@geops/rvf-mobility-web-component 0.1.131 → 0.1.132-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as pf,$a as qf,A as w7,Aa as Pf,Ab as Zt,B as qp,Ba as _o,Bb as Qe,C as S7,Ca as Af,Cb as m3,D as Hp,Da as Mo,Db as Qf,E as $p,Ea as Bf,Eb as tg,F as y5,Fa as wi,Fb as Il,G as f8,Ga as kf,Gb as wo,H as Wp,Ha as D9,Hb as Pl,I as Yp,Ia as Rf,Ib as So,J as Xp,Ja as Df,Jb as eg,K as ho,Ka as V3,Kb as q1,L as K2,La as Si,Lb as zg,M as Kp,Ma as Ti,Mb as q2,N as Jp,Na as Ff,Nb as I,O as fo,Oa as Sl,Ob as c2,P as E6,Pa as F9,Pb as kl,Q as cf,Qa as $e,Qb as Ei,R as L6,Ra as Of,Rb as Io,S as r3,Sa as Tl,Sb as Zg,T as Lf,Ta as Nf,U as uf,Ua as Vf,V as hf,Va as $t,W as Cf,Wa as Gf,X as g8,Xa as Uf,Y as go,Ya as G3,Z as df,Za as zl,_ as He,_a as jf,a as A9,aa as n3,ab as Hf,b as j2,ba as ff,bb as Zl,c as B9,ca as mo,cb as zi,d as oo,da as _i,db as U3,e as wp,ea as xo,eb as $f,f as O3,fa as gf,fb as bo,g as N3,ga as mf,gb as y6,h as W1,ha as xf,hb as We,i as Sp,ia as yf,ib as N6,j as T1,ja as vf,jb as V6,k as Tp,ka as _f,kb as Ye,l as Mt,la as Mf,lb as Xe,m as t2,ma as j8,mb as Wf,n as h5,na as Mi,nb as G6,o as x6,oa as bi,ob as O9,p as Ne,pa as yo,pb as Ke,q as k1,qa as vo,qb as q8,r as ao,ra as bf,rb as Je,s as zp,sa as wf,sb as Yf,t as Zp,ta as Sf,tb as El,u as i3,ua as Tf,ub as Xf,v as gt,va as zf,vb as Kf,w as Q5,wa as Zf,wb as Jf,x as jp,xa as Ef,xb as v6,y as gi,ya as If,yb as _6,z as mi,za as I6,zb as j3}from"./chunk-PTTAXOBA.js";import{a as H8,b as z7,c as Z7}from"./chunk-AOWOBR67.js";import{$a as Tg,A as R9,Aa as sg,B as i6,C as uo,Ca as lg,Da as cg,Ea as Lg,F as Gp,Fa as ug,G as Up,Ga as hg,Ha as Cg,I as U8,Ia as dg,Ja as pg,K as _l,Ka as fg,La as zo,M as Qp,Ma as gg,N as Co,Na as mg,O as tf,Oa as xg,Pa as yg,Q as Z6,Qa as Zo,R as ef,Ra as vg,Ta as Eo,Ua as Al,Va as _g,W as rf,Wa as Mg,X as nf,Xa as bg,Y as of,Ya as wg,Za as Bl,_a as Sg,a as Ep,aa as r6,b as k9,ba as Ml,c as Ip,d as p8,da as xi,e as Ve,ea as qe,f as Ge,fa as af,g as Pp,ga as po,h as Ap,ha as sf,i as G8,ia as bl,j as Ue,ja as yi,k as Bp,ka as vi,l as kp,m as so,n as lo,na as T7,o as Rp,oa as wl,p as Dp,pa as lf,qa as ig,r as Fp,ra as rg,s as Op,sa as ng,t as co,ta as og,u as b7,ua as N9,va as ag,w as je,wa as To,x as Np,xa as Zi,y as Lo,ya as a2,z as Vp}from"./chunk-CZ6RUAVW.js";import{a as Oe,b as yb,c as O6}from"./chunk-5TBO732O.js";var Q3=Oe((KN,hx)=>{var TT="Expected a function",Lx=NaN,zT="[object Symbol]",ZT=/^\s+|\s+$/g,ET=/^[-+]0x[0-9a-f]+$/i,IT=/^0b[01]+$/i,PT=/^0o[0-7]+$/i,AT=parseInt,BT=typeof global=="object"&&global&&global.Object===Object&&global,kT=typeof self=="object"&&self&&self.Object===Object&&self,RT=BT||kT||Function("return this")(),DT=Object.prototype,FT=DT.toString,OT=Math.max,NT=Math.min,uL=function(){return RT.Date.now()};function VT(c,i,s){var u,L,n,y,M,S,E=0,Z=!1,F=!1,G=!0;if(typeof c!="function")throw new TypeError(TT);i=ux(i)||0,hL(s)&&(Z=!!s.leading,F="maxWait"in s,n=F?OT(ux(s.maxWait)||0,i):n,G="trailing"in s?!!s.trailing:G);function j(w1){var z1=u,O1=L;return u=L=void 0,E=w1,y=c.apply(O1,z1),y}function R(w1){return E=w1,M=setTimeout(a1,i),Z?j(w1):y}function r1(w1){var z1=w1-S,O1=w1-E,U1=i-z1;return F?NT(U1,n-O1):U1}function X(w1){var z1=w1-S,O1=w1-E;return S===void 0||z1>=i||z1<0||F&&O1>=n}function a1(){var w1=uL();if(X(w1))return d1(w1);M=setTimeout(a1,r1(w1))}function d1(w1){return M=void 0,G&&u?j(w1):(u=L=void 0,y)}function s1(){M!==void 0&&clearTimeout(M),E=0,u=S=L=M=void 0}function y1(){return M===void 0?y:d1(uL())}function m1(){var w1=uL(),z1=X(w1);if(u=arguments,L=this,S=w1,z1){if(M===void 0)return R(S);if(F)return M=setTimeout(a1,i),j(S)}return M===void 0&&(M=setTimeout(a1,i)),y}return m1.cancel=s1,m1.flush=y1,m1}function hL(c){var i=typeof c;return!!c&&(i=="object"||i=="function")}function GT(c){return!!c&&typeof c=="object"}function UT(c){return typeof c=="symbol"||GT(c)&&FT.call(c)==zT}function ux(c){if(typeof c=="number")return c;if(UT(c))return Lx;if(hL(c)){var i=typeof c.valueOf=="function"?c.valueOf():c;c=hL(i)?i+"":i}if(typeof c!="string")return c===0?c:+c;c=c.replace(ZT,"");var s=IT.test(c);return s||PT.test(c)?AT(c.slice(2),s?2:8):ET.test(c)?Lx:+c}hx.exports=VT});var px=Oe((CL,dL)=>{(function(c,i){typeof CL=="object"&&typeof dL<"u"?dL.exports=i():typeof define=="function"&&define.amd?define(i):(c=typeof globalThis<"u"?globalThis:c||self,c.maplibregl=i())})(CL,(function(){"use strict";var c={},i={};function s(L,n,y){if(i[L]=y,L==="index"){var M="var sharedModule = {}; ("+i.shared+")(sharedModule); ("+i.worker+")(sharedModule);",S={};return i.shared(S),i.index(c,S),typeof window<"u"&&c.setWorkerUrl(window.URL.createObjectURL(new Blob([M],{type:"text/javascript"}))),c}}s("shared",["exports"],(function(L){"use strict";function n(o,t,r,l){return new(r||(r=Promise))((function(h,d){function f(b){try{_(l.next(b))}catch(z){d(z)}}function x(b){try{_(l.throw(b))}catch(z){d(z)}}function _(b){var z;b.done?h(b.value):(z=b.value,z instanceof r?z:new r((function(P){P(z)}))).then(f,x)}_((l=l.apply(o,t||[])).next())}))}function y(o,t){this.x=o,this.y=t}function M(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var S,E;typeof SuppressedError=="function"&&SuppressedError,y.prototype={clone(){return new y(this.x,this.y)},add(o){return this.clone()._add(o)},sub(o){return this.clone()._sub(o)},multByPoint(o){return this.clone()._multByPoint(o)},divByPoint(o){return this.clone()._divByPoint(o)},mult(o){return this.clone()._mult(o)},div(o){return this.clone()._div(o)},rotate(o){return this.clone()._rotate(o)},rotateAround(o,t){return this.clone()._rotateAround(o,t)},matMult(o){return this.clone()._matMult(o)},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(o){return this.x===o.x&&this.y===o.y},dist(o){return Math.sqrt(this.distSqr(o))},distSqr(o){let t=o.x-this.x,r=o.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(o){return Math.atan2(this.y-o.y,this.x-o.x)},angleWith(o){return this.angleWithSep(o.x,o.y)},angleWithSep(o,t){return Math.atan2(this.x*t-this.y*o,this.x*o+this.y*t)},_matMult(o){let t=o[2]*this.x+o[3]*this.y;return this.x=o[0]*this.x+o[1]*this.y,this.y=t,this},_add(o){return this.x+=o.x,this.y+=o.y,this},_sub(o){return this.x-=o.x,this.y-=o.y,this},_mult(o){return this.x*=o,this.y*=o,this},_div(o){return this.x/=o,this.y/=o,this},_multByPoint(o){return this.x*=o.x,this.y*=o.y,this},_divByPoint(o){return this.x/=o.x,this.y/=o.y,this},_unit(){return this._div(this.mag()),this},_perp(){let o=this.y;return this.y=this.x,this.x=-o,this},_rotate(o){let t=Math.cos(o),r=Math.sin(o),l=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=l,this},_rotateAround(o,t){let r=Math.cos(o),l=Math.sin(o),h=t.y+l*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-l*(this.y-t.y),this.y=h,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:y},y.convert=function(o){if(o instanceof y)return o;if(Array.isArray(o))return new y(+o[0],+o[1]);if(o.x!==void 0&&o.y!==void 0)return new y(+o.x,+o.y);throw new Error("Expected [x, y] or {x, y} point format")};var Z=(function(){if(E)return S;function o(t,r,l,h){this.cx=3*t,this.bx=3*(l-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(h-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=l,this.p2y=h}return E=1,S=o,o.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var l=t,h=0;h<8;h++){var d=this.sampleCurveX(l)-t;if(Math.abs(d)<r)return l;var f=this.sampleCurveDerivativeX(l);if(Math.abs(f)<1e-6)break;l-=d/f}var x=0,_=1;for(l=t,h=0;h<20&&(d=this.sampleCurveX(l),!(Math.abs(d-t)<r));h++)t>d?x=l:_=l,l=.5*(_-x)+x;return l},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},S})(),F=M(Z);let G,j;function R(){return G==null&&(G=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),G}function r1(){if(j==null&&(j=!1,R())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let l=0;l<25;l++){let h=4*l;t.fillStyle=`rgb(${h},${h+1},${h+2})`,t.fillRect(l%5,Math.floor(l/5),1,1)}let r=t.getImageData(0,0,5,5).data;for(let l=0;l<100;l++)if(l%4!=3&&r[l]!==l){j=!0;break}}}return j||!1}var X=1e-6,a1=typeof Float32Array<"u"?Float32Array:Array;function d1(){var o=new a1(9);return a1!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[5]=0,o[6]=0,o[7]=0),o[0]=1,o[4]=1,o[8]=1,o}function s1(o){return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function y1(){var o=new a1(3);return a1!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function m1(o){var t=o[0],r=o[1],l=o[2];return Math.sqrt(t*t+r*r+l*l)}function w1(o,t,r){var l=new a1(3);return l[0]=o,l[1]=t,l[2]=r,l}function z1(o,t,r){return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o}function O1(o,t,r){return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o}function U1(o,t,r){var l=t[0],h=t[1],d=t[2],f=r[0],x=r[1],_=r[2];return o[0]=h*_-d*x,o[1]=d*f-l*_,o[2]=l*x-h*f,o}var e2,s2=m1;function N1(o,t,r){var l=t[0],h=t[1],d=t[2],f=t[3];return o[0]=r[0]*l+r[4]*h+r[8]*d+r[12]*f,o[1]=r[1]*l+r[5]*h+r[9]*d+r[13]*f,o[2]=r[2]*l+r[6]*h+r[10]*d+r[14]*f,o[3]=r[3]*l+r[7]*h+r[11]*d+r[15]*f,o}function o2(){var o=new a1(4);return a1!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o[3]=1,o}function p2(o,t,r,l){var h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",d=Math.PI/360;t*=d,l*=d,r*=d;var f=Math.sin(t),x=Math.cos(t),_=Math.sin(r),b=Math.cos(r),z=Math.sin(l),P=Math.cos(l);switch(h){case"xyz":o[0]=f*b*P+x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P-f*_*z;break;case"xzy":o[0]=f*b*P-x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P+f*_*z;break;case"yxz":o[0]=f*b*P+x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P+f*_*z;break;case"yzx":o[0]=f*b*P+x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P-f*_*z;break;case"zxy":o[0]=f*b*P-x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P-f*_*z;break;case"zyx":o[0]=f*b*P-x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P+f*_*z;break;default:throw new Error("Unknown angle order "+h)}return o}function T2(){var o=new a1(2);return a1!=Float32Array&&(o[0]=0,o[1]=0),o}function l2(o,t){var r=new a1(2);return r[0]=o,r[1]=t,r}y1(),e2=new a1(4),a1!=Float32Array&&(e2[0]=0,e2[1]=0,e2[2]=0,e2[3]=0),y1(),w1(1,0,0),w1(0,1,0),o2(),o2(),d1(),T2();let Y1=8192;function f2(o,t,r){return t*(Y1/(o.tileSize*Math.pow(2,r-o.tileID.overscaledZ)))}function b2(o,t){return(o%t+t)%t}function d2(o,t,r){return o*(1-r)+t*r}function R2(o){if(o<=0)return 0;if(o>=1)return 1;let t=o*o,r=t*o;return 4*(o<.5?r:3*(o-t)+r-.75)}function J2(o,t,r,l){let h=new F(o,t,r,l);return d=>h.solve(d)}let v5=J2(.25,.1,.25,1);function F1(o,t,r){return Math.min(r,Math.max(t,o))}function i5(o,t,r){let l=r-t,h=((o-t)%l+l)%l+t;return h===t?r:h}function N2(o,...t){for(let r of t)for(let l in r)o[l]=r[l];return o}let g2=1;function L5(o,t,r){let l={};for(let h in o)l[h]=t.call(this,o[h],h,o);return l}function x5(o,t,r){let l={};for(let h in o)t.call(this,o[h],h,o)&&(l[h]=o[h]);return l}function Q2(o){return Array.isArray(o)?o.map(Q2):typeof o=="object"&&o?L5(o,Q2):o}let Z5={};function U2(o){Z5[o]||(typeof console<"u"&&console.warn(o),Z5[o]=!0)}function m2(o,t,r){return(r.y-o.y)*(t.x-o.x)>(t.y-o.y)*(r.x-o.x)}function o5(o){return typeof WorkerGlobalScope<"u"&&o!==void 0&&o instanceof WorkerGlobalScope}let e5=null;function X2(o){return typeof ImageBitmap<"u"&&o instanceof ImageBitmap}let C5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ht(o,t,r,l,h){return n(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let d=new VideoFrame(o,{timestamp:0});try{let f=d?.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);let x=f.startsWith("BGR"),_=new Uint8ClampedArray(l*h*4);if(yield d.copyTo(_,(function(b,z,P,k,D){let N=4*Math.max(-z,0),U=(Math.max(0,P)-P)*k*4+N,$=4*k,J=Math.max(0,z),L1=Math.max(0,P);return{rect:{x:J,y:L1,width:Math.min(b.width,z+k)-J,height:Math.min(b.height,P+D)-L1},layout:[{offset:U,stride:$}]}})(o,t,r,l,h)),x)for(let b=0;b<_.length;b+=4){let z=_[b];_[b]=_[b+2],_[b+2]=z}return _}finally{d.close()}}))}let R5,d5;function w5(o,t,r,l){return o.addEventListener(t,r,l),{unsubscribe:()=>{o.removeEventListener(t,r,l)}}}function W2(o){return o*Math.PI/180}function u5(o){return o/Math.PI*180}let Y2={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},P5={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},it="AbortError";function E5(){return new Error(it)}let D5={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Vt(o){return D5.REGISTERED_PROTOCOLS[o.substring(0,o.indexOf("://"))]}let U5="global-dispatcher";class F5 extends Error{constructor(t,r,l,h){super(`AJAXError: ${r} (${t}): ${l}`),this.status=t,this.statusText=r,this.url=l,this.body=h}}let lt=()=>o5(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,p1=function(o,t){if(/:\/\//.test(o.url)&&!/^https?:|^file:/.test(o.url)){let l=Vt(o.url);if(l)return l(o,t);if(o5(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:o,targetMapId:U5},t)}if(!(/^file:/.test(r=o.url)||/^file:/.test(lt())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(l,h){return n(this,void 0,void 0,(function*(){let d=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,cache:l.cache,referrer:lt(),signal:h.signal}),f,x;l.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{f=yield fetch(d)}catch(b){throw new F5(0,b.message,l.url,new Blob)}if(!f.ok){let b=yield f.blob();throw new F5(f.status,f.statusText,l.url,b)}x=l.type==="arrayBuffer"||l.type==="image"?f.arrayBuffer():l.type==="json"?f.json():f.text();let _=yield x;if(h.signal.aborted)throw E5();return{data:_,cacheControl:f.headers.get("Cache-Control"),expires:f.headers.get("Expires")}}))})(o,t);if(o5(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:o,mustQueue:!0,targetMapId:U5},t)}var r;return(function(l,h){return new Promise(((d,f)=>{var x;let _=new XMLHttpRequest;_.open(l.method||"GET",l.url,!0),l.type!=="arrayBuffer"&&l.type!=="image"||(_.responseType="arraybuffer");for(let b in l.headers)_.setRequestHeader(b,l.headers[b]);l.type==="json"&&(_.responseType="text",!((x=l.headers)===null||x===void 0)&&x.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=l.credentials==="include",_.onerror=()=>{f(new Error(_.statusText))},_.onload=()=>{if(!h.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let b=_.response;if(l.type==="json")try{b=JSON.parse(_.response)}catch(z){return void f(z)}d({data:b,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{let b=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});f(new F5(_.status,_.statusText,l.url,b))}},h.signal.addEventListener("abort",(()=>{_.abort(),f(E5())})),_.send(l.body)}))})(o,t)};function H(o){if(!o||o.indexOf("://")<=0||o.indexOf("data:image/")===0||o.indexOf("blob:")===0)return!0;let t=new URL(o),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function W(o,t,r){r[o]&&r[o].indexOf(t)!==-1||(r[o]=r[o]||[],r[o].push(t))}function K(o,t,r){if(r&&r[o]){let l=r[o].indexOf(t);l!==-1&&r[o].splice(l,1)}}class l1{constructor(t,r={}){N2(this,r),this.type=t}}class C1 extends l1{constructor(t,r={}){super("error",N2({error:t},r))}}class S1{on(t,r){return this._listeners=this._listeners||{},W(t,r,this._listeners),{unsubscribe:()=>{this.off(t,r)}}}off(t,r){return K(t,r,this._listeners),K(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},W(t,r,this._oneTimeListeners),this):new Promise((l=>this.once(t,l)))}fire(t,r){typeof t=="string"&&(t=new l1(t,r||{}));let l=t.type;if(this.listens(l)){t.target=this;let h=this._listeners&&this._listeners[l]?this._listeners[l].slice():[];for(let x of h)x.call(this,t);let d=this._oneTimeListeners&&this._oneTimeListeners[l]?this._oneTimeListeners[l].slice():[];for(let x of d)K(l,x,this._oneTimeListeners),x.call(this,t);let f=this._eventedParent;f&&(N2(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(t))}else t instanceof C1&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var t1={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"array",value:"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:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{required:!0,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","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},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"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},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:"*",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-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","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"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},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"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"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"}}};let M1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function I1(o,t){let r={};for(let l in o)l!=="ref"&&(r[l]=o[l]);return M1.forEach((l=>{l in t&&(r[l]=t[l])})),r}function R1(o,t){if(Array.isArray(o)){if(!Array.isArray(t)||o.length!==t.length)return!1;for(let r=0;r<o.length;r++)if(!R1(o[r],t[r]))return!1;return!0}if(typeof o=="object"&&o!==null&&t!==null){if(typeof t!="object"||Object.keys(o).length!==Object.keys(t).length)return!1;for(let r in o)if(!R1(o[r],t[r]))return!1;return!0}return o===t}function D1(o,t){o.push(t)}function h2(o,t,r){D1(r,{command:"addSource",args:[o,t[o]]})}function w2(o,t,r){D1(t,{command:"removeSource",args:[o]}),r[o]=!0}function k2(o,t,r,l){w2(o,r,l),h2(o,t,r)}function z5(o,t,r){let l;for(l in o[r])if(Object.prototype.hasOwnProperty.call(o[r],l)&&l!=="data"&&!R1(o[r][l],t[r][l]))return!1;for(l in t[r])if(Object.prototype.hasOwnProperty.call(t[r],l)&&l!=="data"&&!R1(o[r][l],t[r][l]))return!1;return!0}function H2(o,t,r,l,h,d){o=o||{},t=t||{};for(let f in o)Object.prototype.hasOwnProperty.call(o,f)&&(R1(o[f],t[f])||r.push({command:d,args:[l,f,t[f],h]}));for(let f in t)Object.prototype.hasOwnProperty.call(t,f)&&!Object.prototype.hasOwnProperty.call(o,f)&&(R1(o[f],t[f])||r.push({command:d,args:[l,f,t[f],h]}))}function O2(o){return o.id}function _5(o,t){return o[t.id]=t,o}class H1{constructor(t,r,l,h){this.message=(t?`${t}: `:"")+l,h&&(this.identifier=h),r!=null&&r.__line__&&(this.line=r.__line__)}}function p5(o,...t){for(let r of t)for(let l in r)o[l]=r[l];return o}class a5 extends Error{constructor(t,r){super(r),this.message=r,this.key=t}}class I5{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[l,h]of r)this.bindings[l]=h}concat(t){return new I5(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}let f5={kind:"null"},G1={kind:"number"},L2={kind:"string"},_2={kind:"boolean"},Wt={kind:"color"},M8={kind:"projectionDefinition"},It={kind:"object"},V2={kind:"value"},M3={kind:"collator"},a9={kind:"formatted"},s9={kind:"padding"},j6={kind:"colorArray"},b8={kind:"numberArray"},l9={kind:"resolvedImage"},c9={kind:"variableAnchorOffsetCollection"};function b6(o,t){return{kind:"array",itemType:o,N:t}}function O5(o){if(o.kind==="array"){let t=O5(o.itemType);return typeof o.N=="number"?`array<${t}, ${o.N}>`:o.itemType.kind==="value"?"array":`array<${t}>`}return o.kind}let is=[f5,G1,L2,_2,Wt,M8,a9,It,b6(V2),s9,b8,j6,l9,c9];function u3(o,t){if(t.kind==="error")return null;if(o.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!u3(o.itemType,t.itemType))&&(typeof o.N!="number"||o.N===t.N))return null}else{if(o.kind===t.kind)return null;if(o.kind==="value"){for(let r of is)if(!u3(r,t))return null}}return`Expected ${O5(o)} but found ${O5(t)} instead.`}function J9(o,t){return t.some((r=>r.kind===o.kind))}function rt(o,t){return t.some((r=>r==="null"?o===null:r==="array"?Array.isArray(o):r==="object"?o&&!Array.isArray(o)&&typeof o=="object":r===typeof o))}function i8(o,t){return o.kind==="array"&&t.kind==="array"?o.itemType.kind===t.itemType.kind&&typeof o.N=="number":o.kind===t.kind}let J7=.96422,L9=.82521,Q7=4/29,u9=6/29,br=3*u9*u9,wr=u9*u9*u9,rs=Math.PI/180,Sr=180/Math.PI;function Tr(o){return(o%=360)<0&&(o+=360),o}function zr([o,t,r,l]){let h,d,f=e4((.2225045*(o=t4(o))+.7168786*(t=t4(t))+.0606169*(r=t4(r)))/1);o===t&&t===r?h=d=f:(h=e4((.4360747*o+.3850649*t+.1430804*r)/J7),d=e4((.0139322*o+.0971045*t+.7141733*r)/L9));let x=116*f-16;return[x<0?0:x,500*(h-f),200*(f-d),l]}function t4(o){return o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}function e4(o){return o>wr?Math.pow(o,1/3):o/br+Q7}function Zr([o,t,r,l]){let h=(o+16)/116,d=isNaN(t)?h:h+t/500,f=isNaN(r)?h:h-r/200;return h=1*r4(h),d=J7*r4(d),f=L9*r4(f),[i4(3.1338561*d-1.6168667*h-.4906146*f),i4(-.9787684*d+1.9161415*h+.033454*f),i4(.0719453*d-.2289914*h+1.4052427*f),l]}function i4(o){return(o=o<=.00304?12.92*o:1.055*Math.pow(o,1/2.4)-.055)<0?0:o>1?1:o}function r4(o){return o>u9?o*o*o:br*(o-Q7)}let Er=Object.hasOwn||function(o,t){return Object.prototype.hasOwnProperty.call(o,t)};function b3(o,t){return Er(o,t)?o[t]:void 0}function f0(o){return parseInt(o.padEnd(2,o),16)/255}function Ir(o,t){return h3(t?o/100:o,0,1)}function h3(o,t,r){return Math.min(Math.max(t,o),r)}function Pr(o){return!o.some(Number.isNaN)}let ns={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 r8(o,t,r){return o+r*(t-o)}function w8(o,t,r){return o.map(((l,h)=>r8(l,t[h],r)))}class s5{constructor(t,r,l,h=1,d=!0){this.r=t,this.g=r,this.b=l,this.a=h,d||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[t,r,l,h]))}static parse(t){if(t instanceof s5)return t;if(typeof t!="string")return;let r=(function(l){if((l=l.toLowerCase().trim())==="transparent")return[0,0,0,0];let h=b3(ns,l);if(h){let[f,x,_]=h;return[f/255,x/255,_/255,1]}if(l.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(l)){let f=l.length<6?1:2,x=1;return[f0(l.slice(x,x+=f)),f0(l.slice(x,x+=f)),f0(l.slice(x,x+=f)),f0(l.slice(x,x+f)||"ff")]}if(l.startsWith("rgb")){let f=l.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){let[x,_,b,z,P,k,D,N,U,$,J,L1]=f,Q=[z||" ",D||" ",$].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){let n1=[b,k,U].join(""),f1=n1==="%%%"?100:n1===""?255:0;if(f1){let _1=[h3(+_/f1,0,1),h3(+P/f1,0,1),h3(+N/f1,0,1),J?Ir(+J,L1):1];if(Pr(_1))return _1}}return}}let d=l.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){let[f,x,_,b,z,P,k,D,N]=d,U=[_||" ",z||" ",k].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){let $=[+x,h3(+b,0,100),h3(+P,0,100),D?Ir(+D,N):1];if(Pr($))return(function([J,L1,Q,n1]){function f1(_1){let P1=(_1+J/30)%12,$1=L1*Math.min(Q,1-Q);return Q-$1*Math.max(-1,Math.min(P1-3,9-P1,1))}return J=Tr(J),L1/=100,Q/=100,[f1(0),f1(8),f1(4),n1]})($)}}})(t);return r?new s5(...r,!1):void 0}get rgb(){let{r:t,g:r,b:l,a:h}=this,d=h||1/0;return this.overwriteGetter("rgb",[t/d,r/d,l/d,h])}get hcl(){return this.overwriteGetter("hcl",(function(t){let[r,l,h,d]=zr(t),f=Math.sqrt(l*l+h*h);return[Math.round(1e4*f)?Tr(Math.atan2(h,l)*Sr):NaN,f,r,d]})(this.rgb))}get lab(){return this.overwriteGetter("lab",zr(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,l,h]=this.rgb;return`rgba(${[t,r,l].map((d=>Math.round(255*d))).join(",")},${h})`}static interpolate(t,r,l,h="rgb"){switch(h){case"rgb":{let[d,f,x,_]=w8(t.rgb,r.rgb,l);return new s5(d,f,x,_,!1)}case"hcl":{let[d,f,x,_]=t.hcl,[b,z,P,k]=r.hcl,D,N;if(isNaN(d)||isNaN(b))isNaN(d)?isNaN(b)?D=NaN:(D=b,x!==1&&x!==0||(N=z)):(D=d,P!==1&&P!==0||(N=f));else{let Q=b-d;b>d&&Q>180?Q-=360:b<d&&d-b>180&&(Q+=360),D=d+l*Q}let[U,$,J,L1]=(function([Q,n1,f1,_1]){return Q=isNaN(Q)?0:Q*rs,Zr([f1,Math.cos(Q)*n1,Math.sin(Q)*n1,_1])})([D,N??r8(f,z,l),r8(x,P,l),r8(_,k,l)]);return new s5(U,$,J,L1,!1)}case"lab":{let[d,f,x,_]=Zr(w8(t.lab,r.lab,l));return new s5(d,f,x,_,!1)}}}}s5.black=new s5(0,0,0,1),s5.white=new s5(1,1,1,1),s5.transparent=new s5(0,0,0,0),s5.red=new s5(1,0,0,1);class A6{constructor(t,r,l){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=l,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let g5=["bottom","center","top"];class n8{constructor(t,r,l,h,d,f){this.text=t,this.image=r,this.scale=l,this.fontStack=h,this.textColor=d,this.verticalAlign=f}}class mt{constructor(t){this.sections=t}static fromString(t){return new mt([new n8(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((t=>t.text.length!==0||t.image&&t.image.name.length!==0))}static factory(t){return t instanceof mt?t:mt.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map((t=>t.text)).join("")}}class Yt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Yt)return t;if(typeof t=="number")return new Yt([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Yt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){return new Yt(w8(t.values,r.values,l))}}class Xt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Xt)return t;if(typeof t=="number")return new Xt([t]);if(Array.isArray(t)){for(let r of t)if(typeof r!="number")return;return new Xt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){return new Xt(w8(t.values,r.values,l))}}class wt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wt)return t;if(typeof t=="string"){let l=s5.parse(t);return l?new wt([l]):void 0}if(!Array.isArray(t))return;let r=[];for(let l of t){if(typeof l!="string")return;let h=s5.parse(l);if(!h)return;r.push(h)}return new wt(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l,h="rgb"){let d=[];if(t.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let f=0;f<t.values.length;f++)d.push(s5.interpolate(t.values[f],r.values[f],l,h));return new wt(d)}}class N5 extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}let g0=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class o6{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof o6)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r<t.length;r+=2){let l=t[r],h=t[r+1];if(typeof l!="string"||!g0.has(l)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new o6(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){let h=t.values,d=r.values;if(h.length!==d.length)throw new N5(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`);let f=[];for(let x=0;x<h.length;x+=2){if(h[x]!==d[x])throw new N5(`Cannot interpolate values containing mismatched anchors. from[${x}]: ${h[x]}, to[${x}]: ${d[x]}`);f.push(h[x]);let[_,b]=h[x+1],[z,P]=d[x+1];f.push([r8(_,z,l),r8(b,P,l)])}return new o6(f)}}class d6{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new d6({name:t,available:!1}):null}}class Kt{constructor(t,r,l){this.from=t,this.to=r,this.transition=l}static interpolate(t,r,l){return new Kt(t,r,l)}static parse(t){return t instanceof Kt?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new Kt(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new Kt(t.from,t.to,t.transition):typeof t=="string"?new Kt(t,t,1):void 0}}function Ar(o,t,r,l){return typeof o=="number"&&o>=0&&o<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?l===void 0||typeof l=="number"&&l>=0&&l<=1?null:`Invalid rgba value [${[o,t,r,l].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof l=="number"?[o,t,r,l]:[o,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function o8(o){if(o===null||typeof o=="string"||typeof o=="boolean"||typeof o=="number"||o instanceof Kt||o instanceof s5||o instanceof A6||o instanceof mt||o instanceof Yt||o instanceof Xt||o instanceof wt||o instanceof o6||o instanceof d6)return!0;if(Array.isArray(o)){for(let t of o)if(!o8(t))return!1;return!0}if(typeof o=="object"){for(let t in o)if(!o8(o[t]))return!1;return!0}return!1}function j5(o){if(o===null)return f5;if(typeof o=="string")return L2;if(typeof o=="boolean")return _2;if(typeof o=="number")return G1;if(o instanceof s5)return Wt;if(o instanceof Kt)return M8;if(o instanceof A6)return M3;if(o instanceof mt)return a9;if(o instanceof Yt)return s9;if(o instanceof Xt)return b8;if(o instanceof wt)return j6;if(o instanceof o6)return c9;if(o instanceof d6)return l9;if(Array.isArray(o)){let t=o.length,r;for(let l of o){let h=j5(l);if(r){if(r===h)continue;r=V2;break}r=h}return b6(r||V2,t)}return It}function h9(o){let t=typeof o;return o===null?"":t==="string"||t==="number"||t==="boolean"?String(o):o instanceof s5||o instanceof Kt||o instanceof mt||o instanceof Yt||o instanceof Xt||o instanceof wt||o instanceof o6||o instanceof d6?o.toString():JSON.stringify(o)}class a8{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!o8(t[1]))return r.error("invalid value");let l=t[1],h=j5(l),d=r.expectedType;return h.kind!=="array"||h.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(h=d),new a8(h,l)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Q9={string:L2,number:G1,boolean:_2,object:It};class p6{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l,h=1,d=t[0];if(d==="array"){let x,_;if(t.length>2){let b=t[1];if(typeof b!="string"||!(b in Q9)||b==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);x=Q9[b],h++}else x=V2;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],h++}l=b6(x,_)}else{if(!Q9[d])throw new Error(`Types doesn't contain name = ${d}`);l=Q9[d]}let f=[];for(;h<t.length;h++){let x=r.parse(t[h],h,V2);if(!x)return null;f.push(x)}return new p6(l,f)}evaluate(t){for(let r=0;r<this.args.length;r++){let l=this.args[r].evaluate(t);if(!u3(this.type,j5(l)))return l;if(r===this.args.length-1)throw new N5(`Expected value to be of type ${O5(this.type)}, but found ${O5(j5(l))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}let q5={"to-boolean":_2,"to-color":Wt,"to-number":G1,"to-string":L2};class C3{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=t[0];if(!q5[l])throw new Error(`Can't parse ${l} as it is not part of the known types`);if((l==="to-boolean"||l==="to-string")&&t.length!==2)return r.error("Expected one argument.");let h=q5[l],d=[];for(let f=1;f<t.length;f++){let x=r.parse(t[f],f,V2);if(!x)return null;d.push(x)}return new C3(h,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,l;for(let h of this.args){if(r=h.evaluate(t),l=null,r instanceof s5)return r;if(typeof r=="string"){let d=t.parseColor(r);if(d)return d}else if(Array.isArray(r)&&(l=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ar(r[0],r[1],r[2],r[3]),!l))return new s5(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new N5(l||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let l of this.args){r=l.evaluate(t);let h=Yt.parse(r);if(h)return h}throw new N5(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(let l of this.args){r=l.evaluate(t);let h=Xt.parse(r);if(h)return h}throw new N5(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(let l of this.args){r=l.evaluate(t);let h=wt.parse(r);if(h)return h}throw new N5(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let l of this.args){r=l.evaluate(t);let h=o6.parse(r);if(h)return h}throw new N5(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let l of this.args){if(r=l.evaluate(t),r===null)return 0;let h=Number(r);if(!isNaN(h))return h}throw new N5(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return mt.fromString(h9(this.args[0].evaluate(t)));case"resolvedImage":return d6.fromString(h9(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return h9(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}let M5=["Unknown","Point","LineString","Polygon"];class t5{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?M5[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache.get(t);return r||(r=s5.parse(t),this._parseColorCache.set(t,r)),r}}class C9{constructor(t,r,l=[],h,d=new I5,f=[]){this.registry=t,this.path=l,this.key=l.map((x=>`[${x}]`)).join(""),this.scope=d,this.errors=f,this.expectedType=h,this._isConstant=r}parse(t,r,l,h,d={}){return r?this.concat(r,l,h)._parse(t,d):this._parse(t,d)}_parse(t,r){function l(h,d,f){return f==="assert"?new p6(d,[h]):f==="coerce"?new C3(d,[h]):h}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let h=t[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let d=this.registry[h];if(d){let f=d.parse(t,this);if(!f)return null;if(this.expectedType){let x=this.expectedType,_=f.type;if(x.kind!=="string"&&x.kind!=="number"&&x.kind!=="boolean"&&x.kind!=="object"&&x.kind!=="array"||_.kind!=="value"){if(x.kind==="projectionDefinition"&&["string","array"].includes(_.kind)||["color","formatted","resolvedImage"].includes(x.kind)&&["value","string"].includes(_.kind)||["padding","numberArray"].includes(x.kind)&&["value","number","array"].includes(_.kind)||x.kind==="colorArray"&&["value","string","array"].includes(_.kind)||x.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(_.kind))f=l(f,x,r.typeAnnotation||"coerce");else if(this.checkSubtype(x,_))return null}else f=l(f,x,r.typeAnnotation||"assert")}if(!(f instanceof a8)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){let x=new t5;try{f=new a8(f.type,f.evaluate(x))}catch(_){return this.error(_.message),null}}return f}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,l){let h=typeof t=="number"?this.path.concat(t):this.path,d=l?this.scope.concat(l):this.scope;return new C9(this.registry,this._isConstant,h,r||null,d,this.errors)}error(t,...r){let l=`${this.key}${r.map((h=>`[${h}]`)).join("")}`;this.errors.push(new a5(l,t))}checkSubtype(t,r){let l=u3(t,r);return l&&this.error(l),l}}class m5{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let l=[];for(let d=1;d<t.length-1;d+=2){let f=t[d];if(typeof f!="string")return r.error(`Expected string, but found ${typeof f} instead.`,d);if(/[^a-zA-Z0-9_]/.test(f))return r.error("Variable names must contain only alphanumeric characters or '_'.",d);let x=r.parse(t[d+1],d+1);if(!x)return null;l.push([f,x])}let h=r.parse(t[t.length-1],t.length-1,r.expectedType,l);return h?new m5(l,h):null}outputDefined(){return this.result.outputDefined()}}class d9{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let l=t[1];return r.scope.has(l)?new d9(l,r.scope.get(l)):r.error(`Unknown variable "${l}". Make sure "${l}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class q6{constructor(t,r,l){this.type=t,this.index=r,this.input=l}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let l=r.parse(t[1],1,G1),h=r.parse(t[2],2,b6(r.expectedType||V2));return l&&h?new q6(h.type.itemType,l,h):null}evaluate(t){let r=this.index.evaluate(t),l=this.input.evaluate(t);if(r<0)throw new N5(`Array index out of bounds: ${r} < 0.`);if(r>=l.length)throw new N5(`Array index out of bounds: ${r} > ${l.length-1}.`);if(r!==Math.floor(r))throw new N5(`Array index must be an integer, but found ${r} instead.`);return l[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class te{constructor(t,r){this.type=_2,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let l=r.parse(t[1],1,V2),h=r.parse(t[2],2,V2);return l&&h?J9(l.type,[_2,L2,G1,f5,V2])?new te(l,h):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${O5(l.type)} instead`):null}evaluate(t){let r=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!l)return!1;if(!rt(r,["boolean","string","number","null"]))throw new N5(`Expected first argument to be of type boolean, string, number or null, but found ${O5(j5(r))} instead.`);if(!rt(l,["string","array"]))throw new N5(`Expected second argument to be of type array or string, but found ${O5(j5(l))} instead.`);return l.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class S8{constructor(t,r,l){this.type=G1,this.needle=t,this.haystack=r,this.fromIndex=l}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 l=r.parse(t[1],1,V2),h=r.parse(t[2],2,V2);if(!l||!h)return null;if(!J9(l.type,[_2,L2,G1,f5,V2]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${O5(l.type)} instead`);if(t.length===4){let d=r.parse(t[3],3,G1);return d?new S8(l,h,d):null}return new S8(l,h)}evaluate(t){let r=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!rt(r,["boolean","string","number","null"]))throw new N5(`Expected first argument to be of type boolean, string, number or null, but found ${O5(j5(r))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(t)),rt(l,["string"])){let d=l.indexOf(r,h);return d===-1?-1:[...l.slice(0,d)].length}if(rt(l,["array"]))return l.indexOf(r,h);throw new N5(`Expected second argument to be of type array or string, but found ${O5(j5(l))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class m0{constructor(t,r,l,h,d,f){this.inputType=t,this.type=r,this.input=l,this.cases=h,this.outputs=d,this.otherwise=f}static parse(t,r){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.");let l,h;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);let d={},f=[];for(let b=2;b<t.length-1;b+=2){let z=t[b],P=t[b+1];Array.isArray(z)||(z=[z]);let k=r.concat(b);if(z.length===0)return k.error("Expected at least one branch label.");for(let N of z){if(typeof N!="number"&&typeof N!="string")return k.error("Branch labels must be numbers or strings.");if(typeof N=="number"&&Math.abs(N)>Number.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return k.error("Numeric branch labels must be integer values.");if(l){if(k.checkSubtype(l,j5(N)))return null}else l=j5(N);if(d[String(N)]!==void 0)return k.error("Branch labels must be unique.");d[String(N)]=f.length}let D=r.parse(P,b,h);if(!D)return null;h=h||D.type,f.push(D)}let x=r.parse(t[1],1,V2);if(!x)return null;let _=r.parse(t[t.length-1],t.length-1,h);return _?x.type.kind!=="value"&&r.concat(1).checkSubtype(l,x.type)?null:new m0(l,h,x,d,f,_):null}evaluate(t){let r=this.input.evaluate(t);return(j5(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class ee{constructor(t,r,l){this.type=t,this.branches=r,this.otherwise=l}static parse(t,r){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.");let l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);let h=[];for(let f=1;f<t.length-1;f+=2){let x=r.parse(t[f],f,_2);if(!x)return null;let _=r.parse(t[f+1],f+1,l);if(!_)return null;h.push([x,_]),l=l||_.type}let d=r.parse(t[t.length-1],t.length-1,l);if(!d)return null;if(!l)throw new Error("Can't infer output type");return new ee(l,h,d)}evaluate(t){for(let[r,l]of this.branches)if(r.evaluate(t))return l.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,l]of this.branches)t(r),t(l);t(this.otherwise)}outputDefined(){return this.branches.every((([t,r])=>r.outputDefined()))&&this.otherwise.outputDefined()}}class ie{constructor(t,r,l,h){this.type=t,this.input=r,this.beginIndex=l,this.endIndex=h}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 l=r.parse(t[1],1,V2),h=r.parse(t[2],2,G1);if(!l||!h)return null;if(!J9(l.type,[b6(V2),L2,V2]))return r.error(`Expected first argument to be of type array or string, but found ${O5(l.type)} instead`);if(t.length===4){let d=r.parse(t[3],3,G1);return d?new ie(l.type,l,h,d):null}return new ie(l.type,l,h)}evaluate(t){let r=this.input.evaluate(t),l=this.beginIndex.evaluate(t),h;if(this.endIndex&&(h=this.endIndex.evaluate(t)),rt(r,["string"]))return[...r].slice(l,h).join("");if(rt(r,["array"]))return r.slice(l,h);throw new N5(`Expected first argument to be of type array or string, but found ${O5(j5(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function x0(o,t){let r=o.length-1,l,h,d=0,f=r,x=0;for(;d<=f;)if(x=Math.floor((d+f)/2),l=o[x],h=o[x+1],l<=t){if(x===r||t<h)return x;d=x+1}else{if(!(l>t))throw new N5("Input is not a number.");f=x-1}return 0}class p9{constructor(t,r,l){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(let[h,d]of l)this.labels.push(h),this.outputs.push(d)}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 l=r.parse(t[1],1,G1);if(!l)return null;let h=[],d=null;r.expectedType&&r.expectedType.kind!=="value"&&(d=r.expectedType);for(let f=1;f<t.length;f+=2){let x=f===1?-1/0:t[f],_=t[f+1],b=f,z=f+1;if(typeof x!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',b);if(h.length&&h[h.length-1][0]>=x)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);let P=r.parse(_,z,d);if(!P)return null;d=d||P.type,h.push([x,P])}return new p9(d,l,h)}evaluate(t){let r=this.labels,l=this.outputs;if(r.length===1)return l[0].evaluate(t);let h=this.input.evaluate(t);if(h<=r[0])return l[0].evaluate(t);let d=r.length;return h>=r[d-1]?l[d-1].evaluate(t):l[x0(r,h)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Br(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var d3,Gt,y0=(function(){if(Gt)return d3;function o(t,r,l,h){this.cx=3*t,this.bx=3*(l-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(h-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=l,this.p2y=h}return Gt=1,d3=o,o.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var l=t,h=0;h<8;h++){var d=this.sampleCurveX(l)-t;if(Math.abs(d)<r)return l;var f=this.sampleCurveDerivativeX(l);if(Math.abs(f)<1e-6)break;l-=d/f}var x=0,_=1;for(l=t,h=0;h<20&&(d=this.sampleCurveX(l),!(Math.abs(d-t)<r));h++)t>d?x=l:_=l,l=.5*(_-x)+x;return l},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},d3})(),kr=Br(y0);class Ut{constructor(t,r,l,h,d){this.type=t,this.operator=r,this.interpolation=l,this.input=h,this.labels=[],this.outputs=[];for(let[f,x]of d)this.labels.push(f),this.outputs.push(x)}static interpolationFactor(t,r,l,h){let d=0;if(t.name==="exponential")d=xt(r,t.base,l,h);else if(t.name==="linear")d=xt(r,1,l,h);else if(t.name==="cubic-bezier"){let f=t.controlPoints;d=new kr(f[0],f[1],f[2],f[3]).solve(xt(r,1,l,h))}return d}static parse(t,r){let[l,h,d,...f]=t;if(!Array.isArray(h)||h.length===0)return r.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){let b=h[1];if(typeof b!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:b}}else{if(h[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(h[0])}`,1,0);{let b=h.slice(1);if(b.length!==4||b.some((z=>typeof z!="number"||z<0||z>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:b}}}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(d=r.parse(d,2,G1),!d)return null;let x=[],_=null;l!=="interpolate-hcl"&&l!=="interpolate-lab"||r.expectedType==j6?r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType):_=Wt;for(let b=0;b<f.length;b+=2){let z=f[b],P=f[b+1],k=b+3,D=b+4;if(typeof z!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(x.length&&x[x.length-1][0]>=z)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);let N=r.parse(P,D,_);if(!N)return null;_=_||N.type,x.push([z,N])}return i8(_,G1)||i8(_,M8)||i8(_,Wt)||i8(_,s9)||i8(_,b8)||i8(_,j6)||i8(_,c9)||i8(_,b6(G1))?new Ut(_,l,h,d,x):r.error(`Type ${O5(_)} is not interpolatable.`)}evaluate(t){let r=this.labels,l=this.outputs;if(r.length===1)return l[0].evaluate(t);let h=this.input.evaluate(t);if(h<=r[0])return l[0].evaluate(t);let d=r.length;if(h>=r[d-1])return l[d-1].evaluate(t);let f=x0(r,h),x=Ut.interpolationFactor(this.interpolation,h,r[f],r[f+1]),_=l[f].evaluate(t),b=l[f+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return r8(_,b,x);case"color":return s5.interpolate(_,b,x);case"padding":return Yt.interpolate(_,b,x);case"colorArray":return wt.interpolate(_,b,x);case"numberArray":return Xt.interpolate(_,b,x);case"variableAnchorOffsetCollection":return o6.interpolate(_,b,x);case"array":return w8(_,b,x);case"projectionDefinition":return Kt.interpolate(_,b,x)}case"interpolate-hcl":switch(this.type.kind){case"color":return s5.interpolate(_,b,x,"hcl");case"colorArray":return wt.interpolate(_,b,x,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return s5.interpolate(_,b,x,"lab");case"colorArray":return wt.interpolate(_,b,x,"lab")}}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function xt(o,t,r,l){let h=l-r,d=o-r;return h===0?0:t===1?d/h:(Math.pow(t,d)-1)/(Math.pow(t,h)-1)}let H6={color:s5.interpolate,number:r8,padding:Yt.interpolate,numberArray:Xt.interpolate,colorArray:wt.interpolate,variableAnchorOffsetCollection:o6.interpolate,array:w8};class f9{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=null,h=r.expectedType;h&&h.kind!=="value"&&(l=h);let d=[];for(let x of t.slice(1)){let _=r.parse(x,1+d.length,l,void 0,{typeAnnotation:"omit"});if(!_)return null;l=l||_.type,d.push(_)}if(!l)throw new Error("No output type");let f=h&&d.some((x=>u3(h,x.type)));return new f9(f?V2:l,d)}evaluate(t){let r,l=null,h=0;for(let d of this.args)if(h++,l=d.evaluate(t),l&&l instanceof d6&&!l.available&&(r||(r=l.name),l=null,h===this.args.length&&(l=r)),l!==null)break;return l}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function n4(o,t){return o==="=="||o==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Rr(o,t,r,l){return l.compare(t,r)===0}function $6(o,t,r){let l=o!=="=="&&o!=="!=";return class dx{constructor(d,f,x){this.type=_2,this.lhs=d,this.rhs=f,this.collator=x,this.hasUntypedArgument=d.type.kind==="value"||f.type.kind==="value"}static parse(d,f){if(d.length!==3&&d.length!==4)return f.error("Expected two or three arguments.");let x=d[0],_=f.parse(d[1],1,V2);if(!_)return null;if(!n4(x,_.type))return f.concat(1).error(`"${x}" comparisons are not supported for type '${O5(_.type)}'.`);let b=f.parse(d[2],2,V2);if(!b)return null;if(!n4(x,b.type))return f.concat(2).error(`"${x}" comparisons are not supported for type '${O5(b.type)}'.`);if(_.type.kind!==b.type.kind&&_.type.kind!=="value"&&b.type.kind!=="value")return f.error(`Cannot compare types '${O5(_.type)}' and '${O5(b.type)}'.`);l&&(_.type.kind==="value"&&b.type.kind!=="value"?_=new p6(b.type,[_]):_.type.kind!=="value"&&b.type.kind==="value"&&(b=new p6(_.type,[b])));let z=null;if(d.length===4){if(_.type.kind!=="string"&&b.type.kind!=="string"&&_.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(z=f.parse(d[3],3,M3),!z)return null}return new dx(_,b,z)}evaluate(d){let f=this.lhs.evaluate(d),x=this.rhs.evaluate(d);if(l&&this.hasUntypedArgument){let _=j5(f),b=j5(x);if(_.kind!==b.kind||_.kind!=="string"&&_.kind!=="number")throw new N5(`Expected arguments for "${o}" to be (string, string) or (number, number), but found (${_.kind}, ${b.kind}) instead.`)}if(this.collator&&!l&&this.hasUntypedArgument){let _=j5(f),b=j5(x);if(_.kind!=="string"||b.kind!=="string")return t(d,f,x)}return this.collator?r(d,f,x,this.collator.evaluate(d)):t(d,f,x)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}let v0=$6("==",(function(o,t,r){return t===r}),Rr),o4=$6("!=",(function(o,t,r){return t!==r}),(function(o,t,r,l){return!Rr(0,t,r,l)})),os=$6("<",(function(o,t,r){return t<r}),(function(o,t,r,l){return l.compare(t,r)<0})),Dr=$6(">",(function(o,t,r){return t>r}),(function(o,t,r,l){return l.compare(t,r)>0})),_0=$6("<=",(function(o,t,r){return t<=r}),(function(o,t,r,l){return l.compare(t,r)<=0})),M0=$6(">=",(function(o,t,r){return t>=r}),(function(o,t,r,l){return l.compare(t,r)>=0}));class f6{constructor(t,r,l){this.type=M3,this.locale=l,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let l=t[1];if(typeof l!="object"||Array.isArray(l))return r.error("Collator options argument must be an object.");let h=r.parse(l["case-sensitive"]!==void 0&&l["case-sensitive"],1,_2);if(!h)return null;let d=r.parse(l["diacritic-sensitive"]!==void 0&&l["diacritic-sensitive"],1,_2);if(!d)return null;let f=null;return l.locale&&(f=r.parse(l.locale,1,L2),!f)?null:new f6(h,d,f)}evaluate(t){return new A6(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class b0{constructor(t,r,l,h,d){this.type=L2,this.number=t,this.locale=r,this.currency=l,this.minFractionDigits=h,this.maxFractionDigits=d}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let l=r.parse(t[1],1,G1);if(!l)return null;let h=t[2];if(typeof h!="object"||Array.isArray(h))return r.error("NumberFormat options argument must be an object.");let d=null;if(h.locale&&(d=r.parse(h.locale,1,L2),!d))return null;let f=null;if(h.currency&&(f=r.parse(h.currency,1,L2),!f))return null;let x=null;if(h["min-fraction-digits"]&&(x=r.parse(h["min-fraction-digits"],1,G1),!x))return null;let _=null;return h["max-fraction-digits"]&&(_=r.parse(h["max-fraction-digits"],1,G1),!_)?null:new b0(l,d,f,x,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class T8{constructor(t){this.type=a9,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=t[1];if(!Array.isArray(l)&&typeof l=="object")return r.error("First argument must be an image or text section.");let h=[],d=!1;for(let f=1;f<=t.length-1;++f){let x=t[f];if(d&&typeof x=="object"&&!Array.isArray(x)){d=!1;let _=null;if(x["font-scale"]&&(_=r.parse(x["font-scale"],1,G1),!_))return null;let b=null;if(x["text-font"]&&(b=r.parse(x["text-font"],1,b6(L2)),!b))return null;let z=null;if(x["text-color"]&&(z=r.parse(x["text-color"],1,Wt),!z))return null;let P=null;if(x["vertical-align"]){if(typeof x["vertical-align"]=="string"&&!g5.includes(x["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${x["vertical-align"]}' instead.`);if(P=r.parse(x["vertical-align"],1,L2),!P)return null}let k=h[h.length-1];k.scale=_,k.font=b,k.textColor=z,k.verticalAlign=P}else{let _=r.parse(t[f],1,V2);if(!_)return null;let b=_.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,h.push({content:_,scale:null,font:null,textColor:null,verticalAlign:null})}}return new T8(h)}evaluate(t){return new mt(this.sections.map((r=>{let l=r.content.evaluate(t);return j5(l)===l9?new n8("",l,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new n8(h9(l),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)})))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}}class a4{constructor(t){this.type=l9,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let l=r.parse(t[1],1,L2);return l?new a4(l):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),l=d6.fromString(r);return l&&t.availableImages&&(l.available=t.availableImages.indexOf(r)>-1),l}eachChild(t){t(this.input)}outputDefined(){return!1}}class re{constructor(t){this.type=G1,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let l=r.parse(t[1],1);return l?l.type.kind!=="array"&&l.type.kind!=="string"&&l.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${O5(l.type)} instead.`):new re(l):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new N5(`Expected value to be of type string or array, but found ${O5(j5(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let p3=8192;function as(o,t){let r=(180+o[0])/360,l=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o[1]*Math.PI/360)))/360,h=Math.pow(2,t.z);return[Math.round(r*h*p3),Math.round(l*h*p3)]}function s4(o,t){let r=Math.pow(2,t.z);return[(h=(o[0]/p3+t.x)/r,360*h-180),(l=(o[1]/p3+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90)];var l,h}function ne(o,t){o[0]=Math.min(o[0],t[0]),o[1]=Math.min(o[1],t[1]),o[2]=Math.max(o[2],t[0]),o[3]=Math.max(o[3],t[1])}function s8(o,t){return!(o[0]<=t[0]||o[2]>=t[2]||o[1]<=t[1]||o[3]>=t[3])}function ss(o,t,r){let l=o[0]-t[0],h=o[1]-t[1],d=o[0]-r[0],f=o[1]-r[1];return l*f-d*h==0&&l*d<=0&&h*f<=0}function oe(o,t,r,l){return(h=[l[0]-r[0],l[1]-r[1]])[0]*(d=[t[0]-o[0],t[1]-o[1]])[1]-h[1]*d[0]!=0&&!(!Vr(o,t,r,l)||!Vr(r,l,o,t));var h,d}function Fr(o,t,r){for(let l of r)for(let h=0;h<l.length-1;++h)if(oe(o,t,l[h],l[h+1]))return!0;return!1}function g9(o,t,r=!1){let l=!1;for(let x of t)for(let _=0;_<x.length-1;_++){if(ss(o,x[_],x[_+1]))return r;(d=x[_])[1]>(h=o)[1]!=(f=x[_+1])[1]>h[1]&&h[0]<(f[0]-d[0])*(h[1]-d[1])/(f[1]-d[1])+d[0]&&(l=!l)}var h,d,f;return l}function Or(o,t){for(let r of t)if(g9(o,r))return!0;return!1}function Nr(o,t){for(let r of o)if(!g9(r,t))return!1;for(let r=0;r<o.length-1;++r)if(Fr(o[r],o[r+1],t))return!1;return!0}function ls(o,t){for(let r of t)if(Nr(o,r))return!0;return!1}function Vr(o,t,r,l){let h=l[0]-r[0],d=l[1]-r[1],f=(o[0]-r[0])*d-h*(o[1]-r[1]),x=(t[0]-r[0])*d-h*(t[1]-r[1]);return f>0&&x<0||f<0&&x>0}function l4(o,t,r){let l=[];for(let h=0;h<o.length;h++){let d=[];for(let f=0;f<o[h].length;f++){let x=as(o[h][f],r);ne(t,x),d.push(x)}l.push(d)}return l}function Gr(o,t,r){let l=[];for(let h=0;h<o.length;h++){let d=l4(o[h],t,r);l.push(d)}return l}function c4(o,t,r,l){if(o[0]<r[0]||o[0]>r[2]){let h=.5*l,d=o[0]-r[0]>h?-l:r[0]-o[0]>h?l:0;d===0&&(d=o[0]-r[2]>h?-l:r[2]-o[0]>h?l:0),o[0]+=d}ne(t,o)}function L4(o,t,r,l){let h=Math.pow(2,l.z)*p3,d=[l.x*p3,l.y*p3],f=[];for(let x of o)for(let _ of x){let b=[_.x+d[0],_.y+d[1]];c4(b,t,r,h),f.push(b)}return f}function u4(o,t,r,l){let h=Math.pow(2,l.z)*p3,d=[l.x*p3,l.y*p3],f=[];for(let _ of o){let b=[];for(let z of _){let P=[z.x+d[0],z.y+d[1]];ne(t,P),b.push(P)}f.push(b)}if(t[2]-t[0]<=h/2){(x=t)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(let _ of f)for(let b of _)c4(b,t,r,h)}var x;return f}class z8{constructor(t,r){this.type=_2,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(o8(t[1])){let l=t[1];if(l.type==="FeatureCollection"){let h=[];for(let d of l.features){let{type:f,coordinates:x}=d.geometry;f==="Polygon"&&h.push(x),f==="MultiPolygon"&&h.push(...x)}if(h.length)return new z8(l,{type:"MultiPolygon",coordinates:h})}else if(l.type==="Feature"){let h=l.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new z8(l,l.geometry)}else if(l.type==="Polygon"||l.type==="MultiPolygon")return new z8(l,l)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,l){let h=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(l.type==="Polygon"){let x=l4(l.coordinates,d,f),_=L4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!g9(b,x))return!1}if(l.type==="MultiPolygon"){let x=Gr(l.coordinates,d,f),_=L4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!Or(b,x))return!1}return!0})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,l){let h=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(l.type==="Polygon"){let x=l4(l.coordinates,d,f),_=u4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!Nr(b,x))return!1}if(l.type==="MultiPolygon"){let x=Gr(l.coordinates,d,f),_=u4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!ls(b,x))return!1}return!0})(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ur=class{constructor(o=[],t=(r,l)=>r<l?-1:r>l?1:0){if(this.data=o,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(o){this.data.push(o),this._up(this.length++)}pop(){if(this.length===0)return;let o=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),o}peek(){return this.data[0]}_up(o){let{data:t,compare:r}=this,l=t[o];for(;o>0;){let h=o-1>>1,d=t[h];if(r(l,d)>=0)break;t[o]=d,o=h}t[o]=l}_down(o){let{data:t,compare:r}=this,l=this.length>>1,h=t[o];for(;o<l;){let d=1+(o<<1),f=d+1;if(f<this.length&&r(t[f],t[d])<0&&(d=f),r(t[d],h)>=0)break;t[o]=t[d],o=d}t[o]=h}};function jr(o,t,r=0,l=o.length-1,h=w0){for(;l>r;){if(l-r>600){let _=l-r+1,b=t-r+1,z=Math.log(_),P=.5*Math.exp(2*z/3),k=.5*Math.sqrt(z*P*(_-P)/_)*(b-_/2<0?-1:1);jr(o,t,Math.max(r,Math.floor(t-b*P/_+k)),Math.min(l,Math.floor(t+(_-b)*P/_+k)),h)}let d=o[t],f=r,x=l;for(ae(o,r,t),h(o[l],d)>0&&ae(o,r,l);f<x;){for(ae(o,f,x),f++,x--;h(o[f],d)<0;)f++;for(;h(o[x],d)>0;)x--}h(o[r],d)===0?ae(o,r,x):(x++,ae(o,x,l)),x<=t&&(r=x+1),t<=x&&(l=x-1)}}function ae(o,t,r){let l=o[t];o[t]=o[r],o[r]=l}function w0(o,t){return o<t?-1:o>t?1:0}function se(o,t){if(o.length<=1)return[o];let r=[],l,h;for(let d of o){let f=Ls(d);f!==0&&(d.area=Math.abs(f),h===void 0&&(h=f<0),h===f<0?(l&&r.push(l),l=[d]):l.push(d))}if(l&&r.push(l),t>1)for(let d=0;d<r.length;d++)r[d].length<=t||(jr(r[d],t,1,r[d].length-1,cs),r[d]=r[d].slice(0,t));return r}function cs(o,t){return t.area-o.area}function Ls(o){let t=0;for(let r,l,h=0,d=o.length,f=d-1;h<d;f=h++)r=o[h],l=o[f],t+=(l.x-r.x)*(r.y+l.y);return t}let qr=1/298.257223563,S0=qr*(2-qr),h4=Math.PI/180;class C4{constructor(t){let r=6378.137*h4*1e3,l=Math.cos(t*h4),h=1/(1-S0*(1-l*l)),d=Math.sqrt(h);this.kx=r*d*l,this.ky=r*d*h*(1-S0)}distance(t,r){let l=this.wrap(t[0]-r[0])*this.kx,h=(t[1]-r[1])*this.ky;return Math.sqrt(l*l+h*h)}pointOnLine(t,r){let l,h,d,f,x=1/0;for(let _=0;_<t.length-1;_++){let b=t[_][0],z=t[_][1],P=this.wrap(t[_+1][0]-b)*this.kx,k=(t[_+1][1]-z)*this.ky,D=0;P===0&&k===0||(D=(this.wrap(r[0]-b)*this.kx*P+(r[1]-z)*this.ky*k)/(P*P+k*k),D>1?(b=t[_+1][0],z=t[_+1][1]):D>0&&(b+=P/this.kx*D,z+=k/this.ky*D)),P=this.wrap(r[0]-b)*this.kx,k=(r[1]-z)*this.ky;let N=P*P+k*k;N<x&&(x=N,l=b,h=z,d=_,f=D)}return{point:[l,h],index:d,t:Math.max(0,Math.min(1,f))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Hr(o,t){return t[0]-o[0]}function le(o){return o[1]-o[0]+1}function f3(o,t){return o[1]>=o[0]&&o[1]<t}function d4(o,t){if(o[0]>o[1])return[null,null];let r=le(o);if(t){if(r===2)return[o,null];let h=Math.floor(r/2);return[[o[0],o[0]+h],[o[0]+h,o[1]]]}if(r===1)return[o,null];let l=Math.floor(r/2)-1;return[[o[0],o[0]+l],[o[0]+l+1,o[1]]]}function p4(o,t){if(!f3(t,o.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let l=t[0];l<=t[1];++l)ne(r,o[l]);return r}function f4(o){let t=[1/0,1/0,-1/0,-1/0];for(let r of o)for(let l of r)ne(t,l);return t}function g4(o){return o[0]!==-1/0&&o[1]!==-1/0&&o[2]!==1/0&&o[3]!==1/0}function m4(o,t,r){if(!g4(o)||!g4(t))return NaN;let l=0,h=0;return o[2]<t[0]&&(l=t[0]-o[2]),o[0]>t[2]&&(l=o[0]-t[2]),o[1]>t[3]&&(h=o[1]-t[3]),o[3]<t[1]&&(h=t[1]-o[3]),r.distance([0,0],[l,h])}function Z8(o,t,r){let l=r.pointOnLine(t,o);return r.distance(o,l.point)}function x4(o,t,r,l,h){let d=Math.min(Z8(o,[r,l],h),Z8(t,[r,l],h)),f=Math.min(Z8(r,[o,t],h),Z8(l,[o,t],h));return Math.min(d,f)}function us(o,t,r,l,h){if(!f3(t,o.length)||!f3(l,r.length))return 1/0;let d=1/0;for(let f=t[0];f<t[1];++f){let x=o[f],_=o[f+1];for(let b=l[0];b<l[1];++b){let z=r[b],P=r[b+1];if(oe(x,_,z,P))return 0;d=Math.min(d,x4(x,_,z,P,h))}}return d}function S5(o,t,r,l,h){if(!f3(t,o.length)||!f3(l,r.length))return NaN;let d=1/0;for(let f=t[0];f<=t[1];++f)for(let x=l[0];x<=l[1];++x)if(d=Math.min(d,h.distance(o[f],r[x])),d===0)return d;return d}function hs(o,t,r){if(g9(o,t,!0))return 0;let l=1/0;for(let h of t){let d=h[0],f=h[h.length-1];if(d!==f&&(l=Math.min(l,Z8(o,[f,d],r)),l===0))return l;let x=r.pointOnLine(h,o);if(l=Math.min(l,r.distance(o,x.point)),l===0)return l}return l}function Cs(o,t,r,l){if(!f3(t,o.length))return NaN;for(let d=t[0];d<=t[1];++d)if(g9(o[d],r,!0))return 0;let h=1/0;for(let d=t[0];d<t[1];++d){let f=o[d],x=o[d+1];for(let _ of r)for(let b=0,z=_.length,P=z-1;b<z;P=b++){let k=_[P],D=_[b];if(oe(f,x,k,D))return 0;h=Math.min(h,x4(f,x,k,D,l))}}return h}function $r(o,t){for(let r of o)for(let l of r)if(g9(l,t,!0))return!0;return!1}function ds(o,t,r,l=1/0){let h=f4(o),d=f4(t);if(l!==1/0&&m4(h,d,r)>=l)return l;if(s8(h,d)){if($r(o,t))return 0}else if($r(t,o))return 0;let f=1/0;for(let x of o)for(let _=0,b=x.length,z=b-1;_<b;z=_++){let P=x[z],k=x[_];for(let D of t)for(let N=0,U=D.length,$=U-1;N<U;$=N++){let J=D[$],L1=D[N];if(oe(P,k,J,L1))return 0;f=Math.min(f,x4(P,k,J,L1,r))}}return f}function Wr(o,t,r,l,h,d){if(!d)return;let f=m4(p4(l,d),h,r);f<t&&o.push([f,d,[0,0]])}function T0(o,t,r,l,h,d,f){if(!d||!f)return;let x=m4(p4(l,d),p4(h,f),r);x<t&&o.push([x,d,f])}function z0(o,t,r,l,h=1/0){let d=Math.min(l.distance(o[0],r[0][0]),h);if(d===0)return d;let f=new Ur([[0,[0,o.length-1],[0,0]]],Hr),x=f4(r);for(;f.length>0;){let _=f.pop();if(_[0]>=d)continue;let b=_[1],z=t?50:100;if(le(b)<=z){if(!f3(b,o.length))return NaN;if(t){let P=Cs(o,b,r,l);if(isNaN(P)||P===0)return P;d=Math.min(d,P)}else for(let P=b[0];P<=b[1];++P){let k=hs(o[P],r,l);if(d=Math.min(d,k),d===0)return 0}}else{let P=d4(b,t);Wr(f,d,l,o,x,P[0]),Wr(f,d,l,o,x,P[1])}}return d}function Z0(o,t,r,l,h,d=1/0){let f=Math.min(d,h.distance(o[0],r[0]));if(f===0)return f;let x=new Ur([[0,[0,o.length-1],[0,r.length-1]]],Hr);for(;x.length>0;){let _=x.pop();if(_[0]>=f)continue;let b=_[1],z=_[2],P=t?50:100,k=l?50:100;if(le(b)<=P&&le(z)<=k){if(!f3(b,o.length)&&f3(z,r.length))return NaN;let D;if(t&&l)D=us(o,b,r,z,h),f=Math.min(f,D);else if(t&&!l){let N=o.slice(b[0],b[1]+1);for(let U=z[0];U<=z[1];++U)if(D=Z8(r[U],N,h),f=Math.min(f,D),f===0)return f}else if(!t&&l){let N=r.slice(z[0],z[1]+1);for(let U=b[0];U<=b[1];++U)if(D=Z8(o[U],N,h),f=Math.min(f,D),f===0)return f}else D=S5(o,b,r,z,h),f=Math.min(f,D)}else{let D=d4(b,t),N=d4(z,l);T0(x,f,h,o,r,D[0],N[0]),T0(x,f,h,o,r,D[0],N[1]),T0(x,f,h,o,r,D[1],N[0]),T0(x,f,h,o,r,D[1],N[1])}}return f}function y4(o){return o.type==="MultiPolygon"?o.coordinates.map((t=>({type:"Polygon",coordinates:t}))):o.type==="MultiLineString"?o.coordinates.map((t=>({type:"LineString",coordinates:t}))):o.type==="MultiPoint"?o.coordinates.map((t=>({type:"Point",coordinates:t}))):[o]}class E8{constructor(t,r){this.type=G1,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(o8(t[1])){let l=t[1];if(l.type==="FeatureCollection")return new E8(l,l.features.map((h=>y4(h.geometry))).flat());if(l.type==="Feature")return new E8(l,y4(l.geometry));if("type"in l&&"coordinates"in l)return new E8(l,y4(l))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,l){let h=r.geometry(),d=h.flat().map((_=>s4([_.x,_.y],r.canonical)));if(h.length===0)return NaN;let f=new C4(d[0][1]),x=1/0;for(let _ of l){switch(_.type){case"Point":x=Math.min(x,Z0(d,!1,[_.coordinates],!1,f,x));break;case"LineString":x=Math.min(x,Z0(d,!1,_.coordinates,!0,f,x));break;case"Polygon":x=Math.min(x,z0(d,!1,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,l){let h=r.geometry(),d=h.flat().map((_=>s4([_.x,_.y],r.canonical)));if(h.length===0)return NaN;let f=new C4(d[0][1]),x=1/0;for(let _ of l){switch(_.type){case"Point":x=Math.min(x,Z0(d,!0,[_.coordinates],!1,f,x));break;case"LineString":x=Math.min(x,Z0(d,!0,_.coordinates,!0,f,x));break;case"Polygon":x=Math.min(x,z0(d,!0,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries);if(t.geometryType()==="Polygon")return(function(r,l){let h=r.geometry();if(h.length===0||h[0].length===0)return NaN;let d=se(h,0).map((_=>_.map((b=>b.map((z=>s4([z.x,z.y],r.canonical))))))),f=new C4(d[0][0][0][1]),x=1/0;for(let _ of l)for(let b of d){switch(_.type){case"Point":x=Math.min(x,z0([_.coordinates],!1,b,f,x));break;case"LineString":x=Math.min(x,z0(_.coordinates,!0,b,f,x));break;case"Polygon":x=Math.min(x,ds(b,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class ce{constructor(t){this.type=V2,this.key=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let l=t[1];return l==null?r.error("Global state property must be defined."):typeof l!="string"?r.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new ce(l)}evaluate(t){var r;let l=(r=t.globals)===null||r===void 0?void 0:r.globalState;return l&&Object.keys(l).length!==0?b3(l,this.key):null}eachChild(){}outputDefined(){return!1}}let m9={"==":v0,"!=":o4,">":Dr,"<":os,">=":M0,"<=":_0,array:p6,at:q6,boolean:p6,case:ee,coalesce:f9,collator:f6,format:T8,image:a4,in:te,"index-of":S8,interpolate:Ut,"interpolate-hcl":Ut,"interpolate-lab":Ut,length:re,let:m5,literal:a8,match:m0,number:p6,"number-format":b0,object:p6,slice:ie,step:p9,string:p6,"to-boolean":C3,"to-color":C3,"to-number":C3,"to-string":C3,var:d9,within:z8,distance:E8,"global-state":ce};class B6{constructor(t,r,l,h){this.name=t,this.type=r,this._evaluate=l,this.args=h}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let l=t[0],h=B6.definitions[l];if(!h)return r.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0);let d=Array.isArray(h)?h[0]:h.type,f=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,x=f.filter((([b])=>!Array.isArray(b)||b.length===t.length-1)),_=null;for(let[b,z]of x){_=new C9(r.registry,E0,r.path,null,r.scope);let P=[],k=!1;for(let D=1;D<t.length;D++){let N=t[D],U=Array.isArray(b)?b[D-1]:b.type,$=_.parse(N,1+P.length,U);if(!$){k=!0;break}P.push($)}if(!k)if(Array.isArray(b)&&b.length!==P.length)_.error(`Expected ${b.length} arguments, but found ${P.length} instead.`);else{for(let D=0;D<P.length;D++){let N=Array.isArray(b)?b[D]:b.type,U=P[D];_.concat(D+1).checkSubtype(N,U.type)}if(_.errors.length===0)return new B6(l,d,z,P)}}if(x.length===1)r.errors.push(..._.errors);else{let b=(x.length?x:f).map((([P])=>{return k=P,Array.isArray(k)?`(${k.map(O5).join(", ")})`:`(${O5(k.type)}...)`;var k})).join(" | "),z=[];for(let P=1;P<t.length;P++){let k=r.parse(t[P],1+z.length);if(!k)return null;z.push(O5(k.type))}r.error(`Expected arguments of type ${b}, but found (${z.join(", ")}) instead.`)}return null}static register(t,r){B6.definitions=r;for(let l in r)t[l]=B6}}function Yr(o,[t,r,l,h]){t=t.evaluate(o),r=r.evaluate(o),l=l.evaluate(o);let d=h?h.evaluate(o):1,f=Ar(t,r,l,d);if(f)throw new N5(f);return new s5(t/255,r/255,l/255,d,!1)}function Xr(o,t){return o in t}function v4(o,t){let r=t[o];return r===void 0?null:r}function I8(o){return{type:o}}function E0(o){if(o instanceof d9)return E0(o.boundExpression);if(o instanceof B6&&o.name==="error"||o instanceof f6||o instanceof z8||o instanceof E8||o instanceof ce)return!1;let t=o instanceof C3||o instanceof p6,r=!0;return o.eachChild((l=>{r=t?r&&E0(l):r&&l instanceof a8})),!!r&&I0(o)&&P0(o,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function I0(o){if(o instanceof B6&&(o.name==="get"&&o.args.length===1||o.name==="feature-state"||o.name==="has"&&o.args.length===1||o.name==="properties"||o.name==="geometry-type"||o.name==="id"||/^filter-/.test(o.name))||o instanceof z8||o instanceof E8)return!1;let t=!0;return o.eachChild((r=>{t&&!I0(r)&&(t=!1)})),t}function Le(o){if(o instanceof B6&&o.name==="feature-state")return!1;let t=!0;return o.eachChild((r=>{t&&!Le(r)&&(t=!1)})),t}function P0(o,t){if(o instanceof B6&&t.indexOf(o.name)>=0)return!1;let r=!0;return o.eachChild((l=>{r&&!P0(l,t)&&(r=!1)})),r}function Kr(o){return{result:"success",value:o}}function x9(o){return{result:"error",value:o}}function y9(o){return o["property-type"]==="data-driven"||o["property-type"]==="cross-faded-data-driven"}function Jr(o){return!!o.expression&&o.expression.parameters.indexOf("zoom")>-1}function _4(o){return!!o.expression&&o.expression.interpolated}function l5(o){return o instanceof Number?"number":o instanceof String?"string":o instanceof Boolean?"boolean":Array.isArray(o)?"array":o===null?"null":typeof o}function A0(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&j5(o)===It}function ps(o){return o}function Qr(o,t){let r=o.stops&&typeof o.stops[0][0]=="object",l=r||!(r||o.property!==void 0),h=o.type||(_4(t)?"exponential":"interval"),d=(function(z){switch(z.type){case"color":return s5.parse;case"padding":return Yt.parse;case"numberArray":return Xt.parse;case"colorArray":return wt.parse;default:return null}})(t);if(d&&((o=p5({},o)).stops&&(o.stops=o.stops.map((z=>[z[0],d(z[1])]))),o.default=d(o.default?o.default:t.default)),o.colorSpace&&(f=o.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${o.colorSpace}"`);var f;let x=(function(z){switch(z){case"exponential":return tn;case"interval":return fs;case"categorical":return M4;case"identity":return gs;default:throw new Error(`Unknown function type "${z}"`)}})(h),_,b;if(h==="categorical"){_=Object.create(null);for(let z of o.stops)_[z[0]]=z[1];b=typeof o.stops[0][0]}if(r){let z={},P=[];for(let N=0;N<o.stops.length;N++){let U=o.stops[N],$=U[0].zoom;z[$]===void 0&&(z[$]={zoom:$,type:o.type,property:o.property,default:o.default,stops:[]},P.push($)),z[$].stops.push([U[0].value,U[1]])}let k=[];for(let N of P)k.push([z[N].zoom,Qr(z[N],t)]);let D={name:"linear"};return{kind:"composite",interpolationType:D,interpolationFactor:Ut.interpolationFactor.bind(void 0,D),zoomStops:k.map((N=>N[0])),evaluate:({zoom:N},U)=>tn({stops:k,base:o.base},t,N).evaluate(N,U)}}if(l){let z=h==="exponential"?{name:"exponential",base:o.base!==void 0?o.base:1}:null;return{kind:"camera",interpolationType:z,interpolationFactor:Ut.interpolationFactor.bind(void 0,z),zoomStops:o.stops.map((P=>P[0])),evaluate:({zoom:P})=>x(o,t,P,_,b)}}return{kind:"source",evaluate(z,P){let k=P&&P.properties?P.properties[o.property]:void 0;return k===void 0?ue(o.default,t.default):x(o,t,k,_,b)}}}function ue(o,t,r){return o!==void 0?o:t!==void 0?t:r!==void 0?r:void 0}function M4(o,t,r,l,h){return ue(typeof r===h?l[r]:void 0,o.default,t.default)}function fs(o,t,r){if(l5(r)!=="number")return ue(o.default,t.default);let l=o.stops.length;if(l===1||r<=o.stops[0][0])return o.stops[0][1];if(r>=o.stops[l-1][0])return o.stops[l-1][1];let h=x0(o.stops.map((d=>d[0])),r);return o.stops[h][1]}function tn(o,t,r){let l=o.base!==void 0?o.base:1;if(l5(r)!=="number")return ue(o.default,t.default);let h=o.stops.length;if(h===1||r<=o.stops[0][0])return o.stops[0][1];if(r>=o.stops[h-1][0])return o.stops[h-1][1];let d=x0(o.stops.map((z=>z[0])),r),f=(function(z,P,k,D){let N=D-k,U=z-k;return N===0?0:P===1?U/N:(Math.pow(P,U)-1)/(Math.pow(P,N)-1)})(r,l,o.stops[d][0],o.stops[d+1][0]),x=o.stops[d][1],_=o.stops[d+1][1],b=H6[t.type]||ps;return typeof x.evaluate=="function"?{evaluate(...z){let P=x.evaluate.apply(void 0,z),k=_.evaluate.apply(void 0,z);if(P!==void 0&&k!==void 0)return b(P,k,f,o.colorSpace)}}:b(x,_,f,o.colorSpace)}function gs(o,t,r){switch(t.type){case"color":r=s5.parse(r);break;case"formatted":r=mt.fromString(r.toString());break;case"resolvedImage":r=d6.fromString(r.toString());break;case"padding":r=Yt.parse(r);break;case"colorArray":r=wt.parse(r);break;case"numberArray":r=Xt.parse(r);break;default:l5(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return ue(r,o.default,t.default)}B6.register(m9,{error:[{kind:"error"},[L2],(o,[t])=>{throw new N5(t.evaluate(o))}],typeof:[L2,[V2],(o,[t])=>O5(j5(t.evaluate(o)))],"to-rgba":[b6(G1,4),[Wt],(o,[t])=>{let[r,l,h,d]=t.evaluate(o).rgb;return[255*r,255*l,255*h,d]}],rgb:[Wt,[G1,G1,G1],Yr],rgba:[Wt,[G1,G1,G1,G1],Yr],has:{type:_2,overloads:[[[L2],(o,[t])=>Xr(t.evaluate(o),o.properties())],[[L2,It],(o,[t,r])=>Xr(t.evaluate(o),r.evaluate(o))]]},get:{type:V2,overloads:[[[L2],(o,[t])=>v4(t.evaluate(o),o.properties())],[[L2,It],(o,[t,r])=>v4(t.evaluate(o),r.evaluate(o))]]},"feature-state":[V2,[L2],(o,[t])=>v4(t.evaluate(o),o.featureState||{})],properties:[It,[],o=>o.properties()],"geometry-type":[L2,[],o=>o.geometryType()],id:[V2,[],o=>o.id()],zoom:[G1,[],o=>o.globals.zoom],"heatmap-density":[G1,[],o=>o.globals.heatmapDensity||0],elevation:[G1,[],o=>o.globals.elevation||0],"line-progress":[G1,[],o=>o.globals.lineProgress||0],accumulated:[V2,[],o=>o.globals.accumulated===void 0?null:o.globals.accumulated],"+":[G1,I8(G1),(o,t)=>{let r=0;for(let l of t)r+=l.evaluate(o);return r}],"*":[G1,I8(G1),(o,t)=>{let r=1;for(let l of t)r*=l.evaluate(o);return r}],"-":{type:G1,overloads:[[[G1,G1],(o,[t,r])=>t.evaluate(o)-r.evaluate(o)],[[G1],(o,[t])=>-t.evaluate(o)]]},"/":[G1,[G1,G1],(o,[t,r])=>t.evaluate(o)/r.evaluate(o)],"%":[G1,[G1,G1],(o,[t,r])=>t.evaluate(o)%r.evaluate(o)],ln2:[G1,[],()=>Math.LN2],pi:[G1,[],()=>Math.PI],e:[G1,[],()=>Math.E],"^":[G1,[G1,G1],(o,[t,r])=>Math.pow(t.evaluate(o),r.evaluate(o))],sqrt:[G1,[G1],(o,[t])=>Math.sqrt(t.evaluate(o))],log10:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))/Math.LN10],ln:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))],log2:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))/Math.LN2],sin:[G1,[G1],(o,[t])=>Math.sin(t.evaluate(o))],cos:[G1,[G1],(o,[t])=>Math.cos(t.evaluate(o))],tan:[G1,[G1],(o,[t])=>Math.tan(t.evaluate(o))],asin:[G1,[G1],(o,[t])=>Math.asin(t.evaluate(o))],acos:[G1,[G1],(o,[t])=>Math.acos(t.evaluate(o))],atan:[G1,[G1],(o,[t])=>Math.atan(t.evaluate(o))],min:[G1,I8(G1),(o,t)=>Math.min(...t.map((r=>r.evaluate(o))))],max:[G1,I8(G1),(o,t)=>Math.max(...t.map((r=>r.evaluate(o))))],abs:[G1,[G1],(o,[t])=>Math.abs(t.evaluate(o))],round:[G1,[G1],(o,[t])=>{let r=t.evaluate(o);return r<0?-Math.round(-r):Math.round(r)}],floor:[G1,[G1],(o,[t])=>Math.floor(t.evaluate(o))],ceil:[G1,[G1],(o,[t])=>Math.ceil(t.evaluate(o))],"filter-==":[_2,[L2,V2],(o,[t,r])=>o.properties()[t.value]===r.value],"filter-id-==":[_2,[V2],(o,[t])=>o.id()===t.value],"filter-type-==":[_2,[L2],(o,[t])=>o.geometryType()===t.value],"filter-<":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l<h}],"filter-id-<":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r<l}],"filter->":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l>h}],"filter-id->":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r>l}],"filter-<=":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l<=h}],"filter-id-<=":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r<=l}],"filter->=":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l>=h}],"filter-id->=":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r>=l}],"filter-has":[_2,[V2],(o,[t])=>t.value in o.properties()],"filter-has-id":[_2,[],o=>o.id()!==null&&o.id()!==void 0],"filter-type-in":[_2,[b6(L2)],(o,[t])=>t.value.indexOf(o.geometryType())>=0],"filter-id-in":[_2,[b6(V2)],(o,[t])=>t.value.indexOf(o.id())>=0],"filter-in-small":[_2,[L2,b6(V2)],(o,[t,r])=>r.value.indexOf(o.properties()[t.value])>=0],"filter-in-large":[_2,[L2,b6(V2)],(o,[t,r])=>(function(l,h,d,f){for(;d<=f;){let x=d+f>>1;if(h[x]===l)return!0;h[x]>l?f=x-1:d=x+1}return!1})(o.properties()[t.value],r.value,0,r.value.length-1)],all:{type:_2,overloads:[[[_2,_2],(o,[t,r])=>t.evaluate(o)&&r.evaluate(o)],[I8(_2),(o,t)=>{for(let r of t)if(!r.evaluate(o))return!1;return!0}]]},any:{type:_2,overloads:[[[_2,_2],(o,[t,r])=>t.evaluate(o)||r.evaluate(o)],[I8(_2),(o,t)=>{for(let r of t)if(r.evaluate(o))return!0;return!1}]]},"!":[_2,[_2],(o,[t])=>!t.evaluate(o)],"is-supported-script":[_2,[L2],(o,[t])=>{let r=o.globals&&o.globals.isSupportedScript;return!r||r(t.evaluate(o))}],upcase:[L2,[L2],(o,[t])=>t.evaluate(o).toUpperCase()],downcase:[L2,[L2],(o,[t])=>t.evaluate(o).toLowerCase()],concat:[L2,I8(V2),(o,t)=>t.map((r=>h9(r.evaluate(o)))).join("")],"resolved-locale":[L2,[M3],(o,[t])=>t.evaluate(o).resolvedLocale()]});class B0{constructor(t,r,l){this.expression=t,this._warningHistory={},this._evaluator=new t5,this._defaultValue=r?(function(h){if(h.type==="color"&&A0(h.default))return new s5(0,0,0,0);switch(h.type){case"color":return s5.parse(h.default)||null;case"padding":return Yt.parse(h.default)||null;case"numberArray":return Xt.parse(h.default)||null;case"colorArray":return wt.parse(h.default)||null;case"variableAnchorOffsetCollection":return o6.parse(h.default)||null;case"projectionDefinition":return Kt.parse(h.default)||null;default:return h.default===void 0?null:h.default}})(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=l}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=l,this._evaluator.canonical=h,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(t,r,l,h,d,f){this._globalState&&(t=v9(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=l||null,this._evaluator.canonical=h,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f||null;try{let x=this.expression.evaluate(this._evaluator);if(x==null||typeof x=="number"&&x!=x)return this._defaultValue;if(this._enumValues&&!(x in this._enumValues))throw new N5(`Expected value to be one of ${Object.keys(this._enumValues).map((_=>JSON.stringify(_))).join(", ")}, but found ${JSON.stringify(x)} instead.`);return x}catch(x){return this._warningHistory[x.message]||(this._warningHistory[x.message]=!0,typeof console<"u"&&console.warn(x.message)),this._defaultValue}}}function k0(o){return Array.isArray(o)&&o.length>0&&typeof o[0]=="string"&&o[0]in m9}function R0(o,t,r){let l=new C9(m9,E0,[],t?(function(d){let f={color:Wt,string:L2,number:G1,enum:L2,boolean:_2,formatted:a9,padding:s9,numberArray:b8,colorArray:j6,projectionDefinition:M8,resolvedImage:l9,variableAnchorOffsetCollection:c9};return d.type==="array"?b6(f[d.value]||V2,d.length):f[d.type]})(t):void 0),h=l.parse(o,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?Kr(new B0(h,t,r)):x9(l.errors)}class P8{constructor(t,r,l){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Le(r.expression),this.globalStateRefs=N0(r.expression),this._globalState=l}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,l,h,d,f)}evaluate(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluate(t,r,l,h,d,f)}}class D0{constructor(t,r,l,h,d){this.kind=t,this.zoomStops=l,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Le(r.expression),this.globalStateRefs=N0(r.expression),this.interpolationType=h,this._globalState=d}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,l,h,d,f)}evaluate(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluate(t,r,l,h,d,f)}interpolationFactor(t,r,l){return this.interpolationType?Ut.interpolationFactor(this.interpolationType,t,r,l):0}}function en(o,t,r){let l=R0(o,t,r);if(l.result==="error")return l;let h=l.value.expression,d=I0(h);if(!d&&!y9(t))return x9([new a5("","data expressions not supported")]);let f=P0(h,["zoom"]);if(!f&&!Jr(t))return x9([new a5("","zoom expressions not supported")]);let x=O0(h);return x||f?x instanceof a5?x9([x]):x instanceof Ut&&!_4(t)?x9([new a5("",'"interpolate" expressions cannot be used with this property')]):Kr(x?new D0(d?"camera":"composite",l.value,x.labels,x instanceof Ut?x.interpolation:void 0,r):new P8(d?"constant":"source",l.value,r)):x9([new a5("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class F0{constructor(t,r){this._parameters=t,this._specification=r,p5(this,Qr(this._parameters,this._specification))}static deserialize(t){return new F0(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function O0(o){let t=null;if(o instanceof m5)t=O0(o.result);else if(o instanceof f9){for(let r of o.args)if(t=O0(r),t)break}else(o instanceof p9||o instanceof Ut)&&o.input instanceof B6&&o.input.name==="zoom"&&(t=o);return t instanceof a5||o.eachChild((r=>{let l=O0(r);l instanceof a5?t=l:!t&&l?t=new a5("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&l&&t!==l&&(t=new a5("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function N0(o,t=new Set){return o instanceof ce&&t.add(o.key),o.eachChild((r=>{N0(r,t)})),t}function v9(o,t){let{zoom:r,heatmapDensity:l,elevation:h,lineProgress:d,isSupportedScript:f,accumulated:x}=o??{};return{zoom:r,heatmapDensity:l,elevation:h,lineProgress:d,isSupportedScript:f,accumulated:x,globalState:t}}function V0(o){if(o===!0||o===!1)return!0;if(!Array.isArray(o)||o.length===0)return!1;switch(o[0]){case"has":return o.length>=2&&o[1]!=="$id"&&o[1]!=="$type";case"in":return o.length>=3&&(typeof o[1]!="string"||Array.isArray(o[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return o.length!==3||Array.isArray(o[1])||Array.isArray(o[2]);case"any":case"all":for(let t of o.slice(1))if(!V0(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}let rn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function he(o,t){if(o==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};V0(o)||(o=Ce(o));let r=R0(o,rn,t);if(r.result==="error")throw new Error(r.value.map((l=>`${l.key}: ${l.message}`)).join(", "));return{filter:(l,h,d)=>r.value.evaluate(l,h,{},d),needGeometry:b4(o),getGlobalStateRefs:()=>N0(r.value.expression)}}function ms(o,t){return o<t?-1:o>t?1:0}function b4(o){if(!Array.isArray(o))return!1;if(o[0]==="within"||o[0]==="distance")return!0;for(let t=1;t<o.length;t++)if(b4(o[t]))return!0;return!1}function Ce(o){if(!o)return!0;let t=o[0];return o.length<=1?t!=="any":t==="=="?G0(o[1],o[2],"=="):t==="!="?U0(G0(o[1],o[2],"==")):t==="<"||t===">"||t==="<="||t===">="?G0(o[1],o[2],t):t==="any"?(r=o.slice(1),["any"].concat(r.map(Ce))):t==="all"?["all"].concat(o.slice(1).map(Ce)):t==="none"?["all"].concat(o.slice(1).map(Ce).map(U0)):t==="in"?nn(o[1],o.slice(2)):t==="!in"?U0(nn(o[1],o.slice(2))):t==="has"?on(o[1]):t!=="!has"||U0(on(o[1]));var r}function G0(o,t,r){switch(o){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,o,t]}}function nn(o,t){if(t.length===0)return!1;switch(o){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((r=>typeof r!=typeof t[0]))?["filter-in-large",o,["literal",t.sort(ms)]]:["filter-in-small",o,["literal",t]]}}function on(o){switch(o){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",o]}}function U0(o){return["!",o]}function w4(o){let t=typeof o;if(t==="number"||t==="boolean"||t==="string"||o==null)return JSON.stringify(o);if(Array.isArray(o)){let h="[";for(let d of o)h+=`${w4(d)},`;return`${h}]`}let r=Object.keys(o).sort(),l="{";for(let h=0;h<r.length;h++)l+=`${JSON.stringify(r[h])}:${w4(o[r[h]])},`;return`${l}}`}function an(o){let t="";for(let r of M1)t+=`/${w4(o[r])}`;return t}function S4(o){let t=o.value;return t?[new H1(o.key,t,"constants have been deprecated as of v8")]:[]}function nt(o){return o instanceof Number||o instanceof String||o instanceof Boolean?o.valueOf():o}function w3(o){if(Array.isArray(o))return o.map(w3);if(o instanceof Object&&!(o instanceof Number||o instanceof String||o instanceof Boolean)){let t={};for(let r in o)t[r]=w3(o[r]);return t}return nt(o)}function g6(o){let t=o.key,r=o.value,l=o.valueSpec||{},h=o.objectElementValidators||{},d=o.style,f=o.styleSpec,x=o.validateSpec,_=[],b=l5(r);if(b!=="object")return[new H1(t,r,`object expected, ${b} found`)];for(let z in r){let P=z.split(".")[0],k=b3(l,P)||l["*"],D;if(b3(h,P))D=h[P];else if(b3(l,P))D=x;else if(h["*"])D=h["*"];else{if(!l["*"]){_.push(new H1(t,r[z],`unknown property "${z}"`));continue}D=x}_=_.concat(D({key:(t&&`${t}.`)+z,value:r[z],valueSpec:k,style:d,styleSpec:f,object:r,objectKey:z,validateSpec:x},r))}for(let z in l)h[z]||l[z].required&&l[z].default===void 0&&r[z]===void 0&&_.push(new H1(t,r,`missing required property "${z}"`));return _}function de(o){let t=o.value,r=o.valueSpec,l=o.style,h=o.styleSpec,d=o.key,f=o.arrayElementValidator||o.validateSpec;if(l5(t)!=="array")return[new H1(d,t,`array expected, ${l5(t)} found`)];if(r.length&&t.length!==r.length)return[new H1(d,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new H1(d,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let x={type:r.value,values:r.values};h.$version<7&&(x.function=r.function),l5(r.value)==="object"&&(x=r.value);let _=[];for(let b=0;b<t.length;b++)_=_.concat(f({array:t,arrayIndex:b,value:t[b],valueSpec:x,validateSpec:o.validateSpec,style:l,styleSpec:h,key:`${d}[${b}]`}));return _}function A8(o){let t=o.key,r=o.value,l=o.valueSpec,h=l5(r);return h==="number"&&r!=r&&(h="NaN"),h!=="number"?[new H1(t,r,`number expected, ${h} found`)]:"minimum"in l&&r<l.minimum?[new H1(t,r,`${r} is less than the minimum value ${l.minimum}`)]:"maximum"in l&&r>l.maximum?[new H1(t,r,`${r} is greater than the maximum value ${l.maximum}`)]:[]}function sn(o){let t=o.valueSpec,r=nt(o.value.type),l,h,d,f={},x=r!=="categorical"&&o.value.property===void 0,_=!x,b=l5(o.value.stops)==="array"&&l5(o.value.stops[0])==="array"&&l5(o.value.stops[0][0])==="object",z=g6({key:o.key,value:o.value,valueSpec:o.styleSpec.function,validateSpec:o.validateSpec,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{stops:function(D){if(r==="identity")return[new H1(D.key,D.value,'identity function may not have a "stops" property')];let N=[],U=D.value;return N=N.concat(de({key:D.key,value:U,valueSpec:D.valueSpec,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,arrayElementValidator:P})),l5(U)==="array"&&U.length===0&&N.push(new H1(D.key,U,"array must have at least one stop")),N},default:function(D){return D.validateSpec({key:D.key,value:D.value,valueSpec:t,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec})}}});return r==="identity"&&x&&z.push(new H1(o.key,o.value,'missing required property "property"')),r==="identity"||o.value.stops||z.push(new H1(o.key,o.value,'missing required property "stops"')),r==="exponential"&&o.valueSpec.expression&&!_4(o.valueSpec)&&z.push(new H1(o.key,o.value,"exponential functions not supported")),o.styleSpec.$version>=8&&(_&&!y9(o.valueSpec)?z.push(new H1(o.key,o.value,"property functions not supported")):x&&!Jr(o.valueSpec)&&z.push(new H1(o.key,o.value,"zoom functions not supported"))),r!=="categorical"&&!b||o.value.property!==void 0||z.push(new H1(o.key,o.value,'"property" property is required')),z;function P(D){let N=[],U=D.value,$=D.key;if(l5(U)!=="array")return[new H1($,U,`array expected, ${l5(U)} found`)];if(U.length!==2)return[new H1($,U,`array length 2 expected, length ${U.length} found`)];if(b){if(l5(U[0])!=="object")return[new H1($,U,`object expected, ${l5(U[0])} found`)];if(U[0].zoom===void 0)return[new H1($,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new H1($,U,"object stop key must have value")];if(d&&d>nt(U[0].zoom))return[new H1($,U[0].zoom,"stop zoom values must appear in ascending order")];nt(U[0].zoom)!==d&&(d=nt(U[0].zoom),h=void 0,f={}),N=N.concat(g6({key:`${$}[0]`,value:U[0],valueSpec:{zoom:{}},validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{zoom:A8,value:k}}))}else N=N.concat(k({key:`${$}[0]`,value:U[0],validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec},U));return k0(w3(U[1]))?N.concat([new H1(`${$}[1]`,U[1],"expressions are not allowed in function stops.")]):N.concat(D.validateSpec({key:`${$}[1]`,value:U[1],valueSpec:t,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec}))}function k(D,N){let U=l5(D.value),$=nt(D.value),J=D.value!==null?D.value:N;if(l){if(U!==l)return[new H1(D.key,J,`${U} stop domain type must match previous stop domain type ${l}`)]}else l=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new H1(D.key,J,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&r!=="categorical"){let L1=`number expected, ${U} found`;return y9(t)&&r===void 0&&(L1+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H1(D.key,J,L1)]}return r!=="categorical"||U!=="number"||isFinite($)&&Math.floor($)===$?r!=="categorical"&&U==="number"&&h!==void 0&&$<h?[new H1(D.key,J,"stop domain values must appear in ascending order")]:(h=$,r==="categorical"&&$ in f?[new H1(D.key,J,"stop domain values must be unique")]:(f[$]=!0,[])):[new H1(D.key,J,`integer expected, found ${$}`)]}}function _9(o){let t=(o.expressionContext==="property"?en:R0)(w3(o.value),o.valueSpec);if(t.result==="error")return t.value.map((l=>new H1(`${o.key}${l.key}`,o.value,l.message)));let r=t.value.expression||t.value._styleExpression.expression;if(o.expressionContext==="property"&&o.propertyKey==="text-font"&&!r.outputDefined())return[new H1(o.key,o.value,`Invalid data expression for "${o.propertyKey}". Output values must be contained as literals within the expression.`)];if(o.expressionContext==="property"&&o.propertyType==="layout"&&!Le(r))return[new H1(o.key,o.value,'"feature-state" data expressions are not supported with layout properties.')];if(o.expressionContext==="filter"&&!Le(r))return[new H1(o.key,o.value,'"feature-state" data expressions are not supported with filters.')];if(o.expressionContext&&o.expressionContext.indexOf("cluster")===0){if(!P0(r,["zoom","feature-state"]))return[new H1(o.key,o.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(o.expressionContext==="cluster-initial"&&!I0(r))return[new H1(o.key,o.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function T4(o){let t=o.key,r=o.value,l=l5(r);return l!=="string"?[new H1(t,r,`color expected, ${l} found`)]:s5.parse(String(r))?[]:[new H1(t,r,`color expected, "${r}" found`)]}function pe(o){let t=o.key,r=o.value,l=o.valueSpec,h=[];return Array.isArray(l.values)?l.values.indexOf(nt(r))===-1&&h.push(new H1(t,r,`expected one of [${l.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(l.values).indexOf(nt(r))===-1&&h.push(new H1(t,r,`expected one of [${Object.keys(l.values).join(", ")}], ${JSON.stringify(r)} found`)),h}function z4(o){return V0(w3(o.value))?_9(p5({},o,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ln(o)}function ln(o){let t=o.value,r=o.key;if(l5(t)!=="array")return[new H1(r,t,`array expected, ${l5(t)} found`)];let l=o.styleSpec,h,d=[];if(t.length<1)return[new H1(r,t,"filter array must have at least 1 element")];switch(d=d.concat(pe({key:`${r}[0]`,value:t[0],valueSpec:l.filter_operator,style:o.style,styleSpec:o.styleSpec})),nt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&nt(t[1])==="$type"&&d.push(new H1(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new H1(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(h=l5(t[1]),h!=="string"&&d.push(new H1(`${r}[1]`,t[1],`string expected, ${h} found`)));for(let f=2;f<t.length;f++)h=l5(t[f]),nt(t[1])==="$type"?d=d.concat(pe({key:`${r}[${f}]`,value:t[f],valueSpec:l.geometry_type,style:o.style,styleSpec:o.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&d.push(new H1(`${r}[${f}]`,t[f],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let f=1;f<t.length;f++)d=d.concat(ln({key:`${r}[${f}]`,value:t[f],style:o.style,styleSpec:o.styleSpec}));break;case"has":case"!has":h=l5(t[1]),t.length!==2?d.push(new H1(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):h!=="string"&&d.push(new H1(`${r}[1]`,t[1],`string expected, ${h} found`))}return d}function Z4(o,t){let r=o.key,l=o.validateSpec,h=o.style,d=o.styleSpec,f=o.value,x=o.objectKey,_=d[`${t}_${o.layerType}`];if(!_)return[];let b=x.match(/^(.*)-transition$/);if(t==="paint"&&b&&_[b[1]]&&_[b[1]].transition)return l({key:r,value:f,valueSpec:d.transition,style:h,styleSpec:d});let z=o.valueSpec||_[x];if(!z)return[new H1(r,f,`unknown property "${x}"`)];let P;if(l5(f)==="string"&&y9(z)&&!z.tokens&&(P=/^{([^}]+)}$/.exec(f)))return[new H1(r,f,`"${x}" does not support interpolation syntax
|
|
1
|
+
import{$ as pf,$a as qf,A as w7,Aa as Pf,Ab as Zt,B as qp,Ba as _o,Bb as Qe,C as S7,Ca as Af,Cb as m3,D as Hp,Da as Mo,Db as Qf,E as $p,Ea as Bf,Eb as tg,F as y5,Fa as wi,Fb as Il,G as f8,Ga as kf,Gb as wo,H as Wp,Ha as D9,Hb as Pl,I as Yp,Ia as Rf,Ib as So,J as Xp,Ja as Df,Jb as eg,K as ho,Ka as V3,Kb as q1,L as K2,La as Si,Lb as zg,M as Kp,Ma as Ti,Mb as q2,N as Jp,Na as Ff,Nb as I,O as fo,Oa as Sl,Ob as c2,P as E6,Pa as F9,Pb as kl,Q as cf,Qa as $e,Qb as Ei,R as L6,Ra as Of,Rb as Io,S as r3,Sa as Tl,Sb as Zg,T as Lf,Ta as Nf,U as uf,Ua as Vf,V as hf,Va as $t,W as Cf,Wa as Gf,X as g8,Xa as Uf,Y as go,Ya as G3,Z as df,Za as zl,_ as He,_a as jf,a as A9,aa as n3,ab as Hf,b as j2,ba as ff,bb as Zl,c as B9,ca as mo,cb as zi,d as oo,da as _i,db as U3,e as wp,ea as xo,eb as $f,f as O3,fa as gf,fb as bo,g as N3,ga as mf,gb as y6,h as W1,ha as xf,hb as We,i as Sp,ia as yf,ib as N6,j as T1,ja as vf,jb as V6,k as Tp,ka as _f,kb as Ye,l as Mt,la as Mf,lb as Xe,m as t2,ma as j8,mb as Wf,n as h5,na as Mi,nb as G6,o as x6,oa as bi,ob as O9,p as Ne,pa as yo,pb as Ke,q as k1,qa as vo,qb as q8,r as ao,ra as bf,rb as Je,s as zp,sa as wf,sb as Yf,t as Zp,ta as Sf,tb as El,u as i3,ua as Tf,ub as Xf,v as gt,va as zf,vb as Kf,w as Q5,wa as Zf,wb as Jf,x as jp,xa as Ef,xb as v6,y as gi,ya as If,yb as _6,z as mi,za as I6,zb as j3}from"./chunk-PTTAXOBA.js";import{a as H8,b as z7,c as Z7}from"./chunk-CWZMEFYO.js";import{$a as Tg,A as R9,Aa as sg,B as i6,C as uo,Ca as lg,Da as cg,Ea as Lg,F as Gp,Fa as ug,G as Up,Ga as hg,Ha as Cg,I as U8,Ia as dg,Ja as pg,K as _l,Ka as fg,La as zo,M as Qp,Ma as gg,N as Co,Na as mg,O as tf,Oa as xg,Pa as yg,Q as Z6,Qa as Zo,R as ef,Ra as vg,Ta as Eo,Ua as Al,Va as _g,W as rf,Wa as Mg,X as nf,Xa as bg,Y as of,Ya as wg,Za as Bl,_a as Sg,a as Ep,aa as r6,b as k9,ba as Ml,c as Ip,d as p8,da as xi,e as Ve,ea as qe,f as Ge,fa as af,g as Pp,ga as po,h as Ap,ha as sf,i as G8,ia as bl,j as Ue,ja as yi,k as Bp,ka as vi,l as kp,m as so,n as lo,na as T7,o as Rp,oa as wl,p as Dp,pa as lf,qa as ig,r as Fp,ra as rg,s as Op,sa as ng,t as co,ta as og,u as b7,ua as N9,va as ag,w as je,wa as To,x as Np,xa as Zi,y as Lo,ya as a2,z as Vp}from"./chunk-CZ6RUAVW.js";import{a as Oe,b as yb,c as O6}from"./chunk-5TBO732O.js";var Q3=Oe((KN,hx)=>{var TT="Expected a function",Lx=NaN,zT="[object Symbol]",ZT=/^\s+|\s+$/g,ET=/^[-+]0x[0-9a-f]+$/i,IT=/^0b[01]+$/i,PT=/^0o[0-7]+$/i,AT=parseInt,BT=typeof global=="object"&&global&&global.Object===Object&&global,kT=typeof self=="object"&&self&&self.Object===Object&&self,RT=BT||kT||Function("return this")(),DT=Object.prototype,FT=DT.toString,OT=Math.max,NT=Math.min,uL=function(){return RT.Date.now()};function VT(c,i,s){var u,L,n,y,M,S,E=0,Z=!1,F=!1,G=!0;if(typeof c!="function")throw new TypeError(TT);i=ux(i)||0,hL(s)&&(Z=!!s.leading,F="maxWait"in s,n=F?OT(ux(s.maxWait)||0,i):n,G="trailing"in s?!!s.trailing:G);function j(w1){var z1=u,O1=L;return u=L=void 0,E=w1,y=c.apply(O1,z1),y}function R(w1){return E=w1,M=setTimeout(a1,i),Z?j(w1):y}function r1(w1){var z1=w1-S,O1=w1-E,U1=i-z1;return F?NT(U1,n-O1):U1}function X(w1){var z1=w1-S,O1=w1-E;return S===void 0||z1>=i||z1<0||F&&O1>=n}function a1(){var w1=uL();if(X(w1))return d1(w1);M=setTimeout(a1,r1(w1))}function d1(w1){return M=void 0,G&&u?j(w1):(u=L=void 0,y)}function s1(){M!==void 0&&clearTimeout(M),E=0,u=S=L=M=void 0}function y1(){return M===void 0?y:d1(uL())}function m1(){var w1=uL(),z1=X(w1);if(u=arguments,L=this,S=w1,z1){if(M===void 0)return R(S);if(F)return M=setTimeout(a1,i),j(S)}return M===void 0&&(M=setTimeout(a1,i)),y}return m1.cancel=s1,m1.flush=y1,m1}function hL(c){var i=typeof c;return!!c&&(i=="object"||i=="function")}function GT(c){return!!c&&typeof c=="object"}function UT(c){return typeof c=="symbol"||GT(c)&&FT.call(c)==zT}function ux(c){if(typeof c=="number")return c;if(UT(c))return Lx;if(hL(c)){var i=typeof c.valueOf=="function"?c.valueOf():c;c=hL(i)?i+"":i}if(typeof c!="string")return c===0?c:+c;c=c.replace(ZT,"");var s=IT.test(c);return s||PT.test(c)?AT(c.slice(2),s?2:8):ET.test(c)?Lx:+c}hx.exports=VT});var px=Oe((CL,dL)=>{(function(c,i){typeof CL=="object"&&typeof dL<"u"?dL.exports=i():typeof define=="function"&&define.amd?define(i):(c=typeof globalThis<"u"?globalThis:c||self,c.maplibregl=i())})(CL,(function(){"use strict";var c={},i={};function s(L,n,y){if(i[L]=y,L==="index"){var M="var sharedModule = {}; ("+i.shared+")(sharedModule); ("+i.worker+")(sharedModule);",S={};return i.shared(S),i.index(c,S),typeof window<"u"&&c.setWorkerUrl(window.URL.createObjectURL(new Blob([M],{type:"text/javascript"}))),c}}s("shared",["exports"],(function(L){"use strict";function n(o,t,r,l){return new(r||(r=Promise))((function(h,d){function f(b){try{_(l.next(b))}catch(z){d(z)}}function x(b){try{_(l.throw(b))}catch(z){d(z)}}function _(b){var z;b.done?h(b.value):(z=b.value,z instanceof r?z:new r((function(P){P(z)}))).then(f,x)}_((l=l.apply(o,t||[])).next())}))}function y(o,t){this.x=o,this.y=t}function M(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var S,E;typeof SuppressedError=="function"&&SuppressedError,y.prototype={clone(){return new y(this.x,this.y)},add(o){return this.clone()._add(o)},sub(o){return this.clone()._sub(o)},multByPoint(o){return this.clone()._multByPoint(o)},divByPoint(o){return this.clone()._divByPoint(o)},mult(o){return this.clone()._mult(o)},div(o){return this.clone()._div(o)},rotate(o){return this.clone()._rotate(o)},rotateAround(o,t){return this.clone()._rotateAround(o,t)},matMult(o){return this.clone()._matMult(o)},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(o){return this.x===o.x&&this.y===o.y},dist(o){return Math.sqrt(this.distSqr(o))},distSqr(o){let t=o.x-this.x,r=o.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(o){return Math.atan2(this.y-o.y,this.x-o.x)},angleWith(o){return this.angleWithSep(o.x,o.y)},angleWithSep(o,t){return Math.atan2(this.x*t-this.y*o,this.x*o+this.y*t)},_matMult(o){let t=o[2]*this.x+o[3]*this.y;return this.x=o[0]*this.x+o[1]*this.y,this.y=t,this},_add(o){return this.x+=o.x,this.y+=o.y,this},_sub(o){return this.x-=o.x,this.y-=o.y,this},_mult(o){return this.x*=o,this.y*=o,this},_div(o){return this.x/=o,this.y/=o,this},_multByPoint(o){return this.x*=o.x,this.y*=o.y,this},_divByPoint(o){return this.x/=o.x,this.y/=o.y,this},_unit(){return this._div(this.mag()),this},_perp(){let o=this.y;return this.y=this.x,this.x=-o,this},_rotate(o){let t=Math.cos(o),r=Math.sin(o),l=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=l,this},_rotateAround(o,t){let r=Math.cos(o),l=Math.sin(o),h=t.y+l*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-l*(this.y-t.y),this.y=h,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:y},y.convert=function(o){if(o instanceof y)return o;if(Array.isArray(o))return new y(+o[0],+o[1]);if(o.x!==void 0&&o.y!==void 0)return new y(+o.x,+o.y);throw new Error("Expected [x, y] or {x, y} point format")};var Z=(function(){if(E)return S;function o(t,r,l,h){this.cx=3*t,this.bx=3*(l-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(h-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=l,this.p2y=h}return E=1,S=o,o.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var l=t,h=0;h<8;h++){var d=this.sampleCurveX(l)-t;if(Math.abs(d)<r)return l;var f=this.sampleCurveDerivativeX(l);if(Math.abs(f)<1e-6)break;l-=d/f}var x=0,_=1;for(l=t,h=0;h<20&&(d=this.sampleCurveX(l),!(Math.abs(d-t)<r));h++)t>d?x=l:_=l,l=.5*(_-x)+x;return l},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},S})(),F=M(Z);let G,j;function R(){return G==null&&(G=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),G}function r1(){if(j==null&&(j=!1,R())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let l=0;l<25;l++){let h=4*l;t.fillStyle=`rgb(${h},${h+1},${h+2})`,t.fillRect(l%5,Math.floor(l/5),1,1)}let r=t.getImageData(0,0,5,5).data;for(let l=0;l<100;l++)if(l%4!=3&&r[l]!==l){j=!0;break}}}return j||!1}var X=1e-6,a1=typeof Float32Array<"u"?Float32Array:Array;function d1(){var o=new a1(9);return a1!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[5]=0,o[6]=0,o[7]=0),o[0]=1,o[4]=1,o[8]=1,o}function s1(o){return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function y1(){var o=new a1(3);return a1!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function m1(o){var t=o[0],r=o[1],l=o[2];return Math.sqrt(t*t+r*r+l*l)}function w1(o,t,r){var l=new a1(3);return l[0]=o,l[1]=t,l[2]=r,l}function z1(o,t,r){return o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o}function O1(o,t,r){return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o}function U1(o,t,r){var l=t[0],h=t[1],d=t[2],f=r[0],x=r[1],_=r[2];return o[0]=h*_-d*x,o[1]=d*f-l*_,o[2]=l*x-h*f,o}var e2,s2=m1;function N1(o,t,r){var l=t[0],h=t[1],d=t[2],f=t[3];return o[0]=r[0]*l+r[4]*h+r[8]*d+r[12]*f,o[1]=r[1]*l+r[5]*h+r[9]*d+r[13]*f,o[2]=r[2]*l+r[6]*h+r[10]*d+r[14]*f,o[3]=r[3]*l+r[7]*h+r[11]*d+r[15]*f,o}function o2(){var o=new a1(4);return a1!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o[3]=1,o}function p2(o,t,r,l){var h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",d=Math.PI/360;t*=d,l*=d,r*=d;var f=Math.sin(t),x=Math.cos(t),_=Math.sin(r),b=Math.cos(r),z=Math.sin(l),P=Math.cos(l);switch(h){case"xyz":o[0]=f*b*P+x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P-f*_*z;break;case"xzy":o[0]=f*b*P-x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P+f*_*z;break;case"yxz":o[0]=f*b*P+x*_*z,o[1]=x*_*P-f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P+f*_*z;break;case"yzx":o[0]=f*b*P+x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P-f*_*z;break;case"zxy":o[0]=f*b*P-x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z+f*_*P,o[3]=x*b*P-f*_*z;break;case"zyx":o[0]=f*b*P-x*_*z,o[1]=x*_*P+f*b*z,o[2]=x*b*z-f*_*P,o[3]=x*b*P+f*_*z;break;default:throw new Error("Unknown angle order "+h)}return o}function T2(){var o=new a1(2);return a1!=Float32Array&&(o[0]=0,o[1]=0),o}function l2(o,t){var r=new a1(2);return r[0]=o,r[1]=t,r}y1(),e2=new a1(4),a1!=Float32Array&&(e2[0]=0,e2[1]=0,e2[2]=0,e2[3]=0),y1(),w1(1,0,0),w1(0,1,0),o2(),o2(),d1(),T2();let Y1=8192;function f2(o,t,r){return t*(Y1/(o.tileSize*Math.pow(2,r-o.tileID.overscaledZ)))}function b2(o,t){return(o%t+t)%t}function d2(o,t,r){return o*(1-r)+t*r}function R2(o){if(o<=0)return 0;if(o>=1)return 1;let t=o*o,r=t*o;return 4*(o<.5?r:3*(o-t)+r-.75)}function J2(o,t,r,l){let h=new F(o,t,r,l);return d=>h.solve(d)}let v5=J2(.25,.1,.25,1);function F1(o,t,r){return Math.min(r,Math.max(t,o))}function i5(o,t,r){let l=r-t,h=((o-t)%l+l)%l+t;return h===t?r:h}function N2(o,...t){for(let r of t)for(let l in r)o[l]=r[l];return o}let g2=1;function L5(o,t,r){let l={};for(let h in o)l[h]=t.call(this,o[h],h,o);return l}function x5(o,t,r){let l={};for(let h in o)t.call(this,o[h],h,o)&&(l[h]=o[h]);return l}function Q2(o){return Array.isArray(o)?o.map(Q2):typeof o=="object"&&o?L5(o,Q2):o}let Z5={};function U2(o){Z5[o]||(typeof console<"u"&&console.warn(o),Z5[o]=!0)}function m2(o,t,r){return(r.y-o.y)*(t.x-o.x)>(t.y-o.y)*(r.x-o.x)}function o5(o){return typeof WorkerGlobalScope<"u"&&o!==void 0&&o instanceof WorkerGlobalScope}let e5=null;function X2(o){return typeof ImageBitmap<"u"&&o instanceof ImageBitmap}let C5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ht(o,t,r,l,h){return n(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let d=new VideoFrame(o,{timestamp:0});try{let f=d?.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);let x=f.startsWith("BGR"),_=new Uint8ClampedArray(l*h*4);if(yield d.copyTo(_,(function(b,z,P,k,D){let N=4*Math.max(-z,0),U=(Math.max(0,P)-P)*k*4+N,$=4*k,J=Math.max(0,z),L1=Math.max(0,P);return{rect:{x:J,y:L1,width:Math.min(b.width,z+k)-J,height:Math.min(b.height,P+D)-L1},layout:[{offset:U,stride:$}]}})(o,t,r,l,h)),x)for(let b=0;b<_.length;b+=4){let z=_[b];_[b]=_[b+2],_[b+2]=z}return _}finally{d.close()}}))}let R5,d5;function w5(o,t,r,l){return o.addEventListener(t,r,l),{unsubscribe:()=>{o.removeEventListener(t,r,l)}}}function W2(o){return o*Math.PI/180}function u5(o){return o/Math.PI*180}let Y2={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},P5={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},it="AbortError";function E5(){return new Error(it)}let D5={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Vt(o){return D5.REGISTERED_PROTOCOLS[o.substring(0,o.indexOf("://"))]}let U5="global-dispatcher";class F5 extends Error{constructor(t,r,l,h){super(`AJAXError: ${r} (${t}): ${l}`),this.status=t,this.statusText=r,this.url=l,this.body=h}}let lt=()=>o5(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,p1=function(o,t){if(/:\/\//.test(o.url)&&!/^https?:|^file:/.test(o.url)){let l=Vt(o.url);if(l)return l(o,t);if(o5(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:o,targetMapId:U5},t)}if(!(/^file:/.test(r=o.url)||/^file:/.test(lt())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(l,h){return n(this,void 0,void 0,(function*(){let d=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,cache:l.cache,referrer:lt(),signal:h.signal}),f,x;l.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{f=yield fetch(d)}catch(b){throw new F5(0,b.message,l.url,new Blob)}if(!f.ok){let b=yield f.blob();throw new F5(f.status,f.statusText,l.url,b)}x=l.type==="arrayBuffer"||l.type==="image"?f.arrayBuffer():l.type==="json"?f.json():f.text();let _=yield x;if(h.signal.aborted)throw E5();return{data:_,cacheControl:f.headers.get("Cache-Control"),expires:f.headers.get("Expires")}}))})(o,t);if(o5(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:o,mustQueue:!0,targetMapId:U5},t)}var r;return(function(l,h){return new Promise(((d,f)=>{var x;let _=new XMLHttpRequest;_.open(l.method||"GET",l.url,!0),l.type!=="arrayBuffer"&&l.type!=="image"||(_.responseType="arraybuffer");for(let b in l.headers)_.setRequestHeader(b,l.headers[b]);l.type==="json"&&(_.responseType="text",!((x=l.headers)===null||x===void 0)&&x.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=l.credentials==="include",_.onerror=()=>{f(new Error(_.statusText))},_.onload=()=>{if(!h.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let b=_.response;if(l.type==="json")try{b=JSON.parse(_.response)}catch(z){return void f(z)}d({data:b,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{let b=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});f(new F5(_.status,_.statusText,l.url,b))}},h.signal.addEventListener("abort",(()=>{_.abort(),f(E5())})),_.send(l.body)}))})(o,t)};function H(o){if(!o||o.indexOf("://")<=0||o.indexOf("data:image/")===0||o.indexOf("blob:")===0)return!0;let t=new URL(o),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function W(o,t,r){r[o]&&r[o].indexOf(t)!==-1||(r[o]=r[o]||[],r[o].push(t))}function K(o,t,r){if(r&&r[o]){let l=r[o].indexOf(t);l!==-1&&r[o].splice(l,1)}}class l1{constructor(t,r={}){N2(this,r),this.type=t}}class C1 extends l1{constructor(t,r={}){super("error",N2({error:t},r))}}class S1{on(t,r){return this._listeners=this._listeners||{},W(t,r,this._listeners),{unsubscribe:()=>{this.off(t,r)}}}off(t,r){return K(t,r,this._listeners),K(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},W(t,r,this._oneTimeListeners),this):new Promise((l=>this.once(t,l)))}fire(t,r){typeof t=="string"&&(t=new l1(t,r||{}));let l=t.type;if(this.listens(l)){t.target=this;let h=this._listeners&&this._listeners[l]?this._listeners[l].slice():[];for(let x of h)x.call(this,t);let d=this._oneTimeListeners&&this._oneTimeListeners[l]?this._oneTimeListeners[l].slice():[];for(let x of d)K(l,x,this._oneTimeListeners),x.call(this,t);let f=this._eventedParent;f&&(N2(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(t))}else t instanceof C1&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var t1={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"array",value:"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:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},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:{required:!0,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","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},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"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},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:"*",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-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","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"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},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"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"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"}}};let M1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function I1(o,t){let r={};for(let l in o)l!=="ref"&&(r[l]=o[l]);return M1.forEach((l=>{l in t&&(r[l]=t[l])})),r}function R1(o,t){if(Array.isArray(o)){if(!Array.isArray(t)||o.length!==t.length)return!1;for(let r=0;r<o.length;r++)if(!R1(o[r],t[r]))return!1;return!0}if(typeof o=="object"&&o!==null&&t!==null){if(typeof t!="object"||Object.keys(o).length!==Object.keys(t).length)return!1;for(let r in o)if(!R1(o[r],t[r]))return!1;return!0}return o===t}function D1(o,t){o.push(t)}function h2(o,t,r){D1(r,{command:"addSource",args:[o,t[o]]})}function w2(o,t,r){D1(t,{command:"removeSource",args:[o]}),r[o]=!0}function k2(o,t,r,l){w2(o,r,l),h2(o,t,r)}function z5(o,t,r){let l;for(l in o[r])if(Object.prototype.hasOwnProperty.call(o[r],l)&&l!=="data"&&!R1(o[r][l],t[r][l]))return!1;for(l in t[r])if(Object.prototype.hasOwnProperty.call(t[r],l)&&l!=="data"&&!R1(o[r][l],t[r][l]))return!1;return!0}function H2(o,t,r,l,h,d){o=o||{},t=t||{};for(let f in o)Object.prototype.hasOwnProperty.call(o,f)&&(R1(o[f],t[f])||r.push({command:d,args:[l,f,t[f],h]}));for(let f in t)Object.prototype.hasOwnProperty.call(t,f)&&!Object.prototype.hasOwnProperty.call(o,f)&&(R1(o[f],t[f])||r.push({command:d,args:[l,f,t[f],h]}))}function O2(o){return o.id}function _5(o,t){return o[t.id]=t,o}class H1{constructor(t,r,l,h){this.message=(t?`${t}: `:"")+l,h&&(this.identifier=h),r!=null&&r.__line__&&(this.line=r.__line__)}}function p5(o,...t){for(let r of t)for(let l in r)o[l]=r[l];return o}class a5 extends Error{constructor(t,r){super(r),this.message=r,this.key=t}}class I5{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[l,h]of r)this.bindings[l]=h}concat(t){return new I5(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}let f5={kind:"null"},G1={kind:"number"},L2={kind:"string"},_2={kind:"boolean"},Wt={kind:"color"},M8={kind:"projectionDefinition"},It={kind:"object"},V2={kind:"value"},M3={kind:"collator"},a9={kind:"formatted"},s9={kind:"padding"},j6={kind:"colorArray"},b8={kind:"numberArray"},l9={kind:"resolvedImage"},c9={kind:"variableAnchorOffsetCollection"};function b6(o,t){return{kind:"array",itemType:o,N:t}}function O5(o){if(o.kind==="array"){let t=O5(o.itemType);return typeof o.N=="number"?`array<${t}, ${o.N}>`:o.itemType.kind==="value"?"array":`array<${t}>`}return o.kind}let is=[f5,G1,L2,_2,Wt,M8,a9,It,b6(V2),s9,b8,j6,l9,c9];function u3(o,t){if(t.kind==="error")return null;if(o.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!u3(o.itemType,t.itemType))&&(typeof o.N!="number"||o.N===t.N))return null}else{if(o.kind===t.kind)return null;if(o.kind==="value"){for(let r of is)if(!u3(r,t))return null}}return`Expected ${O5(o)} but found ${O5(t)} instead.`}function J9(o,t){return t.some((r=>r.kind===o.kind))}function rt(o,t){return t.some((r=>r==="null"?o===null:r==="array"?Array.isArray(o):r==="object"?o&&!Array.isArray(o)&&typeof o=="object":r===typeof o))}function i8(o,t){return o.kind==="array"&&t.kind==="array"?o.itemType.kind===t.itemType.kind&&typeof o.N=="number":o.kind===t.kind}let J7=.96422,L9=.82521,Q7=4/29,u9=6/29,br=3*u9*u9,wr=u9*u9*u9,rs=Math.PI/180,Sr=180/Math.PI;function Tr(o){return(o%=360)<0&&(o+=360),o}function zr([o,t,r,l]){let h,d,f=e4((.2225045*(o=t4(o))+.7168786*(t=t4(t))+.0606169*(r=t4(r)))/1);o===t&&t===r?h=d=f:(h=e4((.4360747*o+.3850649*t+.1430804*r)/J7),d=e4((.0139322*o+.0971045*t+.7141733*r)/L9));let x=116*f-16;return[x<0?0:x,500*(h-f),200*(f-d),l]}function t4(o){return o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}function e4(o){return o>wr?Math.pow(o,1/3):o/br+Q7}function Zr([o,t,r,l]){let h=(o+16)/116,d=isNaN(t)?h:h+t/500,f=isNaN(r)?h:h-r/200;return h=1*r4(h),d=J7*r4(d),f=L9*r4(f),[i4(3.1338561*d-1.6168667*h-.4906146*f),i4(-.9787684*d+1.9161415*h+.033454*f),i4(.0719453*d-.2289914*h+1.4052427*f),l]}function i4(o){return(o=o<=.00304?12.92*o:1.055*Math.pow(o,1/2.4)-.055)<0?0:o>1?1:o}function r4(o){return o>u9?o*o*o:br*(o-Q7)}let Er=Object.hasOwn||function(o,t){return Object.prototype.hasOwnProperty.call(o,t)};function b3(o,t){return Er(o,t)?o[t]:void 0}function f0(o){return parseInt(o.padEnd(2,o),16)/255}function Ir(o,t){return h3(t?o/100:o,0,1)}function h3(o,t,r){return Math.min(Math.max(t,o),r)}function Pr(o){return!o.some(Number.isNaN)}let ns={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 r8(o,t,r){return o+r*(t-o)}function w8(o,t,r){return o.map(((l,h)=>r8(l,t[h],r)))}class s5{constructor(t,r,l,h=1,d=!0){this.r=t,this.g=r,this.b=l,this.a=h,d||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[t,r,l,h]))}static parse(t){if(t instanceof s5)return t;if(typeof t!="string")return;let r=(function(l){if((l=l.toLowerCase().trim())==="transparent")return[0,0,0,0];let h=b3(ns,l);if(h){let[f,x,_]=h;return[f/255,x/255,_/255,1]}if(l.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(l)){let f=l.length<6?1:2,x=1;return[f0(l.slice(x,x+=f)),f0(l.slice(x,x+=f)),f0(l.slice(x,x+=f)),f0(l.slice(x,x+f)||"ff")]}if(l.startsWith("rgb")){let f=l.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){let[x,_,b,z,P,k,D,N,U,$,J,L1]=f,Q=[z||" ",D||" ",$].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){let n1=[b,k,U].join(""),f1=n1==="%%%"?100:n1===""?255:0;if(f1){let _1=[h3(+_/f1,0,1),h3(+P/f1,0,1),h3(+N/f1,0,1),J?Ir(+J,L1):1];if(Pr(_1))return _1}}return}}let d=l.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){let[f,x,_,b,z,P,k,D,N]=d,U=[_||" ",z||" ",k].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){let $=[+x,h3(+b,0,100),h3(+P,0,100),D?Ir(+D,N):1];if(Pr($))return(function([J,L1,Q,n1]){function f1(_1){let P1=(_1+J/30)%12,$1=L1*Math.min(Q,1-Q);return Q-$1*Math.max(-1,Math.min(P1-3,9-P1,1))}return J=Tr(J),L1/=100,Q/=100,[f1(0),f1(8),f1(4),n1]})($)}}})(t);return r?new s5(...r,!1):void 0}get rgb(){let{r:t,g:r,b:l,a:h}=this,d=h||1/0;return this.overwriteGetter("rgb",[t/d,r/d,l/d,h])}get hcl(){return this.overwriteGetter("hcl",(function(t){let[r,l,h,d]=zr(t),f=Math.sqrt(l*l+h*h);return[Math.round(1e4*f)?Tr(Math.atan2(h,l)*Sr):NaN,f,r,d]})(this.rgb))}get lab(){return this.overwriteGetter("lab",zr(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,l,h]=this.rgb;return`rgba(${[t,r,l].map((d=>Math.round(255*d))).join(",")},${h})`}static interpolate(t,r,l,h="rgb"){switch(h){case"rgb":{let[d,f,x,_]=w8(t.rgb,r.rgb,l);return new s5(d,f,x,_,!1)}case"hcl":{let[d,f,x,_]=t.hcl,[b,z,P,k]=r.hcl,D,N;if(isNaN(d)||isNaN(b))isNaN(d)?isNaN(b)?D=NaN:(D=b,x!==1&&x!==0||(N=z)):(D=d,P!==1&&P!==0||(N=f));else{let Q=b-d;b>d&&Q>180?Q-=360:b<d&&d-b>180&&(Q+=360),D=d+l*Q}let[U,$,J,L1]=(function([Q,n1,f1,_1]){return Q=isNaN(Q)?0:Q*rs,Zr([f1,Math.cos(Q)*n1,Math.sin(Q)*n1,_1])})([D,N??r8(f,z,l),r8(x,P,l),r8(_,k,l)]);return new s5(U,$,J,L1,!1)}case"lab":{let[d,f,x,_]=Zr(w8(t.lab,r.lab,l));return new s5(d,f,x,_,!1)}}}}s5.black=new s5(0,0,0,1),s5.white=new s5(1,1,1,1),s5.transparent=new s5(0,0,0,0),s5.red=new s5(1,0,0,1);class A6{constructor(t,r,l){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=l,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let g5=["bottom","center","top"];class n8{constructor(t,r,l,h,d,f){this.text=t,this.image=r,this.scale=l,this.fontStack=h,this.textColor=d,this.verticalAlign=f}}class mt{constructor(t){this.sections=t}static fromString(t){return new mt([new n8(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((t=>t.text.length!==0||t.image&&t.image.name.length!==0))}static factory(t){return t instanceof mt?t:mt.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map((t=>t.text)).join("")}}class Yt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Yt)return t;if(typeof t=="number")return new Yt([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Yt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){return new Yt(w8(t.values,r.values,l))}}class Xt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Xt)return t;if(typeof t=="number")return new Xt([t]);if(Array.isArray(t)){for(let r of t)if(typeof r!="number")return;return new Xt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){return new Xt(w8(t.values,r.values,l))}}class wt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wt)return t;if(typeof t=="string"){let l=s5.parse(t);return l?new wt([l]):void 0}if(!Array.isArray(t))return;let r=[];for(let l of t){if(typeof l!="string")return;let h=s5.parse(l);if(!h)return;r.push(h)}return new wt(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l,h="rgb"){let d=[];if(t.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let f=0;f<t.values.length;f++)d.push(s5.interpolate(t.values[f],r.values[f],l,h));return new wt(d)}}class N5 extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}let g0=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class o6{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof o6)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r<t.length;r+=2){let l=t[r],h=t[r+1];if(typeof l!="string"||!g0.has(l)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new o6(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,l){let h=t.values,d=r.values;if(h.length!==d.length)throw new N5(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`);let f=[];for(let x=0;x<h.length;x+=2){if(h[x]!==d[x])throw new N5(`Cannot interpolate values containing mismatched anchors. from[${x}]: ${h[x]}, to[${x}]: ${d[x]}`);f.push(h[x]);let[_,b]=h[x+1],[z,P]=d[x+1];f.push([r8(_,z,l),r8(b,P,l)])}return new o6(f)}}class d6{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new d6({name:t,available:!1}):null}}class Kt{constructor(t,r,l){this.from=t,this.to=r,this.transition=l}static interpolate(t,r,l){return new Kt(t,r,l)}static parse(t){return t instanceof Kt?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new Kt(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new Kt(t.from,t.to,t.transition):typeof t=="string"?new Kt(t,t,1):void 0}}function Ar(o,t,r,l){return typeof o=="number"&&o>=0&&o<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?l===void 0||typeof l=="number"&&l>=0&&l<=1?null:`Invalid rgba value [${[o,t,r,l].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof l=="number"?[o,t,r,l]:[o,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function o8(o){if(o===null||typeof o=="string"||typeof o=="boolean"||typeof o=="number"||o instanceof Kt||o instanceof s5||o instanceof A6||o instanceof mt||o instanceof Yt||o instanceof Xt||o instanceof wt||o instanceof o6||o instanceof d6)return!0;if(Array.isArray(o)){for(let t of o)if(!o8(t))return!1;return!0}if(typeof o=="object"){for(let t in o)if(!o8(o[t]))return!1;return!0}return!1}function j5(o){if(o===null)return f5;if(typeof o=="string")return L2;if(typeof o=="boolean")return _2;if(typeof o=="number")return G1;if(o instanceof s5)return Wt;if(o instanceof Kt)return M8;if(o instanceof A6)return M3;if(o instanceof mt)return a9;if(o instanceof Yt)return s9;if(o instanceof Xt)return b8;if(o instanceof wt)return j6;if(o instanceof o6)return c9;if(o instanceof d6)return l9;if(Array.isArray(o)){let t=o.length,r;for(let l of o){let h=j5(l);if(r){if(r===h)continue;r=V2;break}r=h}return b6(r||V2,t)}return It}function h9(o){let t=typeof o;return o===null?"":t==="string"||t==="number"||t==="boolean"?String(o):o instanceof s5||o instanceof Kt||o instanceof mt||o instanceof Yt||o instanceof Xt||o instanceof wt||o instanceof o6||o instanceof d6?o.toString():JSON.stringify(o)}class a8{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!o8(t[1]))return r.error("invalid value");let l=t[1],h=j5(l),d=r.expectedType;return h.kind!=="array"||h.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(h=d),new a8(h,l)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Q9={string:L2,number:G1,boolean:_2,object:It};class p6{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l,h=1,d=t[0];if(d==="array"){let x,_;if(t.length>2){let b=t[1];if(typeof b!="string"||!(b in Q9)||b==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);x=Q9[b],h++}else x=V2;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],h++}l=b6(x,_)}else{if(!Q9[d])throw new Error(`Types doesn't contain name = ${d}`);l=Q9[d]}let f=[];for(;h<t.length;h++){let x=r.parse(t[h],h,V2);if(!x)return null;f.push(x)}return new p6(l,f)}evaluate(t){for(let r=0;r<this.args.length;r++){let l=this.args[r].evaluate(t);if(!u3(this.type,j5(l)))return l;if(r===this.args.length-1)throw new N5(`Expected value to be of type ${O5(this.type)}, but found ${O5(j5(l))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}let q5={"to-boolean":_2,"to-color":Wt,"to-number":G1,"to-string":L2};class C3{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=t[0];if(!q5[l])throw new Error(`Can't parse ${l} as it is not part of the known types`);if((l==="to-boolean"||l==="to-string")&&t.length!==2)return r.error("Expected one argument.");let h=q5[l],d=[];for(let f=1;f<t.length;f++){let x=r.parse(t[f],f,V2);if(!x)return null;d.push(x)}return new C3(h,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,l;for(let h of this.args){if(r=h.evaluate(t),l=null,r instanceof s5)return r;if(typeof r=="string"){let d=t.parseColor(r);if(d)return d}else if(Array.isArray(r)&&(l=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ar(r[0],r[1],r[2],r[3]),!l))return new s5(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new N5(l||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let l of this.args){r=l.evaluate(t);let h=Yt.parse(r);if(h)return h}throw new N5(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(let l of this.args){r=l.evaluate(t);let h=Xt.parse(r);if(h)return h}throw new N5(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(let l of this.args){r=l.evaluate(t);let h=wt.parse(r);if(h)return h}throw new N5(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let l of this.args){r=l.evaluate(t);let h=o6.parse(r);if(h)return h}throw new N5(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let l of this.args){if(r=l.evaluate(t),r===null)return 0;let h=Number(r);if(!isNaN(h))return h}throw new N5(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return mt.fromString(h9(this.args[0].evaluate(t)));case"resolvedImage":return d6.fromString(h9(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return h9(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}let M5=["Unknown","Point","LineString","Polygon"];class t5{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?M5[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache.get(t);return r||(r=s5.parse(t),this._parseColorCache.set(t,r)),r}}class C9{constructor(t,r,l=[],h,d=new I5,f=[]){this.registry=t,this.path=l,this.key=l.map((x=>`[${x}]`)).join(""),this.scope=d,this.errors=f,this.expectedType=h,this._isConstant=r}parse(t,r,l,h,d={}){return r?this.concat(r,l,h)._parse(t,d):this._parse(t,d)}_parse(t,r){function l(h,d,f){return f==="assert"?new p6(d,[h]):f==="coerce"?new C3(d,[h]):h}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let h=t[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let d=this.registry[h];if(d){let f=d.parse(t,this);if(!f)return null;if(this.expectedType){let x=this.expectedType,_=f.type;if(x.kind!=="string"&&x.kind!=="number"&&x.kind!=="boolean"&&x.kind!=="object"&&x.kind!=="array"||_.kind!=="value"){if(x.kind==="projectionDefinition"&&["string","array"].includes(_.kind)||["color","formatted","resolvedImage"].includes(x.kind)&&["value","string"].includes(_.kind)||["padding","numberArray"].includes(x.kind)&&["value","number","array"].includes(_.kind)||x.kind==="colorArray"&&["value","string","array"].includes(_.kind)||x.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(_.kind))f=l(f,x,r.typeAnnotation||"coerce");else if(this.checkSubtype(x,_))return null}else f=l(f,x,r.typeAnnotation||"assert")}if(!(f instanceof a8)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){let x=new t5;try{f=new a8(f.type,f.evaluate(x))}catch(_){return this.error(_.message),null}}return f}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,l){let h=typeof t=="number"?this.path.concat(t):this.path,d=l?this.scope.concat(l):this.scope;return new C9(this.registry,this._isConstant,h,r||null,d,this.errors)}error(t,...r){let l=`${this.key}${r.map((h=>`[${h}]`)).join("")}`;this.errors.push(new a5(l,t))}checkSubtype(t,r){let l=u3(t,r);return l&&this.error(l),l}}class m5{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let l=[];for(let d=1;d<t.length-1;d+=2){let f=t[d];if(typeof f!="string")return r.error(`Expected string, but found ${typeof f} instead.`,d);if(/[^a-zA-Z0-9_]/.test(f))return r.error("Variable names must contain only alphanumeric characters or '_'.",d);let x=r.parse(t[d+1],d+1);if(!x)return null;l.push([f,x])}let h=r.parse(t[t.length-1],t.length-1,r.expectedType,l);return h?new m5(l,h):null}outputDefined(){return this.result.outputDefined()}}class d9{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let l=t[1];return r.scope.has(l)?new d9(l,r.scope.get(l)):r.error(`Unknown variable "${l}". Make sure "${l}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class q6{constructor(t,r,l){this.type=t,this.index=r,this.input=l}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let l=r.parse(t[1],1,G1),h=r.parse(t[2],2,b6(r.expectedType||V2));return l&&h?new q6(h.type.itemType,l,h):null}evaluate(t){let r=this.index.evaluate(t),l=this.input.evaluate(t);if(r<0)throw new N5(`Array index out of bounds: ${r} < 0.`);if(r>=l.length)throw new N5(`Array index out of bounds: ${r} > ${l.length-1}.`);if(r!==Math.floor(r))throw new N5(`Array index must be an integer, but found ${r} instead.`);return l[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class te{constructor(t,r){this.type=_2,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let l=r.parse(t[1],1,V2),h=r.parse(t[2],2,V2);return l&&h?J9(l.type,[_2,L2,G1,f5,V2])?new te(l,h):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${O5(l.type)} instead`):null}evaluate(t){let r=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!l)return!1;if(!rt(r,["boolean","string","number","null"]))throw new N5(`Expected first argument to be of type boolean, string, number or null, but found ${O5(j5(r))} instead.`);if(!rt(l,["string","array"]))throw new N5(`Expected second argument to be of type array or string, but found ${O5(j5(l))} instead.`);return l.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class S8{constructor(t,r,l){this.type=G1,this.needle=t,this.haystack=r,this.fromIndex=l}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 l=r.parse(t[1],1,V2),h=r.parse(t[2],2,V2);if(!l||!h)return null;if(!J9(l.type,[_2,L2,G1,f5,V2]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${O5(l.type)} instead`);if(t.length===4){let d=r.parse(t[3],3,G1);return d?new S8(l,h,d):null}return new S8(l,h)}evaluate(t){let r=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!rt(r,["boolean","string","number","null"]))throw new N5(`Expected first argument to be of type boolean, string, number or null, but found ${O5(j5(r))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(t)),rt(l,["string"])){let d=l.indexOf(r,h);return d===-1?-1:[...l.slice(0,d)].length}if(rt(l,["array"]))return l.indexOf(r,h);throw new N5(`Expected second argument to be of type array or string, but found ${O5(j5(l))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class m0{constructor(t,r,l,h,d,f){this.inputType=t,this.type=r,this.input=l,this.cases=h,this.outputs=d,this.otherwise=f}static parse(t,r){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.");let l,h;r.expectedType&&r.expectedType.kind!=="value"&&(h=r.expectedType);let d={},f=[];for(let b=2;b<t.length-1;b+=2){let z=t[b],P=t[b+1];Array.isArray(z)||(z=[z]);let k=r.concat(b);if(z.length===0)return k.error("Expected at least one branch label.");for(let N of z){if(typeof N!="number"&&typeof N!="string")return k.error("Branch labels must be numbers or strings.");if(typeof N=="number"&&Math.abs(N)>Number.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return k.error("Numeric branch labels must be integer values.");if(l){if(k.checkSubtype(l,j5(N)))return null}else l=j5(N);if(d[String(N)]!==void 0)return k.error("Branch labels must be unique.");d[String(N)]=f.length}let D=r.parse(P,b,h);if(!D)return null;h=h||D.type,f.push(D)}let x=r.parse(t[1],1,V2);if(!x)return null;let _=r.parse(t[t.length-1],t.length-1,h);return _?x.type.kind!=="value"&&r.concat(1).checkSubtype(l,x.type)?null:new m0(l,h,x,d,f,_):null}evaluate(t){let r=this.input.evaluate(t);return(j5(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class ee{constructor(t,r,l){this.type=t,this.branches=r,this.otherwise=l}static parse(t,r){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.");let l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);let h=[];for(let f=1;f<t.length-1;f+=2){let x=r.parse(t[f],f,_2);if(!x)return null;let _=r.parse(t[f+1],f+1,l);if(!_)return null;h.push([x,_]),l=l||_.type}let d=r.parse(t[t.length-1],t.length-1,l);if(!d)return null;if(!l)throw new Error("Can't infer output type");return new ee(l,h,d)}evaluate(t){for(let[r,l]of this.branches)if(r.evaluate(t))return l.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,l]of this.branches)t(r),t(l);t(this.otherwise)}outputDefined(){return this.branches.every((([t,r])=>r.outputDefined()))&&this.otherwise.outputDefined()}}class ie{constructor(t,r,l,h){this.type=t,this.input=r,this.beginIndex=l,this.endIndex=h}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 l=r.parse(t[1],1,V2),h=r.parse(t[2],2,G1);if(!l||!h)return null;if(!J9(l.type,[b6(V2),L2,V2]))return r.error(`Expected first argument to be of type array or string, but found ${O5(l.type)} instead`);if(t.length===4){let d=r.parse(t[3],3,G1);return d?new ie(l.type,l,h,d):null}return new ie(l.type,l,h)}evaluate(t){let r=this.input.evaluate(t),l=this.beginIndex.evaluate(t),h;if(this.endIndex&&(h=this.endIndex.evaluate(t)),rt(r,["string"]))return[...r].slice(l,h).join("");if(rt(r,["array"]))return r.slice(l,h);throw new N5(`Expected first argument to be of type array or string, but found ${O5(j5(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function x0(o,t){let r=o.length-1,l,h,d=0,f=r,x=0;for(;d<=f;)if(x=Math.floor((d+f)/2),l=o[x],h=o[x+1],l<=t){if(x===r||t<h)return x;d=x+1}else{if(!(l>t))throw new N5("Input is not a number.");f=x-1}return 0}class p9{constructor(t,r,l){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(let[h,d]of l)this.labels.push(h),this.outputs.push(d)}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 l=r.parse(t[1],1,G1);if(!l)return null;let h=[],d=null;r.expectedType&&r.expectedType.kind!=="value"&&(d=r.expectedType);for(let f=1;f<t.length;f+=2){let x=f===1?-1/0:t[f],_=t[f+1],b=f,z=f+1;if(typeof x!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',b);if(h.length&&h[h.length-1][0]>=x)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);let P=r.parse(_,z,d);if(!P)return null;d=d||P.type,h.push([x,P])}return new p9(d,l,h)}evaluate(t){let r=this.labels,l=this.outputs;if(r.length===1)return l[0].evaluate(t);let h=this.input.evaluate(t);if(h<=r[0])return l[0].evaluate(t);let d=r.length;return h>=r[d-1]?l[d-1].evaluate(t):l[x0(r,h)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Br(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var d3,Gt,y0=(function(){if(Gt)return d3;function o(t,r,l,h){this.cx=3*t,this.bx=3*(l-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(h-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=l,this.p2y=h}return Gt=1,d3=o,o.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var l=t,h=0;h<8;h++){var d=this.sampleCurveX(l)-t;if(Math.abs(d)<r)return l;var f=this.sampleCurveDerivativeX(l);if(Math.abs(f)<1e-6)break;l-=d/f}var x=0,_=1;for(l=t,h=0;h<20&&(d=this.sampleCurveX(l),!(Math.abs(d-t)<r));h++)t>d?x=l:_=l,l=.5*(_-x)+x;return l},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},d3})(),kr=Br(y0);class Ut{constructor(t,r,l,h,d){this.type=t,this.operator=r,this.interpolation=l,this.input=h,this.labels=[],this.outputs=[];for(let[f,x]of d)this.labels.push(f),this.outputs.push(x)}static interpolationFactor(t,r,l,h){let d=0;if(t.name==="exponential")d=xt(r,t.base,l,h);else if(t.name==="linear")d=xt(r,1,l,h);else if(t.name==="cubic-bezier"){let f=t.controlPoints;d=new kr(f[0],f[1],f[2],f[3]).solve(xt(r,1,l,h))}return d}static parse(t,r){let[l,h,d,...f]=t;if(!Array.isArray(h)||h.length===0)return r.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){let b=h[1];if(typeof b!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:b}}else{if(h[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(h[0])}`,1,0);{let b=h.slice(1);if(b.length!==4||b.some((z=>typeof z!="number"||z<0||z>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:b}}}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(d=r.parse(d,2,G1),!d)return null;let x=[],_=null;l!=="interpolate-hcl"&&l!=="interpolate-lab"||r.expectedType==j6?r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType):_=Wt;for(let b=0;b<f.length;b+=2){let z=f[b],P=f[b+1],k=b+3,D=b+4;if(typeof z!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(x.length&&x[x.length-1][0]>=z)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);let N=r.parse(P,D,_);if(!N)return null;_=_||N.type,x.push([z,N])}return i8(_,G1)||i8(_,M8)||i8(_,Wt)||i8(_,s9)||i8(_,b8)||i8(_,j6)||i8(_,c9)||i8(_,b6(G1))?new Ut(_,l,h,d,x):r.error(`Type ${O5(_)} is not interpolatable.`)}evaluate(t){let r=this.labels,l=this.outputs;if(r.length===1)return l[0].evaluate(t);let h=this.input.evaluate(t);if(h<=r[0])return l[0].evaluate(t);let d=r.length;if(h>=r[d-1])return l[d-1].evaluate(t);let f=x0(r,h),x=Ut.interpolationFactor(this.interpolation,h,r[f],r[f+1]),_=l[f].evaluate(t),b=l[f+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return r8(_,b,x);case"color":return s5.interpolate(_,b,x);case"padding":return Yt.interpolate(_,b,x);case"colorArray":return wt.interpolate(_,b,x);case"numberArray":return Xt.interpolate(_,b,x);case"variableAnchorOffsetCollection":return o6.interpolate(_,b,x);case"array":return w8(_,b,x);case"projectionDefinition":return Kt.interpolate(_,b,x)}case"interpolate-hcl":switch(this.type.kind){case"color":return s5.interpolate(_,b,x,"hcl");case"colorArray":return wt.interpolate(_,b,x,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return s5.interpolate(_,b,x,"lab");case"colorArray":return wt.interpolate(_,b,x,"lab")}}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function xt(o,t,r,l){let h=l-r,d=o-r;return h===0?0:t===1?d/h:(Math.pow(t,d)-1)/(Math.pow(t,h)-1)}let H6={color:s5.interpolate,number:r8,padding:Yt.interpolate,numberArray:Xt.interpolate,colorArray:wt.interpolate,variableAnchorOffsetCollection:o6.interpolate,array:w8};class f9{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=null,h=r.expectedType;h&&h.kind!=="value"&&(l=h);let d=[];for(let x of t.slice(1)){let _=r.parse(x,1+d.length,l,void 0,{typeAnnotation:"omit"});if(!_)return null;l=l||_.type,d.push(_)}if(!l)throw new Error("No output type");let f=h&&d.some((x=>u3(h,x.type)));return new f9(f?V2:l,d)}evaluate(t){let r,l=null,h=0;for(let d of this.args)if(h++,l=d.evaluate(t),l&&l instanceof d6&&!l.available&&(r||(r=l.name),l=null,h===this.args.length&&(l=r)),l!==null)break;return l}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function n4(o,t){return o==="=="||o==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Rr(o,t,r,l){return l.compare(t,r)===0}function $6(o,t,r){let l=o!=="=="&&o!=="!=";return class dx{constructor(d,f,x){this.type=_2,this.lhs=d,this.rhs=f,this.collator=x,this.hasUntypedArgument=d.type.kind==="value"||f.type.kind==="value"}static parse(d,f){if(d.length!==3&&d.length!==4)return f.error("Expected two or three arguments.");let x=d[0],_=f.parse(d[1],1,V2);if(!_)return null;if(!n4(x,_.type))return f.concat(1).error(`"${x}" comparisons are not supported for type '${O5(_.type)}'.`);let b=f.parse(d[2],2,V2);if(!b)return null;if(!n4(x,b.type))return f.concat(2).error(`"${x}" comparisons are not supported for type '${O5(b.type)}'.`);if(_.type.kind!==b.type.kind&&_.type.kind!=="value"&&b.type.kind!=="value")return f.error(`Cannot compare types '${O5(_.type)}' and '${O5(b.type)}'.`);l&&(_.type.kind==="value"&&b.type.kind!=="value"?_=new p6(b.type,[_]):_.type.kind!=="value"&&b.type.kind==="value"&&(b=new p6(_.type,[b])));let z=null;if(d.length===4){if(_.type.kind!=="string"&&b.type.kind!=="string"&&_.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(z=f.parse(d[3],3,M3),!z)return null}return new dx(_,b,z)}evaluate(d){let f=this.lhs.evaluate(d),x=this.rhs.evaluate(d);if(l&&this.hasUntypedArgument){let _=j5(f),b=j5(x);if(_.kind!==b.kind||_.kind!=="string"&&_.kind!=="number")throw new N5(`Expected arguments for "${o}" to be (string, string) or (number, number), but found (${_.kind}, ${b.kind}) instead.`)}if(this.collator&&!l&&this.hasUntypedArgument){let _=j5(f),b=j5(x);if(_.kind!=="string"||b.kind!=="string")return t(d,f,x)}return this.collator?r(d,f,x,this.collator.evaluate(d)):t(d,f,x)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}let v0=$6("==",(function(o,t,r){return t===r}),Rr),o4=$6("!=",(function(o,t,r){return t!==r}),(function(o,t,r,l){return!Rr(0,t,r,l)})),os=$6("<",(function(o,t,r){return t<r}),(function(o,t,r,l){return l.compare(t,r)<0})),Dr=$6(">",(function(o,t,r){return t>r}),(function(o,t,r,l){return l.compare(t,r)>0})),_0=$6("<=",(function(o,t,r){return t<=r}),(function(o,t,r,l){return l.compare(t,r)<=0})),M0=$6(">=",(function(o,t,r){return t>=r}),(function(o,t,r,l){return l.compare(t,r)>=0}));class f6{constructor(t,r,l){this.type=M3,this.locale=l,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let l=t[1];if(typeof l!="object"||Array.isArray(l))return r.error("Collator options argument must be an object.");let h=r.parse(l["case-sensitive"]!==void 0&&l["case-sensitive"],1,_2);if(!h)return null;let d=r.parse(l["diacritic-sensitive"]!==void 0&&l["diacritic-sensitive"],1,_2);if(!d)return null;let f=null;return l.locale&&(f=r.parse(l.locale,1,L2),!f)?null:new f6(h,d,f)}evaluate(t){return new A6(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class b0{constructor(t,r,l,h,d){this.type=L2,this.number=t,this.locale=r,this.currency=l,this.minFractionDigits=h,this.maxFractionDigits=d}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let l=r.parse(t[1],1,G1);if(!l)return null;let h=t[2];if(typeof h!="object"||Array.isArray(h))return r.error("NumberFormat options argument must be an object.");let d=null;if(h.locale&&(d=r.parse(h.locale,1,L2),!d))return null;let f=null;if(h.currency&&(f=r.parse(h.currency,1,L2),!f))return null;let x=null;if(h["min-fraction-digits"]&&(x=r.parse(h["min-fraction-digits"],1,G1),!x))return null;let _=null;return h["max-fraction-digits"]&&(_=r.parse(h["max-fraction-digits"],1,G1),!_)?null:new b0(l,d,f,x,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class T8{constructor(t){this.type=a9,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let l=t[1];if(!Array.isArray(l)&&typeof l=="object")return r.error("First argument must be an image or text section.");let h=[],d=!1;for(let f=1;f<=t.length-1;++f){let x=t[f];if(d&&typeof x=="object"&&!Array.isArray(x)){d=!1;let _=null;if(x["font-scale"]&&(_=r.parse(x["font-scale"],1,G1),!_))return null;let b=null;if(x["text-font"]&&(b=r.parse(x["text-font"],1,b6(L2)),!b))return null;let z=null;if(x["text-color"]&&(z=r.parse(x["text-color"],1,Wt),!z))return null;let P=null;if(x["vertical-align"]){if(typeof x["vertical-align"]=="string"&&!g5.includes(x["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${x["vertical-align"]}' instead.`);if(P=r.parse(x["vertical-align"],1,L2),!P)return null}let k=h[h.length-1];k.scale=_,k.font=b,k.textColor=z,k.verticalAlign=P}else{let _=r.parse(t[f],1,V2);if(!_)return null;let b=_.type.kind;if(b!=="string"&&b!=="value"&&b!=="null"&&b!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,h.push({content:_,scale:null,font:null,textColor:null,verticalAlign:null})}}return new T8(h)}evaluate(t){return new mt(this.sections.map((r=>{let l=r.content.evaluate(t);return j5(l)===l9?new n8("",l,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new n8(h9(l),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)})))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}}class a4{constructor(t){this.type=l9,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let l=r.parse(t[1],1,L2);return l?new a4(l):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),l=d6.fromString(r);return l&&t.availableImages&&(l.available=t.availableImages.indexOf(r)>-1),l}eachChild(t){t(this.input)}outputDefined(){return!1}}class re{constructor(t){this.type=G1,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let l=r.parse(t[1],1);return l?l.type.kind!=="array"&&l.type.kind!=="string"&&l.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${O5(l.type)} instead.`):new re(l):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new N5(`Expected value to be of type string or array, but found ${O5(j5(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let p3=8192;function as(o,t){let r=(180+o[0])/360,l=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o[1]*Math.PI/360)))/360,h=Math.pow(2,t.z);return[Math.round(r*h*p3),Math.round(l*h*p3)]}function s4(o,t){let r=Math.pow(2,t.z);return[(h=(o[0]/p3+t.x)/r,360*h-180),(l=(o[1]/p3+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90)];var l,h}function ne(o,t){o[0]=Math.min(o[0],t[0]),o[1]=Math.min(o[1],t[1]),o[2]=Math.max(o[2],t[0]),o[3]=Math.max(o[3],t[1])}function s8(o,t){return!(o[0]<=t[0]||o[2]>=t[2]||o[1]<=t[1]||o[3]>=t[3])}function ss(o,t,r){let l=o[0]-t[0],h=o[1]-t[1],d=o[0]-r[0],f=o[1]-r[1];return l*f-d*h==0&&l*d<=0&&h*f<=0}function oe(o,t,r,l){return(h=[l[0]-r[0],l[1]-r[1]])[0]*(d=[t[0]-o[0],t[1]-o[1]])[1]-h[1]*d[0]!=0&&!(!Vr(o,t,r,l)||!Vr(r,l,o,t));var h,d}function Fr(o,t,r){for(let l of r)for(let h=0;h<l.length-1;++h)if(oe(o,t,l[h],l[h+1]))return!0;return!1}function g9(o,t,r=!1){let l=!1;for(let x of t)for(let _=0;_<x.length-1;_++){if(ss(o,x[_],x[_+1]))return r;(d=x[_])[1]>(h=o)[1]!=(f=x[_+1])[1]>h[1]&&h[0]<(f[0]-d[0])*(h[1]-d[1])/(f[1]-d[1])+d[0]&&(l=!l)}var h,d,f;return l}function Or(o,t){for(let r of t)if(g9(o,r))return!0;return!1}function Nr(o,t){for(let r of o)if(!g9(r,t))return!1;for(let r=0;r<o.length-1;++r)if(Fr(o[r],o[r+1],t))return!1;return!0}function ls(o,t){for(let r of t)if(Nr(o,r))return!0;return!1}function Vr(o,t,r,l){let h=l[0]-r[0],d=l[1]-r[1],f=(o[0]-r[0])*d-h*(o[1]-r[1]),x=(t[0]-r[0])*d-h*(t[1]-r[1]);return f>0&&x<0||f<0&&x>0}function l4(o,t,r){let l=[];for(let h=0;h<o.length;h++){let d=[];for(let f=0;f<o[h].length;f++){let x=as(o[h][f],r);ne(t,x),d.push(x)}l.push(d)}return l}function Gr(o,t,r){let l=[];for(let h=0;h<o.length;h++){let d=l4(o[h],t,r);l.push(d)}return l}function c4(o,t,r,l){if(o[0]<r[0]||o[0]>r[2]){let h=.5*l,d=o[0]-r[0]>h?-l:r[0]-o[0]>h?l:0;d===0&&(d=o[0]-r[2]>h?-l:r[2]-o[0]>h?l:0),o[0]+=d}ne(t,o)}function L4(o,t,r,l){let h=Math.pow(2,l.z)*p3,d=[l.x*p3,l.y*p3],f=[];for(let x of o)for(let _ of x){let b=[_.x+d[0],_.y+d[1]];c4(b,t,r,h),f.push(b)}return f}function u4(o,t,r,l){let h=Math.pow(2,l.z)*p3,d=[l.x*p3,l.y*p3],f=[];for(let _ of o){let b=[];for(let z of _){let P=[z.x+d[0],z.y+d[1]];ne(t,P),b.push(P)}f.push(b)}if(t[2]-t[0]<=h/2){(x=t)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(let _ of f)for(let b of _)c4(b,t,r,h)}var x;return f}class z8{constructor(t,r){this.type=_2,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(o8(t[1])){let l=t[1];if(l.type==="FeatureCollection"){let h=[];for(let d of l.features){let{type:f,coordinates:x}=d.geometry;f==="Polygon"&&h.push(x),f==="MultiPolygon"&&h.push(...x)}if(h.length)return new z8(l,{type:"MultiPolygon",coordinates:h})}else if(l.type==="Feature"){let h=l.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new z8(l,l.geometry)}else if(l.type==="Polygon"||l.type==="MultiPolygon")return new z8(l,l)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,l){let h=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(l.type==="Polygon"){let x=l4(l.coordinates,d,f),_=L4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!g9(b,x))return!1}if(l.type==="MultiPolygon"){let x=Gr(l.coordinates,d,f),_=L4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!Or(b,x))return!1}return!0})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,l){let h=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(l.type==="Polygon"){let x=l4(l.coordinates,d,f),_=u4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!Nr(b,x))return!1}if(l.type==="MultiPolygon"){let x=Gr(l.coordinates,d,f),_=u4(r.geometry(),h,d,f);if(!s8(h,d))return!1;for(let b of _)if(!ls(b,x))return!1}return!0})(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ur=class{constructor(o=[],t=(r,l)=>r<l?-1:r>l?1:0){if(this.data=o,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(o){this.data.push(o),this._up(this.length++)}pop(){if(this.length===0)return;let o=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),o}peek(){return this.data[0]}_up(o){let{data:t,compare:r}=this,l=t[o];for(;o>0;){let h=o-1>>1,d=t[h];if(r(l,d)>=0)break;t[o]=d,o=h}t[o]=l}_down(o){let{data:t,compare:r}=this,l=this.length>>1,h=t[o];for(;o<l;){let d=1+(o<<1),f=d+1;if(f<this.length&&r(t[f],t[d])<0&&(d=f),r(t[d],h)>=0)break;t[o]=t[d],o=d}t[o]=h}};function jr(o,t,r=0,l=o.length-1,h=w0){for(;l>r;){if(l-r>600){let _=l-r+1,b=t-r+1,z=Math.log(_),P=.5*Math.exp(2*z/3),k=.5*Math.sqrt(z*P*(_-P)/_)*(b-_/2<0?-1:1);jr(o,t,Math.max(r,Math.floor(t-b*P/_+k)),Math.min(l,Math.floor(t+(_-b)*P/_+k)),h)}let d=o[t],f=r,x=l;for(ae(o,r,t),h(o[l],d)>0&&ae(o,r,l);f<x;){for(ae(o,f,x),f++,x--;h(o[f],d)<0;)f++;for(;h(o[x],d)>0;)x--}h(o[r],d)===0?ae(o,r,x):(x++,ae(o,x,l)),x<=t&&(r=x+1),t<=x&&(l=x-1)}}function ae(o,t,r){let l=o[t];o[t]=o[r],o[r]=l}function w0(o,t){return o<t?-1:o>t?1:0}function se(o,t){if(o.length<=1)return[o];let r=[],l,h;for(let d of o){let f=Ls(d);f!==0&&(d.area=Math.abs(f),h===void 0&&(h=f<0),h===f<0?(l&&r.push(l),l=[d]):l.push(d))}if(l&&r.push(l),t>1)for(let d=0;d<r.length;d++)r[d].length<=t||(jr(r[d],t,1,r[d].length-1,cs),r[d]=r[d].slice(0,t));return r}function cs(o,t){return t.area-o.area}function Ls(o){let t=0;for(let r,l,h=0,d=o.length,f=d-1;h<d;f=h++)r=o[h],l=o[f],t+=(l.x-r.x)*(r.y+l.y);return t}let qr=1/298.257223563,S0=qr*(2-qr),h4=Math.PI/180;class C4{constructor(t){let r=6378.137*h4*1e3,l=Math.cos(t*h4),h=1/(1-S0*(1-l*l)),d=Math.sqrt(h);this.kx=r*d*l,this.ky=r*d*h*(1-S0)}distance(t,r){let l=this.wrap(t[0]-r[0])*this.kx,h=(t[1]-r[1])*this.ky;return Math.sqrt(l*l+h*h)}pointOnLine(t,r){let l,h,d,f,x=1/0;for(let _=0;_<t.length-1;_++){let b=t[_][0],z=t[_][1],P=this.wrap(t[_+1][0]-b)*this.kx,k=(t[_+1][1]-z)*this.ky,D=0;P===0&&k===0||(D=(this.wrap(r[0]-b)*this.kx*P+(r[1]-z)*this.ky*k)/(P*P+k*k),D>1?(b=t[_+1][0],z=t[_+1][1]):D>0&&(b+=P/this.kx*D,z+=k/this.ky*D)),P=this.wrap(r[0]-b)*this.kx,k=(r[1]-z)*this.ky;let N=P*P+k*k;N<x&&(x=N,l=b,h=z,d=_,f=D)}return{point:[l,h],index:d,t:Math.max(0,Math.min(1,f))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Hr(o,t){return t[0]-o[0]}function le(o){return o[1]-o[0]+1}function f3(o,t){return o[1]>=o[0]&&o[1]<t}function d4(o,t){if(o[0]>o[1])return[null,null];let r=le(o);if(t){if(r===2)return[o,null];let h=Math.floor(r/2);return[[o[0],o[0]+h],[o[0]+h,o[1]]]}if(r===1)return[o,null];let l=Math.floor(r/2)-1;return[[o[0],o[0]+l],[o[0]+l+1,o[1]]]}function p4(o,t){if(!f3(t,o.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let l=t[0];l<=t[1];++l)ne(r,o[l]);return r}function f4(o){let t=[1/0,1/0,-1/0,-1/0];for(let r of o)for(let l of r)ne(t,l);return t}function g4(o){return o[0]!==-1/0&&o[1]!==-1/0&&o[2]!==1/0&&o[3]!==1/0}function m4(o,t,r){if(!g4(o)||!g4(t))return NaN;let l=0,h=0;return o[2]<t[0]&&(l=t[0]-o[2]),o[0]>t[2]&&(l=o[0]-t[2]),o[1]>t[3]&&(h=o[1]-t[3]),o[3]<t[1]&&(h=t[1]-o[3]),r.distance([0,0],[l,h])}function Z8(o,t,r){let l=r.pointOnLine(t,o);return r.distance(o,l.point)}function x4(o,t,r,l,h){let d=Math.min(Z8(o,[r,l],h),Z8(t,[r,l],h)),f=Math.min(Z8(r,[o,t],h),Z8(l,[o,t],h));return Math.min(d,f)}function us(o,t,r,l,h){if(!f3(t,o.length)||!f3(l,r.length))return 1/0;let d=1/0;for(let f=t[0];f<t[1];++f){let x=o[f],_=o[f+1];for(let b=l[0];b<l[1];++b){let z=r[b],P=r[b+1];if(oe(x,_,z,P))return 0;d=Math.min(d,x4(x,_,z,P,h))}}return d}function S5(o,t,r,l,h){if(!f3(t,o.length)||!f3(l,r.length))return NaN;let d=1/0;for(let f=t[0];f<=t[1];++f)for(let x=l[0];x<=l[1];++x)if(d=Math.min(d,h.distance(o[f],r[x])),d===0)return d;return d}function hs(o,t,r){if(g9(o,t,!0))return 0;let l=1/0;for(let h of t){let d=h[0],f=h[h.length-1];if(d!==f&&(l=Math.min(l,Z8(o,[f,d],r)),l===0))return l;let x=r.pointOnLine(h,o);if(l=Math.min(l,r.distance(o,x.point)),l===0)return l}return l}function Cs(o,t,r,l){if(!f3(t,o.length))return NaN;for(let d=t[0];d<=t[1];++d)if(g9(o[d],r,!0))return 0;let h=1/0;for(let d=t[0];d<t[1];++d){let f=o[d],x=o[d+1];for(let _ of r)for(let b=0,z=_.length,P=z-1;b<z;P=b++){let k=_[P],D=_[b];if(oe(f,x,k,D))return 0;h=Math.min(h,x4(f,x,k,D,l))}}return h}function $r(o,t){for(let r of o)for(let l of r)if(g9(l,t,!0))return!0;return!1}function ds(o,t,r,l=1/0){let h=f4(o),d=f4(t);if(l!==1/0&&m4(h,d,r)>=l)return l;if(s8(h,d)){if($r(o,t))return 0}else if($r(t,o))return 0;let f=1/0;for(let x of o)for(let _=0,b=x.length,z=b-1;_<b;z=_++){let P=x[z],k=x[_];for(let D of t)for(let N=0,U=D.length,$=U-1;N<U;$=N++){let J=D[$],L1=D[N];if(oe(P,k,J,L1))return 0;f=Math.min(f,x4(P,k,J,L1,r))}}return f}function Wr(o,t,r,l,h,d){if(!d)return;let f=m4(p4(l,d),h,r);f<t&&o.push([f,d,[0,0]])}function T0(o,t,r,l,h,d,f){if(!d||!f)return;let x=m4(p4(l,d),p4(h,f),r);x<t&&o.push([x,d,f])}function z0(o,t,r,l,h=1/0){let d=Math.min(l.distance(o[0],r[0][0]),h);if(d===0)return d;let f=new Ur([[0,[0,o.length-1],[0,0]]],Hr),x=f4(r);for(;f.length>0;){let _=f.pop();if(_[0]>=d)continue;let b=_[1],z=t?50:100;if(le(b)<=z){if(!f3(b,o.length))return NaN;if(t){let P=Cs(o,b,r,l);if(isNaN(P)||P===0)return P;d=Math.min(d,P)}else for(let P=b[0];P<=b[1];++P){let k=hs(o[P],r,l);if(d=Math.min(d,k),d===0)return 0}}else{let P=d4(b,t);Wr(f,d,l,o,x,P[0]),Wr(f,d,l,o,x,P[1])}}return d}function Z0(o,t,r,l,h,d=1/0){let f=Math.min(d,h.distance(o[0],r[0]));if(f===0)return f;let x=new Ur([[0,[0,o.length-1],[0,r.length-1]]],Hr);for(;x.length>0;){let _=x.pop();if(_[0]>=f)continue;let b=_[1],z=_[2],P=t?50:100,k=l?50:100;if(le(b)<=P&&le(z)<=k){if(!f3(b,o.length)&&f3(z,r.length))return NaN;let D;if(t&&l)D=us(o,b,r,z,h),f=Math.min(f,D);else if(t&&!l){let N=o.slice(b[0],b[1]+1);for(let U=z[0];U<=z[1];++U)if(D=Z8(r[U],N,h),f=Math.min(f,D),f===0)return f}else if(!t&&l){let N=r.slice(z[0],z[1]+1);for(let U=b[0];U<=b[1];++U)if(D=Z8(o[U],N,h),f=Math.min(f,D),f===0)return f}else D=S5(o,b,r,z,h),f=Math.min(f,D)}else{let D=d4(b,t),N=d4(z,l);T0(x,f,h,o,r,D[0],N[0]),T0(x,f,h,o,r,D[0],N[1]),T0(x,f,h,o,r,D[1],N[0]),T0(x,f,h,o,r,D[1],N[1])}}return f}function y4(o){return o.type==="MultiPolygon"?o.coordinates.map((t=>({type:"Polygon",coordinates:t}))):o.type==="MultiLineString"?o.coordinates.map((t=>({type:"LineString",coordinates:t}))):o.type==="MultiPoint"?o.coordinates.map((t=>({type:"Point",coordinates:t}))):[o]}class E8{constructor(t,r){this.type=G1,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(o8(t[1])){let l=t[1];if(l.type==="FeatureCollection")return new E8(l,l.features.map((h=>y4(h.geometry))).flat());if(l.type==="Feature")return new E8(l,y4(l.geometry));if("type"in l&&"coordinates"in l)return new E8(l,y4(l))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(r,l){let h=r.geometry(),d=h.flat().map((_=>s4([_.x,_.y],r.canonical)));if(h.length===0)return NaN;let f=new C4(d[0][1]),x=1/0;for(let _ of l){switch(_.type){case"Point":x=Math.min(x,Z0(d,!1,[_.coordinates],!1,f,x));break;case"LineString":x=Math.min(x,Z0(d,!1,_.coordinates,!0,f,x));break;case"Polygon":x=Math.min(x,z0(d,!1,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries);if(t.geometryType()==="LineString")return(function(r,l){let h=r.geometry(),d=h.flat().map((_=>s4([_.x,_.y],r.canonical)));if(h.length===0)return NaN;let f=new C4(d[0][1]),x=1/0;for(let _ of l){switch(_.type){case"Point":x=Math.min(x,Z0(d,!0,[_.coordinates],!1,f,x));break;case"LineString":x=Math.min(x,Z0(d,!0,_.coordinates,!0,f,x));break;case"Polygon":x=Math.min(x,z0(d,!0,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries);if(t.geometryType()==="Polygon")return(function(r,l){let h=r.geometry();if(h.length===0||h[0].length===0)return NaN;let d=se(h,0).map((_=>_.map((b=>b.map((z=>s4([z.x,z.y],r.canonical))))))),f=new C4(d[0][0][0][1]),x=1/0;for(let _ of l)for(let b of d){switch(_.type){case"Point":x=Math.min(x,z0([_.coordinates],!1,b,f,x));break;case"LineString":x=Math.min(x,z0(_.coordinates,!0,b,f,x));break;case"Polygon":x=Math.min(x,ds(b,_.coordinates,f,x))}if(x===0)return x}return x})(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class ce{constructor(t){this.type=V2,this.key=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let l=t[1];return l==null?r.error("Global state property must be defined."):typeof l!="string"?r.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new ce(l)}evaluate(t){var r;let l=(r=t.globals)===null||r===void 0?void 0:r.globalState;return l&&Object.keys(l).length!==0?b3(l,this.key):null}eachChild(){}outputDefined(){return!1}}let m9={"==":v0,"!=":o4,">":Dr,"<":os,">=":M0,"<=":_0,array:p6,at:q6,boolean:p6,case:ee,coalesce:f9,collator:f6,format:T8,image:a4,in:te,"index-of":S8,interpolate:Ut,"interpolate-hcl":Ut,"interpolate-lab":Ut,length:re,let:m5,literal:a8,match:m0,number:p6,"number-format":b0,object:p6,slice:ie,step:p9,string:p6,"to-boolean":C3,"to-color":C3,"to-number":C3,"to-string":C3,var:d9,within:z8,distance:E8,"global-state":ce};class B6{constructor(t,r,l,h){this.name=t,this.type=r,this._evaluate=l,this.args=h}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let l=t[0],h=B6.definitions[l];if(!h)return r.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0);let d=Array.isArray(h)?h[0]:h.type,f=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,x=f.filter((([b])=>!Array.isArray(b)||b.length===t.length-1)),_=null;for(let[b,z]of x){_=new C9(r.registry,E0,r.path,null,r.scope);let P=[],k=!1;for(let D=1;D<t.length;D++){let N=t[D],U=Array.isArray(b)?b[D-1]:b.type,$=_.parse(N,1+P.length,U);if(!$){k=!0;break}P.push($)}if(!k)if(Array.isArray(b)&&b.length!==P.length)_.error(`Expected ${b.length} arguments, but found ${P.length} instead.`);else{for(let D=0;D<P.length;D++){let N=Array.isArray(b)?b[D]:b.type,U=P[D];_.concat(D+1).checkSubtype(N,U.type)}if(_.errors.length===0)return new B6(l,d,z,P)}}if(x.length===1)r.errors.push(..._.errors);else{let b=(x.length?x:f).map((([P])=>{return k=P,Array.isArray(k)?`(${k.map(O5).join(", ")})`:`(${O5(k.type)}...)`;var k})).join(" | "),z=[];for(let P=1;P<t.length;P++){let k=r.parse(t[P],1+z.length);if(!k)return null;z.push(O5(k.type))}r.error(`Expected arguments of type ${b}, but found (${z.join(", ")}) instead.`)}return null}static register(t,r){B6.definitions=r;for(let l in r)t[l]=B6}}function Yr(o,[t,r,l,h]){t=t.evaluate(o),r=r.evaluate(o),l=l.evaluate(o);let d=h?h.evaluate(o):1,f=Ar(t,r,l,d);if(f)throw new N5(f);return new s5(t/255,r/255,l/255,d,!1)}function Xr(o,t){return o in t}function v4(o,t){let r=t[o];return r===void 0?null:r}function I8(o){return{type:o}}function E0(o){if(o instanceof d9)return E0(o.boundExpression);if(o instanceof B6&&o.name==="error"||o instanceof f6||o instanceof z8||o instanceof E8||o instanceof ce)return!1;let t=o instanceof C3||o instanceof p6,r=!0;return o.eachChild((l=>{r=t?r&&E0(l):r&&l instanceof a8})),!!r&&I0(o)&&P0(o,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function I0(o){if(o instanceof B6&&(o.name==="get"&&o.args.length===1||o.name==="feature-state"||o.name==="has"&&o.args.length===1||o.name==="properties"||o.name==="geometry-type"||o.name==="id"||/^filter-/.test(o.name))||o instanceof z8||o instanceof E8)return!1;let t=!0;return o.eachChild((r=>{t&&!I0(r)&&(t=!1)})),t}function Le(o){if(o instanceof B6&&o.name==="feature-state")return!1;let t=!0;return o.eachChild((r=>{t&&!Le(r)&&(t=!1)})),t}function P0(o,t){if(o instanceof B6&&t.indexOf(o.name)>=0)return!1;let r=!0;return o.eachChild((l=>{r&&!P0(l,t)&&(r=!1)})),r}function Kr(o){return{result:"success",value:o}}function x9(o){return{result:"error",value:o}}function y9(o){return o["property-type"]==="data-driven"||o["property-type"]==="cross-faded-data-driven"}function Jr(o){return!!o.expression&&o.expression.parameters.indexOf("zoom")>-1}function _4(o){return!!o.expression&&o.expression.interpolated}function l5(o){return o instanceof Number?"number":o instanceof String?"string":o instanceof Boolean?"boolean":Array.isArray(o)?"array":o===null?"null":typeof o}function A0(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&j5(o)===It}function ps(o){return o}function Qr(o,t){let r=o.stops&&typeof o.stops[0][0]=="object",l=r||!(r||o.property!==void 0),h=o.type||(_4(t)?"exponential":"interval"),d=(function(z){switch(z.type){case"color":return s5.parse;case"padding":return Yt.parse;case"numberArray":return Xt.parse;case"colorArray":return wt.parse;default:return null}})(t);if(d&&((o=p5({},o)).stops&&(o.stops=o.stops.map((z=>[z[0],d(z[1])]))),o.default=d(o.default?o.default:t.default)),o.colorSpace&&(f=o.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${o.colorSpace}"`);var f;let x=(function(z){switch(z){case"exponential":return tn;case"interval":return fs;case"categorical":return M4;case"identity":return gs;default:throw new Error(`Unknown function type "${z}"`)}})(h),_,b;if(h==="categorical"){_=Object.create(null);for(let z of o.stops)_[z[0]]=z[1];b=typeof o.stops[0][0]}if(r){let z={},P=[];for(let N=0;N<o.stops.length;N++){let U=o.stops[N],$=U[0].zoom;z[$]===void 0&&(z[$]={zoom:$,type:o.type,property:o.property,default:o.default,stops:[]},P.push($)),z[$].stops.push([U[0].value,U[1]])}let k=[];for(let N of P)k.push([z[N].zoom,Qr(z[N],t)]);let D={name:"linear"};return{kind:"composite",interpolationType:D,interpolationFactor:Ut.interpolationFactor.bind(void 0,D),zoomStops:k.map((N=>N[0])),evaluate:({zoom:N},U)=>tn({stops:k,base:o.base},t,N).evaluate(N,U)}}if(l){let z=h==="exponential"?{name:"exponential",base:o.base!==void 0?o.base:1}:null;return{kind:"camera",interpolationType:z,interpolationFactor:Ut.interpolationFactor.bind(void 0,z),zoomStops:o.stops.map((P=>P[0])),evaluate:({zoom:P})=>x(o,t,P,_,b)}}return{kind:"source",evaluate(z,P){let k=P&&P.properties?P.properties[o.property]:void 0;return k===void 0?ue(o.default,t.default):x(o,t,k,_,b)}}}function ue(o,t,r){return o!==void 0?o:t!==void 0?t:r!==void 0?r:void 0}function M4(o,t,r,l,h){return ue(typeof r===h?l[r]:void 0,o.default,t.default)}function fs(o,t,r){if(l5(r)!=="number")return ue(o.default,t.default);let l=o.stops.length;if(l===1||r<=o.stops[0][0])return o.stops[0][1];if(r>=o.stops[l-1][0])return o.stops[l-1][1];let h=x0(o.stops.map((d=>d[0])),r);return o.stops[h][1]}function tn(o,t,r){let l=o.base!==void 0?o.base:1;if(l5(r)!=="number")return ue(o.default,t.default);let h=o.stops.length;if(h===1||r<=o.stops[0][0])return o.stops[0][1];if(r>=o.stops[h-1][0])return o.stops[h-1][1];let d=x0(o.stops.map((z=>z[0])),r),f=(function(z,P,k,D){let N=D-k,U=z-k;return N===0?0:P===1?U/N:(Math.pow(P,U)-1)/(Math.pow(P,N)-1)})(r,l,o.stops[d][0],o.stops[d+1][0]),x=o.stops[d][1],_=o.stops[d+1][1],b=H6[t.type]||ps;return typeof x.evaluate=="function"?{evaluate(...z){let P=x.evaluate.apply(void 0,z),k=_.evaluate.apply(void 0,z);if(P!==void 0&&k!==void 0)return b(P,k,f,o.colorSpace)}}:b(x,_,f,o.colorSpace)}function gs(o,t,r){switch(t.type){case"color":r=s5.parse(r);break;case"formatted":r=mt.fromString(r.toString());break;case"resolvedImage":r=d6.fromString(r.toString());break;case"padding":r=Yt.parse(r);break;case"colorArray":r=wt.parse(r);break;case"numberArray":r=Xt.parse(r);break;default:l5(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return ue(r,o.default,t.default)}B6.register(m9,{error:[{kind:"error"},[L2],(o,[t])=>{throw new N5(t.evaluate(o))}],typeof:[L2,[V2],(o,[t])=>O5(j5(t.evaluate(o)))],"to-rgba":[b6(G1,4),[Wt],(o,[t])=>{let[r,l,h,d]=t.evaluate(o).rgb;return[255*r,255*l,255*h,d]}],rgb:[Wt,[G1,G1,G1],Yr],rgba:[Wt,[G1,G1,G1,G1],Yr],has:{type:_2,overloads:[[[L2],(o,[t])=>Xr(t.evaluate(o),o.properties())],[[L2,It],(o,[t,r])=>Xr(t.evaluate(o),r.evaluate(o))]]},get:{type:V2,overloads:[[[L2],(o,[t])=>v4(t.evaluate(o),o.properties())],[[L2,It],(o,[t,r])=>v4(t.evaluate(o),r.evaluate(o))]]},"feature-state":[V2,[L2],(o,[t])=>v4(t.evaluate(o),o.featureState||{})],properties:[It,[],o=>o.properties()],"geometry-type":[L2,[],o=>o.geometryType()],id:[V2,[],o=>o.id()],zoom:[G1,[],o=>o.globals.zoom],"heatmap-density":[G1,[],o=>o.globals.heatmapDensity||0],elevation:[G1,[],o=>o.globals.elevation||0],"line-progress":[G1,[],o=>o.globals.lineProgress||0],accumulated:[V2,[],o=>o.globals.accumulated===void 0?null:o.globals.accumulated],"+":[G1,I8(G1),(o,t)=>{let r=0;for(let l of t)r+=l.evaluate(o);return r}],"*":[G1,I8(G1),(o,t)=>{let r=1;for(let l of t)r*=l.evaluate(o);return r}],"-":{type:G1,overloads:[[[G1,G1],(o,[t,r])=>t.evaluate(o)-r.evaluate(o)],[[G1],(o,[t])=>-t.evaluate(o)]]},"/":[G1,[G1,G1],(o,[t,r])=>t.evaluate(o)/r.evaluate(o)],"%":[G1,[G1,G1],(o,[t,r])=>t.evaluate(o)%r.evaluate(o)],ln2:[G1,[],()=>Math.LN2],pi:[G1,[],()=>Math.PI],e:[G1,[],()=>Math.E],"^":[G1,[G1,G1],(o,[t,r])=>Math.pow(t.evaluate(o),r.evaluate(o))],sqrt:[G1,[G1],(o,[t])=>Math.sqrt(t.evaluate(o))],log10:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))/Math.LN10],ln:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))],log2:[G1,[G1],(o,[t])=>Math.log(t.evaluate(o))/Math.LN2],sin:[G1,[G1],(o,[t])=>Math.sin(t.evaluate(o))],cos:[G1,[G1],(o,[t])=>Math.cos(t.evaluate(o))],tan:[G1,[G1],(o,[t])=>Math.tan(t.evaluate(o))],asin:[G1,[G1],(o,[t])=>Math.asin(t.evaluate(o))],acos:[G1,[G1],(o,[t])=>Math.acos(t.evaluate(o))],atan:[G1,[G1],(o,[t])=>Math.atan(t.evaluate(o))],min:[G1,I8(G1),(o,t)=>Math.min(...t.map((r=>r.evaluate(o))))],max:[G1,I8(G1),(o,t)=>Math.max(...t.map((r=>r.evaluate(o))))],abs:[G1,[G1],(o,[t])=>Math.abs(t.evaluate(o))],round:[G1,[G1],(o,[t])=>{let r=t.evaluate(o);return r<0?-Math.round(-r):Math.round(r)}],floor:[G1,[G1],(o,[t])=>Math.floor(t.evaluate(o))],ceil:[G1,[G1],(o,[t])=>Math.ceil(t.evaluate(o))],"filter-==":[_2,[L2,V2],(o,[t,r])=>o.properties()[t.value]===r.value],"filter-id-==":[_2,[V2],(o,[t])=>o.id()===t.value],"filter-type-==":[_2,[L2],(o,[t])=>o.geometryType()===t.value],"filter-<":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l<h}],"filter-id-<":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r<l}],"filter->":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l>h}],"filter-id->":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r>l}],"filter-<=":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l<=h}],"filter-id-<=":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r<=l}],"filter->=":[_2,[L2,V2],(o,[t,r])=>{let l=o.properties()[t.value],h=r.value;return typeof l==typeof h&&l>=h}],"filter-id->=":[_2,[V2],(o,[t])=>{let r=o.id(),l=t.value;return typeof r==typeof l&&r>=l}],"filter-has":[_2,[V2],(o,[t])=>t.value in o.properties()],"filter-has-id":[_2,[],o=>o.id()!==null&&o.id()!==void 0],"filter-type-in":[_2,[b6(L2)],(o,[t])=>t.value.indexOf(o.geometryType())>=0],"filter-id-in":[_2,[b6(V2)],(o,[t])=>t.value.indexOf(o.id())>=0],"filter-in-small":[_2,[L2,b6(V2)],(o,[t,r])=>r.value.indexOf(o.properties()[t.value])>=0],"filter-in-large":[_2,[L2,b6(V2)],(o,[t,r])=>(function(l,h,d,f){for(;d<=f;){let x=d+f>>1;if(h[x]===l)return!0;h[x]>l?f=x-1:d=x+1}return!1})(o.properties()[t.value],r.value,0,r.value.length-1)],all:{type:_2,overloads:[[[_2,_2],(o,[t,r])=>t.evaluate(o)&&r.evaluate(o)],[I8(_2),(o,t)=>{for(let r of t)if(!r.evaluate(o))return!1;return!0}]]},any:{type:_2,overloads:[[[_2,_2],(o,[t,r])=>t.evaluate(o)||r.evaluate(o)],[I8(_2),(o,t)=>{for(let r of t)if(r.evaluate(o))return!0;return!1}]]},"!":[_2,[_2],(o,[t])=>!t.evaluate(o)],"is-supported-script":[_2,[L2],(o,[t])=>{let r=o.globals&&o.globals.isSupportedScript;return!r||r(t.evaluate(o))}],upcase:[L2,[L2],(o,[t])=>t.evaluate(o).toUpperCase()],downcase:[L2,[L2],(o,[t])=>t.evaluate(o).toLowerCase()],concat:[L2,I8(V2),(o,t)=>t.map((r=>h9(r.evaluate(o)))).join("")],"resolved-locale":[L2,[M3],(o,[t])=>t.evaluate(o).resolvedLocale()]});class B0{constructor(t,r,l){this.expression=t,this._warningHistory={},this._evaluator=new t5,this._defaultValue=r?(function(h){if(h.type==="color"&&A0(h.default))return new s5(0,0,0,0);switch(h.type){case"color":return s5.parse(h.default)||null;case"padding":return Yt.parse(h.default)||null;case"numberArray":return Xt.parse(h.default)||null;case"colorArray":return wt.parse(h.default)||null;case"variableAnchorOffsetCollection":return o6.parse(h.default)||null;case"projectionDefinition":return Kt.parse(h.default)||null;default:return h.default===void 0?null:h.default}})(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=l}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=l,this._evaluator.canonical=h,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(t,r,l,h,d,f){this._globalState&&(t=v9(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=l||null,this._evaluator.canonical=h,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f||null;try{let x=this.expression.evaluate(this._evaluator);if(x==null||typeof x=="number"&&x!=x)return this._defaultValue;if(this._enumValues&&!(x in this._enumValues))throw new N5(`Expected value to be one of ${Object.keys(this._enumValues).map((_=>JSON.stringify(_))).join(", ")}, but found ${JSON.stringify(x)} instead.`);return x}catch(x){return this._warningHistory[x.message]||(this._warningHistory[x.message]=!0,typeof console<"u"&&console.warn(x.message)),this._defaultValue}}}function k0(o){return Array.isArray(o)&&o.length>0&&typeof o[0]=="string"&&o[0]in m9}function R0(o,t,r){let l=new C9(m9,E0,[],t?(function(d){let f={color:Wt,string:L2,number:G1,enum:L2,boolean:_2,formatted:a9,padding:s9,numberArray:b8,colorArray:j6,projectionDefinition:M8,resolvedImage:l9,variableAnchorOffsetCollection:c9};return d.type==="array"?b6(f[d.value]||V2,d.length):f[d.type]})(t):void 0),h=l.parse(o,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?Kr(new B0(h,t,r)):x9(l.errors)}class P8{constructor(t,r,l){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Le(r.expression),this.globalStateRefs=N0(r.expression),this._globalState=l}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,l,h,d,f)}evaluate(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluate(t,r,l,h,d,f)}}class D0{constructor(t,r,l,h,d){this.kind=t,this.zoomStops=l,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Le(r.expression),this.globalStateRefs=N0(r.expression),this.interpolationType=h,this._globalState=d}evaluateWithoutErrorHandling(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,l,h,d,f)}evaluate(t,r,l,h,d,f){return this._globalState&&(t=v9(t,this._globalState)),this._styleExpression.evaluate(t,r,l,h,d,f)}interpolationFactor(t,r,l){return this.interpolationType?Ut.interpolationFactor(this.interpolationType,t,r,l):0}}function en(o,t,r){let l=R0(o,t,r);if(l.result==="error")return l;let h=l.value.expression,d=I0(h);if(!d&&!y9(t))return x9([new a5("","data expressions not supported")]);let f=P0(h,["zoom"]);if(!f&&!Jr(t))return x9([new a5("","zoom expressions not supported")]);let x=O0(h);return x||f?x instanceof a5?x9([x]):x instanceof Ut&&!_4(t)?x9([new a5("",'"interpolate" expressions cannot be used with this property')]):Kr(x?new D0(d?"camera":"composite",l.value,x.labels,x instanceof Ut?x.interpolation:void 0,r):new P8(d?"constant":"source",l.value,r)):x9([new a5("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class F0{constructor(t,r){this._parameters=t,this._specification=r,p5(this,Qr(this._parameters,this._specification))}static deserialize(t){return new F0(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function O0(o){let t=null;if(o instanceof m5)t=O0(o.result);else if(o instanceof f9){for(let r of o.args)if(t=O0(r),t)break}else(o instanceof p9||o instanceof Ut)&&o.input instanceof B6&&o.input.name==="zoom"&&(t=o);return t instanceof a5||o.eachChild((r=>{let l=O0(r);l instanceof a5?t=l:!t&&l?t=new a5("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&l&&t!==l&&(t=new a5("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function N0(o,t=new Set){return o instanceof ce&&t.add(o.key),o.eachChild((r=>{N0(r,t)})),t}function v9(o,t){let{zoom:r,heatmapDensity:l,elevation:h,lineProgress:d,isSupportedScript:f,accumulated:x}=o??{};return{zoom:r,heatmapDensity:l,elevation:h,lineProgress:d,isSupportedScript:f,accumulated:x,globalState:t}}function V0(o){if(o===!0||o===!1)return!0;if(!Array.isArray(o)||o.length===0)return!1;switch(o[0]){case"has":return o.length>=2&&o[1]!=="$id"&&o[1]!=="$type";case"in":return o.length>=3&&(typeof o[1]!="string"||Array.isArray(o[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return o.length!==3||Array.isArray(o[1])||Array.isArray(o[2]);case"any":case"all":for(let t of o.slice(1))if(!V0(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}let rn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function he(o,t){if(o==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};V0(o)||(o=Ce(o));let r=R0(o,rn,t);if(r.result==="error")throw new Error(r.value.map((l=>`${l.key}: ${l.message}`)).join(", "));return{filter:(l,h,d)=>r.value.evaluate(l,h,{},d),needGeometry:b4(o),getGlobalStateRefs:()=>N0(r.value.expression)}}function ms(o,t){return o<t?-1:o>t?1:0}function b4(o){if(!Array.isArray(o))return!1;if(o[0]==="within"||o[0]==="distance")return!0;for(let t=1;t<o.length;t++)if(b4(o[t]))return!0;return!1}function Ce(o){if(!o)return!0;let t=o[0];return o.length<=1?t!=="any":t==="=="?G0(o[1],o[2],"=="):t==="!="?U0(G0(o[1],o[2],"==")):t==="<"||t===">"||t==="<="||t===">="?G0(o[1],o[2],t):t==="any"?(r=o.slice(1),["any"].concat(r.map(Ce))):t==="all"?["all"].concat(o.slice(1).map(Ce)):t==="none"?["all"].concat(o.slice(1).map(Ce).map(U0)):t==="in"?nn(o[1],o.slice(2)):t==="!in"?U0(nn(o[1],o.slice(2))):t==="has"?on(o[1]):t!=="!has"||U0(on(o[1]));var r}function G0(o,t,r){switch(o){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,o,t]}}function nn(o,t){if(t.length===0)return!1;switch(o){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((r=>typeof r!=typeof t[0]))?["filter-in-large",o,["literal",t.sort(ms)]]:["filter-in-small",o,["literal",t]]}}function on(o){switch(o){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",o]}}function U0(o){return["!",o]}function w4(o){let t=typeof o;if(t==="number"||t==="boolean"||t==="string"||o==null)return JSON.stringify(o);if(Array.isArray(o)){let h="[";for(let d of o)h+=`${w4(d)},`;return`${h}]`}let r=Object.keys(o).sort(),l="{";for(let h=0;h<r.length;h++)l+=`${JSON.stringify(r[h])}:${w4(o[r[h]])},`;return`${l}}`}function an(o){let t="";for(let r of M1)t+=`/${w4(o[r])}`;return t}function S4(o){let t=o.value;return t?[new H1(o.key,t,"constants have been deprecated as of v8")]:[]}function nt(o){return o instanceof Number||o instanceof String||o instanceof Boolean?o.valueOf():o}function w3(o){if(Array.isArray(o))return o.map(w3);if(o instanceof Object&&!(o instanceof Number||o instanceof String||o instanceof Boolean)){let t={};for(let r in o)t[r]=w3(o[r]);return t}return nt(o)}function g6(o){let t=o.key,r=o.value,l=o.valueSpec||{},h=o.objectElementValidators||{},d=o.style,f=o.styleSpec,x=o.validateSpec,_=[],b=l5(r);if(b!=="object")return[new H1(t,r,`object expected, ${b} found`)];for(let z in r){let P=z.split(".")[0],k=b3(l,P)||l["*"],D;if(b3(h,P))D=h[P];else if(b3(l,P))D=x;else if(h["*"])D=h["*"];else{if(!l["*"]){_.push(new H1(t,r[z],`unknown property "${z}"`));continue}D=x}_=_.concat(D({key:(t&&`${t}.`)+z,value:r[z],valueSpec:k,style:d,styleSpec:f,object:r,objectKey:z,validateSpec:x},r))}for(let z in l)h[z]||l[z].required&&l[z].default===void 0&&r[z]===void 0&&_.push(new H1(t,r,`missing required property "${z}"`));return _}function de(o){let t=o.value,r=o.valueSpec,l=o.style,h=o.styleSpec,d=o.key,f=o.arrayElementValidator||o.validateSpec;if(l5(t)!=="array")return[new H1(d,t,`array expected, ${l5(t)} found`)];if(r.length&&t.length!==r.length)return[new H1(d,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new H1(d,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let x={type:r.value,values:r.values};h.$version<7&&(x.function=r.function),l5(r.value)==="object"&&(x=r.value);let _=[];for(let b=0;b<t.length;b++)_=_.concat(f({array:t,arrayIndex:b,value:t[b],valueSpec:x,validateSpec:o.validateSpec,style:l,styleSpec:h,key:`${d}[${b}]`}));return _}function A8(o){let t=o.key,r=o.value,l=o.valueSpec,h=l5(r);return h==="number"&&r!=r&&(h="NaN"),h!=="number"?[new H1(t,r,`number expected, ${h} found`)]:"minimum"in l&&r<l.minimum?[new H1(t,r,`${r} is less than the minimum value ${l.minimum}`)]:"maximum"in l&&r>l.maximum?[new H1(t,r,`${r} is greater than the maximum value ${l.maximum}`)]:[]}function sn(o){let t=o.valueSpec,r=nt(o.value.type),l,h,d,f={},x=r!=="categorical"&&o.value.property===void 0,_=!x,b=l5(o.value.stops)==="array"&&l5(o.value.stops[0])==="array"&&l5(o.value.stops[0][0])==="object",z=g6({key:o.key,value:o.value,valueSpec:o.styleSpec.function,validateSpec:o.validateSpec,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{stops:function(D){if(r==="identity")return[new H1(D.key,D.value,'identity function may not have a "stops" property')];let N=[],U=D.value;return N=N.concat(de({key:D.key,value:U,valueSpec:D.valueSpec,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,arrayElementValidator:P})),l5(U)==="array"&&U.length===0&&N.push(new H1(D.key,U,"array must have at least one stop")),N},default:function(D){return D.validateSpec({key:D.key,value:D.value,valueSpec:t,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec})}}});return r==="identity"&&x&&z.push(new H1(o.key,o.value,'missing required property "property"')),r==="identity"||o.value.stops||z.push(new H1(o.key,o.value,'missing required property "stops"')),r==="exponential"&&o.valueSpec.expression&&!_4(o.valueSpec)&&z.push(new H1(o.key,o.value,"exponential functions not supported")),o.styleSpec.$version>=8&&(_&&!y9(o.valueSpec)?z.push(new H1(o.key,o.value,"property functions not supported")):x&&!Jr(o.valueSpec)&&z.push(new H1(o.key,o.value,"zoom functions not supported"))),r!=="categorical"&&!b||o.value.property!==void 0||z.push(new H1(o.key,o.value,'"property" property is required')),z;function P(D){let N=[],U=D.value,$=D.key;if(l5(U)!=="array")return[new H1($,U,`array expected, ${l5(U)} found`)];if(U.length!==2)return[new H1($,U,`array length 2 expected, length ${U.length} found`)];if(b){if(l5(U[0])!=="object")return[new H1($,U,`object expected, ${l5(U[0])} found`)];if(U[0].zoom===void 0)return[new H1($,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new H1($,U,"object stop key must have value")];if(d&&d>nt(U[0].zoom))return[new H1($,U[0].zoom,"stop zoom values must appear in ascending order")];nt(U[0].zoom)!==d&&(d=nt(U[0].zoom),h=void 0,f={}),N=N.concat(g6({key:`${$}[0]`,value:U[0],valueSpec:{zoom:{}},validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{zoom:A8,value:k}}))}else N=N.concat(k({key:`${$}[0]`,value:U[0],validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec},U));return k0(w3(U[1]))?N.concat([new H1(`${$}[1]`,U[1],"expressions are not allowed in function stops.")]):N.concat(D.validateSpec({key:`${$}[1]`,value:U[1],valueSpec:t,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec}))}function k(D,N){let U=l5(D.value),$=nt(D.value),J=D.value!==null?D.value:N;if(l){if(U!==l)return[new H1(D.key,J,`${U} stop domain type must match previous stop domain type ${l}`)]}else l=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new H1(D.key,J,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&r!=="categorical"){let L1=`number expected, ${U} found`;return y9(t)&&r===void 0&&(L1+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new H1(D.key,J,L1)]}return r!=="categorical"||U!=="number"||isFinite($)&&Math.floor($)===$?r!=="categorical"&&U==="number"&&h!==void 0&&$<h?[new H1(D.key,J,"stop domain values must appear in ascending order")]:(h=$,r==="categorical"&&$ in f?[new H1(D.key,J,"stop domain values must be unique")]:(f[$]=!0,[])):[new H1(D.key,J,`integer expected, found ${$}`)]}}function _9(o){let t=(o.expressionContext==="property"?en:R0)(w3(o.value),o.valueSpec);if(t.result==="error")return t.value.map((l=>new H1(`${o.key}${l.key}`,o.value,l.message)));let r=t.value.expression||t.value._styleExpression.expression;if(o.expressionContext==="property"&&o.propertyKey==="text-font"&&!r.outputDefined())return[new H1(o.key,o.value,`Invalid data expression for "${o.propertyKey}". Output values must be contained as literals within the expression.`)];if(o.expressionContext==="property"&&o.propertyType==="layout"&&!Le(r))return[new H1(o.key,o.value,'"feature-state" data expressions are not supported with layout properties.')];if(o.expressionContext==="filter"&&!Le(r))return[new H1(o.key,o.value,'"feature-state" data expressions are not supported with filters.')];if(o.expressionContext&&o.expressionContext.indexOf("cluster")===0){if(!P0(r,["zoom","feature-state"]))return[new H1(o.key,o.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(o.expressionContext==="cluster-initial"&&!I0(r))return[new H1(o.key,o.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function T4(o){let t=o.key,r=o.value,l=l5(r);return l!=="string"?[new H1(t,r,`color expected, ${l} found`)]:s5.parse(String(r))?[]:[new H1(t,r,`color expected, "${r}" found`)]}function pe(o){let t=o.key,r=o.value,l=o.valueSpec,h=[];return Array.isArray(l.values)?l.values.indexOf(nt(r))===-1&&h.push(new H1(t,r,`expected one of [${l.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(l.values).indexOf(nt(r))===-1&&h.push(new H1(t,r,`expected one of [${Object.keys(l.values).join(", ")}], ${JSON.stringify(r)} found`)),h}function z4(o){return V0(w3(o.value))?_9(p5({},o,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ln(o)}function ln(o){let t=o.value,r=o.key;if(l5(t)!=="array")return[new H1(r,t,`array expected, ${l5(t)} found`)];let l=o.styleSpec,h,d=[];if(t.length<1)return[new H1(r,t,"filter array must have at least 1 element")];switch(d=d.concat(pe({key:`${r}[0]`,value:t[0],valueSpec:l.filter_operator,style:o.style,styleSpec:o.styleSpec})),nt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&nt(t[1])==="$type"&&d.push(new H1(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new H1(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(h=l5(t[1]),h!=="string"&&d.push(new H1(`${r}[1]`,t[1],`string expected, ${h} found`)));for(let f=2;f<t.length;f++)h=l5(t[f]),nt(t[1])==="$type"?d=d.concat(pe({key:`${r}[${f}]`,value:t[f],valueSpec:l.geometry_type,style:o.style,styleSpec:o.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&d.push(new H1(`${r}[${f}]`,t[f],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let f=1;f<t.length;f++)d=d.concat(ln({key:`${r}[${f}]`,value:t[f],style:o.style,styleSpec:o.styleSpec}));break;case"has":case"!has":h=l5(t[1]),t.length!==2?d.push(new H1(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):h!=="string"&&d.push(new H1(`${r}[1]`,t[1],`string expected, ${h} found`))}return d}function Z4(o,t){let r=o.key,l=o.validateSpec,h=o.style,d=o.styleSpec,f=o.value,x=o.objectKey,_=d[`${t}_${o.layerType}`];if(!_)return[];let b=x.match(/^(.*)-transition$/);if(t==="paint"&&b&&_[b[1]]&&_[b[1]].transition)return l({key:r,value:f,valueSpec:d.transition,style:h,styleSpec:d});let z=o.valueSpec||_[x];if(!z)return[new H1(r,f,`unknown property "${x}"`)];let P;if(l5(f)==="string"&&y9(z)&&!z.tokens&&(P=/^{([^}]+)}$/.exec(f)))return[new H1(r,f,`"${x}" does not support interpolation syntax
|
|
2
2
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(P[1])} }\`.`)];let k=[];return o.layerType==="symbol"&&x==="text-font"&&A0(w3(f))&&nt(f.type)==="identity"&&k.push(new H1(r,f,'"text-font" does not support identity functions')),k.concat(l({key:o.key,value:f,valueSpec:z,style:h,styleSpec:d,expressionContext:"property",propertyType:t,propertyKey:x}))}function E4(o){return Z4(o,"paint")}function fe(o){return Z4(o,"layout")}function cn(o){let t=[],r=o.value,l=o.key,h=o.style,d=o.styleSpec;if(l5(r)!=="object")return[new H1(l,r,`object expected, ${l5(r)} found`)];r.type||r.ref||t.push(new H1(l,r,'either "type" or "ref" is required'));let f=nt(r.type),x=nt(r.ref);if(r.id){let _=nt(r.id);for(let b=0;b<o.arrayIndex;b++){let z=h.layers[b];nt(z.id)===_&&t.push(new H1(l,r.id,`duplicate layer id "${r.id}", previously used at line ${z.id.__line__}`))}}if("ref"in r){let _;["type","source","source-layer","filter","layout"].forEach((b=>{b in r&&t.push(new H1(l,r[b],`"${b}" is prohibited for ref layers`))})),h.layers.forEach((b=>{nt(b.id)===x&&(_=b)})),_?_.ref?t.push(new H1(l,r.ref,"ref cannot reference another ref layer")):f=nt(_.type):t.push(new H1(l,r.ref,`ref layer "${x}" not found`))}else if(f!=="background")if(r.source){let _=h.sources&&h.sources[r.source],b=_&&nt(_.type);_?b==="vector"&&f==="raster"?t.push(new H1(l,r.source,`layer "${r.id}" requires a raster source`)):b!=="raster-dem"&&f==="hillshade"||b!=="raster-dem"&&f==="color-relief"?t.push(new H1(l,r.source,`layer "${r.id}" requires a raster-dem source`)):b==="raster"&&f!=="raster"?t.push(new H1(l,r.source,`layer "${r.id}" requires a vector source`)):b!=="vector"||r["source-layer"]?b==="raster-dem"&&f!=="hillshade"&&f!=="color-relief"?t.push(new H1(l,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||b==="geojson"&&_.lineMetrics||t.push(new H1(l,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new H1(l,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new H1(l,r.source,`source "${r.source}" not found`))}else t.push(new H1(l,r,'missing required property "source"'));return t=t.concat(g6({key:l,value:r,valueSpec:d.layer,style:o.style,styleSpec:o.styleSpec,validateSpec:o.validateSpec,objectElementValidators:{"*":()=>[],type:()=>o.validateSpec({key:`${l}.type`,value:r.type,valueSpec:d.layer.type,style:o.style,styleSpec:o.styleSpec,validateSpec:o.validateSpec,object:r,objectKey:"type"}),filter:z4,layout:_=>g6({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":b=>fe(p5({layerType:f},b))}}),paint:_=>g6({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":b=>E4(p5({layerType:f},b))}})}})),t}function l8(o){let t=o.value,r=o.key,l=l5(t);return l!=="string"?[new H1(r,t,`string expected, ${l} found`)]:[]}let I4={promoteId:function({key:o,value:t}){if(l5(t)==="string")return l8({key:o,value:t});{let r=[];for(let l in t)r.push(...l8({key:`${o}.${l}`,value:t[l]}));return r}}};function Ln(o){let t=o.value,r=o.key,l=o.styleSpec,h=o.style,d=o.validateSpec;if(!t.type)return[new H1(r,t,'"type" is required')];let f=nt(t.type),x;switch(f){case"vector":case"raster":return x=g6({key:r,value:t,valueSpec:l[`source_${f.replace("-","_")}`],style:o.style,styleSpec:l,objectElementValidators:I4,validateSpec:d}),x;case"raster-dem":return x=(function(_){var b;let z=(b=_.sourceName)!==null&&b!==void 0?b:"",P=_.value,k=_.styleSpec,D=k.source_raster_dem,N=_.style,U=[],$=l5(P);if(P===void 0)return U;if($!=="object")return U.push(new H1("source_raster_dem",P,`object expected, ${$} found`)),U;let J=nt(P.encoding)==="custom",L1=["redFactor","greenFactor","blueFactor","baseShift"],Q=_.value.encoding?`"${_.value.encoding}"`:"Default";for(let n1 in P)!J&&L1.includes(n1)?U.push(new H1(n1,P[n1],`In "${z}": "${n1}" is only valid when "encoding" is set to "custom". ${Q} encoding found`)):D[n1]?U=U.concat(_.validateSpec({key:n1,value:P[n1],valueSpec:D[n1],validateSpec:_.validateSpec,style:N,styleSpec:k})):U.push(new H1(n1,P[n1],`unknown property "${n1}"`));return U})({sourceName:r,value:t,style:o.style,styleSpec:l,validateSpec:d}),x;case"geojson":if(x=g6({key:r,value:t,valueSpec:l.source_geojson,style:h,styleSpec:l,validateSpec:d,objectElementValidators:I4}),t.cluster)for(let _ in t.clusterProperties){let[b,z]=t.clusterProperties[_],P=typeof b=="string"?[b,["accumulated"],["get",_]]:b;x.push(..._9({key:`${r}.${_}.map`,value:z,expressionContext:"cluster-map"})),x.push(..._9({key:`${r}.${_}.reduce`,value:P,expressionContext:"cluster-reduce"}))}return x;case"video":return g6({key:r,value:t,valueSpec:l.source_video,style:h,validateSpec:d,styleSpec:l});case"image":return g6({key:r,value:t,valueSpec:l.source_image,style:h,validateSpec:d,styleSpec:l});case"canvas":return[new H1(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pe({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function P4(o){let t=o.value,r=o.styleSpec,l=r.light,h=o.style,d=[],f=l5(t);if(t===void 0)return d;if(f!=="object")return d=d.concat([new H1("light",t,`object expected, ${f} found`)]),d;for(let x in t){let _=x.match(/^(.*)-transition$/);d=d.concat(_&&l[_[1]]&&l[_[1]].transition?o.validateSpec({key:x,value:t[x],valueSpec:r.transition,validateSpec:o.validateSpec,style:h,styleSpec:r}):l[x]?o.validateSpec({key:x,value:t[x],valueSpec:l[x],validateSpec:o.validateSpec,style:h,styleSpec:r}):[new H1(x,t[x],`unknown property "${x}"`)])}return d}function A4(o){let t=o.value,r=o.styleSpec,l=r.sky,h=o.style,d=l5(t);if(t===void 0)return[];if(d!=="object")return[new H1("sky",t,`object expected, ${d} found`)];let f=[];for(let x in t)f=f.concat(l[x]?o.validateSpec({key:x,value:t[x],valueSpec:l[x],style:h,styleSpec:r}):[new H1(x,t[x],`unknown property "${x}"`)]);return f}function M9(o){let t=o.value,r=o.styleSpec,l=r.terrain,h=o.style,d=[],f=l5(t);if(t===void 0)return d;if(f!=="object")return d=d.concat([new H1("terrain",t,`object expected, ${f} found`)]),d;for(let x in t)d=d.concat(l[x]?o.validateSpec({key:x,value:t[x],valueSpec:l[x],validateSpec:o.validateSpec,style:h,styleSpec:r}):[new H1(x,t[x],`unknown property "${x}"`)]);return d}function un(o){let t=[],r=o.value,l=o.key;if(Array.isArray(r)){let h=[],d=[];for(let f in r)r[f].id&&h.includes(r[f].id)&&t.push(new H1(l,r,`all the sprites' ids must be unique, but ${r[f].id} is duplicated`)),h.push(r[f].id),r[f].url&&d.includes(r[f].url)&&t.push(new H1(l,r,`all the sprites' URLs must be unique, but ${r[f].url} is duplicated`)),d.push(r[f].url),t=t.concat(g6({key:`${l}[${f}]`,value:r[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:o.validateSpec}));return t}return l8({key:l,value:r})}function hn(o){return t=o.value,t&&t.constructor===Object?[]:[new H1(o.key,o.value,`object expected, ${l5(o.value)} found`)];var t}let Cn={"*":()=>[],array:de,boolean:function(o){let t=o.value,r=o.key,l=l5(t);return l!=="boolean"?[new H1(r,t,`boolean expected, ${l} found`)]:[]},number:A8,color:T4,constants:S4,enum:pe,filter:z4,function:sn,layer:cn,object:g6,source:Ln,light:P4,sky:A4,terrain:M9,projection:function(o){let t=o.value,r=o.styleSpec,l=r.projection,h=o.style,d=l5(t);if(t===void 0)return[];if(d!=="object")return[new H1("projection",t,`object expected, ${d} found`)];let f=[];for(let x in t)f=f.concat(l[x]?o.validateSpec({key:x,value:t[x],valueSpec:l[x],style:h,styleSpec:r}):[new H1(x,t[x],`unknown property "${x}"`)]);return f},projectionDefinition:function(o){let t=o.key,r=o.value;r=r instanceof String?r.valueOf():r;let l=l5(r);return l!=="array"||(function(h){return Array.isArray(h)&&h.length===3&&typeof h[0]=="string"&&typeof h[1]=="string"&&typeof h[2]=="number"})(r)||(function(h){return!!["interpolate","step","literal"].includes(h[0])})(r)?["array","string"].includes(l)?[]:[new H1(t,r,`projection expected, invalid type "${l}" found`)]:[new H1(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]},string:l8,formatted:function(o){return l8(o).length===0?[]:_9(o)},resolvedImage:function(o){return l8(o).length===0?[]:_9(o)},padding:function(o){let t=o.key,r=o.value;if(l5(r)==="array"){if(r.length<1||r.length>4)return[new H1(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let l={type:"number"},h=[];for(let d=0;d<r.length;d++)h=h.concat(o.validateSpec({key:`${t}[${d}]`,value:r[d],validateSpec:o.validateSpec,valueSpec:l}));return h}return A8({key:t,value:r,valueSpec:{}})},numberArray:function(o){let t=o.key,r=o.value;if(l5(r)==="array"){let l={type:"number"};if(r.length<1)return[new H1(t,r,"array length at least 1 expected, length 0 found")];let h=[];for(let d=0;d<r.length;d++)h=h.concat(o.validateSpec({key:`${t}[${d}]`,value:r[d],validateSpec:o.validateSpec,valueSpec:l}));return h}return A8({key:t,value:r,valueSpec:{}})},colorArray:function(o){let t=o.key,r=o.value;if(l5(r)==="array"){if(r.length<1)return[new H1(t,r,"array length at least 1 expected, length 0 found")];let l=[];for(let h=0;h<r.length;h++)l=l.concat(T4({key:`${t}[${h}]`,value:r[h]}));return l}return T4({key:t,value:r})},variableAnchorOffsetCollection:function(o){let t=o.key,r=o.value,l=l5(r),h=o.styleSpec;if(l!=="array"||r.length<1||r.length%2!=0)return[new H1(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let d=[];for(let f=0;f<r.length;f+=2)d=d.concat(pe({key:`${t}[${f}]`,value:r[f],valueSpec:h.layout_symbol["text-anchor"]})),d=d.concat(de({key:`${t}[${f+1}]`,value:r[f+1],valueSpec:{length:2,value:"number"},validateSpec:o.validateSpec,style:o.style,styleSpec:h}));return d},sprite:un,state:hn};function j0(o){let t=o.value,r=o.valueSpec,l=o.styleSpec;return o.validateSpec=j0,r.expression&&A0(nt(t))?sn(o):r.expression&&k0(w3(t))?_9(o):r.type&&Cn[r.type]?Cn[r.type](o):g6(p5({},o,{valueSpec:r.type?l[r.type]:r}))}function dn(o){let t=o.value,r=o.key,l=l8(o);return l.length||(t.indexOf("{fontstack}")===-1&&l.push(new H1(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&l.push(new H1(r,t,'"glyphs" url must include a "{range}" token'))),l}function k6(o,t=t1){let r=[];return r=r.concat(j0({key:"",value:o,valueSpec:t.$root,styleSpec:t,style:o,validateSpec:j0,objectElementValidators:{glyphs:dn,"*":()=>[]}})),o.constants&&(r=r.concat(S4({key:"constants",value:o.constants}))),b9(r)}function a6(o){return function(t){return o(Object.assign({},t,{validateSpec:j0}))}}function b9(o){return[].concat(o).sort(((t,r)=>t.line-r.line))}function ct(o){return function(...t){return b9(o.apply(this,t))}}k6.source=ct(a6(Ln)),k6.sprite=ct(a6(un)),k6.glyphs=ct(a6(dn)),k6.light=ct(a6(P4)),k6.sky=ct(a6(A4)),k6.terrain=ct(a6(M9)),k6.state=ct(a6(hn)),k6.layer=ct(a6(cn)),k6.filter=ct(a6(z4)),k6.paintProperty=ct(a6(E4)),k6.layoutProperty=ct(a6(fe));let ge=t1,B8=k6,xs=B8.light,ys=B8.sky,me=B8.paintProperty,pn=B8.layoutProperty;function q0(o,t){let r=!1;if(t&&t.length)for(let l of t)o.fire(new C1(new Error(l.message))),r=!0;return r}class xe{constructor(t,r,l){let h=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let f=new Int32Array(this.arrayBuffer);t=f[0],this.d=(r=f[1])+2*(l=f[2]);for(let _=0;_<this.d*this.d;_++){let b=f[3+_],z=f[3+_+1];h.push(b===z?null:f.subarray(b,z))}let x=f[3+h.length+1];this.keys=f.subarray(f[3+h.length],x),this.bboxes=f.subarray(x),this.insert=this._insertReadonly}else{this.d=r+2*l;for(let f=0;f<this.d*this.d;f++)h.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=l,this.scale=r/t,this.uid=0;let d=l/r*t;this.min=-d,this.max=t+d}insert(t,r,l,h,d){this._forEachCell(r,l,h,d,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(d)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,l,h,d,f){this.cells[d].push(f)}query(t,r,l,h,d){let f=this.min,x=this.max;if(t<=f&&r<=f&&x<=l&&x<=h&&!d)return Array.prototype.slice.call(this.keys);{let _=[];return this._forEachCell(t,r,l,h,this._queryCell,_,{},d),_}}_queryCell(t,r,l,h,d,f,x,_){let b=this.cells[d];if(b!==null){let z=this.keys,P=this.bboxes;for(let k=0;k<b.length;k++){let D=b[k];if(x[D]===void 0){let N=4*D;(_?_(P[N+0],P[N+1],P[N+2],P[N+3]):t<=P[N+2]&&r<=P[N+3]&&l>=P[N+0]&&h>=P[N+1])?(x[D]=!0,f.push(z[D])):x[D]=!1}}}}_forEachCell(t,r,l,h,d,f,x,_){let b=this._convertToCellCoord(t),z=this._convertToCellCoord(r),P=this._convertToCellCoord(l),k=this._convertToCellCoord(h);for(let D=b;D<=P;D++)for(let N=z;N<=k;N++){let U=this.d*N+D;if((!_||_(this._convertFromCellCoord(D),this._convertFromCellCoord(N),this._convertFromCellCoord(D+1),this._convertFromCellCoord(N+1)))&&d.call(this,t,r,l,h,U,f,x,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,l=0;for(let f=0;f<this.cells.length;f++)l+=this.cells[f].length;let h=new Int32Array(r+l+this.keys.length+this.bboxes.length);h[0]=this.extent,h[1]=this.n,h[2]=this.padding;let d=r;for(let f=0;f<t.length;f++){let x=t[f];h[3+f]=d,h.set(x,d),d+=x.length}return h[3+t.length]=d,h.set(this.keys,d),d+=this.keys.length,h[3+t.length+1]=d,h.set(this.bboxes,d),d+=this.bboxes.length,h.buffer}static serialize(t,r){let l=t.toArrayBuffer();return r&&r.push(l),{buffer:l}}static deserialize(t){return new xe(t.buffer)}}let W6={};function C2(o,t,r={}){if(W6[o])throw new Error(`${o} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:o,writeable:!1}),W6[o]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}C2("Object",Object),C2("Set",Set),C2("TransferableGridIndex",xe),C2("Color",s5),C2("Error",Error),C2("AJAXError",F5),C2("ResolvedImage",d6),C2("StylePropertyFunction",F0),C2("StyleExpression",B0,{omit:["_evaluator"]}),C2("ZoomDependentExpression",D0),C2("ZoomConstantExpression",P8),C2("CompoundExpression",B6,{omit:["_evaluate"]});for(let o in m9)m9[o]._classRegistryKey||C2(`Expression_${o}`,m9[o]);function w9(o){return o&&typeof ArrayBuffer<"u"&&(o instanceof ArrayBuffer||o.constructor&&o.constructor.name==="ArrayBuffer")}function B4(o){return o.$name||o.constructor._classRegistryKey}function fn(o){return!(function(t){if(t===null||typeof t!="object")return!1;let r=B4(t);return!(!r||r==="Object")})(o)&&(o==null||typeof o=="boolean"||typeof o=="number"||typeof o=="string"||o instanceof Boolean||o instanceof Number||o instanceof String||o instanceof Date||o instanceof RegExp||o instanceof Blob||o instanceof Error||w9(o)||X2(o)||ArrayBuffer.isView(o)||o instanceof ImageData)}function ye(o,t){if(fn(o))return(w9(o)||X2(o))&&t&&t.push(o),ArrayBuffer.isView(o)&&t&&t.push(o.buffer),o instanceof ImageData&&t&&t.push(o.data.buffer),o;if(Array.isArray(o)){let d=[];for(let f of o)d.push(ye(f,t));return d}if(typeof o!="object")throw new Error("can't serialize object of type "+typeof o);let r=B4(o);if(!r)throw new Error(`can't serialize object of unregistered class ${o.constructor.name}`);if(!W6[r])throw new Error(`${r} is not registered.`);let{klass:l}=W6[r],h=l.serialize?l.serialize(o,t):{};if(l.serialize){if(t&&h===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let d in o){if(!o.hasOwnProperty(d)||W6[r].omit.indexOf(d)>=0)continue;let f=o[d];h[d]=W6[r].shallow.indexOf(d)>=0?f:ye(f,t)}o instanceof Error&&(h.message=o.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(h.$name=r),h}function S3(o){if(fn(o))return o;if(Array.isArray(o))return o.map(S3);if(typeof o!="object")throw new Error("can't deserialize object of type "+typeof o);let t=B4(o)||"Object";if(!W6[t])throw new Error(`can't deserialize unregistered class ${t}`);let{klass:r}=W6[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(o);let l=Object.create(r.prototype);for(let h of Object.keys(o)){if(h==="$name")continue;let d=o[h];l[h]=W6[t].shallow.indexOf(h)>=0?d:S3(d)}return l}class k4{constructor(){this.first=!0}update(t,r){let l=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=l,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=l,!0):(this.lastFloorZoom>l?(this.lastIntegerZoom=l+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<l&&(this.lastIntegerZoom=l,this.lastIntegerZoomTime=r),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=l,!0))}}function vs(o){return/[\u02EA\u02EB\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\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-\uDFE4\uDFF0-\uDFF6]|[\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-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD83C\uDE00|\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(o))}function S9(o){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\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]|\uD806[\uDEB0-\uDEBF]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\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-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD83C\uDE00|\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(o))}function R4(o){for(let t of o)if(S9(t.charCodeAt(0)))return!0;return!1}function D4(o){for(let t of o)if(!mn(t.charCodeAt(0)))return!1;return!0}function ve(o){let t=o.map((r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}})).filter((r=>r));return new RegExp(t.join("|"),"u")}let gn=ve(["Arab","Dupl","Mong","Ougr","Syrc"]);function mn(o){return!gn.test(String.fromCodePoint(o))}function F4(o){return!(S9(o)||(t=o,/[\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]/gim.test(String.fromCodePoint(t))));var t}let xn=ve(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function H0(o){return xn.test(String.fromCodePoint(o))}function yn(o,t){return!(!t&&H0(o)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(o)))}function _s(o){for(let t of o)if(H0(t.charCodeAt(0)))return!0;return!1}let T3=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(o){this.pluginStatus=o.pluginStatus,this.pluginURL=o.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(o){if(T3.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=o.applyArabicShaping,this.processBidirectionalText=o.processBidirectionalText,this.processStyledBidirectionalText=o.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(o,t){return n(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(o.pluginStatus!=="loading")return this.setState(o),o;let r=o.pluginURL,l=new Promise((d=>{this.loadScriptResolve=d}));t(r);let h=new Promise((d=>setTimeout((()=>d()),this.TIMEOUT)));if(yield Promise.race([l,h]),this.isParsed()){let d={pluginStatus:"loaded",pluginURL:r};return this.setState(d),d}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${r}`)}))}};class A5{constructor(t,r){this.isSupportedScript=vn,this.zoom=t,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new k4,this.transition=r.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new k4,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,r=t-Math.floor(t),l=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*l}:{fromScale:.5,toScale:1,t:1-(1-l)*r}}}function vn(o){return(function(t,r){for(let l of t)if(!yn(l.charCodeAt(0),r))return!1;return!0})(o,T3.getRTLTextPluginStatus()==="loaded")}class $0{constructor(t,r,l){this.property=t,this.value=r,this.expression=(function(h,d,f){if(A0(h))return new F0(h,d);if(k0(h)){let x=en(h,d,f);if(x.result==="error")throw new Error(x.value.map((_=>`${_.key}: ${_.message}`)).join(", "));return x.value}{let x=h;return d.type==="color"&&typeof h=="string"?x=s5.parse(h):d.type!=="padding"||typeof h!="number"&&!Array.isArray(h)?d.type!=="numberArray"||typeof h!="number"&&!Array.isArray(h)?d.type!=="colorArray"||typeof h!="string"&&!Array.isArray(h)?d.type==="variableAnchorOffsetCollection"&&Array.isArray(h)?x=o6.parse(h):d.type==="projectionDefinition"&&typeof h=="string"&&(x=Kt.parse(h)):x=wt.parse(h):x=Xt.parse(h):x=Yt.parse(h),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>x}}})(r===void 0?t.specification.default:r,t.specification,l)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,r,l){return this.property.possiblyEvaluate(this,t,r,l)}}class W0{constructor(t,r){this.property=t,this.value=new $0(t,void 0,r)}transitioned(t,r){return new _n(this.property,this.value,r,N2({},t.transition,this.transition),t.now)}untransitioned(){return new _n(this.property,this.value,null,{},0)}}class O4{constructor(t,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r}getValue(t){return Q2(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new W0(this._values[t].property,this._globalState)),this._values[t].value=new $0(this._values[t].property,r===null?void 0:Q2(r),this._globalState)}getTransition(t){return Q2(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new W0(this._values[t].property,this._globalState)),this._values[t].transition=Q2(r)||void 0}serialize(){let t={};for(let r of Object.keys(this._values)){let l=this.getValue(r);l!==void 0&&(t[r]=l);let h=this.getTransition(r);h!==void 0&&(t[`${r}-transition`]=h)}return t}transitioned(t,r){let l=new Mn(this._properties);for(let h of Object.keys(this._values))l._values[h]=this._values[h].transitioned(t,r._values[h]);return l}untransitioned(){let t=new Mn(this._properties);for(let r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class _n{constructor(t,r,l,h,d){this.property=t,this.value=r,this.begin=d+h.delay||0,this.end=this.begin+h.duration||0,t.specification.transition&&(h.delay||h.duration)&&(this.prior=l)}possiblyEvaluate(t,r,l){let h=t.now||0,d=this.value.possiblyEvaluate(t,r,l),f=this.prior;if(f){if(h>this.end)return this.prior=null,d;if(this.value.isDataDriven())return this.prior=null,d;if(h<this.begin)return f.possiblyEvaluate(t,r,l);{let x=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(f.possiblyEvaluate(t,r,l),d,R2(x))}}return d}}class Mn{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,l){let h=new _e(this._properties);for(let d of Object.keys(this._values))h._values[d]=this._values[d].possiblyEvaluate(t,r,l);return h}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class bn{constructor(t,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r}hasValue(t){return this._values[t].value!==void 0}getValue(t){return Q2(this._values[t].value)}setValue(t,r){this._values[t]=new $0(this._values[t].property,r===null?void 0:Q2(r),this._globalState)}serialize(){let t={};for(let r of Object.keys(this._values)){let l=this.getValue(r);l!==void 0&&(t[r]=l)}return t}possiblyEvaluate(t,r,l){let h=new _e(this._properties);for(let d of Object.keys(this._values))h._values[d]=this._values[d].possiblyEvaluate(t,r,l);return h}}class Y6{constructor(t,r,l){this.property=t,this.value=r,this.parameters=l}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,l,h){return this.property.evaluate(this.value,this.parameters,t,r,l,h)}}class _e{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class v2{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,l){let h=H6[this.specification.type];return h?h(t,r,l):t}}class P2{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,l,h){return new Y6(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},l,h)}:t.expression,r)}interpolate(t,r,l){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new Y6(this,{kind:"constant",value:void 0},t.parameters);let h=H6[this.specification.type];if(h){let d=h(t.value.value,r.value.value,l);return new Y6(this,{kind:"constant",value:d},t.parameters)}return t}evaluate(t,r,l,h,d,f){return t.kind==="constant"?t.value:t.evaluate(r,l,h,d,f)}}class Me extends P2{possiblyEvaluate(t,r,l,h){if(t.value===void 0)return new Y6(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){let d=t.expression.evaluate(r,null,{},l,h),f=t.property.specification.type==="resolvedImage"&&typeof d!="string"?d.name:d,x=this._calculate(f,f,f,r);return new Y6(this,{kind:"constant",value:x},r)}if(t.expression.kind==="camera"){let d=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new Y6(this,{kind:"constant",value:d},r)}return new Y6(this,t.expression,r)}evaluate(t,r,l,h,d,f){if(t.kind==="source"){let x=t.evaluate(r,l,h,d,f);return this._calculate(x,x,x,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},l,h),t.evaluate({zoom:Math.floor(r.zoom)},l,h),t.evaluate({zoom:Math.floor(r.zoom)+1},l,h),r):t.value}_calculate(t,r,l,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:l,to:r}}interpolate(t){return t}}class Y0{constructor(t){this.specification=t}possiblyEvaluate(t,r,l,h){if(t.value!==void 0){if(t.expression.kind==="constant"){let d=t.expression.evaluate(r,null,{},l,h);return this._calculate(d,d,d,r)}return this._calculate(t.expression.evaluate(new A5(Math.floor(r.zoom-1),r)),t.expression.evaluate(new A5(Math.floor(r.zoom),r)),t.expression.evaluate(new A5(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,l,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:l,to:r}}interpolate(t){return t}}class X0{constructor(t){this.specification=t}possiblyEvaluate(t,r,l,h){return!!t.expression.evaluate(r,null,{},l,h)}interpolate(){return!1}}class s6{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in t){let l=t[r];l.specification.overridable&&this.overridableProperties.push(r);let h=this.defaultPropertyValues[r]=new $0(l,void 0,void 0),d=this.defaultTransitionablePropertyValues[r]=new W0(l,void 0);this.defaultTransitioningPropertyValues[r]=d.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=h.possiblyEvaluate({})}}}C2("DataDrivenProperty",P2),C2("DataConstantProperty",v2),C2("CrossFadedDataDrivenProperty",Me),C2("CrossFadedProperty",Y0),C2("ColorRampProperty",X0);let N4="-transition";class R6 extends S1{constructor(t,r,l){if(super(),this.id=t.id,this.type=t.type,this._globalState=l,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=he(t.filter,l)),r.layout&&(this._unevaluatedLayout=new bn(r.layout,l)),r.paint)){this._transitionablePaint=new O4(r.paint,l);for(let h in t.paint)this.setPaintProperty(h,t.paint[h],{validate:!1});for(let h in t.layout)this.setLayoutProperty(h,t.layout[h],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _e(r.paint)}}setFilter(t){this.filter=t,this._featureFilter=he(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let l=this._unevaluatedLayout._values[r];for(let h of l.getGlobalStateRefs())t.add(h)}for(let r of this._featureFilter.getGlobalStateRefs())t.add(r);return t}getPaintAffectingGlobalStateRefs(){var t;let r=new globalThis.Map;if(this._transitionablePaint)for(let l in this._transitionablePaint._values){let h=this._transitionablePaint._values[l].value;for(let d of h.getGlobalStateRefs()){let f=(t=r.get(d))!==null&&t!==void 0?t:[];f.push({name:l,value:h.value}),r.set(d,f)}}return r}setLayoutProperty(t,r,l={}){r!=null&&this._validate(pn,`layers.${this.id}.layout.${t}`,t,r,l)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(N4)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,l={}){if(r!=null&&this._validate(me,`layers.${this.id}.paint.${t}`,t,r,l))return!1;if(t.endsWith(N4))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{let h=this._transitionablePaint._values[t],d=h.property.specification["property-type"]==="cross-faded-data-driven",f=h.value.isDataDriven(),x=h.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);let _=this._transitionablePaint._values[t].value;return _.isDataDriven()||f||d||this._handleOverridablePaintPropertyUpdate(t,x,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,l){return!1}isHidden(t,r=!1){return!!(this.minzoom&&t<(r?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x5(t,((r,l)=>!(r===void 0||l==="layout"&&!Object.keys(r).length||l==="paint"&&!Object.keys(r).length)))}_validate(t,r,l,h,d={}){return(!d||d.validate!==!1)&&q0(this,t.call(B8,{key:r,layerType:this.type,objectKey:l,value:h,styleSpec:t1,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let r=this.paint.get(t);if(r instanceof Y6&&y9(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}let V4;var Ms={get paint(){return V4=V4||new s6({"raster-opacity":new v2(t1.paint_raster["raster-opacity"]),"raster-hue-rotate":new v2(t1.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new v2(t1.paint_raster["raster-brightness-min"]),"raster-brightness-max":new v2(t1.paint_raster["raster-brightness-max"]),"raster-saturation":new v2(t1.paint_raster["raster-saturation"]),"raster-contrast":new v2(t1.paint_raster["raster-contrast"]),"raster-resampling":new v2(t1.paint_raster["raster-resampling"]),"raster-fade-duration":new v2(t1.paint_raster["raster-fade-duration"])})}};class bs extends R6{constructor(t,r){super(t,Ms,r)}}let ws={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class be{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ot{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function V5(o,t=1){let r=0,l=0;return{members:o.map((h=>{let d=ws[h.type].BYTES_PER_ELEMENT,f=r=wn(r,Math.max(t,d)),x=h.components||1;return l=Math.max(l,d),r+=d*x,{name:h.name,type:h.type,components:x,offset:f}})),size:wn(r,Math.max(l,t)),alignment:t}}function wn(o,t){return Math.ceil(o/t)*t}class we extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){let l=this.length;return this.resize(l+1),this.emplace(l,t,r)}emplace(t,r,l){let h=2*t;return this.int16[h+0]=r,this.int16[h+1]=l,t}}we.prototype.bytesPerElement=4,C2("StructArrayLayout2i4",we);class K0 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,l)}emplace(t,r,l,h){let d=3*t;return this.int16[d+0]=r,this.int16[d+1]=l,this.int16[d+2]=h,t}}K0.prototype.bytesPerElement=6,C2("StructArrayLayout3i6",K0);class J0 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h){let d=this.length;return this.resize(d+1),this.emplace(d,t,r,l,h)}emplace(t,r,l,h,d){let f=4*t;return this.int16[f+0]=r,this.int16[f+1]=l,this.int16[f+2]=h,this.int16[f+3]=d,t}}J0.prototype.bytesPerElement=8,C2("StructArrayLayout4i8",J0);class G4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f){let x=this.length;return this.resize(x+1),this.emplace(x,t,r,l,h,d,f)}emplace(t,r,l,h,d,f,x){let _=6*t;return this.int16[_+0]=r,this.int16[_+1]=l,this.int16[_+2]=h,this.int16[_+3]=d,this.int16[_+4]=f,this.int16[_+5]=x,t}}G4.prototype.bytesPerElement=12,C2("StructArrayLayout2i4i12",G4);class U4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f){let x=this.length;return this.resize(x+1),this.emplace(x,t,r,l,h,d,f)}emplace(t,r,l,h,d,f,x){let _=4*t,b=8*t;return this.int16[_+0]=r,this.int16[_+1]=l,this.uint8[b+4]=h,this.uint8[b+5]=d,this.uint8[b+6]=f,this.uint8[b+7]=x,t}}U4.prototype.bytesPerElement=8,C2("StructArrayLayout2i4ub8",U4);class X6 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){let l=this.length;return this.resize(l+1),this.emplace(l,t,r)}emplace(t,r,l){let h=2*t;return this.float32[h+0]=r,this.float32[h+1]=l,t}}X6.prototype.bytesPerElement=8,C2("StructArrayLayout2f8",X6);class Q0 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_,b,z){let P=this.length;return this.resize(P+1),this.emplace(P,t,r,l,h,d,f,x,_,b,z)}emplace(t,r,l,h,d,f,x,_,b,z,P){let k=10*t;return this.uint16[k+0]=r,this.uint16[k+1]=l,this.uint16[k+2]=h,this.uint16[k+3]=d,this.uint16[k+4]=f,this.uint16[k+5]=x,this.uint16[k+6]=_,this.uint16[k+7]=b,this.uint16[k+8]=z,this.uint16[k+9]=P,t}}Q0.prototype.bytesPerElement=20,C2("StructArrayLayout10ui20",Q0);class Se extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_){let b=this.length;return this.resize(b+1),this.emplace(b,t,r,l,h,d,f,x,_)}emplace(t,r,l,h,d,f,x,_,b){let z=8*t;return this.uint16[z+0]=r,this.uint16[z+1]=l,this.uint16[z+2]=h,this.uint16[z+3]=d,this.uint16[z+4]=f,this.uint16[z+5]=x,this.uint16[z+6]=_,this.uint16[z+7]=b,t}}Se.prototype.bytesPerElement=16,C2("StructArrayLayout8ui16",Se);class t7 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_,b,z,P,k){let D=this.length;return this.resize(D+1),this.emplace(D,t,r,l,h,d,f,x,_,b,z,P,k)}emplace(t,r,l,h,d,f,x,_,b,z,P,k,D){let N=12*t;return this.int16[N+0]=r,this.int16[N+1]=l,this.int16[N+2]=h,this.int16[N+3]=d,this.uint16[N+4]=f,this.uint16[N+5]=x,this.uint16[N+6]=_,this.uint16[N+7]=b,this.int16[N+8]=z,this.int16[N+9]=P,this.int16[N+10]=k,this.int16[N+11]=D,t}}t7.prototype.bytesPerElement=24,C2("StructArrayLayout4i4ui4i24",t7);class Te extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,l){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,l)}emplace(t,r,l,h){let d=3*t;return this.float32[d+0]=r,this.float32[d+1]=l,this.float32[d+2]=h,t}}Te.prototype.bytesPerElement=12,C2("StructArrayLayout3f12",Te);class j4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}j4.prototype.bytesPerElement=4,C2("StructArrayLayout1ul4",j4);class T9 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_,b){let z=this.length;return this.resize(z+1),this.emplace(z,t,r,l,h,d,f,x,_,b)}emplace(t,r,l,h,d,f,x,_,b,z){let P=10*t,k=5*t;return this.int16[P+0]=r,this.int16[P+1]=l,this.int16[P+2]=h,this.int16[P+3]=d,this.int16[P+4]=f,this.int16[P+5]=x,this.uint32[k+3]=_,this.uint16[P+8]=b,this.uint16[P+9]=z,t}}T9.prototype.bytesPerElement=20,C2("StructArrayLayout6i1ul2ui20",T9);class k8 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f){let x=this.length;return this.resize(x+1),this.emplace(x,t,r,l,h,d,f)}emplace(t,r,l,h,d,f,x){let _=6*t;return this.int16[_+0]=r,this.int16[_+1]=l,this.int16[_+2]=h,this.int16[_+3]=d,this.int16[_+4]=f,this.int16[_+5]=x,t}}k8.prototype.bytesPerElement=12,C2("StructArrayLayout2i2i2i12",k8);class q4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d){let f=this.length;return this.resize(f+1),this.emplace(f,t,r,l,h,d)}emplace(t,r,l,h,d,f){let x=4*t,_=8*t;return this.float32[x+0]=r,this.float32[x+1]=l,this.float32[x+2]=h,this.int16[_+6]=d,this.int16[_+7]=f,t}}q4.prototype.bytesPerElement=16,C2("StructArrayLayout2f1f2i16",q4);class e7 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f){let x=this.length;return this.resize(x+1),this.emplace(x,t,r,l,h,d,f)}emplace(t,r,l,h,d,f,x){let _=16*t,b=4*t,z=8*t;return this.uint8[_+0]=r,this.uint8[_+1]=l,this.float32[b+1]=h,this.float32[b+2]=d,this.int16[z+6]=f,this.int16[z+7]=x,t}}e7.prototype.bytesPerElement=16,C2("StructArrayLayout2ub2f2i16",e7);class c8 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,l)}emplace(t,r,l,h){let d=3*t;return this.uint16[d+0]=r,this.uint16[d+1]=l,this.uint16[d+2]=h,t}}c8.prototype.bytesPerElement=6,C2("StructArrayLayout3ui6",c8);class H4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J){let L1=this.length;return this.resize(L1+1),this.emplace(L1,t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J)}emplace(t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J,L1){let Q=24*t,n1=12*t,f1=48*t;return this.int16[Q+0]=r,this.int16[Q+1]=l,this.uint16[Q+2]=h,this.uint16[Q+3]=d,this.uint32[n1+2]=f,this.uint32[n1+3]=x,this.uint32[n1+4]=_,this.uint16[Q+10]=b,this.uint16[Q+11]=z,this.uint16[Q+12]=P,this.float32[n1+7]=k,this.float32[n1+8]=D,this.uint8[f1+36]=N,this.uint8[f1+37]=U,this.uint8[f1+38]=$,this.uint32[n1+10]=J,this.int16[Q+22]=L1,t}}H4.prototype.bytesPerElement=48,C2("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",H4);class $4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J,L1,Q,n1,f1,_1,P1,$1,j1,J1,u2,r2){let n2=this.length;return this.resize(n2+1),this.emplace(n2,t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J,L1,Q,n1,f1,_1,P1,$1,j1,J1,u2,r2)}emplace(t,r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J,L1,Q,n1,f1,_1,P1,$1,j1,J1,u2,r2,n2){let V1=32*t,I2=16*t;return this.int16[V1+0]=r,this.int16[V1+1]=l,this.int16[V1+2]=h,this.int16[V1+3]=d,this.int16[V1+4]=f,this.int16[V1+5]=x,this.int16[V1+6]=_,this.int16[V1+7]=b,this.uint16[V1+8]=z,this.uint16[V1+9]=P,this.uint16[V1+10]=k,this.uint16[V1+11]=D,this.uint16[V1+12]=N,this.uint16[V1+13]=U,this.uint16[V1+14]=$,this.uint16[V1+15]=J,this.uint16[V1+16]=L1,this.uint16[V1+17]=Q,this.uint16[V1+18]=n1,this.uint16[V1+19]=f1,this.uint16[V1+20]=_1,this.uint16[V1+21]=P1,this.uint16[V1+22]=$1,this.uint32[I2+12]=j1,this.float32[I2+13]=J1,this.float32[I2+14]=u2,this.uint16[V1+30]=r2,this.uint16[V1+31]=n2,t}}$4.prototype.bytesPerElement=64,C2("StructArrayLayout8i15ui1ul2f2ui64",$4);class ze extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}ze.prototype.bytesPerElement=4,C2("StructArrayLayout1f4",ze);class W4 extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,l){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,l)}emplace(t,r,l,h){let d=3*t;return this.uint16[6*t+0]=r,this.float32[d+1]=l,this.float32[d+2]=h,t}}W4.prototype.bytesPerElement=12,C2("StructArrayLayout1ui2f12",W4);class g extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,l){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,l)}emplace(t,r,l,h){let d=4*t;return this.uint32[2*t+0]=r,this.uint16[d+2]=l,this.uint16[d+3]=h,t}}g.prototype.bytesPerElement=8,C2("StructArrayLayout1ul2ui8",g);class e extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){let l=this.length;return this.resize(l+1),this.emplace(l,t,r)}emplace(t,r,l){let h=2*t;return this.uint16[h+0]=r,this.uint16[h+1]=l,t}}e.prototype.bytesPerElement=4,C2("StructArrayLayout2ui4",e);class a extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}a.prototype.bytesPerElement=2,C2("StructArrayLayout1ui2",a);class C extends ot{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,l,h){let d=this.length;return this.resize(d+1),this.emplace(d,t,r,l,h)}emplace(t,r,l,h,d){let f=4*t;return this.float32[f+0]=r,this.float32[f+1]=l,this.float32[f+2]=h,this.float32[f+3]=d,t}}C.prototype.bytesPerElement=16,C2("StructArrayLayout4f16",C);class p extends be{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new y(this.anchorPointX,this.anchorPointY)}}p.prototype.size=20;class m extends T9{get(t){return new p(this,t)}}C2("CollisionBoxArray",m);class v extends be{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}v.prototype.size=48;class w extends H4{get(t){return new v(this,t)}}C2("PlacedSymbolArray",w);class T extends be{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get 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]}}T.prototype.size=64;class A extends $4{get(t){return new T(this,t)}}C2("SymbolInstanceArray",A);class B extends ze{getoffsetX(t){return this.float32[1*t+0]}}C2("GlyphOffsetArray",B);class V extends K0{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}C2("SymbolLineVertexArray",V);class O extends be{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]}}O.prototype.size=12;class q extends W4{get(t){return new O(this,t)}}C2("TextAnchorOffsetArray",q);class Y extends be{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]}}Y.prototype.size=8;class e1 extends g{get(t){return new Y(this,t)}}C2("FeatureIndexArray",e1);class i1 extends we{}class o1 extends we{}class u1 extends we{}class g1 extends G4{}class c1 extends U4{}class x1 extends X6{}class v1 extends Q0{}class h1 extends Se{}class b1 extends t7{}class A1 extends Te{}class Z1 extends j4{}class E1 extends k8{}class B1 extends e7{}class Q1 extends c8{}class i2 extends e{}let X1=V5([{name:"a_pos",components:2,type:"Int16"}],4),{members:y2}=X1;class M2{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,r,l,h){let d=this.segments[this.segments.length-1];return t>M2.MAX_VERTEX_ARRAY_LENGTH&&U2(`Max vertices per segment is ${M2.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${M2.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!d||d.vertexLength+t>M2.MAX_VERTEX_ARRAY_LENGTH||d.sortKey!==h?this.createNewSegment(r,l,h):d}createNewSegment(t,r,l){let h={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return l!==void 0&&(h.sortKey=l),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(h),h}getOrCreateLatestSegment(t,r,l){return this.prepareSegment(0,t,r,l)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,l,h){return new M2([{vertexOffset:t,primitiveOffset:r,vertexLength:l,primitiveLength:h,vaos:{},sortKey:0}])}}function T5(o,t){return 256*(o=F1(Math.floor(o),0,255))+F1(Math.floor(t),0,255)}M2.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,C2("SegmentVector",M2);let H5=V5([{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"}]),G5=V5([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var X5,B5,yt,k5={exports:{}},Pt={exports:{}},Ct={exports:{}},vt=(function(){if(yt)return k5.exports;yt=1;var o=(X5||(X5=1,Pt.exports=function(r,l){var h,d,f,x,_,b,z,P;for(d=r.length-(h=3&r.length),f=l,_=3432918353,b=461845907,P=0;P<d;)z=255&r.charCodeAt(P)|(255&r.charCodeAt(++P))<<8|(255&r.charCodeAt(++P))<<16|(255&r.charCodeAt(++P))<<24,++P,f=27492+(65535&(x=5*(65535&(f=(f^=z=(65535&(z=(z=(65535&z)*_+(((z>>>16)*_&65535)<<16)&4294967295)<<15|z>>>17))*b+(((z>>>16)*b&65535)<<16)&4294967295)<<13|f>>>19))+((5*(f>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(z=0,h){case 3:z^=(255&r.charCodeAt(P+2))<<16;case 2:z^=(255&r.charCodeAt(P+1))<<8;case 1:f^=z=(65535&(z=(z=(65535&(z^=255&r.charCodeAt(P)))*_+(((z>>>16)*_&65535)<<16)&4294967295)<<15|z>>>17))*b+(((z>>>16)*b&65535)<<16)&4294967295}return f^=r.length,f=2246822507*(65535&(f^=f>>>16))+((2246822507*(f>>>16)&65535)<<16)&4294967295,f=3266489909*(65535&(f^=f>>>13))+((3266489909*(f>>>16)&65535)<<16)&4294967295,(f^=f>>>16)>>>0}),Pt.exports),t=(B5||(B5=1,Ct.exports=function(r,l){for(var h,d=r.length,f=l^d,x=0;d>=4;)h=1540483477*(65535&(h=255&r.charCodeAt(x)|(255&r.charCodeAt(++x))<<8|(255&r.charCodeAt(++x))<<16|(255&r.charCodeAt(++x))<<24))+((1540483477*(h>>>16)&65535)<<16),f=1540483477*(65535&f)+((1540483477*(f>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),d-=4,++x;switch(d){case 3:f^=(255&r.charCodeAt(x+2))<<16;case 2:f^=(255&r.charCodeAt(x+1))<<8;case 1:f=1540483477*(65535&(f^=255&r.charCodeAt(x)))+((1540483477*(f>>>16)&65535)<<16)}return f=1540483477*(65535&(f^=f>>>13))+((1540483477*(f>>>16)&65535)<<16),(f^=f>>>15)>>>0}),Ct.exports);return k5.exports=o,k5.exports.murmur3=o,k5.exports.murmur2=t,k5.exports})(),Jt=M(vt);class g3{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,l,h){this.ids.push(L8(t)),this.positions.push(r,l,h)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=L8(t),l=0,h=this.ids.length-1;for(;l<h;){let f=l+h>>1;this.ids[f]>=r?h=f:l=f+1}let d=[];for(;this.ids[l]===r;)d.push({index:this.positions[3*l],start:this.positions[3*l+1],end:this.positions[3*l+2]}),l++;return d}static serialize(t,r){let l=new Float64Array(t.ids),h=new Uint32Array(t.positions);return z3(l,h,0,l.length-1),r&&r.push(l.buffer,h.buffer),{ids:l,positions:h}}static deserialize(t){let r=new g3;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function L8(o){let t=+o;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Jt(String(o))}function z3(o,t,r,l){for(;r<l;){let h=o[r+l>>1],d=r-1,f=l+1;for(;;){do d++;while(o[d]<h);do f--;while(o[f]>h);if(d>=f)break;Z3(o,d,f),Z3(t,3*d,3*f),Z3(t,3*d+1,3*f+1),Z3(t,3*d+2,3*f+2)}f-r<l-f?(z3(o,t,r,f),r=f+1):(z3(o,t,f+1,l),l=f)}}function Z3(o,t,r){let l=o[t];o[t]=o[r],o[r]=l}C2("FeaturePositionMap",g3);class D6{constructor(t,r){this.gl=t.gl,this.location=r}}class R8 extends D6{constructor(t,r){super(t,r),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class D8 extends D6{constructor(t,r){super(t,r),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class w6 extends D6{constructor(t,r){super(t,r),this.current=s5.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}let u8=new Float32Array(16);function E3(o){return[T5(255*o.r,255*o.g),T5(255*o.b,255*o.a)]}class I3{constructor(t,r,l){this.value=t,this.uniformNames=r.map((h=>`u_${h}`)),this.type=l}setUniform(t,r,l){t.set(l.constantOr(this.value))}getBinding(t,r,l){return this.type==="color"?new w6(t,r):new R8(t,r)}}class K5{constructor(t,r){this.uniformNames=r.map((l=>`u_${l}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,r){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(t,r,l,h){let d=null;h==="u_pattern_to"?d=this.patternTo:h==="u_pattern_from"?d=this.patternFrom:h==="u_dasharray_to"?d=this.dashTo:h==="u_dasharray_from"?d=this.dashFrom:h==="u_pixel_ratio_to"?d=this.pixelRatioTo:h==="u_pixel_ratio_from"&&(d=this.pixelRatioFrom),d!==null&&t.set(d)}getBinding(t,r,l){return l.substr(0,9)==="u_pattern"||l.substr(0,12)==="u_dasharray_"?new D8(t,r):new R8(t,r)}}class $5{constructor(t,r,l,h){this.expression=t,this.type=l,this.maxValue=0,this.paintVertexAttributes=r.map((d=>({name:`a_${d}`,type:"Float32",components:l==="color"?2:1,offset:0}))),this.paintVertexArray=new h}populatePaintArray(t,r,l){let h=this.paintVertexArray.length,d=this.expression.evaluate(new A5(0,l),r,{},l.canonical,[],l.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(h,t,d)}updatePaintArray(t,r,l,h,d){let f=this.expression.evaluate(new A5(0,d),l,h);this._setPaintValue(t,r,f)}_setPaintValue(t,r,l){if(this.type==="color"){let h=E3(l);for(let d=t;d<r;d++)this.paintVertexArray.emplace(d,h[0],h[1])}else{for(let h=t;h<r;h++)this.paintVertexArray.emplace(h,l);this.maxValue=Math.max(this.maxValue,Math.abs(l))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class dt{constructor(t,r,l,h,d,f){this.expression=t,this.uniformNames=r.map((x=>`u_${x}_t`)),this.type=l,this.useIntegerZoom=h,this.zoom=d,this.maxValue=0,this.paintVertexAttributes=r.map((x=>({name:`a_${x}`,type:"Float32",components:l==="color"?4:2,offset:0}))),this.paintVertexArray=new f}populatePaintArray(t,r,l){let h=this.expression.evaluate(new A5(this.zoom,l),r,{},l.canonical,[],l.formattedSection),d=this.expression.evaluate(new A5(this.zoom+1,l),r,{},l.canonical,[],l.formattedSection),f=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(f,t,h,d)}updatePaintArray(t,r,l,h,d){let f=this.expression.evaluate(new A5(this.zoom,d),l,h),x=this.expression.evaluate(new A5(this.zoom+1,d),l,h);this._setPaintValue(t,r,f,x)}_setPaintValue(t,r,l,h){if(this.type==="color"){let d=E3(l),f=E3(h);for(let x=t;x<r;x++)this.paintVertexArray.emplace(x,d[0],d[1],f[0],f[1])}else{for(let d=t;d<r;d++)this.paintVertexArray.emplace(d,l,h);this.maxValue=Math.max(this.maxValue,Math.abs(l),Math.abs(h))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,r){let l=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,h=F1(this.expression.interpolationFactor(l,this.zoom,this.zoom+1),0,1);t.set(h)}getBinding(t,r,l){return new R8(t,r)}}class J5{constructor(t,r,l,h,d,f){this.expression=t,this.type=r,this.useIntegerZoom=l,this.zoom=h,this.layerId=f,this.zoomInPaintVertexArray=new d,this.zoomOutPaintVertexArray=new d}populatePaintArray(t,r,l){let h=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(h,t,this.getPositionIds(r),l)}updatePaintArray(t,r,l,h,d){this._setPaintValues(t,r,this.getPositionIds(l),d)}_setPaintValues(t,r,l,h){let d=this.getPositions(h);if(!d||!l)return;let f=d[l.min],x=d[l.mid],_=d[l.max];if(f&&x&&_)for(let b=t;b<r;b++)this.emplace(this.zoomInPaintVertexArray,b,x,f),this.emplace(this.zoomOutPaintVertexArray,b,x,_)}upload(t){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){let r=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,r,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,r,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Sn extends J5{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return H5.members}emplace(t,r,l,h){t.emplace(r,l.tlbr[0],l.tlbr[1],l.tlbr[2],l.tlbr[3],h.tlbr[0],h.tlbr[1],h.tlbr[2],h.tlbr[3],l.pixelRatio,h.pixelRatio)}}class Tn extends J5{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return G5.members}emplace(t,r,l,h){t.emplace(r,0,l.y,l.height,l.width,0,h.y,h.height,h.width)}}class zn{constructor(t,r,l){this.binders={},this._buffers=[];let h=[];for(let d in t.paint._values){if(!l(d))continue;let f=t.paint.get(d);if(!(f instanceof Y6&&y9(f.property.specification)))continue;let x=Ss(d,t.type),_=f.value,b=f.property.specification.type,z=f.property.useIntegerZoom,P=f.property.specification["property-type"],k=P==="cross-faded"||P==="cross-faded-data-driven";if(_.kind==="constant")this.binders[d]=k?new K5(_.value,x):new I3(_.value,x,b),h.push(`/u_${d}`);else if(_.kind==="source"||k){let D=Zn(d,b,"source");this.binders[d]=k?d==="line-dasharray"?new Tn(_,b,z,r,D,t.id):new Sn(_,b,z,r,D,t.id):new $5(_,x,b,D),h.push(`/a_${d}`)}else{let D=Zn(d,b,"composite");this.binders[d]=new dt(_,x,b,z,r,D),h.push(`/z_${d}`)}}this.cacheKey=h.sort().join("")}getMaxValue(t){let r=this.binders[t];return r instanceof $5||r instanceof dt?r.maxValue:0}populatePaintArrays(t,r,l){for(let h in this.binders){let d=this.binders[h];(d instanceof $5||d instanceof dt||d instanceof J5)&&d.populatePaintArray(t,r,l)}}setConstantPatternPositions(t,r){for(let l in this.binders){let h=this.binders[l];h instanceof K5&&h.setConstantPatternPositions(t,r)}}setConstantDashPositions(t,r){for(let l in this.binders){let h=this.binders[l];h instanceof K5&&h.setConstantDashPositions(t,r)}}updatePaintArrays(t,r,l,h,d){let f=!1;for(let x in t){let _=r.getPositions(x);for(let b of _){let z=l.feature(b.index);for(let P in this.binders){let k=this.binders[P];if((k instanceof $5||k instanceof dt||k instanceof J5)&&k.expression.isStateDependent===!0){let D=h.paint.get(P);k.expression=D.value,k.updatePaintArray(b.start,b.end,z,t[x],d),f=!0}}}}return f}defines(){let t=[];for(let r in this.binders){let l=this.binders[r];(l instanceof I3||l instanceof K5)&&t.push(...l.uniformNames.map((h=>`#define HAS_UNIFORM_${h}`)))}return t}getBinderAttributes(){let t=[];for(let r in this.binders){let l=this.binders[r];if(l instanceof $5||l instanceof dt)for(let h=0;h<l.paintVertexAttributes.length;h++)t.push(l.paintVertexAttributes[h].name);else if(l instanceof J5){let h=l.getVertexAttributes();for(let d of h)t.push(d.name)}}return t}getBinderUniforms(){let t=[];for(let r in this.binders){let l=this.binders[r];if(l instanceof I3||l instanceof K5||l instanceof dt)for(let h of l.uniformNames)t.push(h)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){let l=[];for(let h in this.binders){let d=this.binders[h];if(d instanceof I3||d instanceof K5||d instanceof dt){for(let f of d.uniformNames)if(r[f]){let x=d.getBinding(t,r[f],f);l.push({name:f,property:h,binding:x})}}}return l}setUniforms(t,r,l,h){for(let{name:d,property:f,binding:x}of r)this.binders[f].setUniform(x,h,l.get(f),d)}updatePaintBuffers(t){this._buffers=[];for(let r in this.binders){let l=this.binders[r];if(t&&l instanceof J5){let h=t.fromScale===2?l.zoomInPaintVertexBuffer:l.zoomOutPaintVertexBuffer;h&&this._buffers.push(h)}else(l instanceof $5||l instanceof dt)&&l.paintVertexBuffer&&this._buffers.push(l.paintVertexBuffer)}}upload(t){for(let r in this.binders){let l=this.binders[r];(l instanceof $5||l instanceof dt||l instanceof J5)&&l.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let r=this.binders[t];(r instanceof $5||r instanceof dt||r instanceof J5)&&r.destroy()}}}class F8{constructor(t,r,l=()=>!0){this.programConfigurations={};for(let h of t)this.programConfigurations[h.id]=new zn(h,r,l);this.needsUpload=!1,this._featureMap=new g3,this._bufferOffset=0}populatePaintArrays(t,r,l,h){for(let d in this.programConfigurations)this.programConfigurations[d].populatePaintArrays(t,r,h);r.id!==void 0&&this._featureMap.add(r.id,l,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,l,h){for(let d of l)this.needsUpload=this.programConfigurations[d.id].updatePaintArrays(t,this._featureMap,r,d,h)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Ss(o,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-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"]}[o]||[o.replace(`${t}-`,"").replace(/-/g,"_")]}function Zn(o,t,r){let l={color:{source:X6,composite:C},number:{source:ze,composite:X6}},h=(function(d){return{"line-pattern":{source:v1,composite:v1},"fill-pattern":{source:v1,composite:v1},"fill-extrusion-pattern":{source:v1,composite:v1},"line-dasharray":{source:h1,composite:h1}}[d]})(o);return h&&h[r]||l[t][r]}C2("ConstantBinder",I3),C2("CrossFadedConstantBinder",K5),C2("SourceExpressionBinder",$5),C2("CrossFadedPatternBinder",Sn),C2("CrossFadedDasharrayBinder",Tn),C2("CompositeExpressionBinder",dt),C2("ProgramConfiguration",zn,{omit:["_buffers"]}),C2("ProgramConfigurationSet",F8);let P3=Math.pow(2,14)-1,Y4=-P3-1;function h8(o){let t=Y1/o.extent,r=o.loadGeometry();for(let l=0;l<r.length;l++){let h=r[l];for(let d=0;d<h.length;d++){let f=h[d],x=Math.round(f.x*t),_=Math.round(f.y*t);f.x=F1(x,Y4,P3),f.y=F1(_,Y4,P3),(x<f.x||x>f.x+1||_<f.y||_>f.y+1)&&U2("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function C8(o,t){return{type:o.type,id:o.id,properties:o.properties,geometry:t?h8(o):[]}}let i7=-32768;function En(o,t,r,l,h){o.emplaceBack(i7+8*t+l,i7+8*r+h)}class Ze{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new o1,this.indexArray=new Q1,this.segments=new M2,this.programConfigurations=new F8(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,l){let h=this.layers[0],d=[],f=null,x=!1,_=h.type==="heatmap";if(h.type==="circle"){let z=h;f=z.layout.get("circle-sort-key"),x=!f.isConstant(),_=_||z.paint.get("circle-pitch-alignment")==="map"}let b=_?r.subdivisionGranularity.circle:1;for(let{feature:z,id:P,index:k,sourceLayerIndex:D}of t){let N=this.layers[0]._featureFilter.needGeometry,U=C8(z,N);if(!this.layers[0]._featureFilter.filter(new A5(this.zoom),U,l))continue;let $=x?f.evaluate(U,{},l):void 0,J={id:P,properties:z.properties,type:z.type,sourceLayerIndex:D,index:k,geometry:N?U.geometry:h8(z),patterns:{},sortKey:$};d.push(J)}x&&d.sort(((z,P)=>z.sortKey-P.sortKey));for(let z of d){let{geometry:P,index:k,sourceLayerIndex:D}=z,N=t[k].feature;this.addFeature(z,P,k,l,b),r.featureIndex.insert(N,P,k,D,this.index)}}update(t,r,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:l})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,y2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,l,h,d=1){let f;switch(d){case 1:f=[0,7];break;case 3:f=[0,2,5,7];break;case 5:f=[0,1,3,4,6,7];break;case 7:f=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${d}; valid values are 1, 3, 5, 7.`)}let x=f.length;for(let _ of r)for(let b of _){let z=b.x,P=b.y;if(z<0||z>=Y1||P<0||P>=Y1)continue;let k=this.segments.prepareSegment(x*x,this.layoutVertexArray,this.indexArray,t.sortKey),D=k.vertexLength;for(let N=0;N<x;N++)for(let U=0;U<x;U++)En(this.layoutVertexArray,z,P,f[U],f[N]);for(let N=0;N<x-1;N++)for(let U=0;U<x-1;U++){let $=D+N*x+U,J=D+(N+1)*x+U;this.indexArray.emplaceBack($,J+1,$+1),this.indexArray.emplaceBack($,J,J+1)}k.vertexLength+=x*x,k.primitiveLength+=(x-1)*(x-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,{imagePositions:{},canonical:h})}}function bC(o,t){for(let r=0;r<o.length;r++)if(r7(t,o[r]))return!0;for(let r=0;r<t.length;r++)if(r7(o,t[r]))return!0;return!!Ts(o,t)}function In(o,t,r){return!!r7(o,t)||!!zs(t,o,r)}function wC(o,t){if(o.length===1)return TC(t,o[0]);for(let r=0;r<t.length;r++){let l=t[r];for(let h=0;h<l.length;h++)if(r7(o,l[h]))return!0}for(let r=0;r<o.length;r++)if(TC(t,o[r]))return!0;for(let r=0;r<t.length;r++)if(Ts(o,t[r]))return!0;return!1}function o_(o,t,r){if(o.length>1){if(Ts(o,t))return!0;for(let l=0;l<t.length;l++)if(zs(t[l],o,r))return!0}for(let l=0;l<o.length;l++)if(zs(o[l],t,r))return!0;return!1}function Ts(o,t){if(o.length===0||t.length===0)return!1;for(let r=0;r<o.length-1;r++){let l=o[r],h=o[r+1];for(let d=0;d<t.length-1;d++)if(a_(l,h,t[d],t[d+1]))return!0}return!1}function a_(o,t,r,l){return m2(o,r,l)!==m2(t,r,l)&&m2(o,t,r)!==m2(o,t,l)}function zs(o,t,r){let l=r*r;if(t.length===1)return o.distSqr(t[0])<l;for(let h=1;h<t.length;h++)if(SC(o,t[h-1],t[h])<l)return!0;return!1}function SC(o,t,r){let l=t.distSqr(r);if(l===0)return o.distSqr(t);let h=((o.x-t.x)*(r.x-t.x)+(o.y-t.y)*(r.y-t.y))/l;return o.distSqr(h<0?t:h>1?r:r.sub(t)._mult(h)._add(t))}function TC(o,t){let r,l,h,d=!1;for(let f=0;f<o.length;f++){r=o[f];for(let x=0,_=r.length-1;x<r.length;_=x++)l=r[x],h=r[_],l.y>t.y!=h.y>t.y&&t.x<(h.x-l.x)*(t.y-l.y)/(h.y-l.y)+l.x&&(d=!d)}return d}function r7(o,t){let r=!1;for(let l=0,h=o.length-1;l<o.length;h=l++){let d=o[l],f=o[h];d.y>t.y!=f.y>t.y&&t.x<(f.x-d.x)*(t.y-d.y)/(f.y-d.y)+d.x&&(r=!r)}return r}function s_(o,t,r){let l=r[0],h=r[2];if(o.x<l.x&&t.x<l.x||o.x>h.x&&t.x>h.x||o.y<l.y&&t.y<l.y||o.y>h.y&&t.y>h.y)return!1;let d=m2(o,t,r[0]);return d!==m2(o,t,r[1])||d!==m2(o,t,r[2])||d!==m2(o,t,r[3])}function n7(o,t,r){let l=t.paint.get(o).value;return l.kind==="constant"?l.value:r.programConfigurations.get(t.id).getMaxValue(o)}function Pn(o){return Math.sqrt(o[0]*o[0]+o[1]*o[1])}function An(o,t,r,l,h){if(!t[0]&&!t[1])return o;let d=y.convert(t)._mult(h);r==="viewport"&&d._rotate(-l);let f=[];for(let x=0;x<o.length;x++)f.push(o[x].sub(d));return f}function l_({queryGeometry:o,size:t},r){return In(o,r,t)}function c_({queryGeometry:o,size:t,transform:r,unwrappedTileID:l,getElevation:h},d){return In(o,d,t*(r.projectTileCoordinates(d.x,d.y,l,h).signedDistanceFromCamera/r.cameraToCenterDistance))}function L_({queryGeometry:o,size:t,transform:r,unwrappedTileID:l,getElevation:h},d){let f=r.projectTileCoordinates(d.x,d.y,l,h).signedDistanceFromCamera,x=t*(r.cameraToCenterDistance/f);return In(o,Zs(d,r,l,h),x)}function u_({queryGeometry:o,size:t,transform:r,unwrappedTileID:l,getElevation:h},d){return In(o,Zs(d,r,l,h),t)}function zC({queryGeometry:o,size:t,transform:r,unwrappedTileID:l,getElevation:h,pitchAlignment:d="map",pitchScale:f="map"},x){let _=d==="map"?f==="map"?l_:c_:f==="map"?L_:u_,b={queryGeometry:o,size:t,transform:r,unwrappedTileID:l,getElevation:h};for(let z of x)for(let P of z)if(_(b,P))return!0;return!1}function Zs(o,t,r,l){let h=t.projectTileCoordinates(o.x,o.y,r,l).point;return new y((.5*h.x+.5)*t.width,(.5*-h.y+.5)*t.height)}let ZC,EC;C2("CircleBucket",Ze,{omit:["layers"]});var h_={get paint(){return EC=EC||new s6({"circle-radius":new P2(t1.paint_circle["circle-radius"]),"circle-color":new P2(t1.paint_circle["circle-color"]),"circle-blur":new P2(t1.paint_circle["circle-blur"]),"circle-opacity":new P2(t1.paint_circle["circle-opacity"]),"circle-translate":new v2(t1.paint_circle["circle-translate"]),"circle-translate-anchor":new v2(t1.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new v2(t1.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new v2(t1.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new P2(t1.paint_circle["circle-stroke-width"]),"circle-stroke-color":new P2(t1.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new P2(t1.paint_circle["circle-stroke-opacity"])})},get layout(){return ZC=ZC||new s6({"circle-sort-key":new P2(t1.layout_circle["circle-sort-key"])})}};class C_ extends R6{constructor(t,r){super(t,h_,r)}createBucket(t){return new Ze(t)}queryRadius(t){let r=t;return n7("circle-radius",this,r)+n7("circle-stroke-width",this,r)+Pn(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:l,geometry:h,transform:d,pixelsToTileUnits:f,unwrappedTileID:x,getElevation:_}){let b=An(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-d.bearingInRadians,f),z=this.paint.get("circle-radius").evaluate(r,l)+this.paint.get("circle-stroke-width").evaluate(r,l),P=this.paint.get("circle-pitch-scale"),k=this.paint.get("circle-pitch-alignment"),D,N;return k==="map"?(D=b,N=z*f):(D=(function(U,$,J,L1){return U.map((Q=>Zs(Q,$,J,L1)))})(b,d,x,_),N=z),zC({queryGeometry:D,size:N,transform:d,unwrappedTileID:x,getElevation:_,pitchAlignment:k,pitchScale:P},h)}}class IC extends Ze{}let PC;C2("HeatmapBucket",IC,{omit:["layers"]});var d_={get paint(){return PC=PC||new s6({"heatmap-radius":new P2(t1.paint_heatmap["heatmap-radius"]),"heatmap-weight":new P2(t1.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new v2(t1.paint_heatmap["heatmap-intensity"]),"heatmap-color":new X0(t1.paint_heatmap["heatmap-color"]),"heatmap-opacity":new v2(t1.paint_heatmap["heatmap-opacity"])})}};function Es(o,{width:t,height:r},l,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==t*r*l)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${t*r*l}`)}else h=new Uint8Array(t*r*l);return o.width=t,o.height=r,o.data=h,o}function AC(o,{width:t,height:r},l){if(t===o.width&&r===o.height)return;let h=Es({},{width:t,height:r},l);Is(o,h,{x:0,y:0},{x:0,y:0},{width:Math.min(o.width,t),height:Math.min(o.height,r)},l),o.width=t,o.height=r,o.data=h.data}function Is(o,t,r,l,h,d){if(h.width===0||h.height===0)return t;if(h.width>o.width||h.height>o.height||r.x>o.width-h.width||r.y>o.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>t.width||h.height>t.height||l.x>t.width-h.width||l.y>t.height-h.height)throw new RangeError("out of range destination coordinates for image copy");let f=o.data,x=t.data;if(f===x)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<h.height;_++){let b=((r.y+_)*o.width+r.x)*d,z=((l.y+_)*t.width+l.x)*d;for(let P=0;P<h.width*d;P++)x[z+P]=f[b+P]}return t}class X4{constructor(t,r){Es(this,t,1,r)}resize(t){AC(this,t,1)}clone(){return new X4({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,l,h,d){Is(t,r,l,h,d,1)}}class S6{constructor(t,r){Es(this,t,4,r)}resize(t){AC(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new S6({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,l,h,d){Is(t,r,l,h,d,4)}setPixel(t,r,l){let h=4*(t*this.width+r);this.data[h+0]=Math.round(255*l.r/l.a),this.data[h+1]=Math.round(255*l.g/l.a),this.data[h+2]=Math.round(255*l.b/l.a),this.data[h+3]=Math.round(255*l.a)}}function BC(o){let t={},r=o.resolution||256,l=o.clips?o.clips.length:1,h=o.image||new S6({width:r,height:l});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);let d=(f,x,_)=>{t[o.evaluationKey]=_;let b=o.expression.evaluate(t);h.setPixel(f/4/r,x/4,b)};if(o.clips)for(let f=0,x=0;f<l;++f,x+=4*r)for(let _=0,b=0;_<r;_++,b+=4){let z=_/(r-1),{start:P,end:k}=o.clips[f];d(x,b,P*(1-z)+k*z)}else for(let f=0,x=0;f<r;f++,x+=4)d(0,x,f/(r-1));return h}C2("AlphaImage",X4),C2("RGBAImage",S6);let Ps="big-fb";class p_ extends R6{createBucket(t){return new IC(t)}constructor(t,r){super(t,d_,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=BC({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ps)&&this.heatmapFbos.delete(Ps)}queryRadius(t){return n7("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:l,geometry:h,transform:d,pixelsToTileUnits:f,unwrappedTileID:x,getElevation:_}){return zC({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(r,l)*f,transform:d,unwrappedTileID:x,getElevation:_},h)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let kC;var f_={get paint(){return kC=kC||new s6({"hillshade-illumination-direction":new v2(t1.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new v2(t1.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new v2(t1.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new v2(t1.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new v2(t1.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new v2(t1.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new v2(t1.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new v2(t1.paint_hillshade["hillshade-method"])})}};class g_ extends R6{constructor(t,r){super(t,f_,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,l=this.paint.get("hillshade-highlight-color").values,h=this.paint.get("hillshade-shadow-color").values,d=Math.max(t.length,r.length,l.length,h.length);t=t.concat(Array(d-t.length).fill(t.at(-1))),r=r.concat(Array(d-r.length).fill(r.at(-1))),l=l.concat(Array(d-l.length).fill(l.at(-1))),h=h.concat(Array(d-h.length).fill(h.at(-1)));let f=r.map(W2);return{directionRadians:t.map(W2),altitudeRadians:f,shadowColor:h,highlightColor:l}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let RC;var m_={get paint(){return RC=RC||new s6({"color-relief-opacity":new v2(t1["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new X0(t1["paint_color-relief"]["color-relief-color"])})}};class As{constructor(t,r,l,h){this.context=t,this.format=l,this.texture=t.gl.createTexture(),this.update(r,h)}update(t,r,l){let{width:h,height:d}=t,f=!(this.size&&this.size[0]===h&&this.size[1]===d||l),{context:x}=this,{gl:_}=x;if(this.useMipmap=!!(r&&r.useMipmap),_.bindTexture(_.TEXTURE_2D,this.texture),x.pixelStoreUnpackFlipY.set(!1),x.pixelStoreUnpack.set(1),x.pixelStoreUnpackPremultiplyAlpha.set(this.format===_.RGBA&&(!r||r.premultiply!==!1)),f)this.size=[h,d],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||X2(t)?_.texImage2D(_.TEXTURE_2D,0,this.format,this.format,_.UNSIGNED_BYTE,t):_.texImage2D(_.TEXTURE_2D,0,this.format,h,d,0,this.format,_.UNSIGNED_BYTE,t.data);else{let{x:b,y:z}=l||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||X2(t)?_.texSubImage2D(_.TEXTURE_2D,0,b,z,_.RGBA,_.UNSIGNED_BYTE,t):_.texSubImage2D(_.TEXTURE_2D,0,b,z,h,d,_.RGBA,_.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&_.generateMipmap(_.TEXTURE_2D),x.pixelStoreUnpackFlipY.setDefault(),x.pixelStoreUnpack.setDefault(),x.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(t,r,l){let{context:h}=this,{gl:d}=h;d.bindTexture(d.TEXTURE_2D,this.texture),l!==d.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(l=d.LINEAR),t!==this.filter&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,l||t),this.filter=t),r!==this.wrap&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,r),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class DC{constructor(t,r,l,h=1,d=1,f=1,x=0){if(this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(l&&!["mapbox","terrarium","custom"].includes(l))return void U2(`"${l}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;let _=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),l){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=h,this.greenFactor=d,this.blueFactor=f,this.baseShift=x;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let b=0;b<_;b++)this.data[this._idx(-1,b)]=this.data[this._idx(0,b)],this.data[this._idx(_,b)]=this.data[this._idx(_-1,b)],this.data[this._idx(b,-1)]=this.data[this._idx(b,0)],this.data[this._idx(b,_)]=this.data[this._idx(b,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let b=0;b<_;b++)for(let z=0;z<_;z++){let P=this.get(b,z);P>this.max&&(this.max=P),P<this.min&&(this.min=P)}}get(t,r){let l=new Uint8Array(this.data.buffer),h=4*this._idx(t,r);return this.unpack(l[h],l[h+1],l[h+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-1||t>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,l){return t*this.redFactor+r*this.greenFactor+l*this.blueFactor-this.baseShift}pack(t){return FC(t,this.getUnpackVector())}getPixels(){return new S6({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,l){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let h=r*this.dim,d=r*this.dim+this.dim,f=l*this.dim,x=l*this.dim+this.dim;switch(r){case-1:h=d-1;break;case 1:d=h+1}switch(l){case-1:f=x-1;break;case 1:x=f+1}let _=-r*this.dim,b=-l*this.dim;for(let z=f;z<x;z++)for(let P=h;P<d;P++)this.data[this._idx(P,z)]=t.data[this._idx(P+_,z+b)]}}function FC(o,t){let r=t[0],l=t[1],h=t[2],d=t[3],f=Math.min(r,l,h),x=Math.round((o+d)/f);return{r:Math.floor(x*f/r)%256,g:Math.floor(x*f/l)%256,b:Math.floor(x*f/h)%256}}C2("DEMData",DC);class x_ extends R6{constructor(t,r){super(t,m_,r)}_createColorRamp(t){let r={elevationStops:[],colorStops:[]},l=this._transitionablePaint._values["color-relief-color"].value.expression;if(l instanceof P8&&l._styleExpression.expression instanceof Ut){this.colorRampExpression=l;let f=l._styleExpression.expression;r.elevationStops=f.labels,r.colorStops=[];for(let x of r.elevationStops)r.colorStops.push(f.evaluate({globals:{elevation:x}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[s5.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=t)return r;let h={elevationStops:[],colorStops:[]},d=(r.elevationStops.length-1)/(t-1);for(let f=0;f<r.elevationStops.length-.5;f+=d)h.elevationStops.push(r.elevationStops[Math.round(f)]),h.colorStops.push(r.colorStops[Math.round(f)]);return U2(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${r.elevationStops.length}`),h}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,r,l){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let h=this._createColorRamp(r),d=new S6({width:h.colorStops.length,height:1}),f=new S6({width:h.colorStops.length,height:1});for(let x=0;x<h.elevationStops.length;x++){let _=FC(h.elevationStops[x],l);f.setPixel(0,x,new s5(_.r/255,_.g/255,_.b/255,1)),d.setPixel(0,x,h.colorStops[x])}return this.colorRampTextures={elevationTexture:new As(t,f,t.gl.RGBA),colorTexture:new As(t,d,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}}let y_=V5([{name:"a_pos",components:2,type:"Int16"}],4),{members:v_}=y_;function Bn(o,t,r){let l=r.patternDependencies,h=!1;for(let d of t){let f=d.paint.get(`${o}-pattern`);f.isConstant()||(h=!0);let x=f.constantOr(null);x&&(h=!0,l[x.to]=!0,l[x.from]=!0)}return h}function Bs(o,t,r,l,h){let{zoom:d}=l,f=h.patternDependencies;for(let x of t){let _=x.paint.get(`${o}-pattern`).value;if(_.kind!=="constant"){let b=_.evaluate({zoom:d-1},r,{},h.availableImages),z=_.evaluate({zoom:d},r,{},h.availableImages),P=_.evaluate({zoom:d+1},r,{},h.availableImages);b=b&&b.name?b.name:b,z=z&&z.name?z.name:z,P=P&&P.name?P.name:P,f[b]=!0,f[z]=!0,f[P]=!0,r.patterns[x.id]={min:b,mid:z,max:P}}}return r}function OC(o,t,r,l,h){let d;if(h===(function(f,x,_,b){let z=0;for(let P=x,k=_-b;P<_;P+=b)z+=(f[k]-f[P])*(f[P+1]+f[k+1]),k=P;return z})(o,t,r,l)>0)for(let f=t;f<r;f+=l)d=UC(f/l|0,o[f],o[f+1],d);else for(let f=r-l;f>=t;f-=l)d=UC(f/l|0,o[f],o[f+1],d);return d&&o7(d,d.next)&&(ti(d),d=d.next),d}function Ee(o,t){if(!o)return o;t||(t=o);let r,l=o;do if(r=!1,l.steiner||!o7(l,l.next)&&ft(l.prev,l,l.next)!==0)l=l.next;else{if(ti(l),l=t=l.prev,l===l.next)break;r=!0}while(r||l!==t);return t}function K4(o,t,r,l,h,d,f){if(!o)return;!f&&d&&(function(_,b,z,P){let k=_;do k.z===0&&(k.z=ks(k.x,k.y,b,z,P)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==_);k.prevZ.nextZ=null,k.prevZ=null,(function(D){let N,U=1;do{let $,J=D;D=null;let L1=null;for(N=0;J;){N++;let Q=J,n1=0;for(let _1=0;_1<U&&(n1++,Q=Q.nextZ,Q);_1++);let f1=U;for(;n1>0||f1>0&&Q;)n1!==0&&(f1===0||!Q||J.z<=Q.z)?($=J,J=J.nextZ,n1--):($=Q,Q=Q.nextZ,f1--),L1?L1.nextZ=$:D=$,$.prevZ=L1,L1=$;J=Q}L1.nextZ=null,U*=2}while(N>1)})(k)})(o,l,h,d);let x=o;for(;o.prev!==o.next;){let _=o.prev,b=o.next;if(d?M_(o,l,h,d):__(o))t.push(_.i,o.i,b.i),ti(o),o=b.next,x=b.next;else if((o=b)===x){f?f===1?K4(o=b_(Ee(o),t),t,r,l,h,d,2):f===2&&w_(o,t,r,l,h,d):K4(Ee(o),t,r,l,h,d,1);break}}}function __(o){let t=o.prev,r=o,l=o.next;if(ft(t,r,l)>=0)return!1;let h=t.x,d=r.x,f=l.x,x=t.y,_=r.y,b=l.y,z=Math.min(h,d,f),P=Math.min(x,_,b),k=Math.max(h,d,f),D=Math.max(x,_,b),N=l.next;for(;N!==t;){if(N.x>=z&&N.x<=k&&N.y>=P&&N.y<=D&&J4(h,x,d,_,f,b,N.x,N.y)&&ft(N.prev,N,N.next)>=0)return!1;N=N.next}return!0}function M_(o,t,r,l){let h=o.prev,d=o,f=o.next;if(ft(h,d,f)>=0)return!1;let x=h.x,_=d.x,b=f.x,z=h.y,P=d.y,k=f.y,D=Math.min(x,_,b),N=Math.min(z,P,k),U=Math.max(x,_,b),$=Math.max(z,P,k),J=ks(D,N,t,r,l),L1=ks(U,$,t,r,l),Q=o.prevZ,n1=o.nextZ;for(;Q&&Q.z>=J&&n1&&n1.z<=L1;){if(Q.x>=D&&Q.x<=U&&Q.y>=N&&Q.y<=$&&Q!==h&&Q!==f&&J4(x,z,_,P,b,k,Q.x,Q.y)&&ft(Q.prev,Q,Q.next)>=0||(Q=Q.prevZ,n1.x>=D&&n1.x<=U&&n1.y>=N&&n1.y<=$&&n1!==h&&n1!==f&&J4(x,z,_,P,b,k,n1.x,n1.y)&&ft(n1.prev,n1,n1.next)>=0))return!1;n1=n1.nextZ}for(;Q&&Q.z>=J;){if(Q.x>=D&&Q.x<=U&&Q.y>=N&&Q.y<=$&&Q!==h&&Q!==f&&J4(x,z,_,P,b,k,Q.x,Q.y)&&ft(Q.prev,Q,Q.next)>=0)return!1;Q=Q.prevZ}for(;n1&&n1.z<=L1;){if(n1.x>=D&&n1.x<=U&&n1.y>=N&&n1.y<=$&&n1!==h&&n1!==f&&J4(x,z,_,P,b,k,n1.x,n1.y)&&ft(n1.prev,n1,n1.next)>=0)return!1;n1=n1.nextZ}return!0}function b_(o,t){let r=o;do{let l=r.prev,h=r.next.next;!o7(l,h)&&VC(l,r,r.next,h)&&Q4(l,h)&&Q4(h,l)&&(t.push(l.i,r.i,h.i),ti(r),ti(r.next),r=o=h),r=r.next}while(r!==o);return Ee(r)}function w_(o,t,r,l,h,d){let f=o;do{let x=f.next.next;for(;x!==f.prev;){if(f.i!==x.i&&E_(f,x)){let _=GC(f,x);return f=Ee(f,f.next),_=Ee(_,_.next),K4(f,t,r,l,h,d,0),void K4(_,t,r,l,h,d,0)}x=x.next}f=f.next}while(f!==o)}function S_(o,t){let r=o.x-t.x;return r===0&&(r=o.y-t.y,r===0)&&(r=(o.next.y-o.y)/(o.next.x-o.x)-(t.next.y-t.y)/(t.next.x-t.x)),r}function T_(o,t){let r=(function(h,d){let f=d,x=h.x,_=h.y,b,z=-1/0;if(o7(h,f))return f;do{if(o7(h,f.next))return f.next;if(_<=f.y&&_>=f.next.y&&f.next.y!==f.y){let U=f.x+(_-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(U<=x&&U>z&&(z=U,b=f.x<f.next.x?f:f.next,U===x))return b}f=f.next}while(f!==d);if(!b)return null;let P=b,k=b.x,D=b.y,N=1/0;f=b;do{if(x>=f.x&&f.x>=k&&x!==f.x&&NC(_<D?x:z,_,k,D,_<D?z:x,_,f.x,f.y)){let U=Math.abs(_-f.y)/(x-f.x);Q4(f,h)&&(U<N||U===N&&(f.x>b.x||f.x===b.x&&z_(b,f)))&&(b=f,N=U)}f=f.next}while(f!==P);return b})(o,t);if(!r)return t;let l=GC(r,o);return Ee(l,l.next),Ee(r,r.next)}function z_(o,t){return ft(o.prev,o,t.prev)<0&&ft(t.next,o,o.next)<0}function ks(o,t,r,l,h){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=(o-r)*h|0)|o<<8))|o<<4))|o<<2))|o<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-l)*h|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Z_(o){let t=o,r=o;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==o);return r}function NC(o,t,r,l,h,d,f,x){return(h-f)*(t-x)>=(o-f)*(d-x)&&(o-f)*(l-x)>=(r-f)*(t-x)&&(r-f)*(d-x)>=(h-f)*(l-x)}function J4(o,t,r,l,h,d,f,x){return!(o===f&&t===x)&&NC(o,t,r,l,h,d,f,x)}function E_(o,t){return o.next.i!==t.i&&o.prev.i!==t.i&&!(function(r,l){let h=r;do{if(h.i!==r.i&&h.next.i!==r.i&&h.i!==l.i&&h.next.i!==l.i&&VC(h,h.next,r,l))return!0;h=h.next}while(h!==r);return!1})(o,t)&&(Q4(o,t)&&Q4(t,o)&&(function(r,l){let h=r,d=!1,f=(r.x+l.x)/2,x=(r.y+l.y)/2;do h.y>x!=h.next.y>x&&h.next.y!==h.y&&f<(h.next.x-h.x)*(x-h.y)/(h.next.y-h.y)+h.x&&(d=!d),h=h.next;while(h!==r);return d})(o,t)&&(ft(o.prev,o,t.prev)||ft(o,t.prev,t))||o7(o,t)&&ft(o.prev,o,o.next)>0&&ft(t.prev,t,t.next)>0)}function ft(o,t,r){return(t.y-o.y)*(r.x-t.x)-(t.x-o.x)*(r.y-t.y)}function o7(o,t){return o.x===t.x&&o.y===t.y}function VC(o,t,r,l){let h=Rn(ft(o,t,r)),d=Rn(ft(o,t,l)),f=Rn(ft(r,l,o)),x=Rn(ft(r,l,t));return h!==d&&f!==x||!(h!==0||!kn(o,r,t))||!(d!==0||!kn(o,l,t))||!(f!==0||!kn(r,o,l))||!(x!==0||!kn(r,t,l))}function kn(o,t,r){return t.x<=Math.max(o.x,r.x)&&t.x>=Math.min(o.x,r.x)&&t.y<=Math.max(o.y,r.y)&&t.y>=Math.min(o.y,r.y)}function Rn(o){return o>0?1:o<0?-1:0}function Q4(o,t){return ft(o.prev,o,o.next)<0?ft(o,t,o.next)>=0&&ft(o,o.prev,t)>=0:ft(o,t,o.prev)<0||ft(o,o.next,t)<0}function GC(o,t){let r=Rs(o.i,o.x,o.y),l=Rs(t.i,t.x,t.y),h=o.next,d=t.prev;return o.next=t,t.prev=o,r.next=h,h.prev=r,l.next=r,r.prev=l,d.next=l,l.prev=d,l}function UC(o,t,r,l){let h=Rs(o,t,r);return l?(h.next=l.next,h.prev=l,l.next.prev=h,l.next=h):(h.prev=h,h.next=h),h}function ti(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Rs(o,t,r){return{i:o,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class a7{constructor(t,r){if(r>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=r}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class Dn{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}Dn.noSubdivision=new Dn({fill:new a7(0,0),line:new a7(0,0),tile:new a7(0,0),stencil:new a7(0,0),circle:1}),C2("SubdivisionGranularityExpression",a7),C2("SubdivisionGranularitySetting",Dn);let s7=-32768,ei=32767;class I_{constructor(t,r){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=Y1/t,this._canonical=r}_getKey(t,r){return(t+=32768)<<16|r+32768}_vertexToIndex(t,r){if(t<-32768||r<-32768||t>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let l=0|Math.round(t),h=0|Math.round(r),d=this._getKey(l,h);if(this._vertexDictionary.has(d))return this._vertexDictionary.get(d);let f=this._vertexBuffer.length/2;return this._vertexDictionary.set(d,f),this._vertexBuffer.push(l,h),f}_subdivideTrianglesScanline(t){if(this._granularity<2)return(function(h,d){let f=[];for(let x=0;x<d.length;x+=3){let _=d[x],b=d[x+1],z=d[x+2],P=h[2*_],k=h[2*_+1];(h[2*b]-P)*(h[2*z+1]-k)-(h[2*b+1]-k)*(h[2*z]-P)>0?(f.push(_),f.push(z),f.push(b)):(f.push(_),f.push(b),f.push(z))}return f})(this._vertexBuffer,t);let r=[],l=t.length;for(let h=0;h<l;h+=3){let d=[t[h+0],t[h+1],t[h+2]],f=[this._vertexBuffer[2*t[h+0]+0],this._vertexBuffer[2*t[h+0]+1],this._vertexBuffer[2*t[h+1]+0],this._vertexBuffer[2*t[h+1]+1],this._vertexBuffer[2*t[h+2]+0],this._vertexBuffer[2*t[h+2]+1]],x=1/0,_=1/0,b=-1/0,z=-1/0;for(let U=0;U<3;U++){let $=f[2*U],J=f[2*U+1];x=Math.min(x,$),b=Math.max(b,$),_=Math.min(_,J),z=Math.max(z,J)}if(x===b||_===z)continue;let P=Math.floor(x/this._granularityCellSize),k=Math.ceil(b/this._granularityCellSize),D=Math.floor(_/this._granularityCellSize),N=Math.ceil(z/this._granularityCellSize);if(P!==k||D!==N)for(let U=D;U<N;U++){let $=this._scanlineGenerateVertexRingForCellRow(U,f,d);P_(this._vertexBuffer,$,r)}else r.push(...d)}return r}_scanlineGenerateVertexRingForCellRow(t,r,l){let h=t*this._granularityCellSize,d=h+this._granularityCellSize,f=[];for(let x=0;x<3;x++){let _=r[2*x],b=r[2*x+1],z=r[2*(x+1)%6],P=r[(2*(x+1)+1)%6],k=r[2*(x+2)%6],D=r[(2*(x+2)+1)%6],N=z-_,U=P-b,$=N===0,J=U===0,L1=(h-b)/U,Q=(d-b)/U,n1=Math.min(L1,Q),f1=Math.max(L1,Q);if(!J&&(n1>=1||f1<=0)||J&&(b<h||b>d)){P>=h&&P<=d&&f.push(l[(x+1)%3]);continue}!J&&n1>0&&f.push(this._vertexToIndex(_+N*n1,b+U*n1));let _1=_+N*Math.max(n1,0),P1=_+N*Math.min(f1,1);$||this._generateIntraEdgeVertices(f,_,b,z,P,_1,P1),!J&&f1<1&&f.push(this._vertexToIndex(_+N*f1,b+U*f1)),(J||P>=h&&P<=d)&&f.push(l[(x+1)%3]),!J&&(P<=h||P>=d)&&this._generateInterEdgeVertices(f,_,b,z,P,k,D,P1,h,d)}return f}_generateIntraEdgeVertices(t,r,l,h,d,f,x){let _=h-r,b=d-l,z=b===0,P=z?Math.min(r,h):Math.min(f,x),k=z?Math.max(r,h):Math.max(f,x),D=Math.floor(P/this._granularityCellSize)+1,N=Math.ceil(k/this._granularityCellSize)-1;if(z?r<h:f<x)for(let U=D;U<=N;U++){let $=U*this._granularityCellSize;t.push(this._vertexToIndex($,l+b*($-r)/_))}else for(let U=N;U>=D;U--){let $=U*this._granularityCellSize;t.push(this._vertexToIndex($,l+b*($-r)/_))}}_generateInterEdgeVertices(t,r,l,h,d,f,x,_,b,z){let P=d-l,k=f-h,D=x-d,N=(b-d)/D,U=(z-d)/D,$=Math.min(N,U),J=Math.max(N,U),L1=h+k*$,Q=Math.floor(Math.min(L1,_)/this._granularityCellSize)+1,n1=Math.ceil(Math.max(L1,_)/this._granularityCellSize)-1,f1=_<L1,_1=D===0;if(_1&&(x===b||x===z))return;if(_1||$>=1||J<=0){let $1=l-x,j1=f+(r-f)*Math.min((b-x)/$1,(z-x)/$1);Q=Math.floor(Math.min(j1,_)/this._granularityCellSize)+1,n1=Math.ceil(Math.max(j1,_)/this._granularityCellSize)-1,f1=_<j1}let P1=P>0?z:b;if(f1)for(let $1=Q;$1<=n1;$1++)t.push(this._vertexToIndex($1*this._granularityCellSize,P1));else for(let $1=n1;$1>=Q;$1--)t.push(this._vertexToIndex($1*this._granularityCellSize,P1))}_generateOutline(t){let r=[];for(let l of t){let h=Ie(l,this._granularity,!0),d=this._pointArrayToIndices(h),f=[];for(let x=1;x<d.length;x++)f.push(d[x-1]),f.push(d[x]);r.push(f)}return r}_handlePoles(t){let r=!1,l=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(l=!0)),(r||l)&&this._fillPoles(t,r,l)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let r=0;r<t.length;r+=2){let l=t[r+1];l===s7&&(t[r+1]=-32767),l===ei&&(t[r+1]=32766)}}_generatePoleQuad(t,r,l,h,d,f){h>d!=(f===s7)?(t.push(r),t.push(l),t.push(this._vertexToIndex(h,f)),t.push(l),t.push(this._vertexToIndex(d,f)),t.push(this._vertexToIndex(h,f))):(t.push(l),t.push(r),t.push(this._vertexToIndex(h,f)),t.push(this._vertexToIndex(d,f)),t.push(l),t.push(this._vertexToIndex(h,f)))}_fillPoles(t,r,l){let h=this._vertexBuffer,d=Y1,f=t.length;for(let x=2;x<f;x+=3){let _=t[x-2],b=t[x-1],z=t[x],P=h[2*_],k=h[2*_+1],D=h[2*b],N=h[2*b+1],U=h[2*z],$=h[2*z+1];r&&(k===0&&N===0&&this._generatePoleQuad(t,_,b,P,D,s7),N===0&&$===0&&this._generatePoleQuad(t,b,z,D,U,s7),$===0&&k===0&&this._generatePoleQuad(t,z,_,U,P,s7)),l&&(k===d&&N===d&&this._generatePoleQuad(t,_,b,P,D,ei),N===d&&$===d&&this._generatePoleQuad(t,b,z,D,U,ei),$===d&&k===d&&this._generatePoleQuad(t,z,_,U,P,ei))}}_initializeVertices(t){for(let r=0;r<t.length;r+=2)this._vertexToIndex(t[r],t[r+1])}subdividePolygonInternal(t,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:l,holeIndices:h}=(function(x){let _=[],b=[];for(let z of x)if(z.length!==0){z!==x[0]&&_.push(b.length/2);for(let P=0;P<z.length;P++)b.push(z[P].x),b.push(z[P].y)}return{flattened:b,holeIndices:_}})(t),d;this._initializeVertices(l);try{let x=(function(b,z,P=2){let k=z&&z.length,D=k?z[0]*P:b.length,N=OC(b,0,D,P,!0),U=[];if(!N||N.next===N.prev)return U;let $,J,L1;if(k&&(N=(function(Q,n1,f1,_1){let P1=[];for(let $1=0,j1=n1.length;$1<j1;$1++){let J1=OC(Q,n1[$1]*_1,$1<j1-1?n1[$1+1]*_1:Q.length,_1,!1);J1===J1.next&&(J1.steiner=!0),P1.push(Z_(J1))}P1.sort(S_);for(let $1=0;$1<P1.length;$1++)f1=T_(P1[$1],f1);return f1})(b,z,N,P)),b.length>80*P){$=b[0],J=b[1];let Q=$,n1=J;for(let f1=P;f1<D;f1+=P){let _1=b[f1],P1=b[f1+1];_1<$&&($=_1),P1<J&&(J=P1),_1>Q&&(Q=_1),P1>n1&&(n1=P1)}L1=Math.max(Q-$,n1-J),L1=L1!==0?32767/L1:0}return K4(N,U,P,$,J,L1,0),U})(l,h),_=this._convertIndices(l,x);d=this._subdivideTrianglesScanline(_)}catch(x){console.error(x)}let f=[];return r&&(f=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(d),{verticesFlattened:this._vertexBuffer,indicesTriangles:d,indicesLineList:f}}_convertIndices(t,r){let l=[];for(let h=0;h<r.length;h++)l.push(this._vertexToIndex(t[2*r[h]],t[2*r[h]+1]));return l}_pointArrayToIndices(t){let r=[];for(let l=0;l<t.length;l++){let h=t[l];r.push(this._vertexToIndex(h.x,h.y))}return r}}function jC(o,t,r,l=!0){return new I_(r,t).subdividePolygonInternal(o,l)}function Ie(o,t,r=!1){if(!o||o.length<1)return[];if(o.length<2)return[];let l=o[0],h=o[o.length-1],d=r&&(l.x!==h.x||l.y!==h.y);if(t<2)return d?[...o,o[0]]:[...o];let f=Math.floor(Y1/t),x=[];x.push(new y(o[0].x,o[0].y));let _=o.length,b=d?_:_-1;for(let z=0;z<b;z++){let P=o[z],k=z<_-1?o[z+1]:o[0],D=P.x,N=P.y,U=k.x,$=k.y,J=D!==U,L1=N!==$;if(!J&&!L1)continue;let Q=U-D,n1=$-N,f1=Math.abs(Q),_1=Math.abs(n1),P1=D,$1=N;for(;;){let J1=Q>0?(Math.floor(P1/f)+1)*f:(Math.ceil(P1/f)-1)*f,u2=n1>0?(Math.floor($1/f)+1)*f:(Math.ceil($1/f)-1)*f,r2=Math.abs(P1-J1),n2=Math.abs($1-u2),V1=Math.abs(P1-U),I2=Math.abs($1-$),z2=J?r2/f1:Number.POSITIVE_INFINITY,E2=L1?n2/_1:Number.POSITIVE_INFINITY;if((V1<=r2||!J)&&(I2<=n2||!L1))break;if(z2<E2&&J||!L1){P1=J1,$1+=n1*z2;let x2=new y(P1,Math.round($1));x[x.length-1].x===x2.x&&x[x.length-1].y===x2.y||x.push(x2)}else{P1+=Q*E2,$1=u2;let x2=new y(Math.round(P1),$1);x[x.length-1].x===x2.x&&x[x.length-1].y===x2.y||x.push(x2)}}let j1=new y(U,$);x[x.length-1].x===j1.x&&x[x.length-1].y===j1.y||x.push(j1)}return x}function P_(o,t,r){if(t.length===0)throw new Error("Subdivision vertex ring is empty.");let l=0,h=o[2*t[0]];for(let _=1;_<t.length;_++){let b=o[2*t[_]];b<h&&(h=b,l=_)}let d=t.length,f=l,x=(f+1)%d;for(;;){let _=f-1>=0?f-1:d-1,b=(x+1)%d,z=o[2*t[_]],P=o[2*t[b]],k=o[2*t[f]],D=o[2*t[f]+1],N=o[2*t[x]+1],U=!1;if(z<P)U=!0;else if(z>P)U=!1;else{let $=N-D,J=-(o[2*t[x]]-k),L1=D<N?1:-1;((z-k)*$+(o[2*t[_]+1]-D)*J)*L1>((P-k)*$+(o[2*t[b]+1]-D)*J)*L1&&(U=!0)}if(U){let $=t[_],J=t[f],L1=t[x];$!==J&&$!==L1&&J!==L1&&r.push(L1,J,$),f--,f<0&&(f=d-1)}else{let $=t[b],J=t[f],L1=t[x];$!==J&&$!==L1&&J!==L1&&r.push(L1,J,$),x++,x>=d&&(x=0)}if(_===b)break}}function qC(o,t,r,l,h,d,f,x,_){let b=h.length/2,z=f&&x&&_;if(b<M2.MAX_VERTEX_ARRAY_LENGTH){let P=t.prepareSegment(b,r,l),k=P.vertexLength;for(let U=0;U<d.length;U+=3)l.emplaceBack(k+d[U],k+d[U+1],k+d[U+2]);let D,N;P.vertexLength+=b,P.primitiveLength+=d.length/3,z&&(N=f.prepareSegment(b,r,x),D=N.vertexLength,N.vertexLength+=b);for(let U=0;U<h.length;U+=2)o(h[U],h[U+1]);if(z)for(let U=0;U<_.length;U++){let $=_[U];for(let J=1;J<$.length;J+=2)x.emplaceBack(D+$[J-1],D+$[J]);N.primitiveLength+=$.length/2}}else(function(P,k,D,N,U,$){let J=[];for(let _1=0;_1<N.length/2;_1++)J.push(-1);let L1={count:0},Q=0,n1=P.getOrCreateLatestSegment(k,D),f1=n1.vertexLength;for(let _1=2;_1<U.length;_1+=3){let P1=U[_1-2],$1=U[_1-1],j1=U[_1],J1=J[P1]<Q,u2=J[$1]<Q,r2=J[j1]<Q;n1.vertexLength+((J1?1:0)+(u2?1:0)+(r2?1:0))>M2.MAX_VERTEX_ARRAY_LENGTH&&(n1=P.createNewSegment(k,D),Q=L1.count,J1=!0,u2=!0,r2=!0,f1=0);let n2=ii(J,N,$,L1,P1,J1,n1),V1=ii(J,N,$,L1,$1,u2,n1),I2=ii(J,N,$,L1,j1,r2,n1);D.emplaceBack(f1+n2-Q,f1+V1-Q,f1+I2-Q),n1.primitiveLength++}})(t,r,l,h,d,o),z&&(function(P,k,D,N,U,$){let J=[];for(let _1=0;_1<N.length/2;_1++)J.push(-1);let L1={count:0},Q=0,n1=P.getOrCreateLatestSegment(k,D),f1=n1.vertexLength;for(let _1=0;_1<U.length;_1++){let P1=U[_1];for(let $1=1;$1<U[_1].length;$1+=2){let j1=P1[$1-1],J1=P1[$1],u2=J[j1]<Q,r2=J[J1]<Q;n1.vertexLength+((u2?1:0)+(r2?1:0))>M2.MAX_VERTEX_ARRAY_LENGTH&&(n1=P.createNewSegment(k,D),Q=L1.count,u2=!0,r2=!0,f1=0);let n2=ii(J,N,$,L1,j1,u2,n1),V1=ii(J,N,$,L1,J1,r2,n1);D.emplaceBack(f1+n2-Q,f1+V1-Q),n1.primitiveLength++}}})(f,r,x,h,_,o),t.forceNewSegmentOnNextPrepare(),f?.forceNewSegmentOnNextPrepare()}function ii(o,t,r,l,h,d,f){if(d){let x=l.count;return r(t[2*h],t[2*h+1]),o[h]=l.count,l.count++,f.vertexLength++,x}return o[h]}class Ds{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new u1,this.indexArray=new Q1,this.indexArray2=new i2,this.programConfigurations=new F8(t.layers,t.zoom),this.segments=new M2,this.segments2=new M2,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,l){this.hasDependencies=Bn("fill",this.layers,r);let h=this.layers[0].layout.get("fill-sort-key"),d=!h.isConstant(),f=[];for(let{feature:x,id:_,index:b,sourceLayerIndex:z}of t){let P=this.layers[0]._featureFilter.needGeometry,k=C8(x,P);if(!this.layers[0]._featureFilter.filter(new A5(this.zoom),k,l))continue;let D=d?h.evaluate(k,{},l,r.availableImages):void 0,N={id:_,properties:x.properties,type:x.type,sourceLayerIndex:z,index:b,geometry:P?k.geometry:h8(x),patterns:{},sortKey:D};f.push(N)}d&&f.sort(((x,_)=>x.sortKey-_.sortKey));for(let x of f){let{geometry:_,index:b,sourceLayerIndex:z}=x;if(this.hasDependencies){let P=Bs("fill",this.layers,x,{zoom:this.zoom},r);this.patternFeatures.push(P)}else this.addFeature(x,_,b,l,{},r.subdivisionGranularity);r.featureIndex.insert(t[b].feature,_,b,z,this.index)}}update(t,r,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:l})}addFeatures(t,r,l){for(let h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,r,l,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,v_),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,l,h,d,f){for(let x of se(r,500)){let _=jC(x,h,f.fill.getGranularityForZoomLevel(h.z)),b=this.layoutVertexArray;qC(((z,P)=>{b.emplaceBack(z,P)}),this.segments,this.layoutVertexArray,this.indexArray,_.verticesFlattened,_.indicesTriangles,this.segments2,this.indexArray2,_.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,{imagePositions:d,canonical:h})}}let HC,$C;C2("FillBucket",Ds,{omit:["layers","patternFeatures"]});var A_={get paint(){return $C=$C||new s6({"fill-antialias":new v2(t1.paint_fill["fill-antialias"]),"fill-opacity":new P2(t1.paint_fill["fill-opacity"]),"fill-color":new P2(t1.paint_fill["fill-color"]),"fill-outline-color":new P2(t1.paint_fill["fill-outline-color"]),"fill-translate":new v2(t1.paint_fill["fill-translate"]),"fill-translate-anchor":new v2(t1.paint_fill["fill-translate-anchor"]),"fill-pattern":new Me(t1.paint_fill["fill-pattern"])})},get layout(){return HC=HC||new s6({"fill-sort-key":new P2(t1.layout_fill["fill-sort-key"])})}};class B_ extends R6{constructor(t,r){super(t,A_,r)}recalculate(t,r){super.recalculate(t,r);let l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ds(t)}queryRadius(){return Pn(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:r,transform:l,pixelsToTileUnits:h}){return wC(An(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-l.bearingInRadians,h),r)}isTileClipped(){return!0}}let k_=V5([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),R_=V5([{name:"a_centroid",components:2,type:"Int16"}],4),{members:D_}=k_;class l7{constructor(t,r,l,h,d){this.properties={},this.extent=l,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=h,this._values=d,t.readFields(F_,this,r)}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,l=[],h,d=1,f=0,x=0,_=0;for(;t.pos<r;){if(f<=0){let b=t.readVarint();d=7&b,f=b>>3}if(f--,d===1||d===2)x+=t.readSVarint(),_+=t.readSVarint(),d===1&&(h&&l.push(h),h=[]),h&&h.push(new y(x,_));else{if(d!==7)throw new Error(`unknown command ${d}`);h&&h.push(h[0].clone())}}return h&&l.push(h),l}bbox(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,l=1,h=0,d=0,f=0,x=1/0,_=-1/0,b=1/0,z=-1/0;for(;t.pos<r;){if(h<=0){let P=t.readVarint();l=7&P,h=P>>3}if(h--,l===1||l===2)d+=t.readSVarint(),f+=t.readSVarint(),d<x&&(x=d),d>_&&(_=d),f<b&&(b=f),f>z&&(z=f);else if(l!==7)throw new Error(`unknown command ${l}`)}return[x,b,_,z]}toGeoJSON(t,r,l){let h=this.extent*Math.pow(2,l),d=this.extent*t,f=this.extent*r,x=this.loadGeometry();function _(k){return[360*(k.x+d)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(k.y+f)/h)*Math.PI))-90]}function b(k){return k.map(_)}let z;if(this.type===1){let k=[];for(let N of x)k.push(N[0]);let D=b(k);z=k.length===1?{type:"Point",coordinates:D[0]}:{type:"MultiPoint",coordinates:D}}else if(this.type===2){let k=x.map(b);z=k.length===1?{type:"LineString",coordinates:k[0]}:{type:"MultiLineString",coordinates:k}}else{if(this.type!==3)throw new Error("unknown feature type");{let k=(function(N){let U=N.length;if(U<=1)return[N];let $=[],J,L1;for(let Q=0;Q<U;Q++){let n1=O_(N[Q]);n1!==0&&(L1===void 0&&(L1=n1<0),L1===n1<0?(J&&$.push(J),J=[N[Q]]):J&&J.push(N[Q]))}return J&&$.push(J),$})(x),D=[];for(let N of k)D.push(N.map(b));z=D.length===1?{type:"Polygon",coordinates:D[0]}:{type:"MultiPolygon",coordinates:D}}}let P={type:"Feature",geometry:z,properties:this.properties};return this.id!=null&&(P.id=this.id),P}}function F_(o,t,r){o===1?t.id=r.readVarint():o===2?(function(l,h){let d=l.readVarint()+l.pos;for(;l.pos<d;){let f=h._keys[l.readVarint()],x=h._values[l.readVarint()];h.properties[f]=x}})(r,t):o===3?t.type=r.readVarint():o===4&&(t._geometry=r.pos)}function O_(o){let t=0;for(let r,l,h=0,d=o.length,f=d-1;h<d;f=h++)r=o[h],l=o[f],t+=(l.x-r.x)*(r.y+l.y);return t}l7.types=["Unknown","Point","LineString","Polygon"];class WC{constructor(t,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(N_,this,r),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let r=this._pbf.readVarint()+this._pbf.pos;return new l7(this._pbf,r,this.extent,this._keys,this._values)}}function N_(o,t,r){o===15?t.version=r.readVarint():o===1?t.name=r.readString():o===5?t.extent=r.readVarint():o===2?t._features.push(r.pos):o===3?t._keys.push(r.readString()):o===4&&t._values.push((function(l){let h=null,d=l.readVarint()+l.pos;for(;l.pos<d;){let f=l.readVarint()>>3;h=f===1?l.readString():f===2?l.readFloat():f===3?l.readDouble():f===4?l.readVarint64():f===5?l.readVarint():f===6?l.readSVarint():f===7?l.readBoolean():null}if(h==null)throw new Error("unknown feature value");return h})(r))}class YC{constructor(t,r){this.layers=t.readFields(V_,{},r)}}function V_(o,t,r){if(o===3){let l=new WC(r,r.readVarint()+r.pos);l.length&&(t[l.name]=l)}}let Fs=Math.pow(2,13);function ri(o,t,r,l,h,d,f,x){o.emplaceBack(t,r,2*Math.floor(l*Fs)+f,h*Fs*2,d*Fs*2,Math.round(x))}class Os{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new g1,this.centroidVertexArray=new i1,this.indexArray=new Q1,this.programConfigurations=new F8(t.layers,t.zoom),this.segments=new M2,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,l){this.features=[],this.hasDependencies=Bn("fill-extrusion",this.layers,r);for(let{feature:h,id:d,index:f,sourceLayerIndex:x}of t){let _=this.layers[0]._featureFilter.needGeometry,b=C8(h,_);if(!this.layers[0]._featureFilter.filter(new A5(this.zoom),b,l))continue;let z={id:d,sourceLayerIndex:x,index:f,geometry:_?b.geometry:h8(h),properties:h.properties,type:h.type,patterns:{}};this.hasDependencies?this.features.push(Bs("fill-extrusion",this.layers,z,{zoom:this.zoom},r)):this.addFeature(z,z.geometry,f,l,{},r.subdivisionGranularity),r.featureIndex.insert(h,z.geometry,f,x,this.index,!0)}}addFeatures(t,r,l){for(let h of this.features){let{geometry:d}=h;this.addFeature(h,d,h.index,r,l,t.subdivisionGranularity)}}update(t,r,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:l})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,D_),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,R_.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,l,h,d,f){for(let x of se(r,500)){let _={x:0,y:0,sampleCount:0},b=this.layoutVertexArray.length;this.processPolygon(_,h,t,x,f);let z=this.layoutVertexArray.length-b,P=Math.floor(_.x/_.sampleCount),k=Math.floor(_.y/_.sampleCount);for(let D=0;D<z;D++)this.centroidVertexArray.emplaceBack(P,k)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,{imagePositions:d,canonical:h})}processPolygon(t,r,l,h,d){if(h.length<1||XC(h[0]))return;for(let P of h)P.length!==0&&G_(t,P);let f={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},x=d.fill.getGranularityForZoomLevel(r.z),_=l7.types[l.type]==="Polygon";for(let P of h){if(P.length===0||XC(P))continue;let k=Ie(P,x,_);this._generateSideFaces(k,f)}if(!_)return;let b=jC(h,r,x,!1),z=this.layoutVertexArray;qC(((P,k)=>{ri(z,P,k,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,b.verticesFlattened,b.indicesTriangles)}_generateSideFaces(t,r){let l=0;for(let h=1;h<t.length;h++){let d=t[h],f=t[h-1];if(U_(d,f))continue;r.segment.vertexLength+4>M2.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let x=d.sub(f)._perp()._unit(),_=f.dist(d);l+_>32768&&(l=0),ri(this.layoutVertexArray,d.x,d.y,x.x,x.y,0,0,l),ri(this.layoutVertexArray,d.x,d.y,x.x,x.y,0,1,l),l+=_,ri(this.layoutVertexArray,f.x,f.y,x.x,x.y,0,0,l),ri(this.layoutVertexArray,f.x,f.y,x.x,x.y,0,1,l);let b=r.segment.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}}function G_(o,t){for(let r=0;r<t.length;r++){let l=t[r];r===t.length-1&&t[0].x===l.x&&t[0].y===l.y||(o.x+=l.x,o.y+=l.y,o.sampleCount++)}}function U_(o,t){return o.x===t.x&&(o.x<0||o.x>Y1)||o.y===t.y&&(o.y<0||o.y>Y1)}function XC(o){return o.every((t=>t.x<0))||o.every((t=>t.x>Y1))||o.every((t=>t.y<0))||o.every((t=>t.y>Y1))}let KC;C2("FillExtrusionBucket",Os,{omit:["layers","features"]});var j_={get paint(){return KC=KC||new s6({"fill-extrusion-opacity":new v2(t1["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new P2(t1["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new v2(t1["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new v2(t1["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Me(t1["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new P2(t1["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new P2(t1["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new v2(t1["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class q_ extends R6{constructor(t,r){super(t,j_,r)}createBucket(t){return new Os(t)}queryRadius(){return Pn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:l,geometry:h,transform:d,pixelsToTileUnits:f,pixelPosMatrix:x}){let _=An(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-d.bearingInRadians,f),b=this.paint.get("fill-extrusion-height").evaluate(r,l),z=this.paint.get("fill-extrusion-base").evaluate(r,l),P=(function(D,N){let U=[];for(let $ of D){let J=[$.x,$.y,0,1];N1(J,J,N),U.push(new y(J[0]/J[3],J[1]/J[3]))}return U})(_,x),k=(function(D,N,U,$){let J=[],L1=[],Q=$[8]*N,n1=$[9]*N,f1=$[10]*N,_1=$[11]*N,P1=$[8]*U,$1=$[9]*U,j1=$[10]*U,J1=$[11]*U;for(let u2 of D){let r2=[],n2=[];for(let V1 of u2){let I2=V1.x,z2=V1.y,E2=$[0]*I2+$[4]*z2+$[12],x2=$[1]*I2+$[5]*z2+$[13],n5=$[2]*I2+$[6]*z2+$[14],Lt=$[3]*I2+$[7]*z2+$[15],Tt=n5+f1,e6=Lt+_1,Q6=E2+P1,T6=x2+$1,jt=n5+j1,at=Lt+J1,Rt=new y((E2+Q)/e6,(x2+n1)/e6);Rt.z=Tt/e6,r2.push(Rt);let qt=new y(Q6/at,T6/at);qt.z=jt/at,n2.push(qt)}J.push(r2),L1.push(n2)}return[J,L1]})(h,z,b,x);return(function(D,N,U){let $=1/0;wC(U,N)&&($=JC(U,N[0]));for(let J=0;J<N.length;J++){let L1=N[J],Q=D[J];for(let n1=0;n1<L1.length-1;n1++){let f1=L1[n1],_1=[f1,L1[n1+1],Q[n1+1],Q[n1],f1];bC(U,_1)&&($=Math.min($,JC(U,_1)))}}return $!==1/0&&$})(k[0],k[1],P)}}function ni(o,t){return o.x*t.x+o.y*t.y}function JC(o,t){if(o.length===1){let r=0,l=t[r++],h;for(;!h||l.equals(h);)if(h=t[r++],!h)return 1/0;for(;r<t.length;r++){let d=t[r],f=o[0],x=h.sub(l),_=d.sub(l),b=f.sub(l),z=ni(x,x),P=ni(x,_),k=ni(_,_),D=ni(b,x),N=ni(b,_),U=z*k-P*P,$=(k*D-P*N)/U,J=(z*N-P*D)/U,L1=l.z*(1-$-J)+h.z*$+d.z*J;if(isFinite(L1))return L1}return 1/0}{let r=1/0;for(let l of t)r=Math.min(r,l.z);return r}}let H_=V5([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:$_}=H_,W_=V5([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Y_}=W_,X_=Math.cos(Math.PI/180*37.5),QC=Math.pow(2,14)/.5;class Ns{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((r=>{this.gradients[r.id]={}})),this.layoutVertexArray=new c1,this.layoutVertexArray2=new x1,this.indexArray=new Q1,this.programConfigurations=new F8(t.layers,t.zoom),this.segments=new M2,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(t,r,l){this.hasDependencies=Bn("line",this.layers,r)||this.hasLineDasharray(this.layers);let h=this.layers[0].layout.get("line-sort-key"),d=!h.isConstant(),f=[];for(let{feature:x,id:_,index:b,sourceLayerIndex:z}of t){let P=this.layers[0]._featureFilter.needGeometry,k=C8(x,P);if(!this.layers[0]._featureFilter.filter(new A5(this.zoom),k,l))continue;let D=d?h.evaluate(k,{},l):void 0,N={id:_,properties:x.properties,type:x.type,sourceLayerIndex:z,index:b,geometry:P?k.geometry:h8(x),patterns:{},dashes:{},sortKey:D};f.push(N)}d&&f.sort(((x,_)=>x.sortKey-_.sortKey));for(let x of f){let{geometry:_,index:b,sourceLayerIndex:z}=x;this.hasDependencies?(Bn("line",this.layers,r)?Bs("line",this.layers,x,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,x,this.zoom,r),this.patternFeatures.push(x)):this.addFeature(x,_,b,l,{},{},r.subdivisionGranularity),r.featureIndex.insert(t[b].feature,_,b,z,this.index)}}update(t,r,l,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:l,dashPositions:h})}addFeatures(t,r,l,h){for(let d of this.patternFeatures)this.addFeature(d,d.geometry,d.index,r,l,h,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Y_)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$_),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,l,h,d,f,x){let _=this.layers[0].layout,b=_.get("line-join").evaluate(t,{}),z=_.get("line-cap"),P=_.get("line-miter-limit"),k=_.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let D of r)this.addLine(D,t,b,z,P,k,h,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,{imagePositions:d,dashPositions:f,canonical:h})}addLine(t,r,l,h,d,f,x,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=Ie(t,x?_.line.getGranularityForZoomLevel(x.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Q=0;Q<t.length-1;Q++)this.totalDistance+=t[Q].dist(t[Q+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let b=l7.types[r.type]==="Polygon",z=t.length;for(;z>=2&&t[z-1].equals(t[z-2]);)z--;let P=0;for(;P<z-1&&t[P].equals(t[P+1]);)P++;if(z<(b?3:2))return;l==="bevel"&&(d=1.05);let k=this.overscaling<=16?122880/(512*this.overscaling):0,D=this.segments.prepareSegment(10*z,this.layoutVertexArray,this.indexArray),N,U,$,J,L1;this.e1=this.e2=-1,b&&(N=t[z-2],L1=t[P].sub(N)._unit()._perp());for(let Q=P;Q<z;Q++){if($=Q===z-1?b?t[P+1]:void 0:t[Q+1],$&&t[Q].equals($))continue;L1&&(J=L1),N&&(U=N),N=t[Q],L1=$?$.sub(N)._unit()._perp():J,J=J||L1;let n1=J.add(L1);n1.x===0&&n1.y===0||n1._unit();let f1=J.x*L1.x+J.y*L1.y,_1=n1.x*L1.x+n1.y*L1.y,P1=_1!==0?1/_1:1/0,$1=2*Math.sqrt(2-2*_1),j1=_1<X_&&U&&$,J1=J.x*L1.y-J.y*L1.x>0;if(j1&&Q>P){let n2=N.dist(U);if(n2>2*k){let V1=N.sub(N.sub(U)._mult(k/n2)._round());this.updateDistance(U,V1),this.addCurrentVertex(V1,J,0,0,D),U=V1}}let u2=U&&$,r2=u2?l:b?"butt":h;if(u2&&r2==="round"&&(P1<f?r2="miter":P1<=2&&(r2="fakeround")),r2==="miter"&&P1>d&&(r2="bevel"),r2==="bevel"&&(P1>2&&(r2="flipbevel"),P1<d&&(r2="miter")),U&&this.updateDistance(U,N),r2==="miter")n1._mult(P1),this.addCurrentVertex(N,n1,0,0,D);else if(r2==="flipbevel"){if(P1>100)n1=L1.mult(-1);else{let n2=P1*J.add(L1).mag()/J.sub(L1).mag();n1._perp()._mult(n2*(J1?-1:1))}this.addCurrentVertex(N,n1,0,0,D),this.addCurrentVertex(N,n1.mult(-1),0,0,D)}else if(r2==="bevel"||r2==="fakeround"){let n2=-Math.sqrt(P1*P1-1),V1=J1?n2:0,I2=J1?0:n2;if(U&&this.addCurrentVertex(N,J,V1,I2,D),r2==="fakeround"){let z2=Math.round(180*$1/Math.PI/20);for(let E2=1;E2<z2;E2++){let x2=E2/z2;if(x2!==.5){let Lt=x2-.5;x2+=x2*Lt*(x2-1)*((1.0904+f1*(f1*(3.55645-1.43519*f1)-3.2452))*Lt*Lt+(.848013+f1*(.215638*f1-1.06021)))}let n5=L1.sub(J)._mult(x2)._add(J)._unit()._mult(J1?-1:1);this.addHalfVertex(N,n5.x,n5.y,!1,J1,0,D)}}$&&this.addCurrentVertex(N,L1,-V1,-I2,D)}else if(r2==="butt")this.addCurrentVertex(N,n1,0,0,D);else if(r2==="square"){let n2=U?1:-1;this.addCurrentVertex(N,n1,n2,n2,D)}else r2==="round"&&(U&&(this.addCurrentVertex(N,J,0,0,D),this.addCurrentVertex(N,J,1,1,D,!0)),$&&(this.addCurrentVertex(N,L1,-1,-1,D,!0),this.addCurrentVertex(N,L1,0,0,D)));if(j1&&Q<z-1){let n2=N.dist($);if(n2>2*k){let V1=N.add($.sub(N)._mult(k/n2)._round());this.updateDistance(N,V1),this.addCurrentVertex(V1,L1,0,0,D),N=V1}}}}addCurrentVertex(t,r,l,h,d,f=!1){let x=r.y*h-r.x,_=-r.y-r.x*h;this.addHalfVertex(t,r.x+r.y*l,r.y-r.x*l,f,!1,l,d),this.addHalfVertex(t,x,_,f,!0,-h,d),this.distance>QC/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,l,h,d,f))}addHalfVertex({x:t,y:r},l,h,d,f,x,_){let b=.5*(this.lineClips?this.scaledDistance*(QC-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(d?1:0),(r<<1)+(f?1:0),Math.round(63*l)+128,Math.round(63*h)+128,1+(x===0?0:x<0?-1:1)|(63&b)<<2,b>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let z=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,z,this.e2),_.primitiveLength++),f?this.e2=z:this.e1=z}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}hasLineDasharray(t){for(let r of t){let l=r.paint.get("line-dasharray");if(l&&!l.isConstant())return!0}return!1}addLineDashDependencies(t,r,l,h){for(let d of t){let f=d.paint.get("line-dasharray");if(!f||f.value.kind==="constant")continue;let x=d.layout.get("line-cap")==="round",_={dasharray:f.value.evaluate({zoom:l-1},r,{}),round:x},b={dasharray:f.value.evaluate({zoom:l},r,{}),round:x},z={dasharray:f.value.evaluate({zoom:l+1},r,{}),round:x},P=`${_.dasharray.join(",")},${_.round}`,k=`${b.dasharray.join(",")},${b.round}`,D=`${z.dasharray.join(",")},${z.round}`;h.dashDependencies[P]=_,h.dashDependencies[k]=b,h.dashDependencies[D]=z,r.dashes[d.id]={min:P,mid:k,max:D}}}}let td,ed;C2("LineBucket",Ns,{omit:["layers","patternFeatures"]});var id={get paint(){return ed=ed||new s6({"line-opacity":new P2(t1.paint_line["line-opacity"]),"line-color":new P2(t1.paint_line["line-color"]),"line-translate":new v2(t1.paint_line["line-translate"]),"line-translate-anchor":new v2(t1.paint_line["line-translate-anchor"]),"line-width":new P2(t1.paint_line["line-width"]),"line-gap-width":new P2(t1.paint_line["line-gap-width"]),"line-offset":new P2(t1.paint_line["line-offset"]),"line-blur":new P2(t1.paint_line["line-blur"]),"line-dasharray":new Me(t1.paint_line["line-dasharray"]),"line-pattern":new Me(t1.paint_line["line-pattern"]),"line-gradient":new X0(t1.paint_line["line-gradient"])})},get layout(){return td=td||new s6({"line-cap":new v2(t1.layout_line["line-cap"]),"line-join":new P2(t1.layout_line["line-join"]),"line-miter-limit":new v2(t1.layout_line["line-miter-limit"]),"line-round-limit":new v2(t1.layout_line["line-round-limit"]),"line-sort-key":new P2(t1.layout_line["line-sort-key"])})}};class K_ extends P2{possiblyEvaluate(t,r){return r=new A5(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,l,h){return r=N2({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,l,h)}}let Fn;class J_ extends R6{constructor(t,r){super(t,id,r),this.gradientVersion=0,Fn||(Fn=new K_(id.paint.properties["line-width"].specification),Fn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let r=this.gradientExpression();this.stepInterpolant=!!(function(l){return l._styleExpression!==void 0})(r)&&r._styleExpression.expression instanceof p9,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Fn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ns(t)}queryRadius(t){let r=t,l=rd(n7("line-width",this,r),n7("line-gap-width",this,r)),h=n7("line-offset",this,r);return l/2+Math.abs(h)+Pn(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:l,geometry:h,transform:d,pixelsToTileUnits:f}){let x=An(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-d.bearingInRadians,f),_=f/2*rd(this.paint.get("line-width").evaluate(r,l),this.paint.get("line-gap-width").evaluate(r,l)),b=this.paint.get("line-offset").evaluate(r,l);return b&&(h=(function(z,P){let k=[];for(let D=0;D<z.length;D++){let N=z[D],U=[];for(let $=0;$<N.length;$++){let J=N[$-1],L1=N[$],Q=N[$+1],n1=$===0?new y(0,0):L1.sub(J)._unit()._perp(),f1=$===N.length-1?new y(0,0):Q.sub(L1)._unit()._perp(),_1=n1._add(f1)._unit(),P1=_1.x*f1.x+_1.y*f1.y;P1!==0&&_1._mult(1/P1),U.push(_1._mult(P)._add(L1))}k.push(U)}return k})(h,b*f)),(function(z,P,k){for(let D=0;D<P.length;D++){let N=P[D];if(z.length>=3){for(let U=0;U<N.length;U++)if(r7(z,N[U]))return!0}if(o_(z,N,k))return!0}return!1})(x,h,_)}isTileClipped(){return!0}}function rd(o,t){return t>0?t+2*o:o}let Q_=V5([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),tM=V5([{name:"a_projected_pos",components:3,type:"Float32"}],4);V5([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let eM=V5([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);V5([{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 nd=V5([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),iM=V5([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function rM(o,t,r){return o.sections.forEach((l=>{l.text=(function(h,d,f){let x=d.layout.get("text-transform").evaluate(f,{});return x==="uppercase"?h=h.toLocaleUpperCase():x==="lowercase"&&(h=h.toLocaleLowerCase()),T3.applyArabicShaping&&(h=T3.applyArabicShaping(h)),h})(l.text,t,r)})),o}V5([{name:"triangle",components:3,type:"Uint16"}]),V5([{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"}]),V5([{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"}]),V5([{type:"Float32",name:"offsetX"}]),V5([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),V5([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let oi={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var At=24;let Vs=4294967296,od=1/Vs,ad=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Gs{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,r,l=this.length){for(;this.pos<l;){let h=this.readVarint(),d=h>>3,f=this.pos;this.type=7&h,t(d,r,this),this.pos===f&&this.skip(h)}return r}readMessage(t,r){return this.readFields(t,r,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Vs;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Vs;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let r=this.buf,l,h;return h=r[this.pos++],l=127&h,h<128?l:(h=r[this.pos++],l|=(127&h)<<7,h<128?l:(h=r[this.pos++],l|=(127&h)<<14,h<128?l:(h=r[this.pos++],l|=(127&h)<<21,h<128?l:(h=r[this.pos],l|=(15&h)<<28,(function(d,f,x){let _=x.buf,b,z;if(z=_[x.pos++],b=(112&z)>>4,z<128||(z=_[x.pos++],b|=(127&z)<<3,z<128)||(z=_[x.pos++],b|=(127&z)<<10,z<128)||(z=_[x.pos++],b|=(127&z)<<17,z<128)||(z=_[x.pos++],b|=(127&z)<<24,z<128)||(z=_[x.pos++],b|=(1&z)<<31,z<128))return c7(d,b,f);throw new Error("Expected varint not more than 10 bytes")})(l,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,r=this.pos;return this.pos=t,t-r>=12&&ad?ad.decode(this.buf.subarray(r,t)):(function(l,h,d){let f="",x=h;for(;x<d;){let _=l[x],b,z,P,k=null,D=_>239?4:_>223?3:_>191?2:1;if(x+D>d)break;D===1?_<128&&(k=_):D===2?(b=l[x+1],(192&b)==128&&(k=(31&_)<<6|63&b,k<=127&&(k=null))):D===3?(b=l[x+1],z=l[x+2],(192&b)==128&&(192&z)==128&&(k=(15&_)<<12|(63&b)<<6|63&z,(k<=2047||k>=55296&&k<=57343)&&(k=null))):D===4&&(b=l[x+1],z=l[x+2],P=l[x+3],(192&b)==128&&(192&z)==128&&(192&P)==128&&(k=(15&_)<<18|(63&b)<<12|(63&z)<<6|63&P,(k<=65535||k>=1114112)&&(k=null))),k===null?(k=65533,D=1):k>65535&&(k-=65536,f+=String.fromCharCode(k>>>10&1023|55296),k=56320|1023&k),f+=String.fromCharCode(k),x+=D}return f})(this.buf,r,t)}readBytes(){let t=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,t);return this.pos=t,r}readPackedVarint(t=[],r){let l=this.readPackedEnd();for(;this.pos<l;)t.push(this.readVarint(r));return t}readPackedSVarint(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(t){let r=7&t;if(r===0)for(;this.buf[this.pos++]>127;);else if(r===2)this.pos=this.readVarint()+this.pos;else if(r===5)this.pos+=4;else{if(r!==1)throw new Error(`Unimplemented type: ${r}`);this.pos+=8}}writeTag(t,r){this.writeVarint(t<<3|r)}realloc(t){let r=this.length||16;for(;r<this.pos+t;)r*=2;if(r!==this.length){let l=new Uint8Array(r);l.set(this.buf),this.buf=l,this.dataView=new DataView(l.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*od),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*od),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?(function(r,l){let h,d;if(r>=0?(h=r%4294967296|0,d=r/4294967296|0):(h=~(-r%4294967296),d=~(-r/4294967296),4294967295^h?h=h+1|0:(h=0,d=d+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),(function(f,x,_){_.buf[_.pos++]=127&f|128,f>>>=7,_.buf[_.pos++]=127&f|128,f>>>=7,_.buf[_.pos++]=127&f|128,f>>>=7,_.buf[_.pos++]=127&f|128,_.buf[_.pos]=127&(f>>>=7)})(h,0,l),(function(f,x){let _=(7&f)<<4;x.buf[x.pos++]|=_|((f>>>=3)?128:0),f&&(x.buf[x.pos++]=127&f|((f>>>=7)?128:0),f&&(x.buf[x.pos++]=127&f|((f>>>=7)?128:0),f&&(x.buf[x.pos++]=127&f|((f>>>=7)?128:0),f&&(x.buf[x.pos++]=127&f|((f>>>=7)?128:0),f&&(x.buf[x.pos++]=127&f)))))})(d,l)})(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;let r=this.pos;this.pos=(function(h,d,f){for(let x,_,b=0;b<d.length;b++){if(x=d.charCodeAt(b),x>55295&&x<57344){if(!_){x>56319||b+1===d.length?(h[f++]=239,h[f++]=191,h[f++]=189):_=x;continue}if(x<56320){h[f++]=239,h[f++]=191,h[f++]=189,_=x;continue}x=_-55296<<10|x-56320|65536,_=null}else _&&(h[f++]=239,h[f++]=191,h[f++]=189,_=null);x<128?h[f++]=x:(x<2048?h[f++]=x>>6|192:(x<65536?h[f++]=x>>12|224:(h[f++]=x>>18|240,h[f++]=x>>12&63|128),h[f++]=x>>6&63|128),h[f++]=63&x|128)}return f})(this.buf,t,this.pos);let l=this.pos-r;l>=128&&sd(r,l,this),this.pos=r-1,this.writeVarint(l),this.pos+=l}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let r=t.length;this.writeVarint(r),this.realloc(r);for(let l=0;l<r;l++)this.buf[this.pos++]=t[l]}writeRawMessage(t,r){this.pos++;let l=this.pos;t(r,this);let h=this.pos-l;h>=128&&sd(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h}writeMessage(t,r,l){this.writeTag(t,2),this.writeRawMessage(r,l)}writePackedVarint(t,r){r.length&&this.writeMessage(t,nM,r)}writePackedSVarint(t,r){r.length&&this.writeMessage(t,oM,r)}writePackedBoolean(t,r){r.length&&this.writeMessage(t,lM,r)}writePackedFloat(t,r){r.length&&this.writeMessage(t,aM,r)}writePackedDouble(t,r){r.length&&this.writeMessage(t,sM,r)}writePackedFixed32(t,r){r.length&&this.writeMessage(t,cM,r)}writePackedSFixed32(t,r){r.length&&this.writeMessage(t,LM,r)}writePackedFixed64(t,r){r.length&&this.writeMessage(t,uM,r)}writePackedSFixed64(t,r){r.length&&this.writeMessage(t,hM,r)}writeBytesField(t,r){this.writeTag(t,2),this.writeBytes(r)}writeFixed32Field(t,r){this.writeTag(t,5),this.writeFixed32(r)}writeSFixed32Field(t,r){this.writeTag(t,5),this.writeSFixed32(r)}writeFixed64Field(t,r){this.writeTag(t,1),this.writeFixed64(r)}writeSFixed64Field(t,r){this.writeTag(t,1),this.writeSFixed64(r)}writeVarintField(t,r){this.writeTag(t,0),this.writeVarint(r)}writeSVarintField(t,r){this.writeTag(t,0),this.writeSVarint(r)}writeStringField(t,r){this.writeTag(t,2),this.writeString(r)}writeFloatField(t,r){this.writeTag(t,5),this.writeFloat(r)}writeDoubleField(t,r){this.writeTag(t,1),this.writeDouble(r)}writeBooleanField(t,r){this.writeVarintField(t,+r)}}function c7(o,t,r){return r?4294967296*t+(o>>>0):4294967296*(t>>>0)+(o>>>0)}function sd(o,t,r){let l=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(l);for(let h=r.pos-1;h>=o;h--)r.buf[h+l]=r.buf[h]}function nM(o,t){for(let r=0;r<o.length;r++)t.writeVarint(o[r])}function oM(o,t){for(let r=0;r<o.length;r++)t.writeSVarint(o[r])}function aM(o,t){for(let r=0;r<o.length;r++)t.writeFloat(o[r])}function sM(o,t){for(let r=0;r<o.length;r++)t.writeDouble(o[r])}function lM(o,t){for(let r=0;r<o.length;r++)t.writeBoolean(o[r])}function cM(o,t){for(let r=0;r<o.length;r++)t.writeFixed32(o[r])}function LM(o,t){for(let r=0;r<o.length;r++)t.writeSFixed32(o[r])}function uM(o,t){for(let r=0;r<o.length;r++)t.writeFixed64(o[r])}function hM(o,t){for(let r=0;r<o.length;r++)t.writeSFixed64(o[r])}function CM(o,t,r){o===1&&r.readMessage(dM,t)}function dM(o,t,r){if(o===3){let{id:l,bitmap:h,width:d,height:f,left:x,top:_,advance:b}=r.readMessage(pM,{});t.push({id:l,bitmap:new X4({width:d+6,height:f+6},h),metrics:{width:d,height:f,left:x,top:_,advance:b}})}}function pM(o,t,r){o===1?t.id=r.readVarint():o===2?t.bitmap=r.readBytes():o===3?t.width=r.readVarint():o===4?t.height=r.readVarint():o===5?t.left=r.readSVarint():o===6?t.top=r.readSVarint():o===7&&(t.advance=r.readVarint())}function ld(o){let t=0,r=0;for(let f of o)t+=f.w*f.h,r=Math.max(r,f.w);o.sort(((f,x)=>x.h-f.h));let l=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],h=0,d=0;for(let f of o)for(let x=l.length-1;x>=0;x--){let _=l[x];if(!(f.w>_.w||f.h>_.h)){if(f.x=_.x,f.y=_.y,d=Math.max(d,f.y+f.h),h=Math.max(h,f.x+f.w),f.w===_.w&&f.h===_.h){let b=l.pop();b&&x<l.length&&(l[x]=b)}else f.h===_.h?(_.x+=f.w,_.w-=f.w):f.w===_.w?(_.y+=f.h,_.h-=f.h):(l.push({x:_.x+f.w,y:_.y,w:_.w-f.w,h:f.h}),_.y+=f.h,_.h-=f.h);break}}return{w:h,h:d,fill:t/(h*d)||0}}class Us{constructor(t,{pixelRatio:r,version:l,stretchX:h,stretchY:d,content:f,textFitWidth:x,textFitHeight:_}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=h,this.stretchY=d,this.content=f,this.version=l,this.textFitWidth=x,this.textFitHeight=_}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]}}class cd{constructor(t,r){let l={},h={};this.haveRenderCallbacks=[];let d=[];this.addImages(t,l,d),this.addImages(r,h,d);let{w:f,h:x}=ld(d),_=new S6({width:f||1,height:x||1});for(let b in t){let z=t[b],P=l[b].paddedRect;S6.copy(z.data,_,{x:0,y:0},{x:P.x+1,y:P.y+1},z.data)}for(let b in r){let z=r[b],P=h[b].paddedRect,k=P.x+1,D=P.y+1,N=z.data.width,U=z.data.height;S6.copy(z.data,_,{x:0,y:0},{x:k,y:D},z.data),S6.copy(z.data,_,{x:0,y:U-1},{x:k,y:D-1},{width:N,height:1}),S6.copy(z.data,_,{x:0,y:0},{x:k,y:D+U},{width:N,height:1}),S6.copy(z.data,_,{x:N-1,y:0},{x:k-1,y:D},{width:1,height:U}),S6.copy(z.data,_,{x:0,y:0},{x:k+N,y:D},{width:1,height:U})}this.image=_,this.iconPositions=l,this.patternPositions=h}addImages(t,r,l){for(let h in t){let d=t[h],f={x:0,y:0,w:d.data.width+2,h:d.data.height+2};l.push(f),r[h]=new Us(f,d),d.hasRenderCallback&&this.haveRenderCallbacks.push(h)}}patchUpdatedImages(t,r){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let l in t.updatedImages)this.patchUpdatedImage(this.iconPositions[l],t.getImage(l),r),this.patchUpdatedImage(this.patternPositions[l],t.getImage(l),r)}patchUpdatedImage(t,r,l){if(!t||!r||t.version===r.version)return;t.version=r.version;let[h,d]=t.tl;l.update(r.data,void 0,{x:h,y:d})}}var z9;C2("ImagePosition",Us),C2("ImageAtlas",cd),L.at=void 0,(z9=L.at||(L.at={}))[z9.none=0]="none",z9[z9.horizontal=1]="horizontal",z9[z9.vertical=2]="vertical",z9[z9.horizontalOnly=3]="horizontalOnly";class ai{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,r,l){let h=new ai;return h.scale=t||1,h.fontStack=r,h.verticalAlign=l||"bottom",h}static forImage(t,r){let l=new ai;return l.imageName=t,l.verticalAlign=r||"bottom",l}}class L7{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){let l=new L7;for(let h=0;h<t.sections.length;h++){let d=t.sections[h];d.image?l.addImageSection(d):l.addTextSection(d,r)}return l}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=(function(t){let r="";for(let l=0;l<t.length;l++){let h=t.charCodeAt(l+1)||null,d=t.charCodeAt(l-1)||null;r+=h&&F4(h)&&!oi[t[l+1]]||d&&F4(d)&&!oi[t[l-1]]||!oi[t[l]]?t[l]:oi[t[l]]}return r})(this.text)}trim(){let t=0;for(let l=0;l<this.text.length&&Nn[this.text.charCodeAt(l)];l++)t++;let r=this.text.length;for(let l=this.text.length-1;l>=0&&l>=t&&Nn[this.text.charCodeAt(l)];l--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){let l=new L7;return l.text=this.text.substring(t,r),l.sectionIndex=this.sectionIndex.slice(t,r),l.sections=this.sections,l}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,r)=>Math.max(t,this.sections[r].scale)),0)}getMaxImageSize(t){let r=0,l=0;for(let h=0;h<this.length();h++){let d=this.getSection(h);if(d.imageName){let f=t[d.imageName];if(!f)continue;let x=f.displaySize;r=Math.max(r,x[0]),l=Math.max(l,x[1])}}return{maxImageWidth:r,maxImageHeight:l}}addTextSection(t,r){this.text+=t.text,this.sections.push(ai.forText(t.scale,t.fontStack||r,t.verticalAlign));let l=this.sections.length-1;for(let h=0;h<t.text.length;++h)this.sectionIndex.push(l)}addImageSection(t){let r=t.image?t.image.name:"";if(r.length===0)return void U2("Can't add FormattedSection with an empty image.");let l=this.getNextImageSectionCharCode();l?(this.text+=String.fromCharCode(l),this.sections.push(ai.forImage(r,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):U2("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function On(o,t,r,l,h,d,f,x,_,b,z,P,k,D,N){let U=L7.fromFeature(o,h),$;P===L.at.vertical&&U.verticalizePunctuation();let{processBidirectionalText:J,processStyledBidirectionalText:L1}=T3;if(J&&U.sections.length===1){$=[];let f1=J(U.toString(),js(U,b,d,t,l,D));for(let _1 of f1){let P1=new L7;P1.text=_1,P1.sections=U.sections;for(let $1=0;$1<_1.length;$1++)P1.sectionIndex.push(0);$.push(P1)}}else if(L1){$=[];let f1=L1(U.text,U.sectionIndex,js(U,b,d,t,l,D));for(let _1 of f1){let P1=new L7;P1.text=_1[0],P1.sectionIndex=_1[1],P1.sections=U.sections,$.push(P1)}}else $=(function(f1,_1){let P1=[],$1=f1.text,j1=0;for(let J1 of _1)P1.push(f1.substring(j1,J1)),j1=J1;return j1<$1.length&&P1.push(f1.substring(j1,$1.length)),P1})(U,js(U,b,d,t,l,D));let Q=[],n1={positionedLines:Q,text:U.toString(),top:z[1],bottom:z[1],left:z[0],right:z[0],writingMode:P,iconsInText:!1,verticalizable:!1};return(function(f1,_1,P1,$1,j1,J1,u2,r2,n2,V1,I2,z2){let E2=0,x2=0,n5=0,Lt=0,Tt=r2==="right"?1:r2==="left"?0:.5,e6=At/z2,Q6=0;for(let at of j1){at.trim();let Rt=at.getMaxScale(),qt={positionedGlyphs:[],lineOffset:0};f1.positionedLines[Q6]=qt;let Ht=qt.positionedGlyphs,m6=0;if(!at.length()){x2+=J1,++Q6;continue}let t3=xM($1,at,e6);for(let z6=0;z6<at.length();z6++){let zt=at.getSection(z6),Ft=at.getSectionIndex(z6),Ot=at.getCharCode(z6),_t=yM(n2,I2,Ot),W5;if(zt.imageName){if(f1.iconsInText=!0,zt.scale=zt.scale*e6,W5=_M(zt,_t,Rt,t3,$1),!W5)continue;m6=Math.max(m6,W5.imageOffset)}else if(W5=vM(zt,Ot,_t,t3,_1,P1),!W5)continue;let{rect:k3,metrics:x7,baselineOffset:R3}=W5;Ht.push({glyph:Ot,imageName:zt.imageName,x:E2,y:x2+R3+-17,vertical:_t,scale:zt.scale,fontStack:zt.fontStack,sectionIndex:Ft,metrics:x7,rect:k3}),_t?(f1.verticalizable=!0,E2+=(zt.imageName?x7.advance:At)*zt.scale+V1):E2+=x7.advance*zt.scale+V1}Ht.length!==0&&(n5=Math.max(E2-V1,n5),MM(Ht,0,Ht.length-1,Tt)),E2=0,qt.lineOffset=Math.max(m6,(Rt-1)*At);let Dt=J1*Rt+m6;x2+=Dt,Lt=Math.max(Dt,Lt),++Q6}let{horizontalAlign:T6,verticalAlign:jt}=qs(u2);(function(at,Rt,qt,Ht,m6,t3,Dt,z6,zt){let Ft=(Rt-qt)*m6,Ot=0;Ot=t3!==Dt?-z6*Ht- -17:-Ht*zt*Dt+.5*Dt;for(let _t of at)for(let W5 of _t.positionedGlyphs)W5.x+=Ft,W5.y+=Ot})(f1.positionedLines,Tt,T6,jt,n5,Lt,J1,x2,j1.length),f1.top+=-jt*x2,f1.bottom=f1.top+x2,f1.left+=-T6*n5,f1.right=f1.left+n5})(n1,t,r,l,$,f,x,_,P,b,k,N),!(function(f1){for(let _1 of f1)if(_1.positionedGlyphs.length!==0)return!1;return!0})(Q)&&n1}let Nn={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fM={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},gM={40:!0};function Ld(o,t,r,l,h,d){if(t.imageName){let f=l[t.imageName];return f?f.displaySize[0]*t.scale*At/d+h:0}{let f=r[t.fontStack],x=f&&f[o];return x?x.metrics.advance*t.scale+h:0}}function ud(o,t,r,l){let h=Math.pow(o-t,2);return l?o<t?h/2:2*h:h+Math.abs(r)*r}function mM(o,t,r){let l=0;return o===10&&(l-=1e4),r&&(l+=150),o!==40&&o!==65288||(l+=50),t!==41&&t!==65289||(l+=50),l}function hd(o,t,r,l,h,d){let f=null,x=ud(t,r,h,d);for(let _ of l){let b=ud(t-_.x,r,h,d)+_.badness;b<=x&&(f=_,x=b)}return{index:o,x:t,priorBreak:f,badness:x}}function Cd(o){return o?Cd(o.priorBreak).concat(o.index):[]}function js(o,t,r,l,h,d){if(!o)return[];let f=[],x=(function(z,P,k,D,N,U){let $=0;for(let J=0;J<z.length();J++){let L1=z.getSection(J);$+=Ld(z.getCharCode(J),L1,D,N,P,U)}return $/Math.max(1,Math.ceil($/k))})(o,t,r,l,h,d),_=o.text.indexOf("\u200B")>=0,b=0;for(let z=0;z<o.length();z++){let P=o.getSection(z),k=o.getCharCode(z);if(Nn[k]||(b+=Ld(k,P,l,h,t,d)),z<o.length()-1){let D=vs(k);(fM[k]||D||P.imageName||z!==o.length()-2&&gM[o.getCharCode(z+1)])&&f.push(hd(z+1,b,x,f,mM(k,o.getCharCode(z+1),D&&_),!1))}}return Cd(hd(o.length(),b,x,f,0,!0))}function qs(o){let t=.5,r=.5;switch(o){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(o){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 xM(o,t,r){let l=t.getMaxScale()*At,{maxImageWidth:h,maxImageHeight:d}=t.getMaxImageSize(o),f=Math.max(l,d*r);return{verticalLineContentWidth:Math.max(l,h*r),horizontalLineContentHeight:f}}function dd(o){switch(o){case"top":return 0;case"center":return .5;default:return 1}}function yM(o,t,r){return!(o===L.at.horizontal||!t&&!S9(r)||t&&(Nn[r]||(l=r,/\p{sc=Arab}/u.test(String.fromCodePoint(l)))));var l}function vM(o,t,r,l,h,d){let f=d[o.fontStack],x=(function(b,z,P,k){if(b&&b.rect)return b;let D=z[P.fontStack],N=D&&D[k];return N?{rect:null,metrics:N.metrics}:null})(f&&f[t],h,o,t);if(x===null)return null;let _;if(r)_=l.verticalLineContentWidth-o.scale*At;else{let b=dd(o.verticalAlign);_=(l.horizontalLineContentHeight-o.scale*At)*b}return{rect:x.rect,metrics:x.metrics,baselineOffset:_}}function _M(o,t,r,l,h){let d=h[o.imageName];if(!d)return null;let f=d.paddedRect,x=d.displaySize,_={width:x[0],height:x[1],left:1,top:-3,advance:t?x[1]:x[0]},b;if(t)b=l.verticalLineContentWidth-x[1]*o.scale;else{let z=dd(o.verticalAlign);b=(l.horizontalLineContentHeight-x[1]*o.scale)*z}return{rect:f,metrics:_,baselineOffset:b,imageOffset:(t?x[0]:x[1])*o.scale-At*r}}function MM(o,t,r,l){if(l===0)return;let h=o[r],d=(o[r].x+h.metrics.advance*h.scale)*l;for(let f=t;f<=r;f++)o[f].x-=d}function bM(o,t,r){let{horizontalAlign:l,verticalAlign:h}=qs(r),d=t[0]-o.displaySize[0]*l,f=t[1]-o.displaySize[1]*h;return{image:o,top:f,bottom:f+o.displaySize[1],left:d,right:d+o.displaySize[0]}}function pd(o){var t,r;let l=o.left,h=o.top,d=o.right-l,f=o.bottom-h,x=(t=o.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",_=(r=o.image.textFitHeight)!==null&&r!==void 0?r:"stretchOrShrink",b=(o.image.content[2]-o.image.content[0])/(o.image.content[3]-o.image.content[1]);if(_==="proportional"){if(x==="stretchOnly"&&d/f<b||x==="proportional"){let z=Math.ceil(f*b);l*=z/d,d=z}}else if(x==="proportional"&&_==="stretchOnly"&&b!==0&&d/f>b){let z=Math.ceil(d/b);h*=z/f,f=z}return{x1:l,y1:h,x2:l+d,y2:h+f}}function fd(o,t,r,l,h,d){let f=o.image,x;if(f.content){let $=f.content,J=f.pixelRatio||1;x=[$[0]/J,$[1]/J,f.displaySize[0]-$[2]/J,f.displaySize[1]-$[3]/J]}let _=t.left*d,b=t.right*d,z,P,k,D;r==="width"||r==="both"?(D=h[0]+_-l[3],P=h[0]+b+l[1]):(D=h[0]+(_+b-f.displaySize[0])/2,P=D+f.displaySize[0]);let N=t.top*d,U=t.bottom*d;return r==="height"||r==="both"?(z=h[1]+N-l[0],k=h[1]+U+l[2]):(z=h[1]+(N+U-f.displaySize[1])/2,k=z+f.displaySize[1]),{image:f,top:z,right:P,bottom:k,left:D,collisionPadding:x}}let O8=128,Z9=32640;function gd(o,t){let{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new A5(o+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:l,interpolationType:h}=r,d=0;for(;d<l.length&&l[d]<=o;)d++;d=Math.max(0,d-1);let f=d;for(;f<l.length&&l[f]<o+1;)f++;f=Math.min(l.length-1,f);let x=l[d],_=l[f];return r.kind==="composite"?{kind:"composite",minZoom:x,maxZoom:_,interpolationType:h}:{kind:"camera",minZoom:x,maxZoom:_,minSize:r.evaluate(new A5(x)),maxSize:r.evaluate(new A5(_)),interpolationType:h}}}function Hs(o,t,r){let l="never",h=o.get(t);return h?l=h:o.get(r)&&(l="always"),l}let wM=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Vn(o,t,r,l,h,d,f,x,_,b,z,P,k){let D=x?Math.min(Z9,Math.round(x[0])):0,N=x?Math.min(Z9,Math.round(x[1])):0;o.emplaceBack(t,r,Math.round(32*l),Math.round(32*h),d,f,(D<<1)+(_?1:0),N,16*b,16*z,256*P,256*k)}function $s(o,t,r){o.emplaceBack(t.x,t.y,r),o.emplaceBack(t.x,t.y,r),o.emplaceBack(t.x,t.y,r),o.emplaceBack(t.x,t.y,r)}function SM(o){for(let t of o.sections)if(_s(t.text))return!0;return!1}class Ws{constructor(t){this.layoutVertexArray=new b1,this.indexArray=new Q1,this.programConfigurations=t,this.segments=new M2,this.dynamicLayoutVertexArray=new A1,this.opacityVertexArray=new Z1,this.hasVisibleVertices=!1,this.placedSymbolArray=new w}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,r,l,h){this.isEmpty()||(l&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Q_.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,tM.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,wM,!0),this.opacityVertexBuffer.itemSize=1),(l||h)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}C2("SymbolBuffers",Ws);class Ys{constructor(t,r,l){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new l,this.segments=new M2,this.collisionVertexArray=new B1}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,eM.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}C2("CollisionBuffers",Ys);class u7{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((f=>f.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=gd(this.zoom,r["text-size"]),this.iconSizeData=gd(this.zoom,r["icon-size"]);let l=this.layers[0].layout,h=l.get("symbol-sort-key"),d=l.get("symbol-z-order");this.canOverlap=Hs(l,"text-overlap","text-allow-overlap")!=="never"||Hs(l,"icon-overlap","icon-allow-overlap")!=="never"||l.get("text-ignore-placement")||l.get("icon-ignore-placement"),this.sortFeaturesByKey=d!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(d==="viewport-y"||d==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,l.get("symbol-placement")==="point"&&(this.writingModes=l.get("text-writing-mode").map((f=>L.at[f]))),this.stateDependentLayerIds=this.layers.filter((f=>f.isStateDependent())).map((f=>f.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Ws(new F8(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Ws(new F8(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new B,this.lineVertexArray=new V,this.symbolInstances=new A,this.textAnchorOffsets=new q}calculateGlyphDependencies(t,r,l,h,d){for(let f=0;f<t.length;f++)if(r[t.charCodeAt(f)]=!0,(l||h)&&d){let x=oi[t.charAt(f)];x&&(r[x.charCodeAt(0)]=!0)}}populate(t,r,l){let h=this.layers[0],d=h.layout,f=d.get("text-font"),x=d.get("text-field"),_=d.get("icon-image"),b=(x.value.kind!=="constant"||x.value.value instanceof mt&&!x.value.value.isEmpty()||x.value.value.toString().length>0)&&(f.value.kind!=="constant"||f.value.value.length>0),z=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,P=d.get("symbol-sort-key");if(this.features=[],!b&&!z)return;let k=r.iconDependencies,D=r.glyphDependencies,N=r.availableImages,U=new A5(this.zoom);for(let{feature:$,id:J,index:L1,sourceLayerIndex:Q}of t){let n1=h._featureFilter.needGeometry,f1=C8($,n1);if(!h._featureFilter.filter(U,f1,l))continue;let _1,P1;if(n1||(f1.geometry=h8($)),b){let j1=h.getValueAndResolveTokens("text-field",f1,l,N),J1=mt.factory(j1),u2=this.hasRTLText=this.hasRTLText||SM(J1);(!u2||T3.getRTLTextPluginStatus()==="unavailable"||u2&&T3.isParsed())&&(_1=rM(J1,h,f1))}if(z){let j1=h.getValueAndResolveTokens("icon-image",f1,l,N);P1=j1 instanceof d6?j1:d6.fromString(j1)}if(!_1&&!P1)continue;let $1=this.sortFeaturesByKey?P.evaluate(f1,{},l):void 0;if(this.features.push({id:J,text:_1,icon:P1,index:L1,sourceLayerIndex:Q,geometry:f1.geometry,properties:$.properties,type:l7.types[$.type],sortKey:$1}),P1&&(k[P1.name]=!0),_1){let j1=f.evaluate(f1,{},l).join(","),J1=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(L.at.vertical)>=0;for(let u2 of _1.sections)if(u2.image)k[u2.image.name]=!0;else{let r2=R4(_1.toString()),n2=u2.fontStack||j1,V1=D[n2]=D[n2]||{};this.calculateGlyphDependencies(u2.text,V1,J1,this.allowVerticalPlacement,r2)}}}d.get("symbol-placement")==="line"&&(this.features=(function($){let J={},L1={},Q=[],n1=0;function f1(j1){Q.push($[j1]),n1++}function _1(j1,J1,u2){let r2=L1[j1];return delete L1[j1],L1[J1]=r2,Q[r2].geometry[0].pop(),Q[r2].geometry[0]=Q[r2].geometry[0].concat(u2[0]),r2}function P1(j1,J1,u2){let r2=J[J1];return delete J[J1],J[j1]=r2,Q[r2].geometry[0].shift(),Q[r2].geometry[0]=u2[0].concat(Q[r2].geometry[0]),r2}function $1(j1,J1,u2){let r2=u2?J1[0][J1[0].length-1]:J1[0][0];return`${j1}:${r2.x}:${r2.y}`}for(let j1=0;j1<$.length;j1++){let J1=$[j1],u2=J1.geometry,r2=J1.text?J1.text.toString():null;if(!r2){f1(j1);continue}let n2=$1(r2,u2),V1=$1(r2,u2,!0);if(n2 in L1&&V1 in J&&L1[n2]!==J[V1]){let I2=P1(n2,V1,u2),z2=_1(n2,V1,Q[I2].geometry);delete J[n2],delete L1[V1],L1[$1(r2,Q[z2].geometry,!0)]=z2,Q[I2].geometry=null}else n2 in L1?_1(n2,V1,u2):V1 in J?P1(n2,V1,u2):(f1(j1),J[n2]=n1-1,L1[V1]=n1-1)}return Q.filter((j1=>j1.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort((($,J)=>$.sortKey-J.sortKey))}update(t,r,l){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:l}),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:l}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){let l=this.lineVertexArray.length;if(t.segment!==void 0){let h=t.dist(r[t.segment+1]),d=t.dist(r[t.segment]),f={};for(let x=t.segment+1;x<r.length;x++)f[x]={x:r[x].x,y:r[x].y,tileUnitDistanceFromAnchor:h},x<r.length-1&&(h+=r[x+1].dist(r[x]));for(let x=t.segment||0;x>=0;x--)f[x]={x:r[x].x,y:r[x].y,tileUnitDistanceFromAnchor:d},x>0&&(d+=r[x-1].dist(r[x]));for(let x=0;x<r.length;x++){let _=f[x];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:l,lineLength:this.lineVertexArray.length-l}}addSymbols(t,r,l,h,d,f,x,_,b,z,P,k){let D=t.indexArray,N=t.layoutVertexArray,U=t.segments.prepareSegment(4*r.length,N,D,this.canOverlap?f.sortKey:void 0),$=this.glyphOffsetArray.length,J=U.vertexLength,L1=this.allowVerticalPlacement&&x===L.at.vertical?Math.PI/2:0,Q=f.text&&f.text.sections;for(let n1=0;n1<r.length;n1++){let{tl:f1,tr:_1,bl:P1,br:$1,tex:j1,pixelOffsetTL:J1,pixelOffsetBR:u2,minFontScaleX:r2,minFontScaleY:n2,glyphOffset:V1,isSDF:I2,sectionIndex:z2}=r[n1],E2=U.vertexLength,x2=V1[1];Vn(N,_.x,_.y,f1.x,x2+f1.y,j1.x,j1.y,l,I2,J1.x,J1.y,r2,n2),Vn(N,_.x,_.y,_1.x,x2+_1.y,j1.x+j1.w,j1.y,l,I2,u2.x,J1.y,r2,n2),Vn(N,_.x,_.y,P1.x,x2+P1.y,j1.x,j1.y+j1.h,l,I2,J1.x,u2.y,r2,n2),Vn(N,_.x,_.y,$1.x,x2+$1.y,j1.x+j1.w,j1.y+j1.h,l,I2,u2.x,u2.y,r2,n2),$s(t.dynamicLayoutVertexArray,_,L1),D.emplaceBack(E2,E2+2,E2+1),D.emplaceBack(E2+1,E2+2,E2+3),U.vertexLength+=4,U.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(V1[0]),n1!==r.length-1&&z2===r[n1+1].sectionIndex||t.programConfigurations.populatePaintArrays(N.length,f,f.index,{imagePositions:{},canonical:k,formattedSection:Q&&Q[z2]})}t.placedSymbolArray.emplaceBack(_.x,_.y,$,this.glyphOffsetArray.length-$,J,b,z,_.segment,l?l[0]:0,l?l[1]:0,h[0],h[1],x,0,!1,0,P)}_addCollisionDebugVertex(t,r,l,h,d,f){return r.emplaceBack(0,0),t.emplaceBack(l.x,l.y,h,d,Math.round(f.x),Math.round(f.y))}addCollisionDebugVertices(t,r,l,h,d,f,x){let _=d.segments.prepareSegment(4,d.layoutVertexArray,d.indexArray),b=_.vertexLength,z=d.layoutVertexArray,P=d.collisionVertexArray,k=x.anchorX,D=x.anchorY;this._addCollisionDebugVertex(z,P,f,k,D,new y(t,r)),this._addCollisionDebugVertex(z,P,f,k,D,new y(l,r)),this._addCollisionDebugVertex(z,P,f,k,D,new y(l,h)),this._addCollisionDebugVertex(z,P,f,k,D,new y(t,h)),_.vertexLength+=4;let N=d.indexArray;N.emplaceBack(b,b+1),N.emplaceBack(b+1,b+2),N.emplaceBack(b+2,b+3),N.emplaceBack(b+3,b),_.primitiveLength+=4}addDebugCollisionBoxes(t,r,l,h){for(let d=t;d<r;d++){let f=this.collisionBoxArray.get(d);this.addCollisionDebugVertices(f.x1,f.y1,f.x2,f.y2,h?this.textCollisionBox:this.iconCollisionBox,f.anchorPoint,l)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ys(E1,nd.members,i2),this.iconCollisionBox=new Ys(E1,nd.members,i2);for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(t,r,l,h,d,f,x,_,b){let z={};for(let P=r;P<l;P++){let k=t.get(P);z.textBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},z.textFeatureIndex=k.featureIndex;break}for(let P=h;P<d;P++){let k=t.get(P);z.verticalTextBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},z.verticalTextFeatureIndex=k.featureIndex;break}for(let P=f;P<x;P++){let k=t.get(P);z.iconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},z.iconFeatureIndex=k.featureIndex;break}for(let P=_;P<b;P++){let k=t.get(P);z.verticalIconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},z.verticalIconFeatureIndex=k.featureIndex;break}return z}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let l=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,l.textBoxStartIndex,l.textBoxEndIndex,l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l.iconBoxStartIndex,l.iconBoxEndIndex,l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){let l=t.placedSymbolArray.get(r),h=l.vertexStartIndex+4*l.numGlyphs;for(let d=l.vertexStartIndex;d<h;d+=4)t.indexArray.emplaceBack(d,d+2,d+1),t.indexArray.emplaceBack(d+1,d+2,d+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(t),l=Math.cos(t),h=[],d=[],f=[];for(let x=0;x<this.symbolInstances.length;++x){f.push(x);let _=this.symbolInstances.get(x);h.push(0|Math.round(r*_.anchorX+l*_.anchorY)),d.push(_.featureIndex)}return f.sort(((x,_)=>h[x]-h[_]||d[_]-d[x])),f}addToSortKeyRanges(t,r){let l=this.sortKeyRanges[this.sortKeyRanges.length-1];l&&l.sortKey===r?l.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let l=this.symbolInstances.get(r);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach(((h,d,f)=>{h>=0&&f.indexOf(h)===d&&this.addIndicesForPlacedSymbol(this.text,h)})),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let md,xd;C2("SymbolBucket",u7,{omit:["layers","collisionBoxArray","features","compareText"]}),u7.MAX_GLYPHS=65535,u7.addDynamicAttributes=$s;var Xs={get paint(){return xd=xd||new s6({"icon-opacity":new P2(t1.paint_symbol["icon-opacity"]),"icon-color":new P2(t1.paint_symbol["icon-color"]),"icon-halo-color":new P2(t1.paint_symbol["icon-halo-color"]),"icon-halo-width":new P2(t1.paint_symbol["icon-halo-width"]),"icon-halo-blur":new P2(t1.paint_symbol["icon-halo-blur"]),"icon-translate":new v2(t1.paint_symbol["icon-translate"]),"icon-translate-anchor":new v2(t1.paint_symbol["icon-translate-anchor"]),"text-opacity":new P2(t1.paint_symbol["text-opacity"]),"text-color":new P2(t1.paint_symbol["text-color"],{runtimeType:Wt,getOverride:o=>o.textColor,hasOverride:o=>!!o.textColor}),"text-halo-color":new P2(t1.paint_symbol["text-halo-color"]),"text-halo-width":new P2(t1.paint_symbol["text-halo-width"]),"text-halo-blur":new P2(t1.paint_symbol["text-halo-blur"]),"text-translate":new v2(t1.paint_symbol["text-translate"]),"text-translate-anchor":new v2(t1.paint_symbol["text-translate-anchor"])})},get layout(){return md=md||new s6({"symbol-placement":new v2(t1.layout_symbol["symbol-placement"]),"symbol-spacing":new v2(t1.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new v2(t1.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new P2(t1.layout_symbol["symbol-sort-key"]),"symbol-z-order":new v2(t1.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new v2(t1.layout_symbol["icon-allow-overlap"]),"icon-overlap":new v2(t1.layout_symbol["icon-overlap"]),"icon-ignore-placement":new v2(t1.layout_symbol["icon-ignore-placement"]),"icon-optional":new v2(t1.layout_symbol["icon-optional"]),"icon-rotation-alignment":new v2(t1.layout_symbol["icon-rotation-alignment"]),"icon-size":new P2(t1.layout_symbol["icon-size"]),"icon-text-fit":new v2(t1.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new v2(t1.layout_symbol["icon-text-fit-padding"]),"icon-image":new P2(t1.layout_symbol["icon-image"]),"icon-rotate":new P2(t1.layout_symbol["icon-rotate"]),"icon-padding":new P2(t1.layout_symbol["icon-padding"]),"icon-keep-upright":new v2(t1.layout_symbol["icon-keep-upright"]),"icon-offset":new P2(t1.layout_symbol["icon-offset"]),"icon-anchor":new P2(t1.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new v2(t1.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new v2(t1.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new v2(t1.layout_symbol["text-rotation-alignment"]),"text-field":new P2(t1.layout_symbol["text-field"]),"text-font":new P2(t1.layout_symbol["text-font"]),"text-size":new P2(t1.layout_symbol["text-size"]),"text-max-width":new P2(t1.layout_symbol["text-max-width"]),"text-line-height":new v2(t1.layout_symbol["text-line-height"]),"text-letter-spacing":new P2(t1.layout_symbol["text-letter-spacing"]),"text-justify":new P2(t1.layout_symbol["text-justify"]),"text-radial-offset":new P2(t1.layout_symbol["text-radial-offset"]),"text-variable-anchor":new v2(t1.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new P2(t1.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new P2(t1.layout_symbol["text-anchor"]),"text-max-angle":new v2(t1.layout_symbol["text-max-angle"]),"text-writing-mode":new v2(t1.layout_symbol["text-writing-mode"]),"text-rotate":new P2(t1.layout_symbol["text-rotate"]),"text-padding":new v2(t1.layout_symbol["text-padding"]),"text-keep-upright":new v2(t1.layout_symbol["text-keep-upright"]),"text-transform":new P2(t1.layout_symbol["text-transform"]),"text-offset":new P2(t1.layout_symbol["text-offset"]),"text-allow-overlap":new v2(t1.layout_symbol["text-allow-overlap"]),"text-overlap":new v2(t1.layout_symbol["text-overlap"]),"text-ignore-placement":new v2(t1.layout_symbol["text-ignore-placement"]),"text-optional":new v2(t1.layout_symbol["text-optional"])})}};class yd{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:f5,this.defaultValue=t}evaluate(t){if(t.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}C2("FormatSectionOverride",yd,{omit:["defaultValue"]});class Gn extends R6{constructor(t,r){super(t,Xs,r)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let l=this.layout.get("text-writing-mode");if(l){let h=[];for(let d of l)h.indexOf(d)<0&&h.push(d);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,l,h){let d=this.layout.get(t).evaluate(r,{},l,h),f=this._unevaluatedLayout._values[t];return f.isDataDriven()||k0(f.value)||!d?d:(function(x,_){return _.replace(/{([^{}]+)}/g,((b,z)=>x&&z in x?String(x[z]):""))})(r.properties,d)}createBucket(t){return new u7(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Xs.paint.overridableProperties){if(!Gn.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),l=new yd(r),h=new B0(l,r.property.specification),d=null;d=r.value.kind==="constant"||r.value.kind==="source"?new P8("source",h):new D0("composite",h,r.value.zoomStops),this.paint._values[t]=new Y6(r.property,d,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,l){return!(!this.layout||r.isDataDriven()||l.isDataDriven())&&Gn.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){let l=t.get("text-field"),h=Xs.paint.properties[r],d=!1,f=x=>{for(let _ of x)if(h.overrides&&h.overrides.hasOverride(_))return void(d=!0)};if(l.value.kind==="constant"&&l.value.value instanceof mt)f(l.value.value.sections);else if(l.value.kind==="source"||l.value.kind==="composite"){let x=b=>{d||(b instanceof a8&&j5(b.value)===a9?f(b.value.sections):b instanceof T8?f(b.sections):b.eachChild(x))},_=l.value;_._styleExpression&&x(_._styleExpression.expression)}return d}}let vd;var TM={get paint(){return vd=vd||new s6({"background-color":new v2(t1.paint_background["background-color"]),"background-pattern":new Y0(t1.paint_background["background-pattern"]),"background-opacity":new v2(t1.paint_background["background-opacity"])})}};class zM extends R6{constructor(t,r){super(t,TM,r)}}class ZM extends R6{constructor(t,r){super(t,{},r),this.onAdd=l=>{this.implementation.onAdd&&this.implementation.onAdd(l,l.painter.context.gl)},this.onRemove=l=>{this.implementation.onRemove&&this.implementation.onRemove(l,l.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class EM{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let IM={once:!0},Ks=63710088e-1;class E9{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new E9(i5(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let r=Math.PI/180,l=this.lat*r,h=t.lat*r,d=Math.sin(l)*Math.sin(h)+Math.cos(l)*Math.cos(h)*Math.cos((t.lng-this.lng)*r);return Ks*Math.acos(Math.min(d,1))}static convert(t){if(t instanceof E9)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new E9(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new E9(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let _d=2*Math.PI*Ks;function Md(o){return _d*Math.cos(o*Math.PI/180)}function bd(o){return(180+o)/360}function wd(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function Sd(o,t){return o/Md(t)}function Td(o){return 360*o-180}function Un(o){return 360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90}function zd(o,t){return o*Md(Un(t))}class si{constructor(t,r,l=0){this.x=+t,this.y=+r,this.z=+l}static fromLngLat(t,r=0){let l=E9.convert(t);return new si(bd(l.lng),wd(l.lat),Sd(r,l.lat))}toLngLat(){return new E9(Td(this.x),Un(this.y))}toAltitude(){return zd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/_d*(t=Un(this.y),1/Math.cos(t*Math.PI/180));var t}}function Zd(o,t,r){var l=2*Math.PI*6378137/256/Math.pow(2,r);return[o*l-2*Math.PI*6378137/2,t*l-2*Math.PI*6378137/2]}class Js{constructor(t,r,l){if(!(function(h,d,f){return!(h<0||h>25||f<0||f>=Math.pow(2,h)||d<0||d>=Math.pow(2,h))})(t,r,l))throw new Error(`x=${r}, y=${l}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=l,this.key=h7(0,t,t,r,l)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,l){let h=(f=this.y,x=this.z,_=Zd(256*(d=this.x),256*(f=Math.pow(2,x)-f-1),x),b=Zd(256*(d+1),256*(f+1),x),_[0]+","+_[1]+","+b[0]+","+b[1]);var d,f,x,_,b;let z=(function(P,k,D){let N,U="";for(let $=P;$>0;$--)N=1<<$-1,U+=(k&N?1:0)+(D&N?2:0);return U})(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,z).replace(/{bbox-epsg-3857}/g,h)}isChildOf(t){let r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){let r=Math.pow(2,this.z);return new y((t.x*r-this.x)*Y1,(t.y*r-this.y)*Y1)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ed{constructor(t,r){this.wrap=t,this.canonical=r,this.key=h7(t,r.z,r.z,r.x,r.y)}}class K6{constructor(t,r,l,h,d){if(this.terrainRttPosMatrix32f=null,t<l)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${l}`);this.overscaledZ=t,this.wrap=r,this.canonical=new Js(l,+h,+d),this.key=h7(r,t,l,h,d)}clone(){return new K6(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new K6(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new K6(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let l=this.canonical.z-t;return t>this.canonical.z?h7(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):h7(this.wrap*+r,t,t,this.canonical.x>>l,this.canonical.y>>l)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-t.canonical.z;return!(r<0)&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new K6(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,l=2*this.canonical.x,h=2*this.canonical.y;return[new K6(r,this.wrap,r,l,h),new K6(r,this.wrap,r,l+1,h),new K6(r,this.wrap,r,l,h+1),new K6(r,this.wrap,r,l+1,h+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new K6(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new K6(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ed(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new si(t.x-this.wrap,t.y))}}function h7(o,t,r,l,h){(o*=2)<0&&(o=-1*o-1);let d=1<<r;return(d*d*o+d*h+l).toString(36)+r.toString(36)+t.toString(36)}function li(o,t){return t?o.properties[t]:o.id}C2("CanonicalTileID",Js),C2("OverscaledTileID",K6,{omit:["terrainRttPosMatrix32f"]});class Pe{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(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(t){return this.expandBy(-t)}map(t){let r=new Pe;return r.extend(t(new y(this.minX,this.minY))),r.extend(t(new y(this.maxX,this.minY))),r.extend(t(new y(this.minX,this.maxY))),r.extend(t(new y(this.maxX,this.maxY))),r}static fromPoints(t){let r=new Pe;for(let l of t)r.extend(l);return r}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class Id{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r<t.length;r++){let l=t[r];this._stringToNumber[l]=r,this._numberToString[r]=l}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Pd{constructor(t,r,l,h,d){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=l,t._y=h,this.properties=t.properties,this.id=d}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class C7{_name;dataBuffer;nullabilityBuffer;_size;constructor(t,r,l){this._name=t,this.dataBuffer=r,typeof l=="number"?this._size=l:(this.nullabilityBuffer=l,this._size=l.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer&&this.nullabilityBuffer.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class jn extends C7{}class Qs extends jn{getValueFromBuffer(t){return this.dataBuffer[t]}}class tl extends jn{getValueFromBuffer(t){return this.dataBuffer[t]}}class Ad extends C7{delta;constructor(t,r,l,h){super(t,r,h),this.delta=l}}class el extends Ad{constructor(t,r,l,h){super(t,Int32Array.of(r),l,h)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}}class il extends C7{constructor(t,r,l){super(t,Int32Array.of(r),l)}getValueFromBuffer(t){return this.dataBuffer[0]}}class PM{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(t,r,l,h,d=4096){this._name=t,this._geometryVector=r,this._idVector=l,this._propertyVectors=h,this._extent=d}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((r=>[r.name,r])))),this.propertyVectorsMap.get(t)}*[Symbol.iterator](){let t=this.geometryVector[Symbol.iterator](),r=0;for(;r<this.numFeatures;){let l;this.idVector&&(l=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(r)):this.idVector.getValue(r));let h=t?.next().value,d={};for(let f of this.propertyVectors){if(!f)continue;let x=f.name,_=f.getValue(r);_!==null&&(d[x]=_)}r++,yield{id:l,geometry:h,properties:d}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],r=this.geometryVector.getGeometries();for(let l=0;l<this.numFeatures;l++){let h;this.idVector&&(h=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(l)):this.idVector.getValue(l));let d={coordinates:r[l],type:this.geometryVector.geometryType(l)},f={};for(let x of this.propertyVectors){if(!x)continue;let _=x.name,b=x.getValue(l);b!==null&&(f[_]=b)}t.push({id:h,geometry:d,properties:f})}return t}containsMaxSaveIntegerValues(t){return t instanceof Qs||t instanceof il&&t instanceof el||t instanceof tl}}class AM{value;constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}}var Qt,c5,N8,A3,Ae,F6,Bt,kt,Bd,J6;(function(o){o.PRESENT="PRESENT",o.DATA="DATA",o.OFFSET="OFFSET",o.LENGTH="LENGTH"})(Qt||(Qt={}));class rl{_dictionaryType;_offsetType;_lengthType;constructor(t,r,l){this._dictionaryType=t,this._offsetType=r,this._lengthType=l}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function St(o,t,r){let l=new Int32Array(r),h=0,d=t.get();for(let f=0;f<l.length;f++){let x=o[d++],_=127&x;x<128||(x=o[d++],_|=(127&x)<<7,x<128||(x=o[d++],_|=(127&x)<<14,x<128||(x=o[d++],_|=(127&x)<<21,x<128||(x=o[d++],_|=(15&x)<<28)))),l[h++]=_}return t.set(d),l}function qn(o,t,r){let l=new BigInt64Array(r);for(let h=0;h<l.length;h++)l[h]=kM(o,t);return l}function BM(o,t){let r,l;return l=o[t.get()],t.increment(),r=127&l,l<128?r:(l=o[t.get()],t.increment(),r|=(127&l)<<7,l<128?r:(l=o[t.get()],t.increment(),r|=(127&l)<<14,l<128?r:(l=o[t.get()],t.increment(),r|=(127&l)<<21,l<128?r:(l=o[t.get()],r|=(15&l)<<28,(function(h,d,f){let x,_;if(_=d[f.get()],f.increment(),x=(112&_)>>4,_<128||(_=d[f.get()],f.increment(),x|=(127&_)<<3,_<128)||(_=d[f.get()],f.increment(),x|=(127&_)<<10,_<128)||(_=d[f.get()],f.increment(),x|=(127&_)<<17,_<128)||(_=d[f.get()],f.increment(),x|=(127&_)<<24,_<128)||(_=d[f.get()],f.increment(),x|=(1&_)<<31,_<128))return 4294967296*x+(h>>>0);throw new Error("Expected varint not more than 10 bytes")})(r,o,t)))))}function kd(o,t,r,l){throw new Error("FastPFor is not implemented yet.")}function Be(o){return o>>>1^-(1&o)}function d7(o){return o>>1n^-(1n&o)}function kM(o,t){let r=0n,l=0,h=t.get();for(;h<o.length;){let d=o[h++];if(r|=BigInt(127&d)<<BigInt(l),!(128&d))break;if(l+=7,l>=64)throw new Error("Varint too long")}return t.set(h),r}function Rd(o,t,r){let l=new Int32Array(r),h=0;for(let d=0;d<t;d++){let f=o[d];l.fill(o[d+t],h,h+f),h+=f}return l}function Dd(o,t,r){let l=new BigInt64Array(r),h=0;for(let d=0;d<t;d++){let f=Number(o[d]);l.fill(o[d+t],h,h+f),h+=f}return l}function Fd(o,t,r){let l=new Float64Array(r),h=0;for(let d=0;d<t;d++){let f=o[d];l.fill(o[d+t],h,h+f),h+=f}return l}function nl(o){let t=o.length/4*4,r=1;if(t>=4)for(let l=o[0];r<t-4;r+=4)l=o[r]+=l,l=o[r+1]+=l,l=o[r+2]+=l,l=o[r+3]+=l;for(;r!=o.length;)o[r]+=o[r-1],++r}function Od(o){o[0]=o[0]>>>1^-(1&o[0]),o[1]=o[1]>>>1^-(1&o[1]);let t=o.length/4*4,r=2;if(t>=4)for(;r<t-4;r+=4){let l=o[r],h=o[r+1],d=o[r+2],f=o[r+3];o[r]=(l>>>1^-(1&l))+o[r-2],o[r+1]=(h>>>1^-(1&h))+o[r-1],o[r+2]=(d>>>1^-(1&d))+o[r],o[r+3]=(f>>>1^-(1&f))+o[r+1]}for(;r!=o.length;r+=2)o[r]=(o[r]>>>1^-(1&o[r]))+o[r-2],o[r+1]=(o[r+1]>>>1^-(1&o[r+1]))+o[r-1]}function I9(o,t,r){return Math.min(r,Math.max(t,o))}(function(o){o.NONE="NONE",o.DELTA="DELTA",o.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",o.RLE="RLE",o.MORTON="MORTON",o.PDE="PDE"})(c5||(c5={})),(function(o){o.NONE="NONE",o.FAST_PFOR="FAST_PFOR",o.VARINT="VARINT",o.ALP="ALP"})(N8||(N8={})),(function(o){o.NONE="NONE",o.SINGLE="SINGLE",o.SHARED="SHARED",o.VERTEX="VERTEX",o.MORTON="MORTON",o.FSST="FSST"})(A3||(A3={})),(function(o){o.VERTEX="VERTEX",o.INDEX="INDEX",o.STRING="STRING",o.KEY="KEY"})(Ae||(Ae={})),(function(o){o.VAR_BINARY="VAR_BINARY",o.GEOMETRIES="GEOMETRIES",o.PARTS="PARTS",o.RINGS="RINGS",o.TRIANGLES="TRIANGLES",o.SYMBOL="SYMBOL",o.DICTIONARY="DICTIONARY"})(F6||(F6={}));class ke{_physicalStreamType;_logicalStreamType;_logicalLevelTechnique1;_logicalLevelTechnique2;_physicalLevelTechnique;_numValues;_byteLength;constructor(t,r,l,h,d,f,x){this._physicalStreamType=t,this._logicalStreamType=r,this._logicalLevelTechnique1=l,this._logicalLevelTechnique2=h,this._physicalLevelTechnique=d,this._numValues=f,this._byteLength=x}static decode(t,r){let l=t[r.get()],h=Object.values(Qt)[l>>4],d=null;switch(h){case Qt.DATA:d=new rl(Object.values(A3)[15&l]);break;case Qt.OFFSET:d=new rl(null,Object.values(Ae)[15&l]);break;case Qt.LENGTH:d=new rl(null,null,Object.values(F6)[15&l])}r.increment();let f=t[r.get()],x=Object.values(c5)[f>>5],_=Object.values(c5)[f>>2&7],b=Object.values(N8)[3&f];r.increment();let z=St(t,r,2);return new ke(h,d,x,_,b,z[0],z[1])}get physicalStreamType(){return this._physicalStreamType}get logicalStreamType(){return this._logicalStreamType}get logicalLevelTechnique1(){return this._logicalLevelTechnique1}get logicalLevelTechnique2(){return this._logicalLevelTechnique2}get physicalLevelTechnique(){return this._physicalLevelTechnique}get numValues(){return this._numValues}get byteLength(){return this._byteLength}getDecompressedCount(){return this._numValues}}class Hn extends ke{num_bits;coordinate_shift;constructor(t,r,l,h,d,f,x,_,b){super(t,r,l,h,d,f,x),this.num_bits=_,this.coordinate_shift=b}static decode(t,r){let l=ke.decode(t,r),h=St(t,r,2);return new Hn(l.physicalStreamType,l.logicalStreamType,l.logicalLevelTechnique1,l.logicalLevelTechnique2,l.physicalLevelTechnique,l.numValues,l.byteLength,h[0],h[1])}static decodePartial(t,r,l){let h=St(r,l,2);return new Hn(t.physicalStreamType,t.logicalStreamType,t.logicalLevelTechnique1,t.logicalLevelTechnique2,t.physicalLevelTechnique,t.numValues,t.byteLength,h[0],h[1])}numBits(){return this.num_bits}coordinateShift(){return this.coordinate_shift}}class ci extends ke{_runs;_numRleValues;constructor(t,r,l,h,d,f,x,_,b){super(t,r,l,h,d,f,x),this._runs=_,this._numRleValues=b}static decode(t,r){let l=ke.decode(t,r),h=St(t,r,2);return new ci(l.physicalStreamType,l.logicalStreamType,l.logicalLevelTechnique1,l.logicalLevelTechnique2,l.physicalLevelTechnique,l.numValues,l.byteLength,h[0],h[1])}static decodePartial(t,r,l){let h=St(r,l,2);return new ci(t.physicalStreamType,t.logicalStreamType,t.logicalLevelTechnique1,t.logicalLevelTechnique2,t.physicalLevelTechnique,t.numValues,t.byteLength,h[0],h[1])}get runs(){return this._runs}get numRleValues(){return this._numRleValues}getDecompressedCount(){return this._numRleValues}}class l6{static decode(t,r){let l=ke.decode(t,r);return l.logicalLevelTechnique1===c5.MORTON?Hn.decodePartial(l,t,r):c5.RLE!==l.logicalLevelTechnique1&&c5.RLE!==l.logicalLevelTechnique2||N8.NONE===l.physicalLevelTechnique?l:ci.decodePartial(l,t,r)}}(function(o){o[o.FLAT=0]="FLAT",o[o.CONST=1]="CONST",o[o.SEQUENCE=2]="SEQUENCE",o[o.DICTIONARY=3]="DICTIONARY",o[o.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(Bt||(Bt={}));class B3{values;_size;constructor(t,r){this.values=t,this._size=r}get(t){let r=Math.floor(t/8);return(this.values[r]>>t%8&1)==1}set(t,r){let l=Math.floor(t/8);this.values[l]=this.values[l]|(r?1:0)<<t%8}getInt(t){let r=Math.floor(t/8);return this.values[r]>>t%8&1}size(){return this._size}getBuffer(){return this.values}}class $2{constructor(){}static decodeIntStream(t,r,l,h,d){let f=$2.decodePhysicalLevelTechnique(t,r,l);return this.decodeIntBuffer(f,l,h,d)}static decodeLengthStreamToOffsetBuffer(t,r,l){let h=$2.decodePhysicalLevelTechnique(t,r,l);return this.decodeLengthToOffsetBuffer(h,l)}static decodePhysicalLevelTechnique(t,r,l){let h=l.physicalLevelTechnique;if(h===N8.FAST_PFOR)return kd();if(h===N8.VARINT)return St(t,r,l.numValues);if(h===N8.NONE){let d=r.get();r.add(l.byteLength);let f=t.subarray(d,r.get());return new Int32Array(f)}throw new Error("Specified physicalLevelTechnique is not supported (yet).")}static decodeConstIntStream(t,r,l,h){let d=$2.decodePhysicalLevelTechnique(t,r,l);if(d.length===1){let f=d[0];return h?Be(f):f}return h?(function(f){return Be(f[1])})(d):(function(f){return f[1]})(d)}static decodeSequenceIntStream(t,r,l){return(function(h){if(h.length==2){let d=Be(h[1]);return[d,d]}return[Be(h[2]),Be(h[3])]})($2.decodePhysicalLevelTechnique(t,r,l))}static decodeSequenceLongStream(t,r,l){return(function(h){if(h.length==2){let d=d7(h[1]);return[d,d]}return[d7(h[2]),d7(h[3])]})(qn(t,r,l.numValues))}static decodeLongStream(t,r,l,h){let d=qn(t,r,l.numValues);return this.decodeLongBuffer(d,l,h)}static decodeLongFloat64Stream(t,r,l,h){let d=(function(f,x,_){let b=new Float64Array(x);for(let z=0;z<x;z++)b[z]=BM(f,_);return b})(t,l.numValues,r);return this.decodeFloat64Buffer(d,l,h)}static decodeConstLongStream(t,r,l,h){let d=qn(t,r,l.numValues);if(d.length===1){let f=d[0];return h?d7(f):f}return h?(function(f){return d7(f[1])})(d):(function(f){return f[1]})(d)}static decodeIntBuffer(t,r,l,h){switch(r.logicalLevelTechnique1){case c5.DELTA:return r.logicalLevelTechnique2===c5.RLE?(function(d,f,x){let _=new Int32Array(x),b=0,z=0;for(let P=0;P<f;P++){let k=d[P],D=Be(d[P+f]);for(let N=0;N<k;N++)z+=D,_[b++]=z}return _})(t,r.runs,r.numRleValues):((function(d){d[0]=d[0]>>>1^-(1&d[0]);let f=d.length/4*4,x=1;if(f>=4)for(;x<f-4;x+=4){let _=d[x],b=d[x+1],z=d[x+2],P=d[x+3];d[x]=(_>>>1^-(1&_))+d[x-1],d[x+1]=(b>>>1^-(1&b))+d[x],d[x+2]=(z>>>1^-(1&z))+d[x+1],d[x+3]=(P>>>1^-(1&P))+d[x+2]}for(;x!=d.length;++x)d[x]=(d[x]>>>1^-(1&d[x]))+d[x-1]})(t),t);case c5.RLE:return(function(d,f,x){return x?(function(_,b,z){let P=new Int32Array(z),k=0;for(let D=0;D<b;D++){let N=_[D],U=_[D+b];U=U>>>1^-(1&U),P.fill(U,k,k+N),k+=N}return P})(d,f.runs,f.numRleValues):Rd(d,f.runs,f.numRleValues)})(t,r,l);case c5.MORTON:return nl(t),t;case c5.COMPONENTWISE_DELTA:return h?((function(d,f,x,_){let b=d[0]>>>1^-(1&d[0]),z=d[1]>>>1^-(1&d[1]);d[0]=I9(Math.round(b*f),x,_),d[1]=I9(Math.round(z*f),x,_);let P=d.length/16,k=2;if(P>=4)for(;k<P-4;k+=4){let D=d[k],N=d[k+1],U=(D>>>1^-(1&D))+b,$=(N>>>1^-(1&N))+z;d[k]=I9(Math.round(U*f),x,_),d[k+1]=I9(Math.round($*f),x,_);let J=d[k+2],L1=d[k+3];b=(J>>>1^-(1&J))+U,z=(L1>>>1^-(1&L1))+$,d[k+2]=I9(Math.round(b*f),x,_),d[k+3]=I9(Math.round(z*f),x,_)}for(;k!=d.length;k+=2)b+=d[k]>>>1^-(1&d[k]),z+=d[k+1]>>>1^-(1&d[k+1]),d[k]=I9(Math.round(b*f),x,_),d[k+1]=I9(Math.round(z*f),x,_)})(t,h.scale,h.min,h.max),t):(Od(t),t);case c5.NONE:return l&&(function(d){for(let f=0;f<d.length;f++){let x=d[f];d[f]=x>>>1^-(1&x)}})(t),t;default:throw new Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}}static decodeLongBuffer(t,r,l){switch(r.logicalLevelTechnique1){case c5.DELTA:return r.logicalLevelTechnique2===c5.RLE?(function(h,d,f){let x=new BigInt64Array(f),_=0,b=0n;for(let z=0;z<d;z++){let P=Number(h[z]),k=d7(h[z+d]);for(let D=0;D<P;D++)b+=k,x[_++]=b}return x})(t,r.runs,r.numRleValues):((function(h){h[0]=h[0]>>1n^-(1n&h[0]);let d=h.length/4*4,f=1;if(d>=4)for(;f<d-4;f+=4){let x=h[f],_=h[f+1],b=h[f+2],z=h[f+3];h[f]=(x>>1n^-(1n&x))+h[f-1],h[f+1]=(_>>1n^-(1n&_))+h[f],h[f+2]=(b>>1n^-(1n&b))+h[f+1],h[f+3]=(z>>1n^-(1n&z))+h[f+2]}for(;f!=h.length;++f)h[f]=(h[f]>>1n^-(1n&h[f]))+h[f-1]})(t),t);case c5.RLE:return(function(h,d,f){return f?(function(x,_,b){let z=new BigInt64Array(b),P=0;for(let k=0;k<_;k++){let D=Number(x[k]),N=x[k+_];N=N>>1n^-(1n&N),z.fill(N,P,P+D),P+=D}return z})(h,d.runs,d.numRleValues):Dd(h,d.runs,d.numRleValues)})(t,r,l);case c5.NONE:return l&&(function(h){for(let d=0;d<h.length;d++){let f=h[d];h[d]=f>>1n^-(1n&f)}})(t),t;default:throw new Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}}static decodeFloat64Buffer(t,r,l){switch(r.logicalLevelTechnique1){case c5.DELTA:return r.logicalLevelTechnique2===c5.RLE&&(t=Fd(t,r.runs,r.numRleValues)),(function(h){h[0]=h[0]%2==1?(h[0]+1)/-2:h[0]/2;let d=h.length/4*4,f=1;if(d>=4)for(;f<d-4;f+=4){let x=h[f],_=h[f+1],b=h[f+2],z=h[f+3];h[f]=(x%2==1?(x+1)/-2:x/2)+h[f-1],h[f+1]=(_%2==1?(_+1)/-2:_/2)+h[f],h[f+2]=(b%2==1?(b+1)/-2:b/2)+h[f+1],h[f+3]=(z%2==1?(z+1)/-2:z/2)+h[f+2]}for(;f!=h.length;++f)h[f]=(h[f]%2==1?(h[f]+1)/-2:h[f]/2)+h[f-1]})(t),t;case c5.RLE:return(function(h,d,f){return f?(function(x,_,b){let z=new Float64Array(b),P=0;for(let k=0;k<_;k++){let D=x[k],N=x[k+_];N=N%2==1?(N+1)/-2:N/2,z.fill(N,P,P+D),P+=D}return z})(h,d.runs,d.numRleValues):Fd(h,d.runs,d.numRleValues)})(t,r,l);case c5.NONE:return l&&(function(h){for(let d=0;d<h.length;d++){let f=h[d];h[d]=f%2==1?(f+1)/-2:f/2}})(t),t;default:throw new Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}}static decodeLengthToOffsetBuffer(t,r){if(r.logicalLevelTechnique1===c5.DELTA&&r.logicalLevelTechnique2===c5.NONE)return(function(l){let h=new Int32Array(l.length+1);h[0]=0,h[1]=Be(l[0]);let d=h[1],f=2;for(;f!=h.length;++f){let x=l[f-1];d+=x>>>1^-(1&x),h[f]=h[f-1]+d}return h})(t);if(r.logicalLevelTechnique1===c5.RLE&&r.logicalLevelTechnique2===c5.NONE)return(function(l,h,d){let f=new Int32Array(d+1);f[0]=0;let x=1,_=f[0];for(let b=0;b<h;b++){let z=l[b],P=l[b+h];for(let k=x;k<x+z;k++)f[k]=P+_,_=f[k];x+=z}return f})(t,r.runs,r.numRleValues);if(r.logicalLevelTechnique1===c5.NONE&&r.logicalLevelTechnique2===c5.NONE){(function(h){let d=0;for(let f=0;f<h.length;f++)h[f]+=d,d=h[f]})(t);let l=new Int32Array(r.numValues+1);return l[0]=0,l.set(t,1),l}if(r.logicalLevelTechnique1===c5.DELTA&&r.logicalLevelTechnique2===c5.RLE){let l=(function(h,d,f){let x=new Int32Array(f+1);x[0]=0;let _=1,b=x[0];for(let z=0;z<d;z++){let P=h[z],k=h[z+d];k=k>>>1^-(1&k);for(let D=_;D<_+P;D++)x[D]=k+b,b=x[D];_+=P}return x})(t,r.runs,r.numRleValues);return nl(l),l}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")}static decodeNullableIntStream(t,r,l,h,d){let f=l.physicalLevelTechnique===N8.FAST_PFOR?kd():St(t,r,l.numValues);return this.decodeNullableIntBuffer(f,l,h,d)}static decodeNullableLongStream(t,r,l,h,d){let f=qn(t,r,l.numValues);return this.decodeNullableLongBuffer(f,l,h,d)}static decodeNullableIntBuffer(t,r,l,h){switch(r.logicalLevelTechnique1){case c5.DELTA:return r.logicalLevelTechnique2===c5.RLE&&(t=Rd(t,r.runs,r.numRleValues)),(function(d,f){let x=new Int32Array(d.size()),_=0;d.get(0)?(x[0]=d.get(0)?f[0]>>>1^-(1&f[0]):0,_=1):x[0]=0;let b=1;for(;b!=x.length;++b)x[b]=d.get(b)?x[b-1]+(f[_]>>>1^-(1&f[_++])):x[b-1];return x})(h,t);case c5.RLE:return(function(d,f,x,_){let b=f;return x?(function(z,P,k){let D=new Int32Array(z.size()),N=0;for(let U=0;U<k;U++){let $=P[U],J=P[U+k];J=J>>>1^-(1&J);for(let L1=N;L1<N+$;L1++)z.get(L1)?D[L1]=J:(D[L1]=0,N++);N+=$}return D})(_,d,b.runs):(function(z,P,k){let D=new Int32Array(z.size()),N=0;for(let U=0;U<k;U++){let $=P[U],J=P[U+k];for(let L1=N;L1<N+$;L1++)z.get(L1)?D[L1]=J:(D[L1]=0,N++);N+=$}return D})(_,d,b.runs)})(t,r,l,h);case c5.MORTON:return nl(t),t;case c5.COMPONENTWISE_DELTA:return Od(t),t;case c5.NONE:return t=l?(function(d,f){let x=new Int32Array(d.size()),_=0,b=0;for(;b!=x.length;++b)if(d.get(b)){let z=f[_++];x[b]=z>>>1^-(1&z)}else x[b]=0;return x})(h,t):(function(d,f){let x=new Int32Array(d.size()),_=0,b=0;for(;b!=x.length;++b)x[b]=d.get(b)?f[_++]:0;return x})(h,t),t;default:throw new Error("The specified Logical level technique is not supported")}}static decodeNullableLongBuffer(t,r,l,h){switch(r.logicalLevelTechnique1){case c5.DELTA:return r.logicalLevelTechnique2===c5.RLE&&(t=Dd(t,r.runs,r.numRleValues)),(function(d,f){let x=new BigInt64Array(d.size()),_=0;d.get(0)?(x[0]=d.get(0)?f[0]>>1n^-(1n&f[0]):0n,_=1):x[0]=0n;let b=1;for(;b!=x.length;++b)x[b]=d.get(b)?x[b-1]+(f[_]>>1n^-(1n&f[_++])):x[b-1];return x})(h,t);case c5.RLE:return(function(d,f,x,_){let b=f;return x?(function(z,P,k){let D=new BigInt64Array(z.size()),N=0;for(let U=0;U<k;U++){let $=Number(P[U]),J=P[U+k];J=J>>1n^-(1n&J);for(let L1=N;L1<N+$;L1++)z.get(L1)?D[L1]=J:(D[L1]=0n,N++);N+=$}return D})(_,d,b.runs):(function(z,P,k){let D=new BigInt64Array(z.size()),N=0;for(let U=0;U<k;U++){let $=Number(P[U]),J=P[U+k];for(let L1=N;L1<N+$;L1++)z.get(L1)?D[L1]=J:(D[L1]=0n,N++);N+=$}return D})(_,d,b.runs)})(t,r,l,h);case c5.NONE:return t=l?(function(d,f){let x=new BigInt64Array(d.size()),_=0,b=0;for(;b!=x.length;++b)if(d.get(b)){let z=f[_++];x[b]=z>>1n^-(1n&z)}else x[b]=0n;return x})(h,t):(function(d,f){let x=new BigInt64Array(d.size()),_=0,b=0;for(;b!=x.length;++b)x[b]=d.get(b)?f[_++]:0n;return x})(h,t),t;default:throw new Error("The specified Logical level technique is not supported")}}static getVectorType(t,r,l,h){let d=t.logicalLevelTechnique1;if(d===c5.RLE)return t.runs===1?Bt.CONST:Bt.FLAT;let f=r instanceof B3?r.size():r;if(d===c5.DELTA&&t.logicalLevelTechnique2===c5.RLE){let x=t.runs,_=2;if(t.numRleValues!==f)return Bt.FLAT;if(x===1)return Bt.SEQUENCE;if(x===2){let b=h.get(),z;if(t.physicalLevelTechnique===N8.VARINT)z=St(l,h,4);else{let P=h.get();z=new Int32Array(l.buffer,l.byteOffset+P,4)}if(h.set(b),z[2]===_&&z[3]===_)return Bt.SEQUENCE}}return t.numValues===1?Bt.CONST:Bt.FLAT}}class Nd extends jn{getValueFromBuffer(t){return this.dataBuffer[t]}}class Vd extends Ad{constructor(t,r,l,h){super(t,BigInt64Array.of(r),l,h)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}}class p7{_geometryOffsets;_partOffsets;_ringOffsets;constructor(t,r,l){this._geometryOffsets=t,this._partOffsets=r,this._ringOffsets=l}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}class RM{tileExtent;_numBits;_coordinateShift;minBound;maxBound;constructor(t,r){this._coordinateShift=t<0?Math.abs(t):0,this.tileExtent=r+this._coordinateShift,this._numBits=Math.ceil(Math.log2(this.tileExtent)),this.minBound=t,this.maxBound=r}validateCoordinates(t){if(t.x<this.minBound||t.y<this.minBound||t.x>this.maxBound||t.y>this.maxBound)throw new Error("The specified tile buffer size is currently not supported.")}numBits(){return this._numBits}coordinateShift(){return this._coordinateShift}}class f7 extends RM{encode(t){this.validateCoordinates(t);let r=t.x+this._coordinateShift,l=t.y+this._coordinateShift,h=0;for(let d=0;d<this._numBits;d++)h|=(r&1<<d)<<d|(l&1<<d)<<d+1;return h}decode(t){return{x:this.decodeMorton(t)-this._coordinateShift,y:this.decodeMorton(t>>1)-this._coordinateShift}}decodeMorton(t){let r=0;for(let l=0;l<this._numBits;l++)r|=(t&1<<2*l)>>l;return r}static decode(t,r,l){return{x:f7.decodeMorton(t,r)-l,y:f7.decodeMorton(t>>1,r)-l}}static decodeMorton(t,r){let l=0;for(let h=0;h<r;h++)l|=(t&1<<2*h)>>h;return l}}(function(o){o[o.POINT=0]="POINT",o[o.LINESTRING=1]="LINESTRING",o[o.POLYGON=2]="POLYGON",o[o.MULTIPOINT=3]="MULTIPOINT",o[o.MULTILINESTRING=4]="MULTILINESTRING",o[o.MULTIPOLYGON=5]="MULTIPOLYGON"})(kt||(kt={})),(function(o){o[o.POINT=0]="POINT",o[o.LINESTRING=1]="LINESTRING",o[o.POLYGON=2]="POLYGON"})(Bd||(Bd={})),(function(o){o[o.MORTON=0]="MORTON",o[o.VEC_2=1]="VEC_2",o[o.VEC_3=2]="VEC_3"})(J6||(J6={}));class DM{createPoint(t){return[[t]]}createMultiPoint(t){return t.map((r=>[r]))}createLineString(t){return[t]}createMultiLineString(t){return t}createPolygon(t,r){return[t,...r]}createMultiPolygon(t){return t.flat()}}function Gd(o){let t=new Array(o.numGeometries),r=1,l=1,h=1,d=0,f=new DM,x=0,_=0,b=o.mortonSettings,z=o.topologyVector,P=z.geometryOffsets,k=z.partOffsets,D=z.ringOffsets,N=o.vertexOffsets,U=o.containsPolygonGeometry(),$=o.vertexBuffer;for(let J=0;J<o.numGeometries;J++){let L1=o.geometryType(J);if(L1===kt.POINT){if(N&&N.length!==0)if(o.vertexBufferType===J6.VEC_2){let Q=2*N[_++],n1=new y($[Q],$[Q+1]);t[d++]=f.createPoint(n1)}else{let Q=N[_++],n1=f7.decode($[Q],b.numBits,b.coordinateShift),f1=new y(n1.x,n1.y);t[d++]=f.createPoint(f1)}else{let Q=new y($[x++],$[x++]);t[d++]=f.createPoint(Q)}P&&h++,k&&r++,D&&l++}else if(L1===kt.MULTIPOINT){let Q=P[h]-P[h-1];h++;let n1=new Array(Q);if(N&&N.length!==0){for(let f1=0;f1<Q;f1++){let _1=2*N[_++];n1[f1]=new y($[_1],$[_1+1])}t[d++]=f.createMultiPoint(n1)}else{for(let f1=0;f1<Q;f1++){let _1=$[x++],P1=$[x++];n1[f1]=new y(_1,P1)}t[d++]=f.createMultiPoint(n1)}}else if(L1===kt.LINESTRING){let Q,n1=0;U?(n1=D[l]-D[l-1],l++):n1=k[r]-k[r-1],r++,N&&N.length!==0?(Q=o.vertexBufferType===J6.VEC_2?al($,N,_,n1,!1):sl($,N,_,n1,!1,b),_+=n1):(Q=ol($,x,n1,!1),x+=2*n1),t[d++]=f.createLineString(Q),P&&h++}else if(L1===kt.POLYGON){let Q=k[r]-k[r-1];r++;let n1=new Array(Q-1),f1=D[l]-D[l-1];if(l++,N&&N.length!==0){let _1=o.vertexBufferType===J6.VEC_2?Wn($,N,_,f1):Yn($,N,_,f1,0,b);_+=f1;for(let P1=0;P1<n1.length;P1++)f1=D[l]-D[l-1],l++,n1[P1]=o.vertexBufferType===J6.VEC_2?Wn($,N,_,f1):Yn($,N,_,f1,0,b),_+=f1;t[d++]=f.createPolygon(_1,n1)}else{let _1=$n($,x,f1);x+=2*f1;for(let P1=0;P1<n1.length;P1++)f1=D[l]-D[l-1],l++,n1[P1]=$n($,x,f1),x+=2*f1;t[d++]=f.createPolygon(_1,n1)}P&&h++}else if(L1===kt.MULTILINESTRING){let Q=P[h]-P[h-1];h++;let n1=new Array(Q);if(N&&N.length!==0){for(let f1=0;f1<Q;f1++){let _1=0;U?(_1=D[l]-D[l-1],l++):_1=k[r]-k[r-1],r++;let P1=o.vertexBufferType===J6.VEC_2?al($,N,_,_1,!1):sl($,N,_,_1,!1,b);n1[f1]=P1,_+=_1}t[d++]=f.createMultiLineString(n1)}else{for(let f1=0;f1<Q;f1++){let _1=0;U?(_1=D[l]-D[l-1],l++):_1=k[r]-k[r-1],r++,n1[f1]=ol($,x,_1,!1),x+=2*_1}t[d++]=f.createMultiLineString(n1)}}else{if(L1!==kt.MULTIPOLYGON)throw new Error("The specified geometry type is currently not supported.");{let Q=P[h]-P[h-1];h++;let n1=new Array(Q),f1=0;if(N&&N.length!==0){for(let _1=0;_1<Q;_1++){let P1=k[r]-k[r-1];r++;let $1=new Array(P1-1);f1=D[l]-D[l-1],l++;let j1=o.vertexBufferType===J6.VEC_2?Wn($,N,_,f1):Yn($,N,_,f1,0,b);_+=f1;for(let J1=0;J1<$1.length;J1++)f1=D[l]-D[l-1],l++,$1[J1]=o.vertexBufferType===J6.VEC_2?Wn($,N,_,f1):Yn($,N,_,f1,0,b),_+=f1;n1[_1]=f.createPolygon(j1,$1)}t[d++]=f.createMultiPolygon(n1)}else{for(let _1=0;_1<Q;_1++){let P1=k[r]-k[r-1];r++;let $1=new Array(P1-1);f1=D[l]-D[l-1],l++;let j1=$n($,x,f1);x+=2*f1;for(let J1=0;J1<$1.length;J1++){let u2=D[l]-D[l-1];l++,$1[J1]=$n($,x,u2),x+=2*u2}n1[_1]=f.createPolygon(j1,$1)}t[d++]=f.createMultiPolygon(n1)}}}}return t}function $n(o,t,r){return ol(o,t,r,!0)}function Wn(o,t,r,l){return al(o,t,r,l,!0)}function Yn(o,t,r,l,h,d){return sl(o,t,r,l,!0,d)}function ol(o,t,r,l){let h=new Array(l?r+1:r);for(let d=0;d<2*r;d+=2)h[d/2]=new y(o[t+d],o[t+d+1]);return l&&(h[h.length-1]=h[0]),h}function al(o,t,r,l,h){let d=new Array(h?l+1:l);for(let f=0;f<2*l;f+=2){let x=2*t[r+f/2];d[f/2]=new y(o[x],o[x+1])}return h&&(d[d.length-1]=d[0]),d}function sl(o,t,r,l,h,d){let f=new Array(h?l+1:l);for(let x=0;x<l;x++){let _=f7.decode(o[t[r+x]],d.numBits,d.coordinateShift);f[x]=new y(_.x,_.y)}return h&&(f[f.length-1]=f[0]),f}class Ud{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(t,r,l,h,d){this._vertexBufferType=t,this._topologyVector=r,this._vertexOffsets=l,this._vertexBuffer=h,this._mortonSettings=d}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){let t=Gd(this),r=0;for(;r<this.numGeometries;)yield{coordinates:t[r],type:this.geometryType(r)},r++}getSimpleEncodedVertex(t){let r=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let l=f7.decode(this.vertexBuffer[this.vertexOffsets[t]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[l.x,l.y]}let r=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getGeometries(){return Gd(this)}get mortonSettings(){return this._mortonSettings}}class Li extends Ud{_numGeometries;_geometryType;constructor(t,r,l,h,d,f,x){super(l,h,d,f,x),this._numGeometries=t,this._geometryType=r}static createMortonEncoded(t,r,l,h,d,f){return new Li(t,r,J6.MORTON,l,h,d,f)}static create(t,r,l,h,d){return new Li(t,r,J6.VEC_2,l,h,d)}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===kt.POLYGON||this._geometryType===kt.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class ui extends Ud{_geometryTypes;constructor(t,r,l,h,d,f){super(t,l,h,d,f),this._geometryTypes=r}static createMortonEncoded(t,r,l,h,d){return new ui(J6.MORTON,t,r,l,h,d)}static create(t,r,l,h){return new ui(J6.VEC_2,t,r,l,h)}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===kt.POLYGON||this.geometryType(t)===kt.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class jd{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(t,r,l,h){this._triangleOffsets=t,this._indexBuffer=r,this._vertexBuffer=l,this._topologyVector=h}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 new Error("Cannot convert GpuVector to coordinates without topology information");let t=new Array(this.numGeometries),r=this._topologyVector,l=r.partOffsets,h=r.ringOffsets,d=r.geometryOffsets,f=0,x=1,_=1,b=1;for(let z=0;z<this.numGeometries;z++)switch(this.geometryType(z)){case kt.POLYGON:{let P=l[x]-l[x-1];x++;let k=[];for(let D=0;D<P;D++){let N=h[_]-h[_-1];_++;let U=[];for(let $=0;$<N;$++){let J=this._vertexBuffer[f++],L1=this._vertexBuffer[f++];U.push(new y(J,L1))}U.length>0&&U.push(U[0]),k.push(U)}t[z]=k,d&&b++}break;case kt.MULTIPOLYGON:{let P=d[b]-d[b-1];b++;let k=[];for(let D=0;D<P;D++){let N=l[x]-l[x-1];x++;for(let U=0;U<N;U++){let $=h[_]-h[_-1];_++;let J=[];for(let L1=0;L1<$;L1++){let Q=this._vertexBuffer[f++],n1=this._vertexBuffer[f++];J.push(new y(Q,n1))}J.length>0&&J.push(J[0]),k.push(J)}}t[z]=k}}return t}[Symbol.iterator](){return null}}class Xn extends jd{_numGeometries;_geometryType;constructor(t,r,l,h,d,f){super(l,h,d,f),this._numGeometries=t,this._geometryType=r}static create(t,r,l,h,d,f){return new Xn(t,r,l,h,d,f)}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}class Kn extends jd{_geometryTypes;constructor(t,r,l,h,d){super(r,l,h,d),this._geometryTypes=t}static create(t,r,l,h,d){return new Kn(t,r,l,h,d)}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function FM(o,t,r,l,h){let d=l6.decode(o,r),f=null,x=null,_=null,b=null,z=null,P=null,k=null,D=null;if($2.getVectorType(d,l,o,r)===Bt.CONST){let U=$2.decodeConstIntStream(o,r,d,!1);for(let $=0;$<t-1;$++){let J=l6.decode(o,r);switch(J.physicalStreamType){case Qt.LENGTH:switch(J.logicalStreamType.lengthType){case F6.GEOMETRIES:f=$2.decodeLengthStreamToOffsetBuffer(o,r,J);break;case F6.PARTS:x=$2.decodeLengthStreamToOffsetBuffer(o,r,J);break;case F6.RINGS:_=$2.decodeLengthStreamToOffsetBuffer(o,r,J);break;case F6.TRIANGLES:k=$2.decodeLengthStreamToOffsetBuffer(o,r,J)}break;case Qt.OFFSET:switch(J.logicalStreamType.offsetType){case Ae.VERTEX:b=$2.decodeIntStream(o,r,J,!1);break;case Ae.INDEX:D=$2.decodeIntStream(o,r,J,!1)}break;case Qt.DATA:if(A3.VERTEX===J.logicalStreamType.dictionaryType)z=$2.decodeIntStream(o,r,J,!0,h);else{let L1=J;P={numBits:L1.numBits(),coordinateShift:L1.coordinateShift()},z=$2.decodeIntStream(o,r,J,!1,h)}}}if(D!==null){if(f!=null||x!=null){let $=new p7(f,x,_);return Xn.create(l,U,k,D,z,$)}return Xn.create(l,U,k,D,z)}return P===null?Li.create(l,U,new p7(f,x,_),b,z):Li.createMortonEncoded(l,U,new p7(f,x,_),b,z,P)}let N=$2.decodeIntStream(o,r,d,!1);for(let U=0;U<t-1;U++){let $=l6.decode(o,r);switch($.physicalStreamType){case Qt.LENGTH:switch($.logicalStreamType.lengthType){case F6.GEOMETRIES:f=$2.decodeIntStream(o,r,$,!1);break;case F6.PARTS:x=$2.decodeIntStream(o,r,$,!1);break;case F6.RINGS:_=$2.decodeIntStream(o,r,$,!1);break;case F6.TRIANGLES:k=$2.decodeLengthStreamToOffsetBuffer(o,r,$)}break;case Qt.OFFSET:switch($.logicalStreamType.offsetType){case Ae.VERTEX:b=$2.decodeIntStream(o,r,$,!1);break;case Ae.INDEX:D=$2.decodeIntStream(o,r,$,!1)}break;case Qt.DATA:if(A3.VERTEX===$.logicalStreamType.dictionaryType)z=$2.decodeIntStream(o,r,$,!0,h);else{let J=$;P={numBits:J.numBits(),coordinateShift:J.coordinateShift()},z=$2.decodeIntStream(o,r,$,!1,h)}}}return D!==null&&x===null?Kn.create(N,k,D,z):(f!==null?(f=ll(N,f,2),x!==null&&_!==null?(x=qd(N,f,x,!1),_=(function(U,$,J,L1){let Q=new Int32Array(J[J.length-1]+1),n1=0;Q[0]=n1;let f1=1,_1=1,P1=0;for(let $1=0;$1<U.length;$1++){let j1=U[$1],J1=$[$1+1]-$[$1];if(j1!==0&&j1!==3)for(let u2=0;u2<J1;u2++){let r2=J[f1]-J[f1-1];f1++;for(let n2=0;n2<r2;n2++)n1=Q[_1++]=n1+L1[P1++]}else for(let u2=0;u2<J1;u2++)Q[_1++]=++n1,f1++}return Q})(N,f,x,_)):x!==null&&(x=(function(U,$,J){let L1=new Int32Array($[$.length-1]+1),Q=0;L1[0]=Q;let n1=1,f1=0;for(let _1=0;_1<U.length;_1++){let P1=U[_1],$1=$[_1+1]-$[_1];if(P1===4||P1===1)for(let j1=0;j1<$1;j1++)Q=L1[n1++]=Q+J[f1++];else for(let j1=0;j1<$1;j1++)L1[n1++]=++Q}return L1})(N,f,x))):x!==null&&_!==null?(x=ll(N,x,1),_=qd(N,x,_,!0)):x!==null&&(x=ll(N,x,0)),D!==null?Kn.create(N,k,D,z,new p7(f,x,_)):P===null?ui.create(N,new p7(f,x,_),b,z):ui.createMortonEncoded(N,new p7(f,x,_),b,z,P))}function ll(o,t,r){let l=new Int32Array(o.length+1),h=0;l[0]=h;let d=0;for(let f=0;f<o.length;f++)h=l[f+1]=h+(o[f]>r?t[d++]:1);return l}function qd(o,t,r,l){let h=new Int32Array(t[t.length-1]+1),d=0;h[0]=d;let f=1,x=0;for(let _=0;_<o.length;_++){let b=o[_],z=t[_+1]-t[_];if(b===5||b===2||l&&(b===4||b===1))for(let P=0;P<z;P++)d=h[f++]=d+r[x++];else for(let P=0;P<z;P++)h[f++]=++d}return h}class OM extends C7{dataVector;constructor(t,r,l){super(t,r.getBuffer(),l),this.dataVector=r}getValueFromBuffer(t){return this.dataVector.get(t)}}class NM extends jn{getValueFromBuffer(t){return this.dataBuffer[t]}}class Hd extends C7{constructor(t,r,l){super(t,BigInt64Array.of(r),l)}getValueFromBuffer(t){return this.dataBuffer[0]}}function VM(o,t,r){for(let l=0;l<o;l++){let h=l6.decode(t,r);r.add(h.byteLength)}}function hi(o,t,r){return $d(o,Math.ceil(t/8),r)}function $d(o,t,r){let l=new Uint8Array(t),h=0;for(;h<t;){let d=o[r.increment()];if(d<=127){let f=d+3,x=o[r.increment()],_=h+f;l.fill(x,h,_),h=_}else{let f=256-d;for(let x=0;x<f;x++)l[h++]=o[r.increment()]}}return l}let GM=new TextDecoder;function cl(o,t,r){return r-t>=12?GM.decode(o.subarray(t,r)):(function(l,h,d){let f="",x=h;for(;x<d;){let _=l[x],b,z,P,k=null,D=_>239?4:_>223?3:_>191?2:1;if(x+D>d)break;D===1?_<128&&(k=_):D===2?(b=l[x+1],(192&b)==128&&(k=(31&_)<<6|63&b,k<=127&&(k=null))):D===3?(b=l[x+1],z=l[x+2],(192&b)==128&&(192&z)==128&&(k=(15&_)<<12|(63&b)<<6|63&z,(k<=2047||k>=55296&&k<=57343)&&(k=null))):D===4&&(b=l[x+1],z=l[x+2],P=l[x+3],(192&b)==128&&(192&z)==128&&(192&P)==128&&(k=(15&_)<<18|(63&b)<<12|(63&z)<<6|63&P,(k<=65535||k>=1114112)&&(k=null))),k===null?(k=65533,D=1):k>65535&&(k-=65536,f+=String.fromCharCode(k>>>10&1023|55296),k=56320|1023&k),f+=String.fromCharCode(k),x+=D}return f})(o,t,r)}class Ll extends C7{offsetBuffer;constructor(t,r,l,h){super(t,l,h),this.offsetBuffer=r}}class Wd extends Ll{textEncoder;constructor(t,r,l,h){super(t,r,l,h??r.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(t){return cl(this.dataBuffer,this.offsetBuffer[t],this.offsetBuffer[t+1])}}class g7 extends Ll{indexBuffer;textEncoder;constructor(t,r,l,h,d){super(t,l,h,d??r.length),this.indexBuffer=r,this.indexBuffer=r,this.textEncoder=new TextEncoder}getValueFromBuffer(t){let r=this.indexBuffer[t];return cl(this.dataBuffer,this.offsetBuffer[r],this.offsetBuffer[r+1])}}class Yd extends Ll{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(t,r,l,h,d,f,x){super(t,l,h,x),this.indexBuffer=r,this.symbolOffsetBuffer=d,this.symbolTableBuffer=f,this.textEncoder=new TextEncoder}getValueFromBuffer(t){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=(function(l,h,d){let f=[],x=new Array(h.length).fill(0);for(let _=1;_<h.length;_++)x[_]=x[_-1]+h[_-1];for(let _=0;_<d.length;_++)if(d[_]===255)f.push(d[++_]);else{let b=h[d[_]],z=x[d[_]];for(let P=0;P<b;P++)f.push(l[z+P])}return new Uint8Array(f)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let r=this.indexBuffer[t];return cl(this.decodedDictionary,this.offsetBuffer[r],this.offsetBuffer[r+1])}offsetToLengthBuffer(t){let r=new Uint32Array(t.length-1),l=t[0];for(let h=1;h<t.length;h++){let d=t[h];r[h-1]=d-l,l=d}return r}}class Ci{static ROOT_COLUMN_NAME="default";static NESTED_COLUMN_SEPARATOR=":";constructor(){}static decode(t,r,l,h,d){let f=null,x=null,_=null,b=null,z=null,P=null,k=null,D=null;for(let N=0;N<h;N++){let U=l6.decode(r,l);if(U.byteLength!==0)switch(U.physicalStreamType){case Qt.PRESENT:{let $=hi(r,U.numValues,l);P=new B3($,U.numValues);break}case Qt.OFFSET:x=d!=null||P!=null?$2.decodeNullableIntStream(r,l,U,!1,d??P):$2.decodeIntStream(r,l,U,!1);break;case Qt.LENGTH:{let $=$2.decodeLengthStreamToOffsetBuffer(r,l,U);F6.DICTIONARY===U.logicalStreamType.lengthType?f=$:F6.SYMBOL===U.logicalStreamType.lengthType?b=$:k=$;break}case Qt.DATA:{let $=r.subarray(l.get(),l.get()+U.byteLength);l.add(U.byteLength);let J=U.logicalStreamType.dictionaryType;A3.FSST===J?z=$:A3.SINGLE===J||A3.SHARED===J?_=$:A3.NONE===J&&(D=$);break}}}return this.decodeFsstDictionaryVector(t,z,x,f,_,b,d??P)??this.decodeDictionaryVector(t,_,x,f,d??P)??this.decodePlainStringVector(t,k,D,x,d??P)}static decodeFsstDictionaryVector(t,r,l,h,d,f,x){return r?new Yd(t,l,h,d,f,r,x):null}static decodeDictionaryVector(t,r,l,h,d){return r?d?new g7(t,l,h,r,d):new g7(t,l,h,r):null}static decodePlainStringVector(t,r,l,h,d){if(!r||!l)return null;if(h)return d?new g7(t,h,r,l,d):new g7(t,h,r,l);if(d&&d.size()!==r.length-1){let f=new Int32Array(d.size()),x=0;for(let _=0;_<d.size();_++)f[_]=d.get(_)?x++:0;return new g7(t,f,r,l,d)}return d?new Wd(t,r,l,d):new Wd(t,r,l)}static decodeSharedDictionary(t,r,l,h,d){let f=null,x=null,_=null,b=null,z=!1;for(;!z;){let N=l6.decode(t,r);switch(N.physicalStreamType){case Qt.LENGTH:F6.DICTIONARY===N.logicalStreamType.lengthType?f=$2.decodeLengthStreamToOffsetBuffer(t,r,N):_=$2.decodeLengthStreamToOffsetBuffer(t,r,N);break;case Qt.DATA:A3.SINGLE===N.logicalStreamType.dictionaryType||A3.SHARED===N.logicalStreamType.dictionaryType?(x=t.subarray(r.get(),r.get()+N.byteLength),z=!0):b=t.subarray(r.get(),r.get()+N.byteLength),r.add(N.byteLength)}}let P=l.complexType.children,k=[],D=0;for(let N of P){let U=St(t,r,1)[0];if(U==0)continue;let $=`${l.name}${N.name===Ci.ROOT_COLUMN_NAME?"":Ci.NESTED_COLUMN_SEPARATOR+N.name}`;if(d&&!d.has($)){VM(U,t,r);continue}if(U!==2||N.type!=="scalarField"||N.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");let J=l6.decode(t,r),L1=hi(t,J.numValues,r),Q=l6.decode(t,r),n1=(Q instanceof ci?Q.numRleValues:Q.numValues)!==h?$2.decodeNullableIntStream(t,r,Q,!1,new B3(L1,J.numValues)):$2.decodeIntStream(t,r,Q,!1);k[D++]=b?new Yd($,n1,f,x,_,b,new B3(L1,J.numValues)):new g7($,n1,f,x,new B3(L1,J.numValues))}return k}}function UM(o,t,r,l,h,d){return r.type==="scalarType"?(function(f,x,_,b,z,P){let k=null,D=0;if(f===0)return null;if(P.nullable){let U=l6.decode(x,_);D=U.numValues;let $=_.get(),J=hi(x,D,_);_.set($+U.byteLength),k=new B3(J,U.numValues)}let N=k??b;switch(z.physicalType){case 4:case 3:return(function(U,$,J,L1,Q){let n1=l6.decode(U,$),f1=$2.getVectorType(n1,Q,U,$),_1=L1.physicalType===3;if(f1===Bt.FLAT){let P1=di(Q)?$2.decodeNullableIntStream(U,$,n1,_1,Q):$2.decodeIntStream(U,$,n1,_1);return new Qs(J.name,P1,Q)}if(f1===Bt.SEQUENCE){let P1=$2.decodeSequenceIntStream(U,$,n1);return new el(J.name,P1[0],P1[1],n1.numRleValues)}{let P1=$2.decodeConstIntStream(U,$,n1,_1);return new il(J.name,P1,Q)}})(x,_,P,z,N);case 9:return Ci.decode(P.name,x,_,P.nullable?f-1:f,k);case 0:return(function(U,$,J,L1,Q){let n1=l6.decode(U,$),f1=n1.numValues,_1=$.get(),P1=di(Q)?(function(j1,J1,u2,r2){let n2=$d(j1,Math.ceil(J1/8),u2),V1=new B3(n2,J1),I2=r2.size(),z2=new B3(new Uint8Array(I2),I2),E2=0;for(let x2=0;x2<r2.size();x2++){let n5=!!r2.get(x2)&&V1.get(E2++);z2.set(x2,n5)}return z2.getBuffer()})(U,f1,$,Q):hi(U,f1,$);$.set(_1+n1.byteLength);let $1=new B3(P1,f1);return new OM(J.name,$1,Q)})(x,_,P,0,N);case 6:case 5:return(function(U,$,J,L1,Q){let n1=l6.decode(U,$),f1=$2.getVectorType(n1,L1,U,$),_1=Q.physicalType===5;if(f1===Bt.FLAT){let P1=di(L1)?$2.decodeNullableLongStream(U,$,n1,_1,L1):$2.decodeLongStream(U,$,n1,_1);return new Nd(J.name,P1,L1)}if(f1===Bt.SEQUENCE){let P1=$2.decodeSequenceLongStream(U,$,n1);return new Vd(J.name,P1[0],P1[1],n1.numRleValues)}{let P1=$2.decodeConstLongStream(U,$,n1,_1);return new Hd(J.name,P1,L1)}})(x,_,P,N,z);case 7:return(function(U,$,J,L1){let Q=l6.decode(U,$),n1=di(L1)?(function(f1,_1,P1,$1){let j1=_1.get(),J1=j1+$1*Float32Array.BYTES_PER_ELEMENT,u2=new Uint8Array(f1.subarray(j1,J1)).buffer,r2=new Float32Array(u2);_1.set(J1);let n2=P1.size(),V1=new Float32Array(n2),I2=0;for(let z2=0;z2<n2;z2++)V1[z2]=P1.get(z2)?r2[I2++]:0;return V1})(U,$,L1,Q.numValues):(function(f1,_1,P1){let $1=_1.get(),j1=$1+P1*Float32Array.BYTES_PER_ELEMENT,J1=new Uint8Array(f1.subarray($1,j1)).buffer,u2=new Float32Array(J1);return _1.set(j1),u2})(U,$,Q.numValues);return new NM(J.name,n1,L1)})(x,_,P,N);case 8:return(function(U,$,J,L1){let Q=l6.decode(U,$),n1=di(L1)?(function(f1,_1,P1,$1){let j1=_1.get(),J1=j1+$1*Float64Array.BYTES_PER_ELEMENT,u2=new Uint8Array(f1.subarray(j1,J1)).buffer,r2=new Float64Array(u2);_1.set(J1);let n2=P1.size(),V1=new Float64Array(n2),I2=0;for(let z2=0;z2<n2;z2++)V1[z2]=P1.get(z2)?r2[I2++]:0;return V1})(U,$,L1,Q.numValues):(function(f1,_1,P1){let $1=_1.get(),j1=$1+P1*Float64Array.BYTES_PER_ELEMENT,J1=new Uint8Array(f1.subarray($1,j1)).buffer,u2=new Float64Array(J1);return _1.set(j1),u2})(U,$,Q.numValues);return new tl(J.name,n1,L1)})(x,_,P,N);default:throw new Error(`The specified data type for the field is currently not supported: ${z}`)}})(l,o,t,h,r.scalarType,r):l!=1?null:Ci.decodeSharedDictionary(o,t,r,h,d)}function di(o){return o instanceof B3}class Jn{static decodeColumnType(t){switch(t){case 0:case 1:case 2:case 3:{let r={};r.nullable=!!(1&t),r.columnScope=0;let l={};return l.physicalType=t>1?6:4,l.type="physicalType",r.scalarType=l,r.type="scalarType",r}case 4:{let r={nullable:!1,columnScope:0},l={type:"physicalType",physicalType:0};return r.type="complexType",r.complexType=l,r}case 30:{let r={nullable:!1,columnScope:0},l={type:"physicalType",physicalType:1};return r.type="complexType",r.complexType=l,r}default:return this.mapScalarType(t)}}static columnTypeHasName(t){return t>=10}static columnTypeHasChildren(t){return t===30}static hasStreamCount(t){if(t.name==="id")return!1;if(t.type==="scalarType"){let r=t.scalarType;if(r.type==="physicalType")switch(r.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}else if(r.type==="logicalType")return!1}else if(t.type==="complexType"){let r=t.complexType;if(r.type==="physicalType")switch(r.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}static mapScalarType(t){let r=null;switch(t){case 10:case 11:r=0;break;case 12:case 13:r=1;break;case 14:case 15:r=2;break;case 16:case 17:r=3;break;case 18:case 19:r=4;break;case 20:case 21:r=5;break;case 22:case 23:r=6;break;case 24:case 25:r=7;break;case 26:case 27:r=8;break;case 28:case 29:r=9;break;default:return null}let l={};l.nullable=!!(1&t),l.columnScope=0;let h={type:"physicalType"};return h.physicalType=r,l.type="scalarType",l.scalarType=h,l}}let jM=new TextDecoder;function Xd(o,t){let r=St(o,t,1)[0];if(r===0)return"";let l=t.get(),h=o.subarray(l,l+r);return t.add(r),jM.decode(h)}function Kd(o,t){let r=St(o,t,1)[0]>>>0,l=!!(4&r),h=!!(2&r),d=St(o,t,1)[0]>>>0,f={};if(1&r&&(f.nullable=!0),h){let x={};if(l?(x.type="logicalType",x.logicalType=d):(x.type="physicalType",x.physicalType=d),8&r){let _=St(o,t,1)[0]>>>0;x.children=new Array(_);for(let b=0;b<_;b++)x.children[b]=Kd(o,t)}f.type="complexField",f.complexField=x}else{let x={};l?(x.type="logicalType",x.logicalType=d):(x.type="physicalType",x.physicalType=d),f.type="scalarField",f.scalarField=x}return f}function qM(o,t){let r=St(o,t,1)[0]>>>0,l=Jn.decodeColumnType(r);if(!l)throw new Error(`Unsupported column type code: ${r}`);if(Jn.columnTypeHasName(r)?l.name=Xd(o,t):r>=0&&r<=3?l.name="id":r===4&&(l.name="geometry"),Jn.columnTypeHasChildren(r)){let h=St(o,t,1)[0]>>>0,d=l.complexType;d.children=new Array(h);for(let f=0;f<h;f++)d.children[f]=Kd(o,t)}return l}function HM(o,t){let r={featureTables:[]},l={};l.name=Xd(o,t);let h=St(o,t,1)[0]>>>0,d=St(o,t,1)[0]>>>0;l.columns=new Array(d);for(let f=0;f<d;f++)l.columns[f]=qM(o,t);return r.featureTables.push(l),[r,h]}function $M(o,t,r,l,h,d,f=!1){let x=t.scalarType.physicalType,_=$2.getVectorType(h,d,o,r);if(x===4)switch(_){case Bt.FLAT:{let b=$2.decodeIntStream(o,r,h,!1);return new Qs(l,b,d)}case Bt.SEQUENCE:{let b=$2.decodeSequenceIntStream(o,r,h);return new el(l,b[0],b[1],h.numRleValues)}case Bt.CONST:{let b=$2.decodeConstIntStream(o,r,h,!1);return new il(l,b,d)}}else switch(_){case Bt.FLAT:{if(f){let z=$2.decodeLongFloat64Stream(o,r,h,!1);return new tl(l,z,d)}let b=$2.decodeLongStream(o,r,h,!1);return new Nd(l,b,d)}case Bt.SEQUENCE:{let b=$2.decodeSequenceLongStream(o,r,h);return new Vd(l,b[0],b[1],h.numRleValues)}case Bt.CONST:{let b=$2.decodeConstLongStream(o,r,h,!1);return new Hd(l,b,d)}}throw new Error("Vector type not supported for id column.")}class WM{constructor(t,r){var l;switch(this._featureData=t,this.properties=this._featureData.properties||{},(l=this._featureData.geometry)===null||l===void 0?void 0:l.type){case kt.POINT:case kt.MULTIPOINT:this.type=1;break;case kt.LINESTRING:case kt.MULTILINESTRING:this.type=2;break;case kt.POLYGON:case kt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=r,this.id=Number(this._featureData.id)}projectPoint(t,r,l,h){return[360*(t.x+r)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+l)/h)*Math.PI))-90]}projectLine(t,r,l,h){return t.map((d=>this.projectPoint(d,r,l,h)))}toGeoJSON(t,r,l){let h=this.extent*Math.pow(2,l),d=this.extent*t,f=this.extent*r,x=this.loadGeometry(),_;switch(this.type){case 1:{let z=[];for(let k of x)z.push(k[0]);let P=this.projectLine(z,d,f,h);_=z.length===1?{type:"Point",coordinates:P[0]}:{type:"MultiPoint",coordinates:P};break}case 2:{let z=x.map((P=>this.projectLine(P,d,f,h)));_=z.length===1?{type:"LineString",coordinates:z[0]}:{type:"MultiLineString",coordinates:z};break}case 3:{let z=se(x),P=[];for(let k of z)P.push(k.map((D=>this.projectLine(D,d,f,h))));_=P.length===1?{type:"Polygon",coordinates:P[0]}:{type:"MultiPolygon",coordinates:P};break}default:throw new Error(`unknown feature type: ${this.type}`)}let b={type:"Feature",geometry:_,properties:this.properties};return this.id!=null&&(b.id=this.id),b}loadGeometry(){let t=[];for(let r of this._featureData.geometry.coordinates){let l=[];for(let h of r)l.push(new y(h.x,h.y));t.push(l)}return t}bbox(){return[0,0,0,0]}}class YM{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new WM(this.features[t],this.extent)}}class Jd{constructor(t){this.layers={};let r=(function(l,h,d=!0){let f=new AM(0),x=[];for(;f.get()<l.length;){let _=St(l,f,1)[0]>>>0,b=f.get()+_;if(b>l.length)throw new Error(`Block overruns tile: ${b} > ${l.length}`);if(St(l,f,1)[0]>>>0!=1){f.set(b);continue}let z=HM(l,f),P=z[1],k=z[0].featureTables[0],D=null,N=null,U=[],$=0;for(let L1 of k.columns){let Q=L1.name;if(Q==="id"){let n1=null;if(L1.nullable){let _1=l6.decode(l,f),P1=f.get(),$1=hi(l,_1.numValues,f);f.set(P1+_1.byteLength),n1=new B3($1,_1.numValues)}let f1=l6.decode(l,f);$=f1.getDecompressedCount(),D=$M(l,L1,f,Q,f1,n1??$,d)}else if(Q==="geometry"){let n1=St(l,f,1)[0];if($===0){let f1=f.get();$=l6.decode(l,f).getDecompressedCount(),f.set(f1)}N=FM(l,n1,f,$,h)}else{let n1=Jn.hasStreamCount(L1)?St(l,f,1)[0]:1;if(n1===0&&L1.type==="scalarType")continue;let f1=UM(l,f,L1,n1,$,void 0);f1&&(Array.isArray(f1)?U.push(...f1):U.push(f1))}}let J=new PM(k.name,N,D,U,P);x.push(J),f.set(b)}return x})(new Uint8Array(t));this.layers=r.reduce(((l,h)=>Object.assign(Object.assign({},l),{[h.name]:new YM(h)})),{})}}class Qd{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new xe(Y1,16,0),this.grid3D=new xe(Y1,16,0),this.featureIndexArray=new e1,this.promoteId=r}insert(t,r,l,h,d,f){let x=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(l,h,d);let _=f?this.grid3D:this.grid;for(let b=0;b<r.length;b++){let z=r[b],P=[1/0,1/0,-1/0,-1/0];for(let k=0;k<z.length;k++){let D=z[k];P[0]=Math.min(P[0],D.x),P[1]=Math.min(P[1],D.y),P[2]=Math.max(P[2],D.x),P[3]=Math.max(P[3],D.y)}P[0]<Y1&&P[1]<Y1&&P[2]>=0&&P[3]>=0&&_.insert(x,P[0],P[1],P[2],P[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new YC(new Gs(this.rawTileData)).layers:new Jd(this.rawTileData).layers,this.sourceLayerCoder=new Id(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,l,h){this.loadVTLayers();let d=t.params,f=Y1/t.tileSize/t.scale,x=he(d.filter,d.globalState),_=t.queryGeometry,b=t.queryPadding*f,z=Pe.fromPoints(_),P=this.grid.query(z.minX-b,z.minY-b,z.maxX+b,z.maxY+b),k=Pe.fromPoints(t.cameraQueryGeometry).expandBy(b),D=this.grid3D.query(k.minX,k.minY,k.maxX,k.maxY,(($,J,L1,Q)=>(function(n1,f1,_1,P1,$1){for(let J1 of n1)if(f1<=J1.x&&_1<=J1.y&&P1>=J1.x&&$1>=J1.y)return!0;let j1=[new y(f1,_1),new y(f1,$1),new y(P1,$1),new y(P1,_1)];if(n1.length>2){for(let J1 of j1)if(r7(n1,J1))return!0}for(let J1=0;J1<n1.length-1;J1++)if(s_(n1[J1],n1[J1+1],j1))return!0;return!1})(t.cameraQueryGeometry,$-b,J-b,L1+b,Q+b)));for(let $ of D)P.push($);P.sort(XM);let N={},U;for(let $=0;$<P.length;$++){let J=P[$];if(J===U)continue;U=J;let L1=this.featureIndexArray.get(J),Q=null;this.loadMatchingFeature(N,L1.bucketIndex,L1.sourceLayerIndex,L1.featureIndex,x,d.layers,d.availableImages,r,l,h,((n1,f1,_1)=>(Q||(Q=h8(n1)),f1.queryIntersectsFeature({queryGeometry:_,feature:n1,featureState:_1,geometry:Q,zoom:this.z,transform:t.transform,pixelsToTileUnits:f,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation}))))}return N}loadMatchingFeature(t,r,l,h,d,f,x,_,b,z,P){let k=this.bucketLayerIDs[r];if(f&&!k.some(($=>f.has($))))return;let D=this.sourceLayerCoder.decode(l),N=this.vtLayers[D].feature(h);if(d.needGeometry){let $=C8(N,!0);if(!d.filter(new A5(this.tileID.overscaledZ),$,this.tileID.canonical))return}else if(!d.filter(new A5(this.tileID.overscaledZ),N))return;let U=this.getId(N,D);for(let $=0;$<k.length;$++){let J=k[$];if(f&&!f.has(J))continue;let L1=_[J];if(!L1)continue;let Q={};U&&z&&(Q=z.getState(L1.sourceLayer||"_geojsonTileLayer",U));let n1=N2({},b[J]);n1.paint=tp(n1.paint,L1.paint,N,Q,x),n1.layout=tp(n1.layout,L1.layout,N,Q,x);let f1=!P||P(N,L1,Q);if(!f1)continue;let _1=new Pd(N,this.z,this.x,this.y,U);_1.layer=n1;let P1=t[J];P1===void 0&&(P1=t[J]=[]),P1.push({featureIndex:h,feature:_1,intersectionZ:f1})}}lookupSymbolFeatures(t,r,l,h,d,f,x,_){let b={};this.loadVTLayers();let z=he(d.filterSpec,d.globalState);for(let P of t)this.loadMatchingFeature(b,l,h,P,z,f,x,_,r);return b}hasLayer(t){for(let r of this.bucketLayerIDs)for(let l of r)if(t===l)return!0;return!1}getId(t,r){var l;let h=t.id;return this.promoteId&&(h=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof h=="boolean"&&(h=Number(h)),h===void 0&&(!((l=t.properties)===null||l===void 0)&&l.cluster)&&this.promoteId&&(h=Number(t.properties.cluster_id))),h}}function tp(o,t,r,l,h){return L5(o,((d,f)=>{let x=t instanceof _e?t.get(f):null;return x&&x.evaluate?x.evaluate(r,l,h):x}))}function XM(o,t){return t-o}function ep(o,t,r,l,h){let d=[];for(let f=0;f<o.length;f++){let x=o[f],_;for(let b=0;b<x.length-1;b++){let z=x[b],P=x[b+1];z.x<t&&P.x<t||(z.x<t?z=new y(t,z.y+(t-z.x)/(P.x-z.x)*(P.y-z.y))._round():P.x<t&&(P=new y(t,z.y+(t-z.x)/(P.x-z.x)*(P.y-z.y))._round()),z.y<r&&P.y<r||(z.y<r?z=new y(z.x+(r-z.y)/(P.y-z.y)*(P.x-z.x),r)._round():P.y<r&&(P=new y(z.x+(r-z.y)/(P.y-z.y)*(P.x-z.x),r)._round()),z.x>=l&&P.x>=l||(z.x>=l?z=new y(l,z.y+(l-z.x)/(P.x-z.x)*(P.y-z.y))._round():P.x>=l&&(P=new y(l,z.y+(l-z.x)/(P.x-z.x)*(P.y-z.y))._round()),z.y>=h&&P.y>=h||(z.y>=h?z=new y(z.x+(h-z.y)/(P.y-z.y)*(P.x-z.x),h)._round():P.y>=h&&(P=new y(z.x+(h-z.y)/(P.y-z.y)*(P.x-z.x),h)._round()),_&&z.equals(_[_.length-1])||(_=[z],d.push(_)),_.push(P)))))}}return d}function ip(o,t,r,l,h){switch(t){case 1:return(function(d,f,x,_){let b=[];for(let z of d)for(let P of z){let k=_===0?P.x:P.y;k>=f&&k<=x&&b.push([P])}return b})(o,r,l,h);case 2:return rp(o,r,l,h,!1);case 3:return rp(o,r,l,h,!0)}return[]}function KM(o,t,r,l,h){let d=l===0?JM:QM,f=[],x=[];for(let z=0;z<o.length-1;z++){let P=o[z],k=o[z+1],D=l===0?P.x:P.y,N=l===0?k.x:k.y,U=!1;D<t?N>t&&f.push(d(P,k,t)):D>r?N<r&&f.push(d(P,k,r)):f.push(P),N<t&&D>=t&&(f.push(d(P,k,t)),U=!0),N>r&&D<=r&&(f.push(d(P,k,r)),U=!0),!h&&U&&(x.push(f),f=[])}let _=o.length-1,b=l===0?o[_].x:o[_].y;return b>=t&&b<=r&&f.push(o[_]),h&&f.length>0&&!f[0].equals(f[f.length-1])&&f.push(new y(f[0].x,f[0].y)),f.length>0&&x.push(f),x}function rp(o,t,r,l,h){let d=[];for(let f of o){let x=KM(f,t,r,l,h);x.length>0&&d.push(...x)}return d}function JM(o,t,r){return new y(r,o.y+(r-o.x)/(t.x-o.x)*(t.y-o.y))}function QM(o,t,r){return new y(o.x+(r-o.y)/(t.y-o.y)*(t.x-o.x),r)}C2("FeatureIndex",Qd,{omit:["rawTileData","sourceLayerCoder"]});class P9 extends y{constructor(t,r,l,h){super(t,r),this.angle=l,h!==void 0&&(this.segment=h)}clone(){return new P9(this.x,this.y,this.angle,this.segment)}}function np(o,t,r,l,h){if(t.segment===void 0||r===0)return!0;let d=t,f=t.segment+1,x=0;for(;x>-r/2;){if(f--,f<0)return!1;x-=o[f].dist(d),d=o[f]}x+=o[f].dist(o[f+1]),f++;let _=[],b=0;for(;x<r/2;){let z=o[f],P=o[f+1];if(!P)return!1;let k=o[f-1].angleTo(z)-z.angleTo(P);for(k=Math.abs((k+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:x,angleDelta:k}),b+=k;x-_[0].distance>l;)b-=_.shift().angleDelta;if(b>h)return!1;f++,x+=z.dist(P)}return!0}function op(o){let t=0;for(let r=0;r<o.length-1;r++)t+=o[r].dist(o[r+1]);return t}function ap(o,t,r){return o?.6*t*r:0}function sp(o,t){return Math.max(o?o.right-o.left:0,t?t.right-t.left:0)}function tb(o,t,r,l,h,d){let f=ap(r,h,d),x=sp(r,l)*d,_=0,b=op(o)/2;for(let z=0;z<o.length-1;z++){let P=o[z],k=o[z+1],D=P.dist(k);if(_+D>b){let N=(b-_)/D,U=H6.number(P.x,k.x,N),$=H6.number(P.y,k.y,N),J=new P9(U,$,k.angleTo(P),z);return J._round(),!f||np(o,J,x,f,t)?J:void 0}_+=D}}function eb(o,t,r,l,h,d,f,x,_){let b=ap(l,d,f),z=sp(l,h),P=z*f,k=o[0].x===0||o[0].x===_||o[0].y===0||o[0].y===_;return t-P<t/4&&(t=P+t/4),lp(o,k?t/2*x%t:(z/2+2*d)*f*x%t,t,b,r,P,k,!1,_)}function lp(o,t,r,l,h,d,f,x,_){let b=d/2,z=op(o),P=0,k=t-r,D=[];for(let N=0;N<o.length-1;N++){let U=o[N],$=o[N+1],J=U.dist($),L1=$.angleTo(U);for(;k+r<P+J;){k+=r;let Q=(k-P)/J,n1=H6.number(U.x,$.x,Q),f1=H6.number(U.y,$.y,Q);if(n1>=0&&n1<_&&f1>=0&&f1<_&&k-b>=0&&k+b<=z){let _1=new P9(n1,f1,L1,N);_1._round(),l&&!np(o,_1,d,l,h)||D.push(_1)}}P+=J}return x||D.length||f||(D=lp(o,P/2,r,l,h,d,f,!0,_)),D}function cp(o,t,r,l){let h=[],d=o.image,f=d.pixelRatio,x=d.paddedRect.w-2,_=d.paddedRect.h-2,b={x1:o.left,y1:o.top,x2:o.right,y2:o.bottom},z=d.stretchX||[[0,x]],P=d.stretchY||[[0,_]],k=(V1,I2)=>V1+I2[1]-I2[0],D=z.reduce(k,0),N=P.reduce(k,0),U=x-D,$=_-N,J=0,L1=D,Q=0,n1=N,f1=0,_1=U,P1=0,$1=$;if(d.content&&l){let V1=d.content,I2=V1[2]-V1[0],z2=V1[3]-V1[1];(d.textFitWidth||d.textFitHeight)&&(b=pd(o)),J=Qn(z,0,V1[0]),Q=Qn(P,0,V1[1]),L1=Qn(z,V1[0],V1[2]),n1=Qn(P,V1[1],V1[3]),f1=V1[0]-J,P1=V1[1]-Q,_1=I2-L1,$1=z2-n1}let j1=b.x1,J1=b.y1,u2=b.x2-j1,r2=b.y2-J1,n2=(V1,I2,z2,E2)=>{let x2=to(V1.stretch-J,L1,u2,j1),n5=eo(V1.fixed-f1,_1,V1.stretch,D),Lt=to(I2.stretch-Q,n1,r2,J1),Tt=eo(I2.fixed-P1,$1,I2.stretch,N),e6=to(z2.stretch-J,L1,u2,j1),Q6=eo(z2.fixed-f1,_1,z2.stretch,D),T6=to(E2.stretch-Q,n1,r2,J1),jt=eo(E2.fixed-P1,$1,E2.stretch,N),at=new y(x2,Lt),Rt=new y(e6,Lt),qt=new y(e6,T6),Ht=new y(x2,T6),m6=new y(n5/f,Tt/f),t3=new y(Q6/f,jt/f),Dt=t*Math.PI/180;if(Dt){let Ft=Math.sin(Dt),Ot=Math.cos(Dt),_t=[Ot,-Ft,Ft,Ot];at._matMult(_t),Rt._matMult(_t),Ht._matMult(_t),qt._matMult(_t)}let z6=V1.stretch+V1.fixed,zt=I2.stretch+I2.fixed;return{tl:at,tr:Rt,bl:Ht,br:qt,tex:{x:d.paddedRect.x+1+z6,y:d.paddedRect.y+1+zt,w:z2.stretch+z2.fixed-z6,h:E2.stretch+E2.fixed-zt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:m6,pixelOffsetBR:t3,minFontScaleX:_1/f/u2,minFontScaleY:$1/f/r2,isSDF:r}};if(l&&(d.stretchX||d.stretchY)){let V1=Lp(z,U,D),I2=Lp(P,$,N);for(let z2=0;z2<V1.length-1;z2++){let E2=V1[z2],x2=V1[z2+1];for(let n5=0;n5<I2.length-1;n5++)h.push(n2(E2,I2[n5],x2,I2[n5+1]))}}else h.push(n2({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:x+1},{fixed:0,stretch:_+1}));return h}function Qn(o,t,r){let l=0;for(let h of o)l+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]));return l}function Lp(o,t,r){let l=[{fixed:-1,stretch:0}];for(let[h,d]of o){let f=l[l.length-1];l.push({fixed:h-f.stretch,stretch:f.stretch}),l.push({fixed:h-f.stretch,stretch:f.stretch+(d-h)})}return l.push({fixed:t+1,stretch:r}),l}function to(o,t,r,l){return o/t*r+l}function eo(o,t,r,l){return o-t*r/l}C2("Anchor",P9);class io{constructor(t,r,l,h,d,f,x,_,b,z){var P;if(this.boxStartIndex=t.length,b){let k=f.top,D=f.bottom,N=f.collisionPadding;N&&(k-=N[1],D+=N[3]);let U=D-k;U>0&&(U=Math.max(10,U),this.circleDiameter=U)}else{let k=!((P=f.image)===null||P===void 0)&&P.content&&(f.image.textFitWidth||f.image.textFitHeight)?pd(f):{x1:f.left,y1:f.top,x2:f.right,y2:f.bottom};k.y1=k.y1*x-_[0],k.y2=k.y2*x+_[2],k.x1=k.x1*x-_[3],k.x2=k.x2*x+_[1];let D=f.collisionPadding;if(D&&(k.x1-=D[0]*x,k.y1-=D[1]*x,k.x2+=D[2]*x,k.y2+=D[3]*x),z){let N=new y(k.x1,k.y1),U=new y(k.x2,k.y1),$=new y(k.x1,k.y2),J=new y(k.x2,k.y2),L1=z*Math.PI/180;N._rotate(L1),U._rotate(L1),$._rotate(L1),J._rotate(L1),k.x1=Math.min(N.x,U.x,$.x,J.x),k.x2=Math.max(N.x,U.x,$.x,J.x),k.y1=Math.min(N.y,U.y,$.y,J.y),k.y2=Math.max(N.y,U.y,$.y,J.y)}t.emplaceBack(r.x,r.y,k.x1,k.y1,k.x2,k.y2,l,h,d)}this.boxEndIndex=t.length}}class ib{constructor(t=[],r=(l,h)=>l<h?-1:l>h?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let l=(this.length>>1)-1;l>=0;l--)this._down(l)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:l}=this,h=r[t];for(;t>0;){let d=t-1>>1,f=r[d];if(l(h,f)>=0)break;r[t]=f,t=d}r[t]=h}_down(t){let{data:r,compare:l}=this,h=this.length>>1,d=r[t];for(;t<h;){let f=1+(t<<1),x=f+1;if(x<this.length&&l(r[x],r[f])<0&&(f=x),l(r[f],d)>=0)break;r[t]=r[f],t=f}r[t]=d}}function rb(o,t=1,r=!1){let l=Pe.fromPoints(o[0]),h=Math.min(l.width(),l.height()),d=h/2,f=new ib([],nb),{minX:x,minY:_,maxX:b,maxY:z}=l;if(h===0)return new y(x,_);for(let D=x;D<b;D+=h)for(let N=_;N<z;N+=h)f.push(new m7(D+d,N+d,d,o));let P=(function(D){let N=0,U=0,$=0,J=D[0];for(let L1=0,Q=J.length,n1=Q-1;L1<Q;n1=L1++){let f1=J[L1],_1=J[n1],P1=f1.x*_1.y-_1.x*f1.y;U+=(f1.x+_1.x)*P1,$+=(f1.y+_1.y)*P1,N+=3*P1}return new m7(U/N,$/N,0,D)})(o),k=f.length;for(;f.length;){let D=f.pop();(D.d>P.d||!P.d)&&(P=D,r&&console.log("found best %d after %d probes",Math.round(1e4*D.d)/1e4,k)),D.max-P.d<=t||(d=D.h/2,f.push(new m7(D.p.x-d,D.p.y-d,d,o)),f.push(new m7(D.p.x+d,D.p.y-d,d,o)),f.push(new m7(D.p.x-d,D.p.y+d,d,o)),f.push(new m7(D.p.x+d,D.p.y+d,d,o)),k+=4)}return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${P.d}`)),P.p}function nb(o,t){return t.max-o.max}function m7(o,t,r,l){this.p=new y(o,t),this.h=r,this.d=(function(h,d){let f=!1,x=1/0;for(let _=0;_<d.length;_++){let b=d[_];for(let z=0,P=b.length,k=P-1;z<P;k=z++){let D=b[z],N=b[k];D.y>h.y!=N.y>h.y&&h.x<(N.x-D.x)*(h.y-D.y)/(N.y-D.y)+D.x&&(f=!f),x=Math.min(x,SC(h,D,N))}}return(f?1:-1)*Math.sqrt(x)})(this.p,l),this.max=this.d+this.h*Math.SQRT2}var t6;L.aJ=void 0,(t6=L.aJ||(L.aJ={}))[t6.center=1]="center",t6[t6.left=2]="left",t6[t6.right=3]="right",t6[t6.top=4]="top",t6[t6.bottom=5]="bottom",t6[t6["top-left"]=6]="top-left",t6[t6["top-right"]=7]="top-right",t6[t6["bottom-left"]=8]="bottom-left",t6[t6["bottom-right"]=9]="bottom-right";let ul=Number.POSITIVE_INFINITY;function up(o,t){return t[1]!==ul?(function(r,l,h){let d=0,f=0;switch(l=Math.abs(l),h=Math.abs(h),r){case"top-right":case"top-left":case"top":f=h-7;break;case"bottom-right":case"bottom-left":case"bottom":f=7-h}switch(r){case"top-right":case"bottom-right":case"right":d=-l;break;case"top-left":case"bottom-left":case"left":d=l}return[d,f]})(o,t[0],t[1]):(function(r,l){let h=0,d=0;l<0&&(l=0);let f=l/Math.SQRT2;switch(r){case"top-right":case"top-left":d=f-7;break;case"bottom-right":case"bottom-left":d=7-f;break;case"bottom":d=7-l;break;case"top":d=l-7}switch(r){case"top-right":case"bottom-right":h=-f;break;case"top-left":case"bottom-left":h=f;break;case"left":h=l;break;case"right":h=-l}return[h,d]})(o,t[0])}function hp(o,t,r){var l;let h=o.layout,d=(l=h.get("text-variable-anchor-offset"))===null||l===void 0?void 0:l.evaluate(t,{},r);if(d){let x=d.values,_=[];for(let b=0;b<x.length;b+=2){let z=_[b]=x[b],P=x[b+1].map((k=>k*At));z.startsWith("top")?P[1]-=7:z.startsWith("bottom")&&(P[1]+=7),_[b+1]=P}return new o6(_)}let f=h.get("text-variable-anchor");if(f){let x;x=o._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(t,{},r)*At,ul]:h.get("text-offset").evaluate(t,{},r).map((b=>b*At));let _=[];for(let b of f)_.push(b,up(b,x));return new o6(_)}return null}function hl(o){switch(o){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ob(o,t,r,l,h,d,f,x,_,b,z,P){let k=d.textMaxSize.evaluate(t,{});k===void 0&&(k=f);let D=o.layers[0].layout,N=D.get("icon-offset").evaluate(t,{},z),U=dp(r.horizontal),$=f/24,J=o.tilePixelRatio*$,L1=o.tilePixelRatio*k/24,Q=o.tilePixelRatio*x,n1=o.tilePixelRatio*D.get("symbol-spacing"),f1=D.get("text-padding")*o.tilePixelRatio,_1=(function(z2,E2,x2,n5=1){let Lt=z2.get("icon-padding").evaluate(E2,{},x2),Tt=Lt&&Lt.values;return[Tt[0]*n5,Tt[1]*n5,Tt[2]*n5,Tt[3]*n5]})(D,t,z,o.tilePixelRatio),P1=D.get("text-max-angle")/180*Math.PI,$1=D.get("text-rotation-alignment")!=="viewport"&&D.get("symbol-placement")!=="point",j1=D.get("icon-rotation-alignment")==="map"&&D.get("symbol-placement")!=="point",J1=D.get("symbol-placement"),u2=n1/2,r2=D.get("icon-text-fit"),n2;l&&r2!=="none"&&(o.allowVerticalPlacement&&r.vertical&&(n2=fd(l,r.vertical,r2,D.get("icon-text-fit-padding"),N,$)),U&&(l=fd(l,U,r2,D.get("icon-text-fit-padding"),N,$)));let V1=z?P.line.getGranularityForZoomLevel(z.z):1,I2=(z2,E2)=>{E2.x<0||E2.x>=Y1||E2.y<0||E2.y>=Y1||(function(x2,n5,Lt,Tt,e6,Q6,T6,jt,at,Rt,qt,Ht,m6,t3,Dt,z6,zt,Ft,Ot,_t,W5,k3,x7,R3,lb){let y7=x2.addToLineVertexArray(n5,Lt),Re,v7,_7,M7,mp=0,xp=0,yp=0,vp=0,yl=-1,vl=-1,V8={},_p=Jt("");if(x2.allowVerticalPlacement&&Tt.vertical){let c6=jt.layout.get("text-rotate").evaluate(W5,{},R3)+90;_7=new io(at,n5,Rt,qt,Ht,Tt.vertical,m6,t3,Dt,c6),T6&&(M7=new io(at,n5,Rt,qt,Ht,T6,zt,Ft,Dt,c6))}if(e6){let c6=jt.layout.get("icon-rotate").evaluate(W5,{}),e3=jt.layout.get("icon-text-fit")!=="none",De=cp(e6,c6,x7,e3),F3=T6?cp(T6,c6,x7,e3):void 0;v7=new io(at,n5,Rt,qt,Ht,e6,zt,Ft,!1,c6),mp=4*De.length;let Fe=x2.iconSizeData,d8=null;Fe.kind==="source"?(d8=[O8*jt.layout.get("icon-size").evaluate(W5,{})],d8[0]>Z9&&U2(`${x2.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Fe.kind==="composite"&&(d8=[O8*k3.compositeIconSizes[0].evaluate(W5,{},R3),O8*k3.compositeIconSizes[1].evaluate(W5,{},R3)],(d8[0]>Z9||d8[1]>Z9)&&U2(`${x2.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),x2.addSymbols(x2.icon,De,d8,_t,Ot,W5,L.at.none,n5,y7.lineStartIndex,y7.lineLength,-1,R3),yl=x2.icon.placedSymbolArray.length-1,F3&&(xp=4*F3.length,x2.addSymbols(x2.icon,F3,d8,_t,Ot,W5,L.at.vertical,n5,y7.lineStartIndex,y7.lineLength,-1,R3),vl=x2.icon.placedSymbolArray.length-1)}let Mp=Object.keys(Tt.horizontal);for(let c6 of Mp){let e3=Tt.horizontal[c6];if(!Re){_p=Jt(e3.text);let F3=jt.layout.get("text-rotate").evaluate(W5,{},R3);Re=new io(at,n5,Rt,qt,Ht,e3,m6,t3,Dt,F3)}let De=e3.positionedLines.length===1;if(yp+=Cp(x2,n5,e3,Q6,jt,Dt,W5,z6,y7,Tt.vertical?L.at.horizontal:L.at.horizontalOnly,De?Mp:[c6],V8,yl,k3,R3),De)break}Tt.vertical&&(vp+=Cp(x2,n5,Tt.vertical,Q6,jt,Dt,W5,z6,y7,L.at.vertical,["vertical"],V8,vl,k3,R3));let cb=Re?Re.boxStartIndex:x2.collisionBoxArray.length,Lb=Re?Re.boxEndIndex:x2.collisionBoxArray.length,ub=_7?_7.boxStartIndex:x2.collisionBoxArray.length,hb=_7?_7.boxEndIndex:x2.collisionBoxArray.length,Cb=v7?v7.boxStartIndex:x2.collisionBoxArray.length,db=v7?v7.boxEndIndex:x2.collisionBoxArray.length,pb=M7?M7.boxStartIndex:x2.collisionBoxArray.length,fb=M7?M7.boxEndIndex:x2.collisionBoxArray.length,D3=-1,no=(c6,e3)=>c6&&c6.circleDiameter?Math.max(c6.circleDiameter,e3):e3;D3=no(Re,D3),D3=no(_7,D3),D3=no(v7,D3),D3=no(M7,D3);let bp=D3>-1?1:0;bp&&(D3*=lb/At),x2.glyphOffsetArray.length>=u7.MAX_GLYPHS&&U2("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),W5.sortKey!==void 0&&x2.addToSortKeyRanges(x2.symbolInstances.length,W5.sortKey);let gb=hp(jt,W5,R3),[mb,xb]=(function(c6,e3){let De=c6.length,F3=e3?.values;if(F3?.length>0)for(let Fe=0;Fe<F3.length;Fe+=2){let d8=F3[Fe+1];c6.emplaceBack(L.aJ[F3[Fe]],d8[0],d8[1])}return[De,c6.length]})(x2.textAnchorOffsets,gb);x2.symbolInstances.emplaceBack(n5.x,n5.y,V8.right>=0?V8.right:-1,V8.center>=0?V8.center:-1,V8.left>=0?V8.left:-1,V8.vertical||-1,yl,vl,_p,cb,Lb,ub,hb,Cb,db,pb,fb,Rt,yp,vp,mp,xp,bp,0,m6,D3,mb,xb)})(o,E2,z2,r,l,h,n2,o.layers[0],o.collisionBoxArray,t.index,t.sourceLayerIndex,o.index,J,[f1,f1,f1,f1],$1,_,Q,_1,j1,N,t,d,b,z,f)};if(J1==="line")for(let z2 of ep(t.geometry,0,0,Y1,Y1)){let E2=Ie(z2,V1),x2=eb(E2,n1,P1,r.vertical||U,l,24,L1,o.overscaling,Y1);for(let n5 of x2)U&&ab(o,U.text,u2,n5)||I2(E2,n5)}else if(J1==="line-center"){for(let z2 of t.geometry)if(z2.length>1){let E2=Ie(z2,V1),x2=tb(E2,P1,r.vertical||U,l,24,L1);x2&&I2(E2,x2)}}else if(t.type==="Polygon")for(let z2 of se(t.geometry,0)){let E2=rb(z2,16);I2(Ie(z2[0],V1,!0),new P9(E2.x,E2.y,0))}else if(t.type==="LineString")for(let z2 of t.geometry){let E2=Ie(z2,V1);I2(E2,new P9(E2[0].x,E2[0].y,0))}else if(t.type==="Point")for(let z2 of t.geometry)for(let E2 of z2)I2([E2],new P9(E2.x,E2.y,0))}function Cp(o,t,r,l,h,d,f,x,_,b,z,P,k,D,N){let U=(function(L1,Q,n1,f1,_1,P1,$1,j1){let J1=f1.layout.get("text-rotate").evaluate(P1,{})*Math.PI/180,u2=[];for(let r2 of Q.positionedLines)for(let n2 of r2.positionedGlyphs){if(!n2.rect)continue;let V1=n2.rect||{},I2=4,z2=!0,E2=1,x2=0,n5=(_1||j1)&&n2.vertical,Lt=n2.metrics.advance*n2.scale/2;if(j1&&Q.verticalizable&&(x2=r2.lineOffset/2-(n2.imageName?-(At-n2.metrics.width*n2.scale)/2:(n2.scale-1)*At)),n2.imageName){let Ft=$1[n2.imageName];z2=Ft.sdf,E2=Ft.pixelRatio,I2=1/E2}let Tt=_1?[n2.x+Lt,n2.y]:[0,0],e6=_1?[0,0]:[n2.x+Lt+n1[0],n2.y+n1[1]-x2],Q6=[0,0];n5&&(Q6=e6,e6=[0,0]);let T6=n2.metrics.isDoubleResolution?2:1,jt=(n2.metrics.left-I2)*n2.scale-Lt+e6[0],at=(-n2.metrics.top-I2)*n2.scale+e6[1],Rt=jt+V1.w/T6*n2.scale/E2,qt=at+V1.h/T6*n2.scale/E2,Ht=new y(jt,at),m6=new y(Rt,at),t3=new y(jt,qt),Dt=new y(Rt,qt);if(n5){let Ft=new y(-Lt,Lt- -17),Ot=-Math.PI/2,_t=12-Lt,W5=new y(22-_t,-(n2.imageName?_t:0)),k3=new y(...Q6);Ht._rotateAround(Ot,Ft)._add(W5)._add(k3),m6._rotateAround(Ot,Ft)._add(W5)._add(k3),t3._rotateAround(Ot,Ft)._add(W5)._add(k3),Dt._rotateAround(Ot,Ft)._add(W5)._add(k3)}if(J1){let Ft=Math.sin(J1),Ot=Math.cos(J1),_t=[Ot,-Ft,Ft,Ot];Ht._matMult(_t),m6._matMult(_t),t3._matMult(_t),Dt._matMult(_t)}let z6=new y(0,0),zt=new y(0,0);u2.push({tl:Ht,tr:m6,bl:t3,br:Dt,tex:V1,writingMode:Q.writingMode,glyphOffset:Tt,sectionIndex:n2.sectionIndex,isSDF:z2,pixelOffsetTL:z6,pixelOffsetBR:zt,minFontScaleX:0,minFontScaleY:0})}return u2})(0,r,x,h,d,f,l,o.allowVerticalPlacement),$=o.textSizeData,J=null;$.kind==="source"?(J=[O8*h.layout.get("text-size").evaluate(f,{})],J[0]>Z9&&U2(`${o.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):$.kind==="composite"&&(J=[O8*D.compositeTextSizes[0].evaluate(f,{},N),O8*D.compositeTextSizes[1].evaluate(f,{},N)],(J[0]>Z9||J[1]>Z9)&&U2(`${o.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),o.addSymbols(o.text,U,J,x,d,f,b,t,_.lineStartIndex,_.lineLength,k,N);for(let L1 of z)P[L1]=o.text.placedSymbolArray.length-1;return 4*U.length}function dp(o){for(let t in o)return o[t];return null}function ab(o,t,r,l){let h=o.compareText;if(t in h){let d=h[t];for(let f=d.length-1;f>=0;f--)if(l.dist(d[f])<r)return!0}else h[t]=[];return h[t].push(l),!1}let pp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Cl{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,l]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let h=l>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);let d=pp[15&l];if(!d)throw new Error("Unrecognized array type.");let[f]=new Uint16Array(t,2,1),[x]=new Uint32Array(t,4,1);return new Cl(x,f,d,t)}constructor(t,r=64,l=Float64Array,h){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=l,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let d=pp.indexOf(this.ArrayType),f=2*t*this.ArrayType.BYTES_PER_ELEMENT,x=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-x%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${l}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+x+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+f+x+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+x+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+d]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){let l=this._pos>>1;return this.ids[l]=l,this.coords[this._pos++]=t,this.coords[this._pos++]=r,l}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return dl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,l,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:d,coords:f,nodeSize:x}=this,_=[0,d.length-1,0],b=[];for(;_.length;){let z=_.pop()||0,P=_.pop()||0,k=_.pop()||0;if(P-k<=x){for(let $=k;$<=P;$++){let J=f[2*$],L1=f[2*$+1];J>=t&&J<=l&&L1>=r&&L1<=h&&b.push(d[$])}continue}let D=k+P>>1,N=f[2*D],U=f[2*D+1];N>=t&&N<=l&&U>=r&&U<=h&&b.push(d[D]),(z===0?t<=N:r<=U)&&(_.push(k),_.push(D-1),_.push(1-z)),(z===0?l>=N:h>=U)&&(_.push(D+1),_.push(P),_.push(1-z))}return b}within(t,r,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:h,coords:d,nodeSize:f}=this,x=[0,h.length-1,0],_=[],b=l*l;for(;x.length;){let z=x.pop()||0,P=x.pop()||0,k=x.pop()||0;if(P-k<=f){for(let $=k;$<=P;$++)gp(d[2*$],d[2*$+1],t,r)<=b&&_.push(h[$]);continue}let D=k+P>>1,N=d[2*D],U=d[2*D+1];gp(N,U,t,r)<=b&&_.push(h[D]),(z===0?t-l<=N:r-l<=U)&&(x.push(k),x.push(D-1),x.push(1-z)),(z===0?t+l>=N:r+l>=U)&&(x.push(D+1),x.push(P),x.push(1-z))}return _}}function dl(o,t,r,l,h,d){if(h-l<=r)return;let f=l+h>>1;fp(o,t,f,l,h,d),dl(o,t,r,l,f-1,1-d),dl(o,t,r,f+1,h,1-d)}function fp(o,t,r,l,h,d){for(;h>l;){if(h-l>600){let b=h-l+1,z=r-l+1,P=Math.log(b),k=.5*Math.exp(2*P/3),D=.5*Math.sqrt(P*k*(b-k)/b)*(z-b/2<0?-1:1);fp(o,t,r,Math.max(l,Math.floor(r-z*k/b+D)),Math.min(h,Math.floor(r+(b-z)*k/b+D)),d)}let f=t[2*r+d],x=l,_=h;for(pi(o,t,l,r),t[2*h+d]>f&&pi(o,t,l,h);x<_;){for(pi(o,t,x,_),x++,_--;t[2*x+d]<f;)x++;for(;t[2*_+d]>f;)_--}t[2*l+d]===f?pi(o,t,l,_):(_++,pi(o,t,_,h)),_<=r&&(l=_+1),r<=_&&(h=_-1)}}function pi(o,t,r,l){pl(o,r,l),pl(t,2*r,2*l),pl(t,2*r+1,2*l+1)}function pl(o,t,r){let l=o[t];o[t]=o[r],o[r]=l}function gp(o,t,r,l){let h=o-r,d=t-l;return h*h+d*d}var fl;L.cB=void 0,(fl=L.cB||(L.cB={})).create="create",fl.load="load",fl.fullLoad="fullLoad";let ro=null,fi=[],gl=1e3/60,ml="loadTime",xl="fullLoadTime",sb={mark(o){performance.mark(o)},frame(o){let t=o;ro!=null&&fi.push(t-ro),ro=t},clearMetrics(){ro=null,fi=[],performance.clearMeasures(ml),performance.clearMeasures(xl);for(let o in L.cB)performance.clearMarks(L.cB[o])},getPerformanceMetrics(){performance.measure(ml,L.cB.create,L.cB.load),performance.measure(xl,L.cB.create,L.cB.fullLoad);let o=performance.getEntriesByName(ml)[0].duration,t=performance.getEntriesByName(xl)[0].duration,r=fi.length,l=1/(fi.reduce(((d,f)=>d+f),0)/r/1e3),h=fi.filter((d=>d>gl)).reduce(((d,f)=>d+(f-gl)/gl),0);return{loadTime:o,fullLoadTime:t,fps:l,percentDroppedFrames:h/(r+h)*100,totalFrames:r}}};L.$=ht,L.A=a1,L.B=B8,L.C=function([o,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:o*Math.cos(t)*Math.sin(r),y:o*Math.sin(t)*Math.sin(r),z:o*Math.cos(r)}},L.D=v2,L.E=S1,L.F=H6,L.G=A5,L.H=ys,L.I=Us,L.J=function(o){if(e5==null){let t=o.navigator?o.navigator.userAgent:null;e5=!!o.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return e5},L.K=class{constructor(o,t){this.target=o,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new EM((()=>this.process())),this.subscription=w5(this.target,"message",(r=>this.receive(r)),!1),this.globalScope=o5(self)?o:window}registerMessageHandler(o,t){this.messageHandlers[o]=t}unregisterMessageHandler(o){delete this.messageHandlers[o]}sendAsync(o,t){return new Promise(((r,l)=>{let h=Math.round(1e18*Math.random()).toString(36).substring(0,10),d=t?w5(t.signal,"abort",(()=>{d?.unsubscribe(),delete this.resolveRejects[h];let _={id:h,type:"<cancel>",origin:location.origin,targetMapId:o.targetMapId,sourceMapId:this.mapId};this.target.postMessage(_)}),IM):null;this.resolveRejects[h]={resolve:_=>{d?.unsubscribe(),r(_)},reject:_=>{d?.unsubscribe(),l(_)}};let f=[],x=Object.assign(Object.assign({},o),{id:h,sourceMapId:this.mapId,origin:location.origin,data:ye(o.data,f)});this.target.postMessage(x,{transfer:f})}))}receive(o){let t=o.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[r];let l=this.abortControllers[r];return delete this.abortControllers[r],void(l&&l.abort())}if(o5(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;let o=this.taskQueue.shift(),t=this.tasks[o];delete this.tasks[o],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(o,t)}processTask(o,t){return n(this,void 0,void 0,(function*(){if(t.type==="<response>"){let h=this.resolveRejects[o];return delete this.resolveRejects[o],h?void(t.error?h.reject(S3(t.error)):h.resolve(S3(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(o,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let r=S3(t.data),l=new AbortController;this.abortControllers[o]=l;try{let h=yield this.messageHandlers[t.type](t.sourceMapId,r,l);this.completeTask(o,null,h)}catch(h){this.completeTask(o,h)}}))}completeTask(o,t,r){let l=[];delete this.abortControllers[o];let h={id:o,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?ye(t):null,data:ye(r,l)};this.target.postMessage(h,{transfer:l})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},L.L=U5,L.M=function(){var o=new a1(16);return a1!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[11]=0,o[12]=0,o[13]=0,o[14]=0),o[0]=1,o[5]=1,o[10]=1,o[15]=1,o},L.N=function(o,t,r){var l,h,d,f,x,_,b,z,P,k,D,N,U=r[0],$=r[1],J=r[2];return t===o?(o[12]=t[0]*U+t[4]*$+t[8]*J+t[12],o[13]=t[1]*U+t[5]*$+t[9]*J+t[13],o[14]=t[2]*U+t[6]*$+t[10]*J+t[14],o[15]=t[3]*U+t[7]*$+t[11]*J+t[15]):(h=t[1],d=t[2],f=t[3],x=t[4],_=t[5],b=t[6],z=t[7],P=t[8],k=t[9],D=t[10],N=t[11],o[0]=l=t[0],o[1]=h,o[2]=d,o[3]=f,o[4]=x,o[5]=_,o[6]=b,o[7]=z,o[8]=P,o[9]=k,o[10]=D,o[11]=N,o[12]=l*U+x*$+P*J+t[12],o[13]=h*U+_*$+k*J+t[13],o[14]=d*U+b*$+D*J+t[14],o[15]=f*U+z*$+N*J+t[15]),o},L.O=function(o,t,r){var l=r[0],h=r[1],d=r[2];return o[0]=t[0]*l,o[1]=t[1]*l,o[2]=t[2]*l,o[3]=t[3]*l,o[4]=t[4]*h,o[5]=t[5]*h,o[6]=t[6]*h,o[7]=t[7]*h,o[8]=t[8]*d,o[9]=t[9]*d,o[10]=t[10]*d,o[11]=t[11]*d,o[12]=t[12],o[13]=t[13],o[14]=t[14],o[15]=t[15],o},L.P=y,L.Q=function(o,t,r){var l=t[0],h=t[1],d=t[2],f=t[3],x=t[4],_=t[5],b=t[6],z=t[7],P=t[8],k=t[9],D=t[10],N=t[11],U=t[12],$=t[13],J=t[14],L1=t[15],Q=r[0],n1=r[1],f1=r[2],_1=r[3];return o[0]=Q*l+n1*x+f1*P+_1*U,o[1]=Q*h+n1*_+f1*k+_1*$,o[2]=Q*d+n1*b+f1*D+_1*J,o[3]=Q*f+n1*z+f1*N+_1*L1,o[4]=(Q=r[4])*l+(n1=r[5])*x+(f1=r[6])*P+(_1=r[7])*U,o[5]=Q*h+n1*_+f1*k+_1*$,o[6]=Q*d+n1*b+f1*D+_1*J,o[7]=Q*f+n1*z+f1*N+_1*L1,o[8]=(Q=r[8])*l+(n1=r[9])*x+(f1=r[10])*P+(_1=r[11])*U,o[9]=Q*h+n1*_+f1*k+_1*$,o[10]=Q*d+n1*b+f1*D+_1*J,o[11]=Q*f+n1*z+f1*N+_1*L1,o[12]=(Q=r[12])*l+(n1=r[13])*x+(f1=r[14])*P+(_1=r[15])*U,o[13]=Q*h+n1*_+f1*k+_1*$,o[14]=Q*d+n1*b+f1*D+_1*J,o[15]=Q*f+n1*z+f1*N+_1*L1,o},L.R=S6,L.S=function(o,t){let r={};for(let l=0;l<t.length;l++){let h=t[l];h in o&&(r[h]=o[h])}return r},L.T=As,L.U=E9,L.V=i5,L.W=wd,L.X=bd,L.Y=R,L.Z=r1,L._=n,L.a=D5,L.a$=function(o,t){return o[0]*t[0]+o[1]*t[1]+o[2]*t[2]},L.a0=K6,L.a1=Td,L.a2=Un,L.a3=Y1,L.a4=function(o,t){var r,l,h,d,f;if(!o)return t??{};if(!t)return o;let x=Object.assign({},o);if(t.removeAll&&(x={removeAll:!0}),t.remove){let _=new Set(t.remove);x.add&&(x.add=x.add.filter((z=>!_.has(z.id)))),x.update&&(x.update=x.update.filter((z=>!_.has(z.id))));let b=new Set(((r=o.add)!==null&&r!==void 0?r:[]).map((z=>z.id)));t.remove=t.remove.filter((z=>!b.has(z)))}if(t.remove){let _=new Set(x.remove?x.remove.concat(t.remove):t.remove);x.remove=Array.from(_.values())}if(t.add){let _=x.add?x.add.concat(t.add):t.add,b=new Map(_.map((z=>[z.id,z])));x.add=Array.from(b.values())}if(t.update){let _=new Map((l=x.update)===null||l===void 0?void 0:l.map((b=>[b.id,b])));for(let b of t.update){let z=(h=_.get(b.id))!==null&&h!==void 0?h:{id:b.id};b.newGeometry&&(z.newGeometry=b.newGeometry),b.addOrUpdateProperties&&(z.addOrUpdateProperties=((d=z.addOrUpdateProperties)!==null&&d!==void 0?d:[]).concat(b.addOrUpdateProperties)),b.removeProperties&&(z.removeProperties=((f=z.removeProperties)!==null&&f!==void 0?f:[]).concat(b.removeProperties)),b.removeAllProperties&&(z.removeAllProperties=!0),_.set(b.id,z)}x.update=Array.from(_.values())}return x.remove&&x.add&&(x.remove=x.remove.filter((_=>x.add.findIndex((b=>b.id===_))===-1))),x},L.a5=si,L.a6=Pe,L.a7=25,L.a8=Js,L.a9=o=>{let t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(let l of o){let h=window.document.createElement("source");H(l)||(t.crossOrigin="Anonymous"),h.src=l,t.appendChild(h)}}))},L.aA=$s,L.aB=N1,L.aC=function(o,t,r,l){let h=t.y-o.y,d=t.x-o.x,f=l.y-r.y,x=l.x-r.x,_=f*d-x*h;if(_===0)return null;let b=(x*(o.y-r.y)-f*(o.x-r.x))/_;return new y(o.x+b*d,o.y+b*h)},L.aD=ep,L.aE=bC,L.aF=function(o){let t=1/0,r=1/0,l=-1/0,h=-1/0;for(let d of o)t=Math.min(t,d.x),r=Math.min(r,d.y),l=Math.max(l,d.x),h=Math.max(h,d.y);return[t,r,l,h]},L.aG=At,L.aH=f2,L.aI=function(o,t,r,l,h=!1){if(!r[0]&&!r[1])return[0,0];let d=h?l==="map"?-o.bearingInRadians:0:l==="viewport"?o.bearingInRadians:0;if(d){let f=Math.sin(d),x=Math.cos(d);r=[r[0]*x-r[1]*f,r[0]*f+r[1]*x]}return[h?r[0]:f2(t,r[0],o.zoom),h?r[1]:f2(t,r[1],o.zoom)]},L.aK=Hs,L.aL=hl,L.aM=qs,L.aN=Cl,L.aO=V5,L.aP=Dn,L.aQ=i1,L.aR=M2,L.aS=Q1,L.aT=u5,L.aU=zd,L.aV=O1,L.aW=z1,L.aX=function(o){var t=new a1(3);return t[0]=o[0],t[1]=o[1],t[2]=o[2],t},L.aY=function(o,t,r){return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],o},L.aZ=function(o,t){var r=t[0],l=t[1],h=t[2],d=r*r+l*l+h*h;return d>0&&(d=1/Math.sqrt(d)),o[0]=t[0]*d,o[1]=t[1]*d,o[2]=t[2]*d,o},L.a_=U1,L.aa=H1,L.ab=function(){return g2++},L.ac=m,L.ad=u7,L.ae=he,L.af=C8,L.ag=Pd,L.ah=function(o){let t={};if(o.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((r,l,h,d)=>{let f=h||d;return t[l]=!f||f.toLowerCase(),""})),t["max-age"]){let r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},L.ai=F1,L.aj=85.051129,L.ak=W2,L.al=function(o){return Math.pow(2,o)},L.am=s1,L.an=Sd,L.ao=function(o){return Math.log(o)/Math.LN2},L.ap=function(o){var t=o[0],r=o[1];return t*t+r*r},L.aq=class{constructor(o,t){this.max=o,this.onRemove=t,this.reset()}reset(){for(let o in this.data)for(let t of this.data[o])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(o,t,r){let l=o.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);let h={value:t,timeout:void 0};if(r!==void 0&&(h.timeout=setTimeout((()=>{this.remove(o,h)}),r)),this.data[l].push(h),this.order.push(l),this.order.length>this.max){let d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){let t=this.data[o].shift();return t.timeout&&clearTimeout(t.timeout),this.data[o].length===0&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),t.value}getByKey(o){let t=this.data[o];return t?t[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,t){if(!this.has(o))return this;let r=o.wrapped().key,l=t===void 0?0:this.data[r].indexOf(t),h=this.data[r][l];return this.data[r].splice(l,1),h.timeout&&clearTimeout(h.timeout),this.data[r].length===0&&delete this.data[r],this.onRemove(h.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(o){let t=[];for(let r in this.data)for(let l of this.data[r])o(l.value)||t.push(l);for(let r of t)this.remove(r.value.tileID,r)}},L.ar=function(o){if(!o.length)return new Set;let t=Math.max(...o.map((_=>_.canonical.z))),r=1/0,l=-1/0,h=1/0,d=-1/0,f=[];for(let _ of o){let{x:b,y:z,z:P}=_.canonical,k=Math.pow(2,t-P),D=b*k,N=z*k;f.push({id:_,x:D,y:N}),D<r&&(r=D),D>l&&(l=D),N<h&&(h=N),N>d&&(d=N)}let x=new Set;for(let _ of f)_.x!==r&&_.x!==l&&_.y!==h&&_.y!==d||x.add(_.id);return x},L.as=function(o,t){let r=0,l=0;if(o.kind==="constant")l=o.layoutSize;else if(o.kind!=="source"){let{interpolationType:h,minZoom:d,maxZoom:f}=o,x=h?F1(Ut.interpolationFactor(h,t,d,f),0,1):0;o.kind==="camera"?l=H6.number(o.minSize,o.maxSize,x):r=x}return{uSizeT:r,uSize:l}},L.au=function(o,{uSize:t,uSizeT:r},{lowerSize:l,upperSize:h}){return o.kind==="source"?l/O8:o.kind==="composite"?H6.number(l/O8,h/O8,r):t},L.av=function(o,t){var r=t[0],l=t[1],h=t[2],d=t[3],f=t[4],x=t[5],_=t[6],b=t[7],z=t[8],P=t[9],k=t[10],D=t[11],N=t[12],U=t[13],$=t[14],J=t[15],L1=r*x-l*f,Q=r*_-h*f,n1=r*b-d*f,f1=l*_-h*x,_1=l*b-d*x,P1=h*b-d*_,$1=z*U-P*N,j1=z*$-k*N,J1=z*J-D*N,u2=P*$-k*U,r2=P*J-D*U,n2=k*J-D*$,V1=L1*n2-Q*r2+n1*u2+f1*J1-_1*j1+P1*$1;return V1?(o[0]=(x*n2-_*r2+b*u2)*(V1=1/V1),o[1]=(h*r2-l*n2-d*u2)*V1,o[2]=(U*P1-$*_1+J*f1)*V1,o[3]=(k*_1-P*P1-D*f1)*V1,o[4]=(_*J1-f*n2-b*j1)*V1,o[5]=(r*n2-h*J1+d*j1)*V1,o[6]=($*n1-N*P1-J*Q)*V1,o[7]=(z*P1-k*n1+D*Q)*V1,o[8]=(f*r2-x*J1+b*$1)*V1,o[9]=(l*J1-r*r2-d*$1)*V1,o[10]=(N*_1-U*n1+J*L1)*V1,o[11]=(P*n1-z*_1-D*L1)*V1,o[12]=(x*j1-f*u2-_*$1)*V1,o[13]=(r*u2-l*j1+h*$1)*V1,o[14]=(U*Q-N*f1-$*L1)*V1,o[15]=(z*f1-P*Q+k*L1)*V1,o):null},L.aw=T2,L.ax=function(o){var t=o[0],r=o[1];return Math.sqrt(t*t+r*r)},L.ay=function(o){return o[0]=0,o[1]=0,o},L.az=function(o,t,r){return o[0]=t[0]*r,o[1]=t[1]*r,o},L.b=X2,L.b$=function(o,t){var r=Math.sin(t),l=Math.cos(t);return o[0]=l,o[1]=r,o[2]=0,o[3]=-r,o[4]=l,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},L.b0=function(o,t,r){return o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o[3]=t[3]*r[3],o},L.b1=m1,L.b2=function(o,t,r){let l=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return l===0?null:(-(o[0]*r[0]+o[1]*r[1]+o[2]*r[2])-r[3])/l},L.b3=s2,L.b4=function(o,t,r){return o[0]=t[0]*r,o[1]=t[1]*r,o[2]=t[2]*r,o[3]=t[3]*r,o},L.b5=function(o,t){return o[0]*t[0]+o[1]*t[1]+o[2]*t[2]+o[3]},L.b6=Ed,L.b7=h7,L.b8=function(o,t,r,l,h){var d=1/Math.tan(t/2);if(o[0]=d/r,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=d,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[11]=-1,o[12]=0,o[13]=0,o[15]=0,h!=null&&h!==1/0){var f=1/(l-h);o[10]=(h+l)*f,o[14]=2*h*l*f}else o[10]=-1,o[14]=-2*l;return o},L.b9=function(o){var t=new a1(16);return t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3],t[4]=o[4],t[5]=o[5],t[6]=o[6],t[7]=o[7],t[8]=o[8],t[9]=o[9],t[10]=o[10],t[11]=o[11],t[12]=o[12],t[13]=o[13],t[14]=o[14],t[15]=o[15],t},L.bA=function(o,t,r,l){var h=[],d=[];return h[0]=t[0]-r[0],h[1]=t[1]-r[1],h[2]=t[2]-r[2],d[0]=h[0]*Math.cos(l)-h[1]*Math.sin(l),d[1]=h[0]*Math.sin(l)+h[1]*Math.cos(l),d[2]=h[2],o[0]=d[0]+r[0],o[1]=d[1]+r[1],o[2]=d[2]+r[2],o},L.bB=function(o,t,r,l){var h=[],d=[];return h[0]=t[0]-r[0],h[1]=t[1]-r[1],h[2]=t[2]-r[2],d[0]=h[0],d[1]=h[1]*Math.cos(l)-h[2]*Math.sin(l),d[2]=h[1]*Math.sin(l)+h[2]*Math.cos(l),o[0]=d[0]+r[0],o[1]=d[1]+r[1],o[2]=d[2]+r[2],o},L.bC=function(o,t,r,l){var h=[],d=[];return h[0]=t[0]-r[0],h[1]=t[1]-r[1],h[2]=t[2]-r[2],d[0]=h[2]*Math.sin(l)+h[0]*Math.cos(l),d[1]=h[1],d[2]=h[2]*Math.cos(l)-h[0]*Math.sin(l),o[0]=d[0]+r[0],o[1]=d[1]+r[1],o[2]=d[2]+r[2],o},L.bD=function(o,t,r){var l=Math.sin(r),h=Math.cos(r),d=t[0],f=t[1],x=t[2],_=t[3],b=t[8],z=t[9],P=t[10],k=t[11];return t!==o&&(o[4]=t[4],o[5]=t[5],o[6]=t[6],o[7]=t[7],o[12]=t[12],o[13]=t[13],o[14]=t[14],o[15]=t[15]),o[0]=d*h-b*l,o[1]=f*h-z*l,o[2]=x*h-P*l,o[3]=_*h-k*l,o[8]=d*l+b*h,o[9]=f*l+z*h,o[10]=x*l+P*h,o[11]=_*l+k*h,o},L.bE=function(o,t){let r=b2(o,360),l=b2(t,360),h=l-r,d=l>r?h-360:h+360;return Math.abs(h)<Math.abs(d)?h:d},L.bF=function(o){return o[0]=0,o[1]=0,o[2]=0,o},L.bG=function(o,t,r,l){let h=Math.sqrt(o*o+t*t),d=Math.sqrt(r*r+l*l);o/=h,t/=h,r/=d,l/=d;let f=Math.acos(o*r+t*l);return-t*r+o*l>0?f:-f},L.bH=function(o,t){let r=b2(o,2*Math.PI),l=b2(t,2*Math.PI);return Math.min(Math.abs(r-l),Math.abs(r-l+2*Math.PI),Math.abs(r-l-2*Math.PI))},L.bI=function(){let o={},t=t1.$version;for(let r in t1.$root){let l=t1.$root[r];if(l.required){let h=null;h=r==="version"?t:l.type==="array"?[]:{},h!=null&&(o[r]=h)}}return o},L.bJ=lt,L.bK=k4,L.bL=function o(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let l=0;l<t.length;l++)if(!o(t[l],r[l]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(let l in t)if(!o(t[l],r[l]))return!1;return!0}return t===r},L.bM=function(o){o=o.slice();let t=Object.create(null);for(let r=0;r<o.length;r++)t[o[r].id]=o[r];for(let r=0;r<o.length;r++)"ref"in o[r]&&(o[r]=I1(o[r],t[o[r].ref]));return o},L.bN=function(o,t){if(o.type==="custom")return new ZM(o,t);switch(o.type){case"background":return new zM(o,t);case"circle":return new C_(o,t);case"color-relief":return new x_(o,t);case"fill":return new B_(o,t);case"fill-extrusion":return new q_(o,t);case"heatmap":return new p_(o,t);case"hillshade":return new g_(o,t);case"line":return new J_(o,t);case"raster":return new bs(o,t);case"symbol":return new Gn(o,t)}},L.bO=o=>o.type==="raster",L.bP=Q2,L.bQ=function(o,t){if(!o)return[{command:"setStyle",args:[t]}];let r=[];try{if(!R1(o.version,t.version))return[{command:"setStyle",args:[t]}];R1(o.center,t.center)||r.push({command:"setCenter",args:[t.center]}),R1(o.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),R1(o.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),R1(o.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),R1(o.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),R1(o.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),R1(o.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),R1(o.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),R1(o.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),R1(o.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),R1(o.light,t.light)||r.push({command:"setLight",args:[t.light]}),R1(o.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),R1(o.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),R1(o.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let l={},h=[];(function(f,x,_,b){let z;for(z in x=x||{},f=f||{})Object.prototype.hasOwnProperty.call(f,z)&&(Object.prototype.hasOwnProperty.call(x,z)||w2(z,_,b));for(z in x)Object.prototype.hasOwnProperty.call(x,z)&&(Object.prototype.hasOwnProperty.call(f,z)?R1(f[z],x[z])||(f[z].type==="geojson"&&x[z].type==="geojson"&&z5(f,x,z)?D1(_,{command:"setGeoJSONSourceData",args:[z,x[z].data]}):k2(z,x,_,b)):h2(z,x,_))})(o.sources,t.sources,h,l);let d=[];o.layers&&o.layers.forEach((f=>{"source"in f&&l[f.source]?r.push({command:"removeLayer",args:[f.id]}):d.push(f)})),r=r.concat(h),(function(f,x,_){x=x||[];let b=(f=f||[]).map(O2),z=x.map(O2),P=f.reduce(_5,{}),k=x.reduce(_5,{}),D=b.slice(),N=Object.create(null),U,$,J,L1,Q;for(let n1=0,f1=0;n1<b.length;n1++)U=b[n1],Object.prototype.hasOwnProperty.call(k,U)?f1++:(D1(_,{command:"removeLayer",args:[U]}),D.splice(D.indexOf(U,f1),1));for(let n1=0,f1=0;n1<z.length;n1++)U=z[z.length-1-n1],D[D.length-1-n1]!==U&&(Object.prototype.hasOwnProperty.call(P,U)?(D1(_,{command:"removeLayer",args:[U]}),D.splice(D.lastIndexOf(U,D.length-f1),1)):f1++,L1=D[D.length-n1],D1(_,{command:"addLayer",args:[k[U],L1]}),D.splice(D.length-n1,0,U),N[U]=!0);for(let n1=0;n1<z.length;n1++)if(U=z[n1],$=P[U],J=k[U],!N[U]&&!R1($,J))if(R1($.source,J.source)&&R1($["source-layer"],J["source-layer"])&&R1($.type,J.type)){for(Q in H2($.layout,J.layout,_,U,null,"setLayoutProperty"),H2($.paint,J.paint,_,U,null,"setPaintProperty"),R1($.filter,J.filter)||D1(_,{command:"setFilter",args:[U,J.filter]}),R1($.minzoom,J.minzoom)&&R1($.maxzoom,J.maxzoom)||D1(_,{command:"setLayerZoomRange",args:[U,J.minzoom,J.maxzoom]}),$)Object.prototype.hasOwnProperty.call($,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?H2($[Q],J[Q],_,U,Q.slice(6),"setPaintProperty"):R1($[Q],J[Q])||D1(_,{command:"setLayerProperty",args:[U,Q,J[Q]]}));for(Q in J)Object.prototype.hasOwnProperty.call(J,Q)&&!Object.prototype.hasOwnProperty.call($,Q)&&Q!=="layout"&&Q!=="paint"&&Q!=="filter"&&Q!=="metadata"&&Q!=="minzoom"&&Q!=="maxzoom"&&(Q.indexOf("paint.")===0?H2($[Q],J[Q],_,U,Q.slice(6),"setPaintProperty"):R1($[Q],J[Q])||D1(_,{command:"setLayerProperty",args:[U,Q,J[Q]]}))}else D1(_,{command:"removeLayer",args:[U]}),L1=D[D.lastIndexOf(U)+1],D1(_,{command:"addLayer",args:[J,L1]})})(d,t.layers,r)}catch(l){console.warn("Unable to compute style diff:",l),r=[{command:"setStyle",args:[t]}]}return r},L.bR=function(o){let t=[],r=o.id;return r===void 0&&t.push({message:`layers.${r}: missing required property "id"`}),o.render===void 0&&t.push({message:`layers.${r}: missing required method "render"`}),o.renderingMode&&o.renderingMode!=="2d"&&o.renderingMode!=="3d"&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},L.bS=L5,L.bT=x5,L.bU=class extends D6{constructor(o,t){super(o,t),this.current=0}set(o){this.current!==o&&(this.current=o,this.gl.uniform1i(this.location,o))}},L.bV=w6,L.bW=class extends D6{constructor(o,t){super(o,t),this.current=u8}set(o){if(o[12]!==this.current[12]||o[0]!==this.current[0])return this.current=o,void this.gl.uniformMatrix4fv(this.location,!1,o);for(let t=1;t<16;t++)if(o[t]!==this.current[t]){this.current=o,this.gl.uniformMatrix4fv(this.location,!1,o);break}}},L.bX=D8,L.bY=class extends D6{constructor(o,t){super(o,t),this.current=[0,0,0]}set(o){o[0]===this.current[0]&&o[1]===this.current[1]&&o[2]===this.current[2]||(this.current=o,this.gl.uniform3f(this.location,o[0],o[1],o[2]))}},L.bZ=class extends D6{constructor(o,t){super(o,t),this.current=[0,0]}set(o){o[0]===this.current[0]&&o[1]===this.current[1]||(this.current=o,this.gl.uniform2f(this.location,o[0],o[1]))}},L.b_=d1,L.ba=function(o,t,r){var l=Math.sin(r),h=Math.cos(r),d=t[0],f=t[1],x=t[2],_=t[3],b=t[4],z=t[5],P=t[6],k=t[7];return t!==o&&(o[8]=t[8],o[9]=t[9],o[10]=t[10],o[11]=t[11],o[12]=t[12],o[13]=t[13],o[14]=t[14],o[15]=t[15]),o[0]=d*h+b*l,o[1]=f*h+z*l,o[2]=x*h+P*l,o[3]=_*h+k*l,o[4]=b*h-d*l,o[5]=z*h-f*l,o[6]=P*h-x*l,o[7]=k*h-_*l,o},L.bb=function(o,t,r){var l=Math.sin(r),h=Math.cos(r),d=t[4],f=t[5],x=t[6],_=t[7],b=t[8],z=t[9],P=t[10],k=t[11];return t!==o&&(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=t[3],o[12]=t[12],o[13]=t[13],o[14]=t[14],o[15]=t[15]),o[4]=d*h+b*l,o[5]=f*h+z*l,o[6]=x*h+P*l,o[7]=_*h+k*l,o[8]=b*h-d*l,o[9]=z*h-f*l,o[10]=P*h-x*l,o[11]=k*h-_*l,o},L.bc=function(){let o=new Float32Array(16);return s1(o),o},L.bd=function(){let o=new Float64Array(16);return s1(o),o},L.be=function(){return new Float64Array(16)},L.bf=function(o,t,r){let l=new Float64Array(4);return p2(l,o,t-90,r),l},L.bg=function(o,t,r,l){var h,d,f,x,_,b=t[0],z=t[1],P=t[2],k=t[3],D=r[0],N=r[1],U=r[2],$=r[3];return(d=b*D+z*N+P*U+k*$)<0&&(d=-d,D=-D,N=-N,U=-U,$=-$),1-d>X?(h=Math.acos(d),f=Math.sin(h),x=Math.sin((1-l)*h)/f,_=Math.sin(l*h)/f):(x=1-l,_=l),o[0]=x*b+_*D,o[1]=x*z+_*N,o[2]=x*P+_*U,o[3]=x*k+_*$,o},L.bh=function(o){let t=new Float64Array(9);var r,l,h,d,f,x,_,b,z,P,k,D,N,U,$,J,L1,Q;P=(h=(l=o)[0])*(_=h+h),k=(d=l[1])*_,N=(f=l[2])*_,U=f*(b=d+d),J=(x=l[3])*_,L1=x*b,Q=x*(z=f+f),(r=t)[0]=1-(D=d*b)-($=f*z),r[3]=k-Q,r[6]=N+L1,r[1]=k+Q,r[4]=1-P-$,r[7]=U-J,r[2]=N-L1,r[5]=U+J,r[8]=1-P-D;let n1=u5(-Math.asin(F1(t[2],-1,1))),f1,_1;return Math.hypot(t[5],t[8])<.001?(f1=0,_1=-u5(Math.atan2(t[3],t[4]))):(f1=u5(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),_1=u5(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:f1,pitch:n1+90,bearing:_1}},L.bi=function(o,t){return o.roll==t.roll&&o.pitch==t.pitch&&o.bearing==t.bearing},L.bj=s5,L.bk=R8,L.bl=s7,L.bm=ei,L.bn=a7,L.bo=d2,L.bp=R2,L.bq=Kt,L.br=function(o,t,r,l,h){return d2(l,h,F1((o-t)/(r-t),0,1))},L.bs=b2,L.bt=function(){return new Float64Array(3)},L.bu=function(o,t,r,l){return o[0]=t[0]+r[0]*l,o[1]=t[1]+r[1]*l,o[2]=t[2]+r[2]*l,o},L.bv=p2,L.bw=function(o,t,r){var l=r[0],h=r[1],d=r[2],f=r[3],x=t[0],_=t[1],b=t[2],z=h*b-d*_,P=d*x-l*b,k=l*_-h*x;return o[0]=x+f*(z+=z)+h*(k+=k)-d*(P+=P),o[1]=_+f*P+d*z-l*k,o[2]=b+f*k+l*P-h*z,o},L.bx=function(o,t,r){let l=(h=[o[0],o[1],o[2],t[0],t[1],t[2],r[0],r[1],r[2]])[0]*((z=h[8])*(f=h[4])-(x=h[5])*(b=h[7]))+h[1]*(-z*(d=h[3])+x*(_=h[6]))+h[2]*(b*d-f*_);var h,d,f,x,_,b,z;if(l===0)return null;let P=U1([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),k=U1([],[r[0],r[1],r[2]],[o[0],o[1],o[2]]),D=U1([],[o[0],o[1],o[2]],[t[0],t[1],t[2]]),N=O1([],P,-o[3]);return z1(N,N,O1([],k,-t[3])),z1(N,N,O1([],D,-r[3])),O1(N,N,1/l),N},L.by=Ks,L.bz=function(){return new Float64Array(4)},L.c=E5,L.c$=function(o,t){let r=new Map;if(o!=null)if(o.type==="Feature")r.set(li(o,t),o);else for(let l of o.features)r.set(li(l,t),l);return r},L.c0=function(o,t,r){var l=t[0],h=t[1],d=t[2];return o[0]=l*r[0]+h*r[3]+d*r[6],o[1]=l*r[1]+h*r[4]+d*r[7],o[2]=l*r[2]+h*r[5]+d*r[8],o},L.c1=function(o,t,r,l,h,d,f){var x=1/(t-r),_=1/(l-h),b=1/(d-f);return o[0]=-2*x,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*_,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*b,o[11]=0,o[12]=(t+r)*x,o[13]=(h+l)*_,o[14]=(f+d)*b,o[15]=1,o},L.c2=class extends D6{constructor(o,t){super(o,t),this.current=new Array}set(o){if(o!=this.current){this.current=o;let t=new Float32Array(4*o.length);for(let r=0;r<o.length;r++)t[4*r]=o[r].r,t[4*r+1]=o[r].g,t[4*r+2]=o[r].b,t[4*r+3]=o[r].a;this.gl.uniform4fv(this.location,t)}}},L.c3=class extends D6{constructor(o,t){super(o,t),this.current=new Array}set(o){if(o!=this.current){this.current=o;let t=new Float32Array(o);this.gl.uniform1fv(this.location,t)}}},L.c4=class extends q4{},L.c5=iM,L.c6=class extends c8{},L.c7=Ps,L.c8=function(o){return o<=1?1:Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))},L.c9=BC,L.cA=sb,L.cC=function(o){return o.message===it},L.cD=F5,L.cE=function(o,t){D5.REGISTERED_PROTOCOLS[o]=t},L.cF=function(o){delete D5.REGISTERED_PROTOCOLS[o]},L.cG=function(o,t){let r={};for(let h=0;h<o.length;h++){let d=t&&t[o[h].id]||an(o[h]);t&&(t[o[h].id]=d);let f=r[d];f||(f=r[d]=[]),f.push(o[h])}let l=[];for(let h in r)l.push(r[h]);return l},L.cH=C2,L.cI=Id,L.cJ=Qd,L.cK=cd,L.cL=function(o){o.bucket.createArrays(),o.bucket.tilePixelRatio=Y1/(512*o.bucket.overscaling),o.bucket.compareText={},o.bucket.iconsNeedLinear=!1;let t=o.bucket.layers[0],r=t.layout,l=t._unevaluatedLayout._values,h={layoutIconSize:l["icon-size"].possiblyEvaluate(new A5(o.bucket.zoom+1),o.canonical),layoutTextSize:l["text-size"].possiblyEvaluate(new A5(o.bucket.zoom+1),o.canonical),textMaxSize:l["text-size"].possiblyEvaluate(new A5(18))};if(o.bucket.textSizeData.kind==="composite"){let{minZoom:b,maxZoom:z}=o.bucket.textSizeData;h.compositeTextSizes=[l["text-size"].possiblyEvaluate(new A5(b),o.canonical),l["text-size"].possiblyEvaluate(new A5(z),o.canonical)]}if(o.bucket.iconSizeData.kind==="composite"){let{minZoom:b,maxZoom:z}=o.bucket.iconSizeData;h.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new A5(b),o.canonical),l["icon-size"].possiblyEvaluate(new A5(z),o.canonical)]}let d=r.get("text-line-height")*At,f=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",x=r.get("text-keep-upright"),_=r.get("text-size");for(let b of o.bucket.features){let z=r.get("text-font").evaluate(b,{},o.canonical).join(","),P=_.evaluate(b,{},o.canonical),k=h.layoutTextSize.evaluate(b,{},o.canonical),D=h.layoutIconSize.evaluate(b,{},o.canonical),N={horizontal:{},vertical:void 0},U=b.text,$,J=[0,0];if(U){let n1=U.toString(),f1=r.get("text-letter-spacing").evaluate(b,{},o.canonical)*At,_1=D4(n1)?f1:0,P1=r.get("text-anchor").evaluate(b,{},o.canonical),$1=hp(t,b,o.canonical);if(!$1){let r2=r.get("text-radial-offset").evaluate(b,{},o.canonical);J=r2?up(P1,[r2*At,ul]):r.get("text-offset").evaluate(b,{},o.canonical).map((n2=>n2*At))}let j1=f?"center":r.get("text-justify").evaluate(b,{},o.canonical),J1=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(b,{},o.canonical)*At:1/0,u2=()=>{o.bucket.allowVerticalPlacement&&R4(n1)&&(N.vertical=On(U,o.glyphMap,o.glyphPositions,o.imagePositions,z,J1,d,P1,"left",_1,J,L.at.vertical,!0,k,P))};if(!f&&$1){let r2=new Set;if(j1==="auto")for(let V1=0;V1<$1.values.length;V1+=2)r2.add(hl($1.values[V1]));else r2.add(j1);let n2=!1;for(let V1 of r2)if(!N.horizontal[V1])if(n2)N.horizontal[V1]=N.horizontal[0];else{let I2=On(U,o.glyphMap,o.glyphPositions,o.imagePositions,z,J1,d,"center",V1,_1,J,L.at.horizontal,!1,k,P);I2&&(N.horizontal[V1]=I2,n2=I2.positionedLines.length===1)}u2()}else{j1==="auto"&&(j1=hl(P1));let r2=On(U,o.glyphMap,o.glyphPositions,o.imagePositions,z,J1,d,P1,j1,_1,J,L.at.horizontal,!1,k,P);r2&&(N.horizontal[j1]=r2),u2(),R4(n1)&&f&&x&&(N.vertical=On(U,o.glyphMap,o.glyphPositions,o.imagePositions,z,J1,d,P1,j1,_1,J,L.at.vertical,!1,k,P))}}let L1=!1;if(b.icon&&b.icon.name){let n1=o.imageMap[b.icon.name];n1&&($=bM(o.imagePositions[b.icon.name],r.get("icon-offset").evaluate(b,{},o.canonical),r.get("icon-anchor").evaluate(b,{},o.canonical)),L1=!!n1.sdf,o.bucket.sdfIcons===void 0?o.bucket.sdfIcons=L1:o.bucket.sdfIcons!==L1&&U2("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(n1.pixelRatio!==o.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(o.bucket.iconsNeedLinear=!0))}let Q=dp(N.horizontal)||N.vertical;o.bucket.iconsInText=!!Q&&Q.iconsInText,(Q||$)&&ob(o.bucket,b,N,$,o.imageMap,h,k,D,J,L1,o.canonical,o.subdivisionGranularity)}o.showCollisionBoxes&&o.bucket.generateCollisionDebugBuffers()},L.cM=Ds,L.cN=Os,L.cO=Ns,L.cP=WC,L.cQ=Gs,L.cR=l7,L.cS=function(o,t,r,l,h,d){let f=ip(o,t,r,h,0);return f=ip(f,t,l,d,1),f},L.cT=class{constructor(o){this.maxEntries=o,this.map=new Map}get(o){let t=this.map.get(o);return t!==void 0&&(this.map.delete(o),this.map.set(o,t)),t}set(o,t){if(this.map.has(o))this.map.delete(o);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(o,t)}clear(){this.map.clear()}},L.cU=YC,L.cV=Jd,L.cW=class{constructor(o){this._marks={start:[o.url,"start"].join("#"),end:[o.url,"end"].join("#"),measure:o.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let o=performance.getEntriesByName(this._marks.measure);return o.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),o=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),o}},L.cX=function(o,t,r,l,h){return n(this,void 0,void 0,(function*(){if(r1())try{return yield ht(o,t,r,l,h)}catch{}return(function(d,f,x,_,b){let z=d.width,P=d.height;R5&&d5||(R5=new OffscreenCanvas(z,P),d5=R5.getContext("2d",{willReadFrequently:!0})),R5.width=z,R5.height=P,d5.drawImage(d,0,0,z,P);let k=d5.getImageData(f,x,_,b);return d5.clearRect(0,0,z,P),k.data})(o,t,r,l,h)}))},L.cY=DC,L.cZ=M,L.c_=R0,L.ca=function(o,t,r){var l=t[0],h=t[1],d=t[2],f=r[3]*l+r[7]*h+r[11]*d+r[15];return o[0]=(r[0]*l+r[4]*h+r[8]*d+r[12])/(f=f||1),o[1]=(r[1]*l+r[5]*h+r[9]*d+r[13])/f,o[2]=(r[2]*l+r[6]*h+r[10]*d+r[14])/f,o},L.cb=class extends J0{},L.cc=class extends a{},L.cd=function(o,t){return o[0]===t[0]&&o[1]===t[1]&&o[2]===t[2]&&o[3]===t[3]&&o[4]===t[4]&&o[5]===t[5]&&o[6]===t[6]&&o[7]===t[7]&&o[8]===t[8]&&o[9]===t[9]&&o[10]===t[10]&&o[11]===t[11]&&o[12]===t[12]&&o[13]===t[13]&&o[14]===t[14]&&o[15]===t[15]},L.ce=function(o,t){var r=o[0],l=o[1],h=o[2],d=o[3],f=o[4],x=o[5],_=o[6],b=o[7],z=o[8],P=o[9],k=o[10],D=o[11],N=o[12],U=o[13],$=o[14],J=o[15],L1=t[0],Q=t[1],n1=t[2],f1=t[3],_1=t[4],P1=t[5],$1=t[6],j1=t[7],J1=t[8],u2=t[9],r2=t[10],n2=t[11],V1=t[12],I2=t[13],z2=t[14],E2=t[15];return Math.abs(r-L1)<=X*Math.max(1,Math.abs(r),Math.abs(L1))&&Math.abs(l-Q)<=X*Math.max(1,Math.abs(l),Math.abs(Q))&&Math.abs(h-n1)<=X*Math.max(1,Math.abs(h),Math.abs(n1))&&Math.abs(d-f1)<=X*Math.max(1,Math.abs(d),Math.abs(f1))&&Math.abs(f-_1)<=X*Math.max(1,Math.abs(f),Math.abs(_1))&&Math.abs(x-P1)<=X*Math.max(1,Math.abs(x),Math.abs(P1))&&Math.abs(_-$1)<=X*Math.max(1,Math.abs(_),Math.abs($1))&&Math.abs(b-j1)<=X*Math.max(1,Math.abs(b),Math.abs(j1))&&Math.abs(z-J1)<=X*Math.max(1,Math.abs(z),Math.abs(J1))&&Math.abs(P-u2)<=X*Math.max(1,Math.abs(P),Math.abs(u2))&&Math.abs(k-r2)<=X*Math.max(1,Math.abs(k),Math.abs(r2))&&Math.abs(D-n2)<=X*Math.max(1,Math.abs(D),Math.abs(n2))&&Math.abs(N-V1)<=X*Math.max(1,Math.abs(N),Math.abs(V1))&&Math.abs(U-I2)<=X*Math.max(1,Math.abs(U),Math.abs(I2))&&Math.abs($-z2)<=X*Math.max(1,Math.abs($),Math.abs(z2))&&Math.abs(J-E2)<=X*Math.max(1,Math.abs(J),Math.abs(E2))},L.cf=function(o,t){return o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=t[3],o[4]=t[4],o[5]=t[5],o[6]=t[6],o[7]=t[7],o[8]=t[8],o[9]=t[9],o[10]=t[10],o[11]=t[11],o[12]=t[12],o[13]=t[13],o[14]=t[14],o[15]=t[15],o},L.cg=o=>o.type==="symbol",L.ch=o=>o.type==="circle",L.ci=o=>o.type==="heatmap",L.cj=o=>o.type==="line",L.ck=o=>o.type==="fill",L.cl=o=>o.type==="fill-extrusion",L.cm=o=>o.type==="hillshade",L.cn=o=>o.type==="color-relief",L.co=o=>o.type==="background",L.cp=o=>o.type==="custom",L.cq=J2,L.cr=function(o,t,r){let l=l2(t.x-r.x,t.y-r.y),h=l2(o.x-r.x,o.y-r.y);var d,f;return u5(Math.atan2(l[0]*h[1]-l[1]*h[0],(d=l)[0]*(f=h)[0]+d[1]*f[1]))},L.cs=v5,L.ct=function(o,t){return P5[t]&&(o instanceof MouseEvent||o instanceof WheelEvent)},L.cu=function(o,t){return Y2[t]&&"touches"in o},L.cv=function(o){return Y2[o]||P5[o]},L.cw=function(o,t,r){var l=t[0],h=t[1];return o[0]=r[0]*l+r[4]*h+r[12],o[1]=r[1]*l+r[5]*h+r[13],o},L.cx=function(o,t){let{x:r,y:l}=si.fromLngLat(t);return!(o<0||o>25||l<0||l>=1||r<0||r>=1)},L.cy=function(o,t){return o[0]=t[0],o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=t[1],o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=t[2],o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o},L.cz=class extends K0{},L.d=H,L.d0=function(o,t){if(o==null)return!0;if(o.type==="Feature")return li(o,t)!=null;if(o.type==="FeatureCollection"){let r=new Set;for(let l of o.features){let h=li(l,t);if(h==null||r.has(h))return!1;r.add(h)}return!0}return!1},L.d1=function(o,t,r){var l,h,d,f;if(t.removeAll&&o.clear(),t.remove)for(let x of t.remove)o.delete(x);if(t.add)for(let x of t.add){let _=li(x,r);_!=null&&o.set(_,x)}if(t.update)for(let x of t.update){let _=o.get(x.id);if(_==null)continue;let b=!x.removeAllProperties&&(((l=x.removeProperties)===null||l===void 0?void 0:l.length)>0||((h=x.addOrUpdateProperties)===null||h===void 0?void 0:h.length)>0);if((x.newGeometry||x.removeAllProperties||b)&&(_=Object.assign({},_),o.set(x.id,_),b&&(_.properties=Object.assign({},_.properties))),x.newGeometry&&(_.geometry=x.newGeometry),x.removeAllProperties)_.properties={};else if(((d=x.removeProperties)===null||d===void 0?void 0:d.length)>0)for(let z of x.removeProperties)Object.prototype.hasOwnProperty.call(_.properties,z)&&delete _.properties[z];if(((f=x.addOrUpdateProperties)===null||f===void 0?void 0:f.length)>0)for(let{key:z,value:P}of x.addOrUpdateProperties)_.properties[z]=P}},L.d2=T3,L.e=N2,L.f=o=>n(void 0,void 0,void 0,(function*(){if(o.byteLength===0)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(o)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),L.g=Vt,L.h=o=>new Promise(((t,r)=>{let l=new Image;l.onload=()=>{t(l),URL.revokeObjectURL(l.src),l.onload=null,window.requestAnimationFrame((()=>{l.src=C5}))},l.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let h=new Blob([new Uint8Array(o)],{type:"image/png"});l.src=o.byteLength?URL.createObjectURL(h):C5})),L.i=o5,L.j=(o,t)=>p1(N2(o,{type:"json"}),t),L.k=C1,L.l=l1,L.m=p1,L.n=(o,t)=>p1(N2(o,{type:"arrayBuffer"}),t),L.o=function(o){return new Gs(o).readFields(CM,[])},L.p=ld,L.q=function(o){return/[\u1100-\u11FF\u3000-\u30FF\u3131-\u318E\u31F0-\u321E\u3260-\u327E\u32D0-\u32FE\u3300-\u3357\u3400-\u4DBF\u4E00-\u9FFF\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFF00-\uFFEF]|\uD81B[\uDFE4\uDFF2-\uDFF6]|[\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-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD83C\uDE00|\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(o))},L.r=X4,L.s=w5,L.t=s6,L.u=t1,L.v=ge,L.w=U2,L.x=O4,L.y=xs,L.z=q0})),s("worker",["./shared"],(function(L){"use strict";class n{constructor(H,W){this.keyCache={},H&&this.replace(H,W)}replace(H,W){this._layerConfigs={},this._layers={},this.update(H,[],W)}update(H,W,K){for(let C1 of H){this._layerConfigs[C1.id]=C1;let S1=this._layers[C1.id]=L.bN(C1,K);S1._featureFilter=L.ae(S1.filter,K),this.keyCache[C1.id]&&delete this.keyCache[C1.id]}for(let C1 of W)delete this.keyCache[C1],delete this._layerConfigs[C1],delete this._layers[C1];this.familiesBySource={};let l1=L.cG(Object.values(this._layerConfigs),this.keyCache);for(let C1 of l1){let S1=C1.map((h2=>this._layers[h2.id])),t1=S1[0];if(t1.visibility==="none")continue;let M1=t1.source||"",I1=this.familiesBySource[M1];I1||(I1=this.familiesBySource[M1]={});let R1=t1.sourceLayer||"_geojsonTileLayer",D1=I1[R1];D1||(D1=I1[R1]=[]),D1.push(S1)}}}class y{constructor(H){let W={},K=[];for(let t1 in H){let M1=H[t1],I1=W[t1]={};for(let R1 in M1){let D1=M1[+R1];if(!D1||D1.bitmap.width===0||D1.bitmap.height===0)continue;let h2={x:0,y:0,w:D1.bitmap.width+2,h:D1.bitmap.height+2};K.push(h2),I1[R1]={rect:h2,metrics:D1.metrics}}}let{w:l1,h:C1}=L.p(K),S1=new L.r({width:l1||1,height:C1||1});for(let t1 in H){let M1=H[t1];for(let I1 in M1){let R1=M1[+I1];if(!R1||R1.bitmap.width===0||R1.bitmap.height===0)continue;let D1=W[t1][I1].rect;L.r.copy(R1.bitmap,S1,{x:0,y:0},{x:D1.x+1,y:D1.y+1},R1.bitmap)}}this.image=S1,this.positions=W}}L.cH("GlyphAtlas",y);class M{constructor(H){this.tileID=new L.a0(H.tileID.overscaledZ,H.tileID.wrap,H.tileID.canonical.z,H.tileID.canonical.x,H.tileID.canonical.y),this.uid=H.uid,this.zoom=H.zoom,this.pixelRatio=H.pixelRatio,this.tileSize=H.tileSize,this.source=H.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=H.showCollisionBoxes,this.collectResourceTiming=!!H.collectResourceTiming,this.returnDependencies=!!H.returnDependencies,this.promoteId=H.promoteId,this.inFlightDependencies=[]}parse(H,W,K,l1,C1){return L._(this,void 0,void 0,(function*(){this.status="parsing",this.data=H,this.collisionBoxArray=new L.ac;let S1=new L.cI(Object.keys(H.layers).sort()),t1=new L.cJ(this.tileID,this.promoteId);t1.bucketLayerIDs=[];let M1={},I1={featureIndex:t1,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:K,subdivisionGranularity:C1},R1=W.familiesBySource[this.source];for(let L2 in R1){let _2=H.layers[L2];if(!_2)continue;_2.version===1&&L.w(`Vector tile source "${this.source}" layer "${L2}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Wt=S1.encode(L2),M8=[];for(let It=0;It<_2.length;It++){let V2=_2.feature(It),M3=t1.getId(V2,L2);M8.push({feature:V2,id:M3,index:It,sourceLayerIndex:Wt})}for(let It of R1[L2]){let V2=It[0];V2.source!==this.source&&L.w(`layer.source = ${V2.source} does not equal this.source = ${this.source}`),V2.isHidden(this.zoom,!0)||(S(It,this.zoom,K),(M1[V2.id]=V2.createBucket({index:t1.bucketLayerIDs.length,layers:It,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(M8,I1,this.tileID.canonical),t1.bucketLayerIDs.push(It.map((M3=>M3.id))))}}let D1=L.bS(I1.glyphDependencies,(L2=>Object.keys(L2).map(Number)));this.inFlightDependencies.forEach((L2=>L2?.abort())),this.inFlightDependencies=[];let h2=Promise.resolve({});if(Object.keys(D1).length){let L2=new AbortController;this.inFlightDependencies.push(L2),h2=l1.sendAsync({type:"GG",data:{stacks:D1,source:this.source,tileID:this.tileID,type:"glyphs"}},L2)}let w2=Object.keys(I1.iconDependencies),k2=Promise.resolve({});if(w2.length){let L2=new AbortController;this.inFlightDependencies.push(L2),k2=l1.sendAsync({type:"GI",data:{icons:w2,source:this.source,tileID:this.tileID,type:"icons"}},L2)}let z5=Object.keys(I1.patternDependencies),H2=Promise.resolve({});if(z5.length){let L2=new AbortController;this.inFlightDependencies.push(L2),H2=l1.sendAsync({type:"GI",data:{icons:z5,source:this.source,tileID:this.tileID,type:"patterns"}},L2)}let O2=I1.dashDependencies,_5=Promise.resolve({});if(Object.keys(O2).length){let L2=new AbortController;this.inFlightDependencies.push(L2),_5=l1.sendAsync({type:"GDA",data:{dashes:O2}},L2)}let[H1,p5,a5,I5]=yield Promise.all([h2,k2,H2,_5]),f5=new y(H1),G1=new L.cK(p5,a5);for(let L2 in M1){let _2=M1[L2];_2 instanceof L.ad?(S(_2.layers,this.zoom,K),L.cL({bucket:_2,glyphMap:H1,glyphPositions:f5.positions,imageMap:p5,imagePositions:G1.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:I1.subdivisionGranularity})):_2.hasDependencies&&(_2 instanceof L.cM||_2 instanceof L.cN||_2 instanceof L.cO)&&(S(_2.layers,this.zoom,K),_2.addFeatures(I1,this.tileID.canonical,G1.patternPositions,I5))}return this.status="done",{buckets:Object.values(M1).filter((L2=>!L2.isEmpty())),featureIndex:t1,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:f5.image,imageAtlas:G1,dashPositions:I5,glyphMap:this.returnDependencies?H1:null,iconMap:this.returnDependencies?p5:null,glyphPositions:this.returnDependencies?f5.positions:null}}))}}function S(p1,H,W){let K=new L.G(H);for(let l1 of p1)l1.recalculate(K,W)}class E extends L.cR{constructor(H,W){super(new L.cQ,0,W,[],[]),this.feature=H,this.type=H.type,this.properties=H.tags?H.tags:{},"id"in H&&(typeof H.id=="string"?this.id=parseInt(H.id,10):typeof H.id!="number"||isNaN(H.id)||(this.id=H.id))}loadGeometry(){let H=[],W=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let K of W){let l1=[];for(let C1 of K)l1.push(new L.P(C1[0],C1[1]));H.push(l1)}return H}}class Z extends L.cP{constructor(H,W){super(new L.cQ),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.version=W?W.version:1,this.extent=W?W.extent:4096,this.length=H.length,this.features=H}feature(H){return new E(this.features[H],this.extent)}}function F(p1,H){H.writeVarintField(15,p1.version||1),H.writeStringField(1,p1.name||""),H.writeVarintField(5,p1.extent||4096);let W={keys:[],values:[],keycache:{},valuecache:{}};for(let C1=0;C1<p1.length;C1++)W.feature=p1.feature(C1),H.writeMessage(2,G,W);let K=W.keys;for(let C1 of K)H.writeStringField(3,C1);let l1=W.values;for(let C1 of l1)H.writeMessage(4,a1,C1)}function G(p1,H){if(!p1.feature)return;let W=p1.feature;W.id!==void 0&&H.writeVarintField(1,W.id),H.writeMessage(2,j,p1),H.writeVarintField(3,W.type),H.writeMessage(4,X,W)}function j(p1,H){for(let W in p1.feature?.properties){let K=p1.feature.properties[W],l1=p1.keycache[W];if(K===null)continue;l1===void 0&&(p1.keys.push(W),l1=p1.keys.length-1,p1.keycache[W]=l1),H.writeVarint(l1),typeof K!="string"&&typeof K!="boolean"&&typeof K!="number"&&(K=JSON.stringify(K));let C1=typeof K+":"+K,S1=p1.valuecache[C1];S1===void 0&&(p1.values.push(K),S1=p1.values.length-1,p1.valuecache[C1]=S1),H.writeVarint(S1)}}function R(p1,H){return(H<<3)+(7&p1)}function r1(p1){return p1<<1^p1>>31}function X(p1,H){let W=p1.loadGeometry(),K=p1.type,l1=0,C1=0;for(let S1 of W){let t1=1;K===1&&(t1=S1.length),H.writeVarint(R(1,t1));let M1=K===3?S1.length-1:S1.length;for(let I1=0;I1<M1;I1++){I1===1&&K!==1&&H.writeVarint(R(2,M1-1));let R1=S1[I1].x-l1,D1=S1[I1].y-C1;H.writeVarint(r1(R1)),H.writeVarint(r1(D1)),l1+=R1,C1+=D1}p1.type===3&&H.writeVarint(R(7,1))}}function a1(p1,H){let W=typeof p1;W==="string"?H.writeStringField(1,p1):W==="boolean"?H.writeBooleanField(7,p1):W==="number"&&(p1%1!=0?H.writeDoubleField(3,p1):p1<0?H.writeSVarintField(6,p1):H.writeVarintField(5,p1))}class d1 extends L.cR{constructor(H,W,K,l1,C1){super(new L.cQ,0,C1,[],[]),this.type=H,this.properties=K||{},this.extent=C1,this.pointsArray=W,this.id=l1}loadGeometry(){return this.pointsArray.map((H=>H.map((W=>new L.P(W.x,W.y)))))}}class s1 extends L.cP{constructor(H,W,K){super(new L.cQ),this.version=2,this._myFeatures=H,this.name=W,this.length=H.length,this.extent=K}feature(H){return this._myFeatures[H]}}class y1{constructor(){this.layers={}}addLayer(H){this.layers[H.name]=H}}function m1(p1){let H=(function(W){let K=new L.cQ;return(function(l1,C1){for(let S1 in l1.layers)C1.writeMessage(3,F,l1.layers[S1])})(W,K),K.finish()})(p1);return H.byteOffset===0&&H.byteLength===H.buffer.byteLength||(H=new Uint8Array(H)),{vectorTile:p1,rawData:H.buffer}}function w1(p1,H,W){let{extent:K}=p1,l1=Math.pow(2,W.z-H.z),C1=(W.x-H.x*l1)*K,S1=(W.y-H.y*l1)*K,t1=[];for(let M1=0;M1<p1.length;M1++){let I1=p1.feature(M1),R1=I1.loadGeometry();for(let h2 of R1)for(let w2 of h2)w2.x=w2.x*l1-C1,w2.y=w2.y*l1-S1;let D1=128;R1=L.cS(R1,I1.type,-D1,-D1,K+D1,K+D1),R1.length!==0&&t1.push(new d1(I1.type,R1,I1.properties,I1.id,K))}return new s1(t1,p1.name,K)}class z1{constructor(H,W,K){this.actor=H,this.layerIndex=W,this.availableImages=K,this.fetching={},this.loading={},this.loaded={},this.overzoomedTileResultCache=new L.cT(1e3)}loadVectorTile(H,W){return L._(this,void 0,void 0,(function*(){let K=yield L.n(H.request,W);try{return{vectorTile:H.encoding!=="mlt"?new L.cU(new L.cQ(K.data)):new L.cV(K.data),rawData:K.data,cacheControl:K.cacheControl,expires:K.expires}}catch(l1){let C1=new Uint8Array(K.data),S1=`Unable to parse the tile at ${H.request.url}, `;throw S1+=C1[0]===31&&C1[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${l1.message}`,new Error(S1)}}))}loadTile(H){return L._(this,void 0,void 0,(function*(){let{uid:W,overzoomParameters:K}=H;K&&(H.request=K.overzoomRequest);let l1=!!(H&&H.request&&H.request.collectResourceTiming)&&new L.cW(H.request),C1=new M(H);this.loading[W]=C1;let S1=new AbortController;C1.abort=S1;try{let t1=yield this.loadVectorTile(H,S1);if(delete this.loading[W],!t1)return null;if(K){let h2=this._getOverzoomTile(H,t1.vectorTile);t1.rawData=h2.rawData,t1.vectorTile=h2.vectorTile}let M1=t1.rawData,I1={};t1.expires&&(I1.expires=t1.expires),t1.cacheControl&&(I1.cacheControl=t1.cacheControl);let R1={};if(l1){let h2=l1.finish();h2&&(R1.resourceTiming=JSON.parse(JSON.stringify(h2)))}C1.vectorTile=t1.vectorTile;let D1=C1.parse(t1.vectorTile,this.layerIndex,this.availableImages,this.actor,H.subdivisionGranularity);this.loaded[W]=C1,this.fetching[W]={rawTileData:M1,cacheControl:I1,resourceTiming:R1};try{let h2=yield D1;return L.e({rawTileData:M1.slice(0),encoding:H.encoding},h2,I1,R1)}finally{delete this.fetching[W]}}catch(t1){throw delete this.loading[W],C1.status="done",this.loaded[W]=C1,t1}}))}_getOverzoomTile(H,W){let{tileID:K,source:l1,overzoomParameters:C1}=H,{maxZoomTileID:S1}=C1,t1=`${S1.key}_${K.key}`,M1=this.overzoomedTileResultCache.get(t1);if(M1)return M1;let I1=new y1,R1=this.layerIndex.familiesBySource[l1];for(let h2 in R1){let w2=W.layers[h2];if(!w2)continue;let k2=w1(w2,S1,K.canonical);k2.length>0&&I1.addLayer(k2)}let D1=m1(I1);return this.overzoomedTileResultCache.set(t1,D1),D1}reloadTile(H){return L._(this,void 0,void 0,(function*(){let W=H.uid;if(!this.loaded||!this.loaded[W])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let K=this.loaded[W];if(K.showCollisionBoxes=H.showCollisionBoxes,K.status==="parsing"){let l1=yield K.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor,H.subdivisionGranularity),C1;if(this.fetching[W]){let{rawTileData:S1,cacheControl:t1,resourceTiming:M1}=this.fetching[W];delete this.fetching[W],C1=L.e({rawTileData:S1.slice(0),encoding:H.encoding},l1,t1,M1)}else C1=l1;return C1}if(K.status==="done"&&K.vectorTile)return K.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor,H.subdivisionGranularity)}))}abortTile(H){return L._(this,void 0,void 0,(function*(){let W=this.loading,K=H.uid;W&&W[K]&&W[K].abort&&(W[K].abort.abort(),delete W[K])}))}removeTile(H){return L._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[H.uid]&&delete this.loaded[H.uid]}))}}class O1{constructor(){this.loaded={}}loadTile(H){return L._(this,void 0,void 0,(function*(){let{uid:W,encoding:K,rawImageData:l1,redFactor:C1,greenFactor:S1,blueFactor:t1,baseShift:M1}=H,I1=l1.width+2,R1=l1.height+2,D1=L.b(l1)?new L.R({width:I1,height:R1},yield L.cX(l1,-1,-1,I1,R1)):l1,h2=new L.cY(W,D1,K,C1,S1,t1,M1);return this.loaded=this.loaded||{},this.loaded[W]=h2,h2}))}removeTile(H){let W=this.loaded,K=H.uid;W&&W[K]&&delete W[K]}}var U1,e2,s2=(function(){if(e2)return U1;function p1(W,K){if(W.length!==0){H(W[0],K);for(var l1=1;l1<W.length;l1++)H(W[l1],!K)}}function H(W,K){for(var l1=0,C1=0,S1=0,t1=W.length,M1=t1-1;S1<t1;M1=S1++){var I1=(W[S1][0]-W[M1][0])*(W[M1][1]+W[S1][1]),R1=l1+I1;C1+=Math.abs(l1)>=Math.abs(I1)?l1-R1+I1:I1-R1+l1,l1=R1}l1+C1>=0!=!!K&&W.reverse()}return e2=1,U1=function W(K,l1){var C1,S1=K&&K.type;if(S1==="FeatureCollection")for(C1=0;C1<K.features.length;C1++)W(K.features[C1],l1);else if(S1==="GeometryCollection")for(C1=0;C1<K.geometries.length;C1++)W(K.geometries[C1],l1);else if(S1==="Feature")W(K.geometry,l1);else if(S1==="Polygon")p1(K.coordinates,l1);else if(S1==="MultiPolygon")for(C1=0;C1<K.coordinates.length;C1++)p1(K.coordinates[C1],l1);return K}})(),N1=L.cZ(s2);let o2={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:p1=>p1},p2=Math.fround||(T2=new Float32Array(1),p1=>(T2[0]=+p1,T2[0]));var T2;class l2{constructor(H){this.options=Object.assign(Object.create(o2),H),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(H){let{log:W,minZoom:K,maxZoom:l1}=this.options;W&&console.time("total time");let C1=`prepare ${H.length} points`;W&&console.time(C1),this.points=H;let S1=[];for(let M1=0;M1<H.length;M1++){let I1=H[M1];if(!I1.geometry)continue;let[R1,D1]=I1.geometry.coordinates,h2=p2(b2(R1)),w2=p2(d2(D1));S1.push(h2,w2,1/0,M1,-1,1),this.options.reduce&&S1.push(0)}let t1=this.trees[l1+1]=this._createTree(S1);W&&console.timeEnd(C1);for(let M1=l1;M1>=K;M1--){let I1=+Date.now();t1=this.trees[M1]=this._createTree(this._cluster(t1,M1)),W&&console.log("z%d: %d clusters in %dms",M1,t1.numItems,+Date.now()-I1)}return W&&console.timeEnd("total time"),this}getClusters(H,W){let K=((H[0]+180)%360+360)%360-180,l1=Math.max(-90,Math.min(90,H[1])),C1=H[2]===180?180:((H[2]+180)%360+360)%360-180,S1=Math.max(-90,Math.min(90,H[3]));if(H[2]-H[0]>=360)K=-180,C1=180;else if(K>C1){let D1=this.getClusters([K,l1,180,S1],W),h2=this.getClusters([-180,l1,C1,S1],W);return D1.concat(h2)}let t1=this.trees[this._limitZoom(W)],M1=t1.range(b2(K),d2(S1),b2(C1),d2(l1)),I1=t1.data,R1=[];for(let D1 of M1){let h2=this.stride*D1;R1.push(I1[h2+5]>1?Y1(I1,h2,this.clusterProps):this.points[I1[h2+3]])}return R1}getChildren(H){let W=this._getOriginId(H),K=this._getOriginZoom(H),l1="No cluster with the specified id.",C1=this.trees[K];if(!C1)throw new Error(l1);let S1=C1.data;if(W*this.stride>=S1.length)throw new Error(l1);let t1=this.options.radius/(this.options.extent*Math.pow(2,K-1)),M1=C1.within(S1[W*this.stride],S1[W*this.stride+1],t1),I1=[];for(let R1 of M1){let D1=R1*this.stride;S1[D1+4]===H&&I1.push(S1[D1+5]>1?Y1(S1,D1,this.clusterProps):this.points[S1[D1+3]])}if(I1.length===0)throw new Error(l1);return I1}getLeaves(H,W,K){let l1=[];return this._appendLeaves(l1,H,W=W||10,K=K||0,0),l1}getTile(H,W,K){let l1=this.trees[this._limitZoom(H)],C1=Math.pow(2,H),{extent:S1,radius:t1}=this.options,M1=t1/S1,I1=(K-M1)/C1,R1=(K+1+M1)/C1,D1={features:[]};return this._addTileFeatures(l1.range((W-M1)/C1,I1,(W+1+M1)/C1,R1),l1.data,W,K,C1,D1),W===0&&this._addTileFeatures(l1.range(1-M1/C1,I1,1,R1),l1.data,C1,K,C1,D1),W===C1-1&&this._addTileFeatures(l1.range(0,I1,M1/C1,R1),l1.data,-1,K,C1,D1),D1.features.length?D1:null}getClusterExpansionZoom(H){let W=this._getOriginZoom(H)-1;for(;W<=this.options.maxZoom;){let K=this.getChildren(H);if(W++,K.length!==1)break;H=K[0].properties.cluster_id}return W}_appendLeaves(H,W,K,l1,C1){let S1=this.getChildren(W);for(let t1 of S1){let M1=t1.properties;if(M1&&M1.cluster?C1+M1.point_count<=l1?C1+=M1.point_count:C1=this._appendLeaves(H,M1.cluster_id,K,l1,C1):C1<l1?C1++:H.push(t1),H.length===K)break}return C1}_createTree(H){let W=new L.aN(H.length/this.stride|0,this.options.nodeSize,Float32Array);for(let K=0;K<H.length;K+=this.stride)W.add(H[K],H[K+1]);return W.finish(),W.data=H,W}_addTileFeatures(H,W,K,l1,C1,S1){for(let t1 of H){let M1=t1*this.stride,I1=W[M1+5]>1,R1,D1,h2;if(I1)R1=f2(W,M1,this.clusterProps),D1=W[M1],h2=W[M1+1];else{let z5=this.points[W[M1+3]];R1=z5.properties;let[H2,O2]=z5.geometry.coordinates;D1=b2(H2),h2=d2(O2)}let w2={type:1,geometry:[[Math.round(this.options.extent*(D1*C1-K)),Math.round(this.options.extent*(h2*C1-l1))]],tags:R1},k2;k2=I1||this.options.generateId?W[M1+3]:this.points[W[M1+3]].id,k2!==void 0&&(w2.id=k2),S1.features.push(w2)}}_limitZoom(H){return Math.max(this.options.minZoom,Math.min(Math.floor(+H),this.options.maxZoom+1))}_cluster(H,W){let{radius:K,extent:l1,reduce:C1,minPoints:S1}=this.options,t1=K/(l1*Math.pow(2,W)),M1=H.data,I1=[],R1=this.stride;for(let D1=0;D1<M1.length;D1+=R1){if(M1[D1+2]<=W)continue;M1[D1+2]=W;let h2=M1[D1],w2=M1[D1+1],k2=H.within(M1[D1],M1[D1+1],t1),z5=M1[D1+5],H2=z5;for(let O2 of k2){let _5=O2*R1;M1[_5+2]>W&&(H2+=M1[_5+5])}if(H2>z5&&H2>=S1){let O2,_5=h2*z5,H1=w2*z5,p5=-1,a5=(D1/R1<<5)+(W+1)+this.points.length;for(let I5 of k2){let f5=I5*R1;if(M1[f5+2]<=W)continue;M1[f5+2]=W;let G1=M1[f5+5];_5+=M1[f5]*G1,H1+=M1[f5+1]*G1,M1[f5+4]=a5,C1&&(O2||(O2=this._map(M1,D1,!0),p5=this.clusterProps.length,this.clusterProps.push(O2)),C1(O2,this._map(M1,f5)))}M1[D1+4]=a5,I1.push(_5/H2,H1/H2,1/0,a5,-1,H2),C1&&I1.push(p5)}else{for(let O2=0;O2<R1;O2++)I1.push(M1[D1+O2]);if(H2>1)for(let O2 of k2){let _5=O2*R1;if(!(M1[_5+2]<=W)){M1[_5+2]=W;for(let H1=0;H1<R1;H1++)I1.push(M1[_5+H1])}}}}return I1}_getOriginId(H){return H-this.points.length>>5}_getOriginZoom(H){return(H-this.points.length)%32}_map(H,W,K){if(H[W+5]>1){let S1=this.clusterProps[H[W+6]];return K?Object.assign({},S1):S1}let l1=this.points[H[W+3]].properties,C1=this.options.map(l1);return K&&C1===l1?Object.assign({},C1):C1}}function Y1(p1,H,W){return{type:"Feature",id:p1[H+3],properties:f2(p1,H,W),geometry:{type:"Point",coordinates:[(K=p1[H],360*(K-.5)),R2(p1[H+1])]}};var K}function f2(p1,H,W){let K=p1[H+5],l1=K>=1e4?`${Math.round(K/1e3)}k`:K>=1e3?Math.round(K/100)/10+"k":K,C1=p1[H+6],S1=C1===-1?{}:Object.assign({},W[C1]);return Object.assign(S1,{cluster:!0,cluster_id:p1[H+3],point_count:K,point_count_abbreviated:l1})}function b2(p1){return p1/360+.5}function d2(p1){let H=Math.sin(p1*Math.PI/180),W=.5-.25*Math.log((1+H)/(1-H))/Math.PI;return W<0?0:W>1?1:W}function R2(p1){let H=(180-360*p1)*Math.PI/180;return 360*Math.atan(Math.exp(H))/Math.PI-90}function J2(p1,H,W,K){let l1=K,C1=H+(W-H>>1),S1,t1=W-H,M1=p1[H],I1=p1[H+1],R1=p1[W],D1=p1[W+1];for(let h2=H+3;h2<W;h2+=3){let w2=v5(p1[h2],p1[h2+1],M1,I1,R1,D1);if(w2>l1)S1=h2,l1=w2;else if(w2===l1){let k2=Math.abs(h2-C1);k2<t1&&(S1=h2,t1=k2)}}l1>K&&(S1-H>3&&J2(p1,H,S1,K),p1[S1+2]=l1,W-S1>3&&J2(p1,S1,W,K))}function v5(p1,H,W,K,l1,C1){let S1=l1-W,t1=C1-K;if(S1!==0||t1!==0){let M1=((p1-W)*S1+(H-K)*t1)/(S1*S1+t1*t1);M1>1?(W=l1,K=C1):M1>0&&(W+=S1*M1,K+=t1*M1)}return S1=p1-W,t1=H-K,S1*S1+t1*t1}function F1(p1,H,W,K){let l1={id:p1??null,type:H,geometry:W,tags:K,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(H==="Point"||H==="MultiPoint"||H==="LineString")i5(l1,W);else if(H==="Polygon")i5(l1,W[0]);else if(H==="MultiLineString")for(let C1 of W)i5(l1,C1);else if(H==="MultiPolygon")for(let C1 of W)i5(l1,C1[0]);return l1}function i5(p1,H){for(let W=0;W<H.length;W+=3)p1.minX=Math.min(p1.minX,H[W]),p1.minY=Math.min(p1.minY,H[W+1]),p1.maxX=Math.max(p1.maxX,H[W]),p1.maxY=Math.max(p1.maxY,H[W+1])}function N2(p1,H,W,K){if(!H.geometry)return;let l1=H.geometry.coordinates;if(l1&&l1.length===0)return;let C1=H.geometry.type,S1=Math.pow(W.tolerance/((1<<W.maxZoom)*W.extent),2),t1=[],M1=H.id;if(W.promoteId?M1=H.properties[W.promoteId]:W.generateId&&(M1=K||0),C1==="Point")g2(l1,t1);else if(C1==="MultiPoint")for(let I1 of l1)g2(I1,t1);else if(C1==="LineString")L5(l1,t1,S1,!1);else if(C1==="MultiLineString"){if(W.lineMetrics){for(let I1 of l1)t1=[],L5(I1,t1,S1,!1),p1.push(F1(M1,"LineString",t1,H.properties));return}x5(l1,t1,S1,!1)}else if(C1==="Polygon")x5(l1,t1,S1,!0);else{if(C1!=="MultiPolygon"){if(C1==="GeometryCollection"){for(let I1 of H.geometry.geometries)N2(p1,{id:M1,geometry:I1,properties:H.properties},W,K);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let I1 of l1){let R1=[];x5(I1,R1,S1,!0),t1.push(R1)}}p1.push(F1(M1,C1,t1,H.properties))}function g2(p1,H){H.push(Q2(p1[0]),Z5(p1[1]),0)}function L5(p1,H,W,K){let l1,C1,S1=0;for(let M1=0;M1<p1.length;M1++){let I1=Q2(p1[M1][0]),R1=Z5(p1[M1][1]);H.push(I1,R1,0),M1>0&&(S1+=K?(l1*R1-I1*C1)/2:Math.sqrt(Math.pow(I1-l1,2)+Math.pow(R1-C1,2))),l1=I1,C1=R1}let t1=H.length-3;H[2]=1,J2(H,0,t1,W),H[t1+2]=1,H.size=Math.abs(S1),H.start=0,H.end=H.size}function x5(p1,H,W,K){for(let l1=0;l1<p1.length;l1++){let C1=[];L5(p1[l1],C1,W,K),H.push(C1)}}function Q2(p1){return p1/360+.5}function Z5(p1){let H=Math.sin(p1*Math.PI/180),W=.5-.25*Math.log((1+H)/(1-H))/Math.PI;return W<0?0:W>1?1:W}function U2(p1,H,W,K,l1,C1,S1,t1){if(K/=H,C1>=(W/=H)&&S1<K)return p1;if(S1<W||C1>=K)return null;let M1=[];for(let I1 of p1){let R1=I1.geometry,D1=I1.type,h2=l1===0?I1.minX:I1.minY,w2=l1===0?I1.maxX:I1.maxY;if(h2>=W&&w2<K){M1.push(I1);continue}if(w2<W||h2>=K)continue;let k2=[];if(D1==="Point"||D1==="MultiPoint")m2(R1,k2,W,K,l1);else if(D1==="LineString")o5(R1,k2,W,K,l1,!1,t1.lineMetrics);else if(D1==="MultiLineString")X2(R1,k2,W,K,l1,!1);else if(D1==="Polygon")X2(R1,k2,W,K,l1,!0);else if(D1==="MultiPolygon")for(let z5 of R1){let H2=[];X2(z5,H2,W,K,l1,!0),H2.length&&k2.push(H2)}if(k2.length){if(t1.lineMetrics&&D1==="LineString"){for(let z5 of k2)M1.push(F1(I1.id,D1,z5,I1.tags));continue}D1!=="LineString"&&D1!=="MultiLineString"||(k2.length===1?(D1="LineString",k2=k2[0]):D1="MultiLineString"),D1!=="Point"&&D1!=="MultiPoint"||(D1=k2.length===3?"Point":"MultiPoint"),M1.push(F1(I1.id,D1,k2,I1.tags))}}return M1.length?M1:null}function m2(p1,H,W,K,l1){for(let C1=0;C1<p1.length;C1+=3){let S1=p1[C1+l1];S1>=W&&S1<=K&&C5(H,p1[C1],p1[C1+1],p1[C1+2])}}function o5(p1,H,W,K,l1,C1,S1){let t1=e5(p1),M1=l1===0?ht:R5,I1,R1,D1=p1.start;for(let H2=0;H2<p1.length-3;H2+=3){let O2=p1[H2],_5=p1[H2+1],H1=p1[H2+2],p5=p1[H2+3],a5=p1[H2+4],I5=l1===0?O2:_5,f5=l1===0?p5:a5,G1=!1;S1&&(I1=Math.sqrt(Math.pow(O2-p5,2)+Math.pow(_5-a5,2))),I5<W?f5>W&&(R1=M1(t1,O2,_5,p5,a5,W),S1&&(t1.start=D1+I1*R1)):I5>K?f5<K&&(R1=M1(t1,O2,_5,p5,a5,K),S1&&(t1.start=D1+I1*R1)):C5(t1,O2,_5,H1),f5<W&&I5>=W&&(R1=M1(t1,O2,_5,p5,a5,W),G1=!0),f5>K&&I5<=K&&(R1=M1(t1,O2,_5,p5,a5,K),G1=!0),!C1&&G1&&(S1&&(t1.end=D1+I1*R1),H.push(t1),t1=e5(p1)),S1&&(D1+=I1)}let h2=p1.length-3,w2=p1[h2],k2=p1[h2+1],z5=l1===0?w2:k2;z5>=W&&z5<=K&&C5(t1,w2,k2,p1[h2+2]),h2=t1.length-3,C1&&h2>=3&&(t1[h2]!==t1[0]||t1[h2+1]!==t1[1])&&C5(t1,t1[0],t1[1],t1[2]),t1.length&&H.push(t1)}function e5(p1){let H=[];return H.size=p1.size,H.start=p1.start,H.end=p1.end,H}function X2(p1,H,W,K,l1,C1){for(let S1 of p1)o5(S1,H,W,K,l1,C1,!1)}function C5(p1,H,W,K){p1.push(H,W,K)}function ht(p1,H,W,K,l1,C1){let S1=(C1-H)/(K-H);return C5(p1,C1,W+(l1-W)*S1,1),S1}function R5(p1,H,W,K,l1,C1){let S1=(C1-W)/(l1-W);return C5(p1,H+(K-H)*S1,C1,1),S1}function d5(p1,H){let W=[];for(let K=0;K<p1.length;K++){let l1=p1[K],C1=l1.type,S1;if(C1==="Point"||C1==="MultiPoint"||C1==="LineString")S1=w5(l1.geometry,H);else if(C1==="MultiLineString"||C1==="Polygon"){S1=[];for(let t1 of l1.geometry)S1.push(w5(t1,H))}else if(C1==="MultiPolygon"){S1=[];for(let t1 of l1.geometry){let M1=[];for(let I1 of t1)M1.push(w5(I1,H));S1.push(M1)}}W.push(F1(l1.id,C1,S1,l1.tags))}return W}function w5(p1,H){let W=[];W.size=p1.size,p1.start!==void 0&&(W.start=p1.start,W.end=p1.end);for(let K=0;K<p1.length;K+=3)W.push(p1[K]+H,p1[K+1],p1[K+2]);return W}function W2(p1,H){if(p1.transformed)return p1;let W=1<<p1.z,K=p1.x,l1=p1.y;for(let C1 of p1.features){let S1=C1.geometry,t1=C1.type;if(C1.geometry=[],t1===1)for(let M1=0;M1<S1.length;M1+=2)C1.geometry.push(u5(S1[M1],S1[M1+1],H,W,K,l1));else for(let M1=0;M1<S1.length;M1++){let I1=[];for(let R1=0;R1<S1[M1].length;R1+=2)I1.push(u5(S1[M1][R1],S1[M1][R1+1],H,W,K,l1));C1.geometry.push(I1)}}return p1.transformed=!0,p1}function u5(p1,H,W,K,l1,C1){return[Math.round(W*(p1*K-l1)),Math.round(W*(H*K-C1))]}function Y2(p1,H,W,K,l1){let C1=H===l1.maxZoom?0:l1.tolerance/((1<<H)*l1.extent),S1={features:[],numPoints:0,numSimplified:0,numFeatures:p1.length,source:null,x:W,y:K,z:H,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let t1 of p1)P5(S1,t1,C1,l1);return S1}function P5(p1,H,W,K){let l1=H.geometry,C1=H.type,S1=[];if(p1.minX=Math.min(p1.minX,H.minX),p1.minY=Math.min(p1.minY,H.minY),p1.maxX=Math.max(p1.maxX,H.maxX),p1.maxY=Math.max(p1.maxY,H.maxY),C1==="Point"||C1==="MultiPoint")for(let t1=0;t1<l1.length;t1+=3)S1.push(l1[t1],l1[t1+1]),p1.numPoints++,p1.numSimplified++;else if(C1==="LineString")it(S1,l1,p1,W,!1,!1);else if(C1==="MultiLineString"||C1==="Polygon")for(let t1=0;t1<l1.length;t1++)it(S1,l1[t1],p1,W,C1==="Polygon",t1===0);else if(C1==="MultiPolygon")for(let t1=0;t1<l1.length;t1++){let M1=l1[t1];for(let I1=0;I1<M1.length;I1++)it(S1,M1[I1],p1,W,!0,I1===0)}if(S1.length){let t1=H.tags||null;if(C1==="LineString"&&K.lineMetrics){t1={};for(let I1 in H.tags)t1[I1]=H.tags[I1];t1.mapbox_clip_start=l1.start/l1.size,t1.mapbox_clip_end=l1.end/l1.size}let M1={geometry:S1,type:C1==="Polygon"||C1==="MultiPolygon"?3:C1==="LineString"||C1==="MultiLineString"?2:1,tags:t1};H.id!==null&&(M1.id=H.id),p1.features.push(M1)}}function it(p1,H,W,K,l1,C1){let S1=K*K;if(K>0&&H.size<(l1?S1:K))return void(W.numPoints+=H.length/3);let t1=[];for(let M1=0;M1<H.length;M1+=3)(K===0||H[M1+2]>S1)&&(W.numSimplified++,t1.push(H[M1],H[M1+1])),W.numPoints++;l1&&(function(M1,I1){let R1=0;for(let D1=0,h2=M1.length,w2=h2-2;D1<h2;w2=D1,D1+=2)R1+=(M1[D1]-M1[w2])*(M1[D1+1]+M1[w2+1]);if(R1>0===I1)for(let D1=0,h2=M1.length;D1<h2/2;D1+=2){let w2=M1[D1],k2=M1[D1+1];M1[D1]=M1[h2-2-D1],M1[D1+1]=M1[h2-1-D1],M1[h2-2-D1]=w2,M1[h2-1-D1]=k2}})(t1,C1),p1.push(t1)}let E5={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class D5{constructor(H,W){let K=(W=this.options=(function(C1,S1){for(let t1 in S1)C1[t1]=S1[t1];return C1})(Object.create(E5),W)).debug;if(K&&console.time("preprocess data"),W.maxZoom<0||W.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(W.promoteId&&W.generateId)throw new Error("promoteId and generateId cannot be used together.");let l1=(function(C1,S1){let t1=[];if(C1.type==="FeatureCollection")for(let M1=0;M1<C1.features.length;M1++)N2(t1,C1.features[M1],S1,M1);else N2(t1,C1.type==="Feature"?C1:{geometry:C1},S1);return t1})(H,W);this.tiles={},this.tileCoords=[],K&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",W.indexMaxZoom,W.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),l1=(function(C1,S1){let t1=S1.buffer/S1.extent,M1=C1,I1=U2(C1,1,-1-t1,t1,0,-1,2,S1),R1=U2(C1,1,1-t1,2+t1,0,-1,2,S1);return(I1||R1)&&(M1=U2(C1,1,-t1,1+t1,0,-1,2,S1)||[],I1&&(M1=d5(I1,1).concat(M1)),R1&&(M1=M1.concat(d5(R1,-1)))),M1})(l1,W),l1.length&&this.splitTile(l1,0,0,0),K&&(l1.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(H,W,K,l1,C1,S1,t1){let M1=[H,W,K,l1],I1=this.options,R1=I1.debug;for(;M1.length;){l1=M1.pop(),K=M1.pop(),W=M1.pop(),H=M1.pop();let D1=1<<W,h2=Vt(W,K,l1),w2=this.tiles[h2];if(!w2&&(R1>1&&console.time("creation"),w2=this.tiles[h2]=Y2(H,W,K,l1,I1),this.tileCoords.push({z:W,x:K,y:l1}),R1)){R1>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",W,K,l1,w2.numFeatures,w2.numPoints,w2.numSimplified),console.timeEnd("creation"));let G1=`z${W}`;this.stats[G1]=(this.stats[G1]||0)+1,this.total++}if(w2.source=H,C1==null){if(W===I1.indexMaxZoom||w2.numPoints<=I1.indexMaxPoints)continue}else{if(W===I1.maxZoom||W===C1)continue;if(C1!=null){let G1=C1-W;if(K!==S1>>G1||l1!==t1>>G1)continue}}if(w2.source=null,H.length===0)continue;R1>1&&console.time("clipping");let k2=.5*I1.buffer/I1.extent,z5=.5-k2,H2=.5+k2,O2=1+k2,_5=null,H1=null,p5=null,a5=null,I5=U2(H,D1,K-k2,K+H2,0,w2.minX,w2.maxX,I1),f5=U2(H,D1,K+z5,K+O2,0,w2.minX,w2.maxX,I1);H=null,I5&&(_5=U2(I5,D1,l1-k2,l1+H2,1,w2.minY,w2.maxY,I1),H1=U2(I5,D1,l1+z5,l1+O2,1,w2.minY,w2.maxY,I1),I5=null),f5&&(p5=U2(f5,D1,l1-k2,l1+H2,1,w2.minY,w2.maxY,I1),a5=U2(f5,D1,l1+z5,l1+O2,1,w2.minY,w2.maxY,I1),f5=null),R1>1&&console.timeEnd("clipping"),M1.push(_5||[],W+1,2*K,2*l1),M1.push(H1||[],W+1,2*K,2*l1+1),M1.push(p5||[],W+1,2*K+1,2*l1),M1.push(a5||[],W+1,2*K+1,2*l1+1)}}getTile(H,W,K){H=+H,W=+W,K=+K;let l1=this.options,{extent:C1,debug:S1}=l1;if(H<0||H>24)return null;let t1=1<<H,M1=Vt(H,W=W+t1&t1-1,K);if(this.tiles[M1])return W2(this.tiles[M1],C1);S1>1&&console.log("drilling down to z%d-%d-%d",H,W,K);let I1,R1=H,D1=W,h2=K;for(;!I1&&R1>0;)R1--,D1>>=1,h2>>=1,I1=this.tiles[Vt(R1,D1,h2)];return I1&&I1.source?(S1>1&&(console.log("found parent tile z%d-%d-%d",R1,D1,h2),console.time("drilling down")),this.splitTile(I1.source,R1,D1,h2,H,W,K),S1>1&&console.timeEnd("drilling down"),this.tiles[M1]?W2(this.tiles[M1],C1):null):null}}function Vt(p1,H,W){return 32*((1<<p1)*W+H)+p1}class U5 extends z1{constructor(H,W,K,l1=F5){super(H,W,K),this._dataUpdateable=new Map,this._createGeoJSONIndex=l1}loadVectorTile(H,W){return L._(this,void 0,void 0,(function*(){let K=H.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let l1=this._geoJSONIndex.getTile(K.z,K.x,K.y);return l1?m1(new Z(l1.features,{version:2,extent:L.a3})):null}))}loadData(H){return L._(this,void 0,void 0,(function*(){var W;(W=this._pendingRequest)===null||W===void 0||W.abort();let K=!!(H&&H.request&&H.request.collectResourceTiming)&&new L.cW(H.request);this._pendingRequest=new AbortController;try{(!this._pendingData||H.request||H.data||H.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(H,this._pendingRequest));let l1=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(l1,H),this.loaded={};let C1={data:l1};if(K){let S1=K.finish();S1&&(C1.resourceTiming={},C1.resourceTiming[H.source]=JSON.parse(JSON.stringify(S1)))}return C1}catch(l1){if(delete this._pendingRequest,L.cC(l1))return{abandoned:!0};throw l1}}))}getData(){return L._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(H){let W=this.loaded;return W&&W[H.uid]?super.reloadTile(H):this.loadTile(H)}loadAndProcessGeoJSON(H,W){return L._(this,void 0,void 0,(function*(){let K=yield this.loadGeoJSON(H,W);if(delete this._pendingRequest,typeof K!="object")throw new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`);if(N1(K,!0),H.filter){let l1=L.c_(H.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(l1.result==="error")throw new Error(l1.value.map((S1=>`${S1.key}: ${S1.message}`)).join(", "));K={type:"FeatureCollection",features:K.features.filter((S1=>l1.value.evaluate({zoom:0},S1)))}}return K}))}loadGeoJSON(H,W){return L._(this,void 0,void 0,(function*(){let{promoteId:K}=H;if(H.request){let l1=yield L.j(H.request,W);return this._dataUpdateable=L.d0(l1.data,K)?L.c$(l1.data,K):void 0,l1.data}if(typeof H.data=="string")try{let l1=JSON.parse(H.data);return this._dataUpdateable=L.d0(l1,K)?L.c$(l1,K):void 0,l1}catch{throw new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`)}if(!H.dataDiff)throw new Error(`Input data given to '${H.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${H.source}`);return L.d1(this._dataUpdateable,H.dataDiff,K),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(H){return L._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(H){return this._geoJSONIndex.getClusterExpansionZoom(H.clusterId)}getClusterChildren(H){return this._geoJSONIndex.getChildren(H.clusterId)}getClusterLeaves(H){return this._geoJSONIndex.getLeaves(H.clusterId,H.limit,H.offset)}}function F5(p1,H){return H.cluster?new l2((function({superclusterOptions:W,clusterProperties:K}){if(!K||!W)return W;let l1={},C1={},S1={accumulated:null,zoom:0},t1={properties:null},M1=Object.keys(K);for(let I1 of M1){let[R1,D1]=K[I1],h2=L.c_(D1),w2=L.c_(typeof R1=="string"?[R1,["accumulated"],["get",I1]]:R1);l1[I1]=h2.value,C1[I1]=w2.value}return W.map=I1=>{t1.properties=I1;let R1={};for(let D1 of M1)R1[D1]=l1[D1].evaluate(S1,t1);return R1},W.reduce=(I1,R1)=>{t1.properties=R1;for(let D1 of M1)S1.accumulated=I1[D1],I1[D1]=C1[D1].evaluate(S1,t1)},W})(H)).load(p1.features):(function(W,K){return new D5(W,K)})(p1,H.geojsonVtOptions)}class lt{constructor(H){this.self=H,this.actor=new L.K(H),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(W,K)=>{if(this.externalWorkerSourceTypes[W])throw new Error(`Worker source with name "${W}" already registered.`);this.externalWorkerSourceTypes[W]=K},this.self.addProtocol=L.cE,this.self.removeProtocol=L.cF,this.self.registerRTLTextPlugin=W=>{L.d2.setMethods(W)},this.actor.registerMessageHandler("LDT",((W,K)=>this._getDEMWorkerSource(W,K.source).loadTile(K))),this.actor.registerMessageHandler("RDT",((W,K)=>L._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(W,K.source).removeTile(K)})))),this.actor.registerMessageHandler("GCEZ",((W,K)=>L._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,K.type,K.source).getClusterExpansionZoom(K)})))),this.actor.registerMessageHandler("GCC",((W,K)=>L._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,K.type,K.source).getClusterChildren(K)})))),this.actor.registerMessageHandler("GCL",((W,K)=>L._(this,void 0,void 0,(function*(){return this._getWorkerSource(W,K.type,K.source).getClusterLeaves(K)})))),this.actor.registerMessageHandler("LD",((W,K)=>this._getWorkerSource(W,K.type,K.source).loadData(K))),this.actor.registerMessageHandler("GD",((W,K)=>this._getWorkerSource(W,K.type,K.source).getData())),this.actor.registerMessageHandler("LT",((W,K)=>this._getWorkerSource(W,K.type,K.source).loadTile(K))),this.actor.registerMessageHandler("RT",((W,K)=>this._getWorkerSource(W,K.type,K.source).reloadTile(K))),this.actor.registerMessageHandler("AT",((W,K)=>this._getWorkerSource(W,K.type,K.source).abortTile(K))),this.actor.registerMessageHandler("RMT",((W,K)=>this._getWorkerSource(W,K.type,K.source).removeTile(K))),this.actor.registerMessageHandler("RS",((W,K)=>L._(this,void 0,void 0,(function*(){if(!this.workerSources[W]||!this.workerSources[W][K.type]||!this.workerSources[W][K.type][K.source])return;let l1=this.workerSources[W][K.type][K.source];delete this.workerSources[W][K.type][K.source],l1.removeSource!==void 0&&l1.removeSource(K)})))),this.actor.registerMessageHandler("RM",(W=>L._(this,void 0,void 0,(function*(){delete this.layerIndexes[W],delete this.availableImages[W],delete this.workerSources[W],delete this.demWorkerSources[W],this.globalStates.delete(W)})))),this.actor.registerMessageHandler("SR",((W,K)=>L._(this,void 0,void 0,(function*(){this.referrer=K})))),this.actor.registerMessageHandler("SRPS",((W,K)=>this._syncRTLPluginState(W,K))),this.actor.registerMessageHandler("IS",((W,K)=>L._(this,void 0,void 0,(function*(){this.self.importScripts(K)})))),this.actor.registerMessageHandler("SI",((W,K)=>this._setImages(W,K))),this.actor.registerMessageHandler("UL",((W,K)=>L._(this,void 0,void 0,(function*(){this._getLayerIndex(W).update(K.layers,K.removedIds,this._getGlobalState(W))})))),this.actor.registerMessageHandler("UGS",((W,K)=>L._(this,void 0,void 0,(function*(){let l1=this._getGlobalState(W);for(let C1 in K)l1[C1]=K[C1]})))),this.actor.registerMessageHandler("SL",((W,K)=>L._(this,void 0,void 0,(function*(){this._getLayerIndex(W).replace(K,this._getGlobalState(W))}))))}_getGlobalState(H){let W=this.globalStates.get(H);return W||(W={},this.globalStates.set(H,W)),W}_setImages(H,W){return L._(this,void 0,void 0,(function*(){this.availableImages[H]=W;for(let K in this.workerSources[H]){let l1=this.workerSources[H][K];for(let C1 in l1)l1[C1].availableImages=W}}))}_syncRTLPluginState(H,W){return L._(this,void 0,void 0,(function*(){return yield L.d2.syncState(W,this.self.importScripts)}))}_getAvailableImages(H){let W=this.availableImages[H];return W||(W=[]),W}_getLayerIndex(H){let W=this.layerIndexes[H];return W||(W=this.layerIndexes[H]=new n),W}_getWorkerSource(H,W,K){if(this.workerSources[H]||(this.workerSources[H]={}),this.workerSources[H][W]||(this.workerSources[H][W]={}),!this.workerSources[H][W][K]){let l1={sendAsync:(C1,S1)=>(C1.targetMapId=H,this.actor.sendAsync(C1,S1))};switch(W){case"vector":this.workerSources[H][W][K]=new z1(l1,this._getLayerIndex(H),this._getAvailableImages(H));break;case"geojson":this.workerSources[H][W][K]=new U5(l1,this._getLayerIndex(H),this._getAvailableImages(H));break;default:this.workerSources[H][W][K]=new this.externalWorkerSourceTypes[W](l1,this._getLayerIndex(H),this._getAvailableImages(H))}}return this.workerSources[H][W][K]}_getDEMWorkerSource(H,W){return this.demWorkerSources[H]||(this.demWorkerSources[H]={}),this.demWorkerSources[H][W]||(this.demWorkerSources[H][W]=new O1),this.demWorkerSources[H][W]}}return L.i(self)&&(self.worker=new lt(self)),lt})),s("index",["exports","./shared"],(function(L,n){"use strict";var y="5.12.0";function M(){var g=new n.A(4);return n.A!=Float32Array&&(g[1]=0,g[2]=0),g[0]=1,g[3]=1,g}let S,E,Z,F={frame(g,e,a){let C=requestAnimationFrame((m=>{p(),e(m)})),{unsubscribe:p}=n.s(g.signal,"abort",(()=>{p(),cancelAnimationFrame(C),a(n.c())}),!1)},frameAsync(g){return new Promise(((e,a)=>{this.frame(g,e,a)}))},getImageData(g,e=0){return this.getImageCanvasContext(g).getImageData(-e,-e,g.width+2*e,g.height+2*e)},getImageCanvasContext(g){let e=window.document.createElement("canvas"),a=e.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return e.width=g.width,e.height=g.height,a.drawImage(g,0,0,g.width,g.height),a},resolveURL:g=>(S||(S=document.createElement("a")),S.href=g,S.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return Z!==void 0?Z:!!matchMedia&&(E==null&&(E=matchMedia("(prefers-reduced-motion: reduce)")),E.matches)},set prefersReducedMotion(g){Z=g}},G=new class{constructor(){this._realTime=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:this._realTime()}setNow(g){this._frozenAt=g}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function j(){return G.getCurrentTime()}class R{static testProp(e){if(!R.docStyle)return e[0];for(let a=0;a<e.length;a++)if(e[a]in R.docStyle)return e[a];return e[0]}static create(e,a,C){let p=window.document.createElement(e);return a!==void 0&&(p.className=a),C&&C.appendChild(p),p}static createNS(e,a){return window.document.createElementNS(e,a)}static disableDrag(){R.docStyle&&R.selectProp&&(R.userSelect=R.docStyle[R.selectProp],R.docStyle[R.selectProp]="none")}static enableDrag(){R.docStyle&&R.selectProp&&(R.docStyle[R.selectProp]=R.userSelect)}static setTransform(e,a){e.style[R.transformProp]=a}static addEventListener(e,a,C,p={}){e.addEventListener(a,C,"passive"in p?p:p.capture)}static removeEventListener(e,a,C,p={}){e.removeEventListener(a,C,"passive"in p?p:p.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",R.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",R.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",R.suppressClickInternal,!0)}),0)}static getScale(e){let a=e.getBoundingClientRect();return{x:a.width/e.offsetWidth||1,y:a.height/e.offsetHeight||1,boundingClientRect:a}}static getPoint(e,a,C){let p=a.boundingClientRect;return new n.P((C.clientX-p.left)/a.x-e.clientLeft,(C.clientY-p.top)/a.y-e.clientTop)}static mousePos(e,a){let C=R.getScale(e);return R.getPoint(e,C,a)}static touchPos(e,a){let C=[],p=R.getScale(e);for(let m=0;m<a.length;m++)C.push(R.getPoint(e,p,a[m]));return C}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){let a=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),C=a.querySelectorAll("script");for(let p of C)p.remove();return R.clean(a),a.innerHTML}static isPossiblyDangerous(e,a){let C=a.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!C.includes("javascript:")&&!C.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){let a=e.children;for(let C of a)R.removeAttributes(C),R.clean(C)}static removeAttributes(e){for(let{name:a,value:C}of e.attributes)R.isPossiblyDangerous(a,C)&&e.removeAttribute(a)}}R.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,R.selectProp=R.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),R.transformProp=R.testProp(["transform","WebkitTransform"]);let r1={supported:!1,testSupport:function(g){!d1&&a1&&(s1?y1(g):X=g)}},X,a1,d1=!1,s1=!1;function y1(g){let e=g.createTexture();g.bindTexture(g.TEXTURE_2D,e);try{if(g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,a1),g.isContextLost())return;r1.supported=!0}catch{}g.deleteTexture(e),d1=!0}var m1;typeof document<"u"&&(a1=document.createElement("img"),a1.onload=()=>{X&&y1(X),X=null,s1=!0},a1.onerror=()=>{d1=!0,X=null},a1.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(g){let e,a,C,p;g.resetRequestQueue=()=>{e=[],a=0,C=0,p={}},g.addThrottleControl=T=>{let A=C++;return p[A]=T,A},g.removeThrottleControl=T=>{delete p[T],v()},g.getImage=(T,A,B=!0)=>new Promise(((V,O)=>{r1.supported&&(T.headers||(T.headers={}),T.headers.accept="image/webp,*/*"),n.e(T,{type:"image"}),e.push({abortController:A,requestParameters:T,supportImageRefresh:B,state:"queued",onError:q=>{O(q)},onSuccess:q=>{V(q)}}),v()}));let m=T=>n._(this,void 0,void 0,(function*(){T.state="running";let{requestParameters:A,supportImageRefresh:B,onError:V,onSuccess:O,abortController:q}=T,Y=B===!1&&!n.i(self)&&!n.g(A.url)&&(!A.headers||Object.keys(A.headers).reduce(((o1,u1)=>o1&&u1==="accept"),!0));a++;let e1=Y?w(A,q):n.m(A,q);try{let o1=yield e1;delete T.abortController,T.state="completed",o1.data instanceof HTMLImageElement||n.b(o1.data)?O(o1):o1.data&&O({data:yield(i1=o1.data,typeof createImageBitmap=="function"?n.f(i1):n.h(i1)),cacheControl:o1.cacheControl,expires:o1.expires})}catch(o1){delete T.abortController,V(o1)}finally{a--,v()}var i1})),v=()=>{let T=(()=>{for(let A of Object.keys(p))if(p[A]())return!0;return!1})()?n.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:n.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let A=a;A<T&&e.length>0;A++){let B=e.shift();B.abortController.signal.aborted?A--:m(B)}},w=(T,A)=>new Promise(((B,V)=>{let O=new Image,q=T.url,Y=T.credentials;Y&&Y==="include"?O.crossOrigin="use-credentials":(Y&&Y==="same-origin"||!n.d(q))&&(O.crossOrigin="anonymous"),A.signal.addEventListener("abort",(()=>{O.src="",V(n.c())})),O.fetchPriority="high",O.onload=()=>{O.onerror=O.onload=null,B({data:O})},O.onerror=()=>{O.onerror=O.onload=null,A.signal.aborted||V(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},O.src=q}))})(m1||(m1={})),m1.resetRequestQueue();class w1{constructor(e){this._transformRequestFn=e??null}transformRequest(e,a){return this._transformRequestFn&&this._transformRequestFn(e,a)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function z1(g){let e=[];if(typeof g=="string")e.push({id:"default",url:g});else if(g&&g.length>0){let a=[];for(let{id:C,url:p}of g){let m=`${C}${p}`;a.indexOf(m)===-1&&(a.push(m),e.push({id:C,url:p}))}}return e}function O1(g,e,a){try{let C=new URL(g);return C.pathname+=`${e}${a}`,C.toString()}catch{throw new Error(`Invalid sprite URL "${g}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function U1(g){let{userImage:e}=g;return!!(e&&e.render&&e.render())&&(g.data.replace(new Uint8Array(e.data.buffer)),!0)}class e2 extends n.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(let e of Object.keys(this.images))this.removeImage(e);this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:a,promiseResolve:C}of this.requestors)C(this._getImagesForIds(a));this.requestors=[]}}getImage(e){let a=this.images[e];if(a&&!a.data&&a.spriteData){let C=a.spriteData;a.data=new n.R({width:C.width,height:C.height},C.context.getImageData(C.x,C.y,C.width,C.height).data),a.spriteData=null}return a}addImage(e,a){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,a)&&(this.images[e]=a)}_validate(e,a){let C=!0,p=a.data||a.spriteData;return this._validateStretch(a.stretchX,p&&p.width)||(this.fire(new n.k(new Error(`Image "${e}" has invalid "stretchX" value`))),C=!1),this._validateStretch(a.stretchY,p&&p.height)||(this.fire(new n.k(new Error(`Image "${e}" has invalid "stretchY" value`))),C=!1),this._validateContent(a.content,a)||(this.fire(new n.k(new Error(`Image "${e}" has invalid "content" value`))),C=!1),C}_validateStretch(e,a){if(!e)return!0;let C=0;for(let p of e){if(p[0]<C||p[1]<p[0]||a<p[1])return!1;C=p[1]}return!0}_validateContent(e,a){if(!e)return!0;if(e.length!==4)return!1;let C=a.spriteData,p=C&&C.width||a.data.width,m=C&&C.height||a.data.height;return!(e[0]<0||p<e[0]||e[1]<0||m<e[1]||e[2]<0||p<e[2]||e[3]<0||m<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,a,C=!0){let p=this.getImage(e);if(C&&(p.data.width!==a.data.width||p.data.height!==a.data.height))throw new Error(`size mismatch between old image (${p.data.width}x${p.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=p.version+1,this.images[e]=a,this.updatedImages[e]=!0}removeImage(e){let a=this.images[e];delete this.images[e],delete this.patterns[e],a.userImage&&a.userImage.onRemove&&a.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((a,C)=>{let p=!0;if(!this.isLoaded())for(let m of e)this.images[m]||(p=!1);this.isLoaded()||p?a(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:a})}))}_getImagesForIds(e){let a={};for(let C of e){let p=this.getImage(C);p||(this.fire(new n.l("styleimagemissing",{id:C})),p=this.getImage(C)),p?a[C]={data:p.data.clone(),pixelRatio:p.pixelRatio,sdf:p.sdf,version:p.version,stretchX:p.stretchX,stretchY:p.stretchY,content:p.content,textFitWidth:p.textFitWidth,textFitHeight:p.textFitHeight,hasRenderCallback:!!(p.userImage&&p.userImage.render)}:n.w(`Image "${C}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return a}getPixelSize(){let{width:e,height:a}=this.atlasImage;return{width:e,height:a}}getPattern(e){let a=this.patterns[e],C=this.getImage(e);if(!C)return null;if(a&&a.position.version===C.version)return a.position;if(a)a.position.version=C.version;else{let p={w:C.data.width+2,h:C.data.height+2,x:0,y:0},m=new n.I(p,C);this.patterns[e]={bin:p,position:m}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let a=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new n.T(e,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let m in this.patterns)e.push(this.patterns[m].bin);let{w:a,h:C}=n.p(e),p=this.atlasImage;p.resize({width:a||1,height:C||1});for(let m in this.patterns){let{bin:v}=this.patterns[m],w=v.x+1,T=v.y+1,A=this.getImage(m).data,B=A.width,V=A.height;n.R.copy(A,p,{x:0,y:0},{x:w,y:T},{width:B,height:V}),n.R.copy(A,p,{x:0,y:V-1},{x:w,y:T-1},{width:B,height:1}),n.R.copy(A,p,{x:0,y:0},{x:w,y:T+V},{width:B,height:1}),n.R.copy(A,p,{x:B-1,y:0},{x:w-1,y:T},{width:1,height:V}),n.R.copy(A,p,{x:0,y:0},{x:w+B,y:T},{width:1,height:V})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let a of e){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;let C=this.getImage(a);C||n.w(`Image with ID: "${a}" was not found`),U1(C)&&this.updateImage(a,C)}}cloneImages(){let e={};for(let a in this.images){let C=this.images[a];e[a]=Object.assign(Object.assign({},C),{data:C.data?C.data.clone():null})}return e}}let s2=1e20;function N1(g,e,a,C,p,m,v,w,T){for(let A=e;A<e+C;A++)o2(g,a*m+A,m,p,v,w,T);for(let A=a;A<a+p;A++)o2(g,A*m+e,1,C,v,w,T)}function o2(g,e,a,C,p,m,v){m[0]=0,v[0]=-s2,v[1]=s2,p[0]=g[e];for(let w=1,T=0,A=0;w<C;w++){p[w]=g[e+w*a];let B=w*w;do{let V=m[T];A=(p[w]-p[V]+B-V*V)/(w-V)/2}while(A<=v[T]&&--T>-1);T++,m[T]=w,v[T]=A,v[T+1]=s2}for(let w=0,T=0;w<C;w++){for(;v[T+1]<w;)T++;let A=m[T],B=w-A;g[e+w*a]=p[A]+B*B}}let p2=n.v.layout_symbol["text-font"].default.join(",");class T2{constructor(e,a,C){this.requestManager=e,this.localIdeographFontFamily=a,this.entries={},this.lang=C}setURL(e){this.url=e}getGlyphs(e){return n._(this,void 0,void 0,(function*(){let a=[];for(let m in e)for(let v of e[m])a.push(this._getAndCacheGlyphsPromise(m,v));let C=yield Promise.all(a),p={};for(let{stack:m,id:v,glyph:w}of C)p[m]||(p[m]={}),p[m][v]=w&&{id:w.id,bitmap:w.bitmap.clone(),metrics:w.metrics};return p}))}_getAndCacheGlyphsPromise(e,a){return n._(this,void 0,void 0,(function*(){let C=this.entries[e];C||(C=this.entries[e]={glyphs:{},requests:{},ranges:{}});let p=C.glyphs[a];return p!==void 0?{stack:e,id:a,glyph:p}:!this.url||this._charUsesLocalIdeographFontFamily(a)?(p=C.glyphs[a]=this._drawGlyph(C,e,a),{stack:e,id:a,glyph:p}):yield this._downloadAndCacheRangePromise(e,a)}))}_downloadAndCacheRangePromise(e,a){return n._(this,void 0,void 0,(function*(){let C=Math.floor(a/256);if(256*C>65535)throw new Error("glyphs > 65535 not supported");let p=this.entries[e];if(p.ranges[C])return{stack:e,id:a,glyph:null};if(!p.requests[C]){let m=T2.loadGlyphRange(e,C,this.url,this.requestManager);p.requests[C]=m}try{let m=yield p.requests[C];for(let v in m)p.glyphs[+v]=m[+v];return p.ranges[C]=!0,{stack:e,id:a,glyph:m[a]||null}}catch(m){let v=p.glyphs[a]=this._drawGlyph(p,e,a);return this._warnOnMissingGlyphRange(v,C,a,m),{stack:e,id:a,glyph:v}}}))}_warnOnMissingGlyphRange(e,a,C,p){let m=256*a,v=m+255,w=C.toString(16).padStart(4,"0").toUpperCase();n.w(`Unable to load glyph range ${a}, ${m}-${v}. Rendering codepoint U+${w} locally instead. ${p}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&n.q(e)}_drawGlyph(e,a,C){let p=a===p2&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(C),m=p?"ideographTinySDF":"tinySDF";e[m]||(e[m]=this._createTinySDF(p?this.localIdeographFontFamily:a));let v=e[m].draw(String.fromCharCode(C));return{id:C,bitmap:new n.r({width:v.width||60,height:v.height||60},v.data),metrics:{width:v.glyphWidth/2||24,height:v.glyphHeight/2||24,left:v.glyphLeft/2+.5||0,top:v.glyphTop/2-27.5||-8,advance:v.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(e){let a=e?e.split(","):[];a.push("sans-serif");let C=a.map((p=>/[-\w]+/.test(p)?p:`'${CSS.escape(p)}'`)).join(",");return new T2.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:C,fontWeight:this._fontWeight(a[0]),fontStyle:this._fontStyle(a[0]),lang:this.lang})}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let a={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},C;for(let[p,m]of Object.entries(a))new RegExp(`\\b${p}\\b`,"i").test(e)&&(C=`${m}`);return C}destroy(){for(let e in this.entries){let a=this.entries[e];a.tinySDF&&(a.tinySDF=null),a.ideographTinySDF&&(a.ideographTinySDF=null),a.glyphs={},a.requests={},a.ranges={}}this.entries={}}}T2.loadGlyphRange=function(g,e,a,C){return n._(this,void 0,void 0,(function*(){let p=256*e,m=p+255,v=C.transformRequest(a.replace("{fontstack}",g).replace("{range}",`${p}-${m}`),"Glyphs"),w=yield n.n(v,new AbortController);if(!w||!w.data)throw new Error(`Could not load glyph range. range: ${e}, ${p}-${m}`);let T={};for(let A of n.o(w.data))T[A.id]=A;return T}))},T2.TinySDF=class{constructor({fontSize:g=24,buffer:e=3,radius:a=8,cutoff:C=.25,fontFamily:p="sans-serif",fontWeight:m="normal",fontStyle:v="normal",lang:w=null}={}){this.buffer=e,this.cutoff=C,this.radius=a,this.lang=w;let T=this.size=g+4*e,A=this._createCanvas(T),B=this.ctx=A.getContext("2d",{willReadFrequently:!0});B.font=`${v} ${m} ${g}px ${p}`,B.textBaseline="alphabetic",B.textAlign="left",B.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(g){let e=document.createElement("canvas");return e.width=e.height=g,e}draw(g){let{width:e,actualBoundingBoxAscent:a,actualBoundingBoxDescent:C,actualBoundingBoxLeft:p,actualBoundingBoxRight:m}=this.ctx.measureText(g),v=Math.ceil(a),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-p))),T=Math.min(this.size-this.buffer,v+Math.ceil(C)),A=w+2*this.buffer,B=T+2*this.buffer,V=Math.max(A*B,0),O=new Uint8ClampedArray(V),q={data:O,width:A,height:B,glyphWidth:w,glyphHeight:T,glyphTop:v,glyphLeft:0,glyphAdvance:e};if(w===0||T===0)return q;let{ctx:Y,buffer:e1,gridInner:i1,gridOuter:o1}=this;this.lang&&(Y.lang=this.lang),Y.clearRect(e1,e1,w,T),Y.fillText(g,e1,e1+v);let u1=Y.getImageData(e1,e1,w,T);o1.fill(s2,0,V),i1.fill(0,0,V);for(let g1=0;g1<T;g1++)for(let c1=0;c1<w;c1++){let x1=u1.data[4*(g1*w+c1)+3]/255;if(x1===0)continue;let v1=(g1+e1)*A+c1+e1;if(x1===1)o1[v1]=0,i1[v1]=s2;else{let h1=.5-x1;o1[v1]=h1>0?h1*h1:0,i1[v1]=h1<0?h1*h1:0}}N1(o1,0,0,A,B,A,this.f,this.v,this.z),N1(i1,e1,e1,w,T,A,this.f,this.v,this.z);for(let g1=0;g1<V;g1++){let c1=Math.sqrt(o1[g1])-Math.sqrt(i1[g1]);O[g1]=Math.round(255-255*(c1/this.radius+this.cutoff))}return q}};class l2{constructor(){this.specification=n.u.light.position}possiblyEvaluate(e,a){return n.C(e.expression.evaluate(a))}interpolate(e,a,C){return{x:n.F.number(e.x,a.x,C),y:n.F.number(e.y,a.y,C),z:n.F.number(e.z,a.z,C)}}}let Y1;class f2 extends n.E{constructor(e){super(),Y1=Y1||new n.t({anchor:new n.D(n.u.light.anchor),position:new l2,color:new n.D(n.u.light.color),intensity:new n.D(n.u.light.intensity)}),this._transitionable=new n.x(Y1,void 0),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,a={}){if(!this._validate(n.y,e,a))for(let C in e){let p=e[C];C.endsWith("-transition")?this._transitionable.setTransition(C.slice(0,-11),p):this._transitionable.setValue(C,p)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,a,C){return(!C||C.validate!==!1)&&n.z(this,e.call(n.B,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:n.u}))}}let b2=new n.t({"sky-color":new n.D(n.u.sky["sky-color"]),"horizon-color":new n.D(n.u.sky["horizon-color"]),"fog-color":new n.D(n.u.sky["fog-color"]),"fog-ground-blend":new n.D(n.u.sky["fog-ground-blend"]),"horizon-fog-blend":new n.D(n.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new n.D(n.u.sky["sky-horizon-blend"]),"atmosphere-blend":new n.D(n.u.sky["atmosphere-blend"])});class d2 extends n.E{constructor(e){super(),this._transitionable=new n.x(b2,void 0),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new n.G(0))}setSky(e,a={}){if(!this._validate(n.H,e,a)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let C in e){let p=e[C];C.endsWith("-transition")?this._transitionable.setTransition(C.slice(0,-11),p):this._transitionable.setValue(C,p)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,a,C={}){return C?.validate!==!1&&n.z(this,e.call(n.B,n.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:n.u})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class R2{constructor(e,a){this.width=e,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,a){let C=e.join(",")+String(a);return this.dashEntry[C]||(this.dashEntry[C]=this.addDash(e,a)),this.dashEntry[C]}getDashRanges(e,a,C){let p=[],m=e.length%2==1?-e[e.length-1]*C:0,v=e[0]*C,w=!0;p.push({left:m,right:v,isDash:w,zeroLength:e[0]===0});let T=e[0];for(let A=1;A<e.length;A++){w=!w;let B=e[A];m=T*C,T+=B,v=T*C,p.push({left:m,right:v,isDash:w,zeroLength:B===0})}return p}addRoundDash(e,a,C){let p=a/2;for(let m=-C;m<=C;m++){let v=this.width*(this.nextRow+C+m),w=0,T=e[w];for(let A=0;A<this.width;A++){A/T.right>1&&(T=e[++w]);let B=Math.abs(A-T.left),V=Math.abs(A-T.right),O=Math.min(B,V),q,Y=m/C*(p+1);if(T.isDash){let e1=p-Math.abs(Y);q=Math.sqrt(O*O+e1*e1)}else q=p-Math.sqrt(O*O+Y*Y);this.data[v+A]=Math.max(0,Math.min(255,q+128))}}}addRegularDash(e){for(let w=e.length-1;w>=0;--w){let T=e[w],A=e[w+1];T.zeroLength?e.splice(w,1):A&&A.isDash===T.isDash&&(A.left=T.left,e.splice(w,1))}let a=e[0],C=e[e.length-1];a.isDash===C.isDash&&(a.left=C.left-this.width,C.right=a.right+this.width);let p=this.width*this.nextRow,m=0,v=e[m];for(let w=0;w<this.width;w++){w/v.right>1&&(v=e[++m]);let T=Math.abs(w-v.left),A=Math.abs(w-v.right),B=Math.min(T,A);this.data[p+w]=Math.max(0,Math.min(255,(v.isDash?B:-B)+128))}}addDash(e,a){let C=a?7:0,p=2*C+1;if(this.nextRow+p>this.height)return n.w("LineAtlas out of space"),null;let m=0;for(let w=0;w<e.length;w++)m+=e[w];if(m!==0){let w=this.width/m,T=this.getDashRanges(e,this.width,w);a?this.addRoundDash(T,w,C):this.addRegularDash(T)}let v={y:this.nextRow+C,height:2*C,width:m};return this.nextRow+=p,this.dirty=!0,v}bind(e){let a=e.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}let J2="maplibre_preloaded_worker_pool";class v5{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<v5.workerCount;)this.workers.push(new Worker(n.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach((a=>{a.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[J2]}numActive(){return Object.keys(this.active).length}}let F1=Math.floor(F.hardwareConcurrency/2),i5,N2;function g2(){return i5||(i5=new v5),i5}v5.workerCount=n.J(globalThis)?Math.max(Math.min(F1,3),1):1;class L5{constructor(e,a){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=a;let C=this.workerPool.acquire(a);for(let p=0;p<C.length;p++){let m=new n.K(C[p],a);m.name=`Worker ${p}`,this.actors.push(m)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,a){let C=[];for(let p of this.actors)C.push(p.sendAsync({type:e,data:a}));return Promise.all(C)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach((a=>{a.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,a){for(let C of this.actors)C.registerMessageHandler(e,a)}unregisterMessageHandler(e){for(let a of this.actors)a.unregisterMessageHandler(e)}}function x5(){return N2||(N2=new L5(g2(),n.L),N2.registerMessageHandler("GR",((g,e,a)=>n.m(e,a)))),N2}function Q2(g,e){let a=n.M();return n.N(a,a,[1,1,0]),n.O(a,a,[.5*g.width,.5*g.height,1]),g.calculatePosMatrix?n.Q(a,a,g.calculatePosMatrix(e.toUnwrapped())):a}function Z5(g,e,a,C,p,m,v){var w;let T=(function(O,q,Y){if(O)for(let e1 of O){let i1=q[e1];if(i1&&i1.source===Y&&i1.type==="fill-extrusion")return!0}else for(let e1 in q){let i1=q[e1];if(i1.source===Y&&i1.type==="fill-extrusion")return!0}return!1})((w=p?.layers)!==null&&w!==void 0?w:null,e,g.id),A=m.maxPitchScaleFactor(),B=g.tilesIn(C,A,T);B.sort(U2);let V=[];for(let O of B)V.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(e,a,g.getState(),O.queryGeometry,O.cameraQueryGeometry,O.scale,p,m,A,Q2(m,O.tileID),v?(q,Y)=>v(O.tileID,q,Y):void 0)});return(function(O,q){for(let Y in O)for(let e1 of O[Y])m2(e1,q);return O})((function(O){let q={},Y={};for(let e1 of O){let i1=e1.queryResults,o1=e1.wrappedTileID,u1=Y[o1]=Y[o1]||{};for(let g1 in i1){let c1=i1[g1],x1=u1[g1]=u1[g1]||{},v1=q[g1]=q[g1]||[];for(let h1 of c1)x1[h1.featureIndex]||(x1[h1.featureIndex]=!0,v1.push(h1))}}return q})(V),g)}function U2(g,e){let a=g.tileID,C=e.tileID;return a.overscaledZ-C.overscaledZ||a.canonical.y-C.canonical.y||a.wrap-C.wrap||a.canonical.x-C.canonical.x}function m2(g,e){let a=g.feature,C=e.getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=C}function o5(g,e,a){return n._(this,void 0,void 0,(function*(){let C=g;if(g.url?C=(yield n.j(e.transformRequest(g.url,"Source"),a)).data:yield F.frameAsync(a),!C)return null;let p=n.S(n.e(C,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in C&&C.vector_layers&&(p.vectorLayerIds=C.vector_layers.map((m=>m.id))),p}))}class e5{constructor(e,a){e&&(a?this.setSouthWest(e).setNorthEast(a):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof n.U?new n.U(e.lng,e.lat):n.U.convert(e),this}setSouthWest(e){return this._sw=e instanceof n.U?new n.U(e.lng,e.lat):n.U.convert(e),this}extend(e){let a=this._sw,C=this._ne,p,m;if(e instanceof n.U)p=e,m=e;else{if(!(e instanceof e5))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(e5.convert(e)):this.extend(n.U.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(n.U.convert(e)):this;if(p=e._sw,m=e._ne,!p||!m)return this}return a||C?(a.lng=Math.min(p.lng,a.lng),a.lat=Math.min(p.lat,a.lat),C.lng=Math.max(m.lng,C.lng),C.lat=Math.max(m.lat,C.lat)):(this._sw=new n.U(p.lng,p.lat),this._ne=new n.U(m.lng,m.lat)),this}getCenter(){return new n.U((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new n.U(this.getWest(),this.getNorth())}getSouthEast(){return new n.U(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:a,lat:C}=n.U.convert(e),p=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(p=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=C&&C<=this._ne.lat&&p}intersects(e){if((e=e5.convert(e)).getNorth()<this.getSouth()||e.getSouth()>this.getNorth())return!1;let a=n.V(this.getWest(),-180,180),C=n.V(this.getEast(),-180,180),p=n.V(e.getWest(),-180,180),m=n.V(e.getEast(),-180,180),v=a>C,w=p>m;return!(!v||!w)||(v?m>=a||p<=C:w?C>=p||a<=m:!(p>C||m<a))}static convert(e){return e instanceof e5?e:e&&new e5(e)}static fromLngLat(e,a=0){let C=360*a/40075017,p=C/Math.cos(Math.PI/180*e.lat);return new e5(new n.U(e.lng-p,e.lat-C),new n.U(e.lng+p,e.lat+C))}adjustAntiMeridian(){let e=new n.U(this._sw.lng,this._sw.lat),a=new n.U(this._ne.lng,this._ne.lat);return new e5(e,e.lng>a.lng?new n.U(a.lng+360,a.lat):a)}}class X2{constructor(e,a,C){this.bounds=e5.convert(this.validateBounds(e)),this.minzoom=a||0,this.maxzoom=C||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let a=Math.pow(2,e.z),C=Math.floor(n.X(this.bounds.getWest())*a),p=Math.floor(n.W(this.bounds.getNorth())*a),m=Math.ceil(n.X(this.bounds.getEast())*a),v=Math.ceil(n.W(this.bounds.getSouth())*a);return e.x>=C&&e.x<m&&e.y>=p&&e.y<v}}class C5 extends n.E{constructor(e,a,C,p){if(super(),this.id=e,this.dispatcher=C,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,n.e(this,n.S(a,["url","scheme","tileSize","promoteId","encoding"])),this._options=n.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(p)}load(){return n._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=yield o5(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),e&&(n.e(this,e),e.bounds&&(this.tileBounds=new X2(e.bounds,this.minzoom,this.maxzoom)),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.l("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,this.fire(new n.k(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return n.e({},this._options)}loadTile(e){return n._(this,void 0,void 0,(function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C={request:this.map._requestManager.transformRequest(a,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:this._getOverzoomParameters(e)};C.request.collectResourceTiming=this._collectResourceTiming;let p="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise(((m,v)=>{e.reloadPromise={resolve:m,reject:v}}))}else e.actor=this.dispatcher.getActor(),p="LT";e.abortController=new AbortController;try{let m=yield e.actor.sendAsync({type:p,data:C},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,m)}catch(m){if(delete e.abortController,e.aborted)return;if(m&&m.status!==404)throw m;this._afterTileLoadWorkerResponse(e,null)}}))}_getOverzoomParameters(e){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let a=e.tileID.scaledTo(this.maxzoom).canonical,C=a.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:a,overzoomRequest:this.map._requestManager.transformRequest(C,"Tile")}}_afterTileLoadWorkerResponse(e,a){if(a&&a.resourceTiming&&(e.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&e.setExpiryData(a),e.loadVectorData(a,this.map.painter),e.reloadPromise){let C=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(C.resolve).catch(C.reject)}}abortTile(e){return n._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return n._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class ht extends n.E{constructor(e,a,C,p){super(),this.id=e,this.dispatcher=C,this.setEventedParent(p),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=n.e({type:"raster"},a),n.e(this,n.S(a,["url","scheme","tileSize"]))}load(){return n._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let a=yield o5(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,a&&(n.e(this,a),a.bounds&&(this.tileBounds=new X2(a.bounds,this.minzoom,this.maxzoom)),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,this.fire(new n.k(a))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return n.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return n._(this,void 0,void 0,(function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let C=yield m1.getImage(this.map._requestManager.transformRequest(a,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(C&&C.data){this.map._refreshExpiredTiles&&(C.cacheControl||C.expires)&&e.setExpiryData({cacheControl:C.cacheControl,expires:C.expires});let p=this.map.painter.context,m=p.gl,v=C.data;e.texture=this.map.painter.getTileTexture(v.width),e.texture?e.texture.update(v,{useMipmap:!0}):(e.texture=new n.T(p,v,m.RGBA,{useMipmap:!0}),e.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(C){if(delete e.abortController,e.aborted)e.state="unloaded";else if(C)throw e.state="errored",C}}))}abortTile(e){return n._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return n._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class R5 extends ht{constructor(e,a,C,p){super(e,a,C,p),this.type="raster-dem",this.maxzoom=22,this._options=n.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(e){return n._(this,void 0,void 0,(function*(){let a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C=this.map._requestManager.transformRequest(a,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let p=yield m1.getImage(C,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(p&&p.data){let m=p.data;this.map._refreshExpiredTiles&&(p.cacheControl||p.expires)&&e.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});let v=n.b(m)&&n.Y()?m:yield this.readImageNow(m),w={type:this.type,uid:e.uid,source:this.id,rawImageData:v,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();let T=yield e.actor.sendAsync({type:"LDT",data:w});e.dem=T,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(p){if(delete e.abortController,e.aborted)e.state="unloaded";else if(p)throw e.state="errored",p}}))}readImageNow(e){return n._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&n.Z()){let a=e.width+2,C=e.height+2;try{return new n.R({width:a,height:C},yield n.$(e,-1,-1,a,C))}catch{}}return F.getImageData(e,1)}))}_getNeighboringTiles(e){let a=e.canonical,C=Math.pow(2,a.z),p=(a.x-1+C)%C,m=a.x===0?e.wrap-1:e.wrap,v=(a.x+1+C)%C,w=a.x+1===C?e.wrap+1:e.wrap,T={};return T[new n.a0(e.overscaledZ,m,a.z,p,a.y).key]={backfilled:!1},T[new n.a0(e.overscaledZ,w,a.z,v,a.y).key]={backfilled:!1},a.y>0&&(T[new n.a0(e.overscaledZ,m,a.z,p,a.y-1).key]={backfilled:!1},T[new n.a0(e.overscaledZ,e.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},T[new n.a0(e.overscaledZ,w,a.z,v,a.y-1).key]={backfilled:!1}),a.y+1<C&&(T[new n.a0(e.overscaledZ,m,a.z,p,a.y+1).key]={backfilled:!1},T[new n.a0(e.overscaledZ,e.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},T[new n.a0(e.overscaledZ,w,a.z,v,a.y+1).key]={backfilled:!1}),T}unloadTile(e){return n._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))}))}}function d5(g){return g.type==="GeometryCollection"?g.geometries.map((e=>e.coordinates)).flat(1/0):g.coordinates.flat(1/0)}function w5(g){let e=new e5,a;switch(g.type){case"FeatureCollection":a=g.features.map((C=>d5(C.geometry))).flat(1/0);break;case"Feature":a=d5(g.geometry);break;default:a=d5(g)}if(a.length==0)return e;for(let C=0;C<a.length-1;C+=2)e.extend([a[C],a[C+1]]);return e}class W2 extends n.E{constructor(e,a,C,p){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:a.data},this.actor=C.getActor(),this.setEventedParent(p),this._data=a.data,this._options=n.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId,a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&n.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=n.e({source:this.id,cluster:a.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(a.buffer!==void 0?a.buffer:128),tolerance:this._pixelsToTileUnits(a.tolerance!==void 0?a.tolerance:.375),extent:n.a3,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(a.clusterMaxZoom),minPoints:Math.max(2,a.clusterMinPoints||2),extent:n.a3,radius:this._pixelsToTileUnits(a.clusterRadius||50),log:!1,generateId:a.generateId||!1},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.optionsChanged}_pixelsToTileUnits(e){return e*(n.a3/this.tileSize)}_getClusterMaxZoom(e){let a=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||n.w(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${a}"`),a}load(){return n._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._pendingWorkerUpdate={data:e},this._updateWorkerData(),this}updateData(e){return this._pendingWorkerUpdate.diff=n.a4(this._pendingWorkerUpdate.diff,e),this._updateWorkerData(),this}getData(){return n._(this,void 0,void 0,(function*(){let e=n.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}getBounds(){return n._(this,void 0,void 0,(function*(){return w5(yield this.getData())}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!0,this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,a,C){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:a,offset:C}})}_updateWorkerData(){return n._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void n.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:e,diff:a}=this._pendingWorkerUpdate,C=n.e({type:this.type},this.workerOptions);e?(typeof e=="string"?(C.request=this.map._requestManager.transformRequest(F.resolveURL(e),"Source"),C.request.collectResourceTiming=this._collectResourceTiming):C.data=JSON.stringify(e),this._pendingWorkerUpdate.data=void 0):a&&(C.dataDiff=a,this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,this._isUpdatingWorker=!0,this.fire(new n.l("dataloading",{dataType:"source"}));try{let p=yield this.actor.sendAsync({type:"LD",data:C});if(this._isUpdatingWorker=!1,this._removed||p.abandoned)return void this.fire(new n.l("dataabort",{dataType:"source"}));this._data=p.data;let m=null;p.resourceTiming&&p.resourceTiming[this.id]&&(m=p.resourceTiming[this.id].slice(0));let v={dataType:"source"};this._collectResourceTiming&&m&&m.length>0&&n.e(v,{resourceTiming:m}),this.fire(new n.l("data",Object.assign(Object.assign({},v),{sourceDataType:"metadata"}))),this.fire(new n.l("data",Object.assign(Object.assign({},v),{sourceDataType:"content",shouldReloadTileOptions:this._getShouldReloadTileOptions(a)})))}catch(p){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new n.l("dataabort",{dataType:"source"}));this.fire(new n.k(p))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_getShouldReloadTileOptions(e){if(!e||e.removeAll)return;let{add:a=[],update:C=[],remove:p=[]}=e||{},m=new Set([...C.map((v=>v.id)),...p]);return{nextBounds:[...C.map((v=>v.newGeometry)),...a.map((v=>v.geometry))].map((v=>w5(v))),prevIds:m}}shouldReloadTile(e,{nextBounds:a,prevIds:C}){let p=e.latestFeatureIndex.loadVTLayers();for(let T=0;T<e.latestFeatureIndex.featureIndexArray.length;T++){let A=e.latestFeatureIndex.featureIndexArray.get(T),B=p._geojsonTileLayer.feature(A.featureIndex);if(C.has(B.id))return!0}let{buffer:m,extent:v}=this.workerOptions.geojsonVtOptions,w=(function({x:T,y:A,z:B},V=0){let O=n.a1((T-V)/Math.pow(2,B)),q=n.a2((A+1+V)/Math.pow(2,B)),Y=n.a1((T+1+V)/Math.pow(2,B)),e1=n.a2((A-V)/Math.pow(2,B));return new e5([O,q],[Y,e1])})(e.tileID.canonical,m/v);for(let T of a)if(w.intersects(T))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(e){return n._(this,void 0,void 0,(function*(){let a=e.actor?"RT":"LT";e.actor=this.actor;let C={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;let p=yield this.actor.sendAsync({type:a,data:C},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(p,this.map.painter,a==="RT")}))}abortTile(e){return n._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return n._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return n.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class u5 extends n.E{constructor(e,a,C,p){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=C,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(p),this.options=a}load(e){return n._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new n.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let a=yield m1.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,e&&(this.coordinates=e),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,this.fire(new n.k(a))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;let a=e.map(n.a5.fromLngLat);var C;return this.tileID=(function(p){let m=n.a6.fromPoints(p),v=m.width(),w=m.height(),T=Math.max(v,w),A=Math.max(0,Math.floor(-Math.log(T)/Math.LN2)),B=Math.pow(2,A);return new n.a8(A,Math.floor((m.minX+m.maxX)/2*B),Math.floor((m.minY+m.maxY)/2*B))})(a),this.terrainTileRanges=this._getOverlappingTileRanges(a),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=a.map((p=>this.tileID.getTilePoint(p)._round())),this.flippedWindingOrder=((C=this.tileCoords)[1].x-C[0].x)*(C[2].y-C[0].y)-(C[1].y-C[0].y)*(C[2].x-C[0].x)<0,this.fire(new n.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,a=e.gl;this.texture||(this.texture=new n.T(e,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(let p in this.tiles){let m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,C=!0)}C&&this.fire(new n.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return n._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:a,minY:C,maxX:p,maxY:m}=n.a6.fromPoints(e),v={};for(let w=0;w<=n.a7;w++){let T=Math.pow(2,w),A=Math.floor(a*T),B=Math.floor(C*T),V=Math.floor(p*T),O=Math.floor(m*T);v[w]={minTileX:A,minTileY:B,maxTileX:V,maxTileY:O}}return v}}class Y2 extends u5{constructor(e,a,C,p){super(e,a,C,p),this.roundZoom=!0,this.type="video",this.options=a}load(){return n._(this,void 0,void 0,(function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let a of e.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{let a=yield n.a9(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new n.k(a))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let a=this.video.seekable;e<a.start(0)||e>a.end(0)?this.fire(new n.k(new n.aa(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,a=e.gl;this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new n.T(e,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(let p in this.tiles){let m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,C=!0)}C&&this.fire(new n.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class P5 extends u5{constructor(e,a,C,p){super(e,a,C,p),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some((m=>!Array.isArray(m)||m.length!==2||m.some((v=>typeof v!="number"))))||this.fire(new n.k(new n.aa(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.k(new n.aa(`sources.${e}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new n.k(new n.aa(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new n.k(new n.aa(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new n.k(new n.aa(`sources.${e}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return n._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new n.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let a=this.map.painter.context,C=a.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new n.T(a,this.canvas,C.RGBA,{premultiply:!0});let p=!1;for(let m in this.tiles){let v=this.tiles[m];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,p=!0)}p&&this.fire(new n.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}let it={},E5=g=>{switch(g){case"geojson":return W2;case"image":return u5;case"raster":return ht;case"raster-dem":return R5;case"vector":return C5;case"video":return Y2;case"canvas":return P5}return it[g]},D5="RTLPluginLoaded";class Vt extends n.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=x5()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((a=>{throw this.status="error",a}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return n._(this,arguments,void 0,(function*(a,C=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=F.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!C)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return n._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new n.l(D5))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let U5=null;function F5(){return U5||(U5=new Vt),U5}var lt,p1;(function(g){g[g.Base=0]="Base",g[g.Parent=1]="Parent"})(lt||(lt={})),(function(g){g[g.Departing=0]="Departing",g[g.Incoming=1]="Incoming"})(p1||(p1={}));class H{constructor(e,a){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=n.ab(),this.uses=0,this.tileSize=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:a,fadingParentID:C,fadeEndTime:p}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=a,this.fadingParentID=C,this.fadeEndTime=p}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=j(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,a,C){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(p,m){let v={};if(!m)return v;for(let w of p){let T=w.layerIds.map((A=>m.getLayer(A))).filter(Boolean);if(T.length!==0){w.layers=T,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map((A=>T.filter((B=>B.id===A))[0])));for(let A of T)v[A.id]=w}}return v})(e.buckets,a?.style),this.hasSymbolBuckets=!1;for(let p in this.buckets){let m=this.buckets[p];if(m instanceof n.ad){if(this.hasSymbolBuckets=!0,!C)break;m.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let p in this.buckets){let m=this.buckets[p];if(m instanceof n.ad&&m.hasRTLText){this.hasRTLText=!0,F5().lazyLoad();break}}this.queryPadding=0;for(let p in this.buckets){let m=this.buckets[p];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(p).queryRadius(m))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new n.ac}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let C in this.buckets){let p=this.buckets[C];p.uploadPending()&&p.upload(e)}let a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new n.T(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new n.T(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,a,C,p,m,v,w,T,A,B,V){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:p,cameraQueryGeometry:m,scale:v,tileSize:this.tileSize,pixelPosMatrix:B,transform:T,params:w,queryPadding:this.queryPadding*A,getElevation:V},e,a,C):{}}querySourceFeatures(e,a){let C=this.latestFeatureIndex;if(!C||!C.rawTileData)return;let p=C.loadVTLayers(),m=a&&a.sourceLayer?a.sourceLayer:"",v=p._geojsonTileLayer||p[m];if(!v)return;let w=n.ae(a?.filter,a?.globalState),{z:T,x:A,y:B}=this.tileID.canonical,V={z:T,x:A,y:B};for(let O=0;O<v.length;O++){let q=v.feature(O);if(w.needGeometry){let i1=n.af(q,!0);if(!w.filter(new n.G(this.tileID.overscaledZ),i1,this.tileID.canonical))continue}else if(!w.filter(new n.G(this.tileID.overscaledZ),q))continue;let Y=C.getId(q,m),e1=new n.ag(q,T,A,B,Y);e1.tile=V,e.push(e1)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let a=this.expirationTime;if(e.cacheControl){let C=n.ah(e.cacheControl);C["max-age"]&&(this.expirationTime=Date.now()+1e3*C["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let C=Date.now(),p=!1;if(this.expirationTime>C)p=!1;else if(a)if(this.expirationTime<a)p=!0;else{let m=this.expirationTime-a;m?this.expirationTime=C+Math.max(m,3e4):p=!0}else p=!0;p?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,a){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;let C=this.latestFeatureIndex.loadVTLayers();for(let p in this.buckets){if(!a.style.hasLayer(p))continue;let m=this.buckets[p],v=m.layers[0].sourceLayer||"_geojsonTileLayer",w=C[v],T=e[v];if(!w||!T||Object.keys(T).length===0)continue;m.update(T,w,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let A=a&&a.style&&a.style.getLayer(p);A&&(this.queryPadding=Math.max(this.queryPadding,A.queryRadius(m)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<j()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=j()+e}setDependencies(e,a){let C={};for(let p of a)C[p]=!0;this.dependencies[e]=C}hasDependency(e,a){for(let C of e){let p=this.dependencies[C];if(p){for(let m of a)if(p[m])return!0}}return!1}}class W{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,a,C){let p=String(a);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][p]=this.stateChanges[e][p]||{},n.e(this.stateChanges[e][p],C),this.deletedStates[e]===null){this.deletedStates[e]={};for(let m in this.state[e])m!==p&&(this.deletedStates[e][m]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][p]===null){this.deletedStates[e][p]={};for(let m in this.state[e][p])C[m]||(this.deletedStates[e][p][m]=null)}else for(let m in C)this.deletedStates[e]&&this.deletedStates[e][p]&&this.deletedStates[e][p][m]===null&&delete this.deletedStates[e][p][m]}removeFeatureState(e,a,C){if(this.deletedStates[e]===null)return;let p=String(a);if(this.deletedStates[e]=this.deletedStates[e]||{},C&&a!==void 0)this.deletedStates[e][p]!==null&&(this.deletedStates[e][p]=this.deletedStates[e][p]||{},this.deletedStates[e][p][C]=null);else if(a!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][p])for(C in this.deletedStates[e][p]={},this.stateChanges[e][p])this.deletedStates[e][p][C]=null;else this.deletedStates[e][p]=null;else this.deletedStates[e]=null}getState(e,a){let C=String(a),p=n.e({},(this.state[e]||{})[C],(this.stateChanges[e]||{})[C]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let m=this.deletedStates[e][a];if(m===null)return{};for(let v in m)delete p[v]}return p}initializeTileState(e,a){e.setFeatureState(this.state,a)}coalesceChanges(e,a){let C={};for(let p in this.stateChanges){this.state[p]=this.state[p]||{};let m={};for(let v in this.stateChanges[p])this.state[p][v]||(this.state[p][v]={}),n.e(this.state[p][v],this.stateChanges[p][v]),m[v]=this.state[p][v];C[p]=m}for(let p in this.deletedStates){this.state[p]=this.state[p]||{};let m={};if(this.deletedStates[p]===null)for(let v in this.state[p])m[v]={},this.state[p][v]={};else for(let v in this.deletedStates[p]){if(this.deletedStates[p][v]===null)this.state[p][v]={};else for(let w of Object.keys(this.deletedStates[p][v]))delete this.state[p][v][w];m[v]=this.state[p][v]}C[p]=C[p]||{},n.e(C[p],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(C).length!==0)for(let p in e)e[p].setFeatureState(C,a)}}let K=89.25;function l1(g,e){let a=n.ai(e.lat,-n.aj,n.aj);return new n.P(n.X(e.lng)*g,n.W(a)*g)}function C1(g,e){return new n.a5(e.x/g,e.y/g).toLngLat()}function S1(g){return g.cameraToCenterDistance*Math.min(.85*Math.tan(n.ak(90-g.pitch)),Math.tan(n.ak(K-g.pitch)))}function t1(g,e){let a=g.canonical,C=e/n.al(a.z),p=a.x+Math.pow(2,a.z)*g.wrap,m=n.am(new Float64Array(16));return n.N(m,m,[p*C,a.y*C,0]),n.O(m,m,[C/n.a3,C/n.a3,1]),m}function M1(g,e,a,C,p){let m=n.a5.fromLngLat(g,e),v=p*n.an(1,g.lat),w=v*Math.cos(n.ak(a)),T=Math.sqrt(v*v-w*w),A=T*Math.sin(n.ak(-C)),B=T*Math.cos(n.ak(-C));return new n.a5(m.x+A,m.y+B,m.z+w)}function I1(g,e,a){let C=e.intersectsFrustum(g);if(!a||C===0)return C;let p=e.intersectsPlane(a);return p===0?0:C===2&&p===2?2:1}function R1(g,e,a){let C=0,p=(a-e)/10;for(let m=0;m<10;m++)C+=p*Math.pow(Math.cos(e+(m+.5)/10*(a-e)),g);return C}function D1(g,e){return function(a,C,p,m,v){let w=2*((g-1)/n.ao(Math.cos(n.ak(K-v))/Math.cos(n.ak(K)))-1),T=Math.acos(p/m),A=2*R1(w-1,0,n.ak(v/2)),B=Math.min(n.ak(K),T+n.ak(v/2)),V=R1(w-1,Math.min(B,T-n.ak(v/2)),B),O=Math.atan(C/p),q=Math.hypot(C,p),Y=a;return Y+=n.ao(m/q/Math.max(.5,Math.cos(n.ak(v/2)))),Y+=w*n.ao(Math.cos(O))/2,Y-=n.ao(Math.max(1,V/A/e))/2,Y}}let h2=D1(9.314,3);function w2(g,e){let a=(e.roundZoom?Math.round:Math.floor)(g.zoom+n.ao(g.tileSize/e.tileSize));return Math.max(0,a)}function k2(g,e){let a=g.getCameraFrustum(),C=g.getClippingPlane(),p=g.screenPointToMercatorCoordinate(g.getCameraPoint()),m=n.a5.fromLngLat(g.center,g.elevation);p.z=m.z+Math.cos(g.pitchInRadians)*g.cameraToCenterDistance/g.worldSize;let v=g.getCoveringTilesDetailsProvider(),w=v.allowVariableZoom(g,e),T=w2(g,e),A=e.minzoom||0,B=e.maxzoom!==void 0?e.maxzoom:g.maxZoom,V=Math.min(Math.max(0,T),B),O=Math.pow(2,V),q=[O*p.x,O*p.y,0],Y=[O*m.x,O*m.y,0],e1=Math.hypot(m.x-p.x,m.y-p.y),i1=Math.abs(m.z-p.z),o1=Math.hypot(e1,i1),u1=x1=>({zoom:0,x:0,y:0,wrap:x1,fullyVisible:!1}),g1=[],c1=[];if(g.renderWorldCopies&&v.allowWorldCopies())for(let x1=1;x1<=3;x1++)g1.push(u1(-x1)),g1.push(u1(x1));for(g1.push(u1(0));g1.length>0;){let x1=g1.pop(),v1=x1.x,h1=x1.y,b1=x1.fullyVisible,A1={x:v1,y:h1,z:x1.zoom},Z1=v.getTileBoundingVolume(A1,x1.wrap,g.elevation,e);if(!b1){let i2=I1(a,Z1,C);if(i2===0)continue;b1=i2===2}let E1=v.distanceToTile2d(p.x,p.y,A1,Z1),B1=T;w&&(B1=(e.calculateTileZoom||h2)(g.zoom+n.ao(g.tileSize/e.tileSize),E1,i1,o1,g.fov)),B1=(e.roundZoom?Math.round:Math.floor)(B1),B1=Math.max(0,B1);let Q1=Math.min(B1,B);if(x1.wrap=v.getWrap(m,A1,x1.wrap),x1.zoom>=Q1){if(x1.zoom<A)continue;let i2=V-x1.zoom,X1=q[0]-.5-(v1<<i2),y2=q[1]-.5-(h1<<i2),M2=e.reparseOverscaled?Math.max(x1.zoom,B1):x1.zoom;c1.push({tileID:new n.a0(x1.zoom===B?M2:x1.zoom,x1.wrap,x1.zoom,v1,h1),distanceSq:n.ap([Y[0]-.5-v1,Y[1]-.5-h1]),tileDistanceToCamera:Math.sqrt(X1*X1+y2*y2)})}else for(let i2=0;i2<4;i2++)g1.push({zoom:x1.zoom+1,x:(v1<<1)+i2%2,y:(h1<<1)+(i2>>1),wrap:x1.wrap,fullyVisible:b1})}return c1.sort(((x1,v1)=>x1.distanceSq-v1.distanceSq)).map((x1=>x1.tileID))}let z5=n.a6.fromPoints([new n.P(0,0),new n.P(n.a3,n.a3)]);class H2 extends n.E{constructor(e,a,C){super(),this.id=e,this.dispatcher=C,this.on("data",(p=>this._dataHandler(p))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((p,m,v,w)=>{let T=new(E5(m.type))(p,m,v,w);if(T.id!==p)throw new Error(`Expected Source id to be ${p} instead of ${T.id}`);return T})(e,a,C,this),this._tiles={},this._cache=new n.aq(0,(p=>this._unloadTile(p))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new W,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e in this._tiles){let a=this._tiles[e];if(a.state!=="loaded"&&a.state!=="errored")return!1}return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,a,C){return n._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,a,C)}catch(p){e.state="errored",p.status!==404?this._source.fire(new n.k(p,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new n.l("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let a in this._tiles){let C=this._tiles[a];C.upload(e),C.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(O2).map((e=>e.key))}getRenderableIds(e){let a=[];for(let C in this._tiles)this._isIdRenderable(C,e)&&a.push(this._tiles[C]);return e?a.sort(((C,p)=>{let m=C.tileID,v=p.tileID,w=new n.P(m.canonical.x,m.canonical.y)._rotate(-this.transform.bearingInRadians),T=new n.P(v.canonical.x,v.canonical.y)._rotate(-this.transform.bearingInRadians);return m.overscaledZ-v.overscaledZ||T.y-w.y||T.x-w.x})).map((C=>C.tileID.key)):a.map((C=>C.tileID)).sort(O2).map((C=>C.key))}hasRenderableParent(e){let a=e.overscaledZ-1;if(a>=this._source.minzoom){let C=this.getLoadedTile(e.scaledTo(a));if(C)return this._isIdRenderable(C.tileID.key)}return!1}_isIdRenderable(e,a=!1){var C;return(C=this._tiles[e])===null||C===void 0?void 0:C.isRenderable(a)}reload(e,a=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let C in this._tiles)a&&this._source.shouldReloadTile&&!this._source.shouldReloadTile(this._tiles[C],a)||(e?this._reloadTile(C,"expired"):this._tiles[C].state!=="errored"&&this._reloadTile(C,"reloading"))}}_reloadTile(e,a){return n._(this,void 0,void 0,(function*(){let C=this._tiles[e];C&&(C.state!=="loading"&&(C.state=a),yield this._loadTile(C,e,a))}))}_tileLoaded(e,a,C){e.timeAdded=j(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration),C==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(a,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new n.l("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){let a=this.getRenderableIds();for(let p=0;p<a.length;p++){let m=a[p];if(e.neighboringTiles&&e.neighboringTiles[m]){let v=this.getTileByID(m);C(e,v),C(v,e)}}function C(p,m){p.needsHillshadePrepare=!0,p.needsTerrainPrepare=!0;let v=m.tileID.canonical.x-p.tileID.canonical.x,w=m.tileID.canonical.y-p.tileID.canonical.y,T=Math.pow(2,p.tileID.canonical.z),A=m.tileID.key;v===0&&w===0||Math.abs(w)>1||(Math.abs(v)>1&&(Math.abs(v+T)===1?v+=T:Math.abs(v-T)===1&&(v-=T)),m.dem&&p.dem&&(p.dem.backfillBorder(m.dem,v,w),p.neighboringTiles&&p.neighboringTiles[A]&&(p.neighboringTiles[A].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,a){let C=Object.values(e),p=this._getLoadedDescendents(C),m={};for(let v of C){let w=p[v.key];if(!w?.length){m[v.key]=v;continue}let T=v.overscaledZ+H2.maxUnderzooming,A=w.filter((O=>O.tileID.overscaledZ<=T));if(!A.length){m[v.key]=v;continue}let B=Math.min(...A.map((O=>O.tileID.overscaledZ))),V=A.filter((O=>O.tileID.overscaledZ===B)).map((O=>O.tileID));for(let O of V)a[O.key]=O;this._areDescendentsComplete(V,B,v.overscaledZ)||(m[v.key]=v)}return m}_getLoadedDescendents(e){var a;let C={};for(let p in this._tiles){let m=this._tiles[p];if(m.hasData())for(let v of e)m.tileID.isChildOf(v)&&(C[a=v.key]||(C[a]=[])).push(m)}return C}_areDescendentsComplete(e,a,C){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===a:Math.pow(4,a-C)===e.length}getLoadedTile(e){let a=this._tiles[e.key];return a?.hasData()?a:null}updateCacheSize(e){let a=Math.ceil(e.width/this._source.tileSize)+1,C=Math.ceil(e.height/this._source.tileSize)+1,p=Math.floor(a*C*(this._maxTileCacheZoomLevels===null?n.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),m=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,p):p;this._cache.setMaxSize(m)}handleWrapJump(e){let a=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,a){let C={};for(let p in this._tiles){let m=this._tiles[p];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+a),C[m.tileID.key]=m}this._tiles=C,this._resetTileReloadTimers()}}update(e,a){if(!this._sourceLoaded||this._paused)return;let C;this.transform=e,this.terrain=a,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?C=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((T=>new n.a0(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y))):(C=k2(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?e.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:a,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(C=C.filter((T=>this._source.hasTile(T))))):C=[],this.usedForTerrain&&(C=this._addTerrainIdealTiles(C));let p=C.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,p&&this.fire(new n.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let m=w2(e,this._source),v=this._updateRetainedTiles(C,m),w=_5(this._source.type);w&&this._rasterFadeDuration>0&&!a&&this._updateFadingTiles(C,v),w?this._cleanUpRasterTiles(v):this._cleanUpVectorTiles(v)}_cleanUpRasterTiles(e){for(let a in this._tiles)e[a]||this._removeTile(a)}_cleanUpVectorTiles(e){for(let a in this._tiles){let C=this._tiles[a];e[a]?C.clearSymbolFadeHold():C.hasSymbolBuckets?C.holdingForSymbolFade()?C.symbolFadeFinished()&&this._removeTile(a):C.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(a)}}_addTerrainIdealTiles(e){let a=[];for(let C of e)if(C.canonical.z>this._source.minzoom){let p=C.scaledTo(C.canonical.z-1);a.push(p);let m=C.scaledTo(Math.max(this._source.minzoom,Math.min(C.canonical.z,5)));a.push(m)}return e.concat(a)}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,a){var C;let p={},m={},v=Math.max(a-H2.maxOverzooming,this._source.minzoom),w={};for(let T of e){let A=this._addTile(T);p[T.key]=T,A.hasData()||(w[T.key]=T)}w=this._retainLoadedChildren(w,p);for(let T in w){let A=w[T],B=this._tiles[T],V=B?.wasRequested();for(let O=A.overscaledZ-1;O>=v;--O){let q=A.scaledTo(O);if(m[q.key])break;if(m[q.key]=!0,B=this.getTile(q),!B&&V&&(B=this._addTile(q)),B){let Y=B.hasData();if((Y||!(!((C=this.map)===null||C===void 0)&&C.cancelPendingTileRequestsWhileZooming)||V)&&(p[q.key]=q),V=B.wasRequested(),Y)break}}}return p}_updateFadingTiles(e,a){let C=j(),p=n.ar(e);for(let m of e){let v=this._tiles[m.key];v.fadingDirection!==p1.Departing&&v.fadeOpacity!==0||v.resetFadeLogic(),this._updateFadingAncestor(v,a,C)||this._updateFadingDescendents(v,a,C)||this._updateFadingEdge(v,p,C)||v.resetFadeLogic()}}_updateFadingAncestor(e,a,C){if(!e.hasData())return!1;let{tileID:p,fadingRole:m,fadingDirection:v,fadingParentID:w}=e;if(m===lt.Base&&v===p1.Incoming&&w)return a[w.key]=w,!0;let T=Math.max(p.overscaledZ-this._maxFadingAncestorLevels,this._source.minzoom);for(let A=p.overscaledZ-1;A>=T;A--){let B=p.scaledTo(A),V=this.getLoadedTile(B);if(V)return e.setCrossFadeLogic({fadingRole:lt.Base,fadingDirection:p1.Incoming,fadingParentID:V.tileID,fadeEndTime:C+this._rasterFadeDuration}),V.setCrossFadeLogic({fadingRole:lt.Parent,fadingDirection:p1.Departing,fadeEndTime:C+this._rasterFadeDuration}),a[B.key]=B,!0}return!1}_updateFadingDescendents(e,a,C){if(!e.hasData())return!1;let p=e.tileID.children(this._source.maxzoom),m=this._updateFadingChildren(e,p,a,C);if(m)return!0;for(let v of p){let w=v.children(this._source.maxzoom);this._updateFadingChildren(e,w,a,C)&&(m=!0)}return m}_updateFadingChildren(e,a,C,p){if(a[0].overscaledZ>=this._source.maxzoom)return!1;let m=!1;for(let v of a){let w=this.getLoadedTile(v);if(!w)continue;let{fadingRole:T,fadingDirection:A,fadingParentID:B}=w;T===lt.Base&&A===p1.Departing&&B||(w.setCrossFadeLogic({fadingRole:lt.Base,fadingDirection:p1.Departing,fadingParentID:e.tileID,fadeEndTime:p+this._rasterFadeDuration}),e.setCrossFadeLogic({fadingRole:lt.Parent,fadingDirection:p1.Incoming,fadeEndTime:p+this._rasterFadeDuration})),C[v.key]=v,m=!0}return m}_updateFadingEdge(e,a,C){let p=e.tileID;return!!e.selfFading||!e.hasData()&&!!a.has(p)&&(e.setSelfFadeLogic(C+this._rasterFadeDuration),!0)}_addTile(e){let a=this._tiles[e.key];if(a)return a;a=this._cache.getAndRemove(e),a&&(a.resetFadeLogic(),this._setTileReloadTimer(e.key,a),a.tileID=e,this._state.initializeTileState(a,this.map?this.map.painter:null));let C=a;return a||(a=new H(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(a,e.key,a.state)),a.uses++,this._tiles[e.key]=a,C||this._source.fire(new n.l("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(e,a){this._clearTileReloadTimer(e);let C=a.getExpiryTimeout();C&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),C))}_clearTileReloadTimer(e){let a=this._timers[e];a&&(clearTimeout(a),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}refreshTiles(e){for(let a in this._tiles)(this._isIdRenderable(a)||this._tiles[a].state=="errored")&&e.some((C=>C.equals(this._tiles[a].tileID.canonical)))&&this._reloadTile(a,"expired")}_removeTile(e){let a=this._tiles[e];a&&(a.uses--,delete this._tiles[e],this._clearTileReloadTimer(e),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(e){e.dataType==="source"&&(e.sourceDataType!=="metadata"?e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,a,C){let p=[],m=this.transform;if(!m)return p;let v=m.getCoveringTilesDetailsProvider().allowWorldCopies(),w=C?m.getCameraQueryGeometry(e):e,T=q=>m.screenPointToMercatorCoordinate(q,this.terrain),A=this.transformBbox(e,T,!v),B=this.transformBbox(w,T,!v),V=this.getIds(),O=n.a6.fromPoints(B);for(let q=0;q<V.length;q++){let Y=this._tiles[V[q]];if(Y.holdingForSymbolFade())continue;let e1=v?[Y.tileID]:[Y.tileID.unwrapTo(-1),Y.tileID.unwrapTo(0)],i1=Math.pow(2,m.zoom-Y.tileID.overscaledZ),o1=a*Y.queryPadding*n.a3/Y.tileSize/i1;for(let u1 of e1){let g1=O.map((c1=>u1.getTilePoint(new n.a5(c1.x,c1.y))));if(g1.expandBy(o1),g1.intersects(z5)){let c1=A.map((v1=>u1.getTilePoint(v1))),x1=B.map((v1=>u1.getTilePoint(v1)));p.push({tile:Y,tileID:v?u1:u1.unwrapTo(0),queryGeometry:c1,cameraQueryGeometry:x1,scale:i1})}}}return p}transformBbox(e,a,C){let p=e.map(a);if(C){let m=n.a6.fromPoints(e);m.shrinkBy(.001*Math.min(m.width(),m.height()));let v=m.map(a);n.a6.fromPoints(p).covers(v)||(p=p.map((w=>w.x>.5?new n.a5(w.x-1,w.y,w.z):w)))}return p}getVisibleCoordinates(e){let a=this.getRenderableIds(e).map((C=>this._tiles[C].tileID));return this.transform&&this.transform.populateCache(a),a}hasTransition(){if(this._source.hasTransition())return!0;if(_5(this._source.type)&&this._rasterFadeDuration>0){let e=j();for(let a in this._tiles)if(this._tiles[a].fadeEndTime>=e)return!0}return!1}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,a,C){this._state.updateState(e=e||"_geojsonTileLayer",a,C)}removeFeatureState(e,a,C){this._state.removeFeatureState(e=e||"_geojsonTileLayer",a,C)}getFeatureState(e,a){return this._state.getState(e=e||"_geojsonTileLayer",a)}setDependencies(e,a,C){let p=this._tiles[e];p&&p.setDependencies(a,C)}reloadTilesForDependencies(e,a){for(let C in this._tiles)this._tiles[C].hasDependency(e,a)&&this._reloadTile(C,"reloading");this._cache.filter((C=>!C.hasDependency(e,a)))}}function O2(g,e){let a=Math.abs(2*g.wrap)-+(g.wrap<0),C=Math.abs(2*e.wrap)-+(e.wrap<0);return g.overscaledZ-e.overscaledZ||C-a||e.canonical.y-g.canonical.y||e.canonical.x-g.canonical.x}function _5(g){return g==="raster"||g==="image"||g==="video"}H2.maxOverzooming=10,H2.maxUnderzooming=3;class H1{constructor(e,a){this.reset(e,a)}reset(e,a){this.points=e||[],this._distances=[0];for(let C=1;C<this.points.length;C++)this._distances[C]=this._distances[C-1]+this.points[C].dist(this.points[C-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=n.ai(e,0,1);let a=1,C=this._distances[a],p=e*this.paddedLength+this.padding;for(;C<p&&a<this._distances.length;)C=this._distances[++a];let m=a-1,v=this._distances[m],w=C-v,T=w>0?(p-v)/w:0;return this.points[m].mult(1-T).add(this.points[a].mult(T))}}function p5(g,e){let a=!0;return g==="always"||g!=="never"&&e!=="never"||(a=!1),a}class a5{constructor(e,a,C){let p=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(e/C),this.yCellCount=Math.ceil(a/C);for(let v=0;v<this.xCellCount*this.yCellCount;v++)p.push([]),m.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=a,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,a,C,p,m){this._forEachCell(a,C,p,m,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(a),this.bboxes.push(C),this.bboxes.push(p),this.bboxes.push(m)}insertCircle(e,a,C,p){this._forEachCell(a-p,C-p,a+p,C+p,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(a),this.circles.push(C),this.circles.push(p)}_insertBoxCell(e,a,C,p,m,v){this.boxCells[m].push(v)}_insertCircleCell(e,a,C,p,m,v){this.circleCells[m].push(v)}_query(e,a,C,p,m,v,w){if(C<0||e>this.width||p<0||a>this.height)return[];let T=[];if(e<=0&&a<=0&&this.width<=C&&this.height<=p){if(m)return[{key:null,x1:e,y1:a,x2:C,y2:p}];for(let A=0;A<this.boxKeys.length;A++)T.push({key:this.boxKeys[A],x1:this.bboxes[4*A],y1:this.bboxes[4*A+1],x2:this.bboxes[4*A+2],y2:this.bboxes[4*A+3]});for(let A=0;A<this.circleKeys.length;A++){let B=this.circles[3*A],V=this.circles[3*A+1],O=this.circles[3*A+2];T.push({key:this.circleKeys[A],x1:B-O,y1:V-O,x2:B+O,y2:V+O})}}else this._forEachCell(e,a,C,p,this._queryCell,T,{hitTest:m,overlapMode:v,seenUids:{box:{},circle:{}}},w);return T}query(e,a,C,p){return this._query(e,a,C,p,!1,null)}hitTest(e,a,C,p,m,v){return this._query(e,a,C,p,!0,m,v).length>0}hitTestCircle(e,a,C,p,m){let v=e-C,w=e+C,T=a-C,A=a+C;if(w<0||v>this.width||A<0||T>this.height)return!1;let B=[];return this._forEachCell(v,T,w,A,this._queryCellCircle,B,{hitTest:!0,overlapMode:p,circle:{x:e,y:a,radius:C},seenUids:{box:{},circle:{}}},m),B.length>0}_queryCell(e,a,C,p,m,v,w,T){let{seenUids:A,hitTest:B,overlapMode:V}=w,O=this.boxCells[m];if(O!==null){let Y=this.bboxes;for(let e1 of O)if(!A.box[e1]){A.box[e1]=!0;let i1=4*e1,o1=this.boxKeys[e1];if(e<=Y[i1+2]&&a<=Y[i1+3]&&C>=Y[i1+0]&&p>=Y[i1+1]&&(!T||T(o1))&&(!B||!p5(V,o1.overlapMode))&&(v.push({key:o1,x1:Y[i1],y1:Y[i1+1],x2:Y[i1+2],y2:Y[i1+3]}),B))return!0}}let q=this.circleCells[m];if(q!==null){let Y=this.circles;for(let e1 of q)if(!A.circle[e1]){A.circle[e1]=!0;let i1=3*e1,o1=this.circleKeys[e1];if(this._circleAndRectCollide(Y[i1],Y[i1+1],Y[i1+2],e,a,C,p)&&(!T||T(o1))&&(!B||!p5(V,o1.overlapMode))){let u1=Y[i1],g1=Y[i1+1],c1=Y[i1+2];if(v.push({key:o1,x1:u1-c1,y1:g1-c1,x2:u1+c1,y2:g1+c1}),B)return!0}}}return!1}_queryCellCircle(e,a,C,p,m,v,w,T){let{circle:A,seenUids:B,overlapMode:V}=w,O=this.boxCells[m];if(O!==null){let Y=this.bboxes;for(let e1 of O)if(!B.box[e1]){B.box[e1]=!0;let i1=4*e1,o1=this.boxKeys[e1];if(this._circleAndRectCollide(A.x,A.y,A.radius,Y[i1+0],Y[i1+1],Y[i1+2],Y[i1+3])&&(!T||T(o1))&&!p5(V,o1.overlapMode))return v.push(!0),!0}}let q=this.circleCells[m];if(q!==null){let Y=this.circles;for(let e1 of q)if(!B.circle[e1]){B.circle[e1]=!0;let i1=3*e1,o1=this.circleKeys[e1];if(this._circlesCollide(Y[i1],Y[i1+1],Y[i1+2],A.x,A.y,A.radius)&&(!T||T(o1))&&!p5(V,o1.overlapMode))return v.push(!0),!0}}}_forEachCell(e,a,C,p,m,v,w,T){let A=this._convertToXCellCoord(e),B=this._convertToYCellCoord(a),V=this._convertToXCellCoord(C),O=this._convertToYCellCoord(p);for(let q=A;q<=V;q++)for(let Y=B;Y<=O;Y++)if(m.call(this,e,a,C,p,this.xCellCount*Y+q,v,w,T))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,a,C,p,m,v){let w=p-e,T=m-a,A=C+v;return A*A>w*w+T*T}_circleAndRectCollide(e,a,C,p,m,v,w){let T=(v-p)/2,A=Math.abs(e-(p+T));if(A>T+C)return!1;let B=(w-m)/2,V=Math.abs(a-(m+B));if(V>B+C)return!1;if(A<=T||V<=B)return!0;let O=A-T,q=V-B;return O*O+q*q<=C*C}}function I5(g,e,a){let C=n.M();if(!g){let{vecSouth:V,vecEast:O}=G1(e),q=M();q[0]=O[0],q[1]=O[1],q[2]=V[0],q[3]=V[1],p=q,(B=(v=(m=q)[0])*(A=m[3])-(T=m[2])*(w=m[1]))&&(p[0]=A*(B=1/B),p[1]=-w*B,p[2]=-T*B,p[3]=v*B),C[0]=q[0],C[1]=q[1],C[4]=q[2],C[5]=q[3]}var p,m,v,w,T,A,B;return n.O(C,C,[1/a,1/a,1]),C}function f5(g,e,a,C){if(g){let p=n.M();if(!e){let{vecSouth:m,vecEast:v}=G1(a);p[0]=v[0],p[1]=v[1],p[4]=m[0],p[5]=m[1]}return n.O(p,p,[C,C,1]),p}return a.pixelsToClipSpaceMatrix}function G1(g){let e=Math.cos(g.rollInRadians),a=Math.sin(g.rollInRadians),C=Math.cos(g.pitchInRadians),p=Math.cos(g.bearingInRadians),m=Math.sin(g.bearingInRadians),v=n.aw();v[0]=-p*C*a-m*e,v[1]=-m*C*a+p*e;let w=n.ax(v);w<1e-9?n.ay(v):n.az(v,v,1/w);let T=n.aw();T[0]=p*C*e-m*a,T[1]=m*C*e+p*a;let A=n.ax(T);return A<1e-9?n.ay(T):n.az(T,T,1/A),{vecEast:T,vecSouth:v}}function L2(g,e,a,C){let p;C?(p=[g,e,C(g,e),1],n.aB(p,p,a)):(p=[g,e,0,1],J9(p,p,a));let m=p[3];return{point:new n.P(p[0]/m,p[1]/m),signedDistanceFromCamera:m,isOccluded:!1}}function _2(g,e){return .5+g/e*.5}function Wt(g,e){return g.x>=-e[0]&&g.x<=e[0]&&g.y>=-e[1]&&g.y<=e[1]}function M8(g,e,a,C,p,m,v,w,T,A,B,V,O){let q=a?g.textSizeData:g.iconSizeData,Y=n.as(q,e.transform.zoom),e1=[256/e.width*2+1,256/e.height*2+1],i1=a?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;i1.clear();let o1=g.lineVertexArray,u1=a?g.text.placedSymbolArray:g.icon.placedSymbolArray,g1=e.transform.width/e.transform.height,c1=!1;for(let x1=0;x1<u1.length;x1++){let v1=u1.get(x1);if(v1.hidden||v1.writingMode===n.at.vertical&&!c1){u3(v1.numGlyphs,i1);continue}c1=!1;let h1=new n.P(v1.anchorX,v1.anchorY),b1={getElevation:O,pitchedLabelPlaneMatrix:C,lineVertexArray:o1,pitchWithMap:m,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:h1,unwrappedTileID:T,width:A,height:B,translation:V},A1=l9(v1.anchorX,v1.anchorY,b1);if(!Wt(A1.point,e1)){u3(v1.numGlyphs,i1);continue}let Z1=_2(e.transform.cameraToCenterDistance,A1.signedDistanceFromCamera),E1=n.au(q,Y,v1),B1=m?E1*e.transform.getPitchedTextCorrection(v1.anchorX,v1.anchorY,T)/Z1:E1*Z1,Q1=M3({projectionContext:b1,pitchedLabelPlaneMatrixInverse:p,symbol:v1,fontSize:B1,flip:!1,keepUpright:v,glyphOffsetArray:g.glyphOffsetArray,dynamicLayoutVertexArray:i1,aspectRatio:g1,rotateToLine:w});c1=Q1.useVertical,(Q1.notEnoughRoom||c1||Q1.needsFlipping&&M3({projectionContext:b1,pitchedLabelPlaneMatrixInverse:p,symbol:v1,fontSize:B1,flip:!0,keepUpright:v,glyphOffsetArray:g.glyphOffsetArray,dynamicLayoutVertexArray:i1,aspectRatio:g1,rotateToLine:w}).notEnoughRoom)&&u3(v1.numGlyphs,i1)}a?g.text.dynamicLayoutVertexBuffer.updateData(i1):g.icon.dynamicLayoutVertexBuffer.updateData(i1)}function It(g,e,a,C,p,m,v,w){let T=m.glyphStartIndex+m.numGlyphs,A=m.lineStartIndex,B=m.lineStartIndex+m.lineLength,V=e.getoffsetX(m.glyphStartIndex),O=e.getoffsetX(T-1),q=O5(g*V,a,C,p,m.segment,A,B,w,v);if(!q)return null;let Y=O5(g*O,a,C,p,m.segment,A,B,w,v);return Y?w.projectionCache.anyProjectionOccluded?null:{first:q,last:Y}:null}function V2(g,e,a,C){return g===n.at.horizontal&&Math.abs(a.y-e.y)>Math.abs(a.x-e.x)*C?{useVertical:!0}:(g===n.at.vertical?e.y<a.y:e.x>a.x)?{needsFlipping:!0}:null}function M3(g){let{projectionContext:e,pitchedLabelPlaneMatrixInverse:a,symbol:C,fontSize:p,flip:m,keepUpright:v,glyphOffsetArray:w,dynamicLayoutVertexArray:T,aspectRatio:A,rotateToLine:B}=g,V=p/24,O=C.lineOffsetX*V,q=C.lineOffsetY*V,Y;if(C.numGlyphs>1){let e1=C.glyphStartIndex+C.numGlyphs,i1=C.lineStartIndex,o1=C.lineStartIndex+C.lineLength,u1=It(V,w,O,q,m,C,B,e);if(!u1)return{notEnoughRoom:!0};let g1=b8(u1.first.point.x,u1.first.point.y,e,a),c1=b8(u1.last.point.x,u1.last.point.y,e,a);if(v&&!m){let x1=V2(C.writingMode,g1,c1,A);if(x1)return x1}Y=[u1.first];for(let x1=C.glyphStartIndex+1;x1<e1-1;x1++){let v1=O5(V*w.getoffsetX(x1),O,q,m,C.segment,i1,o1,e,B);if(!v1)return{notEnoughRoom:!0};Y.push(v1)}Y.push(u1.last)}else{if(v&&!m){let i1=j6(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,o1=C.lineStartIndex+C.segment+1,u1=new n.P(e.lineVertexArray.getx(o1),e.lineVertexArray.gety(o1)),g1=j6(u1.x,u1.y,e),c1=g1.signedDistanceFromCamera>0?g1.point:a9(e.tileAnchorPoint,u1,i1,1,e),x1=b8(i1.x,i1.y,e,a),v1=b8(c1.x,c1.y,e,a),h1=V2(C.writingMode,x1,v1,A);if(h1)return h1}let e1=O5(V*w.getoffsetX(C.glyphStartIndex),O,q,m,C.segment,C.lineStartIndex,C.lineStartIndex+C.lineLength,e,B);if(!e1||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Y=[e1]}for(let e1 of Y)n.aA(T,e1.point,e1.angle);return{}}function a9(g,e,a,C,p){let m=g.add(g.sub(e)._unit()),v=j6(m.x,m.y,p).point,w=a.sub(v);return a.add(w._mult(C/w.mag()))}function s9(g,e,a){let C=e.projectionCache;if(C.projections[g])return C.projections[g];let p=new n.P(e.lineVertexArray.getx(g),e.lineVertexArray.gety(g)),m=j6(p.x,p.y,e);if(m.signedDistanceFromCamera>0)return C.projections[g]=m.point,C.anyProjectionOccluded=C.anyProjectionOccluded||m.isOccluded,m.point;let v=g-a.direction;return a9(a.distanceFromAnchor===0?e.tileAnchorPoint:new n.P(e.lineVertexArray.getx(v),e.lineVertexArray.gety(v)),p,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,e)}function j6(g,e,a){let C=g+a.translation[0],p=e+a.translation[1],m;return a.pitchWithMap?(m=L2(C,p,a.pitchedLabelPlaneMatrix,a.getElevation),m.isOccluded=!1):(m=a.transform.projectTileCoordinates(C,p,a.unwrappedTileID,a.getElevation),m.point.x=(.5*m.point.x+.5)*a.width,m.point.y=(.5*-m.point.y+.5)*a.height),m}function b8(g,e,a,C){if(a.pitchWithMap){let p=[g,e,0,1];return n.aB(p,p,C),a.transform.projectTileCoordinates(p[0]/p[3],p[1]/p[3],a.unwrappedTileID,a.getElevation).point}return{x:g/a.width*2-1,y:1-e/a.height*2}}function l9(g,e,a){return a.transform.projectTileCoordinates(g,e,a.unwrappedTileID,a.getElevation)}function c9(g,e,a){return g._unit()._perp()._mult(e*a)}function b6(g,e,a,C,p,m,v,w,T){if(w.projectionCache.offsets[g])return w.projectionCache.offsets[g];let A=a.add(e);if(g+T.direction<C||g+T.direction>=p)return w.projectionCache.offsets[g]=A,A;let B=s9(g+T.direction,w,T),V=c9(B.sub(a),v,T.direction),O=a.add(V),q=B.add(V);return w.projectionCache.offsets[g]=n.aC(m,A,O,q)||A,w.projectionCache.offsets[g]}function O5(g,e,a,C,p,m,v,w,T){let A=C?g-e:g+e,B=A>0?1:-1,V=0;C&&(B*=-1,V=Math.PI),B<0&&(V+=Math.PI);let O,q=B>0?m+p:m+p+1;w.projectionCache.cachedAnchorPoint?O=w.projectionCache.cachedAnchorPoint:(O=j6(w.tileAnchorPoint.x,w.tileAnchorPoint.y,w).point,w.projectionCache.cachedAnchorPoint=O);let Y,e1,i1=O,o1=O,u1=0,g1=0,c1=Math.abs(A),x1=[],v1;for(;u1+g1<=c1;){if(q+=B,q<m||q>=v)return null;u1+=g1,o1=i1,e1=Y;let A1={absOffsetX:c1,direction:B,distanceFromAnchor:u1,previousVertex:o1};if(i1=s9(q,w,A1),a===0)x1.push(o1),v1=i1.sub(o1);else{let Z1,E1=i1.sub(o1);Z1=E1.mag()===0?c9(s9(q+B,w,A1).sub(i1),a,B):c9(E1,a,B),e1||(e1=o1.add(Z1)),Y=b6(q,Z1,i1,m,v,e1,a,w,A1),x1.push(e1),v1=Y.sub(e1)}g1=v1.mag()}let h1=v1._mult((c1-u1)/g1)._add(e1||o1),b1=V+Math.atan2(i1.y-o1.y,i1.x-o1.x);return x1.push(h1),{point:h1,angle:T?b1:0,path:x1}}let is=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function u3(g,e){for(let a=0;a<g;a++){let C=e.length;e.resize(C+4),e.float32.set(is,3*C)}}function J9(g,e,a){let C=e[0],p=e[1];return g[0]=a[0]*C+a[4]*p+a[12],g[1]=a[1]*C+a[5]*p+a[13],g[3]=a[3]*C+a[7]*p+a[15],g}let rt=100;class i8{constructor(e,a=new a5(e.width+200,e.height+200,25),C=new a5(e.width+200,e.height+200,25)){this.transform=e,this.grid=a,this.ignoredGrid=C,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+rt,this.screenBottomBoundary=e.height+rt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,a,C,p,m,v,w,T,A,B,V,O){let q=this.projectAndGetPerspectiveRatio(e.anchorPointX+T[0],e.anchorPointY+T[1],m,B,O),Y=C*q.perspectiveRatio,e1;if(v||w)e1=this._projectCollisionBox(e,Y,p,m,v,w,T,q,B,V,O);else{let v1=q.x+(V?V.x*Y:0),h1=q.y+(V?V.y*Y:0);e1={allPointsOccluded:!1,box:[v1+e.x1*Y,h1+e.y1*Y,v1+e.x2*Y,h1+e.y2*Y]}}let[i1,o1,u1,g1]=e1.box,c1=v?e1.allPointsOccluded:q.isOccluded,x1=c1;return x1||(x1=q.perspectiveRatio<this.perspectiveRatioCutoff),x1||(x1=!this.isInsideGrid(i1,o1,u1,g1)),x1||a!=="always"&&this.grid.hitTest(i1,o1,u1,g1,a,A)?{box:[i1,o1,u1,g1],placeable:!1,offscreen:!1,occluded:c1}:{box:[i1,o1,u1,g1],placeable:!0,offscreen:this.isOffscreen(i1,o1,u1,g1),occluded:c1}}placeCollisionCircles(e,a,C,p,m,v,w,T,A,B,V,O,q,Y){let e1=[],i1=new n.P(a.anchorX,a.anchorY),o1=this.getPerspectiveRatio(i1.x,i1.y,v,Y),u1=(A?m*this.transform.getPitchedTextCorrection(a.anchorX,a.anchorY,v)/o1:m*o1)/n.aG,g1={getElevation:Y,pitchedLabelPlaneMatrix:w,lineVertexArray:C,pitchWithMap:A,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:i1,unwrappedTileID:v,width:this.transform.width,height:this.transform.height,translation:q},c1=It(u1,p,a.lineOffsetX*u1,a.lineOffsetY*u1,!1,a,!1,g1),x1=!1,v1=!1,h1=!0;if(c1){let b1=.5*V*o1+O,A1=new n.P(-100,-100),Z1=new n.P(this.screenRightBoundary,this.screenBottomBoundary),E1=new H1,B1=c1.first,Q1=c1.last,i2=[];for(let M2=B1.path.length-1;M2>=1;M2--)i2.push(B1.path[M2]);for(let M2=1;M2<Q1.path.length;M2++)i2.push(Q1.path[M2]);let X1=2.5*b1;if(A){let M2=this.projectPathToScreenSpace(i2,g1);i2=M2.some((T5=>T5.signedDistanceFromCamera<=0))?[]:M2.map((T5=>T5.point))}let y2=[];if(i2.length>0){let M2=i2[0].clone(),T5=i2[0].clone();for(let H5=1;H5<i2.length;H5++)M2.x=Math.min(M2.x,i2[H5].x),M2.y=Math.min(M2.y,i2[H5].y),T5.x=Math.max(T5.x,i2[H5].x),T5.y=Math.max(T5.y,i2[H5].y);y2=M2.x>=A1.x&&T5.x<=Z1.x&&M2.y>=A1.y&&T5.y<=Z1.y?[i2]:T5.x<A1.x||M2.x>Z1.x||T5.y<A1.y||M2.y>Z1.y?[]:n.aD([i2],A1.x,A1.y,Z1.x,Z1.y)}for(let M2 of y2){E1.reset(M2,.25*b1);let T5=0;T5=E1.length<=.5*b1?1:Math.ceil(E1.paddedLength/X1)+1;for(let H5=0;H5<T5;H5++){let G5=H5/Math.max(T5-1,1),X5=E1.lerp(G5),B5=X5.x+rt,yt=X5.y+rt;e1.push(B5,yt,b1,0);let k5=B5-b1,Pt=yt-b1,Ct=B5+b1,vt=yt+b1;if(h1=h1&&this.isOffscreen(k5,Pt,Ct,vt),v1=v1||this.isInsideGrid(k5,Pt,Ct,vt),e!=="always"&&this.grid.hitTestCircle(B5,yt,b1,e,B)&&(x1=!0,!T))return{circles:[],offscreen:!1,collisionDetected:x1}}}}return{circles:!T&&x1||!v1||o1<this.perspectiveRatioCutoff?[]:e1,offscreen:h1,collisionDetected:x1}}projectPathToScreenSpace(e,a){let C=(function(p,m){let v=n.M();return n.av(v,m.pitchedLabelPlaneMatrix),p.map((w=>{let T=L2(w.x,w.y,v,m.getElevation),A=m.transform.projectTileCoordinates(T.point.x,T.point.y,m.unwrappedTileID,m.getElevation);return A.point.x=(.5*A.point.x+.5)*m.width,A.point.y=(.5*-A.point.y+.5)*m.height,A}))})(e,a);return(function(p){let m=0,v=0,w=0,T=0;for(let A=0;A<p.length;A++)p[A].isOccluded?(w=A+1,T=0):(T++,T>v&&(v=T,m=w));return p.slice(m,m+v)})(C)}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let a=[],C=new n.a6;for(let V of e){let O=new n.P(V.x+rt,V.y+rt);C.extend(O),a.push(O)}let{minX:p,minY:m,maxX:v,maxY:w}=C,T=this.grid.query(p,m,v,w).concat(this.ignoredGrid.query(p,m,v,w)),A={},B={};for(let V of T){let O=V.key;if(A[O.bucketInstanceId]===void 0&&(A[O.bucketInstanceId]={}),A[O.bucketInstanceId][O.featureIndex])continue;let q=[new n.P(V.x1,V.y1),new n.P(V.x2,V.y1),new n.P(V.x2,V.y2),new n.P(V.x1,V.y2)];n.aE(a,q)&&(A[O.bucketInstanceId][O.featureIndex]=!0,B[O.bucketInstanceId]===void 0&&(B[O.bucketInstanceId]=[]),B[O.bucketInstanceId].push(O.featureIndex))}return B}insertCollisionBox(e,a,C,p,m,v){(C?this.ignoredGrid:this.grid).insert({bucketInstanceId:p,featureIndex:m,collisionGroupID:v,overlapMode:a},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,a,C,p,m,v){let w=C?this.ignoredGrid:this.grid,T={bucketInstanceId:p,featureIndex:m,collisionGroupID:v,overlapMode:a};for(let A=0;A<e.length;A+=4)w.insertCircle(T,e[A],e[A+1],e[A+2])}projectAndGetPerspectiveRatio(e,a,C,p,m){if(m){let v;p?(v=[e,a,p(e,a),1],n.aB(v,v,m)):(v=[e,a,0,1],J9(v,v,m));let w=v[3];return{x:(v[0]/w+1)/2*this.transform.width+rt,y:(-v[1]/w+1)/2*this.transform.height+rt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/w*.5,isOccluded:!1,signedDistanceFromCamera:w}}{let v=this.transform.projectTileCoordinates(e,a,C,p);return{x:(v.point.x+1)/2*this.transform.width+rt,y:(1-v.point.y)/2*this.transform.height+rt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/v.signedDistanceFromCamera*.5,isOccluded:v.isOccluded,signedDistanceFromCamera:v.signedDistanceFromCamera}}}getPerspectiveRatio(e,a,C,p){let m=this.transform.projectTileCoordinates(e,a,C,p);return .5+this.transform.cameraToCenterDistance/m.signedDistanceFromCamera*.5}isOffscreen(e,a,C,p){return C<rt||e>=this.screenRightBoundary||p<rt||a>this.screenBottomBoundary}isInsideGrid(e,a,C,p){return C>=0&&e<this.gridRightBoundary&&p>=0&&a<this.gridBottomBoundary}getViewportMatrix(){let e=n.am([]);return n.N(e,e,[-100,-100,0]),e}_projectCollisionBox(e,a,C,p,m,v,w,T,A,B,V){let O=1,q=0,Y=0,e1=1,i1=e.anchorPointX+w[0],o1=e.anchorPointY+w[1];if(v&&!m){let i2=this.projectAndGetPerspectiveRatio(i1+1,o1,p,A,V),X1=i2.x-T.x,y2=Math.atan((i2.y-T.y)/X1)+(X1<0?Math.PI:0),M2=Math.sin(y2),T5=Math.cos(y2);O=T5,q=M2,Y=-M2,e1=T5}else if(!v&&m){let i2=G1(this.transform);O=i2.vecEast[0],q=i2.vecEast[1],Y=i2.vecSouth[0],e1=i2.vecSouth[1]}let u1=T.x,g1=T.y,c1=a;m&&(u1=i1,g1=o1,c1=Math.pow(2,-(this.transform.zoom-C.overscaledZ)),c1*=this.transform.getPitchedTextCorrection(i1,o1,p),B||(c1*=n.ai(.5+T.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),B&&(u1+=O*B.x*c1+Y*B.y*c1,g1+=q*B.x*c1+e1*B.y*c1);let x1=e.x1*c1,v1=e.x2*c1,h1=(x1+v1)/2,b1=e.y1*c1,A1=e.y2*c1,Z1=(b1+A1)/2,E1=[{offsetX:x1,offsetY:b1},{offsetX:h1,offsetY:b1},{offsetX:v1,offsetY:b1},{offsetX:v1,offsetY:Z1},{offsetX:v1,offsetY:A1},{offsetX:h1,offsetY:A1},{offsetX:x1,offsetY:A1},{offsetX:x1,offsetY:Z1}],B1=[];for(let{offsetX:i2,offsetY:X1}of E1)B1.push(new n.P(u1+O*i2+Y*X1,g1+q*i2+e1*X1));let Q1=!1;if(m){let i2=B1.map((X1=>this.projectAndGetPerspectiveRatio(X1.x,X1.y,p,A,V)));Q1=i2.some((X1=>!X1.isOccluded)),B1=i2.map((X1=>new n.P(X1.x,X1.y)))}else Q1=!0;return{box:n.aF(B1),allPointsOccluded:!Q1}}}class J7{constructor(e,a,C,p){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?a:-a))):p&&C?1:0,this.placed=C}isHidden(){return this.opacity===0&&!this.placed}}class L9{constructor(e,a,C,p,m){this.text=new J7(e?e.text:null,a,C,m),this.icon=new J7(e?e.icon:null,a,p,m)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Q7{constructor(e,a,C){this.text=e,this.icon=a,this.skipFade=C}}class u9{constructor(e,a,C,p,m){this.bucketInstanceId=e,this.featureIndex=a,this.sourceLayerIndex=C,this.bucketIndex=p,this.tileID=m}}class br{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let a=++this.maxGroupID;this.collisionGroups[e]={ID:a,predicate:C=>C.collisionGroupID===a}}return this.collisionGroups[e]}}function wr(g,e,a,C,p){let{horizontalAlign:m,verticalAlign:v}=n.aM(g);return new n.P(-(m-.5)*e+C[0]*p,-(v-.5)*a+C[1]*p)}class rs{constructor(e,a,C,p,m){this.transform=e.clone(),this.terrain=a,this.collisionIndex=new i8(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=C,this.retainedQueryData={},this.collisionGroups=new br(p),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let a=this.terrain;return a?(C,p)=>a.getElevation(e,C,p):null}getBucketParts(e,a,C,p){let m=C.getBucket(a),v=C.latestFeatureIndex;if(!m||!v||a.id!==m.layerIds[0])return;let w=C.collisionBoxArray,T=m.layers[0].layout,A=m.layers[0].paint,B=Math.pow(2,this.transform.zoom-C.tileID.overscaledZ),V=C.tileSize/n.a3,O=C.tileID.toUnwrapped(),q=T.get("text-rotation-alignment")==="map",Y=n.aH(C,1,this.transform.zoom),e1=n.aI(this.collisionIndex.transform,C,A.get("text-translate"),A.get("text-translate-anchor")),i1=n.aI(this.collisionIndex.transform,C,A.get("icon-translate"),A.get("icon-translate-anchor")),o1=I5(q,this.transform,Y);this.retainedQueryData[m.bucketInstanceId]=new u9(m.bucketInstanceId,v,m.sourceLayerIndex,m.index,C.tileID);let u1={bucket:m,layout:T,translationText:e1,translationIcon:i1,unwrappedTileID:O,pitchedLabelPlaneMatrix:o1,scale:B,textPixelRatio:V,holdingForFade:C.holdingForSymbolFade(),collisionBoxArray:w,partiallyEvaluatedTextSize:n.as(m.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(p)for(let g1 of m.sortKeyRanges){let{sortKey:c1,symbolInstanceStart:x1,symbolInstanceEnd:v1}=g1;e.push({sortKey:c1,symbolInstanceStart:x1,symbolInstanceEnd:v1,parameters:u1})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:u1})}attemptAnchorPlacement(e,a,C,p,m,v,w,T,A,B,V,O,q,Y,e1,i1,o1,u1,g1,c1){let x1=n.aJ[e.textAnchor],v1=[e.textOffset0,e.textOffset1],h1=wr(x1,C,p,v1,m),b1=this.collisionIndex.placeCollisionBox(a,O,T,A,B,w,v,i1,V.predicate,g1,h1,c1);if((!u1||this.collisionIndex.placeCollisionBox(u1,O,T,A,B,w,v,o1,V.predicate,g1,h1,c1).placeable)&&b1.placeable){let A1;if(this.prevPlacement&&this.prevPlacement.variableOffsets[q.crossTileID]&&this.prevPlacement.placements[q.crossTileID]&&this.prevPlacement.placements[q.crossTileID].text&&(A1=this.prevPlacement.variableOffsets[q.crossTileID].anchor),q.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[q.crossTileID]={textOffset:v1,width:C,height:p,anchor:x1,textBoxScale:m,prevAnchor:A1},this.markUsedJustification(Y,x1,q,e1),Y.allowVerticalPlacement&&(this.markUsedOrientation(Y,e1,q),this.placedOrientations[q.crossTileID]=e1),{shift:h1,placedGlyphBoxes:b1}}}placeLayerBucketPart(e,a,C){let{bucket:p,layout:m,translationText:v,translationIcon:w,unwrappedTileID:T,pitchedLabelPlaneMatrix:A,textPixelRatio:B,holdingForFade:V,collisionBoxArray:O,partiallyEvaluatedTextSize:q,collisionGroup:Y}=e.parameters,e1=m.get("text-optional"),i1=m.get("icon-optional"),o1=n.aK(m,"text-overlap","text-allow-overlap"),u1=o1==="always",g1=n.aK(m,"icon-overlap","icon-allow-overlap"),c1=g1==="always",x1=m.get("text-rotation-alignment")==="map",v1=m.get("text-pitch-alignment")==="map",h1=m.get("icon-text-fit")!=="none",b1=m.get("symbol-z-order")==="viewport-y",A1=u1&&(c1||!p.hasIconData()||i1),Z1=c1&&(u1||!p.hasTextData()||e1);!p.collisionArrays&&O&&p.deserializeCollisionBoxes(O);let E1=this.retainedQueryData[p.bucketInstanceId].tileID,B1=this._getTerrainElevationFunc(E1),Q1=this.transform.getFastPathSimpleProjectionMatrix(E1),i2=(X1,y2,M2)=>{var T5,H5;if(a[X1.crossTileID])return;if(V)return void(this.placements[X1.crossTileID]=new Q7(!1,!1,!1));let G5=!1,X5=!1,B5=!0,yt=null,k5={box:null,placeable:!1,offscreen:null,occluded:!1},Pt={placeable:!1},Ct=null,vt=null,Jt=null,g3=0,L8=0,z3=0;y2.textFeatureIndex?g3=y2.textFeatureIndex:X1.useRuntimeCollisionCircles&&(g3=X1.featureIndex),y2.verticalTextFeatureIndex&&(L8=y2.verticalTextFeatureIndex);let Z3=y2.textBox;if(Z3){let w6=K5=>{let $5=n.at.horizontal;if(p.allowVerticalPlacement&&!K5&&this.prevPlacement){let dt=this.prevPlacement.placedOrientations[X1.crossTileID];dt&&(this.placedOrientations[X1.crossTileID]=dt,$5=dt,this.markUsedOrientation(p,$5,X1))}return $5},u8=(K5,$5)=>{if(p.allowVerticalPlacement&&X1.numVerticalGlyphVertices>0&&y2.verticalTextBox){for(let dt of p.writingModes)if(dt===n.at.vertical?(k5=$5(),Pt=k5):k5=K5(),k5&&k5.placeable)break}else k5=K5()},E3=X1.textAnchorOffsetStartIndex,I3=X1.textAnchorOffsetEndIndex;if(I3===E3){let K5=($5,dt)=>{let J5=this.collisionIndex.placeCollisionBox($5,o1,B,E1,T,v1,x1,v,Y.predicate,B1,void 0,Q1);return J5&&J5.placeable&&(this.markUsedOrientation(p,dt,X1),this.placedOrientations[X1.crossTileID]=dt),J5};u8((()=>K5(Z3,n.at.horizontal)),(()=>{let $5=y2.verticalTextBox;return p.allowVerticalPlacement&&X1.numVerticalGlyphVertices>0&&$5?K5($5,n.at.vertical):{box:null,offscreen:null}})),w6(k5&&k5.placeable)}else{let K5=n.aJ[(H5=(T5=this.prevPlacement)===null||T5===void 0?void 0:T5.variableOffsets[X1.crossTileID])===null||H5===void 0?void 0:H5.anchor],$5=(J5,Sn,Tn)=>{let zn=J5.x2-J5.x1,F8=J5.y2-J5.y1,Ss=X1.textBoxScale,Zn=h1&&g1==="never"?Sn:null,P3=null,Y4=o1==="never"?1:2,h8="never";K5&&Y4++;for(let C8=0;C8<Y4;C8++){for(let i7=E3;i7<I3;i7++){let En=p.textAnchorOffsets.get(i7);if(K5&&En.textAnchor!==K5)continue;let Ze=this.attemptAnchorPlacement(En,J5,zn,F8,Ss,x1,v1,B,E1,T,Y,h8,X1,p,Tn,v,w,Zn,B1);if(Ze&&(P3=Ze.placedGlyphBoxes,P3&&P3.placeable))return G5=!0,yt=Ze.shift,P3}K5?K5=null:h8=o1}return C&&!P3&&(P3={box:this.collisionIndex.placeCollisionBox(Z3,"always",B,E1,T,v1,x1,v,Y.predicate,B1,void 0,Q1).box,offscreen:!1,placeable:!1,occluded:!1}),P3};u8((()=>$5(Z3,y2.iconBox,n.at.horizontal)),(()=>{let J5=y2.verticalTextBox;return p.allowVerticalPlacement&&(!k5||!k5.placeable)&&X1.numVerticalGlyphVertices>0&&J5?$5(J5,y2.verticalIconBox,n.at.vertical):{box:null,occluded:!0,offscreen:null}})),k5&&(G5=k5.placeable,B5=k5.offscreen);let dt=w6(k5&&k5.placeable);if(!G5&&this.prevPlacement){let J5=this.prevPlacement.variableOffsets[X1.crossTileID];J5&&(this.variableOffsets[X1.crossTileID]=J5,this.markUsedJustification(p,J5.anchor,X1,dt))}}}if(Ct=k5,G5=Ct&&Ct.placeable,B5=Ct&&Ct.offscreen,X1.useRuntimeCollisionCircles&&X1.centerJustifiedTextSymbolIndex>=0){let w6=p.text.placedSymbolArray.get(X1.centerJustifiedTextSymbolIndex),u8=n.au(p.textSizeData,q,w6),E3=m.get("text-padding");vt=this.collisionIndex.placeCollisionCircles(o1,w6,p.lineVertexArray,p.glyphOffsetArray,u8,T,A,C,v1,Y.predicate,X1.collisionCircleDiameter,E3,v,B1),vt.circles.length&&vt.collisionDetected&&!C&&n.w("Collisions detected, but collision boxes are not shown"),G5=u1||vt.circles.length>0&&!vt.collisionDetected,B5=B5&&vt.offscreen}if(y2.iconFeatureIndex&&(z3=y2.iconFeatureIndex),y2.iconBox){let w6=u8=>this.collisionIndex.placeCollisionBox(u8,g1,B,E1,T,v1,x1,w,Y.predicate,B1,h1&&yt?yt:void 0,Q1);Pt&&Pt.placeable&&y2.verticalIconBox?(Jt=w6(y2.verticalIconBox),X5=Jt.placeable):(Jt=w6(y2.iconBox),X5=Jt.placeable),B5=B5&&Jt.offscreen}let D6=e1||X1.numHorizontalGlyphVertices===0&&X1.numVerticalGlyphVertices===0,R8=i1||X1.numIconVertices===0;D6||R8?R8?D6||(X5=X5&&G5):G5=X5&&G5:X5=G5=X5&&G5;let D8=X5&&Jt.placeable;if(G5&&Ct.placeable&&this.collisionIndex.insertCollisionBox(Ct.box,o1,m.get("text-ignore-placement"),p.bucketInstanceId,Pt&&Pt.placeable&&L8?L8:g3,Y.ID),D8&&this.collisionIndex.insertCollisionBox(Jt.box,g1,m.get("icon-ignore-placement"),p.bucketInstanceId,z3,Y.ID),vt&&G5&&this.collisionIndex.insertCollisionCircles(vt.circles,o1,m.get("text-ignore-placement"),p.bucketInstanceId,g3,Y.ID),C&&this.storeCollisionData(p.bucketInstanceId,M2,y2,Ct,Jt,vt),X1.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(p.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[X1.crossTileID]=new Q7((G5||A1)&&!Ct?.occluded,(X5||Z1)&&!Jt?.occluded,B5||p.justReloaded),a[X1.crossTileID]=!0};if(b1){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let X1=p.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let y2=X1.length-1;y2>=0;--y2){let M2=X1[y2];i2(p.symbolInstances.get(M2),p.collisionArrays[M2],M2)}}else for(let X1=e.symbolInstanceStart;X1<e.symbolInstanceEnd;X1++)i2(p.symbolInstances.get(X1),p.collisionArrays[X1],X1);p.justReloaded=!1}storeCollisionData(e,a,C,p,m,v){if(C.textBox||C.iconBox){let w,T;this.collisionBoxArrays.has(e)?w=this.collisionBoxArrays.get(e):(w=new Map,this.collisionBoxArrays.set(e,w)),w.has(a)?T=w.get(a):(T={text:null,icon:null},w.set(a,T)),C.textBox&&(T.text=p.box),C.iconBox&&(T.icon=m.box)}if(v){let w=this.collisionCircleArrays[e];w===void 0&&(w=this.collisionCircleArrays[e]=[]);for(let T=0;T<v.circles.length;T+=4)w.push(v.circles[T+0]-rt),w.push(v.circles[T+1]-rt),w.push(v.circles[T+2]),w.push(v.collisionDetected?1:0)}}markUsedJustification(e,a,C,p){let m;m=p===n.at.vertical?C.verticalPlacedTextSymbolIndex:{left:C.leftJustifiedTextSymbolIndex,center:C.centerJustifiedTextSymbolIndex,right:C.rightJustifiedTextSymbolIndex}[n.aL(a)];let v=[C.leftJustifiedTextSymbolIndex,C.centerJustifiedTextSymbolIndex,C.rightJustifiedTextSymbolIndex,C.verticalPlacedTextSymbolIndex];for(let w of v)w>=0&&(e.text.placedSymbolArray.get(w).crossTileID=m>=0&&w!==m?0:C.crossTileID)}markUsedOrientation(e,a,C){let p=a===n.at.horizontal||a===n.at.horizontalOnly?a:0,m=a===n.at.vertical?a:0,v=[C.leftJustifiedTextSymbolIndex,C.centerJustifiedTextSymbolIndex,C.rightJustifiedTextSymbolIndex];for(let w of v)e.text.placedSymbolArray.get(w).placedOrientation=p;C.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(C.verticalPlacedTextSymbolIndex).placedOrientation=m)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let a=this.prevPlacement,C=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;let p=a?a.symbolFadeChange(e):1,m=a?a.opacities:{},v=a?a.variableOffsets:{},w=a?a.placedOrientations:{};for(let T in this.placements){let A=this.placements[T],B=m[T];B?(this.opacities[T]=new L9(B,p,A.text,A.icon),C=C||A.text!==B.text.placed||A.icon!==B.icon.placed):(this.opacities[T]=new L9(null,p,A.text,A.icon,A.skipFade),C=C||A.text||A.icon)}for(let T in m){let A=m[T];if(!this.opacities[T]){let B=new L9(A,p,!1,!1);B.isHidden()||(this.opacities[T]=B,C=C||A.text.placed||A.icon.placed)}}for(let T in v)this.variableOffsets[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.variableOffsets[T]=v[T]);for(let T in w)this.placedOrientations[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.placedOrientations[T]=w[T]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");C?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:e)}updateLayerOpacities(e,a){let C={};for(let p of a){let m=p.getBucket(e);m&&p.latestFeatureIndex&&e.id===m.layerIds[0]&&this.updateBucketOpacities(m,p.tileID,C,p.collisionBoxArray)}}updateBucketOpacities(e,a,C,p){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let m=e.layers[0],v=m.layout,w=new L9(null,0,!1,!1,!0),T=v.get("text-allow-overlap"),A=v.get("icon-allow-overlap"),B=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),V=v.get("text-rotation-alignment")==="map",O=v.get("text-pitch-alignment")==="map",q=v.get("icon-text-fit")!=="none",Y=new L9(null,0,T&&(A||!e.hasIconData()||v.get("icon-optional")),A&&(T||!e.hasTextData()||v.get("text-optional")),!0);!e.collisionArrays&&p&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(p);let e1=(o1,u1,g1)=>{for(let c1=0;c1<u1/4;c1++)o1.opacityVertexArray.emplaceBack(g1);o1.hasVisibleVertices=o1.hasVisibleVertices||g1!==b3},i1=this.collisionBoxArrays.get(e.bucketInstanceId);for(let o1=0;o1<e.symbolInstances.length;o1++){let u1=e.symbolInstances.get(o1),{numHorizontalGlyphVertices:g1,numVerticalGlyphVertices:c1,crossTileID:x1}=u1,v1=this.opacities[x1];C[x1]?v1=w:v1||(v1=Y,this.opacities[x1]=v1),C[x1]=!0;let h1=u1.numIconVertices>0,b1=this.placedOrientations[u1.crossTileID],A1=b1===n.at.vertical,Z1=b1===n.at.horizontal||b1===n.at.horizontalOnly;if(g1>0||c1>0){let B1=Er(v1.text);e1(e.text,g1,A1?b3:B1),e1(e.text,c1,Z1?b3:B1);let Q1=v1.text.isHidden();[u1.rightJustifiedTextSymbolIndex,u1.centerJustifiedTextSymbolIndex,u1.leftJustifiedTextSymbolIndex].forEach((y2=>{y2>=0&&(e.text.placedSymbolArray.get(y2).hidden=Q1||A1?1:0)})),u1.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(u1.verticalPlacedTextSymbolIndex).hidden=Q1||Z1?1:0);let i2=this.variableOffsets[u1.crossTileID];i2&&this.markUsedJustification(e,i2.anchor,u1,b1);let X1=this.placedOrientations[u1.crossTileID];X1&&(this.markUsedJustification(e,"left",u1,X1),this.markUsedOrientation(e,X1,u1))}if(h1){let B1=Er(v1.icon),Q1=!(q&&u1.verticalPlacedIconSymbolIndex&&A1);u1.placedIconSymbolIndex>=0&&(e1(e.icon,u1.numIconVertices,Q1?B1:b3),e.icon.placedSymbolArray.get(u1.placedIconSymbolIndex).hidden=v1.icon.isHidden()),u1.verticalPlacedIconSymbolIndex>=0&&(e1(e.icon,u1.numVerticalIconVertices,Q1?b3:B1),e.icon.placedSymbolArray.get(u1.verticalPlacedIconSymbolIndex).hidden=v1.icon.isHidden())}let E1=i1&&i1.has(o1)?i1.get(o1):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let B1=e.collisionArrays[o1];if(B1){let Q1=new n.P(0,0);if(B1.textBox||B1.verticalTextBox){let i2=!0;if(B){let X1=this.variableOffsets[x1];X1?(Q1=wr(X1.anchor,X1.width,X1.height,X1.textOffset,X1.textBoxScale),V&&Q1._rotate(O?-this.transform.bearingInRadians:this.transform.bearingInRadians)):i2=!1}if(B1.textBox||B1.verticalTextBox){let X1;B1.textBox&&(X1=A1),B1.verticalTextBox&&(X1=Z1),Sr(e.textCollisionBox.collisionVertexArray,v1.text.placed,!i2||X1,E1.text,Q1.x,Q1.y)}}if(B1.iconBox||B1.verticalIconBox){let i2=!!(!Z1&&B1.verticalIconBox),X1;B1.iconBox&&(X1=i2),B1.verticalIconBox&&(X1=!i2),Sr(e.iconCollisionBox.collisionVertexArray,v1.icon.placed,X1,E1.icon,q?Q1.x:0,q?Q1.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,a){let C=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*C>e}setStale(){this.stale=!0}}function Sr(g,e,a,C,p,m){C&&C.length!==0||(C=[0,0,0,0]);let v=C[0]-rt,w=C[1]-rt,T=C[2]-rt,A=C[3]-rt;g.emplaceBack(e?1:0,a?1:0,p||0,m||0,v,w),g.emplaceBack(e?1:0,a?1:0,p||0,m||0,T,w),g.emplaceBack(e?1:0,a?1:0,p||0,m||0,T,A),g.emplaceBack(e?1:0,a?1:0,p||0,m||0,v,A)}let Tr=Math.pow(2,25),zr=Math.pow(2,24),t4=Math.pow(2,17),e4=Math.pow(2,16),Zr=Math.pow(2,9),i4=Math.pow(2,8),r4=Math.pow(2,1);function Er(g){if(g.opacity===0&&!g.placed)return 0;if(g.opacity===1&&g.placed)return 4294967295;let e=g.placed?1:0,a=Math.floor(127*g.opacity);return a*Tr+e*zr+a*t4+e*e4+a*Zr+e*i4+a*r4+e}let b3=0;class f0{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,a,C,p,m){let v=this._bucketParts;for(;this._currentTileIndex<e.length;)if(a.getBucketParts(v,p,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,m())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,v.sort(((w,T)=>w.sortKey-T.sortKey)));this._currentPartIndex<v.length;)if(a.placeLayerBucketPart(v[this._currentPartIndex],this._seenCrossTileIDs,C),this._currentPartIndex++,m())return!0;return!1}}class Ir{constructor(e,a,C,p,m,v,w,T){this.placement=new rs(e,a,v,w,T),this._currentPlacementIndex=C.length-1,this._forceFullPlacement=p,this._showCollisionBoxes=m,this._done=!1}isDone(){return this._done}continuePlacement(e,a,C){let p=j(),m=()=>!this._forceFullPlacement&&j()-p>2;for(;this._currentPlacementIndex>=0;){let v=a[e[this._currentPlacementIndex]],w=this.placement.collisionIndex.transform.zoom;if(v.type==="symbol"&&(!v.minzoom||v.minzoom<=w)&&(!v.maxzoom||v.maxzoom>w)){if(this._inProgressLayer||(this._inProgressLayer=new f0(v)),this._inProgressLayer.continuePlacement(C[v.source],this.placement,this._showCollisionBoxes,v,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let h3=512/n.a3/2;class Pr{constructor(e,a,C){this.tileID=e,this.bucketInstanceId=C,this._symbolsByKey={};let p=new Map;for(let m=0;m<a.length;m++){let v=a.get(m),w=v.key,T=p.get(w);T?T.push(v):p.set(w,[v])}for(let[m,v]of p){let w={positions:v.map((T=>({x:Math.floor(T.anchorX*h3),y:Math.floor(T.anchorY*h3)}))),crossTileIDs:v.map((T=>T.crossTileID))};if(w.positions.length>128){let T=new n.aN(w.positions.length,16,Uint16Array);for(let{x:A,y:B}of w.positions)T.add(A,B);T.finish(),delete w.positions,w.index=T}this._symbolsByKey[m]=w}}getScaledCoordinates(e,a){let{x:C,y:p,z:m}=this.tileID.canonical,{x:v,y:w,z:T}=a.canonical,A=h3/Math.pow(2,T-m),B=(w*n.a3+e.anchorY)*A,V=p*n.a3*h3;return{x:Math.floor((v*n.a3+e.anchorX)*A-C*n.a3*h3),y:Math.floor(B-V)}}findMatches(e,a,C){let p=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let m=0;m<e.length;m++){let v=e.get(m);if(v.crossTileID)continue;let w=this._symbolsByKey[v.key];if(!w)continue;let T=this.getScaledCoordinates(v,a);if(w.index){let A=w.index.range(T.x-p,T.y-p,T.x+p,T.y+p).sort();for(let B of A){let V=w.crossTileIDs[B];if(!C[V]){C[V]=!0,v.crossTileID=V;break}}}else if(w.positions)for(let A=0;A<w.positions.length;A++){let B=w.positions[A],V=w.crossTileIDs[A];if(Math.abs(B.x-T.x)<=p&&Math.abs(B.y-T.y)<=p&&!C[V]){C[V]=!0,v.crossTileID=V;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class ns{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class r8{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let a=Math.round((e-this.lng)/360);if(a!==0)for(let C in this.indexes){let p=this.indexes[C],m={};for(let v in p){let w=p[v];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+a),m[w.tileID.key]=w}this.indexes[C]=m}this.lng=e}addBucket(e,a,C){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let m=0;m<a.symbolInstances.length;m++)a.symbolInstances.get(m).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});let p=this.usedCrossTileIDs[e.overscaledZ];for(let m in this.indexes){let v=this.indexes[m];if(Number(m)>e.overscaledZ)for(let w in v){let T=v[w];T.tileID.isChildOf(e)&&T.findMatches(a.symbolInstances,e,p)}else{let w=v[e.scaledTo(Number(m)).key];w&&w.findMatches(a.symbolInstances,e,p)}}for(let m=0;m<a.symbolInstances.length;m++){let v=a.symbolInstances.get(m);v.crossTileID||(v.crossTileID=C.generate(),p[v.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Pr(e,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(e,a){for(let C of a.getCrossTileIDsLists())for(let p of C)delete this.usedCrossTileIDs[e][p]}removeStaleBuckets(e){let a=!1;for(let C in this.indexes){let p=this.indexes[C];for(let m in p)e[p[m].bucketInstanceId]||(this.removeBucketCrossTileIDs(C,p[m]),delete p[m],a=!0)}return a}}class w8{constructor(){this.layerIndexes={},this.crossTileIDs=new ns,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,a,C){let p=this.layerIndexes[e.id];p===void 0&&(p=this.layerIndexes[e.id]=new r8);let m=!1,v={};p.handleWrapJump(C);for(let w of a){let T=w.getBucket(e);T&&e.id===T.layerIds[0]&&(T.bucketInstanceId||(T.bucketInstanceId=++this.maxBucketInstanceId),p.addBucket(w.tileID,T,this.crossTileIDs)&&(m=!0),v[T.bucketInstanceId]=!0)}return p.removeStaleBuckets(v)&&(m=!0),m}pruneUnusedLayers(e){let a={};e.forEach((C=>{a[C]=!0}));for(let C in this.layerIndexes)a[C]||delete this.layerIndexes[C]}}var s5="void main() {fragColor=vec4(1.0);}";let A6={prelude:g5(`#ifdef GL_ES
|
|
3
3
|
precision mediump float;
|
|
4
4
|
#else
|