vendor: 16,280 bytes, line 1
1import{g as A0,e as Mr}from"./DfFv2MDn.js";var Up={exports:{}};var P1=Up.exports,v_;function A1(){return v_||(v_=1,(function(u,o){(function(d,v){u.exports=v()})(P1,(function(){var d={},v={};function w(b,s,D){if(v[b]=D,b==="index"){var N="var sharedModule = {}; ("+v.shared+")(sharedModule); ("+v.worker+")(sharedModule);",Z={};return v.shared(Z),v.index(d,Z),typeof window<"u"&&d.setWorkerUrl(window.URL.createObjectURL(new Blob([N],{type:"text/javascript"}))),d}}w("shared",["exports"],(function(b){function s(i,e,r,a){return new(r||(r=Promise))((function(c,p){function f(S){try{x(a.next(S))}catch(P){p(P)}}function y(S){try{x(a.throw(S))}catch(P){p(P)}}function x(S){var P;S.done?c(S.value):(P=S.value,P instanceof r?P:new r((function(E){E(P)}))).then(f,y)}x((a=a.apply(i,e||[])).next())}))}function D(i,e){this.x=i,this.y=e}function N(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Z,re;typeof SuppressedError=="function"&&SuppressedError,D.prototype={clone(){return new D(this.x,this.y)},add(i){return this.clone()._add(i)},sub(i){return this.clone()._sub(i)},multByPoint(i){return this.clone()._multByPoint(i)},divByPoint(i){return this.clone()._divByPoint(i)},mult(i){return this.clone()._mult(i)},div(i){return this.clone()._div(i)},rotate(i){return this.clone()._rotate(i)},rotateAround(i,e){return this.clone()._rotateAround(i,e)},matMult(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist(i){return Math.sqrt(this.distSqr(i))},distSqr(i){const e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith(i){return this.angleWithSep(i.x,i.y)},angleWithSep(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult(i){const e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add(i){return this.x+=i.x,this.y+=i.y,this},_sub(i){return this.x-=i.x,this.y-=i.y,this},_mult(i){return this.x*=i,this.y*=i,this},_div(i){return this.x/=i,this.y/=i,this},_multByPoint(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint(i){return this.x/=i.x,this.y/=i.y,this},_unit(){return this._div(this.mag()),this},_perp(){const i=this.y;return this.y=this.x,this.x=-i,this},_rotate(i){const e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround(i,e){const r=Math.cos(i),a=Math.sin(i),c=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=c,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:D},D.convert=function(i){if(i instanceof D)return i;if(Array.isArray(i))return new D(+i[0],+i[1]);if(i.x!==void 0&&i.y!==void 0)return new D(+i.x,+i.y);throw new Error("Expected [x, y] or {x, y} point format")};var pe=(function(){if(re)return Z;function i(e,r,a,c){this.cx=3*e,this.bx=3*(a-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(c-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=a,this.p2y=c}return re=1,Z=i,i.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var a=e,c=0;c<8;c++){var p=this.sampleCurveX(a)-e;if(Math.abs(p)<r)return a;var f=this.sampleCurveDerivativeX(a);if(Math.abs(f)<1e-6)break;a-=p/f}var y=0,x=1;for(a=e,c=0;c<20&&(p=this.sampleCurveX(a),!(Math.abs(p-e)<r));c++)e>p?y=a:x=a,a=.5*(x-y)+y;return a},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},Z})(),ue=N(pe);let ve,me;function le(){return ve==null&&(ve=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ve}function He(){if(me==null&&(me=!1,le())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<25;a++){const c=4*a;e.fillStyle=`rgb(${c},${c+1},${c+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<100;a++)if(a%4!=3&&r[a]!==a){me=!0;break}}}return me||!1}var Ne=1e-6,$e=typeof Float32Array<"u"?Float32Array:Array;function ke(){var i=new $e(9);return $e!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function Me(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Re(){var i=new $e(3);return $e!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function rt(i){var e=i[0],r=i[1],a=i[2];return Math.sqrt(e*e+r*r+a*a)}function ut(i,e,r){var a=new $e(3);return a[0]=i,a[1]=e,a[2]=r,a}function It(i,e,r){return i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2],i}function dt(i,e,r){return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i}function Cr(i,e,r){var a=e[0],c=e[1],p=e[2],f=r[0],y=r[1],x=r[2];return i[0]=c*x-p*y,i[1]=p*f-a*x,i[2]=a*y-c*f,i}var Ur,ci=rt;function Tn(i,e,r){var a=e[0],c=e[1],p=e[2],f=e[3];return i[0]=r[0]*a+r[4]*c+r[8]*p+r[12]*f,i[1]=r[1]*a+r[5]*c+r[9]*p+r[13]*f,i[2]=r[2]*a+r[6]*c+r[10]*p+r[14]*f,i[3]=r[3]*a+r[7]*c+r[11]*p+r[15]*f,i}function Sn(){var i=new $e(4);return $e!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function $a(i,e,r,a){var c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",p=Math.PI/360;e*=p,a*=p,r*=p;var f=Math.sin(e),y=Math.cos(e),x=Math.sin(r),S=Math.cos(r),P=Math.sin(a),E=Math.cos(a);switch(c){case"xyz":i[0]=f*S*E+y*x*P,i[1]=y*x*E-f*S*P,i[2]=y*S*P+f*x*E,i[3]=y*S*E-f*x*P;break;case"xzy":i[0]=f*S*E-y*x*P,i[1]=y*x*E-f*S*P,i[2]=y*S*P+f*x*E,i[3]=y*S*E+f*x*P;break;case"yxz":i[0]=f*S*E+y*x*P,i[1]=y*x*E-f*S*P,i[2]=y*S*P-f*x*E,i[3]=y*S*E+f*x*P;break;case"yzx":i[0]=f*S*E+y*x*P,i[1]=y*x*E+f*S*P,i[2]=y*S*P-f*x*E,i[3]=y*S*E-f*x*P;break;case"zxy":i[0]=f*S*E-y*x*P,i[1]=y*x*E+f*S*P,i[2]=y*S*P+f*x*E,i[3]=y*S*E-f*x*P;break;case"zyx":i[0]=f*S*E-y*x*P,i[1]=y*x*E+f*S*P,i[2]=y*S*P-f*x*E,i[3]=y*S*E+f*x*P;break;default:throw new Error("Unknown angle order "+c)}return i}function ui(){var i=new $e(2);return $e!=Float32Array&&(i[0]=0,i[1]=0),i}function Mn(i,e){var r=new $e(2);return r[0]=i,r[1]=e,r}Re(),Ur=new $e(4),$e!=Float32Array&&(Ur[0]=0,Ur[1]=0,Ur[2]=0,Ur[3]=0),Re(),ut(1,0,0),ut(0,1,0),Sn(),Sn(),ke(),ui();const Ot=8192;function Ga(i,e,r){return e*(Ot/(i.tileSize*Math.pow(2,r-i.tileID.overscaledZ)))}function In(i,e){return(i%e+e)%e}function qa(i,e,r){return i*(1-r)+e*r}function Fo(i){if(i<=0)return 0;if(i>=1)return 1;const e=i*i,r=e*i;return 4*(i<.5?r:3*(i-e)+r-.75)}function pa(i,e,r,a){const c=new ue(i,e,r,a);return p=>c.solve(p)}const ri=pa(.25,.1,.25,1);function qi(i,e,r){return Math.min(r,Math.max(e,i))}function Pn(i,e,r){const a=r-e,c=((i-e)%a+a)%a+e;return c===e?r:c}function hi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let da=1;function Zi(i,e,r){const a={};for(const c in i)a[c]=e.call(this,i[c],c,i);return a}function Bo(i,e,r){const a={};for(const c in i)e.call(this,i[c],c,i)&&(a[c]=i[c]);return a}function Wi(i){return Array.isArray(i)?i.map(Wi):typeof i=="object"&&i?Zi(i,Wi):i}const Oo={};function $r(i){Oo[i]||(typeof console<"u"&&console.warn(i),Oo[i]=!0)}function Fi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function mn(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let dr=null;function Gn(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Za(i,e,r,a,c){return s(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(i,{timestamp:0});try{const f=p?.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);const y=f.startsWith("BGR"),x=new Uint8ClampedArray(a*c*4);if(yield p.copyTo(x,(function(S,P,E,k,z){const F=4*Math.max(-P,0),B=(Math.max(0,E)-E)*k*4+F,j=4*k,G=Math.max(0,P),Q=Math.max(0,E);return{rect:{x:G,y:Q,width:Math.min(S.width,P+k)-G,height:Math.min(S.height,E+z)-Q},layout:[{offset:B,stride:j}]}})(i,e,r,a,c)),y)for(let S=0;S<x.length;S+=4){const P=x[S];x[S]=x[S+2],x[S+2]=P}return x}finally{p.close()}}))}let qn,Hi;function Wa(i,e,r,a){return i.addEventListener(e,r,a),{unsubscribe:()=>{i.removeEventListener(e,r,a)}}}function Ha(i){return i*Math.PI/180}function wi(i){return i/Math.PI*180}const ye={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},U={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},V="AbortError";class W extends Error{constructor(e=V){super(e instanceof Error?e.message:e),this.name=V,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function se(i){return i.name===V}const he={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function xe(i){return he.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const ge="global-dispatcher";class de extends Error{constructor(e,r,a,c){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=c}}const Pe=()=>mn(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Oe=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const a=xe(i.url);if(a)return a(i,e);if(mn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:ge},e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Pe())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(a,c){return s(this,void 0,void 0,(function*(){const p=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:Pe(),signal:c.signal});let f,y;a.type!=="json"||p.headers.has("Accept")||p.headers.set("Accept","application/json");try{f=yield fetch(p)}catch(S){throw se(S)?S:new de(0,S.message,a.url,new Blob)}if(!f.ok){const S=yield f.blob();throw new de(f.status,f.statusText,a.url,S)}y=a.type==="arrayBuffer"||a.type==="image"?f.arrayBuffer():a.type==="json"?f.json():f.text();const x=yield y;return c.signal.throwIfAborted(),{data:x,cacheControl:f.headers.get("Cache-Control"),expires:f.headers.get("Expires")}}))})(i,e);if(mn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:ge},e)}var r;return(function(a,c){return new Promise(((p,f)=>{var y;const x=new XMLHttpRequest;x.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(x.responseType="arraybuffer");for(const S in a.headers)x.setRequestHeader(S,a.headers[S]);a.type==="json"&&(x.responseType="text",!((y=a.headers)===null||y===void 0)&&y.Accept||x.setRequestHeader("Accept","application/json")),x.withCredentials=a.credentials==="include",x.onerror=()=>{f(new Error(x.statusText))},x.onload=()=>{if(!c.signal.aborted)if((x.status>=200&&x.status<300||x.status===0)&&x.response!==null){let S=x.response;if(a.type==="json")try{S=JSON.parse(x.response)}catch(P){return void f(P)}p({data:S,cacheControl:x.getResponseHeader("Cache-Control"),expires:x.getResponseHeader("Expires")})}else{const S=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});f(new de(x.status,x.statusText,a.url,S))}},c.signal.addEventListener("abort",(()=>{x.abort(),f(new W(c.signal.reason))})),x.send(a.body)}))})(i,e)};function ze(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Je(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function nt(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class ft{constructor(e,r={}){hi(this,r),this.type=e}}class Ut extends ft{constructor(e,r={}){super("error",hi({error:e},r))}}class Lt{on(e,r){return this._listeners=this._listeners||{},Je(e,r,this._listeners),{unsubscribe:()=>{this.off(e,r)}}}off(e,r){return nt(e,r,this._listeners),nt(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Je(e,r,this._oneTimeListeners),this):new Promise((a=>this.once(e,a)))}fire(e,r){typeof e=="string"&&(e=new ft(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const c=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const y of c)y.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const y of p)nt(a,y,this._oneTimeListeners),y.call(this,e);const f=this._eventedParent;f&&(hi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(e))}else e instanceof Ut&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var we={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0}
vendor: 3,280 bytes, line 1
1,clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-
vendor: 8,538 bytes, line 1
1constant"}},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",
vendor: 6,583 bytes, line 1
1expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-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
vendor: 8,689 bytes, line 1
1"},"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"},
vendor: 3,683 bytes, line 1
1"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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const qt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Jr(i,e){const r={};
vendor: 91,953 bytes, lines 1-2
1for(const a in i)a!=="ref"&&(r[a]=i[a]);return qt.forEach((a=>{a in e&&(r[a]=e[a])})),r}function mt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!mt(i[r],e[r]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!mt(i[r],e[r]))return!1;return!0}return i===e}function jt(i,e){i.push(e)}function Qr(i,e,r){jt(r,{command:"addSource",args:[i,e[i]]})}function rr(i,e,r){jt(e,{command:"removeSource",args:[i]}),r[i]=!0}function fr(i,e,r,a){rr(i,r,a),Qr(i,e,r)}function Zt(i,e,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&a!=="data"&&!mt(i[r][a],e[r][a]))return!1;for(a in e[r])if(Object.prototype.hasOwnProperty.call(e[r],a)&&a!=="data"&&!mt(i[r][a],e[r][a]))return!1;return!0}function Lr(i,e,r,a,c,p){i=i||{},e=e||{};for(const f in i)Object.prototype.hasOwnProperty.call(i,f)&&(mt(i[f],e[f])||r.push({command:p,args:[a,f,e[f],c]}));for(const f in e)Object.prototype.hasOwnProperty.call(e,f)&&!Object.prototype.hasOwnProperty.call(i,f)&&(mt(i[f],e[f])||r.push({command:p,args:[a,f,e[f],c]}))}function No(i){return i.id}function jo(i,e){return i[e.id]=e,i}class je{constructor(e,r,a,c){this.message=(e?`${e}: `:"")+a,c&&(this.identifier=c),r!=null&&r.__line__&&(this.line=r.__line__)}}function pi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}class di extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Ys{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[a,c]of r)this.bindings[a]=c}concat(e){return new Ys(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Bi={kind:"null"},Xe={kind:"number"},xt={kind:"string"},bt={kind:"boolean"},Ai={kind:"color"},Ks={kind:"projectionDefinition"},An={kind:"object"},yt={kind:"value"},Vo={kind:"collator"},Uo={kind:"formatted"},Js={kind:"padding"},Xa={kind:"colorArray"},$o={kind:"numberArray"},Ya={kind:"resolvedImage"},Go={kind:"variableAnchorOffsetCollection"};function fi(i,e){return{kind:"array",itemType:i,N:e}}function Vt(i){if(i.kind==="array"){const e=Vt(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const Qs=[Bi,Xe,xt,bt,Ai,Ks,Uo,An,fi(yt),Js,$o,Xa,Ya,Go];function Ka(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ka(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of Qs)if(!Ka(r,e))return null}}return`Expected ${Vt(i)} but found ${Vt(e)} instead.`}function qo(i,e){return e.some((r=>r.kind===i.kind))}function ma(i,e){return e.some((r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i))}function Xi(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const ih=.96422,ga=.82521,el=4/29,mr=6/29,nh=3*mr*mr,ah=mr*mr*mr,Zo=Math.PI/180,oh=180/Math.PI;function sh(i){return(i%=360)<0&&(i+=360),i}function lh([i,e,r,a]){let c,p;const f=gc((.2225045*(i=tl(i))+.7168786*(e=tl(e))+.0606169*(r=tl(r)))/1);i===e&&e===r?c=p=f:(c=gc((.4360747*i+.3850649*e+.1430804*r)/ih),p=gc((.0139322*i+.0971045*e+.7141733*r)/ga));const y=116*f-16;return[y<0?0:y,500*(c-f),200*(f-p),a]}function tl(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function gc(i){return i>ah?Math.pow(i,1/3):i/nh+el}function yc([i,e,r,a]){let c=(i+16)/116,p=isNaN(e)?c:c+e/500,f=isNaN(r)?c:c-r/200;return c=1*vc(c),p=ih*vc(p),f=ga*vc(f),[_c(3.1338561*p-1.6168667*c-.4906146*f),_c(-.9787684*p+1.9161415*c+.033454*f),_c(.0719453*p-.2289914*c+1.4052427*f),a]}function _c(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function vc(i){return i>mr?i*i*i:nh*(i-el)}const Sd=Object.hasOwn||function(i,e){return Object.prototype.hasOwnProperty.call(i,e)};function Wo(i,e){return Sd(i,e)?i[e]:void 0}function rl(i){return parseInt(i.padEnd(2,i),16)/255}function ch(i,e){return Ja(e?i/100:i,0,1)}function Ja(i,e,r){return Math.min(Math.max(e,i),r)}function xc(i){return!i.some(Number.isNaN)}const Ho={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 Zn(i,e,r){return i+r*(e-i)}function Qa(i,e,r){return i.map(((a,c)=>Zn(a,e[c],r)))}class wt{constructor(e,r,a,c=1,p=!0){this.r=e,this.g=r,this.b=a,this.a=c,p||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[e,r,a,c]))}static parse(e){if(e instanceof wt)return e;if(typeof e!="string")return;const r=(function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const c=Wo(Ho,a);if(c){const[f,y,x]=c;return[f/255,y/255,x/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const f=a.length<6?1:2;let y=1;return[rl(a.slice(y,y+=f)),rl(a.slice(y,y+=f)),rl(a.slice(y,y+=f)),rl(a.slice(y,y+f)||"ff")]}if(a.startsWith("rgb")){const f=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[y,x,S,P,E,k,z,F,B,j,G,Q]=f,q=[P||" ",z||" ",j].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const H=[S,k,B].join(""),te=H==="%%%"?100:H===""?255:0;if(te){const ae=[Ja(+x/te,0,1),Ja(+E/te,0,1),Ja(+F/te,0,1),G?ch(+G,Q):1];if(xc(ae))return ae}}return}}const p=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,y,x,S,P,E,k,z,F]=p,B=[x||" ",P||" ",k].join("");if(B===" "||B===" /"||B===",,"||B===",,,"){const j=[+y,Ja(+S,0,100),Ja(+E,0,100),z?ch(+z,F):1];if(xc(j))return(function([G,Q,q,H]){function te(ae){const _e=(ae+G/30)%12,De=Q*Math.min(q,1-q);return q-De*Math.max(-1,Math.min(_e-3,9-_e,1))}return G=sh(G),Q/=100,q/=100,[te(0),te(8),te(4),H]})(j)}}})(e);return r?new wt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:c}=this,p=c||1/0;return this.overwriteGetter("rgb",[e/p,r/p,a/p,c])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[r,a,c,p]=lh(e),f=Math.sqrt(a*a+c*c);return[Math.round(1e4*f)?sh(Math.atan2(c,a)*oh):NaN,f,r,p]})(this.rgb))}get lab(){return this.overwriteGetter("lab",lh(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,c]=this.rgb;return`rgba(${[e,r,a].map((p=>Math.round(255*p))).join(",")},${c})`}static interpolate(e,r,a,c="rgb"){switch(c){case"rgb":{const[p,f,y,x]=Qa(e.rgb,r.rgb,a);return new wt(p,f,y,x,!1)}case"hcl":{const[p,f,y,x]=e.hcl,[S,P,E,k]=r.hcl;let z,F;if(isNaN(p)||isNaN(S))isNaN(p)?isNaN(S)?z=NaN:(z=S,y!==1&&y!==0||(F=P)):(z=p,E!==1&&E!==0||(F=f));else{let q=S-p;S>p&&q>180?q-=360:S<p&&p-S>180&&(q+=360),z=p+a*q}const[B,j,G,Q]=(function([q,H,te,ae]){return q=isNaN(q)?0:q*Zo,yc([te,Math.cos(q)*H,Math.sin(q)*H,ae])})([z,F??Zn(f,P,a),Zn(y,E,a),Zn(x,k,a)]);return new wt(B,j,G,Q,!1)}case"lab":{const[p,f,y,x]=yc(Qa(e.lab,r.lab,a));return new wt(p,f,y,x,!1)}}}}wt.black=new wt(0,0,0,1),wt.white=new wt(1,1,1,1),wt.transparent=new wt(0,0,0,0),wt.red=new wt(1,0,0,1);class bc{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Md=["bottom","center","top"];class wc{constructor(e,r,a,c,p,f){this.text=e,this.image=r,this.scale=a,this.fontStack=c,this.textColor=p,this.verticalAlign=f}}class Ti{constructor(e){this.sections=e}static fromString(e){return new Ti([new wc(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof Ti?e:Ti.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class ii{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ii)return e;if(typeof e=="number")return new ii([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new ii(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,a){return new ii(Qa(e.values,r.values,a))}}class ur{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ur)return e;if(typeof e=="number")return new ur([e]);if(Array.isArray(e)){for(const r of e)if(typeof r!="number")return;return new ur(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,a){return new ur(Qa(e.values,r.values,a))}}class ht{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ht)return e;if(typeof e=="string"){const a=wt.parse(e);return a?new ht([a]):void 0}if(!Array.isArray(e))return;const r=[];for(const a of e){if(typeof a!="string")return;const c=wt.parse(a);if(!c)return;r.push(c)}return new ht(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,a,c="rgb"){const p=[];if(e.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let f=0;f<e.values.length;f++)p.push(wt.interpolate(e.values[f],r.values[f],a,c));return new ht(p)}}class Wt extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Wn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class mi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof mi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r<e.length;r+=2){const a=e[r],c=e[r+1];if(typeof a!="string"||!Wn.has(a)||!Array.isArray(c)||c.length!==2||typeof c[0]!="number"||typeof c[1]!="number")return}return new mi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,a){const c=e.values,p=r.values;if(c.length!==p.length)throw new Wt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`);const f=[];for(let y=0;y<c.length;y+=2){if(c[y]!==p[y])throw new Wt(`Cannot interpolate values containing mismatched anchors. from[${y}]: ${c[y]}, to[${y}]: ${p[y]}`);f.push(c[y]);const[x,S]=c[y+1],[P,E]=p[y+1];f.push([Zn(x,P,a),Zn(S,E,a)])}return new mi(f)}}class Ei{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ei({name:e,available:!1}):null}}class gi{constructor(e,r,a){this.from=e,this.to=r,this.transition=a}static interpolate(e,r,a){return new gi(e,r,a)}static parse(e){return e instanceof gi?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new gi(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new gi(e.from,e.to,e.transition):typeof e=="string"?new gi(e,e,1):void 0}}function eo(i,e,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hn(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof gi||i instanceof wt||i instanceof bc||i instanceof Ti||i instanceof ii||i instanceof ur||i instanceof ht||i instanceof mi||i instanceof Ei)return!0;if(Array.isArray(i)){for(const e of i)if(!Hn(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!Hn(i[e]))return!1;return!0}return!1}function xr(i){if(i===null)return Bi;if(typeof i=="string")return xt;if(typeof i=="boolean")return bt;if(typeof i=="number")return Xe;if(i instanceof wt)return Ai;if(i instanceof gi)return Ks;if(i instanceof bc)return Vo;if(i instanceof Ti)return Uo;if(i instanceof ii)return Js;if(i instanceof ur)return $o;if(i instanceof ht)return Xa;if(i instanceof mi)return Go;if(i instanceof Ei)return Ya;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const c=xr(a);if(r){if(r===c)continue;r=yt;break}r=c}return fi(r||yt,e)}return An}function ya(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof wt||i instanceof gi||i instanceof Ti||i instanceof ii||i instanceof ur||i instanceof ht||i instanceof mi||i instanceof Ei?i.toString():JSON.stringify(i)}class gn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Hn(e[1]))return r.error("invalid value");const a=e[1];let c=xr(a);const p=r.expectedType;return c.kind!=="array"||c.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(c=p),new gn(c,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const il={string:xt,number:Xe,boolean:bt,object:An};class Si{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,c=1;const p=e[0];if(p==="array"){let y,x;if(e.length>2){const S=e[1];if(typeof S!="string"||!(S in il)||S==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);y=il[S],c++}else y=yt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);x=e[2],c++}a=fi(y,x)}else{if(!il[p])throw new Error(`Types doesn't contain name = ${p}`);a=il[p]}const f=[];for(;c<e.length;c++){const y=r.parse(e[c],c,yt);if(!y)return null;f.push(y)}return new Si(a,f)}evaluate(e){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(e);if(!Ka(this.type,xr(a)))return a;if(r===this.args.length-1)throw new Wt(`Expected value to be of type ${Vt(this.type)}, but found ${Vt(xr(a))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const _a={"to-boolean":bt,"to-color":Ai,"to-number":Xe,"to-string":xt};class En{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!_a[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const c=_a[a],p=[];for(let f=1;f<e.length;f++){const y=r.parse(e[f],f,yt);if(!y)return null;p.push(y)}return new En(c,p)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,a;for(const c of this.args){if(r=c.evaluate(e),a=null,r instanceof wt)return r;if(typeof r=="string"){const p=e.parseColor(r);if(p)return p}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:eo(r[0],r[1],r[2],r[3]),!a))return new wt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Wt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const c=ii.parse(r);if(c)return c}throw new Wt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(const a of this.args){r=a.evaluate(e);const c=ur.parse(r);if(c)return c}throw new Wt(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(const a of this.args){r=a.evaluate(e);const c=ht.parse(r);if(c)return c}throw new Wt(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const c=mi.parse(r);if(c)return c}throw new Wt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const c=Number(r);if(!isNaN(c))return c}throw new Wt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ti.fromString(ya(this.args[0].evaluate(e)));case"resolvedImage":return Ei.fromString(ya(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ya(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const uh=["Unknown","Point","LineString","Polygon"];class Tc{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"?uh[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache.get(e);return r||(r=wt.parse(e),this._parseColorCache.set(e,r)),r}}class va{constructor(e,r,a=[],c,p=new Ys,f=[]){this.registry=e,this.path=a,this.key=a.map((y=>`[${y}]`)).join(""),this.scope=p,this.errors=f,this.expectedType=c,this._isConstant=r}parse(e,r,a,c,p={}){return r?this.concat(r,a,c)._parse(e,p):this._parse(e,p)}_parse(e,r){function a(c,p,f){return f==="assert"?new Si(p,[c]):f==="coerce"?new En(p,[c]):c}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=e[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[c];if(p){let f=p.parse(e,this);if(!f)return null;if(this.expectedType){const y=this.expectedType,x=f.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||x.kind!=="value"){if(y.kind==="projectionDefinition"&&["string","array"].includes(x.kind)||["color","formatted","resolvedImage"].includes(y.kind)&&["value","string"].includes(x.kind)||["padding","numberArray"].includes(y.kind)&&["value","number","array"].includes(x.kind)||y.kind==="colorArray"&&["value","string","array"].includes(x.kind)||y.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(x.kind))f=a(f,y,r.typeAnnotation||"coerce");else if(this.checkSubtype(y,x))return null}else f=a(f,y,r.typeAnnotation||"assert")}if(!(f instanceof gn)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){const y=new Tc;try{f=new gn(f.type,f.evaluate(y))}catch(x){return this.error(x.message),null}}return f}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,a){const c=typeof e=="number"?this.path.concat(e):this.path,p=a?this.scope.concat(a):this.scope;return new va(this.registry,this._isConstant,c,r||null,p,this.errors)}error(e,...r){const a=`${this.key}${r.map((c=>`[${c}]`)).join("")}`;this.errors.push(new di(a,e))}checkSubtype(e,r){const a=Ka(e,r);return a&&this.error(a),a}}class Ht{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let p=1;p<e.length-1;p+=2){const f=e[p];if(typeof f!="string")return r.error(`Expected string, but found ${typeof f} instead.`,p);if(/[^a-zA-Z0-9_]/.test(f))return r.error("Variable names must contain only alphanumeric characters or '_'.",p);const y=r.parse(e[p+1],p+1);if(!y)return null;a.push([f,y])}const c=r.parse(e[e.length-1],e.length-1,r.expectedType,a);return c?new Ht(a,c):null}outputDefined(){return this.result.outputDefined()}}class to{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new to(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Ct{constructor(e,r,a){this.type=e,this.index=r,this.input=a}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Xe),c=r.parse(e[2],2,fi(r.expectedType||yt));return a&&c?new Ct(c.type.itemType,a,c):null}evaluate(e){const r=this.index.evaluate(e),a=this.input.evaluate(e);if(r<0)throw new Wt(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new Wt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Wt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class _t{constructor(e,r){this.type=bt,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,yt),c=r.parse(e[2],2,yt);return a&&c?qo(a.type,[bt,xt,Xe,Bi,yt])?new _t(a,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Vt(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!ma(r,["boolean","string","number","null"]))throw new Wt(`Expected first argument to be of type boolean, string, number or null, but found ${Vt(xr(r))} instead.`);if(!ma(a,["string","array"]))throw new Wt(`Expected second argument to be of type array or string, but found ${Vt(xr(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class ro{constructor(e,r,a){this.type=Xe,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,yt),c=r.parse(e[2],2,yt);if(!a||!c)return null;if(!qo(a.type,[bt,xt,Xe,Bi,yt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Vt(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Xe);return p?new ro(a,c,p):null}return new ro(a,c)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!ma(r,["boolean","string","number","null"]))throw new Wt(`Expected first argument to be of type boolean, string, number or null, but found ${Vt(xr(r))} instead.`);let c;if(this.fromIndex&&(c=this.fromIndex.evaluate(e)),ma(a,["string"])){const p=a.indexOf(r,c);return p===-1?-1:[...a.slice(0,p)].length}if(ma(a,["array"]))return a.indexOf(r,c);throw new Wt(`Expected second argument to be of type array or string, but found ${Vt(xr(a))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Dt{constructor(e,r,a,c,p,f){this.inputType=e,this.type=r,this.input=a,this.cases=c,this.outputs=p,this.otherwise=f}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,c;r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);const p={},f=[];for(let S=2;S<e.length-1;S+=2){let P=e[S];const E=e[S+1];Array.isArray(P)||(P=[P]);const k=r.concat(S);if(P.length===0)return k.error("Expected at least one branch label.");for(const F of P){if(typeof F!="number"&&typeof F!="string")return k.error("Branch labels must be numbers or strings.");if(typeof F=="number"&&Math.abs(F)>Number.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof F=="number"&&Math.floor(F)!==F)return k.error("Numeric branch labels must be integer values.");if(a){if(k.checkSubtype(a,xr(F)))return null}else a=xr(F);if(p[String(F)]!==void 0)return k.error("Branch labels must be unique.");p[String(F)]=f.length}const z=r.parse(E,S,c);if(!z)return null;c=c||z.type,f.push(z)}const y=r.parse(e[1],1,yt);if(!y)return null;const x=r.parse(e[e.length-1],e.length-1,c);return x?y.type.kind!=="value"&&r.concat(1).checkSubtype(a,y.type)?null:new Dt(a,c,y,p,f,x):null}evaluate(e){const r=this.input.evaluate(e);return(xr(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class Xo{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const c=[];for(let f=1;f<e.length-1;f+=2){const y=r.parse(e[f],f,bt);if(!y)return null;const x=r.parse(e[f+1],f+1,a);if(!x)return null;c.push([y,x]),a=a||x.type}const p=r.parse(e[e.length-1],e.length-1,a);if(!p)return null;if(!a)throw new Error("Can't infer output type");return new Xo(a,c,p)}evaluate(e){for(const[r,a]of this.branches)if(r.evaluate(e))return a.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,a]of this.branches)e(r),e(a);e(this.otherwise)}outputDefined(){return this.branches.every((([e,r])=>r.outputDefined()))&&this.otherwise.outputDefined()}}class Oi{constructor(e,r,a,c){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=c}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,yt),c=r.parse(e[2],2,Xe);if(!a||!c)return null;if(!qo(a.type,[fi(yt),xt,yt]))return r.error(`Expected first argument to be of type array or string, but found ${Vt(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Xe);return p?new Oi(a.type,a,c,p):null}return new Oi(a.type,a,c)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);let c;if(this.endIndex&&(c=this.endIndex.evaluate(e)),ma(r,["string"]))return[...r].slice(a,c).join("");if(ma(r,["array"]))return r.slice(a,c);throw new Wt(`Expected first argument to be of type array or string, but found ${Vt(xr(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function io(i,e){const r=i.length-1;let a,c,p=0,f=r,y=0;for(;p<=f;)if(y=Math.floor((p+f)/2),a=i[y],c=i[y+1],a<=e){if(y===r||e<c)return y;p=y+1}else{if(!(a>e))throw new Wt("Input is not a number.");f=y-1}return 0}class Xn{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[c,p]of a)this.labels.push(c),this.outputs.push(p)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,Xe);if(!a)return null;const c=[];let p=null;r.expectedType&&r.expectedType.kind!=="value"&&(p=r.expectedType);for(let f=1;f<e.length;f+=2){const y=f===1?-1/0:e[f],x=e[f+1],S=f,P=f+1;if(typeof y!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',S);if(c.length&&c[c.length-1][0]>=y)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',S);const E=r.parse(x,P,p);if(!E)return null;p=p||E.type,c.push([y,E])}return new Xn(p,a,c)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return a[0].evaluate(e);const p=r.length;return c>=r[p-1]?a[p-1].evaluate(e):a[io(r,c)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function hh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yo,Sc,Id=(function(){if(Sc)return Yo;function i(e,r,a,c){this.cx=3*e,this.bx=3*(a-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(c-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=a,this.p2y=c}return Sc=1,Yo=i,i.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var a=e,c=0;c<8;c++){var p=this.sampleCurveX(a)-e;if(Math.abs(p)<r)return a;var f=this.sampleCurveDerivativeX(a);if(Math.abs(f)<1e-6)break;a-=p/f}var y=0,x=1;for(a=e,c=0;c<20&&(p=this.sampleCurveX(a),!(Math.abs(p-e)<r));c++)e>p?y=a:x=a,a=.5*(x-y)+y;return a},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},Yo})(),ph=hh(Id);class yi{constructor(e,r,a,c,p){this.type=e,this.operator=r,this.interpolation=a,this.input=c,this.labels=[],this.outputs=[];for(const[f,y]of p)this.labels.push(f),this.outputs.push(y)}static interpolationFactor(e,r,a,c){let p=0;if(e.name==="exponential")p=yn(r,e.base,a,c);else if(e.name==="linear")p=yn(r,1,a,c);else if(e.name==="cubic-bezier"){const f=e.controlPoints;p=new ph(f[0],f[1],f[2],f[3]).solve(yn(r,1,a,c))}return p}static parse(e,r){let[a,c,p,...f]=e;if(!Array.isArray(c)||c.length===0)return r.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const S=c[1];if(typeof S!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:S}}else{if(c[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const S=c.slice(1);if(S.length!==4||S.some((P=>typeof P!="number"||P<0||P>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:S}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(p=r.parse(p,2,Xe),!p)return null;const y=[];let x=null;a!=="interpolate-hcl"&&a!=="interpolate-lab"||r.expectedType==Xa?r.expectedType&&r.expectedType.kind!=="value"&&(x=r.expectedType):x=Ai;for(let S=0;S<f.length;S+=2){const P=f[S],E=f[S+1],k=S+3,z=S+4;if(typeof P!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(y.length&&y[y.length-1][0]>=P)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);const F=r.parse(E,z,x);if(!F)return null;x=x||F.type,y.push([P,F])}return Xi(x,Xe)||Xi(x,Ks)||Xi(x,Ai)||Xi(x,Js)||Xi(x,$o)||Xi(x,Xa)||Xi(x,Go)||Xi(x,fi(Xe))?new yi(x,a,c,p,y):r.error(`Type ${Vt(x)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const c=this.input.evaluate(e);if(c<=r[0])return a[0].evaluate(e);const p=r.length;if(c>=r[p-1])return a[p-1].evaluate(e);const f=io(r,c),y=yi.interpolationFactor(this.interpolation,c,r[f],r[f+1]),x=a[f].evaluate(e),S=a[f+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Zn(x,S,y);case"color":return wt.interpolate(x,S,y);case"padding":return ii.interpolate(x,S,y);case"colorArray":return ht.interpolate(x,S,y);case"numberArray":return ur.interpolate(x,S,y);case"variableAnchorOffsetCollection":return mi.interpolate(x,S,y);case"array":return Qa(x,S,y);case"projectionDefinition":return gi.interpolate(x,S,y)}case"interpolate-hcl":switch(this.type.kind){case"color":return wt.interpolate(x,S,y,"hcl");case"colorArray":return ht.interpolate(x,S,y,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return wt.interpolate(x,S,y,"lab");case"colorArray":return ht.interpolate(x,S,y,"lab")}}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function yn(i,e,r,a){const c=a-r,p=i-r;return c===0?0:e===1?p/c:(Math.pow(e,p)-1)/(Math.pow(e,c)-1)}const ar={color:wt.interpolate,number:Zn,padding:ii.interpolate,numberArray:ur.interpolate,colorArray:ht.interpolate,variableAnchorOffsetCollection:mi.interpolate,array:Qa};class xa{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a=null;const c=r.expectedType;c&&c.kind!=="value"&&(a=c);const p=[];for(const y of e.slice(1)){const x=r.parse(y,1+p.length,a,void 0,{typeAnnotation:"omit"});if(!x)return null;a=a||x.type,p.push(x)}if(!a)throw new Error("No output type");const f=c&&p.some((y=>Ka(c,y.type)));return new xa(f?yt:a,p)}evaluate(e){let r,a=null,c=0;for(const p of this.args)if(c++,a=p.evaluate(e),a&&a instanceof Ei&&!a.available&&(r||(r=a.name),a=null,c===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Mc(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ko(i,e,r,a){return a.compare(e,r)===0}function gr(i,e,r){const a=i!=="=="&&i!=="!=";return class E0{constructor(p,f,y){this.type=bt,this.lhs=p,this.rhs=f,this.collator=y,this.hasUntypedArgument=p.type.kind==="value"||f.type.kind==="value"}static parse(p,f){if(p.length!==3&&p.length!==4)return f.error("Expected two or three arguments.");const y=p[0];let x=f.parse(p[1],1,yt);if(!x)return null;if(!Mc(y,x.type))return f.concat(1).error(`"${y}" comparisons are not supported for type '${Vt(x.type)}'.`);let S=f.parse(p[2],2,yt);if(!S)return null;if(!Mc(y,S.type))return f.concat(2).error(`"${y}" comparisons are not supported for type '${Vt(S.type)}'.`);if(x.type.kind!==S.type.kind&&x.type.kind!=="value"&&S.type.kind!=="value")return f.error(`Cannot compare types '${Vt(x.type)}' and '${Vt(S.type)}'.`);a&&(x.type.kind==="value"&&S.type.kind!=="value"?x=new Si(S.type,[x]):x.type.kind!=="value"&&S.type.kind==="value"&&(S=new Si(x.type,[S])));let P=null;if(p.length===4){if(x.type.kind!=="string"&&S.type.kind!=="string"&&x.type.kind!=="value"&&S.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(P=f.parse(p[3],3,Vo),!P)return null}return new E0(x,S,P)}evaluate(p){const f=this.lhs.evaluate(p),y=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const x=xr(f),S=xr(y);if(x.kind!==S.kind||x.kind!=="string"&&x.kind!=="number")throw new Wt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${x.kind}, ${S.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const x=xr(f),S=xr(y);if(x.kind!=="string"||S.kind!=="string")return e(p,f,y)}return this.collator?r(p,f,y,this.collator.evaluate(p)):e(p,f,y)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const dh=gr("==",(function(i,e,r){return e===r}),Ko),Ic=gr("!=",(function(i,e,r){return e!==r}),(function(i,e,r,a){return!Ko(0,e,r,a)})),fh=gr("<",(function(i,e,r){return e<r}),(function(i,e,r,a){return a.compare(e,r)<0})),Pd=gr(">",(function(i,e,r){return e>r}),(function(i,e,r,a){return a.compare(e,r)>0})),no=gr("<=",(function(i,e,r){return e<=r}),(function(i,e,r,a){return a.compare(e,r)<=0})),nl=gr(">=",(function(i,e,r){return e>=r}),(function(i,e,r,a){return a.compare(e,r)>=0}));class ao{constructor(e,r,a){this.type=Vo,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const c=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,bt);if(!c)return null;const p=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,bt);if(!p)return null;let f=null;return a.locale&&(f=r.parse(a.locale,1,xt),!f)?null:new ao(c,p,f)}evaluate(e){return new bc(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Pc{constructor(e,r,a,c,p){this.type=xt,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=c,this.maxFractionDigits=p}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Xe);if(!a)return null;const c=e[2];if(typeof c!="object"||Array.isArray(c))return r.error("NumberFormat options argument must be an object.");let p=null;if(c.locale&&(p=r.parse(c.locale,1,xt),!p))return null;let f=null;if(c.currency&&(f=r.parse(c.currency,1,xt),!f))return null;let y=null;if(c["min-fraction-digits"]&&(y=r.parse(c["min-fraction-digits"],1,Xe),!y))return null;let x=null;return c["max-fraction-digits"]&&(x=r.parse(c["max-fraction-digits"],1,Xe),!x)?null:new Pc(a,p,f,y,x)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Jo{constructor(e){this.type=Uo,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const c=[];let p=!1;for(let f=1;f<=e.length-1;++f){const y=e[f];if(p&&typeof y=="object"&&!Array.isArray(y)){p=!1;let x=null;if(y["font-scale"]&&(x=r.parse(y["font-scale"],1,Xe),!x))return null;let S=null;if(y["text-font"]&&(S=r.parse(y["text-font"],1,fi(xt)),!S))return null;let P=null;if(y["text-color"]&&(P=r.parse(y["text-color"],1,Ai),!P))return null;let E=null;if(y["vertical-align"]){if(typeof y["vertical-align"]=="string"&&!Md.includes(y["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${y["vertical-align"]}' instead.`);if(E=r.parse(y["vertical-align"],1,xt),!E)return null}const k=c[c.length-1];k.scale=x,k.font=S,k.textColor=P,k.verticalAlign=E}else{const x=r.parse(e[f],1,yt);if(!x)return null;const S=x.type.kind;if(S!=="string"&&S!=="value"&&S!=="null"&&S!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,c.push({content:x,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Jo(c)}evaluate(e){return new Ti(this.sections.map((r=>{const a=r.content.evaluate(e);return xr(a)===Ya?new wc("",a,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new wc(ya(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)})))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}}class oo{constructor(e){this.type=Ya,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,xt);return a?new oo(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=Ei.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class so{constructor(e){this.type=Xe,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Vt(a.type)} instead.`):new so(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new Wt(`Expected value to be of type string or array, but found ${Vt(xr(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Rr=8192;function mh(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,c=Math.pow(2,e.z);return[Math.round(r*c*Rr),Math.round(a*c*Rr)]}function lo(i,e){const r=Math.pow(2,e.z);return[(c=(i[0]/Rr+e.x)/r,360*c-180),(a=(i[1]/Rr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,c}function Qo(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function ba(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Ad(i,e,r){const a=i[0]-e[0],c=i[1]-e[1],p=i[0]-r[0],f=i[1]-r[1];return a*f-p*c==0&&a*p<=0&&c*f<=0}function al(i,e,r,a){return(c=[a[0]-r[0],a[1]-r[1]])[0]*(p=[e[0]-i[0],e[1]-i[1]])[1]-c[1]*p[0]!=0&&!(!Ac(i,e,r,a)||!Ac(r,a,i,e));var c,p}function Ed(i,e,r){for(const a of r)for(let c=0;c<a.length-1;++c)if(al(i,e,a[c],a[c+1]))return!0;return!1}function co(i,e,r=!1){let a=!1;for(const y of e)for(let x=0;x<y.length-1;x++){if(Ad(i,y[x],y[x+1]))return r;(p=y[x])[1]>(c=i)[1]!=(f=y[x+1])[1]>c[1]&&c[0]<(f[0]-p[0])*(c[1]-p[1])/(f[1]-p[1])+p[0]&&(a=!a)}var c,p,f;return a}function ol(i,e){for(const r of e)if(co(i,r))return!0;return!1}function gh(i,e){for(const r of i)if(!co(r,e))return!1;for(let r=0;r<i.length-1;++r)if(Ed(i[r],i[r+1],e))return!1;return!0}function yh(i,e){for(const r of e)if(gh(i,r))return!0;return!1}function Ac(i,e,r,a){const c=a[0]-r[0],p=a[1]-r[1],f=(i[0]-r[0])*p-c*(i[1]-r[1]),y=(e[0]-r[0])*p-c*(e[1]-r[1]);return f>0&&y<0||f<0&&y>0}function Ec(i,e,r){const a=[];for(let c=0;c<i.length;c++){const p=[];for(let f=0;f<i[c].length;f++){const y=mh(i[c][f],r);Qo(e,y),p.push(y)}a.push(p)}return a}function Cc(i,e,r){const a=[];for(let c=0;c<i.length;c++){const p=Ec(i[c],e,r);a.push(p)}return a}function _h(i,e,r,a){if(i[0]<r[0]||i[0]>r[2]){const c=.5*a;let p=i[0]-r[0]>c?-a:r[0]-i[0]>c?a:0;p===0&&(p=i[0]-r[2]>c?-a:r[2]-i[0]>c?a:0),i[0]+=p}Qo(e,i)}function vh(i,e,r,a){const c=Math.pow(2,a.z)*Rr,p=[a.x*Rr,a.y*Rr],f=[];for(const y of i)for(const x of y){const S=[x.x+p[0],x.y+p[1]];_h(S,e,r,c),f.push(S)}return f}function xh(i,e,r,a){const c=Math.pow(2,a.z)*Rr,p=[a.x*Rr,a.y*Rr],f=[];for(const x of i){const S=[];for(const P of x){const E=[P.x+p[0],P.y+p[1]];Qo(e,E),S.push(E)}f.push(S)}if(e[2]-e[0]<=c/2){(y=e)[0]=y[1]=1/0,y[2]=y[3]=-1/0;for(const x of f)for(const S of x)_h(S,e,r,c)}var y;return f}class wa{constructor(e,r){this.type=bt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Hn(e[1])){const a=e[1];if(a.type==="FeatureCollection"){const c=[];for(const p of a.features){const{type:f,coordinates:y}=p.geometry;f==="Polygon"&&c.push(y),f==="MultiPolygon"&&c.push(...y)}if(c.length)return new wa(a,{type:"MultiPolygon",coordinates:c})}else if(a.type==="Feature"){const c=a.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new wa(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new wa(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(r,a){const c=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(a.type==="Polygon"){const y=Ec(a.coordinates,p,f),x=vh(r.geometry(),c,p,f);if(!ba(c,p))return!1;for(const S of x)if(!co(S,y))return!1}if(a.type==="MultiPolygon"){const y=Cc(a.coordinates,p,f),x=vh(r.geometry(),c,p,f);if(!ba(c,p))return!1;for(const S of x)if(!ol(S,y))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(r,a){const c=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if(a.type==="Polygon"){const y=Ec(a.coordinates,p,f),x=xh(r.geometry(),c,p,f);if(!ba(c,p))return!1;for(const S of x)if(!gh(S,y))return!1}if(a.type==="MultiPolygon"){const y=Cc(a.coordinates,p,f),x=xh(r.geometry(),c,p,f);if(!ba(c,p))return!1;for(const S of x)if(!yh(S,y))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let bh=class{constructor(i=[],e=(r,a)=>r<a?-1:r>a?1:0){if(this.data=i,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:e,compare:r}=this,a=e[i];for(;i>0;){const c=i-1>>1,p=e[c];if(r(a,p)>=0)break;e[i]=p,i=c}e[i]=a}_down(i){const{data:e,compare:r}=this,a=this.length>>1,c=e[i];for(;i<a;){let p=1+(i<<1);const f=p+1;if(f<this.length&&r(e[f],e[p])<0&&(p=f),r(e[p],c)>=0)break;e[i]=e[p],i=p}e[i]=c}};function kc(i,e,r=0,a=i.length-1,c=wh){for(;a>r;){if(a-r>600){const x=a-r+1,S=e-r+1,P=Math.log(x),E=.5*Math.exp(2*P/3),k=.5*Math.sqrt(P*E*(x-E)/x)*(S-x/2<0?-1:1);kc(i,e,Math.max(r,Math.floor(e-S*E/x+k)),Math.min(a,Math.floor(e+(x-S)*E/x+k)),c)}const p=i[e];let f=r,y=a;for(uo(i,r,e),c(i[a],p)>0&&uo(i,r,a);f<y;){for(uo(i,f,y),f++,y--;c(i[f],p)<0;)f++;for(;c(i[y],p)>0;)y--}c(i[r],p)===0?uo(i,r,y):(y++,uo(i,y,a)),y<=e&&(r=y+1),e<=y&&(a=y-1)}}function uo(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function wh(i,e){return i<e?-1:i>e?1:0}function sl(i,e){if(i.length<=1)return[i];const r=[];let a,c;for(const p of i){const f=kd(p);f!==0&&(p.area=Math.abs(f),c===void 0&&(c=f<0),c===f<0?(a&&r.push(a),a=[p]):a.push(p))}if(a&&r.push(a),e>1)for(let p=0;p<r.length;p++)r[p].length<=e||(kc(r[p],e,1,r[p].length-1,Cd),r[p]=r[p].slice(0,e));return r}function Cd(i,e){return e.area-i.area}function kd(i){let e=0;for(let r,a,c=0,p=i.length,f=p-1;c<p;f=c++)r=i[c],a=i[f],e+=(a.x-r.x)*(r.y+a.y);return e}const Th=1/298.257223563,es=Th*(2-Th),Sh=Math.PI/180;class Dc{constructor(e){const r=6378.137*Sh*1e3,a=Math.cos(e*Sh),c=1/(1-es*(1-a*a)),p=Math.sqrt(c);this.kx=r*p*a,this.ky=r*p*c*(1-es)}distance(e,r){const a=this.wrap(e[0]-r[0])*this.kx,c=(e[1]-r[1])*this.ky;return Math.sqrt(a*a+c*c)}pointOnLine(e,r){let a,c,p,f,y=1/0;for(let x=0;x<e.length-1;x++){let S=e[x][0],P=e[x][1],E=this.wrap(e[x+1][0]-S)*this.kx,k=(e[x+1][1]-P)*this.ky,z=0;E===0&&k===0||(z=(this.wrap(r[0]-S)*this.kx*E+(r[1]-P)*this.ky*k)/(E*E+k*k),z>1?(S=e[x+1][0],P=e[x+1][1]):z>0&&(S+=E/this.kx*z,P+=k/this.ky*z)),E=this.wrap(r[0]-S)*this.kx,k=(r[1]-P)*this.ky;const F=E*E+k*k;F<y&&(y=F,a=S,c=P,p=x,f=z)}return{point:[a,c],index:p,t:Math.max(0,Math.min(1,f))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Mh(i,e){return e[0]-i[0]}function ll(i){return i[1]-i[0]+1}function Yi(i,e){return i[1]>=i[0]&&i[1]<e}function cl(i,e){if(i[0]>i[1])return[null,null];const r=ll(i);if(e){if(r===2)return[i,null];const c=Math.floor(r/2);return[[i[0],i[0]+c],[i[0]+c,i[1]]]}if(r===1)return[i,null];const a=Math.floor(r/2)-1;return[[i[0],i[0]+a],[i[0]+a+1,i[1]]]}function zc(i,e){if(!Yi(e,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let a=e[0];a<=e[1];++a)Qo(r,i[a]);return r}function Lc(i){const e=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const a of r)Qo(e,a);return e}function Rc(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function ul(i,e,r){if(!Rc(i)||!Rc(e))return NaN;let a=0,c=0;return i[2]<e[0]&&(a=e[0]-i[2]),i[0]>e[2]&&(a=i[0]-e[2]),i[1]>e[3]&&(c=i[1]-e[3]),i[3]<e[1]&&(c=e[1]-i[3]),r.distance([0,0],[a,c])}function Ta(i,e,r){const a=r.pointOnLine(e,i);return r.distance(i,a.point)}function Fc(i,e,r,a,c){const p=Math.min(Ta(i,[r,a],c),Ta(e,[r,a],c)),f=Math.min(Ta(r,[i,e],c),Ta(a,[i,e],c));return Math.min(p,f)}function Dd(i,e,r,a,c){if(!Yi(e,i.length)||!Yi(a,r.length))return 1/0;let p=1/0;for(let f=e[0];f<e[1];++f){const y=i[f],x=i[f+1];for(let S=a[0];S<a[1];++S){const P=r[S],E=r[S+1];if(al(y,x,P,E))return 0;p=Math.min(p,Fc(y,x,P,E,c))}}return p}function Ih(i,e,r,a,c){if(!Yi(e,i.length)||!Yi(a,r.length))return NaN;let p=1/0;for(let f=e[0];f<=e[1];++f)for(let y=a[0];y<=a[1];++y)if(p=Math.min(p,c.distance(i[f],r[y])),p===0)return p;return p}function zd(i,e,r){if(co(i,e,!0))return 0;let a=1/0;for(const c of e){const p=c[0],f=c[c.length-1];if(p!==f&&(a=Math.min(a,Ta(i,[f,p],r)),a===0))return a;const y=r.pointOnLine(c,i);if(a=Math.min(a,r.distance(i,y.point)),a===0)return a}return a}function Ld(i,e,r,a){if(!Yi(e,i.length))return NaN;for(let p=e[0];p<=e[1];++p)if(co(i[p],r,!0))return 0;let c=1/0;for(let p=e[0];p<e[1];++p){const f=i[p],y=i[p+1];for(const x of r)for(let S=0,P=x.length,E=P-1;S<P;E=S++){const k=x[E],z=x[S];if(al(f,y,k,z))return 0;c=Math.min(c,Fc(f,y,k,z,a))}}return c}function Ph(i,e){for(const r of i)for(const a of r)if(co(a,e,!0))return!0;return!1}function Rd(i,e,r,a=1/0){const c=Lc(i),p=Lc(e);if(a!==1/0&&ul(c,p,r)>=a)return a;if(ba(c,p)){if(Ph(i,e))return 0}else if(Ph(e,i))return 0;let f=1/0;for(const y of i)for(let x=0,S=y.length,P=S-1;x<S;P=x++){const E=y[P],k=y[x];for(const z of e)for(let F=0,B=z.length,j=B-1;F<B;j=F++){const G=z[j],Q=z[F];if(al(E,k,G,Q))return 0;f=Math.min(f,Fc(E,k,G,Q,r))}}return f}function Rt(i,e,r,a,c,p){if(!p)return;const f=ul(zc(a,p),c,r);f<e&&i.push([f,p,[0,0]])}function hl(i,e,r,a,c,p,f){if(!p||!f)return;const y=ul(zc(a,p),zc(c,f),r);y<e&&i.push([y,p,f])}function pl(i,e,r,a,c=1/0){let p=Math.min(a.distance(i[0],r[0][0]),c);if(p===0)return p;const f=new bh([[0,[0,i.length-1],[0,0]]],Mh),y=Lc(r);for(;f.length>0;){const x=f.pop();if(x[0]>=p)continue;const S=x[1],P=e?50:100;if(ll(S)<=P){if(!Yi(S,i.length))return NaN;if(e){const E=Ld(i,S,r,a);if(isNaN(E)||E===0)return E;p=Math.min(p,E)}else for(let E=S[0];E<=S[1];++E){const k=zd(i[E],r,a);if(p=Math.min(p,k),p===0)return 0}}else{const E=cl(S,e);Rt(f,p,a,i,y,E[0]),Rt(f,p,a,i,y,E[1])}}return p}function dl(i,e,r,a,c,p=1/0){let f=Math.min(p,c.distance(i[0],r[0]));if(f===0)return f;const y=new bh([[0,[0,i.length-1],[0,r.length-1]]],Mh);for(;y.length>0;){const x=y.pop();if(x[0]>=f)continue;const S=x[1],P=x[2],E=e?50:100,k=a?50:100;if(ll(S)<=E&&ll(P)<=k){if(!Yi(S,i.length)&&Yi(P,r.length))return NaN;let z;if(e&&a)z=Dd(i,S,r,P,c),f=Math.min(f,z);else if(e&&!a){const F=i.slice(S[0],S[1]+1);for(let B=P[0];B<=P[1];++B)if(z=Ta(r[B],F,c),f=Math.min(f,z),f===0)return f}else if(!e&&a){const F=r.slice(P[0],P[1]+1);for(let B=S[0];B<=S[1];++B)if(z=Ta(i[B],F,c),f=Math.min(f,z),f===0)return f}else z=Ih(i,S,r,P,c),f=Math.min(f,z)}else{const z=cl(S,e),F=cl(P,a);hl(y,f,c,i,r,z[0],F[0]),hl(y,f,c,i,r,z[0],F[1]),hl(y,f,c,i,r,z[1],F[0]),hl(y,f,c,i,r,z[1],F[1])}}return f}function Bc(i){return i.type==="MultiPolygon"?i.coordinates.map((e=>({type:"Polygon",coordinates:e}))):i.type==="MultiLineString"?i.coordinates.map((e=>({type:"LineString",coordinates:e}))):i.type==="MultiPoint"?i.coordinates.map((e=>({type:"Point",coordinates:e}))):[i]}class Sa{constructor(e,r){this.type=Xe,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Hn(e[1])){const a=e[1];if(a.type==="FeatureCollection")return new Sa(a,a.features.map((c=>Bc(c.geometry))).flat());if(a.type==="Feature")return new Sa(a,Bc(a.geometry));if("type"in a&&"coordinates"in a)return new Sa(a,Bc(a))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(r,a){const c=r.geometry(),p=c.flat().map((x=>lo([x.x,x.y],r.canonical)));if(c.length===0)return NaN;const f=new Dc(p[0][1]);let y=1/0;for(const x of a){switch(x.type){case"Point":y=Math.min(y,dl(p,!1,[x.coordinates],!1,f,y));break;case"LineString":y=Math.min(y,dl(p,!1,x.coordinates,!0,f,y));break;case"Polygon":y=Math.min(y,pl(p,!1,x.coordinates,f,y))}if(y===0)return y}return y})(e,this.geometries);if(e.geometryType()==="LineString")return(function(r,a){const c=r.geometry(),p=c.flat().map((x=>lo([x.x,x.y],r.canonical)));if(c.length===0)return NaN;const f=new Dc(p[0][1]);let y=1/0;for(const x of a){switch(x.type){case"Point":y=Math.min(y,dl(p,!0,[x.coordinates],!1,f,y));break;case"LineString":y=Math.min(y,dl(p,!0,x.coordinates,!0,f,y));break;case"Polygon":y=Math.min(y,pl(p,!0,x.coordinates,f,y))}if(y===0)return y}return y})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(r,a){const c=r.geometry();if(c.length===0||c[0].length===0)return NaN;const p=sl(c,0).map((x=>x.map((S=>S.map((P=>lo([P.x,P.y],r.canonical))))))),f=new Dc(p[0][0][0][1]);let y=1/0;for(const x of a)for(const S of p){switch(x.type){case"Point":y=Math.min(y,pl([x.coordinates],!1,S,f,y));break;case"LineString":y=Math.min(y,pl(x.coordinates,!0,S,f,y));break;case"Polygon":y=Math.min(y,Rd(S,x.coordinates,f,y))}if(y===0)return y}return y})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class ts{constructor(e){this.type=yt,this.key=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=e[1];return a==null?r.error("Global state property must be defined."):typeof a!="string"?r.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new ts(a)}evaluate(e){var r;const a=(r=e.globals)===null||r===void 0?void 0:r.globalState;return a&&Object.keys(a).length!==0?Wo(a,this.key):null}eachChild(){}outputDefined(){return!1}}const ho={"==":dh,"!=":Ic,">":Pd,"<":fh,">=":nl,"<=":no,array:Si,at:Ct,boolean:Si,case:Xo,coalesce:xa,collator:ao,format:Jo,image:oo,in:_t,"index-of":ro,interpolate:yi,"interpolate-hcl":yi,"interpolate-lab":yi,length:so,let:Ht,literal:gn,match:Dt,number:Si,"number-format":Pc,object:Si,slice:Oi,step:Xn,string:Si,"to-boolean":En,"to-color":En,"to-number":En,"to-string":En,var:to,within:wa,distance:Sa,"global-state":ts};class Ni{constructor(e,r,a,c){this.name=e,this.type=r,this._evaluate=a,this.args=c}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const a=e[0],c=Ni.definitions[a];if(!c)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(c)?c[0]:c.type,f=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,y=f.filter((([S])=>!Array.isArray(S)||S.length===e.length-1));let x=null;for(const[S,P]of y){x=new va(r.registry,fl,r.path,null,r.scope);const E=[];let k=!1;for(let z=1;z<e.length;z++){const F=e[z],B=Array.isArray(S)?S[z-1]:S.type,j=x.parse(F,1+E.length,B);if(!j){k=!0;break}E.push(j)}if(!k)if(Array.isArray(S)&&S.length!==E.length)x.error(`Expected ${S.length} arguments, but found ${E.length} instead.`);else{for(let z=0;z<E.length;z++){const F=Array.isArray(S)?S[z]:S.type,B=E[z];x.concat(z+1).checkSubtype(F,B.type)}if(x.errors.length===0)return new Ni(a,p,P,E)}}if(y.length===1)r.errors.push(...x.errors);else{const S=(y.length?y:f).map((([E])=>{return k=E,Array.isArray(k)?`(${k.map(Vt).join(", ")})`:`(${Vt(k.type)}...)`;var k})).join(" | "),P=[];for(let E=1;E<e.length;E++){const k=r.parse(e[E],1+P.length);if(!k)return null;P.push(Vt(k.type))}r.error(`Expected arguments of type ${S}, but found (${P.join(", ")}) instead.`)}return null}static register(e,r){Ni.definitions=r;for(const a in r)e[a]=Ni}}function Ah(i,[e,r,a,c]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const p=c?c.evaluate(i):1,f=eo(e,r,a,p);if(f)throw new Wt(f);return new wt(e/255,r/255,a/255,p,!1)}function Eh(i,e){return i in e}function Oc(i,e){const r=e[i];return r===void 0?null:r}function Ma(i){return{type:i}}function fl(i){if(i instanceof to)return fl(i.boundExpression);if(i instanceof Ni&&i.name==="error"||i instanceof ao||i instanceof wa||i instanceof Sa||i instanceof ts)return!1;const e=i instanceof En||i instanceof Si;let r=!0;return i.eachChild((a=>{r=e?r&&fl(a):r&&a instanceof gn})),!!r&&ml(i)&&gl(i,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function ml(i){if(i instanceof Ni&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof wa||i instanceof Sa)return!1;let e=!0;return i.eachChild((r=>{e&&!ml(r)&&(e=!1)})),e}function rs(i){if(i instanceof Ni&&i.name==="feature-state")return!1;let e=!0;return i.eachChild((r=>{e&&!rs(r)&&(e=!1)})),e}function gl(i,e){if(i instanceof Ni&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild((a=>{r&&!gl(a,e)&&(r=!1)})),r}function Ch(i){return{result:"success",value:i}}function po(i){return{result:"error",value:i}}function fo(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function kh(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Nc(i){return!!i.expression&&i.expression.interpolated}function Tt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function yl(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&xr(i)===An}function Fd(i){return i}function Dh(i,e){const r=i.stops&&typeof i.stops[0][0]=="object",a=r||!(r||i.property!==void 0),c=i.type||(Nc(e)?"exponential":"interval"),p=(function(P){switch(P.type){case"color":return wt.parse;case"padding":return ii.parse;case"numberArray":return ur.parse;case"colorArray":return ht.parse;default:return null}})(e);if(p&&((i=pi({},i)).stops&&(i.stops=i.stops.map((P=>[P[0],p(P[1])]))),i.default=p(i.default?i.default:e.default)),i.colorSpace&&(f=i.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var f;const y=(function(P){switch(P){case"exponential":return zh;case"interval":return Od;case"categorical":return Bd;case"identity":return Nd;default:throw new Error(`Unknown function type "${P}"`)}})(c);let x,S;if(c==="categorical"){x=Object.create(null);for(const P of i.stops)x[P[0]]=P[1];S=typeof i.stops[0][0]}if(r){const P={},E=[];for(let F=0;F<i.stops.length;F++){const B=i.stops[F],j=B[0].zoom;P[j]===void 0&&(P[j]={zoom:j,type:i.type,property:i.property,default:i.default,stops:[]},E.push(j)),P[j].stops.push([B[0].value,B[1]])}const k=[];for(const F of E)k.push([P[F].zoom,Dh(P[F],e)]);const z={name:"linear"};return{kind:"composite",interpolationType:z,interpolationFactor:yi.interpolationFactor.bind(void 0,z),zoomStops:k.map((F=>F[0])),evaluate:({zoom:F},B)=>zh({stops:k,base:i.base},e,F).evaluate(F,B)}}if(a){const P=c==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:P,interpolationFactor:yi.interpolationFactor.bind(void 0,P),zoomStops:i.stops.map((E=>E[0])),evaluate:({zoom:E})=>y(i,e,E,x,S)}}return{kind:"source",evaluate(P,E){const k=E&&E.properties?E.properties[i.property]:void 0;return k===void 0?is(i.default,e.default):y(i,e,k,x,S)}}}function is(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Bd(i,e,r,a,c){return is(typeof r===c?a[r]:void 0,i.default,e.default)}function Od(i,e,r){if(Tt(r)!=="number")return is(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const c=io(i.stops.map((p=>p[0])),r);return i.stops[c][1]}function zh(i,e,r){const a=i.base!==void 0?i.base:1;if(Tt(r)!=="number")return is(i.default,e.default);const c=i.stops.length;if(c===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[c-1][0])return i.stops[c-1][1];const p=io(i.stops.map((P=>P[0])),r),f=(function(P,E,k,z){const F=z-k,B=P-k;return F===0?0:E===1?B/F:(Math.pow(E,B)-1)/(Math.pow(E,F)-1)})(r,a,i.stops[p][0],i.stops[p+1][0]),y=i.stops[p][1],x=i.stops[p+1][1],S=ar[e.type]||Fd;return typeof y.evaluate=="function"?{evaluate(...P){const E=y.evaluate.apply(void 0,P),k=x.evaluate.apply(void 0,P);if(E!==void 0&&k!==void 0)return S(E,k,f,i.colorSpace)}}:S(y,x,f,i.colorSpace)}function Nd(i,e,r){switch(e.type){case"color":r=wt.parse(r);break;case"formatted":r=Ti.fromString(r.toString());break;case"resolvedImage":r=Ei.fromString(r.toString());break;case"padding":r=ii.parse(r);break;case"colorArray":r=ht.parse(r);break;case"numberArray":r=ur.parse(r);break;default:Tt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return is(r,i.default,e.default)}Ni.register(ho,{error:[{kind:"error"},[xt],(i,[e])=>{throw new Wt(e.evaluate(i))}],typeof:[xt,[yt],(i,[e])=>Vt(xr(e.evaluate(i)))],"to-rgba":[fi(Xe,4),[Ai],(i,[e])=>{const[r,a,c,p]=e.evaluate(i).rgb;return[255*r,255*a,255*c,p]}],rgb:[Ai,[Xe,Xe,Xe],Ah],rgba:[Ai,[Xe,Xe,Xe,Xe],Ah],has:{type:bt,overloads:[[[xt],(i,[e])=>Eh(e.evaluate(i),i.properties())],[[xt,An],(i,[e,r])=>Eh(e.evaluate(i),r.evaluate(i))]]},get:{type:yt,overloads:[[[xt],(i,[e])=>Oc(e.evaluate(i),i.properties())],[[xt,An],(i,[e,r])=>Oc(e.evaluate(i),r.evaluate(i))]]},"feature-state":[yt,[xt],(i,[e])=>Oc(e.evaluate(i),i.featureState||{})],properties:[An,[],i=>i.properties()],"geometry-type":[xt,[],i=>i.geometryType()],id:[yt,[],i=>i.id()],zoom:[Xe,[],i=>i.globals.zoom],"heatmap-density":[Xe,[],i=>i.globals.heatmapDensity||0],elevation:[Xe,[],i=>i.globals.elevation||0],"line-progress":[Xe,[],i=>i.globals.lineProgress||0],accumulated:[yt,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Xe,Ma(Xe),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[Xe,Ma(Xe),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:Xe,overloads:[[[Xe,Xe],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Xe],(i,[e])=>-e.evaluate(i)]]},"/":[Xe,[Xe,Xe],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Xe,[Xe,Xe],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Xe,[],()=>Math.LN2],pi:[Xe,[],()=>Math.PI],e:[Xe,[],()=>Math.E],"^":[Xe,[Xe,Xe],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Xe,[Xe],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Xe,[Xe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Xe,[Xe],(i,[e])=>Math.log(e.evaluate(i))],log2:[Xe,[Xe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Xe,[Xe],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Xe,[Xe],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Xe,[Xe],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Xe,[Xe],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Xe,[Xe],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Xe,[Xe],(i,[e])=>Math.atan(e.evaluate(i))],min:[Xe,Ma(Xe),(i,e)=>Math.min(...e.map((r=>r.evaluate(i))))],max:[Xe,Ma(Xe),(i,e)=>Math.max(...e.map((r=>r.evaluate(i))))],abs:[Xe,[Xe],(i,[e])=>Math.abs(e.evaluate(i))],round:[Xe,[Xe],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Xe,[Xe],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Xe,[Xe],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[bt,[xt,yt],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[bt,[yt],(i,[e])=>i.id()===e.value],"filter-type-==":[bt,[xt],(i,[e])=>i.geometryType()===e.value],"filter-<":[bt,[xt,yt],(i,[e,r])=>{const a=i.properties()[e.value],c=r.value;return typeof a==typeof c&&a<c}],"filter-id-<":[bt,[yt],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<a}],"filter->":[bt,[xt,yt],(i,[e,r])=>{const a=i.properties()[e.value],c=r.value;return typeof a==typeof c&&a>c}],"filter-id->":[bt,[yt],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[bt,[xt,yt],(i,[e,r])=>{const a=i.properties()[e.value],c=r.value;return typeof a==typeof c&&a<=c}],"filter-id-<=":[bt,[yt],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[bt,[xt,yt],(i,[e,r])=>{const a=i.properties()[e.value],c=r.value;return typeof a==typeof c&&a>=c}],"filter-id->=":[bt,[yt],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[bt,[yt],(i,[e])=>e.value in i.properties()],"filter-has-id":[bt,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[bt,[fi(xt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[bt,[fi(yt)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[bt,[xt,fi(yt)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[bt,[xt,fi(yt)],(i,[e,r])=>(function(a,c,p,f){for(;p<=f;){const y=p+f>>1;if(c[y]===a)return!0;c[y]>a?f=y-1:p=y+1}return!1})(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:bt,overloads:[[[bt,bt],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[Ma(bt),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:bt,overloads:[[[bt,bt],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[Ma(bt),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[bt,[bt],(i,[e])=>!e.evaluate(i)],"is-supported-script":[bt,[xt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[xt,[xt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[xt,[xt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[xt,Ma(yt),(i,e)=>e.map((r=>ya(r.evaluate(i)))).join("")],"resolved-locale":[xt,[Vo],(i,[e])=>e.evaluate(i).resolvedLocale()]});class jc{constructor(e,r,a){this.expression=e,this._warningHistory={},this._evaluator=new Tc,this._defaultValue=r?(function(c){if(c.type==="color"&&yl(c.default))return new wt(0,0,0,0);switch(c.type){case"color":return wt.parse(c.default)||null;case"padding":return ii.parse(c.default)||null;case"numberArray":return ur.parse(c.default)||null;case"colorArray":return ht.parse(c.default)||null;case"variableAnchorOffsetCollection":return mi.parse(c.default)||null;case"projectionDefinition":return gi.parse(c.default)||null;default:return c.default===void 0?null:c.default}})(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=a}evaluateWithoutErrorHandling(e,r,a,c,p,f){return this._globalState&&(e=Ia(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=c,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,c,p,f){this._globalState&&(e=Ia(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=c,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f||null;try{const y=this.expression.evaluate(this._evaluator);if(y==null||typeof y=="number"&&y!=y)return this._defaultValue;if(this._enumValues&&!(y in this._enumValues))throw new Wt(`Expected value to be one of ${Object.keys(this._enumValues).map((x=>JSON.stringify(x))).join(", ")}, but found ${JSON.stringify(y)} instead.`);return y}catch(y){return this._warningHistory[y.message]||(this._warningHistory[y.message]=!0,typeof console<"u"&&console.warn(y.message)),this._defaultValue}}}function mo(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in ho}function ns(i,e,r){const a=new va(ho,fl,[],e?(function(p){const f={color:Ai,string:xt,number:Xe,enum:xt,boolean:bt,formatted:Uo,padding:Js,numberArray:$o,colorArray:Xa,projectionDefinition:Ks,resolvedImage:Ya,variableAnchorOffsetCollection:Go};return p.type==="array"?fi(f[p.value]||yt,p.length):f[p.type]})(e):void 0),c=a.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return c?Ch(new jc(c,e,r)):po(a.errors)}class _l{constructor(e,r,a){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!rs(r.expression),this.globalStateRefs=Yn(r.expression),this._globalState=a}evaluateWithoutErrorHandling(e,r,a,c,p,f){return this._globalState&&(e=Ia(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,a,c,p,f)}evaluate(e,r,a,c,p,f){return this._globalState&&(e=Ia(e,this._globalState)),this._styleExpression.evaluate(e,r,a,c,p,f)}}class Vc{constructor(e,r,a,c,p){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!rs(r.expression),this.globalStateRefs=Yn(r.expression),this.interpolationType=c,this._globalState=p}evaluateWithoutErrorHandling(e,r,a,c,p,f){return this._globalState&&(e=Ia(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,a,c,p,f)}evaluate(e,r,a,c,p,f){return this._globalState&&(e=Ia(e,this._globalState)),this._styleExpression.evaluate(e,r,a,c,p,f)}interpolationFactor(e,r,a){return this.interpolationType?yi.interpolationFactor(this.interpolationType,e,r,a):0}}function Uc(i,e,r){const a=ns(i,e,r);if(a.result==="error")return a;const c=a.value.expression,p=ml(c);if(!p&&!fo(e))return po([new di("","data expressions not supported")]);const f=gl(c,["zoom"]);if(!f&&!kh(e))return po([new di("","zoom expressions not supported")]);const y=xl(c);return y||f?y instanceof di?po([y]):y instanceof yi&&!Nc(e)?po([new di("",'"interpolate" expressions cannot be used with this property')]):Ch(y?new Vc(p?"camera":"composite",a.value,y.labels,y instanceof yi?y.interpolation:void 0,r):new _l(p?"constant":"source",a.value,r)):po([new di("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class vl{constructor(e,r){this._parameters=e,this._specification=r,pi(this,Dh(this._parameters,this._specification))}static deserialize(e){return new vl(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function xl(i){let e=null;if(i instanceof Ht)e=xl(i.result);else if(i instanceof xa){for(const r of i.args)if(e=xl(r),e)break}else(i instanceof Xn||i instanceof yi)&&i.input instanceof Ni&&i.input.name==="zoom"&&(e=i);return e instanceof di||i.eachChild((r=>{const a=xl(r);a instanceof di?e=a:!e&&a?e=new di("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new di("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Yn(i,e=new Set){return i instanceof ts&&e.add(i.key),i.eachChild((r=>{Yn(r,e)})),e}function Ia(i,e){const{zoom:r,heatmapDensity:a,elevation:c,lineProgress:p,isSupportedScript:f,accumulated:y}=i??{};return{zoom:r,heatmapDensity:a,elevation:c,lineProgress:p,isSupportedScript:f,accumulated:y,globalState:e}}function $c(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!$c(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const jd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function as(i,e){if(i==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};$c(i)||(i=os(i));const r=ns(i,jd,e);if(r.result==="error")throw new Error(r.value.map((a=>`${a.key}: ${a.message}`)).join(", "));return{filter:(a,c,p)=>r.value.evaluate(a,c,{},p),needGeometry:Lh(i),getGlobalStateRefs:()=>Yn(r.value.expression)}}function Vd(i,e){return i<e?-1:i>e?1:0}function Lh(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let e=1;e<i.length;e++)if(Lh(i[e]))return!0;return!1}function os(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?bl(i[1],i[2],"=="):e==="!="?ss(bl(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?bl(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(os))):e==="all"?["all"].concat(i.slice(1).map(os)):e==="none"?["all"].concat(i.slice(1).map(os).map(ss)):e==="in"?Rh(i[1],i.slice(2)):e==="!in"?ss(Rh(i[1],i.slice(2))):e==="has"?Fh(i[1]):e!=="!has"||ss(Fh(i[1]));var r}function bl(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Rh(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((r=>typeof r!=typeof e[0]))?["filter-in-large",i,["literal",e.sort(Vd)]]:["filter-in-small",i,["literal",e]]}}function Fh(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function ss(i){return["!",i]}function wl(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let c="[";for(const p of i)c+=`${wl(p)},`;return`${c}]`}const r=Object.keys(i).sort();let a="{";for(let c=0;c<r.length;c++)a+=`${JSON.stringify(r[c])}:${wl(i[r[c]])},`;return`${a}}`}function Bh(i){let e="";for(const r of qt)e+=`/${wl(i[r])}`;return e}function Oh(i){const e=i.value;return e?[new je(i.key,e,"constants have been deprecated as of v8")]:[]}function br(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Pa(i){if(Array.isArray(i))return i.map(Pa);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=Pa(i[r]);return e}return br(i)}function Ci(i){const e=i.key,r=i.value,a=i.valueSpec||{},c=i.objectElementValidators||{},p=i.style,f=i.styleSpec,y=i.validateSpec;let x=[];const S=Tt(r);if(S!=="object")return[new je(e,r,`object expected, ${S} found`)];for(const P in r){const E=P.split(".")[0],k=Wo(a,E)||a["*"];let z;if(Wo(c,E))z=c[E];else if(Wo(a,E)){if(r[P]===void 0)continue;z=y}else if(c["*"])z=c["*"];else{if(!a["*"]){x.push(new je(e,r[P],`unknown property "${P}"`));continue}z=y}x=x.concat(z({key:(e&&`${e}.`)+P,value:r[P],valueSpec:k,style:p,styleSpec:f,object:r,objectKey:P,validateSpec:y},r))}for(const P in a)c[P]||a[P].required&&a[P].default===void 0&&r[P]===void 0&&x.push(new je(e,r,`missing required property "${P}"`));return x}function Tl(i){const e=i.value,r=i.valueSpec,a=i.style,c=i.styleSpec,p=i.key,f=i.arrayElementValidator||i.validateSpec;if(Tt(e)!=="array")return[new je(p,e,`array expected, ${Tt(e)} found`)];if(r.length&&e.length!==r.length)return[new je(p,e,`array length ${r.length} expected, length ${e.length} found`)];let y={type:r.value,values:r.values};c.$version<7&&(y.function=r.function),Tt(r.value)==="object"&&(y=r.value);let x=[];for(let S=0;S<e.length;S++)x=x.concat(f({array:e,arrayIndex:S,value:e[S],valueSpec:y,validateSpec:i.validateSpec,style:a,styleSpec:c,key:`${p}[${S}]`}));return x}function ls(i){const e=i.key,r=i.value,a=i.valueSpec;let c=Tt(r);return c==="number"&&r!=r&&(c="NaN"),c!=="number"?[new je(e,r,`number expected, ${c} found`)]:"minimum"in a&&r<a.minimum?[new je(e,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new je(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Sl(i){const e=i.valueSpec,r=br(i.value.type);let a,c,p,f={};const y=r!=="categorical"&&i.value.property===void 0,x=!y,S=Tt(i.value.stops)==="array"&&Tt(i.value.stops[0])==="array"&&Tt(i.value.stops[0][0])==="object",P=Ci({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(z){if(r==="identity")return[new je(z.key,z.value,'identity function may not have a "stops" property')];let F=[];const B=z.value;return F=F.concat(Tl({key:z.key,value:B,valueSpec:z.valueSpec,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:E})),Tt(B)==="array"&&B.length===0&&F.push(new je(z.key,B,"array must have at least one stop")),F},default:function(z){return z.validateSpec({key:z.key,value:z.value,valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec})}}});return r==="identity"&&y&&P.push(new je(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||P.push(new je(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Nc(i.valueSpec)&&P.push(new je(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(x&&!fo(i.valueSpec)?P.push(new je(i.key,i.value,"property functions not supported")):y&&!kh(i.valueSpec)&&P.push(new je(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!S||i.value.property!==void 0||P.push(new je(i.key,i.value,'"property" property is required')),P;function E(z){let F=[];const B=z.value,j=z.key;if(Tt(B)!=="array")return[new je(j,B,`array expected, ${Tt(B)} found`)];if(B.length!==2)return[new je(j,B,`array length 2 expected, length ${B.length} found`)];if(S){if(Tt(B[0])!=="object")return[new je(j,B,`object expected, ${Tt(B[0])} found`)];if(B[0].zoom===void 0)return[new je(j,B,"object stop key must have zoom")];if(B[0].value===void 0)return[new je(j,B,"object stop key must have value")];if(p&&p>br(B[0].zoom))return[new je(j,B[0].zoom,"stop zoom values must appear in ascending order")];br(B[0].zoom)!==p&&(p=br(B[0].zoom),c=void 0,f={}),F=F.concat(Ci({key:`${j}[0]`,value:B[0],valueSpec:{zoom:{}},validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:ls,value:k}}))}else F=F.concat(k({key:`${j}[0]`,value:B[0],validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec},B));return mo(Pa(B[1]))?F.concat([new je(`${j}[1]`,B[1],"expressions are not allowed in function stops.")]):F.concat(z.validateSpec({key:`${j}[1]`,value:B[1],valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec}))}function k(z,F){const B=Tt(z.value),j=br(z.value),G=z.value!==null?z.value:F;if(a){if(B!==a)return[new je(z.key,G,`${B} stop domain type must match previous stop domain type ${a}`)]}else a=B;if(B!=="number"&&B!=="string"&&B!=="boolean")return[new je(z.key,G,"stop domain value must be a number, string, or boolean")];if(B!=="number"&&r!=="categorical"){let Q=`number expected, ${B} found`;return fo(e)&&r===void 0&&(Q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new je(z.key,G,Q)]}return r!=="categorical"||B!=="number"||isFinite(j)&&Math.floor(j)===j?r!=="categorical"&&B==="number"&&c!==void 0&&j<c?[new je(z.key,G,"stop domain values must appear in ascending order")]:(c=j,r==="categorical"&&j in f?[new je(z.key,G,"stop domain values must be unique")]:(f[j]=!0,[])):[new je(z.key,G,`integer expected, found ${j}`)]}}function Kn(i){const e=(i.expressionContext==="property"?Uc:ns)(Pa(i.value),i.valueSpec);if(e.result==="error")return e.value.map((a=>new je(`${i.key}${a.key}`,i.value,a.message)));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new je(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!rs(r))return[new je(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!rs(r))return[new je(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!gl(r,["zoom","feature-state"]))return[new je(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!ml(r))return[new je(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function cs(i){const e=i.key,r=i.value,a=Tt(r);return a!=="string"?[new je(e,r,`color expected, ${a} found`)]:wt.parse(String(r))?[]:[new je(e,r,`color expected, "${r}" found`)]}function Aa(i){const e=i.key,r=i.value,a=i.valueSpec,c=[];return Array.isArray(a.values)?a.values.indexOf(br(r))===-1&&c.push(new je(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(br(r))===-1&&c.push(new je(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function go(i){return $c(Pa(i.value))?Kn(pi({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nh(i)}function Nh(i){const e=i.value,r=i.key;if(Tt(e)!=="array")return[new je(r,e,`array expected, ${Tt(e)} found`)];const a=i.styleSpec;let c,p=[];if(e.length<1)return[new je(r,e,"filter array must have at least 1 element")];switch(p=p.concat(Aa({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),br(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&br(e[1])==="$type"&&p.push(new je(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&p.push(new je(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(c=Tt(e[1]),c!=="string"&&p.push(new je(`${r}[1]`,e[1],`string expected, ${c} found`)));for(let f=2;f<e.length;f++)c=Tt(e[f]),br(e[1])==="$type"?p=p.concat(Aa({key:`${r}[${f}]`,value:e[f],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&p.push(new je(`${r}[${f}]`,e[f],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let f=1;f<e.length;f++)p=p.concat(Nh({key:`${r}[${f}]`,value:e[f],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=Tt(e[1]),e.length!==2?p.push(new je(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):c!=="string"&&p.push(new je(`${r}[1]`,e[1],`string expected, ${c} found`))}return p}function jh(i,e){const r=i.key,a=i.validateSpec,c=i.style,p=i.styleSpec,f=i.value,y=i.objectKey,x=p[`${e}_${i.layerType}`];if(!x)return[];const S=y.match(/^(.*)-transition$/);if(e==="paint"&&S&&x[S[1]]&&x[S[1]].transition)return a({key:r,value:f,valueSpec:p.transition,style:c,styleSpec:p});const P=i.valueSpec||x[y];if(!P)return[new je(r,f,`unknown property "${y}"`)];let E;if(Tt(f)==="string"&&fo(P)&&!P.tokens&&(E=/^{([^}]+)}$/.exec(f)))return[new je(r,f,`"${y}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(E[1])} }\`.`)];const k=[];return i.layerType==="symbol"&&y==="text-font"&&yl(Pa(f))&&br(f.type)==="identity"&&k.push(new je(r,f,'"text-font" does not support identity functions')),k.concat(a({key:i.key,value:f,valueSpec:P,style:c,styleSpec:p,expressionContext:"property",propertyType:e,propertyKey:y}))}function Vh(i){return jh(i,"paint")}function Uh(i){return jh(i,"layout")}function $h(i){let e=[];const r=i.value,a=i.key,c=i.style,p=i.styleSpec;if(Tt(r)!=="object")return[new je(a,r,`object expected, ${Tt(r)} found`)];r.type||r.ref||e.push(new je(a,r,'either "type" or "ref" is required'));let f=br(r.type);const y=br(r.ref);if(r.id){const x=br(r.id);for(let S=0;S<i.arrayIndex;S++){const P=c.layers[S];br(P.id)===x&&e.push(new je(a,r.id,`duplicate layer id "${r.id}", previously used at line ${P.id.__line__}`))}}if("ref"in r){let x;["type","source","source-layer","filter","layout"].forEach((S=>{S in r&&e.push(new je(a,r[S],`"${S}" is prohibited for ref layers`))})),c.layers.forEach((S=>{br(S.id)===y&&(x=S)})),x?x.ref?e.push(new je(a,r.ref,"ref cannot reference another ref layer")):f=br(x.type):e.push(new je(a,r.ref,`ref layer "${y}" not found`))}else if(f!=="background")if(r.source){const x=c.sources&&c.sources[r.source],S=x&&br(x.type);x?S==="vector"&&f==="raster"?e.push(new je(a,r.source,`layer "${r.id}" requires a raster source`)):S!=="raster-dem"&&f==="hillshade"||S!=="raster-dem"&&f==="color-relief"?e.push(new je(a,r.source,`layer "${r.id}" requires a raster-dem source`)):S==="raster"&&f!=="raster"?e.push(new je(a,r.source,`layer "${r.id}" requires a vector source`)):S!=="vector"||r["source-layer"]?S==="raster-dem"&&f!=="hillshade"&&f!=="color-relief"?e.push(new je(a,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||S==="geojson"&&x.lineMetrics||e.push(new je(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new je(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new je(a,r.source,`source "${r.source}" not found`))}else e.push(new je(a,r,'missing required property "source"'));return e=e.concat(Ci({key:a,value:r,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:go,layout:x=>Ci({layer:r,key:x.key,value:x.value,style:x.style,styleSpec:x.styleSpec,validateSpec:x.validateSpec,objectElementValidators:{"*":S=>Uh(pi({layerType:f},S))}}),paint:x=>Ci({layer:r,key:x.key,value:x.value,style:x.style,styleSpec:x.styleSpec,validateSpec:x.validateSpec,objectElementValidators:{"*":S=>Vh(pi({layerType:f},S))}})}})),e}function Jn(i){const e=i.value,r=i.key,a=Tt(e);return a!=="string"?[new je(r,e,`string expected, ${a} found`)]:[]}const Gc={promoteId:function({key:i,value:e}){if(Tt(e)==="string")return Jn({key:i,value:e});{const r=[];for(const a in e)r.push(...Jn({key:`${i}.${a}`,value:e[a]}));return r}}};function qc(i){const e=i.value,r=i.key,a=i.styleSpec,c=i.style,p=i.validateSpec;if(!e.type)return[new je(r,e,'"type" is required')];const f=br(e.type);let y;switch(f){case"vector":case"raster":return y=Ci({key:r,value:e,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:Gc,validateSpec:p}),y;case"raster-dem":return y=(function(x){var S;const P=(S=x.sourceName)!==null&&S!==void 0?S:"",E=x.value,k=x.styleSpec,z=k.source_raster_dem,F=x.style;let B=[];const j=Tt(E);if(E===void 0)return B;if(j!=="object")return B.push(new je("source_raster_dem",E,`object expected, ${j} found`)),B;const G=br(E.encoding)==="custom",Q=["redFactor","greenFactor","blueFactor","baseShift"],q=x.value.encoding?`"${x.value.encoding}"`:"Default";for(const H in E)!G&&Q.includes(H)?B.push(new je(H,E[H],`In "${P}": "${H}" is only valid when "encoding" is set to "custom". ${q} encoding found`)):z[H]?B=B.concat(x.validateSpec({key:H,value:E[H],valueSpec:z[H],validateSpec:x.validateSpec,style:F,styleSpec:k})):B.push(new je(H,E[H],`unknown property "${H}"`));return B})({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:p}),y;case"geojson":if(y=Ci({key:r,value:e,valueSpec:a.source_geojson,style:c,styleSpec:a,validateSpec:p,objectElementValidators:Gc}),e.cluster)for(const x in e.clusterProperties){const[S,P]=e.clusterProperties[x],E=typeof S=="string"?[S,["accumulated"],["get",x]]:S;y.push(...Kn({key:`${r}.${x}.map`,value:P,expressionContext:"cluster-map"})),y.push(...Kn({key:`${r}.${x}.reduce`,value:E,expressionContext:"cluster-reduce"}))}return y;case"video":return Ci({key:r,value:e,valueSpec:a.source_video,style:c,validateSpec:p,styleSpec:a});case"image":return Ci({key:r,value:e,valueSpec:a.source_image,style:c,validateSpec:p,styleSpec:a});case"canvas":return[new je(r,null,"Please use runtime APIs to add canvas sources, rather than
2including them in stylesheets.","source.canvas")];default:return Aa({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function us(i){const e=i.value,r=i.styleSpec,a=r.light,c=i.style;let p=[];const f=Tt(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new je("light",e,`object expected, ${f} found`)]),p;for(const y in e){const x=y.match(/^(.*)-transition$/);p=p.concat(x&&a[x[1]]&&a[x[1]].transition?i.validateSpec({key:y,value:e[y],valueSpec:r.transition,validateSpec:i.validateSpec,style:c,styleSpec:r}):a[y]?i.validateSpec({key:y,value:e[y],valueSpec:a[y],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new je(y,e[y],`unknown property "${y}"`)])}return p}function Gh(i){const e=i.value,r=i.styleSpec,a=r.sky,c=i.style,p=Tt(e);if(e===void 0)return[];if(p!=="object")return[new je("sky",e,`object expected, ${p} found`)];let f=[];for(const y in e)f=f.concat(a[y]?i.validateSpec({key:y,value:e[y],valueSpec:a[y],style:c,styleSpec:r}):[new je(y,e[y],`unknown property "${y}"`)]);return f}function Zc(i){const e=i.value,r=i.styleSpec,a=r.terrain,c=i.style;let p=[];const f=Tt(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new je("terrain",e,`object expected, ${f} found`)]),p;for(const y in e)p=p.concat(a[y]?i.validateSpec({key:y,value:e[y],valueSpec:a[y],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new je(y,e[y],`unknown property "${y}"`)]);return p}function Wc(i){let e=[];const r=i.value,a=i.key;if(Array.isArray(r)){const c=[],p=[];for(const f in r)r[f].id&&c.includes(r[f].id)&&e.push(new je(a,r,`all the sprites' ids must be unique, but ${r[f].id} is duplicated`)),c.push(r[f].id),r[f].url&&p.includes(r[f].url)&&e.push(new je(a,r,`all the sprites' URLs must be unique, but ${r[f].url} is duplicated`)),p.push(r[f].url),e=e.concat(Ci({key:`${a}[${f}]`,value:r[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return Jn({key:a,value:r})}function qh(i){return!!i&&i.constructor===Object}function Hc(i){return qh(i.value)?[]:[new je(i.key,i.value,`object expected, ${Tt(i.value)} found`)]}const Xc={"*":()=>[],array:Tl,boolean:function(i){const e=i.value,r=i.key,a=Tt(e);return a!=="boolean"?[new je(r,e,`boolean expected, ${a} found`)]:[]},number:ls,color:cs,constants:Oh,enum:Aa,filter:go,function:Sl,layer:$h,object:Ci,source:qc,light:us,sky:Gh,terrain:Zc,projection:function(i){const e=i.value,r=i.styleSpec,a=r.projection,c=i.style,p=Tt(e);if(e===void 0)return[];if(p!=="object")return[new je("projection",e,`object expected, ${p} found`)];let f=[];for(const y in e)f=f.concat(a[y]?i.validateSpec({key:y,value:e[y],valueSpec:a[y],style:c,styleSpec:r}):[new je(y,e[y],`unknown property "${y}"`)]);return f},projectionDefinition:function(i){const e=i.key;let r=i.value;r=r instanceof String?r.valueOf():r;const a=Tt(r);return a!=="array"||(function(c){return Array.isArray(c)&&c.length===3&&typeof c[0]=="string"&&typeof c[1]=="string"&&typeof c[2]=="number"})(r)||(function(c){return!!["interpolate","step","literal"].includes(c[0])})(r)?["array","string"].includes(a)?[]:[new je(e,r,`projection expected, invalid type "${a}" found`)]:[new je(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]},string:Jn,formatted:function(i){return Jn(i).length===0?[]:Kn(i)},resolvedImage:function(i){return Jn(i).length===0?[]:Kn(i)},padding:function(i){const e=i.key,r=i.value;if(Tt(r)==="array"){if(r.length<1||r.length>4)return[new je(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let c=[];for(let p=0;p<r.length;p++)c=c.concat(i.validateSpec({key:`${e}[${p}]`,value:r[p],validateSpec:i.validateSpec,valueSpec:a}));return c}return ls({key:e,value:r,valueSpec:{}})},numberArray:function(i){const e=i.key,r=i.value;if(Tt(r)==="array"){const a={type:"number"};if(r.length<1)return[new je(e,r,"array length at least 1 expected, length 0 found")];let c=[];for(let p=0;p<r.length;p++)c=c.concat(i.validateSpec({key:`${e}[${p}]`,value:r[p],validateSpec:i.validateSpec,valueSpec:a}));return c}return ls({key:e,value:r,valueSpec:{}}
2)},colorArray:function(i){const e=i.key,r=i.value;if(Tt(r)==="array"){if(r.length<1)return[new je(e,r,"array length at least 1 expected, length 0 found")];let a=[];for(let c=0;c<r.length;c++)a=a.concat(cs({key:`${e}[${c}]`,value:r[c]}));return a}return cs({key:e,value:r})},variableAnchorOffsetCollection:function(i){const e=i.key,r=i.value,a=Tt(r),c=i.styleSpec;if(a!=="array"||r.length<1||r.length%2!=0)return[new je(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let p=[];for(let f=0;f<r.length;f+=2)p=p.concat(Aa({key:`${e}[${f}]`,value:r[f],valueSpec:c.layout_symbol["text-anchor"]})),p=p.concat(Tl({key:`${e}[${f+1}]`,value:r[f+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:c}));return p},sprite:Wc,state:Hc,fontFaces:function(i){const e=i.key,r=i.value,a=i.validateSpec,c=i.styleSpec,p=i.style;if(!qh(r))return[new je(e,r,`object expected, ${Tt(r)} found`)];const f=[];for(const y in r){const x=r[y],S=Tt(x);if(S==="string")f.push(...Jn({key:`${e}.${y}`,value:x}));else if(S==="array"){const P={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[E,k]of x.entries())f.push(...Ci({key:`${e}.${y}[${E}]`,value:k,valueSpec:P,styleSpec:c,style:p,validateSpec:a}))}else f.push(new je(`${e}.${y}`,x,`string or array expected, ${S} found`))}return f}};function Qn(i){const e=i.value,r=i.valueSpec,a=i.styleSpec;return i.validateSpec=Qn,r.expression&&yl(br(e))?Sl(i):r.expression&&mo(Pa(e))?Kn(i):r.type&&Xc[r.type]?Xc[r.type](i):Ci(pi({},i,{valueSpec:r.type?a[r.type]:r}))}function Zh(i){const e=i.value,r=i.key,a=Jn(i);return a.length||(e.indexOf("{fontstack}")===-1&&a.push(new je(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new je(r,e,'"glyphs" url must include a "{range}" token'))),a}function ji(i,e=we){let r=[];return r=r.concat(Qn({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:Qn,objectElementValidators:{glyphs:Zh,"*":()=>[]}})),i.constants&&(r=r.concat(Oh({key:"constants",value:i.constants}))),Wh(r)}function Ki(i){return function(e){return i(Object.assign({},e,{validateSpec:Qn}))}}function Wh(i){return[].concat(i).sort(((e,r)=>e.line-r.line))}function Ji(i){return function(...e){return Wh(i.apply(this,e))}}ji.source=Ji(Ki(qc)),ji.sprite=Ji(Ki(Wc)),ji.glyphs=Ji(Ki(Zh)),ji.light=Ji(Ki(us)),ji.sky=Ji(Ki(Gh)),ji.terrain=Ji(Ki(Zc)),ji.state=Ji(Ki(Hc)),ji.layer=Ji(Ki($h)),ji.filter=Ji(Ki(go)),ji.paintProperty=Ji(Ki(Vh)),ji.layoutProperty=Ji(Ki(Uh));const Ud={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class hs{constructor(e,r){this._globalState=r,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!==null&&e!==void 0?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none")return this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);const r=ns(e,Ud,this._globalState);if(r.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(r.value.map((a=>`${a.key}: ${a.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=r.value,this._globalStateRefs=Yn(r.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}const ps=we,Gr=ji,ds=Gr.light,Hh=Gr.sky,$d=Gr.paintProperty,Gd=Gr.layoutProperty;function yo(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new Ut(new Error(a.message))),r=!0;return r}class _o{constructor(e,r,a){const c=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const f=new Int32Array(this.arrayBuffer);e=f[0],this.d=(r=f[1])+2*(a=f[2]);for(let x=0;x<this.d*this.d;x++){const S=f[3+x],P=f[3+x+1];c.push(S===P?null:f.subarray(S,P))}const y=f[3+c.length+1];this.keys=f.subarray(f[3+c.length],y),this.bboxes=f.subarray(y),this.insert=this._insertReadonly}else{this.d=r+2*a;for(let f=0;f<this.d*this.d;f++)c.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=a,this.scale=r/e,this.uid=0;const p=a/r*e;this.min=-p,this.max=e+p}
vendor: 20,304 bytes, line 2
2insert(e,r,a,c,p){this._forEachCell(r,a,c,p,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(c),this.bboxes.push(p)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,a,c,p,f){this.cells[p].push(f)}query(e,r,a,c,p){const f=this.min,y=this.max;if(e<=f&&r<=f&&y<=a&&y<=c&&!p)return Array.prototype.slice.call(this.keys);{const x=[];return this._forEachCell(e,r,a,c,this._queryCell,x,{},p),x}}_queryCell(e,r,a,c,p,f,y,x){const S=this.cells[p];if(S!==null){const P=this.keys,E=this.bboxes;for(let k=0;k<S.length;k++){const z=S[k];if(y[z]===void 0){const F=4*z;(x?x(E[F+0],E[F+1],E[F+2],E[F+3]):e<=E[F+2]&&r<=E[F+3]&&a>=E[F+0]&&c>=E[F+1])?(y[z]=!0,f.push(P[z])):y[z]=!1}}}}_forEachCell(e,r,a,c,p,f,y,x){const S=this._convertToCellCoord(e),P=this._convertToCellCoord(r),E=this._convertToCellCoord(a),k=this._convertToCellCoord(c);for(let z=S;z<=E;z++)for(let F=P;F<=k;F++){const B=this.d*F+z;if((!x||x(this._convertFromCellCoord(z),this._convertFromCellCoord(F),this._convertFromCellCoord(z+1),this._convertFromCellCoord(F+1)))&&p.call(this,e,r,a,c,B,f,y,x))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let a=0;for(let f=0;f<this.cells.length;f++)a+=this.cells[f].length;const c=new Int32Array(r+a+this.keys.length+this.bboxes.length);c[0]=this.extent,c[1]=this.n,c[2]=this.padding;let p=r;for(let f=0;f<e.length;f++){const y=e[f];c[3+f]=p,c.set(y,p),p+=y.length}return c[3+e.length]=p,c.set(this.keys,p),p+=this.keys.length,c[3+e.length+1]=p,c.set(this.bboxes,p),p+=this.bboxes.length,c.buffer}static serialize(e,r){const a=e.toArrayBuffer();return r&&r.push(a),{buffer:a}}static deserialize(e){return new _o(e.buffer)}}const Qi={};function et(i,e,r={}){if(Qi[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),Qi[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}et("Object",Object),et("Set",Set),et("TransferableGridIndex",_o),et("Color",wt),et("Error",Error),et("AJAXError",de),et("ResolvedImage",Ei),et("StylePropertyFunction",vl),et("StyleExpression",jc,{omit:["_evaluator"]}),et("ZoomDependentExpression",Vc),et("ZoomConstantExpression",_l),et("CompoundExpression",Ni,{omit:["_evaluate"]});for(const i in ho)ho[i]._classRegistryKey||et(`Expression_${i}`,ho[i]);function Ml(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Yc(i){return i.$name||i.constructor._classRegistryKey}function vo(i){return!(function(e){if(e===null||typeof e!="object")return!1;const r=Yc(e);return!(!r||r==="Object")})(i)&&(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||Ml(i)||Gn(i)||ArrayBuffer.isView(i)||i instanceof ImageData)}function fs(i,e){if(vo(i))return(Ml(i)||Gn(i))&&e&&e.push(i),ArrayBuffer.isView(i)&&e&&e.push(i.buffer),i instanceof ImageData&&e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const p=[];for(const f of i)p.push(fs(f,e));return p}if(typeof i!="object")throw new Error("can't serialize object of type "+typeof i);const r=Yc(i);if(!r)throw new Error(`can't serialize object of unregistered class ${i.constructor.name}`);if(!Qi[r])throw new Error(`${r} is not registered.`);const{klass:a}=Qi[r],c=a.serialize?a.serialize(i,e):{};if(a.serialize){if(e&&c===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const p in i){if(!i.hasOwnProperty(p)||Qi[r].omit.indexOf(p)>=0)continue;const f=i[p];c[p]=Qi[r].shallow.indexOf(p)>=0?f:fs(f,e)}i instanceof Error&&(c.message=i.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(c.$name=r),c}function ms(i){if(vo(i))return i;if(Array.isArray(i))return i.map(ms);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);const e=Yc(i)||"Object";if(!Qi[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Qi[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const c of Object.keys(i)){if(c==="$name")continue;const p=i[c];a[c]=Qi[e].shallow.indexOf(c)>=0?p:ms(p)}return a}class Kc{constructor(){this.first=!0}update(e,r){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=r),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=a,!0))}}function gs(i){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(i))}function Jc(i){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]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\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\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(i))}function Xh(i){return/\s/u.test(String.fromCodePoint(i))}function xo(i){for(const e of i)if(Jc(e.codePointAt(0)))return!0;return!1}function qd(i){for(const e of i)if(!Yh(e.codePointAt(0)))return!1;return!0}function Il(i){const e=i.map((r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}})).filter((r=>r));return new RegExp(e.join("|"),"u")}const Pl=Il(["Arab","Dupl","Mong","Ougr","Syrc"]);function Yh(i){return!Pl.test(String.fromCodePoint(i))}function Qc(i){return!(Jc(i)||(e=i,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}const Kh=Il(["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 eu(i){return Kh.test(String.fromCodePoint(i))}function tu(i,e){return!(!e&&eu(i)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(i)))}function Jh(i){for(const e of i)if(eu(e.codePointAt(0)))return!0;return!1}const ea=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){if(ea.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(i,e){return s(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(i.pluginStatus!=="loading")return this.setState(i),i;const r=i.pluginURL,a=new Promise((p=>{this.loadScriptResolve=p}));e(r);const c=new Promise((p=>setTimeout((()=>p()),this.TIMEOUT)));if(yield Promise.race([a,c]),this.isParsed()){const p={pluginStatus:"loaded",pluginURL:r};return this.setState(p),p}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${r}`)}))}};class $t{constructor(e,r){this.isSupportedScript=Zd,this.zoom=e,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new Kc,this.transition=r.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Kc,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}function Zd(i){return(function(e,r){for(const a of e)if(!tu(a.codePointAt(0),r))return!1;return!0})(i,ea.getRTLTextPluginStatus()==="loaded")}const ys="-transition";class Al{constructor(e,r,a){this.property=e,this.value=r,this.expression=(function(c,p,f){if(yl(c))return new vl(c,p);if(mo(c)){const y=Uc(c,p,f);if(y.result==="error")throw new Error(y.value.map((x=>`${x.key}: ${x.message}`)).join(", "));return y.value}{let y=c;return p.type==="color"&&typeof c=="string"?y=wt.parse(c):p.type!=="padding"||typeof c!="number"&&!Array.isArray(c)?p.type!=="numberArray"||typeof c!="number"&&!Array.isArray(c)?p.type!=="colorArray"||typeof c!="string"&&!Array.isArray(c)?p.type==="variableAnchorOffsetCollection"&&Array.isArray(c)?y=mi.parse(c):p.type==="projectionDefinition"&&typeof c=="string"&&(y=gi.parse(c)):y=ht.parse(c):y=ur.parse(c):y=ii.parse(c),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>y}}})(r===void 0?e.specification.default:r,e.specification,a)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class El{constructor(e,r){this.property=e,this.value=new Al(e,void 0,r)}transitioned(e,r){return new Qh(this.property,this.value,r,hi({},e.transition,this.transition),e.now)}untransitioned(){return new Qh(this.property,this.value,null,{},0)}}class ru{constructor(e,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r}getValue(e){return Wi(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new El(this._values[e].property,this._globalState)),this._values[e].value=new Al(this._values[e].property,r===null?void 0:Wi(r),this._globalState)}getTransition(e){return Wi(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new El(this._values[e].property,this._globalState)),this._values[e].transition=Wi(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const c=this.getTransition(r);c!==void 0&&(e[`${r}${ys}`]=c)}return e}transitioned(e,r){const a=new ep(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].transitioned(e,r._values[c]);return a}untransitioned(){const e=new ep(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Qh{constructor(e,r,a,c,p){this.property=e,this.value=r,this.begin=p+c.delay||0,this.end=this.begin+c.duration||0,e.specification.transition&&(c.delay||c.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const c=e.now||0,p=this.value.possiblyEvaluate(e,r,a),f=this.prior;if(f){if(c>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(c<this.begin)return f.possiblyEvaluate(e,r,a);{const y=(c-this.begin)/(this.end-this.begin);return this.property.interpolate(f.possiblyEvaluate(e,r,a),p,Fo(y))}}return p}}class ep{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const c=new _s(this._properties);for(const p of Object.keys(this._values))c._values[p]=this._values[p].possiblyEvaluate(e,r,a);return c}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class tp{constructor(e,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r}hasValue(e){return this._values[e].value!==void 0}getValue(e){return Wi(this._values[e].value)}setValue(e,r){this._values[e]=new Al(this._values[e].property,r===null?void 0:Wi(r),this._globalState)}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const c=new _s(this._properties);for(const p of Object.keys(this._values))c._values[p]=this._values[p].possiblyEvaluate(e,r,a);return c}}class en{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,c){return this.property.evaluate(this.value,this.parameters,e,r,a,c)}}class _s{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class at{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const c=ar[this.specification.type];return c?c(e,r,a):e}}class lt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,c){return new en(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,c)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new en(this,{kind:"constant",value:void 0},e.parameters);const c=ar[this.specification.type];if(c){const p=c(e.value.value,r.value.value,a);return new en(this,{kind:"constant",value:p},e.parameters)}return e}evaluate(e,r,a,c,p,f){return e.kind==="constant"?e.value:e.evaluate(r,a,c,p,f)}}class vs extends lt{possiblyEvaluate(e,r,a,c){if(e.value===void 0)return new en(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,c),f=e.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,y=this._calculate(f,f,f,r);return new en(this,{kind:"constant",value:y},r)}if(e.expression.kind==="camera"){const p=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new en(this,{kind:"constant",value:p},r)}return new en(this,e.expression,r)}evaluate(e,r,a,c,p,f){if(e.kind==="source"){const y=e.evaluate(r,a,c,p,f);return this._calculate(y,y,y,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,c),e.evaluate({zoom:Math.floor(r.zoom)},a,c),e.evaluate({zoom:Math.floor(r.zoom)+1},a,c),r):e.value}_calculate(e,r,a,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Cl{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,c){if(e.value!==void 0){if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,c);return this._calculate(p,p,p,r)}return this._calculate(e.expression.evaluate(new $t(Math.floor(r.zoom-1),r)),e.expression.evaluate(new $t(Math.floor(r.zoom),r)),e.expression.evaluate(new $t(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class kl{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,c){return!!e.expression.evaluate(r,null,{},a,c)}interpolate(){return!1}}class _i{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new Al(a,void 0,void 0),p=this.defaultTransitionablePropertyValues[r]=new El(a,void 0);this.defaultTransitioningPropertyValues[r]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate({})}}}et("DataDrivenProperty",lt),et("DataConstantProperty",at),et("CrossFadedDataDrivenProperty",vs),et("CrossFadedProperty",Cl),et("ColorRampProperty",kl);class Vi extends Lt{constructor(e,r,a){if(super(),this.id=e.id,this.type=e.type,this._globalState=a,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(c,p){return new hs(c,p)})(this.visibility,a),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=as(e.filter,a)),r.layout&&(this._unevaluatedLayout=new tp(r.layout,a)),r.paint)){this._transitionablePaint=new ru(r.paint,a);for(const c in e.paint)this.setPaintProperty(c,e.paint[c],{validate:!1});for(const c in e.layout)this.setLayoutProperty(c,e.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _s(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=as(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){const e=new Set;for(const r of this._visibilityExpression.getGlobalStateRefs())e.add(r);if(this._unevaluatedLayout)for(const r in this._unevaluatedLayout._values){const a=this._unevaluatedLayout._values[r];for(const c of a.getGlobalStateRefs())e.add(c)}for(const r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}getPaintAffectingGlobalStateRefs(){var e;const r=new globalThis.Map;if(this._transitionablePaint)for(const a in this._transitionablePaint._values){const c=this._transitionablePaint._values[a].value;for(const p of c.getGlobalStateRefs()){const f=(e=r.get(p))!==null&&e!==void 0?e:[];f.push({name:a,value:c.value}),r.set(p,f)}}return r}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,r,a={}
2){if(r==null||!this._validate(Gd,`layers.${this.id}.layout.${e}`,e,r,a))return e==="visibility"?(this.visibility=r,this._visibilityExpression.setValue(r),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(ys)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate($d,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(ys))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const c=this._transitionablePaint._values[e],p=c.property.specification["property-type"]==="cross-faded-data-driven",f=c.value.isDataDriven(),y=c.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const x=this._transitionablePaint._values[e].value;return x.isDataDriven()||f||p||this._handleOverridablePaintPropertyUpdate(e,y,x)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e=this.minzoom,r=!1){return!!(this.minzoom&&e<(r?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}
vendor: 12,043 bytes, line 2
2serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Bo(e,((r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length)))}_validate(e,r,a,c,p={}){return(!p||p.validate!==!1)&&yo(this,e.call(Gr,{key:r,layerType:this.type,objectKey:a,value:c,styleSpec:we,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof en&&fo(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}let iu;var rp={get paint(){return iu=iu||new _i({"raster-opacity":new at(we.paint_raster["raster-opacity"]),"raster-hue-rotate":new at(we.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new at(we.paint_raster["raster-brightness-min"]),"raster-brightness-max":new at(we.paint_raster["raster-brightness-max"]),"raster-saturation":new at(we.paint_raster["raster-saturation"]),"raster-contrast":new at(we.paint_raster["raster-contrast"]),"raster-resampling":new at(we.paint_raster["raster-resampling"]),"raster-fade-duration":new at(we.paint_raster["raster-fade-duration"])})}};class Wd extends Vi{constructor(e,r){super(e,rp,r)}}const Hd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class xs{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class hr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function wr(i,e=1){let r=0,a=0;return{members:i.map((c=>{const p=Hd[c.type].BYTES_PER_ELEMENT,f=r=Ea(r,Math.max(e,p)),y=c.components||1;return a=Math.max(a,p),r+=p*y,{name:c.name,type:c.type,components:y,offset:f}})),size:Ea(r,Math.max(a,e)),alignment:e}}function Ea(i,e){return Math.ceil(i/e)*e}class bs extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const c=2*e;return this.int16[c+0]=r,this.int16[c+1]=a,e}}bs.prototype.bytesPerElement=4,et("StructArrayLayout2i4",bs);class Dl extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,a)}emplace(e,r,a,c){const p=3*e;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=c,e}}Dl.prototype.bytesPerElement=6,et("StructArrayLayout3i6",Dl);class nu extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,c)}emplace(e,r,a,c,p){const f=4*e;return this.int16[f+0]=r,this.int16[f+1]=a,this.int16[f+2]=c,this.int16[f+3]=p,e}}nu.prototype.bytesPerElement=8,et("StructArrayLayout4i8",nu);class zl extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f){const y=this.length;return this.resize(y+1),this.emplace(y,e,r,a,c,p,f)}emplace(e,r,a,c,p,f,y){const x=6*e;return this.int16[x+0]=r,this.int16[x+1]=a,this.int16[x+2]=c,this.int16[x+3]=p,this.int16[x+4]=f,this.int16[x+5]=y,e}}zl.prototype.bytesPerElement=12,et("StructArrayLayout2i4i12",zl);class au extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f){const y=this.length;return this.resize(y+1),this.emplace(y,e,r,a,c,p,f)}emplace(e,r,a,c,p,f,y){const x=4*e,S=8*e;return this.int16[x+0]=r,this.int16[x+1]=a,this.uint8[S+4]=c,this.uint8[S+5]=p,this.uint8[S+6]=f,this.uint8[S+7]=y,e}}au.prototype.bytesPerElement=8,et("StructArrayLayout2i4ub8",au);class ws extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const c=2*e;return this.float32[c+0]=r,this.float32[c+1]=a,e}}ws.prototype.bytesPerElement=8,et("StructArrayLayout2f8",ws);class Cn extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x,S,P){const E=this.length;return this.resize(E+1),this.emplace(E,e,r,a,c,p,f,y,x,S,P)}emplace(e,r,a,c,p,f,y,x,S,P,E){const k=10*e;return this.uint16[k+0]=r,this.uint16[k+1]=a,this.uint16[k+2]=c,this.uint16[k+3]=p,this.uint16[k+4]=f,this.uint16[k+5]=y,this.uint16[k+6]=x,this.uint16[k+7]=S,this.uint16[k+8]=P,this.uint16[k+9]=E,e}}Cn.prototype.bytesPerElement=20,et("StructArrayLayout10ui20",Cn);class Ll extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x){const S=this.length;return this.resize(S+1),this.emplace(S,e,r,a,c,p,f,y,x)}emplace(e,r,a,c,p,f,y,x,S){const P=8*e;return this.uint16[P+0]=r,this.uint16[P+1]=a,this.uint16[P+2]=c,this.uint16[P+3]=p,this.uint16[P+4]=f,this.uint16[P+5]=y,this.uint16[P+6]=x,this.uint16[P+7]=S,e}}Ll.prototype.bytesPerElement=16,et("StructArrayLayout8ui16",Ll);class Ts extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x,S,P,E,k){const z=this.length;return this.resize(z+1),this.emplace(z,e,r,a,c,p,f,y,x,S,P,E,k)}emplace(e,r,a,c,p,f,y,x,S,P,E,k,z){const F=12*e;return this.int16[F+0]=r,this.int16[F+1]=a,this.int16[F+2]=c,this.int16[F+3]=p,this.uint16[F+4]=f,this.uint16[F+5]=y,this.uint16[F+6]=x,this.uint16[F+7]=S,this.int16[F+8]=P,this.int16[F+9]=E,this.int16[F+10]=k,this.int16[F+11]=z,e}}Ts.prototype.bytesPerElement=24,et("StructArrayLayout4i4ui4i24",Ts);class Rl extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,a)}emplace(e,r,a,c){const p=3*e;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=c,e}}Rl.prototype.bytesPerElement=12,et("StructArrayLayout3f12",Rl);class Ss extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Ss.prototype.bytesPerElement=4,et("StructArrayLayout1ul4",Ss);class ou extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x,S){const P=this.length;return this.resize(P+1),this.emplace(P,e,r,a,c,p,f,y,x,S)}emplace(e,r,a,c,p,f,y,x,S,P){const E=10*e,k=5*e;return this.int16[E+0]=r,this.int16[E+1]=a,this.int16[E+2]=c,this.int16[E+3]=p,this.int16[E+4]=f,this.int16[E+5]=y,this.uint32[k+3]=x,this.uint16[E+8]=S,this.uint16[E+9]=P,e}}ou.prototype.bytesPerElement=20,et("StructArrayLayout6i1ul2ui20",ou);class bo extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f){const y=this.length;return this.resize(y+1),this.emplace(y,e,r,a,c,p,f)}emplace(e,r,a,c,p,f,y){const x=6*e;return this.int16[x+0]=r,this.int16[x+1]=a,this.int16[x+2]=c,this.int16[x+3]=p,this.int16[x+4]=f,this.int16[x+5]=y,e}}bo.prototype.bytesPerElement=12,et("StructArrayLayout2i2i2i12",bo);class Ca extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,c,p)}emplace(e,r,a,c,p,f){const y=4*e,x=8*e;return this.float32[y+0]=r,this.float32[y+1]=a,this.float32[y+2]=c,this.int16[x+6]=p,this.int16[x+7]=f,e}}Ca.prototype.bytesPerElement=16,et("StructArrayLayout2f1f2i16",Ca);class su extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f){const y=this.length;return this.resize(y+1),this.emplace(y,e,r,a,c,p,f)}emplace(e,r,a,c,p,f,y){const x=16*e,S=4*e,P=8*e;return this.uint8[x+0]=r,this.uint8[x+1]=a,this.float32[S+1]=c,this.float32[S+2]=p,this.int16[P+6]=f,this.int16[P+7]=y,e}}su.prototype.bytesPerElement=16,et("StructArrayLayout2ub2f2i16",su);class Ms extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,a)}emplace(e,r,a,c){const p=3*e;return this.uint16[p+0]=r,this.uint16[p+1]=a,this.uint16[p+2]=c,e}}Ms.prototype.bytesPerElement=6,et("StructArrayLayout3ui6",Ms);class ka extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G)}emplace(e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G,Q){const q=24*e,H=12*e,te=48*e;return this.int16[q+0]=r,this.int16[q+1]=a,this.uint16[q+2]=c,this.uint16[q+3]=p,this.uint32[H+2]=f,this.uint32[H+3]=y,this.uint32[H+4]=x,this.uint16[q+10]=S,this.uint16[q+11]=P,this.uint16[q+12]=E,this.float32[H+7]=k,this.float32[H+8]=z,this.uint8[te+36]=F,this.uint8[te+37]=B,this.uint8[te+38]=j,this.uint32[H+10]=G,this.int16[q+22]=Q,e}}ka.prototype.bytesPerElement=48,et("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ka);class lu extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G,Q,q,H,te,ae,_e,De,Ee,Le,Ge,Be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G,Q,q,H,te,ae,_e,De,Ee,Le,Ge,Be)}emplace(e,r,a,c,p,f,y,x,S,P,E,k,z,F,B,j,G,Q,q,H,te,ae,_e,De,Ee,Le,Ge,Be,Ce){const Ie=32*e,Qe=16*e;return this.int16[Ie+0]=r,this.int16[Ie+1]=a,this.int16[Ie+2]=c,this.int16[Ie+3]=p,this.int16[Ie+4]=f,this.int16[Ie+5]=y,this.int16[Ie+6]=x,this.int16[Ie+7]=S,this.uint16[Ie+8]=P,this.uint16[Ie+9]=E,this.uint16[Ie+10]=k,this.uint16[Ie+11]=z,this.uint16[Ie+12]=F,this.uint16[Ie+13]=B,this.uint16[Ie+14]=j,this.uint16[Ie+15]=G,this.uint16[Ie+16]=
vendor: 5,378 bytes, line 2
2Q,this.uint16[Ie+17]=q,this.uint16[Ie+18]=H,this.uint16[Ie+19]=te,this.uint16[Ie+20]=ae,this.uint16[Ie+21]=_e,this.uint16[Ie+22]=De,this.uint32[Qe+12]=Ee,this.float32[Qe+13]=Le,this.float32[Qe+14]=Ge,this.uint16[Ie+30]=Be,this.uint16[Ie+31]=Ce,e}}lu.prototype.bytesPerElement=64,et("StructArrayLayout8i15ui1ul2f2ui64",lu);class Fl extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}Fl.prototype.bytesPerElement=4,et("StructArrayLayout1f4",Fl);class Bl extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,a)}emplace(e,r,a,c){const p=3*e;return this.uint16[6*e+0]=r,this.float32[p+1]=a,this.float32[p+2]=c,e}}Bl.prototype.bytesPerElement=12,et("StructArrayLayout1ui2f12",Bl);class cu extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,e,r,a)}emplace(e,r,a,c){const p=4*e;return this.uint32[2*e+0]=r,this.uint16[p+2]=a,this.uint16[p+3]=c,e}}cu.prototype.bytesPerElement=8,et("StructArrayLayout1ul2ui8",cu);class m extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const c=2*e;return this.uint16[c+0]=r,this.uint16[c+1]=a,e}}m.prototype.bytesPerElement=4,et("StructArrayLayout2ui4",m);class t extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}t.prototype.bytesPerElement=2,et("StructArrayLayout1ui2",t);class n extends hr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,c){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,c)}emplace(e,r,a,c,p){const f=4*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=c,this.float32[f+3]=p,e}}n.prototype.bytesPerElement=16,et("StructArrayLayout4f16",n);class l extends xs{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 D(this.anchorPointX,this.anchorPointY)}}l.prototype.size=20;class h extends ou{get(e){return new l(this,e)}}et("CollisionBoxArray",h);class g extends xs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}g.prototype.size=48;class _ extends ka{get(e){return new g(this,e)}}et("PlacedSymbolArray",_);class T extends xs{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]}
vendor: 85,940 bytes, line 2
2get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}T.prototype.size=64;class I extends lu{get(e){return new T(this,e)}}et("SymbolInstanceArray",I);class A extends Fl{getoffsetX(e){return this.float32[1*e+0]}}et("GlyphOffsetArray",A);class C extends Dl{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}et("SymbolLineVertexArray",C);class R extends xs{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]}}R.prototype.size=12;class L extends Bl{get(e){return new R(this,e)}}et("TextAnchorOffsetArray",L);class O extends xs{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]}}O.prototype.size=8;class $ extends cu{get(e){return new O(this,e)}}et("FeatureIndexArray",$);class X extends bs{}class K extends bs{}class Y extends bs{}class ee extends zl{}class oe extends au{}class J extends ws{}class ne extends Cn{}class ce extends Ll{}class ie extends Ts{}class fe extends Rl{}class Ae extends Ss{}class be extends bo{}class Te extends su{}class Se extends Ms{}class Ve extends m{}const Ue=wr([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fe}=Ue;class Ze{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,a,c){const p=this.segments[this.segments.length-1];return e>Ze.MAX_VERTEX_ARRAY_LENGTH&&$r(`Max vertices per segment is ${Ze.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Ze.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!p||p.vertexLength+e>Ze.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==c?this.createNewSegment(r,a,c):p}createNewSegment(e,r,a){const c={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return a!==void 0&&(c.sortKey=a),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(c),c}getOrCreateLatestSegment(e,r,a){return this.prepareSegment(0,e,r,a)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,c){return new Ze([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:c,vaos:{},sortKey:0}])}}function gt(i,e){return 256*(i=qi(Math.floor(i),0,255))+qi(Math.floor(e),0,255)}Ze.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,et("SegmentVector",Ze);const Nt=wr([{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"}]),ir=wr([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var Xt,or,Yt,yr={exports:{}},sr={exports:{}},qr={exports:{}},kr=(function(){if(Yt)return yr.exports;Yt=1;var i=(Xt||(Xt=1,sr.exports=function(r,a){var c,p,f,y,x,S,P,E;for(p=r.length-(c=3&r.length),f=a,x=3432918353,S=461845907,E=0;E<p;)P=255&r.charCodeAt(E)|(255&r.charCodeAt(++E))<<8|(255&r.charCodeAt(++E))<<16|(255&r.charCodeAt(++E))<<24,++E,f=27492+(65535&(y=5*(65535&(f=(f^=P=(65535&(P=(P=(65535&P)*x+(((P>>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&65535)<<16)&4294967295)<<13|f>>>19))+((5*(f>>>16)&65535)<<16)&4294967295))+((58964+(y>>>16)&65535)<<16);switch(P=0,c){case 3:P^=(255&r.charCodeAt(E+2))<<16;case 2:P^=(255&r.charCodeAt(E+1))<<8;case 1:f^=P=(65535&(P=(P=(65535&(P^=255&r.charCodeAt(E)))*x+(((P>>>16)*x&65535)<<16)&4294967295)<<15|P>>>17))*S+(((P>>>16)*S&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}),sr.exports),e=(or||(or=1,qr.exports=function(r,a){for(var c,p=r.length,f=a^p,y=0;p>=4;)c=1540483477*(65535&(c=255&r.charCodeAt(y)|(255&r.charCodeAt(++y))<<8|(255&r.charCodeAt(++y))<<16|(255&r.charCodeAt(++y))<<24))+((1540483477*(c>>>16)&65535)<<16),f=1540483477*(65535&f)+((1540483477*(f>>>16)&65535)<<16)^(c=1540483477*(65535&(c^=c>>>24))+((1540483477*(c>>>16)&65535)<<16)),p-=4,++y;switch(p){case 3:f^=(255&r.charCodeAt(y+2))<<16;case 2:f^=(255&r.charCodeAt(y+1))<<8;case 1:f=1540483477*(65535&(f^=255&r.charCodeAt(y)))+((1540483477*(f>>>16)&65535)<<16)}return f=1540483477*(65535&(f^=f>>>13))+((1540483477*(f>>>16)&65535)<<16),(f^=f>>>15)>>>0}),qr.exports);return yr.exports=i,yr.exports.murmur3=i,yr.exports.murmur2=e,yr.exports})(),Tr=N(kr);class ei{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,c){this.ids.push(ta(e)),this.positions.push(r,a,c)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=ta(e);let a=0,c=this.ids.length-1;for(;a<c;){const f=a+c>>1;this.ids[f]>=r?c=f:a=f+1}const p=[];for(;this.ids[a]===r;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(e,r){const a=new Float64Array(e.ids),c=new Uint32Array(e.positions);return kn(a,c,0,a.length-1),r&&r.push(a.buffer,c.buffer),{ids:a,positions:c}}static deserialize(e){const r=new ei;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function ta(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Tr(String(i))}function kn(i,e,r,a){for(;r<a;){const c=i[r+a>>1];let p=r-1,f=a+1;for(;;){do p++;while(i[p]<c);do f--;while(i[f]>c);if(p>=f)break;_n(i,p,f),_n(e,3*p,3*f),_n(e,3*p+1,3*f+1),_n(e,3*p+2,3*f+2)}f-r<a-f?(kn(i,e,r,f),r=f+1):(kn(i,e,f+1,a),a=f)}}function _n(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}et("FeaturePositionMap",ei);class Mi{constructor(e,r){this.gl=e.gl,this.location=r}}class Da extends Mi{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Is extends Mi{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class za extends Mi{constructor(e,r){super(e,r),this.current=wt.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Ui=new Float32Array(16);function vn(i){return[gt(255*i.r,255*i.g),gt(255*i.b,255*i.a)]}class tn{constructor(e,r,a){this.value=e,this.uniformNames=r.map((c=>`u_${c}`)),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new za(e,r):new Da(e,r)}}class rn{constructor(e,r){this.uniformNames=r.map((a=>`u_${a}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,r){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(e,r,a,c){let p=null;c==="u_pattern_to"?p=this.patternTo:c==="u_pattern_from"?p=this.patternFrom:c==="u_dasharray_to"?p=this.dashTo:c==="u_dasharray_from"?p=this.dashFrom:c==="u_pixel_ratio_to"?p=this.pixelRatioTo:c==="u_pixel_ratio_from"&&(p=this.pixelRatioFrom),p!==null&&e.set(p)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"||a.substr(0,12)==="u_dasharray_"?new Is(e,r):new Da(e,r)}}class er{constructor(e,r,a,c){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map((p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0}))),this.paintVertexArray=new c}populatePaintArray(e,r,a){const c=this.paintVertexArray.length,p=this.expression.evaluate(new $t(0,a),r,{},a.canonical,[],a.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(c,e,p)}updatePaintArray(e,r,a,c,p){const f=this.expression.evaluate(new $t(0,p),a,c);this._setPaintValue(e,r,f)}_setPaintValue(e,r,a){if(this.type==="color"){const c=vn(a);for(let p=e;p<r;p++)this.paintVertexArray.emplace(p,c[0],c[1])}else{for(let c=e;c<r;c++)this.paintVertexArray.emplace(c,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Kt{constructor(e,r,a,c,p,f){this.expression=e,this.uniformNames=r.map((y=>`u_${y}_t`)),this.type=a,this.useIntegerZoom=c,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=r.map((y=>({name:`a_${y}`,type:"Float32",components:a==="color"?4:2,offset:0}))),this.paintVertexArray=new f}populatePaintArray(e,r,a){const c=this.expression.evaluate(new $t(this.zoom,a),r,{},a.canonical,[],a.formattedSection),p=this.expression.evaluate(new $t(this.zoom+1,a),r,{},a.canonical,[],a.formattedSection),f=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(f,e,c,p)}updatePaintArray(e,r,a,c,p){const f=this.expression.evaluate(new $t(this.zoom,p),a,c),y=this.expression.evaluate(new $t(this.zoom+1,p),a,c);this._setPaintValue(e,r,f,y)}_setPaintValue(e,r,a,c){if(this.type==="color"){const p=vn(a),f=vn(c);for(let y=e;y<r;y++)this.paintVertexArray.emplace(y,p[0],p[1],f[0],f[1])}else{for(let p=e;p<r;p++)this.paintVertexArray.emplace(p,a,c);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(c))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){const a=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,c=qi(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);e.set(c)}getBinding(e,r,a){return new Da(e,r)}}class jr{constructor(e,r,a,c,p,f){this.expression=e,this.type=r,this.useIntegerZoom=a,this.zoom=c,this.layerId=f,this.zoomInPaintVertexArray=new p,this.zoomOutPaintVertexArray=new p}populatePaintArray(e,r,a){const c=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(c,e,this.getPositionIds(r),a)}updatePaintArray(e,r,a,c,p){this._setPaintValues(e,r,this.getPositionIds(a),p)}_setPaintValues(e,r,a,c){const p=this.getPositions(c);if(!p||!a)return;const f=p[a.min],y=p[a.mid],x=p[a.max];if(f&&y&&x)for(let S=e;S<r;S++)this.emplace(this.zoomInPaintVertexArray,S,y,f),this.emplace(this.zoomOutPaintVertexArray,S,y,x)}upload(e){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){const r=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,r,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,r,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Vr extends jr{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns&&e.patterns[this.layerId]}getVertexAttributes(){return Nt.members}emplace(e,r,a,c){e.emplace(r,a.tlbr[0],a.tlbr[1],a.tlbr[2],a.tlbr[3],c.tlbr[0],c.tlbr[1],c.tlbr[2],c.tlbr[3],a.pixelRatio,c.pixelRatio)}}class ip extends jr{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes&&e.dashes[this.layerId]}getVertexAttributes(){return ir.members}emplace(e,r,a,c){e.emplace(r,0,a.y,a.height,a.width,0,c.y,c.height,c.width)}}class np{constructor(e,r,a){this.binders={},this._buffers=[];const c=[];for(const p in e.paint._values){if(!a(p))continue;const f=e.paint.get(p);if(!(f instanceof en&&fo(f.property.specification)))continue;const y=Xd(p,e.type),x=f.value,S=f.property.specification.type,P=f.property.useIntegerZoom,E=f.property.specification["property-type"],k=E==="cross-faded"||E==="cross-faded-data-driven";if(x.kind==="constant")this.binders[p]=k?new rn(x.value,y):new tn(x.value,y,S),c.push(`/u_${p}`);else if(x.kind==="source"||k){const z=ap(p,S,"source");this.binders[p]=k?p==="line-dasharray"?new ip(x,S,P,r,z,e.id):new Vr(x,S,P,r,z,e.id):new er(x,y,S,z),c.push(`/a_${p}`)}else{const z=ap(p,S,"composite");this.binders[p]=new Kt(x,y,S,P,r,z),c.push(`/z_${p}`)}}this.cacheKey=c.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof er||r instanceof Kt?r.maxValue:0}populatePaintArrays(e,r,a){for(const c in this.binders){const p=this.binders[c];(p instanceof er||p instanceof Kt||p instanceof jr)&&p.populatePaintArray(e,r,a)}}setConstantPatternPositions(e,r){for(const a in this.binders){const c=this.binders[a];c instanceof rn&&c.setConstantPatternPositions(e,r)}}setConstantDashPositions(e,r){for(const a in this.binders){const c=this.binders[a];c instanceof rn&&c.setConstantDashPositions(e,r)}}updatePaintArrays(e,r,a,c,p){let f=!1;for(const y in e){const x=r.getPositions(y);for(const S of x){const P=a.feature(S.index);for(const E in this.binders){const k=this.binders[E];if((k instanceof er||k instanceof Kt||k instanceof jr)&&k.expression.isStateDependent===!0){const z=c.paint.get(E);k.expression=z.value,k.updatePaintArray(S.start,S.end,P,e[y],p),f=!0}}}}return f}defines(){const e=[];for(const r in this.binders){const a=this.binders[r];(a instanceof tn||a instanceof rn)&&e.push(...a.uniformNames.map((c=>`#define HAS_UNIFORM_${c}`)))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof er||a instanceof Kt)for(let c=0;c<a.paintVertexAttributes.length;c++)e.push(a.paintVertexAttributes[c].name);else if(a instanceof jr){const c=a.getVertexAttributes();for(const p of c)e.push(p.name)}}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof tn||a instanceof rn||a instanceof Kt)for(const c of a.uniformNames)e.push(c)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){const a=[];for(const c in this.binders){const p=this.binders[c];if(p instanceof tn||p instanceof rn||p instanceof Kt){for(const f of p.uniformNames)if(r[f]){const y=p.getBinding(e,r[f],f);a.push({name:f,property:c,binding:y})}}}return a}setUniforms(e,r,a,c){for(const{name:p,property:f,binding:y}of r)this.binders[f].setUniform(y,c,a.get(f),p)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const a=this.binders[r];if(e&&a instanceof jr){const c=e.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;c&&this._buffers.push(c)}else(a instanceof er||a instanceof Kt)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(e){for(const r in this.binders){const a=this.binders[r];(a instanceof er||a instanceof Kt||a instanceof jr)&&a.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof er||r instanceof Kt||r instanceof jr)&&r.destroy()}}}class La{constructor(e,r,a=()=>!0){this.programConfigurations={};for(const c of e)this.programConfigurations[c.id]=new np(c,r,a);this.needsUpload=!1,this._featureMap=new ei,this._bufferOffset=0}populatePaintArrays(e,r,a,c){for(const p in this.programConfigurations)this.programConfigurations[p].populatePaintArrays(e,r,c);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,c){for(const p of a)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(e,this._featureMap,r,p,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Xd(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function ap(i,e,r){const a={color:{source:ws,composite:n},number:{source:Fl,composite:ws}},c=(function(p){return{"line-pattern":{source:ne,composite:ne},"fill-pattern":{source:ne,composite:ne},"fill-extrusion-pattern":{source:ne,composite:ne},"line-dasharray":{source:ce,composite:ce}}[p]})(i);return c&&c[r]||a[e][r]}et("ConstantBinder",tn),et("CrossFadedConstantBinder",rn),et("SourceExpressionBinder",er),et("CrossFadedPatternBinder",Vr),et("CrossFadedDasharrayBinder",ip),et("CompositeExpressionBinder",Kt),et("ProgramConfiguration",np,{omit:["_buffers"]}),et("ProgramConfigurationSet",La);const uu=Math.pow(2,14)-1,ra=-uu-1;function ia(i){const e=Ot/i.extent,r=i.loadGeometry();for(let a=0;a<r.length;a++){const c=r[a];for(let p=0;p<c.length;p++){const f=c[p],y=Math.round(f.x*e),x=Math.round(f.y*e);f.x=qi(y,ra,uu),f.y=qi(x,ra,uu),(y<f.x||y>f.x+1||x<f.y||x>f.y+1)&&$r("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function na(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ia(i):[]}}const hu=-32768;function pu(i,e,r,a,c){i.emplaceBack(hu+8*e+a,hu+8*r+c)}class Ol{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new K,this.indexArray=new Se,this.segments=new Ze,this.programConfigurations=new La(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){const c=this.layers[0],p=[];let f=null,y=!1,x=c.type==="heatmap";if(c.type==="circle"){const P=c;f=P.layout.get("circle-sort-key"),y=!f.isConstant(),x=x||P.paint.get("circle-pitch-alignment")==="map"}const S=x?r.subdivisionGranularity.circle:1;for(const{feature:P,id:E,index:k,sourceLayerIndex:z}of e){const F=this.layers[0]._featureFilter.needGeometry,B=na(P,F);if(!this.layers[0]._featureFilter.filter(new $t(this.zoom),B,a))continue;const j=y?f.evaluate(B,{},a):void 0,G={id:E,properties:P.properties,type:P.type,sourceLayerIndex:z,index:k,geometry:F?B.geometry:ia(P),patterns:{},sortKey:j};p.push(G)}y&&p.sort(((P,E)=>P.sortKey-E.sortKey));for(const P of p){const{geometry:E,index:k,sourceLayerIndex:z}=P,F=e[k].feature;this.addFeature(P,E,k,a,S),r.featureIndex.insert(F,E,k,z,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:a})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fe),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,a,c,p=1){let f;switch(p){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: ${p}; valid values are 1, 3, 5, 7.`)}const y=f.length;for(const x of r)for(const S of x){const P=S.x,E=S.y;if(P<0||P>=Ot||E<0||E>=Ot)continue;const k=this.segments.prepareSegment(y*y,this.layoutVertexArray,this.indexArray,e.sortKey),z=k.vertexLength;for(let F=0;F<y;F++)for(let B=0;B<y;B++)pu(this.layoutVertexArray,P,E,f[B],f[F]);for(let F=0;F<y-1;F++)for(let B=0;B<y-1;B++){const j=z+F*y+B,G=z+(F+1)*y+B;this.indexArray.emplaceBack(j,G+1,j+1),this.indexArray.emplaceBack(j,G,G+1)}k.vertexLength+=y*y,k.primitiveLength+=(y-1)*(y-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:{},canonical:c})}}function Nl(i,e){for(let r=0;r<i.length;r++)if(jl(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(jl(i,e[r]))return!0;return!!Yd(i,e)}function op(i,e,r){return!!jl(i,e)||!!Kd(e,i,r)}function lg(i,e){if(i.length===1)return ug(e,i[0]);for(let r=0;r<e.length;r++){const a=e[r];for(let c=0;c<a.length;c++)if(jl(i,a[c]))return!0}for(let r=0;r<i.length;r++)if(ug(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Yd(i,e[r]))return!0;return!1}function ix(i,e,r){if(i.length>1){if(Yd(i,e))return!0;for(let a=0;a<e.length;a++)if(Kd(e[a],i,r))return!0}for(let a=0;a<i.length;a++)if(Kd(i[a],e,r))return!0;return!1}function Yd(i,e){if(i.length===0||e.length===0)return!1;for(let r=0;r<i.length-1;r++){const a=i[r],c=i[r+1];for(let p=0;p<e.length-1;p++)if(nx(a,c,e[p],e[p+1]))return!0}return!1}function nx(i,e,r,a){return Fi(i,r,a)!==Fi(e,r,a)&&Fi(i,e,r)!==Fi(i,e,a)}function Kd(i,e,r){const a=r*r;if(e.length===1)return i.distSqr(e[0])<a;for(let c=1;c<e.length;c++)if(cg(i,e[c-1],e[c])<a)return!0;return!1}function cg(i,e,r){const a=e.distSqr(r);if(a===0)return i.distSqr(e);const c=((i.x-e.x)*(r.x-e.x)+(i.y-e.y)*(r.y-e.y))/a;return i.distSqr(c<0?e:c>1?r:r.sub(e)._mult(c)._add(e))}function ug(i,e){let r,a,c,p=!1;for(let f=0;f<i.length;f++){r=i[f];for(let y=0,x=r.length-1;y<r.length;x=y++)a=r[y],c=r[x],a.y>e.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(p=!p)}return p}function jl(i,e){let r=!1;for(let a=0,c=i.length-1;a<i.length;c=a++){const p=i[a],f=i[c];p.y>e.y!=f.y>e.y&&e.x<(f.x-p.x)*(e.y-p.y)/(f.y-p.y)+p.x&&(r=!r)}return r}function ax(i,e,r){const a=r[0],c=r[2];if(i.x<a.x&&e.x<a.x||i.x>c.x&&e.x>c.x||i.y<a.y&&e.y<a.y||i.y>c.y&&e.y>c.y)return!1;const p=Fi(i,e,r[0]);return p!==Fi(i,e,r[1])||p!==Fi(i,e,r[2])||p!==Fi(i,e,r[3])}function Vl(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function sp(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function lp(i,e,r,a,c){if(!e[0]&&!e[1])return i;const p=D.convert(e)._mult(c);r==="viewport"&&p._rotate(-a);const f=[];for(let y=0;y<i.length;y++)f.push(i[y].sub(p));return f}function ox(i){const e=[];for(let r=0;r<i.length;r++){const a=i[r],c=e.at(-1);(r===0||c&&!a.equals(c))&&e.push(a)}return e}function sx({queryGeometry:i,size:e},r){return op(i,r,e)}function lx({queryGeometry:i,size:e,transform:r,unwrappedTileID:a,getElevation:c},p){return op(i,p,e*(r.projectTileCoordinates(p.x,p.y,a,c).signedDistanceFromCamera/r.cameraToCenterDistance))}function cx({queryGeometry:i,size:e,transform:r,unwrappedTileID:a,getElevation:c},p){const f=r.projectTileCoordinates(p.x,p.y,a,c).signedDistanceFromCamera,y=e*(r.cameraToCenterDistance/f);return op(i,Jd(p,r,a,c),y)}function ux({queryGeometry:i,size:e,transform:r,unwrappedTileID:a,getElevation:c},p){return op(i,Jd(p,r,a,c),e)}function hg({queryGeometry:i,size:e,transform:r,unwrappedTileID:a,getElevation:c,pitchAlignment:p="map",pitchScale:f="map"},y){const x=p==="map"?f==="map"?sx:lx:f==="map"?cx:ux,S={queryGeometry:i,size:e,transform:r,unwrappedTileID:a,getElevation:c};for(const P of y)for(const E of P)if(x(S,E))return!0;return!1}function Jd(i,e,r,a){const c=e.projectTileCoordinates(i.x,i.y,r,a).point;return new D((.5*c.x+.5)*e.width,(.5*-c.y+.5)*e.height)}let pg,dg;et("CircleBucket",Ol,{omit:["layers"]});var hx={get paint(){return dg=dg||new _i({"circle-radius":new lt(we.paint_circle["circle-radius"]),"circle-color":new lt(we.paint_circle["circle-color"]),"circle-blur":new lt(we.paint_circle["circle-blur"]),"circle-opacity":new lt(we.paint_circle["circle-opacity"]),"circle-translate":new at(we.paint_circle["circle-translate"]),"circle-translate-anchor":new at(we.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new at(we.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new at(we.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new lt(we.paint_circle["circle-stroke-width"]),"circle-stroke-color":new lt(we.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new lt(we.paint_circle["circle-stroke-opacity"])})},get layout(){return pg=pg||new _i({"circle-sort-key":new lt(we.layout_circle["circle-sort-key"])})}};class px extends Vi{constructor(e,r){super(e,hx,r)}createBucket(e){return new Ol(e)}queryRadius(e){const r=e;return Vl("circle-radius",this,r)+Vl("circle-stroke-width",this,r)+sp(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:a,geometry:c,transform:p,pixelsToTileUnits:f,unwrappedTileID:y,getElevation:x}){const S=lp(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-p.bearingInRadians,f),P=this.paint.get("circle-radius").evaluate(r,a)+this.paint.get("circle-stroke-width").evaluate(r,a),E=this.paint.get("circle-pitch-scale"),k=this.paint.get("circle-pitch-alignment");let z,F;return k==="map"?(z=S,F=P*f):(z=(function(B,j,G,Q){return B.map((q=>Jd(q,j,G,Q)))})(S,p,y,x),F=P),hg({queryGeometry:z,size:F,transform:p,unwrappedTileID:y,getElevation:x,pitchAlignment:k,pitchScale:E},c)}}class fg extends Ol{}let mg;et("HeatmapBucket",fg,{omit:["layers"]});var dx={get paint(){return mg=mg||new _i({"heatmap-radius":new lt(we.paint_heatmap["heatmap-radius"]),"heatmap-weight":new lt(we.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new at(we.paint_heatmap["heatmap-intensity"]),"heatmap-color":new kl(we.paint_heatmap["heatmap-color"]),"heatmap-opacity":new at(we.paint_heatmap["heatmap-opacity"])})}};function Qd(i,{width:e,height:r},a,c){if(c){if(c instanceof Uint8ClampedArray)c=new Uint8Array(c.buffer);else if(c.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${c.length} but got: ${e*r*a}`)}else c=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=c,i}function gg(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const c=Qd({},{width:e,height:r},a);ef(i,c,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=c.data}function ef(i,e,r,a,c,p){if(c.width===0||c.height===0)return e;if(c.width>i.width||c.height>i.height||r.x>i.width-c.width||r.y>i.height-c.height)throw new RangeError("out of range source coordinates for image copy");if(c.width>e.width||c.height>e.height||a.x>e.width-c.width||a.y>e.height-c.height)throw new RangeError("out of range destination coordinates for image copy");const f=i.data,y=e.data;if(f===y)throw new Error("srcData equals dstData, so image is already copied");for(let x=0;x<c.height;x++){const S=((r.y+x)*i.width+r.x)*p,P=((a.y+x)*e.width+a.x)*p;for(let E=0;E<c.width*p;E++)y[P+E]=f[S+E]}return e}class du{constructor(e,r){Qd(this,e,1,r)}resize(e){gg(this,e,1)}clone(){return new du({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,c,p){ef(e,r,a,c,p,1)}}class ki{constructor(e,r){Qd(this,e,4,r)}resize(e){gg(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new ki({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,c,p){ef(e,r,a,c,p,4)}setPixel(e,r,a){const c=4*(e*this.width+r);this.data[c+0]=Math.round(255*a.r/a.a),this.data[c+1]=Math.round(255*a.g/a.a),this.data[c+2]=Math.round(255*a.b/a.a),this.data[c+3]=Math.round(255*a.a)}}function yg(i){const e={},r=i.resolution||256,a=i.clips?i.clips.length:1,c=i.image||new ki({width:r,height:a});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const p=(f,y,x)=>{e[i.evaluationKey]=x;const S=i.expression.evaluate(e);c.setPixel(f/4/r,y/4,S)};if(i.clips)for(let f=0,y=0;f<a;++f,y+=4*r)for(let x=0,S=0;x<r;x++,S+=4){const P=x/(r-1),{start:E,end:k}=i.clips[f];p(y,S,E*(1-P)+k*P)}else for(let f=0,y=0;f<r;f++,y+=4)p(0,y,f/(r-1));return c}et("AlphaImage",du),et("RGBAImage",ki);const tf="big-fb";class fx extends Vi{createBucket(e){return new fg(e)}constructor(e,r){super(e,dx,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=yg({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(tf)&&this.heatmapFbos.delete(tf)}queryRadius(e){return Vl("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:a,geometry:c,transform:p,pixelsToTileUnits:f,unwrappedTileID:y,getElevation:x}){return hg({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(r,a)*f,transform:p,unwrappedTileID:y,getElevation:x},c)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let _g;var mx={get paint(){return _g=_g||new _i({"hillshade-illumination-direction":new at(we.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new at(we.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new at(we.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new at(we.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new at(we.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new at(we.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new at(we.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new at(we.paint_hillshade["hillshade-method"])})}};class gx extends Vi{constructor(e,r){super(e,mx,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,a=this.paint.get("hillshade-highlight-color").values,c=this.paint.get("hillshade-shadow-color").values;const p=Math.max(e.length,r.length,a.length,c.length);e=e.concat(Array(p-e.length).fill(e.at(-1))),r=r.concat(Array(p-r.length).fill(r.at(-1))),a=a.concat(Array(p-a.length).fill(a.at(-1))),c=c.concat(Array(p-c.length).fill(c.at(-1)));const f=r.map(Ha);return{directionRadians:e.map(Ha),altitudeRadians:f,shadowColor:c,highlightColor:a}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let vg;var yx={get paint(){return vg=vg||new _i({"color-relief-opacity":new at(we["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new kl(we["paint_color-relief"]["color-relief-color"])})}};class rf{constructor(e,r,a,c){this.context=e,this.format=a,this.texture=e.gl.createTexture(),this.update(r,c)}update(e,r,a){const{width:c,height:p}=e,f=!(this.size&&this.size[0]===c&&this.size[1]===p||a),{context:y}=this,{gl:x}=y;if(this.useMipmap=!!(r&&r.useMipmap),x.bindTexture(x.TEXTURE_2D,this.texture),y.pixelStoreUnpackFlipY.set(!1),y.pixelStoreUnpack.set(1),y.pixelStoreUnpackPremultiplyAlpha.set(this.format===x.RGBA&&(!r||r.premultiply!==!1)),f)this.size=[c,p],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Gn(e)?x.texImage2D(x.TEXTURE_2D,0,this.format,this.format,x.UNSIGNED_BYTE,e):x.texImage2D(x.TEXTURE_2D,0,this.format,c,p,0,this.format,x.UNSIGNED_BYTE,e.data);else{const{x:S,y:P}=a||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Gn(e)?x.texSubImage2D(x.TEXTURE_2D,0,S,P,x.RGBA,x.UNSIGNED_BYTE,e):x.texSubImage2D(x.TEXTURE_2D,0,S,P,c,p,x.RGBA,x.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&x.generateMipmap(x.TEXTURE_2D),y.pixelStoreUnpackFlipY.setDefault(),y.pixelStoreUnpack.setDefault(),y.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,a){const{context:c}=this,{gl:p}=c;p.bindTexture(p.TEXTURE_2D,this.texture),a!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=p.LINEAR),e!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,a||e),this.filter=e),r!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,r),p.texParameteri(p.TEXTURE_2D,p.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(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class xg{constructor(e,r,a,c=1,p=1,f=1,y=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void $r(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const x=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=c,this.greenFactor=p,this.blueFactor=f,this.baseShift=y;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let S=0;S<x;S++)this.data[this._idx(-1,S)]=this.data[this._idx(0,S)],this.data[this._idx(x,S)]=this.data[this._idx(x-1,S)],this.data[this._idx(S,-1)]=this.data[this._idx(S,0)],this.data[this._idx(S,x)]=this.data[this._idx(S,x-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(x,-1)]=this.data[this._idx(x-1,0)],this.data[this._idx(-1,x)]=this.data[this._idx(0,x-1)],this.data[this._idx(x,x)]=this.data[this._idx(x-1,x-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let S=0;S<x;S++)for(let P=0;P<x;P++){const E=this.get(S,P);E>this.max&&(this.max=E),E<this.min&&(this.min=E)}}get(e,r){const a=new Uint8Array(this.data.buffer),c=4*this._idx(e,r);return this.unpack(a[c],a[c+1],a[c+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}pack(e){return bg(e,this.getUnpackVector())}getPixels(){return new ki({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let c=r*this.dim,p=r*this.dim+this.dim,f=a*this.dim,y=a*this.dim+this.dim;switch(r){case-1:c=p-1;break;case 1:p=c+1}switch(a){case-1:f=y-1;break;case 1:y=f+1}const x=-r*this.dim,S=-a*this.dim;for(let P=f;P<y;P++)for(let E=c;E<p;E++)this.data[this._idx(E,P)]=e.data[this._idx(E+x,P+S)]}}function bg(i,e){const r=e[0],a=e[1],c=e[2],p=e[3],f=Math.min(r,a,c),y=Math.round((i+p)/f);return{r:Math.floor(y*f/r)%256,g:Math.floor(y*f/a)%256,b:Math.floor(y*f/c)%256}}et("DEMData",xg);class _x extends Vi{constructor(e,r){super(e,yx,r)}_createColorRamp(e){const r={elevationStops:[],colorStops:[]},a=this._transitionablePaint._values["color-relief-color"].value.expression;if(a instanceof _l&&a._styleExpression.expression instanceof yi){this.colorRampExpression=a;const f=a._styleExpression.expression;r.elevationStops=f.labels,r.colorStops=[];for(const y of r.elevationStops)r.colorStops.push(f.evaluate({globals:{elevation:y}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[wt.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;const c={elevationStops:[],colorStops:[]},p=(r.elevationStops.length-1)/(e-1);for(let f=0;f<r.elevationStops.length-.5;f+=p)c.elevationStops.push(r.elevationStops[Math.round(f)]),c.colorStops.push(r.colorStops[Math.round(f)]);return $r(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${r.elevationStops.length}`),c}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,r,a){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const c=this._createColorRamp(r),p=new ki({width:c.colorStops.length,height:1}),f=new ki({width:c.colorStops.length,height:1});for(let y=0;y<c.elevationStops.length;y++){const x=bg(c.elevationStops[y],a);f.setPixel(0,y,new wt(x.r/255,x.g/255,x.b/255,1)),p.setPixel(0,y,c.colorStops[y])}return this.colorRampTextures={elevationTexture:new rf(e,f,e.gl.RGBA),colorTexture:new rf(e,p,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}const vx=wr([{name:"a_pos",components:2,type:"Int16"}],4),{members:xx}=vx;function cp(i,e,r){const a=r.patternDependencies;let c=!1;for(const p of e){const f=p.paint.get(`${i}-pattern`);f.isConstant()||(c=!0);const y=f.constantOr(null);y&&(c=!0,a[y.to]=!0,a[y.from]=!0)}return c}function nf(i,e,r,a,c){const{zoom:p}=a,f=c.patternDependencies;for(const y of e){const x=y.paint.get(`${i}-pattern`).value;if(x.kind!=="constant"){let S=x.evaluate({zoom:p-1},r,{},c.availableImages),P=x.evaluate({zoom:p},r,{},c.availableImages),E=x.evaluate({zoom:p+1},r,{},c.availableImages);S=S&&S.name?S.name:S,P=P&&P.name?P.name:P,E=E&&E.name?E.name:E,f[S]=!0,f[P]=!0,f[E]=!0,r.patterns[y.id]={min:S,mid:P,max:E}}}return r}function wg(i,e,r,a,c){let p;if(c===(function(f,y,x,S){let P=0;for(let E=y,k=x-S;E<x;E+=S)P+=(f[k]-f[E])*(f[E+1]+f[k+1]),k=E;return P})(i,e,r,a)>0)for(let f=e;f<r;f+=a)p=Ig(f/a|0,i[f],i[f+1],p);else for(let f=r-a;f>=e;f-=a)p=Ig(f/a|0,i[f],i[f+1],p);return p&&Ul(p,p.next)&&(yu(p),p=p.next),p}function Ps(i,e){if(!i)return i;e||(e=i);let r,a=i;do if(r=!1,a.steiner||!Ul(a,a.next)&&Dr(a.prev,a,a.next)!==0)a=a.next;else{if(yu(a),a=e=a.prev,a===a.next)break;r=!0}while(r||a!==e);return e}function fu(i,e,r,a,c,p,f){if(!i)return;!f&&p&&(function(x,S,P,E){let k=x;do k.z===0&&(k.z=af(k.x,k.y,S,P,E)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==x);k.prevZ.nextZ=null,k.prevZ=null,(function(z){let F,B=1;do{let j,G=z;z=null;let Q=null;for(F=0;G;){F++;let q=G,H=0;for(let ae=0;ae<B&&(H++,q=q.nextZ,q);ae++);let te=B;for(;H>0||te>0&&q;)H!==0&&(te===0||!q||G.z<=q.z)?(j=G,G=G.nextZ,H--):(j=q,q=q.nextZ,te--),Q?Q.nextZ=j:z=j,j.prevZ=Q,Q=j;G=q}Q.nextZ=null,B*=2}while(F>1)})(k)})(i,a,c,p);let y=i;for(;i.prev!==i.next;){const x=i.prev,S=i.next;if(p?wx(i,a,c,p):bx(i))e.push(x.i,i.i,S.i),yu(i),i=S.next,y=S.next;else if((i=S)===y){f?f===1?fu(i=Tx(Ps(i),e),e,r,a,c,p,2):f===2&&Sx(i,e,r,a,c,p):fu(Ps(i),e,r,a,c,p,1);break}}}function bx(i){const e=i.prev,r=i,a=i.next;if(Dr(e,r,a)>=0)return!1;const c=e.x,p=r.x,f=a.x,y=e.y,x=r.y,S=a.y,P=Math.min(c,p,f),E=Math.min(y,x,S),k=Math.max(c,p,f),z=Math.max(y,x,S);let F=a.next;for(;F!==e;){if(F.x>=P&&F.x<=k&&F.y>=E&&F.y<=z&&mu(c,y,p,x,f,S,F.x,F.y)&&Dr(F.prev,F,F.next)>=0)return!1;F=F.next}return!0}function wx(i,e,r,a){const c=i.prev,p=i,f=i.next;if(Dr(c,p,f)>=0)return!1;const y=c.x,x=p.x,S=f.x,P=c.y,E=p.y,k=f.y,z=Math.min(y,x,S),F=Math.min(P,E,k),B=Math.max(y,x,S),j=Math.max(P,E,k),G=af(z,F,e,r,a),Q=af(B,j,e,r,a);let q=i.prevZ,H=i.nextZ;for(;q&&q.z>=G&&H&&H.z<=Q;){if(q.x>=z&&q.x<=B&&q.y>=F&&q.y<=j&&q!==c&&q!==f&&mu(y,P,x,E,S,k,q.x,q.y)&&Dr(q.prev,q,q.next)>=0||(q=q.prevZ,H.x>=z&&H.x<=B&&H.y>=F&&H.y<=j&&H!==c&&H!==f&&mu(y,P,x,E,S,k,H.x,H.y)&&Dr(H.prev,H,H.next)>=0))return!1;H=H.nextZ}for(;q&&q.z>=G;){if(q.x>=z&&q.x<=B&&q.y>=F&&q.y<=j&&q!==c&&q!==f&&mu(y,P,x,E,S,k,q.x,q.y)&&Dr(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;H&&H.z<=Q;){if(H.x>=z&&H.x<=B&&H.y>=F&&H.y<=j&&H!==c&&H!==f&&mu(y,P,x,E,S,k,H.x,H.y)&&Dr(H.prev,H,H.next)>=0)return!1;H=H.nextZ}return!0}function Tx(i,e){let r=i;do{const a=r.prev,c=r.next.next;!Ul(a,c)&&Sg(a,r,r.next,c)&&gu(a,c)&&gu(c,a)&&(e.push(a.i,r.i,c.i),yu(r),yu(r.next),r=i=c),r=r.next}while(r!==i);return Ps(r)}function Sx(i,e,r,a,c,p){let f=i;do{let y=f.next.next;for(;y!==f.prev;){if(f.i!==y.i&&Ex(f,y)){let x=Mg(f,y);return f=Ps(f,f.next),x=Ps(x,x.next),fu(f,e,r,a,c,p,0),void fu(x,e,r,a,c,p,0)}y=y.next}f=f.next}while(f!==i)}function Mx(i,e){let r=i.x-e.x;return r===0&&(r=i.y-e.y,r===0)&&(r=(i.next.y-i.y)/(i.next.x-i.x)-(e.next.y-e.y)/(e.next.x-e.x)),r}function Ix(i,e){const r=(function(c,p){let f=p;const y=c.x,x=c.y;let S,P=-1/0;if(Ul(c,f))return f;do{if(Ul(c,f.next))return f.next;if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){const B=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(B<=y&&B>P&&(P=B,S=f.x<f.next.x?f:f.next,B===y))return S}f=f.next}while(f!==p);if(!S)return null;const E=S,k=S.x,z=S.y;let F=1/0;f=S;do{if(y>=f.x&&f.x>=k&&y!==f.x&&Tg(x<z?y:P,x,k,z,x<z?P:y,x,f.x,f.y)){const B=Math.abs(x-f.y)/(y-f.x);gu(f,c)&&(B<F||B===F&&(f.x>S.x||f.x===S.x&&Px(S,f)))&&(S=f,F=B)}f=f.next}while(f!==E);return S})(i,e);if(!r)return e;const a=Mg(r,i);return Ps(a,a.next),Ps(r,r.next)}function Px(i,e){return Dr(i.prev,i,e.prev)<0&&Dr(e.next,i,i.next)<0}function af(i,e,r,a,c){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*c|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*c|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ax(i){let e=i,r=i;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==i);return r}function Tg(i,e,r,a,c,p,f,y){return(c-f)*(e-y)>=(i-f)*(p-y)&&(i-f)*(a-y)>=(r-f)*(e-y)&&(r-f)*(p-y)>=(c-f)*(a-y)}function mu(i,e,r,a,c,p,f,y){return!(i===f&&e===y)&&Tg(i,e,r,a,c,p,f,y)}function Ex(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!(function(r,a){let c=r;do{if(c.i!==r.i&&c.next.i!==r.i&&c.i!==a.i&&c.next.i!==a.i&&Sg(c,c.next,r,a))return!0;c=c.next}while(c!==r);return!1})(i,e)&&(gu(i,e)&&gu(e,i)&&(function(r,a){let c=r,p=!1;const f=(r.x+a.x)/2,y=(r.y+a.y)/2;do c.y>y!=c.next.y>y&&c.next.y!==c.y&&f<(c.next.x-c.x)*(y-c.y)/(c.next.y-c.y)+c.x&&(p=!p),c=c.next;while(c!==r);return p})(i,e)&&(Dr(i.prev,i,e.prev)||Dr(i,e.prev,e))||Ul(i,e)&&Dr(i.prev,i,i.next)>0&&Dr(e.prev,e,e.next)>0)}function Dr(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Ul(i,e){return i.x===e.x&&i.y===e.y}function Sg(i,e,r,a){const c=hp(Dr(i,e,r)),p=hp(Dr(i,e,a)),f=hp(Dr(r,a,i)),y=hp(Dr(r,a,e));return c!==p&&f!==y||!(c!==0||!up(i,r,e))||!(p!==0||!up(i,a,e))||!(f!==0||!up(r,i,a))||!(y!==0||!up(r,e,a))}function up(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function hp(i){return i>0?1:i<0?-1:0}function gu(i,e){return Dr(i.prev,i,i.next)<0?Dr(i,e,i.next)>=0&&Dr(i,i.prev,e)>=0:Dr(i,e,i.prev)<0||Dr(i,i.next,e)<0}function Mg(i,e){const r=of(i.i,i.x,i.y),a=of(e.i,e.x,e.y),c=i.next,p=e.prev;return i.next=e,e.prev=i,r.next=c,c.prev=r,a.next=r,r.prev=a,p.next=a,a.prev=p,a}function Ig(i,e,r,a){const c=of(i,e,r);return a?(c.next=a.next,c.prev=a,a.next.prev=c,a.next=c):(c.prev=c,c.next=c),c}function yu(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function of(i,e,r){return{i,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class $l{constructor(e,r){if(r>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class pp{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}pp.noSubdivision=new pp({fill:new $l(0,0),line:new $l(0,0),tile:new $l(0,0),stencil:new $l(0,0),circle:1}),et("SubdivisionGranularityExpression",$l),et("SubdivisionGranularitySetting",pp);const Gl=-32768,_u=32767;class Cx{constructor(e,r){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=Ot/e,this._canonical=r}_getKey(e,r){return(e+=32768)<<16|r+32768}_vertexToIndex(e,r){if(e<-32768||r<-32768||e>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const a=0|Math.round(e),c=0|Math.round(r),p=this._getKey(a,c);if(this._vertexDictionary.has(p))return this._vertexDictionary.get(p);const f=this._vertexBuffer.length/2;return this._vertexDictionary.set(p,f),this._vertexBuffer.push(a,c),f}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(c,p){const f=[];for(let y=0;y<p.length;y+=3){const x=p[y],S=p[y+1],P=p[y+2],E=c[2*x],k=c[2*x+1];(c[2*S]-E)*(c[2*P+1]-k)-(c[2*S+1]-k)*(c[2*P]-E)>0?(f.push(x),f.push(P),f.push(S)):(f.push(x),f.push(S),f.push(P))}return f})(this._vertexBuffer,e);const r=[],a=e.length;for(let c=0;c<a;c+=3){const p=[e[c+0],e[c+1],e[c+2]],f=[this._vertexBuffer[2*e[c+0]+0],this._vertexBuffer[2*e[c+0]+1],this._vertexBuffer[2*e[c+1]+0],this._vertexBuffer[2*e[c+1]+1],this._vertexBuffer[2*e[c+2]+0],this._vertexBuffer[2*e[c+2]+1]];let y=1/0,x=1/0,S=-1/0,P=-1/0;for(let B=0;B<3;B++){const j=f[2*B],G=f[2*B+1];y=Math.min(y,j),S=Math.max(S,j),x=Math.min(x,G),P=Math.max(P,G)}if(y===S||x===P)continue;const E=Math.floor(y/this._granularityCellSize),k=Math.ceil(S/this._granularityCellSize),z=Math.floor(x/this._granularityCellSize),F=Math.ceil(P/this._granularityCellSize);if(E!==k||z!==F)for(let B=z;B<F;B++){const j=this._scanlineGenerateVertexRingForCellRow(B,f,p);kx(this._vertexBuffer,j,r)}else r.push(...p)}return r}_scanlineGenerateVertexRingForCellRow(e,r,a){const c=e*this._granularityCellSize,p=c+this._granularityCellSize,f=[];for(let y=0;y<3;y++){const x=r[2*y],S=r[2*y+1],P=r[2*(y+1)%6],E=r[(2*(y+1)+1)%6],k=r[2*(y+2)%6],z=r[(2*(y+2)+1)%6],F=P-x,B=E-S,j=F===0,G=B===0,Q=(c-S)/B,q=(p-S)/B,H=Math.min(Q,q),te=Math.max(Q,q);if(!G&&(H>=1||te<=0)||G&&(S<c||S>p)){E>=c&&E<=p&&f.push(a[(y+1)%3]);continue}!G&&H>0&&f.push(this._vertexToIndex(x+F*H,S+B*H));const ae=x+F*Math.max(H,0),_e=x+F*Math.min(te,1);j||this._generateIntraEdgeVertices(f,x,S,P,E,ae,_e),!G&&te<1&&f.push(this._vertexToIndex(x+F*te,S+B*te)),(G||E>=c&&E<=p)&&f.push(a[(y+1)%3]),!G&&(E<=c||E>=p)&&this._generateInterEdgeVertices(f,x,S,P,E,k,z,_e,c,p)}return f}_generateIntraEdgeVertices(e,r,a,c,p,f,y){const x=c-r,S=p-a,P=S===0,E=P?Math.min(r,c):Math.min(f,y),k=P?Math.max(r,c):Math.max(f,y),z=Math.floor(E/this._granularityCellSize)+1,F=Math.ceil(k/this._granularityCellSize)-1;if(P?r<c:f<y)for(let B=z;B<=F;B++){const j=B*this._granularityCellSize;e.push(this._vertexToIndex(j,a+S*(j-r)/x))}else for(let B=F;B>=z;B--){const j=B*this._granularityCellSize;e.push(this._vertexToIndex(j,a+S*(j-r)/x))}}_generateInterEdgeVertices(e,r,a,c,p,f,y,x,S,P){const E=p-a,k=f-c,z=y-p,F=(S-p)/z,B=(P-p)/z,j=Math.min(F,B),G=Math.max(F,B),Q=c+k*j;let q=Math.floor(Math.min(Q,x)/this._granularityCellSize)+1,H=Math.ceil(Math.max(Q,x)/this._granularityCellSize)-1,te=x<Q;const ae=z===0;if(ae&&(y===S||y===P))return;if(ae||j>=1||G<=0){const De=a-y,Ee=f+(r-f)*Math.min((S-y)/De,(P-y)/De);q=Math.floor(Math.min(Ee,x)/this._granularityCellSize)+1,H=Math.ceil(Math.max(Ee,x)/this._granularityCellSize)-1,te=x<Ee}const _e=E>0?P:S;if(te)for(let De=q;De<=H;De++)e.push(this._vertexToIndex(De*this._granularityCellSize,_e));else for(let De=H;De>=q;De--)e.push(this._vertexToIndex(De*this._granularityCellSize,_e))}_generateOutline(e){const r=[];for(const a of e){const c=As(a,this._granularity,!0),p=this._pointArrayToIndices(c),f=[];for(let y=1;y<p.length;y++)f.push(p[y-1]),f.push(p[y]);r.push(f)}return r}_handlePoles(e){let r=!1,a=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(a=!0)),(r||a)&&this._fillPoles(e,r,a)}_ensureNoPoleVertices(){const e=this._vertexBuffer;for(let r=0;r<e.length;r+=2){const a=e[r+1];a===Gl&&(e[r+1]=-32767),a===_u&&(e[r+1]=32766)}}_generatePoleQuad(e,r,a,c,p,f){c>p!=(f===Gl)?(e.push(r),e.push(a),e.push(this._vertexToIndex(c,f)),e.push(a),e.push(this._vertexToIndex(p,f)),e.push(this._vertexToIndex(c,f))):(e.push(a),e.push(r),e.push(this._vertexToIndex(c,f)),e.push(this._vertexToIndex(p,f)),e.push(a),e.push(this._vertexToIndex(c,f)))}_fillPoles(e,r,a){const c=this._vertexBuffer,p=Ot,f=e.length;for(let y=2;y<f;y+=3){const x=e[y-2],S=e[y-1],P=e[y],E=c[2*x],k=c[2*x+1],z=c[2*S],F=c[2*S+1],B=c[2*P],j=c[2*P+1];r&&(k===0&&F===0&&this._generatePoleQuad(e,x,S,E,z,Gl),F===0&&j===0&&this._generatePoleQuad(e,S,P,z,B,Gl),j===0&&k===0&&this._generatePoleQuad(e,P,x,B,E,Gl)),a&&(k===p&&F===p&&this._generatePoleQuad(e,x,S,E,z,_u),F===p&&j===p&&this._generatePoleQuad(e,S,P,z,B,_u),j===p&&k===p&&this._generatePoleQuad(e,P,x,B,E,_u))}}_initializeVertices(e){for(let r=0;r<e.length;r+=2)this._vertexToIndex(e[r],e[r+1])}subdividePolygonInternal(e,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:a,holeIndices:c}=(function(y){const x=[],S=[];for(const P of y)if(P.length!==0){P!==y[0]&&x.push(S.length/2);for(let E=0;E<P.length;E++)S.push(P[E].x),S.push(P[E].y)}return{flattened:S,holeIndices:x}})(e);let p;this._initializeVertices(a);try{const y=(function(S,P,E=2){const k=P&&P.length,z=k?P[0]*E:S.length;let F=wg(S,0,z,E,!0);const B=[];if(!F||F.next===F.prev)return B;let j,G,Q;if(k&&(F=(function(q,H,te,ae){const _e=[];for(let De=0,Ee=H.length;De<Ee;De++){const Le=wg(q,H[De]*ae,De<Ee-1?H[De+1]*ae:q.length,ae,!1);Le===Le.next&&(Le.steiner=!0),_e.push(Ax(Le))}_e.sort(Mx);for(let De=0;De<_e.length;De++)te=Ix(_e[De],te);return te})(S,P,F,E)),S.length>80*E){j=S[0],G=S[1];let q=j,H=G;for(let te=E;te<z;te+=E){const ae=S[te],_e=S[te+1];ae<j&&(j=ae),_e<G&&(G=_e),ae>q&&(q=ae),_e>H&&(H=_e)}Q=Math.max(q-j,H-G),Q=Q!==0?32767/Q:0}return fu(F,B,E,j,G,Q,0),B})(a,c),x=this._convertIndices(a,y);p=this._subdivideTrianglesScanline(x)}catch(y){console.error(y)}let f=[];return r&&(f=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(p),{verticesFlattened:this._vertexBuffer,indicesTriangles:p,indicesLineList:f}}_convertIndices(e,r){const a=[];for(let c=0;c<r.length;c++)a.push(this._vertexToIndex(e[2*r[c]],e[2*r[c]+1]));return a}_pointArrayToIndices(e){const r=[];for(let a=0;a<e.length;a++){const c=e[a];r.push(this._vertexToIndex(c.x,c.y))}return r}}function Pg(i,e,r,a=!0){return new Cx(r,e).subdividePolygonInternal(i,a)}function As(i,e,r=!1){if(!i||i.length<1)return[];if(i.length<2)return[];const a=i[0],c=i[i.length-1],p=r&&(a.x!==c.x||a.y!==c.y);if(e<2)return p?[...i,i[0]]:[...i];const f=Math.floor(Ot/e),y=[];y.push(new D(i[0].x,i[0].y));const x=i.length,S=p?x:x-1;for(let P=0;P<S;P++){const E=i[P],k=P<x-1?i[P+1]:i[0],z=E.x,F=E.y,B=k.x,j=k.y,G=z!==B,Q=F!==j;if(!G&&!Q)continue;const q=B-z,H=j-F,te=Math.abs(q),ae=Math.abs(H);let _e=z,De=F;for(;;){const Le=q>0?(Math.floor(_e/f)+1)*f:(Math.ceil(_e/f)-1)*f,Ge=H>0?(Math.floor(De/f)+1)*f:(Math.ceil(De/f)-1)*f,Be=Math.abs(_e-Le),Ce=Math.abs(De-Ge),Ie=Math.abs(_e-B),Qe=Math.abs(De-j),Ye=G?Be/te:Number.POSITIVE_INFINITY,tt=Q?Ce/ae:Number.POSITIVE_INFINITY;if((Ie<=Be||!G)&&(Qe<=Ce||!Q))break;if(Ye<tt&&G||!Q){_e=Le,De+=H*Ye;const We=new D(_e,Math.round(De));y[y.length-1].x===We.x&&y[y.length-1].y===We.y||y.push(We)}else{_e+=q*tt,De=Ge;const We=new D(Math.round(_e),De);y[y.length-1].x===We.x&&y[y.length-1].y===We.y||y.push(We)}}const Ee=new D(B,j);y[y.length-1].x===Ee.x&&y[y.length-1].y===Ee.y||y.push(Ee)}return y}function kx(i,e,r){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let a=0,c=i[2*e[0]];for(let x=1;x<e.length;x++){const S=i[2*e[x]];S<c&&(c=S,a=x)}const p=e.length;let f=a,y=(f+1)%p;for(;;){const x=f-1>=0?f-1:p-1,S=(y+1)%p,P=i[2*e[x]],E=i[2*e[S]],k=i[2*e[f]],z=i[2*e[f]+1],F=i[2*e[y]+1];let B=!1;if(P<E)B=!0;else if(P>E)B=!1;else{const j=F-z,G=-(i[2*e[y]]-k),Q=z<F?1:-1;((P-k)*j+(i[2*e[x]+1]-z)*G)*Q>((E-k)*j+(i[2*e[S]+1]-z)*G)*Q&&(B=!0)}if(B){const j=e[x],G=e[f],Q=e[y];j!==G&&j!==Q&&G!==Q&&r.push(Q,G,j),f--,f<0&&(f=p-1)}else{const j=e[S],G=e[f],Q=e[y];j!==G&&j!==Q&&G!==Q&&r.push(Q,G,j),y++,y>=p&&(y=0)}if(x===S)break}}function Ag(i,e,r,a,c,p,f,y,x){const S=c.length/2,P=f&&y&&x;if(S<Ze.MAX_VERTEX_ARRAY_LENGTH){const E=e.prepareSegment(S,r,a),k=E.vertexLength;for(let B=0;B<p.length;B+=3)a.emplaceBack(k+p[B],k+p[B+1],k+p[B+2]);let z,F;E.vertexLength+=S,E.primitiveLength+=p.length/3,P&&(F=f.prepareSegment(S,r,y),z=F.vertexLength,F.vertexLength+=S);for(let B=0;B<c.length;B+=2)i(c[B],c[B+1]);if(P)for(let B=0;B<x.length;B++){const j=x[B];for(let G=1;G<j.length;G+=2)y.emplaceBack(z+j[G-1],z+j[G]);F.primitiveLength+=j.length/2}}else(function(E,k,z,F,B,j){const G=[];for(let ae=0;ae<F.length/2;ae++)G.push(-1);const Q={count:0};let q=0,H=E.getOrCreateLatestSegment(k,z),te=H.vertexLength;for(let ae=2;ae<B.length;ae+=3){const _e=B[ae-2],De=B[ae-1],Ee=B[ae];let Le=G[_e]<q,Ge=G[De]<q,Be=G[Ee]<q;H.vertexLength+((Le?1:0)+(Ge?1:0)+(Be?1:0))>Ze.MAX_VERTEX_ARRAY_LENGTH&&(H=E.createNewSegment(k,z),q=Q.count,Le=!0,Ge=!0,Be=!0,te=0);const Ce=vu(G,F,j,Q,_e,Le,H),Ie=vu(G,F,j,Q,De,Ge,H),Qe=vu(G,F,j,Q,Ee,Be,H);z.emplaceBack(te+Ce-q,te+Ie-q,te+Qe-q),H.primitiveLength++}})(e,r,a,c,p,i),P&&(function(E,k,z,F,B,j){const G=[];for(let ae=0;ae<F.length/2;ae++)G.push(-1);const Q={count:0};let q=0,H=E.getOrCreateLatestSegment(k,z),te=H.vertexLength;for(let ae=0;ae<B.length;ae++){const _e=B[ae];for(let De=1;De<B[ae].length;De+=2){const Ee=_e[De-1],Le=_e[De];let Ge=G[Ee]<q,Be=G[Le]<q;H.vertexLength+((Ge?1:0)+(Be?1:0))>Ze.MAX_VERTEX_ARRAY_LENGTH&&(H=E.createNewSegment(k,z),q=Q.count,Ge=!0,Be=!0,te=0);const Ce=vu(G,F,j,Q,Ee,Ge,H),Ie=vu(G,F,j,Q,Le,Be,H);z.emplaceBack(te+Ce-q,te+Ie-q),H.primitiveLength++}}})(f,r,y,c,x,i),e.forceNewSegmentOnNextPrepare(),f?.forceNewSegmentOnNextPrepare()}function vu(i,e,r,a,c,p,f){if(p){const y=a.count;return r(e[2*c],e[2*c+1]),i[c]=a.count,a.count++,f.vertexLength++,y}return i[c]}class sf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Y,this.indexArray=new Se,this.indexArray2=new Ve,this.programConfigurations=new La(e.layers,e.zoom),this.segments=new Ze,this.segments2=new Ze,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasDependencies=cp("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),p=!c.isConstant(),f=[];for(const{feature:y,id:x,index:S,sourceLayerIndex:P}of e){const E=this.layers[0]._featureFilter.needGeometry,k=na(y,E);if(!this.layers[0]._featureFilter.filter(new $t(this.zoom),k,a))continue;const z=p?c.evaluate(k,{},a,r.availableImages):void 0,F={id:x,properties:y.properties,type:y.type,sourceLayerIndex:P,index:S,geometry:E?k.geometry:ia(y),patterns:{},sortKey:z};f.push(F)}p&&f.sort(((y,x)=>y.sortKey-x.sortKey));for(const y of f){const{geometry:x,index:S,sourceLayerIndex:P}=y;if(this.hasDependencies){const E=nf("fill",this.layers,y,{zoom:this.zoom},r);this.patternFeatures.push(E)}else this.addFeature(y,x,S,a,{},r.subdivisionGranularity);r.featureIndex.insert(e[S].feature,x,S,P,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:a})}addFeatures(e,r,a){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,a,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,a,c,p,f){for(const y of sl(r,500)){const x=Pg(y,c,f.fill.getGranularityForZoomLevel(c.z)),S=this.layoutVertexArray;Ag(((P,E)=>{S.emplaceBack(P,E)}),this.segments,this.layoutVertexArray,this.indexArray,x.verticesFlattened,x.indicesTriangles,this.segments2,this.indexArray2,x.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:p,canonical:c})}}let Eg,Cg;et("FillBucket",sf,{omit:["layers","patternFeatures"]});var Dx={get paint(){return Cg=Cg||new _i({"fill-antialias":new at(we.paint_fill["fill-antialias"]),"fill-opacity":new lt(we.paint_fill["fill-opacity"]),"fill-color":new lt(we.paint_fill["fill-color"]),"fill-outline-color":new lt(we.paint_fill["fill-outline-color"]),"fill-translate":new at(we.paint_fill["fill-translate"]),"fill-translate-anchor":new at(we.paint_fill["fill-translate-anchor"]),"fill-pattern":new vs(we.paint_fill["fill-pattern"])})},get layout(){return Eg=Eg||new _i({"fill-sort-key":new lt(we.layout_fill["fill-sort-key"])})}};class zx extends Vi{constructor(e,r){super(e,Dx,r)}recalculate(e,r){super.recalculate(e,r);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new sf(e)}queryRadius(){return sp(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:a,pixelsToTileUnits:c}){return lg(lp(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-a.bearingInRadians,c),r)}isTileClipped(){return!0}}const Lx=wr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Rx=wr([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Fx}=Lx;class xu{constructor(e,r,a,c,p){this.properties={},this.extent=a,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=c,this._values=p,e.readFields(Bx,this,r)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const r=e.readVarint()+e.pos,a=[];let c,p=1,f=0,y=0,x=0;for(;e.pos<r;){if(f<=0){const S=e.readVarint();p=7&S,f=S>>3}if(f--,p===1||p===2)y+=e.readSVarint(),x+=e.readSVarint(),p===1&&(c&&a.push(c),c=[]),c&&c.push(new D(y,x));else{if(p!==7)throw new Error(`unknown command ${p}`);c&&c.push(c[0].clone())}}return c&&a.push(c),a}bbox(){const e=this._pbf;e.pos=this._geometry;const r=e.readVarint()+e.pos;let a=1,c=0,p=0,f=0,y=1/0,x=-1/0,S=1/0,P=-1/0;for(;e.pos<r;){if(c<=0){const E=e.readVarint();a=7&E,c=E>>3}if(c--,a===1||a===2)p+=e.readSVarint(),f+=e.readSVarint(),p<y&&(y=p),p>x&&(x=p),f<S&&(S=f),f>P&&(P=f);else if(a!==7)throw new Error(`unknown command ${a}`)}return[y,S,x,P]}toGeoJSON(e,r,a){const c=this.extent*Math.pow(2,a),p=this.extent*e,f=this.extent*r,y=this.loadGeometry();function x(k){return[360*(k.x+p)/c-180,360/Math.PI*Math.atan(Math.exp((1-2*(k.y+f)/c)*Math.PI))-90]}function S(k){return k.map(x)}let P;if(this.type===1){const k=[];for(const F of y)k.push(F[0]);const z=S(k);P=k.length===1?{type:"Point",coordinates:z[0]}:{type:"MultiPoint",coordinates:z}}else if(this.type===2){const k=y.map(S);P=k.length===1?{type:"LineString",coordinates:k[0]}:{type:"MultiLineString",coordinates:k}}else{if(this.type!==3)throw new Error("unknown feature type");{const k=kg(y),z=[];for(const F of k)z.push(F.map(S));P=z.length===1?{type:"Polygon",coordinates:z[0]}:{type:"MultiPolygon",coordinates:z}}}const E={type:"Feature",geometry:P,properties:this.properties};return this.id!=null&&(E.id=this.id),E}}function Bx(i,e,r){i===1?e.id=r.readVarint():i===2?(function(a,c){const p=a.readVarint()+a.pos;for(;a.pos<p;){const f=c._keys[a.readVarint()],y=c._values[a.readVarint()];c.properties[f]=y}})(r,e):i===3?e.type=r.readVarint():i===4&&(e._geometry=r.pos)}function kg(i){const e=i.length;if(e<=1)return[i];const r=[];let a,c;for(let p=0;p<e;p++){const f=Ox(i[p]);f!==0&&(c===void 0&&(c=f<0),c===f<0?(a&&r.push(a),a=[i[p]]):a&&a.push(i[p]))}return a&&r.push(a),r}function Ox(i){let e=0;for(let r,a,c=0,p=i.length,f=p-1;c<p;f=c++)r=i[c],a=i[f],e+=(a.x-r.x)*(r.y+a.y);return e}xu.types=["Unknown","Point","LineString","Polygon"];class Nx{constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(jx,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const r=this._pbf.readVarint()+this._pbf.pos;return new xu(this._pbf,r,this.extent,this._keys,this._values)}}function jx(i,e,r){i===15?e.version=r.readVarint():i===1?e.name=r.readString():i===5?e.extent=r.readVarint():i===2?e._features.push(r.pos):i===3?e._keys.push(r.readString()):i===4&&e._values.push((function(a){let c=null;const p=a.readVarint()+a.pos;for(;a.pos<p;){const f=a.readVarint()>>3;c=f===1?a.readString():f===2?a.readFloat():f===3?a.readDouble():f===4?a.readVarint64():f===5?a.readVarint():f===6?a.readSVarint():f===7?a.readBoolean():null}if(c==null)throw new Error("unknown feature value");return c})(r))}class Dg{constructor(e,r){this.layers=e.readFields(Vx,{},r)}}function Vx(i,e,r){if(i===3){const a=new Nx(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}const lf=Math.pow(2,13);function bu(i,e,r,a,c,p,f,y){i.emplaceBack(e,r,2*Math.floor(a*lf)+f,c*lf*2,p*lf*2,Math.round(y))}class cf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new ee,this.centroidVertexArray=new X,this.indexArray=new Se,this.programConfigurations=new La(e.layers,e.zoom),this.segments=new Ze,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.features=[],this.hasDependencies=cp("fill-extrusion",this.layers,r);for(const{feature:c,id:p,index:f,sourceLayerIndex:y}of e){const x=this.layers[0]._featureFilter.needGeometry,S=na(c,x);if(!this.layers[0]._featureFilter.filter(new $t(this.zoom),S,a))continue;const P={id:p,sourceLayerIndex:y,index:f,geometry:x?S.geometry:ia(c),properties:c.properties,type:c.type,patterns:{}};this.hasDependencies?this.features.push(nf("fill-extrusion",this.layers,P,{zoom:this.zoom},r)):this.addFeature(P,P.geometry,f,a,{},r.subdivisionGranularity),r.featureIndex.insert(c,P.geometry,f,y,this.index,!0)}}addFeatures(e,r,a){for(const c of this.features){const{geometry:p}=c;this.addFeature(c,p,c.index,r,a,e.subdivisionGranularity)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:a})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fx),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Rx.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,a,c,p,f){for(const y of sl(r,500)){const x={x:0,y:0,sampleCount:0},S=this.layoutVertexArray.length;this.processPolygon(x,c,e,y,f);const P=this.layoutVertexArray.length-S,E=Math.floor(x.x/x.sampleCount),k=Math.floor(x.y/x.sampleCount);for(let z=0;z<P;z++)this.centroidVertexArray.emplaceBack(E,k)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:p,canonical:c})}processPolygon(e,r,a,c,p){if(c.length<1||zg(c[0]))return;for(const E of c)E.length!==0&&Ux(e,E);const f={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},y=p.fill.getGranularityForZoomLevel(r.z),x=xu.types[a.type]==="Polygon";for(const E of c){if(E.length===0||zg(E))continue;const k=As(E,y,x);this._generateSideFaces(k,f)}if(!x)return;const S=Pg(c,r,y,!1),P=this.layoutVertexArray;Ag(((E,k)=>{bu(P,E,k,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,S.verticesFlattened,S.indicesTriangles)}_generateSideFaces(e,r){let a=0;for(let c=1;c<e.length;c++){const p=e[c],f=e[c-1];if($x(p,f))continue;r.segment.vertexLength+4>Ze.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const y=p.sub(f)._perp()._unit(),x=f.dist(p);a+x>32768&&(a=0),bu(this.layoutVertexArray,p.x,p.y,y.x,y.y,0,0,a),bu(this.layoutVertexArray,p.x,p.y,y.x,y.y,0,1,a),a+=x,bu(this.layoutVertexArray,f.x,f.y,y.x,y.y,0,0,a),bu(this.layoutVertexArray,f.x,f.y,y.x,y.y,0,1,a);const S=r.segment.vertexLength;this.indexArray.emplaceBack(S,S+2,S+1),this.indexArray.emplaceBack(S+1,S+2,S+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}}function Ux(i,e){for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1&&e[0].x===a.x&&e[0].y===a.y||(i.x+=a.x,i.y+=a.y,i.sampleCount++)}}function $x(i,e){return i.x===e.x&&(i.x<0||i.x>Ot)||i.y===e.y&&(i.y<0||i.y>Ot)}function zg(i){return i.every((e=>e.x<0))||i.every((e=>e.x>Ot))||i.every((e=>e.y<0))||i.every((e=>e.y>Ot))}let Lg;et("FillExtrusionBucket",cf,{omit:["layers","features"]});var Gx={get paint(){return Lg=Lg||new _i({"fill-extrusion-opacity":new at(we["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new lt(we["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new at(we["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new at(we["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new vs(we["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new lt(we["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new lt(we["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new at(we["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class qx extends Vi{constructor(e,r){super(e,Gx,r)}createBucket(e){return new cf(e)}queryRadius(){return sp(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:a,geometry:c,transform:p,pixelsToTileUnits:f,pixelPosMatrix:y}){const x=lp(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-p.bearingInRadians,f),S=this.paint.get("fill-extrusion-height").evaluate(r,a),P=this.paint.get("fill-extrusion-base").evaluate(r,a),E=(function(z,F){const B=[];for(const j of z){const G=[j.x,j.y,0,1];Tn(G,G,F),B.push(new D(G[0]/G[3],G[1]/G[3]))}return B})(x,y),k=(function(z,F,B,j){const G=[],Q=[],q=j[8]*F,H=j[9]*F,te=j[10]*F,ae=j[11]*F,_e=j[8]*B,De=j[9]*B,Ee=j[10]*B,Le=j[11]*B;for(const Ge of z){const Be=[],Ce=[];for(const Ie of Ge){const Qe=Ie.x,Ye=Ie.y,tt=j[0]*Qe+j[4]*Ye+j[12],We=j[1]*Qe+j[5]*Ye+j[13],ot=j[2]*Qe+j[6]*Ye+j[14],zt=j[3]*Qe+j[7]*Ye+j[15],St=ot+te,lr=zt+ae,oi=tt+_e,Fr=We+De,cr=ot+Ee,nr=zt+Le,Ft=new D((tt+q)/lr,(We+H)/lr);Ft.z=St/lr,Be.push(Ft);const _r=new D(oi/nr,Fr/nr);_r.z=cr/nr,Ce.push(_r)}G.push(Be),Q.push(Ce)}return[G,Q]})(c,P,S,y);return(function(z,F,B){let j=1/0;lg(B,F)&&(j=Rg(B,F[0]));for(let G=0;G<F.length;G++){const Q=F[G],q=z[G];for(let H=0;H<Q.length-1;H++){const te=Q[H],ae=[te,Q[H+1],q[H+1],q[H],te];Nl(B,ae)&&(j=Math.min(j,Rg(B,ae)))}}return j!==1/0&&j})(k[0],k[1],E)}}function wu(i,e){return i.x*e.x+i.y*e.y}function Rg(i,e){if(i.length===1){let r=0;const a=e[r++];let c;for(;!c||a.equals(c);)if(c=e[r++],!c)return 1/0;for(;r<e.length;r++){const p=e[r],f=i[0],y=c.sub(a),x=p.sub(a),S=f.sub(a),P=wu(y,y),E=wu(y,x),k=wu(x,x),z=wu(S,y),F=wu(S,x),B=P*k-E*E,j=(k*z-E*F)/B,G=(P*F-E*z)/B,Q=a.z*(1-j-G)+c.z*j+p.z*G;if(isFinite(Q))return Q}return 1/0}{let r=1/0;for(const a of e)r=Math.min(r,a.z);return r}}const Zx=wr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Wx}=Zx,Hx=wr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Xx}=Hx,Yx=Math.cos(Math.PI/180*37.5),Fg=Math.pow(2,14)/.5;class uf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((r=>{this.gradients[r.id]={}})),this.layoutVertexArray=new oe,this.layoutVertexArray2=new J,this.indexArray=new Se,this.programConfigurations=new La(e.layers,e.zoom),this.segments=new Ze,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasDependencies=cp("line",this.layers,r)||this.hasLineDasharray(this.layers);const c=this.layers[0].layout.get("line-sort-key"),p=!c.isConstant(),f=[];for(const{feature:y,id:x,index:S,sourceLayerIndex:P}of e){const E=this.layers[0]._featureFilter.needGeometry,k=na(y,E);if(!this.layers[0]._featureFilter.filter(new $t(this.zoom),k,a))continue;const z=p?c.evaluate(k,{},a):void 0,F={id:x,properties:y.properties,type:y.type,sourceLayerIndex:P,index:S,geometry:E?k.geometry:ia(y),patterns:{},dashes:{},sortKey:z};f.push(F)}p&&f.sort(((y,x)=>y.sortKey-x.sortKey));for(const y of f){const{geometry:x,index:S,sourceLayerIndex:P}=y;this.hasDependencies?(cp("line",this.layers,r)?nf("line",this.layers,y,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,y,this.zoom,r),this.patternFeatures.push(y)):this.addFeature(y,x,S,a,{},{},r.subdivisionGranularity),r.featureIndex.insert(e[S].feature,x,S,P,this.index)}}update(e,r,a,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:a,dashPositions:c})}addFeatures(e,r,a,c){for(const p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,r,a,c,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Xx)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Wx),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,c,p,f,y){const x=this.layers[0].layout,S=x.get("line-join").evaluate(e,{}),P=x.get("line-cap"),E=x.get("line-miter-limit"),k=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const z of r)this.addLine(z,e,S,P,E,k,c,y);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:p,dashPositions:f,canonical:c})}addLine(e,r,a,c,p,f,y,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=As(e,y?x.line.getGranularityForZoomLevel(y.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let q=0;q<e.length-1;q++)this.totalDistance+=e[q].dist(e[q+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const S=xu.types[r.type]==="Polygon";let P=e.length;for(;P>=2&&e[P-1].equals(e[P-2]);)P--;let E=0;for(;E<P-1&&e[E].equals(e[E+1]);)E++;if(P<(S?3:2))return;a==="bevel"&&(p=1.05);const k=this.overscaling<=16?122880/(512*this.overscaling):0,z=this.segments.prepareSegment(10*P,this.layoutVertexArray,this.indexArray);let F,B,j,G,Q;this.e1=this.e2=-1,S&&(F=e[P-2],Q=e[E].sub(F)._unit()._perp());for(let q=E;q<P;q++){if(j=q===P-1?S?e[E+1]:void 0:e[q+1],j&&e[q].equals(j))continue;Q&&(G=Q),F&&(B=F),F=e[q],Q=j?j.sub(F)._unit()._perp():G,G=G||Q;let H=G.add(Q);H.x===0&&H.y===0||H._unit();const te=G.x*Q.x+G.y*Q.y,ae=H.x*Q.x+H.y*Q.y,_e=ae!==0?1/ae:1/0,De=2*Math.sqrt(2-2*ae),Ee=ae<Yx&&B&&j,Le=G.x*Q.y-G.y*Q.x>0;if(Ee&&q>E){const Ce=F.dist(B);if(Ce>2*k){const Ie=F.sub(F.sub(B)._mult(k/Ce)._round());this.updateDistance(B,Ie),this.addCurrentVertex(Ie,G,0,0,z),B=Ie}}const Ge=B&&j;let Be=Ge?a:S?"butt":c;if(Ge&&Be==="round"&&(_e<f?Be="miter":_e<=2&&(Be="fakeround")),Be==="miter"&&_e>p&&(Be="bevel"),Be==="bevel"&&(_e>2&&(Be="flipbevel"),_e<p&&(Be="miter")),B&&this.updateDistance(B,F),Be==="miter")H._mult(_e),this.addCurrentVertex(F,H,0,0,z);else if(Be==="flipbevel"){if(_e>100)H=Q.mult(-1);else{const Ce=_e*G.add(Q).mag()/G.sub(Q).mag();H._perp()._mult(Ce*(Le?-1:1))}this.addCurrentVertex(F,H,0,0,z),this.addCurrentVertex(F,H.mult(-1),0,0,z)}else if(Be==="bevel"||Be==="fakeround"){const Ce=-Math.sqrt(_e*_e-1),Ie=Le?Ce:0,Qe=Le?0:Ce;if(B&&this.addCurrentVertex(F,G,Ie,Qe,z),Be==="fakeround"){const Ye=Math.round(180*De/Math.PI/20);for(let tt=1;tt<Ye;tt++){let We=tt/Ye;if(We!==.5){const zt=We-.5;We+=We*zt*(We-1)*((1.0904+te*(te*(3.55645-1.43519*te)-3.2452))*zt*zt+(.848013+te*(.215638*te-1.06021)))}const ot=Q.sub(G)._mult(We)._add(G)._unit()._mult(Le?-1:1);this.addHalfVertex(F,ot.x,ot.y,!1,Le,0,z)}}j&&this.addCurrentVertex(F,Q,-Ie,-Qe,z)}else if(Be==="butt")this.addCurrentVertex(F,H,0,0,z);else if(Be==="square"){const Ce=B?1:-1;this.addCurrentVertex(F,H,Ce,Ce,z)}else Be==="round"&&(B&&(this.addCurrentVertex(F,G,0,0,z),this.addCurrentVertex(F,G,1,1,z,!0)),j&&(this.addCurrentVertex(F,Q,-1,-1,z,!0),this.addCurrentVertex(F,Q,0,0,z)));if(Ee&&q<P-1){const Ce=F.dist(j);if(Ce>2*k){const Ie=F.add(j.sub(F)._mult(k/Ce)._round());this.updateDistance(F,Ie),this.addCurrentVertex(Ie,Q,0,0,z),F=Ie}}}}addCurrentVertex(e,r,a,c,p,f=!1){const y=r.y*c-r.x,x=-r.y-r.x*c;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,f,!1,a,p),this.addHalfVertex(e,y,x,f,!0,-c,p),this.distance>Fg/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,c,p,f))}addHalfVertex({x:e,y:r},a,c,p,f,y,x){const S=.5*(this.lineClips?this.scaledDistance*(Fg-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(r<<1)+(f?1:0),Math.round(63*a)+128,Math.round(63*c)+128,1+(y===0?0:y<0?-1:1)|(63&S)<<2,S>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const P=x.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,P,this.e2),x.primitiveLength++),f?this.e2=P:this.e1=P}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}hasLineDasharray(e){for(const r of e){const a=r.paint.get("line-dasharray");if(a&&!a.isConstant())return!0}return!1}addLineDashDependencies(e,r,a,c){for(const p of e){const f=p.paint.get("line-dasharray");if(!f||f.value.kind==="constant")continue;const y=p.layout.get("line-cap")==="round",x={dasharray:f.value.evaluate({zoom:a-1},r,{}),round:y},S={dasharray:f.value.evaluate({zoom:a},r,{}),round:y},P={dasharray:f.value.evaluate({zoom:a+1},r,{}),round:y},E=`${x.dasharray.join(",")},${x.round}`,k=`${S.dasharray.join(",")},${S.round}`,z=`${P.dasharray.join(",")},${P.round}`;c.dashDependencies[E]=x,c.dashDependencies[k]=S,c.dashDependencies[z]=P,r.dashes[p.id]={min:E,mid:k,max:z}}}}let Bg,Og;et("LineBucket",uf,{omit:["layers","patternFeatures"]});var Ng={get paint(){return Og=Og||new _i({"line-opacity":new lt(we.paint_line["line-opacity"]),"line-color":new lt(we.paint_line["line-color"]),"line-translate":new at(we.paint_line["line-translate"]),"line-translate-anchor":new at(we.paint_line["line-translate-anchor"]),"line-width":new lt(we.paint_line["line-width"]),"line-gap-width":new lt(we.paint_line["line-gap-width"]),"line-offset":new lt(we.paint_line["line-offset"]),"line-blur":new lt(we.paint_line["line-blur"]),"line-dasharray":new vs(we.paint_line["line-dasharray"]),"line-pattern":new vs(we.paint_line["line-pattern"]),"line-gradient":new kl(we.paint_line["line-gradient"])})},get layout(){return Bg=Bg||new _i({"line-cap":new at(we.layout_line["line-cap"]),"line-join":new lt(we.layout_line["line-join"]),"line-miter-limit":new at(we.layout_line["line-miter-limit"]),"line-round-limit":new at(we.layout_line["line-round-limit"]),"line-sort-key":new lt(we.layout_line["line-sort-key"])})}};class Kx extends lt{possiblyEvaluate(e,r){return r=new $t(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,c){return r=hi({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,c)}}let dp;class Jx extends Vi{constructor(e,r){super(e,Ng,r),this.gradientVersion=0,dp||(dp=new Kx(Ng.paint.properties["line-width"].specification),dp.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!(function(a){return a._styleExpression!==void 0})(r)&&r._styleExpression.expression instanceof Xn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=dp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new uf(e)}queryRadius(e){const r=e,a=jg(Vl("line-width",this,r),Vl("line-gap-width",this,r)),c=Vl("line-offset",this,r);return a/2+Math.abs(c)+sp(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:a,geometry:c,transform:p,pixelsToTileUnits:f}){const y=lp(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-p.bearingInRadians,f),x=f/2*jg(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),S=this.paint.get("line-offset").evaluate(r,a);return S&&(c=(function(P,E){const k=[];for(let z=0;z<P.length;z++){const F=ox(P[z]),B=[];for(let j=0;j<F.length;j++){const G=F[j],Q=F[j-1],q=F[j+1],H=j===0?new D(0,0):G.sub(Q)._unit()._perp(),te=j===F.length-1?new D(0,0):q.sub(G)._unit()._perp(),ae=H._add(te)._unit(),_e=ae.x*te.x+ae.y*te.y;_e!==0&&ae._mult(1/_e),B.push(ae._mult(E)._add(G))}k.push(B)}return k})(c,S*f)),(function(P,E,k){for(let z=0;z<E.length;z++){const F=E[z];if(P.length>=3){for(let B=0;B<F.length;B++)if(jl(P,F[B]))return!0}if(ix(P,F,k))return!0}return!1})(y,c,x)}isTileClipped(){return!0}}function jg(i,e){return e>0?e+2*i:i}const Qx=wr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),eb=wr([{name:"a_projected_pos",components:3,type:"Float32"}],4);wr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const tb=wr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);wr([{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"}]);const Vg=wr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),rb=wr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ib(i,e,r){return i.sections.forEach((a=>{a.text=(function(c,p,f){const y=p.layout.get("text-transform").evaluate(f,{});return y==="uppercase"?c=c.toLocaleUpperCase():y==="lowercase"&&(c=c.toLocaleLowerCase()),ea.applyArabicShaping&&(c=ea.applyArabicShaping(c)),c})(a.text,e,r)})),i}wr([{name:"triangle",components:3,type:"Uint16"}]),wr([{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"}]),wr([{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"}]),wr([{type:"Float32",name:"offsetX"}]),wr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),wr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Zr=24;const Tu={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â¯":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"},nb={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},ab={40:!0};function Ug(i,e,r,a,c,p){if("fontStack"in e){const f=r[e.fontStack],y=f&&f[i];return y?y.metrics.advance*e.scale+c:0}{const f=a[e.imageName];return f?f.displaySize[0]*e.scale*Zr/p+c:0}}function $g(i,e,r,a){const c=Math.pow(i-e,2);return a?i<e?c/2:2*c:c+Math.abs(r)*r}function ob(i,e,r){let a=0;return i===10&&(a-=1e4),r&&(a+=150),i!==40&&i!==65288||(a+=50),e!==41&&e!==65289||(a+=50),a}function Gg(i,e,r,a,c,p){let f=null,y=$g(e,r,c,p);for(const x of a){const S=$g(e-x.x,r,c,p)+x.badness;S<=y&&(f=x,y=S)}return{index:i,x:e,priorBreak:f,badness:y}}function qg(i){return i?qg(i.priorBreak).concat(i.index):[]}class ql{constructor(e="",r=[],a=[]){this.text=e,this.sections=r,this.sectionIndex=a,this.imageSectionID=null}static fromFeature(e,r){const a=new ql;
2for(let c=0;c<e.sections.length;c++){const p=e.sections[c];p.image?a.addImageSection(p):a.addTextSection(p,r)}return a}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=(function(e){let r="",a={premature:!0,value:void 0};const c=e[Symbol.iterator]();let p=c.next();const f=e[Symbol.iterator]();f.next();let y=f.next();for(;!p.done;)r+=!y.done&&Qc(y.value.codePointAt(0))&&!Tu[y.value]||!a.premature&&Qc(a.value.codePointAt(0))&&!Tu[a.value]||!Tu[p.value]?p.value:Tu[p.value],a={value:p.value,premature:!1},p=c.next(),y=f.next();return r})(this.text)}hasZeroWidthSpaces(){return this.text.includes("â")}trim(){const e=this.text.match(/^\s*/),r=e?e[0].length:0,a=this.text.match(/\S\s*$/),c=a?a[0].length-1:0;this.text=this.text.substring(r,this.text.length-c),this.sectionIndex=this.sectionIndex.slice(r,this.sectionIndex.length-c)}substring(e,r){const a=[...this.text].slice(e,r).join(""),c=this.sectionIndex.slice(e,r);return new ql(a,this.sections,c)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,r)=>Math.max(e,this.sections[r].scale)),0)}getMaxImageSize(e){let r=0,a=0;for(let c=0;c<this.length();c++){const p=this.getSection(c);if("imageName"in p){const f=e[p.imageName];if(!f)continue;const y=f.displaySize;r=Math.max(r,y[0]),a=Math.max(a,y[1])}}return{maxImageWidth:r,maxImageHeight:a}}addTextSection(e,r){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||r});const a=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>a)))}addImageSection(e){const r=e.image?e.image.name:"";if(r.length===0)return void $r("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:r}),this.sectionIndex.push(this.sections.length-1)):$r("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,a,c,p){const f=[],y=this.determineAverageLineWidth(e,r,a,c,p),x=this.hasZeroWidthSpaces();let S=0,P=0;const E=this.text[Symbol.iterator]();let k=E.next();const z=this.text[Symbol.iterator]();z.next();let F=z.next();const B=this.text[Symbol.iterator]();B.next(),B.next();let j=B.next();for(;!k.done;){const G=this.getSection(P),Q=k.value.codePointAt(0);if(Xh(Q)||(S+=Ug(Q,G,a,c,e,p)),!F.done){const q=gs(Q),H=F.value.codePointAt(0);(nb[Q]||q||"imageName"in G||!j.done&&ab[H])&&f.push(Gg(P+1,S,y,f,ob(Q,H,q&&x),!1))}P++,k=E.next(),F=z.next(),j=B.next()}return qg(Gg(this.length(),S,y,f,0,!0))}determineAverageLineWidth(e,r,a,c,p){let f=0,y=0;for(const x of this.text){const S=this.getSection(y);f+=Ug(x.codePointAt(0),S,a,c,e,p),y++}return f/Math.max(1,Math.ceil(f/r))}}const hf=4294967296,Zg=1/hf,Wg=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class fp{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,r,a=this.length){for(;this.pos<a;){const c=this.readVarint(),p=c>>3,f=this.pos;this.type=7&c,e(p,r,this),this.pos===f&&this.skip(c)}return r}readMessage(e,r){return this.readFields(e,r,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*hf;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*hf;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const r=this.buf;let a,c;return c=r[this.pos++],a=127&c,c<128?a:(c=r[this.pos++],a|=(127&c)<<7,c<128?a:(c=r[this.pos++],a|=(127&c)<<14,c<128?a:(c=r[this.pos++],a|=(127&c)<<21,c<128?a:(c=r[this.pos],a|=(15&c)<<28,(function(p,f,y){const x=y.buf;let S,P;if(P=x[y.pos++],S=(112&P)>>4,P<128||(P=x[y.pos++],S|=(127&P)<<3,P<128)||(P=x[y.pos++],S|=(127&P)<<10,P<128)||(P=x[y.pos++],S|=(127&P)<<17,P<128)||(P=x[y.pos++],S|=(127&P)<<24,P<128)||(P=x[y.pos++],S|=(1&P)<<31,P<128))return Zl(p,S,f);throw new Error("Expected varint not more than 10 bytes")})(a,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=12&&Wg?Wg.decode(this.buf.subarray(r,e)):(function(a,c,p){let f="",y=c;for(;y<p;){const x=a[y];let S,P,E,k=null,z=x>239?4:x>223?3:x>191?2:1;if(y+z>p)break;z===1?x<128&&(k=x):z===2?(S=a[y+1],(192&S)==128&&(k=(31&x)<<6|63&S,k<=127&&(k=null))):z===3?(S=a[y+1],P=a[y+2],(192&S)==128&&(192&P)==128&&(k=(15&x)<<12|(63&S)<<6|63&P,(k<=2047||k>=55296&&k<=57343)&&(k=null))):z===4&&(S=a[y+1],P=a[y+2],E=a[y+3],(192&S)==128&&(192&P)==128&&(192&E)==128&&(k=(15&x)<<18|(63&S)<<12|(63&P)<<6|63&E,(k<=65535||k>=1114112)&&(k=null))),k===null?(k=65533,z=1):k>
vendor: 5,141 bytes, line 2
265535&&(k-=65536,f+=String.fromCharCode(k>>>10&1023|55296),k=56320|1023&k),f+=String.fromCharCode(k),y+=z}return f})(this.buf,r,e)}readBytes(){const e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r}readPackedVarint(e=[],r){const a=this.readPackedEnd();for(;this.pos<a;)e.push(this.readVarint(r));return e}readPackedSVarint(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){const r=7&e;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(e,r){this.writeVarint(e<<3|r)}realloc(e){let r=this.length||16;for(;r<this.pos+e;)r*=2;if(r!==this.length){const a=new Uint8Array(r);a.set(this.buf),this.buf=a,this.dataView=new DataView(a.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Zg),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Zg),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(r,a){let c,p;if(r>=0?(c=r%4294967296|0,p=r/4294967296|0):(c=~(-r%4294967296),p=~(-r/4294967296),4294967295^c?c=c+1|0:(c=0,p=p+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),(function(f,y,x){x.buf[x.pos++]=127&f|128,f>>>=7,x.buf[x.pos++]=127&f|128,f>>>=7,x.buf[x.pos++]=127&f|128,f>>>=7,x.buf[x.pos++]=127&f|128,x.buf[x.pos]=127&(f>>>=7)})(c,0,a),(function(f,y){const x=(7&f)<<4;y.buf[y.pos++]|=x|((f>>>=3)?128:0),f&&(y.buf[y.pos++]=127&f|((f>>>=7)?128:0),f&&(y.buf[y.pos++]=127&f|((f>>>=7)?128:0),f&&(y.buf[y.pos++]=127&f|((f>>>=7)?128:0),f&&(y.buf[y.pos++]=127&f|((f>>>=7)?128:0),f&&(y.buf[y.pos++]=127&f)))))})(p,a)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const r=this.pos;this.pos=(function(c,p,f){for(let y,x,S=0;S<p.length;S++){if(y=p.charCodeAt(S),y>55295&&y<57344){if(!x){y>56319||S+1===p.length?(c[f++]=239,c[f++]=191,c[f++]=189):x=y;continue}if(y<56320){c[f++]=239,c[f++]=191,c[f++]=189,x=y;continue}y=x-55296<<10|y-56320|65536,x=null}else x&&(c[f++]=239,c[f++]=191,c[f++]=189,x=null);y<128?c[f++]=y:(y<2048?c[f++]=y>>6|192:(y<65536?c[f++]=y>>12|224:(c[f++]=y>>18|240,c[f++]=y>>12&63|128),c[f++]=y>>6&63|128),c[f++]=63&y|128)}return f})(this.buf,e,this.pos);const a=this.pos-r;a>=128&&Hg(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const r=e.length;this.writeVarint(r),this.realloc(r);for(let a=0;a<r;a++)this.buf[this.pos++]=e[a]}writeRawMessage(e,r){this.pos++;const a=this.pos;e(r,this);const c=this.pos-a;c>=128&&Hg(a,c,this),this.pos=a-1,this.writeVarint(c),this.pos+=c}writeMessage(e,r,a){this.writeTag(e,2),this.writeRawMessage(r,a)}writePackedVarint(e,r){r.length&&this.writeMessage(e,sb,r)}writePackedSVarint(e,r){r.length&&this.writeMessage(e,lb,r)}writePackedBoolean(e,r){r.length&&this.writeMessage(e,hb,r)}writePackedFloat(e,r){r.length&&this.writeMessage(e,cb,r)}writePackedDouble(e,r){r.length&&this.writeMessage(e,ub,r)}writePackedFixed32(e,r){r.length&&this.writeMessage(e,pb,r)}writePackedSFixed32(e,r){r.length&&this.writeMessage(e,db,r)}writePackedFixed64(e,r){r.length&&this.writeMessage(e,fb,r)}writePackedSFixed64(e,r){r.length&&this.writeMessage(e,mb,r)}writeBytesField(e,r){this.writeTag(e,2),this.writeBytes(r)}writeFixed32Field(e,r){this.writeTag(e,5),this.writeFixed32(r)}writeSFixed32Field(e,r){this.writeTag(e,5),this.writeSFixed32(r)}
2writeFixed64Field(e,r){this.writeTag(e,1),this.writeFixed64(r)}writeSFixed64Field(e,r){this.writeTag(e,1),this.writeSFixed64(r)}writeVarintField(e,r){this.writeTag(e,0),this.writeVarint(r)}writeSVarintField(e,r){this.writeTag(e,0),this.writeSVarint(r)}writeStringField(e,r){this.writeTag(e,2),this.writeString(r)}writeFloatField(e,r){this.writeTag(e,5),this.writeFloat(r)}writeDoubleField(e,r){this.writeTag(e,1),this.writeDouble(r)}writeBooleanField(e,r){this.writeVarintField(e,+r)}}function Zl(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Hg(i,e,r){const a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(let c=r.pos-1;c>=i;c--)r.buf[c+a]=r.buf[c]}function sb(i,e){for(let r=0;r<i.length;r++)e.writeVarint(i[r])}function lb(i,e){for(let r=0;r<i.length;r++)e.writeSVarint(i[r])}function cb(i,e){for(let r=0;r<i.length;r++)e.writeFloat(i[r])}function ub(i,e){for(let r=0;r<i.length;r++)e.writeDouble(i[r])}function hb(i,e){for(let r=0;r<i.length;r++)e.writeBoolean(i[r])}function pb(i,e){for(let r=0;r<i.length;r++)e.writeFixed32(i[r])}function db(i,e){for(let r=0;r<i.length;r++)e.writeSFixed32(i[r])}function fb(i,e){for(let r=0;r<i.length;r++)e.writeFixed64(i[r])}function mb(i,e){for(let r=0;r<i.length;r++)e.writeSFixed64(i[r])}function gb(i,e,r){i===1&&r.readMessage(yb,e)}function yb(i,e,r){if(i===3){const{id:a,bitmap:c,width:p,height:f,left:y,top:x,advance:S}=r.readMessage(_b,{});e.push({id:a,bitmap:new du({width:p+6,height:f+6},c),metrics:{width:p,height:f,left:y,top:x,advance:S}})}}function _b(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}function Xg(i){let e=0,r=0;for(const f of i)e+=f.w*f.h,r=Math.max(r,f.w);i.sort(((f,y)=>y.h-f.h));const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let c=0,p=0;for(const f of i)for(let y=a.length-1;y>=0;y--){const x=a[y];if(!(f.w>x.w||f.h>x.h)){if(f.x=x.x,f.y=x.y,p=Math.max(p,f.y+f.h),c=Math.max(c,f.x+f.w),f.w===x.w&&f.h===x.h){const S=a.pop();S&&y<a.length&&(a[y]=S)}else f.h===x.h?(x.x+=f.w,x.w-=f.w):f.w===x.w?(x.y+=f.h,x.h-=f.h):(a.push({x:x.x+f.w,y:x.y,w:x.w-f.w,h:f.h}),x.y+=f.h,x.h-=f.h);break}}return{w:c,h:p,fill:e/(c*p)||0}}class pf{constructor(e,{pixelRatio:r,version:a,stretchX:c,stretchY:p,content:f,textFitWidth:y,textFitHeight:x}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=c,this.stretchY=p,this.content=f,this.version=a,this.textFitWidth=y,this.textFitHeight=x}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 Yg{constructor(e,r){const a={},c={};this.haveRenderCallbacks=[];const p=[];this.addImages(e,a,p),this.addImages(r,c,p);const{w:f,h:y}=Xg(p),x=new ki({width:f||1,height:y||1});for(const S in e){const P=e[S],E=a[S].paddedRect;ki.copy(P.data,x,{x:0,y:0},{x:E.x+1,y:E.y+1},P.data)}for(const S in r){const P=r[S],E=c[S].paddedRect,k=E.x+1,z=E.y+1,F=P.data.width,B=P.data.height;ki.copy(P.data,x,{x:0,y:0},{x:k,y:z},P.data),ki.copy(P.data,x,{x:0,y:B-1},{x:k,y:z-1},{width:F,height:1}),ki.copy(P.data,x,{x:0,y:0},{x:k,y:z+B},{width:F,height:1}),ki.copy(P.data,x,{x:F-1,y:0},{x:k-1,y:z},{width:1,height:B}),ki.copy(P.data,x,{x:0,y:0},{x:k+F,y:z},{width:1,height:B})}this.image=x,this.iconPositions=a,this.patternPositions=c}addImages(e,r,a){for(const c in e){const p=e[c],f={x:0,y:0,w:p.data.width+2,h:p.data.height+2};a.push(f),r[c]=new pf(f,p),p.hasRenderCallback&&this.haveRenderCallbacks.push(c)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),r)}patchUpdatedImage(e,r,a){if(!e||!r||e.version===r.version)return;e.version=r.version;const[c,p]=e.tl;a.update(r.data,void 0,{x:c,y:p})}}var wo;function mp(i,e,r,a,c,p,f,y,x,S,P,E,k,z,F){const B=ql.fromFeature(i,c);let j;E===b.az.vertical&&B.verticalizePunctuation();let G=B.determineLineBreaks(S,p,e,a,z);const{processBidirectionalText:Q,processStyledBidirectionalText:q}=ea;if(Q&&B.sections.length===1){j=[],G=G.map((_e=>B.toCodeUnitIndex(_e)));const ae=Q(B.toString(),G);for(const _e of ae){const De=[..._e].map((()=>0));j.push(new ql(_e,B.sections,De))}}else if(q){j=[],G=G.map((Ee=>B.toCodeUnitIndex(Ee)));let ae=0;const _e=[];for(const Ee of B.text)_e.push(...Array(Ee.length).fill(B.sectionIndex[ae])),ae++;const De=q(B.text,_e,G);for(const Ee of De){const Le=[];let Ge="";for(const Be of Ee[0])Le.push(Ee[1][Ge.length]),Ge+=Be;j.push(new ql(Ee[0],B.sections,Le))}}else j=(function(ae,_e){const De=[];let Ee=0;for(const Le of _e)De.push(ae.substring(Ee,Le)),Ee=Le;return Ee<ae.length()&&De.push(ae.substring(Ee,ae.length())),De})(B,G);const H=[],te={positionedLines:H,text:B.toString(),top:P[1],bottom:P[1],left:P[0],right:P[0],writingMode:E,iconsInText:!1,verticalizable:!1};return(function(ae,_e,De,Ee,Le,Ge,Be,Ce,Ie,Qe,Ye,tt){let We=0,ot=0,zt=0,St=0;const lr=Ce==="right"?1:Ce==="left"?0:.5,oi=Zr/tt;let Fr=0;for(const Ft of Le){Ft.trim();const _r=Ft.getMaxScale(),Sr={positionedGlyphs:[],lineOffset:0};ae.positionedLines[Fr]=Sr;const tr=Sr.positionedGlyphs;let Di=0;if(!Ft.length()){ot+=Ge,++Fr;continue}const si=vb(Ee,Ft,oi);let zi=0;for(const Xr of Ft.text){const pr=Ft.getSection(zi),Br=Xr.codePointAt(0),vr=xb(Ie,Ye,Br),Yr={glyph:Br,imageName:null,x:We,y:ot+-17,vertical:vr,scale:1,fontStack:"",sectionIndex:Ft.getSectionIndex(zi),metrics:null,rect:null};let Ba;
vendor: 28,505 bytes, line 2
2if("fontStack"in pr){if(Ba=bb(pr,Br,vr,si,_e,De),!Ba)continue;Yr.fontStack=pr.fontStack}else{if(ae.iconsInText=!0,pr.scale*=oi,Ba=wb(pr,vr,_r,si,Ee),!Ba)continue;Di=Math.max(Di,Ba.imageOffset),Yr.imageName=pr.imageName}const{rect:Ln,metrics:Cu,baselineOffset:Po}=Ba;Yr.y+=Po,Yr.scale=pr.scale,Yr.metrics=Cu,Yr.rect=Ln,tr.push(Yr),vr?(ae.verticalizable=!0,We+=("imageName"in pr?Cu.advance:Zr)*pr.scale+Qe):We+=Cu.advance*pr.scale+Qe,zi++}tr.length!==0&&(zt=Math.max(We-Qe,zt),Tb(tr,0,tr.length-1,lr)),We=0,Sr.lineOffset=Math.max(Di,(_r-1)*Zr);const xn=Ge*_r+Di;ot+=xn,St=Math.max(xn,St),++Fr}const{horizontalAlign:cr,verticalAlign:nr}=df(Be);(function(Ft,_r,Sr,tr,Di,si,zi,xn,Xr){const pr=(_r-Sr)*Di;let Br=0;Br=si!==zi?-xn*tr- -17:-tr*Xr*zi+.5*zi;for(const vr of Ft)for(const Yr of vr.positionedGlyphs)Yr.x+=pr,Yr.y+=Br})(ae.positionedLines,lr,cr,nr,zt,St,Ge,ot,Le.length),ae.top+=-nr*ot,ae.bottom=ae.top+ot,ae.left+=-cr*zt,ae.right=ae.left+zt})(te,e,r,a,j,f,y,x,E,S,k,F),!(function(ae){for(const _e of ae)if(_e.positionedGlyphs.length!==0)return!1;return!0})(H)&&te}function df(i){let e=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function vb(i,e,r){const a=e.getMaxScale()*Zr,{maxImageWidth:c,maxImageHeight:p}=e.getMaxImageSize(i),f=Math.max(a,p*r);return{verticalLineContentWidth:Math.max(a,c*r),horizontalLineContentHeight:f}}function Kg(i){switch(i){case"top":return 0;case"center":return .5;default:return 1}}function xb(i,e,r){return!(i===b.az.horizontal||!e&&!Jc(r)||e&&(Xh(r)||(a=r,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(a)))));var a}function bb(i,e,r,a,c,p){const f=p[i.fontStack],y=(function(S,P,E,k){if(S&&S.rect)return S;const z=P[E.fontStack],F=z&&z[k];return F?{rect:null,metrics:F.metrics}:null})(f&&f[e],c,i,e);if(y===null)return null;let x;if(r)x=a.verticalLineContentWidth-i.scale*Zr;else{const S=Kg(i.verticalAlign);x=(a.horizontalLineContentHeight-i.scale*Zr)*S}return{rect:y.rect,metrics:y.metrics,baselineOffset:x}}function wb(i,e,r,a,c){const p=c[i.imageName];if(!p)return null;const f=p.paddedRect,y=p.displaySize,x={width:y[0],height:y[1],left:1,top:-3,advance:e?y[1]:y[0]};let S;if(e)S=a.verticalLineContentWidth-y[1]*i.scale;else{const P=Kg(i.verticalAlign);S=(a.horizontalLineContentHeight-y[1]*i.scale)*P}return{rect:f,metrics:x,baselineOffset:S,imageOffset:(e?y[0]:y[1])*i.scale-Zr*r}}function Tb(i,e,r,a){if(a===0)return;const c=i[r],p=(i[r].x+c.metrics.advance*c.scale)*a;for(let f=e;f<=r;f++)i[f].x-=p}function Sb(i,e,r){const{horizontalAlign:a,verticalAlign:c}=df(r),p=e[0]-i.displaySize[0]*a,f=e[1]-i.displaySize[1]*c;return{image:i,top:f,bottom:f+i.displaySize[1],left:p,right:p+i.displaySize[0]}}function Jg(i){var e,r;let a=i.left,c=i.top,p=i.right-a,f=i.bottom-c;const y=(e=i.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",x=(r=i.image.textFitHeight)!==null&&r!==void 0?r:"stretchOrShrink",S=(i.image.content[2]-i.image.content[0])/(i.image.content[3]-i.image.content[1]);if(x==="proportional"){if(y==="stretchOnly"&&p/f<S||y==="proportional"){const P=Math.ceil(f*S);a*=P/p,p=P}}else if(y==="proportional"&&x==="stretchOnly"&&S!==0&&p/f>S){const P=Math.ceil(p/S);c*=P/f,f=P}return{x1:a,y1:c,x2:a+p,y2:c+f}}function Qg(i,e,r,a,c,p){const f=i.image;let y;if(f.content){const j=f.content,G=f.pixelRatio||1;y=[j[0]/G,j[1]/G,f.displaySize[0]-j[2]/G,f.displaySize[1]-j[3]/G]}const x=e.left*p,S=e.right*p;let P,E,k,z;r==="width"||r==="both"?(z=c[0]+x-a[3],E=c[0]+S+a[1]):(z=c[0]+(x+S-f.displaySize[0])/2,E=z+f.displaySize[0]);const F=e.top*p,B=e.bottom*p;return r==="height"||r==="both"?(P=c[1]+F-a[0],k=c[1]+B+a[2]):(P=c[1]+(F+B-f.displaySize[1])/2,k=P+f.displaySize[1]),{image:f,top:P,right:E,bottom:k,left:z,collisionPadding:y}}et("ImagePosition",pf),et("ImageAtlas",Yg),b.az=void 0,(wo=b.az||(b.az={}))[wo.none=0]="none",wo[wo.horizontal=1]="horizontal",wo[wo.vertical=2]="vertical",wo[wo.horizontalOnly=3]="horizontalOnly";const Ra=128,To=32640;function ey(i,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new $t(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:c}=r;let p=0;for(;p<a.length&&a[p]<=i;)p++;p=Math.max(0,p-1);let f=p;for(;f<a.length&&a[f]<i+1;)f++;f=Math.min(a.length-1,f);const y=a[p],x=a[f];return r.kind==="composite"?{kind:"composite",minZoom:y,maxZoom:x,interpolationType:c}:{kind:"camera",minZoom:y,maxZoom:x,minSize:r.evaluate(new $t(y)),maxSize:r.evaluate(new $t(x)),interpolationType:c}}}function ff(i,e,r){let a="never";const c=i.get(e);return c?a=c:i.get(r)&&(a="always"),a}const Mb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function gp(i,e,r,a,c,p,f,y,x,S,P,E,k){const z=y?Math.min(To,Math.round(y[0])):0,F=y?Math.min(To,Math.round(y[1])):0;i.emplaceBack(e,r,Math.round(32*a),Math.round(32*c),p,f,(z<<1)+(x?1:0),F,16*S,16*P,256*E,256*k)}function mf(i,e,r){i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r)}function Ib(i){for(const e of i.sections)if(Jh(e.text))return!0;return!1}class gf{constructor(e){this.layoutVertexArray=new ie,this.indexArray=new Se,this.programConfigurations=e,this.segments=new Ze,this.dynamicLayoutVertexArray=new fe,this.opacityVertexArray=new Ae,this.hasVisibleVertices=!1,this.placedSymbolArray=new _}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,a,c){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qx.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,eb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Mb,!0),this.opacityVertexBuffer.itemSize=1),(a||c)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}et("SymbolBuffers",gf);class yf{constructor(e,r,a){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new a,this.segments=new Ze,this.collisionVertexArray=new Te}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,tb.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}et("CollisionBuffers",yf);class Wl{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((f=>f.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ey(this.zoom,r["text-size"]),this.iconSizeData=ey(this.zoom,r["icon-size"]);const a=this.layers[0].layout,c=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=ff(a,"text-overlap","text-allow-overlap")!=="never"||ff(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!c.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map((f=>b.az[f]))),this.stateDependentLayerIds=this.layers.filter((f=>f.isStateDependent())).map((f=>f.id)),this.sourceID=e.sourceID}createArrays(){this.text=new gf(new La(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new gf(new La(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new A,this.lineVertexArray=new C,this.symbolInstances=new I,this.textAnchorOffsets=new L}calculateGlyphDependencies(e,r,a,c,p){for(const f of e)if(r[f.codePointAt(0)]=!0,(a||c)&&p){const y=Tu[f];y&&(r[y.codePointAt(0)]=!0)}}populate(e,r,a){const c=this.layers[0],p=c.layout,f=p.get("text-font"),y=p.get("text-field"),x=p.get("icon-image"),S=(y.value.kind!=="constant"||y.value.value instanceof Ti&&!y.value.value.isEmpty()||y.value.value.toString().length>0)&&(f.value.kind!=="constant"||f.value.value.length>0),P=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,E=p.get("symbol-sort-key");if(this.features=[],!S&&!P)return;const k=r.iconDependencies,z=r.glyphDependencies,F=r.availableImages,B=new $t(this.zoom);for(const{feature:j,id:G,index:Q,sourceLayerIndex:q}of e){const H=c._featureFilter.needGeometry,te=na(j,H);if(!c._featureFilter.filter(B,te,a))continue;let ae,_e;if(H||(te.geometry=ia(j)),S){const Ee=c.getValueAndResolveTokens("text-field",te,a,F),Le=Ti.factory(Ee),Ge=this.hasRTLText=this.hasRTLText||Ib(Le);(!Ge||ea.getRTLTextPluginStatus()==="unavailable"||Ge&&ea.isParsed())&&(ae=ib(Le,c,te))}if(P){const Ee=c.getValueAndResolveTokens("icon-image",te,a,F);_e=Ee instanceof Ei?Ee:Ei.fromString(Ee)}if(!ae&&!_e)continue;const De=this.sortFeaturesByKey?E.evaluate(te,{},a):void 0;if(this.features.push({id:G,text:ae,icon:_e,index:Q,sourceLayerIndex:q,geometry:te.geometry,properties:j.properties,type:xu.types[j.type],sortKey:De}),_e&&(k[_e.name]=!0),ae){const Ee=f.evaluate(te,{},a).join(","),Le=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.az.vertical)>=0;for(const Ge of ae.sections)if(Ge.image)k[Ge.image.name]=!0;else{const Be=xo(ae.toString()),Ce=Ge.fontStack||Ee,Ie=z[Ce]=z[Ce]||{};this.calculateGlyphDependencies(Ge.text,Ie,Le,this.allowVerticalPlacement,Be)}}}p.get("symbol-placement")==="line"&&(this.features=(function(j){const G={},Q={},q=[];let H=0;function te(Ee){q.push(j[Ee]),H++}function ae(Ee,Le,Ge){const Be=Q[Ee];return delete Q[Ee],Q[Le]=Be,q[Be].geometry[0].pop(),q[Be].geometry[0]=q[Be].geometry[0].concat(Ge[0]),Be}function _e(Ee,Le,Ge){const Be=G[Le];return delete G[Le],G[Ee]=Be,q[Be].geometry[0].shift(),q[Be].geometry[0]=Ge[0].concat(q[Be].geometry[0]),Be}function De(Ee,Le,Ge){const Be=Ge?Le[0][Le[0].length-1]:Le[0][0];return`${Ee}:${Be.x}:${Be.y}`}for(let Ee=0;Ee<j.length;Ee++){const Le=j[Ee],Ge=Le.geometry,Be=Le.text?Le.text.toString():null;if(!Be){te(Ee);continue}const Ce=De(Be,Ge),Ie=De(Be,Ge,!0);if(Ce in Q&&Ie in G&&Q[Ce]!==G[Ie]){const Qe=_e(Ce,Ie,Ge),Ye=ae(Ce,Ie,q[Qe].geometry);delete G[Ce],delete Q[Ie],Q[De(Be,q[Ye].geometry,!0)]=Ye,q[Qe].geometry=null}else Ce in Q?ae(Ce,Ie,Ge):Ie in G?_e(Ce,Ie,Ge):(te(Ee),G[Ce]=H-1,Q[Ie]=H-1)}return q.filter((Ee=>Ee.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((j,G)=>j.sortKey-G.sortKey))}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:a}),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:a}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let c=e.dist(r[e.segment+1]),p=e.dist(r[e.segment]);const f={};for(let y=e.segment+1;y<r.length;y++)f[y]={x:r[y].x,y:r[y].y,tileUnitDistanceFromAnchor:c},y<r.length-1&&(c+=r[y+1].dist(r[y]));for(let y=e.segment||0;y>=0;y--)f[y]={x:r[y].x,y:r[y].y,tileUnitDistanceFromAnchor:p},y>0&&(p+=r[y-1].dist(r[y]));for(let y=0;y<r.length;y++){const x=f[y];this.lineVertexArray.emplaceBack(x.x,x.y,x.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,r,a,c,p,f,y,x,S,P,E,k){const z=e.indexArray,F=e.layoutVertexArray,B=e.segments.prepareSegment(4*r.length,F,z,this.canOverlap?f.sortKey:void 0),j=this.glyphOffsetArray.length,G=B.vertexLength,Q=this.allowVerticalPlacement&&y===b.az.vertical?Math.PI/2:0,q=f.text&&f.text.sections;for(let H=0;H<r.length;H++){const{tl:te,tr:ae,bl:_e,br:De,tex:Ee,pixelOffsetTL:Le,pixelOffsetBR:Ge,minFontScaleX:Be,minFontScaleY:Ce,glyphOffset:Ie,isSDF:Qe,sectionIndex:Ye}=r[H],tt=B.vertexLength,We=Ie[1];gp(F,x.x,x.y,te.x,We+te.y,Ee.x,Ee.y,a,Qe,Le.x,Le.y,Be,Ce),gp(F,x.x,x.y,ae.x,We+ae.y,Ee.x+Ee.w,Ee.y,a,Qe,Ge.x,Le.y,Be,Ce),gp(F,x.x,x.y,_e.x,We+_e.y,Ee.x,Ee.y+Ee.h,a,Qe,Le.x,Ge.y,Be,Ce),gp(F,x.x,x.y,De.x,We+De.y,Ee.x+Ee.w,Ee.y+Ee.h,a,Qe,Ge.x,Ge.y,Be,Ce),mf(e.dynamicLayoutVertexArray,x,Q),z.emplaceBack(tt,tt+2,tt+1),z.emplaceBack(tt+1,tt+2,tt+3),B.vertexLength+=4,B.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ie[0]),H!==r.length-1&&Ye===r[H+1].sectionIndex||e.programConfigurations.populatePaintArrays(F.length,f,f.index,{imagePositions:{},canonical:k,formattedSection:q&&q[Ye]})}e.placedSymbolArray.emplaceBack(x.x,x.y,j,this.glyphOffsetArray.length-j,G,S,P,x.segment,a?a[0]:0,a?a[1]:0,c[0],c[1],y,0,!1,0,E)}_addCollisionDebugVertex(e,r,a,c,p,f){return r.emplaceBack(0,0),e.emplaceBack(a.x,a.y,c,p,Math.round(f.x),Math.round(f.y))}addCollisionDebugVertices(e,r,a,c,p,f,y){const x=p.segments.prepareSegment(4,p.layoutVertexArray,p.indexArray),S=x.vertexLength,P=p.layoutVertexArray,E=p.collisionVertexArray,k=y.anchorX,z=y.anchorY;this._addCollisionDebugVertex(P,E,f,k,z,new D(e,r)),this._addCollisionDebugVertex(P,E,f,k,z,new D(a,r)),this._addCollisionDebugVertex(P,E,f,k,z,new D(a,c)),this._addCollisionDebugVertex(P,E,f,k,z,new D(e,c)),x.vertexLength+=4;const F=p.indexArray;F.emplaceBack(S,S+1),F.emplaceBack(S+1,S+2),F.emplaceBack(S+2,S+3),F.emplaceBack(S+3,S),x.primitiveLength+=4}addDebugCollisionBoxes(e,r,a,c){for(let p=e;p<r;p++){const f=this.collisionBoxArray.get(p);this.addCollisionDebugVertices(f.x1,f.y1,f.x2,f.y2,c?this.textCollisionBox:this.iconCollisionBox,f.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yf(be,Vg.members,Ve),this.iconCollisionBox=new yf(be,Vg.members,Ve);for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,a,c,p,f,y,x,S){const P={};for(let E=r;E<a;E++){const k=e.get(E);P.textBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.textFeatureIndex=k.featureIndex;break}for(let E=c;E<p;E++){const k=e.get(E);P.verticalTextBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.verticalTextFeatureIndex=k.featureIndex;break}for(let E=f;E<y;E++){const k=e.get(E);P.iconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.iconFeatureIndex=k.featureIndex;break}for(let E=x;E<S;E++){const k=e.get(E);P.verticalIconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.verticalIconFeatureIndex=k.featureIndex;break}return P}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const a=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const a=e.placedSymbolArray.get(r),c=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;p<c;p+=4)e.indexArray.emplaceBack(p,p+2,p+1),e.indexArray.emplaceBack(p+1,p+2,p+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),a=Math.cos(e),c=[],p=[],f=[];for(let y=0;y<this.symbolInstances.length;++y){f.push(y);const x=this.symbolInstances.get(y);c.push(0|Math.round(r*x.anchorX+a*x.anchorY)),p.push(x.featureIndex)}return f.sort(((y,x)=>c[y]-c[x]||p[x]-p[y])),f}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(((c,p,f)=>{c>=0&&f.indexOf(c)===p&&this.addIndicesForPlacedSymbol(this.text,c)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let ty,ry;et("SymbolBucket",Wl,{omit:["layers","collisionBoxArray","features","compareText"]}),Wl.MAX_GLYPHS=65535,Wl.addDynamicAttributes=mf;var _f={get paint(){return ry=ry||new _i({"icon-opacity":new lt(we.paint_symbol["icon-opacity"]),"icon-color":new lt(we.paint_symbol["icon-color"]),"icon-halo-color":new lt(we.paint_symbol["icon-halo-color"]),"icon-halo-width":new lt(we.paint_symbol["icon-halo-width"]),"icon-halo-blur":new lt(we.paint_symbol["icon-halo-blur"]),"icon-translate":new at(we.paint_symbol["icon-translate"]),"icon-translate-anchor":new at(we.paint_symbol["icon-translate-anchor"]),"text-opacity":new lt(we.paint_symbol["text-opacity"]),"text-color":new lt(we.paint_symbol["text-color"],{runtimeType:Ai,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new lt(we.paint_symbol["text-halo-color"]),"text-halo-width":new lt(we.paint_symbol["text-halo-width"]),"text-halo-blur":new lt(we.paint_symbol["text-halo-blur"]),"text-translate":new at(we.paint_symbol["text-translate"]),"text-translate-anchor":new at(we.paint_symbol["text-translate-anchor"])})},get layout(){return ty=ty||new _i({"symbol-placement":new at(we.layout_symbol["symbol-placement"]),"symbol-spacing":new at(we.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new at(we.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new lt(we.layout_symbol["symbol-sort-key"]),"symbol-z-order":new at(we.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new at(we.layout_symbol["icon-allow-overlap"]),"icon-overlap":new at(we.layout_symbol["icon-overlap"]),"icon-ignore-placement":new at(we.layout_symbol["icon-ignore-placement"]),"icon-optional":new at(we.layout_symbol["icon-optional"]),"icon-rotation-alignment":new at(we.layout_symbol["icon-rotation-alignment"]),"icon-size":new lt(we.layout_symbol["icon-size"]),"icon-text-fit":new at(we.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new at(we.layout_symbol["icon-text-fit-padding"]),"icon-image":new lt(we.layout_symbol["icon-image"]),"icon-rotate":new lt(we.layout_symbol["icon-rotate"]),"icon-padding":new lt(we.layout_symbol["icon-padding"]),"icon-keep-upright":new at(we.layout_symbol["icon-keep-upright"]),"icon-offset":new lt(we.layout_symbol["icon-offset"]),"icon-anchor":new lt(we.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new at(we.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new at(we.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new at(we.layout_symbol["text-rotation-alignment"]),"text-field":new lt(we.layout_symbol["text-field"]),"text-font":new lt(we.layout_symbol["text-font"]),"text-size":new lt(we.layout_symbol["text-size"]),"text-max-width":new lt(we.layout_symbol["text-max-width"]),"text-line-height":new at(we.layout_symbol["text-line-height"]),"text-letter-spacing":new lt(we.layout_symbol["text-letter-spacing"]),"text-justify":new lt(we.layout_symbol["text-justify"]),"text-radial-offset":new lt(we.layout_symbol["text-radial-offset"]),"text-variable-anchor":new at(we.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new lt(we.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new lt(we.layout_symbol["text-anchor"]),"text-max-angle":new at(we.layout_symbol["text-max-angle"]),"text-writing-mode":new at(we.layout_symbol["text-writing-mode"]),"text-rotate":new lt(we.layout_symbol["text-rotate"]),"text-padding":new at(we.layout_symbol["text-padding"]),"text-keep-upright":new at(we.layout_symbol["text-keep-upright"]),"text-transform":new lt(we.layout_symbol["text-transform"]),"text-offset":new lt(we.layout_symbol["text-offset"]),"text-allow-overlap":new at(we.layout_symbol["text-allow-overlap"]),"text-overlap":new at(we.layout_symbol["text-overlap"]),"text-ignore-placement":new at(we.layout_symbol["text-ignore-placement"]),"text-optional":new at(we.layout_symbol["text-optional"])})}};class iy{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Bi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}et("FormatSectionOverride",iy,{omit:["defaultValue"]});class yp extends Vi{constructor(e,r){super(e,_f,r)}recalculate(e,r){if(super.recalculate(e,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"){const a=this.layout.get("text-writing-mode");if(a){const c=[];for(const p of a)c.indexOf(p)<0&&c.push(p);this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,c){const p=this.layout.get(e).evaluate(r,{},a,c),f=this._unevaluatedLayout._values[e];return f.isDataDriven()||mo(f.value)||!p?p:(function(y,x){return x.replace(/{([^{}]+)}/g,((S,P)=>y&&P in y?String(y[P]):""))})(r.properties,p)}createBucket(e){return new Wl(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of _f.paint.overridableProperties){if(!yp.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new iy(r),c=new jc(a,r.property.specification);let p=null;p=r.value.kind==="constant"||r.value.kind==="source"?new _l("source",c):new Vc("composite",c,r.value.zoomStops),this.paint._values[e]=new en(r.property,p,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&yp.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),c=_f.paint.properties[r];let p=!1;const f=y=>{for(const x of y)if(c.overrides&&c.overrides.hasOverride(x))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Ti)f(a.value.value.sections);else if(a.value.kind==="source"||a.value.kind==="composite"){const y=S=>{p||(S instanceof gn&&xr(S.value)===Uo?f(S.value.sections):S instanceof Jo?f(S.sections):S.eachChild(y))},x=a.value;x._styleExpression&&y(x._styleExpression.expression)}return p}}let ny;var Pb={get paint(){return ny=ny||new _i({"background-color":new at(we.paint_background["background-color"]),"background-pattern":new Cl(we.paint_background["background-pattern"]),"background-opacity":new at(we.paint_background["background-opacity"])})}};class Ab extends Vi{constructor(e,r){super(e,Pb,r)}}class Eb extends Vi{constructor(e,r){super(e,{},r),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.painter.context.gl)},this.implementation=e}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 Cb{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const kb={once:!0},vf=63710088e-1;class So{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new So(Pn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,c=e.lat*r,p=Math.sin(a)*Math.sin(c)+Math.cos(a)*Math.cos(c)*Math.cos((e.lng-this.lng)*r);return vf*Math.acos(Math.min(p,1))}static convert(e){if(e instanceof So)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new So(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new So(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const ay=2*Math.PI*vf;function oy(i){return ay*Math.cos(i*Math.PI/180)}function sy(i){return(180+i)/360}function ly(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function cy(i,e){return i/oy(e)}function uy(i){return 360*i-180}function _p(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180)
2)-90}function hy(i,e){return i*oy(_p(e))}class Su{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=So.convert(e);return new Su(sy(a.lng),ly(a.lat),cy(r,a.lat))}toLngLat(){return new So(uy(this.x),_p(this.y))}toAltitude(){return hy(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ay*(e=_p(this.y),1/Math.cos(e*Math.PI/180));var e}}function py(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class xf{constructor(e,r,a){if(!(function(c,p,f){return!(c<0||c>25||f<0||f>=Math.pow(2,c)||p<0||p>=Math.pow(2,c))})(e,r,a))throw new Error(`x=${r}, y=${a}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=a,this.key=Hl(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const c=(function(f,y,x){var S=py(256*f,256*(y=Math.pow(2,x)-y-1),x),P=py(256*(f+1),256*(y+1),x);return S[0]+","+S[1]+","+P[0]+","+P[1]})(this.x,this.y,this.z),p=(function(f,y,x){let S,P="";for(let E=f;E>0;E--)S=1<<E-1,P+=(y&S?1:0)+(x&S?2:0);return P})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,p).replace(/{bbox-epsg-3857}/g,c)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new D((e.x*r-this.x)*Ot,(e.y*r-this.y)*Ot)}toString(){return`${this.z}/${this.x}/${this.y}`}}class dy{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Hl(e,r.z,r.z,r.x,r.y)}}class nn{constructor(e,r,a,c,p){if(this.terrainRttPosMatrix32f=null,e<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new xf(a,+c,+p),this.key=Hl(r,e,a,c,p)}clone(){return new nn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new nn(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nn(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-e;return e>this.canonical.z?Hl(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Hl(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;const r=this.canonical.z-e.canonical.z;return!(r<0)&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new nn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,c=2*this.canonical.y;return[new nn(r,this.wrap,r,a,c),new nn(r,this.wrap,r,a+1,c),new nn(r,this.wrap,r,a,c+1),new nn(r,this.wrap,r,a+1,c+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new nn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new nn(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new dy(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Su(e.x-this.wrap,e.y))}}function Hl(i,e,r,a,c){(i*=2)<0&&(i=-1*i-1);const p=1<<r;return(p*p*i+p*c+a).toString(36)+r.toString(36)+e.toString(36)}function bf(i,e){return e?i.properties[e]:i.id}function Db(i,e){const r={id:i.id};if(e.removeAllProperties&&(delete i.removeProperties,delete i.addOrUpdateProperties,delete e.removeProperties),e.removeProperties)for(const a of e.removeProperties){const c=i.addOrUpdateProperties.findIndex((p=>p.key===a));c>-1&&i.addOrUpdateProperties.splice(c,1)}return(i.removeAllProperties||e.removeAllProperties)&&(r.removeAllProperties=!0),(i.removeProperties||e.removeProperties)&&(r.removeProperties=[...i.removeProperties||[],...e.removeProperties||[]]),(i.addOrUpdateProperties||e.addOrUpdateProperties)&&(r.addOrUpdateProperties=[...i.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(i.newGeometry||e.newGeometry)&&(r.newGeometry=e.newGeometry||i.newGeometry),r}function fy(i){var e,r;if(!i)return{};const a={};
2return a.removeAll=i.removeAll,a.remove=new Set(i.remove||[]),a.add=new Map((e=i.add)===null||e===void 0?void 0:e.map((c=>[c.id,c]))),a.update=new Map((r=i.update)===null||r===void 0?void 0:r.map((c=>[c.id,c]))),a}et("CanonicalTileID",xf),et("OverscaledTileID",nn,{omit:["terrainRttPosMatrix32f"]});class Es{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){const r=new Es;return r.extend(e(new D(this.minX,this.minY))),r.extend(e(new D(this.maxX,this.minY))),r.extend(e(new D(this.minX,this.maxY))),r.extend(e(new D(this.maxX,this.maxY))),r}static fromPoints(e){const r=new Es;for(const a of e)r.extend(a);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class my{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const a=e[r];this._stringToNumber[a]=r,this._numberToString[r]=a}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class gy{constructor(e,r,a,c,p){this.type="Feature",this._vectorTileFeature=e,this._x=a,this._y=c,this._z=r,this.properties=e.properties,this.id=p}projectPoint(e,r,a,c){return[360*(e.x+r)/c-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+a)/c)*Math.PI))-90]}projectLine(e,r,a,c){return e.map((p=>this.projectPoint(p,r,a,c)))}get geometry(){if(this._geometry)return this._geometry;const e=this._vectorTileFeature,r=e.extent*Math.pow(2,this._z),a=e.extent*this._x,c=e.extent*this._y,p=e.loadGeometry();switch(e.type){case 1:{const f=[];for(const x of p)f.push(x[0]);const y=this.projectLine(f,a,c,r);this._geometry=f.length===1?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y};break}case 2:{const f=p.map((y=>this.projectLine(y,a,c,r)));this._geometry=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f};break}case 3:{const f=kg(p),y=[];for(const x of f)y.push(x.map((S=>this.projectLine(S,a,c,r))));this._geometry=y.length===1?{type:"Polygon",coordinates:y[0]}:{type:"MultiPolygon",coordinates:y};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(e[r]=this[r]);return e}}class Xl{_name;dataBuffer;nullabilityBuffer;_size;constructor(e,r,a){this._name=e,this.dataBuffer=r,typeof a=="number"?this._size=a:(this.nullabilityBuffer=a,this._size=a.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer&&this.nullabilityBuffer.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class vp extends Xl{}class wf extends vp{getValueFromBuffer(e){return this.dataBuffer[e]}}class Tf extends vp{getValueFromBuffer(e){return this.dataBuffer[e]}}class yy extends Xl{delta;constructor(e,r,a,c){super(e,r,c),this.delta=a}}class Sf extends yy{constructor(e,r,a,c){super(e,Int32Array.of(r),a,c)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class Mf extends Xl{constructor(e,r,a){super(e,Int32Array.of(r),a)}getValueFromBuffer(e){return this.dataBuffer[0]}}class zb{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(e,r,a,c,p=4096){this._name=e,this._geometryVector=r,this._idVector=a,this._propertyVectors=c,this._extent=p}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((r=>[r.name,r])))),this.propertyVectorsMap.get(e)}*[Symbol.iterator](){const e=this.geometryVector[Symbol.iterator]();let r=0;for(;r<this.numFeatures;){let a;this.idVector&&(a=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(r)):this.idVector.getValue(r));const c=e?.next().value,p={};
vendor: 21,768 bytes, line 2
2for(const f of this.propertyVectors){if(!f)continue;const y=f.name,x=f.getValue(r);x!==null&&(p[y]=x)}r++,yield{id:a,geometry:c,properties:p}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){const e=[],r=this.geometryVector.getGeometries();for(let a=0;a<this.numFeatures;a++){let c;this.idVector&&(c=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(a)):this.idVector.getValue(a));const p={coordinates:r[a],type:this.geometryVector.geometryType(a)},f={};for(const y of this.propertyVectors){if(!y)continue;const x=y.name,S=y.getValue(a);S!==null&&(f[x]=S)}e.push({id:c,geometry:p,properties:f})}return e}containsMaxSaveIntegerValues(e){return e instanceof wf||e instanceof Mf&&e instanceof Sf||e instanceof Tf}}class Lb{value;constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Pt,Fa,ni,Dn,Cs,$i,Wr,Hr,_y,an;function ti(i,e,r){const a=new Int32Array(r);let c=0,p=e.get();for(let f=0;f<a.length;f++){let y=i[p++],x=127&y;y<128||(y=i[p++],x|=(127&y)<<7,y<128||(y=i[p++],x|=(127&y)<<14,y<128||(y=i[p++],x|=(127&y)<<21,y<128||(y=i[p++],x|=(15&y)<<28)))),a[c++]=x}return e.set(p),a}function xp(i,e,r){const a=new BigInt64Array(r);for(let c=0;c<a.length;c++)a[c]=Fb(i,e);return a}function Rb(i,e){let r,a;return a=i[e.get()],e.increment(),r=127&a,a<128?r:(a=i[e.get()],e.increment(),r|=(127&a)<<7,a<128?r:(a=i[e.get()],e.increment(),r|=(127&a)<<14,a<128?r:(a=i[e.get()],e.increment(),r|=(127&a)<<21,a<128?r:(a=i[e.get()],r|=(15&a)<<28,(function(c,p,f){let y,x;if(x=p[f.get()],f.increment(),y=(112&x)>>4,x<128||(x=p[f.get()],f.increment(),y|=(127&x)<<3,x<128)||(x=p[f.get()],f.increment(),y|=(127&x)<<10,x<128)||(x=p[f.get()],f.increment(),y|=(127&x)<<17,x<128)||(x=p[f.get()],f.increment(),y|=(127&x)<<24,x<128)||(x=p[f.get()],f.increment(),y|=(1&x)<<31,x<128))return 4294967296*y+(c>>>0);throw new Error("Expected varint not more than 10 bytes")})(r,i,e)))))}function vy(i,e,r,a){throw new Error("FastPFor is not implemented yet.")}function ks(i){return i>>>1^-(1&i)}function Yl(i){return i>>1n^-(1n&i)}function Fb(i,e){let r=0n,a=0,c=e.get();for(;c<i.length;){const p=i[c++];if(r|=BigInt(127&p)<<BigInt(a),!(128&p))break;if(a+=7,a>=64)throw new Error("Varint too long")}return e.set(c),r}function xy(i,e,r){const a=new Int32Array(r);let c=0;for(let p=0;p<e;p++){const f=i[p];a.fill(i[p+e],c,c+f),c+=f}return a}function by(i,e,r){const a=new BigInt64Array(r);let c=0;for(let p=0;p<e;p++){const f=Number(i[p]);a.fill(i[p+e],c,c+f),c+=f}return a}function wy(i,e,r){const a=new Float64Array(r);let c=0;for(let p=0;p<e;p++){const f=i[p];a.fill(i[p+e],c,c+f),c+=f}return a}function If(i){const e=i.length/4*4;let r=1;if(e>=4)for(let a=i[0];r<e-4;r+=4)a=i[r]+=a,a=i[r+1]+=a,a=i[r+2]+=a,a=i[r+3]+=a;for(;r!=i.length;)i[r]+=i[r-1],++r}function Ty(i){i[0]=i[0]>>>1^-(1&i[0]),i[1]=i[1]>>>1^-(1&i[1]);const e=i.length/4*4;let r=2;if(e>=4)for(;r<e-4;r+=4){const a=i[r],c=i[r+1],p=i[r+2],f=i[r+3];i[r]=(a>>>1^-(1&a))+i[r-2],i[r+1]=(c>>>1^-(1&c))+i[r-1],i[r+2]=(p>>>1^-(1&p))+i[r],i[r+3]=(f>>>1^-(1&f))+i[r+1]}for(;r!=i.length;r+=2)i[r]=(i[r]>>>1^-(1&i[r]))+i[r-2],i[r+1]=(i[r+1]>>>1^-(1&i[r+1]))+i[r-1]}(function(i){i.NONE="NONE",i.DELTA="DELTA",i.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",i.RLE="RLE",i.MORTON="MORTON",i.PDE="PDE"})(Pt||(Pt={})),(function(i){i.NONE="NONE",i.FAST_PFOR="FAST_PFOR",i.VARINT="VARINT",i.ALP="ALP"})(Fa||(Fa={})),(function(i){i.PRESENT="PRESENT",i.DATA="DATA",i.OFFSET="OFFSET",i.LENGTH="LENGTH"})(ni||(ni={}));class Pf{_dictionaryType;_offsetType;_lengthType;constructor(e,r,a){this._dictionaryType=e,this._offsetType=r,this._lengthType=a}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function Ii(i,e){const r=(function(a,c){const p=a[c.get()],f=Object.values(ni)[p>>4];let y=null;switch(f){case ni.DATA:y=new Pf(Object.values(Dn)[15&p]);break;case ni.OFFSET:y=new Pf(null,Object.values(Cs)[15&p]);break;case ni.LENGTH:y=new Pf(null,null,Object.values($i)[15&p])}c.increment();const x=a[c.get()],S=Object.values(Pt)[x>>5],P=Object.values(Pt)[x>>2&7],E=Object.values(Fa)[3&x];c.increment();const k=ti(a,c,2),z=k[0];return{physicalStreamType:f,logicalStreamType:y,logicalLevelTechnique1:S,logicalLevelTechnique2:P,physicalLevelTechnique:E,numValues:z,byteLength:k[1],decompressedCount:z}})(i,e);return r.logicalLevelTechnique1===Pt.MORTON?(function(a,c,p){const f=ti(c,p,2);return{physicalStreamType:a.physicalStreamType,logicalStreamType:a.logicalStreamType,logicalLevelTechnique1:a.logicalLevelTechnique1,logicalLevelTechnique2:a.logicalLevelTechnique2,physicalLevelTechnique:a.physicalLevelTechnique,numValues:a.numValues,byteLength:a.byteLength,decompressedCount:a.decompressedCount,numBits:f[0],coordinateShift:f[1]}})(r,i,e):Pt.RLE!==r.logicalLevelTechnique1&&Pt.RLE!==r.logicalLevelTechnique2||Fa.NONE===r.physicalLevelTechnique?r:(function(a,c,p){const f=ti(c,p,2);return{physicalStreamType:a.physicalStreamType,logicalStreamType:a.logicalStreamType,logicalLevelTechnique1:a.logicalLevelTechnique1,logicalLevelTechnique2:a.logicalLevelTechnique2,physicalLevelTechnique:a.physicalLevelTechnique,numValues:a.numValues,byteLength:a.byteLength,decompressedCount:f[1],runs:f[0],numRleValues:f[1]}})(r,i,e)}(function(i){i.NONE="NONE",i.SINGLE="SINGLE",i.SHARED="SHARED",i.VERTEX="VERTEX",i.MORTON="MORTON",i.FSST="FSST"})(Dn||(Dn={})),(function(i){i.VERTEX="VERTEX",i.INDEX="INDEX",i.STRING="STRING",i.KEY="KEY"})(Cs||(Cs={})),(function(i){i.VAR_BINARY="VAR_BINARY",i.GEOMETRIES="GEOMETRIES",i.PARTS="PARTS",i.RINGS="RINGS",i.TRIANGLES="TRIANGLES",i.SYMBOL="SYMBOL",i.DICTIONARY="DICTIONARY"})($i||($i={})),(function(i){i[i.FLAT=0]="FLAT",i[i.CONST=1]="CONST",i[i.SEQUENCE=2]="SEQUENCE",i[i.DICTIONARY=3]="DICTIONARY",i[i.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(Wr||(Wr={}));class zn{values;_size;constructor(e,r){this.values=e,this._size=r}get(e){const r=Math.floor(e/8);return(this.values[r]>>e%8&1)==1}set(e,r){const a=Math.floor(e/8);this.values[a]=this.values[a]|(r?1:0)<<e%8}getInt(e){const r=Math.floor(e/8);return this.values[r]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function Pi(i,e,r,a,c){return(function(p,f,y){switch(f.logicalLevelTechnique1){case Pt.DELTA:return f.logicalLevelTechnique2===Pt.RLE?(function(x,S,P){const E=new Int32Array(P);let k=0,z=0;for(let F=0;F<S;F++){const B=x[F],j=ks(x[F+S]);for(let G=0;G<B;G++)z+=j,E[k++]=z}return E})(p,f.runs,f.numRleValues):((function(x){x[0]=x[0]>>>1^-(1&x[0]);const S=x.length/4*4;let P=1;if(S>=4)for(;P<S-4;P+=4){const E=x[P],k=x[P+1],z=x[P+2],F=x[P+3];x[P]=(E>>>1^-(1&E))+x[P-1],x[P+1]=(k>>>1^-(1&k))+x[P],x[P+2]=(z>>>1^-(1&z))+x[P+1],x[P+3]=(F>>>1^-(1&F))+x[P+2]}for(;P!=x.length;++P)x[P]=(x[P]>>>1^-(1&x[P]))+x[P-1]})(p),p);case Pt.RLE:return(function(x,S,P){return P?(function(E,k,z){const F=new Int32Array(z);let B=0;for(let j=0;j<k;j++){const G=E[j];let Q=E[j+k];Q=Q>>>1^-(1&Q),F.fill(Q,B,B+G),B+=G}return F})(x,S.runs,S.numRleValues):xy(x,S.runs,S.numRleValues)})(p,f,y);case Pt.MORTON:return If(p),p;case Pt.COMPONENTWISE_DELTA:return Ty(p),p;case Pt.NONE:return y&&(function(x){for(let S=0;S<x.length;S++){const P=x[S];x[S]=P>>>1^-(1&P)}})(p),p;default:throw new Error(`The specified Logical level technique is not supported: ${f.logicalLevelTechnique1}`)}})(bp(i,e,r),r,a)}function Mo(i,e,r){return(function(a,c){if(c.logicalLevelTechnique1===Pt.DELTA&&c.logicalLevelTechnique2===Pt.NONE)return(function(f){const y=new Int32Array(f.length+1);y[0]=0,y[1]=ks(f[0]);let x=y[1],S=2;for(;S!=y.length;++S){const P=f[S-1];x+=P>>>1^-(1&P),y[S]=y[S-1]+x}return y})(a);if(c.logicalLevelTechnique1===Pt.RLE&&c.logicalLevelTechnique2===Pt.NONE)return(function(f,y,x){const S=new Int32Array(x+1);S[0]=0;let P=1,E=S[0];for(let k=0;k<y;k++){const z=f[k],F=f[k+y];for(let B=P;B<P+z;B++)S[B]=F+E,E=S[B];P+=z}return S})(a,c.runs,c.numRleValues);if(c.logicalLevelTechnique1===Pt.NONE&&c.logicalLevelTechnique2===Pt.NONE){(function(f){let y=0;for(let x=0;x<f.length;x++)f[x]+=y,y=f[x]})(a);const p=new Int32Array(c.numValues+1);return p[0]=0,p.set(a,1),p}if(c.logicalLevelTechnique1===Pt.DELTA&&c.logicalLevelTechnique2===Pt.RLE){const p=(function(f,y,x){const S=new Int32Array(x+1);S[0]=0;let P=1,E=S[0];for(let k=0;k<y;k++){const z=f[k];let F=f[k+y];F=F>>>1^-(1&F);for(let B=P;B<P+z;B++)S[B]=F+E,E=S[B];P+=z}return S})(a,c.runs,c.numRleValues);return If(p),p}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(bp(i,e,r),r)}function bp(i,e,r){const a=r.physicalLevelTechnique;if(a===Fa.FAST_PFOR)return vy();if(a===Fa.VARINT)return ti(i,e,r.numValues);if(a===Fa.NONE){const c=e.get();e.add(r.byteLength);const p=i.subarray(c,e.get());return new Int32Array(p)}throw new Error("Specified physicalLevelTechnique is not supported (yet).")}function Af(i,e,r,a){const c=bp(i,e,r);if(c.length===1){const p=c[0];return a?ks(p):p}return a?(function(p){return ks(p[1])})(c):(function(p){return p[1]})(c)}function Sy(i,e,r){return(function(a){if(a.length==2){const c=ks(a[1]);return[c,c]}return[ks(a[2]),ks(a[3])]})(bp(i,e,r))}function My(i,e,r){return(function(a){if(a.length==2){const c=Yl(a[1]);return[c,c]}return[Yl(a[2]),Yl(a[3])]})(xp(i,e,r.numValues))}function Iy(i,e,r,a){return(function(c,p,f){switch(p.logicalLevelTechnique1){case Pt.DELTA:return p.logicalLevelTechnique2===Pt.RLE?(function(y,x,S){const P=new BigInt64Array(S);let E=0,k=0n;for(let z=0;z<x;z++){const F=Number(y[z]),B=Yl(y[z+x]);for(let j=0;j<F;j++)k+=B,P[E++]=k}return P})(c,p.runs,p.numRleValues):((function(y){y[0]=y[0]>>1n^-(1n&y[0]);const x=y.length/4*4;let S=1;if(x>=4)for(;S<x-4;S+=4){const P=y[S],E=y[S+1],k=y[S+2],z=y[S+3];y[S]=(P>>1n^-(1n&P))+y[S-1],y[S+1]=(E>>1n^-(1n&E))+y[S],y[S+2]=(k>>1n^-(1n&k))+y[S+1],y[S+3]=(z>>1n^-(1n&z))+y[S+2]}for(;S!=y.length;++S)y[S]=(y[S]>>1n^-(1n&y[S]))+y[S-1]})(c),c);case Pt.RLE:return(function(y,x,S){return S?(function(P,E,k){const z=new BigInt64Array(k);let F=0;for(let B=0;B<E;B++){const j=Number(P[B]);let G=P[B+E];G=G>>1n^-(1n&G),z.fill(G,F,F+j),F+=j}return z})(y,x.runs,x.numRleValues):by(y,x.runs,x.numRleValues)})(c,p,f);case Pt.NONE:return f&&(function(y){for(let x=0;x<y.length;x++){const S=y[x];y[x]=S>>1n^-(1n&S)}})(c),c;default:throw new Error(`The specified Logical level technique is not supported: ${p.logicalLevelTechnique1}`)}})(xp(i,e,r.numValues),r,a)}function Py(i,e,r,a){const c=xp(i,e,r.numValues);if(c.length===1){const p=c[0];return a?Yl(p):p}return a?(function(p){return Yl(p[1])})(c):(function(p){return p[1]})(c)}function Ef(i,e,r,a,c){return(function(p,f,y,x){switch(f.logicalLevelTechnique1){case Pt.DELTA:return f.logicalLevelTechnique2===Pt.RLE&&(p=xy(p,f.runs,f.numRleValues)),(function(S,P){const E=new Int32Array(S.size());let k=0;S.get(0)?(E[0]=S.get(0)?P[0]>>>1^-(1&P[0]):0,k=1):E[0]=0;let z=1;for(;z!=E.length;++z)E[z]=S.get(z)?E[z-1]+(P[k]>>>1^-(1&P[k++])):E[z-1];return E})(x,p);case Pt.RLE:return(function(S,P,E,k){const z=P;return E?(function(F,B,j){const G=new Int32Array(F.size());let Q=0;for(let q=0;q<j;q++){const H=B[q];let te=B[q+j];te=te>>>1^-(1&te);for(let ae=Q;ae<Q+H;ae++)F.get(ae)?G[ae]=te:(G[ae]=0,Q++);Q+=H}return G})(k,S,z.runs):(function(F,B,j){const G=new Int32Array(F.size());let Q=0;for(let q=0;q<j;q++){const H=B[q],te=B[q+j];for(let ae=Q;ae<Q+H;ae++)F.get(ae)?G[ae]=te:(G[ae]=0,Q++);Q+=H}return G})(k,S,z.runs)})(p,f,y,x);case Pt.MORTON:return If(p),p;case Pt.COMPONENTWISE_DELTA:return Ty(p),p;case Pt.NONE:return p=y?(function(S,P){const E=new Int32Array(S.size());let k=0,z=0;for(;z!=E.length;++z)if(S.get(z)){const F=P[k++];E[z]=F>>>1^-(1&F)}else E[z]=0;return E})(x,p):(function(S,P){const E=new Int32Array(S.size());let k=0,z=0;for(;z!=E.length;++z)E[z]=S.get(z)?P[k++]:0;return E})(x,p),p;default:throw new Error("The specified Logical level technique is not supported")}})(r.physicalLevelTechnique===Fa.FAST_PFOR?vy():ti(i,e,r.numValues),r,a,c)}function wp(i,e,r,a){const c=i.logicalLevelTechnique1;if(c===Pt.RLE)return i.runs===1?Wr.CONST:Wr.FLAT;const p=e instanceof zn?e.size():e;if(c===Pt.DELTA&&i.logicalLevelTechnique2===Pt.RLE){const f=i.runs,y=2;if(i.numRleValues!==p)return Wr.FLAT;if(f===1)return Wr.SEQUENCE;if(f===2){const x=a.get();let S;if(i.physicalLevelTechnique===Fa.VARINT)S=ti(r,a,4);else{const P=a.get();S=new Int32Array(r.buffer,r.byteOffset+P,4)}if(a.set(x),S[2]===y&&S[3]===y)return Wr.SEQUENCE}}return i.numValues===1?Wr.CONST:Wr.FLAT}class Ay extends vp{getValueFromBuffer(e){return this.dataBuffer[e]}}class Ey extends yy{constructor(e,r,a,c){super(e,BigInt64Array.of(r),a,c)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}class Kl{_geometryOffsets;_partOffsets;_ringOffsets;constructor(e,r,a){this._geometryOffsets=e,this._partOffsets=r,this._ringOffsets=a}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}function Cf(i,e,r){return{x:Cy(i,e)-r,y:Cy(i>>1,e)-r}}function Cy(i,e){let r=0;for(let a=0;a<e;a++)r|=(i&1<<2*a)>>a;return r}(function(i){i[i.POINT=0]="POINT",i[i.LINESTRING=1]="LINESTRING",i[i.POLYGON=2]="POLYGON",i[i.MULTIPOINT=3]="MULTIPOINT",i[i.MULTILINESTRING=4]="MULTILINESTRING",i[i.MULTIPOLYGON=5]="MULTIPOLYGON"})(Hr||(Hr={})),(function(i){i[i.POINT=0]="POINT",i[i.LINESTRING=1]="LINESTRING",i[i.POLYGON=2]="POLYGON"})(_y||(_y={})),(function(i){i[i.MORTON=0]="MORTON",i[i.VEC_2=1]="VEC_2",i[i.VEC_3=2]="VEC_3"})(an||(an={}));class Bb{createPoint(e){return[[e]]}createMultiPoint(e){return e.map((r=>[r]))}createLineString(e){return[e]}createMultiLineString(e){return e}createPolygon(e,r){return[e].concat(r)}createMultiPolygon(e){return e.flat()}}function ky(i){const e=new Array(i.numGeometries);let r=1,a=1,c=1,p=0;const f=new Bb;let y=0,x=0;const S=i.mortonSettings,P=i.topologyVector,E=P.geometryOffsets,k=P.partOffsets,z=P.ringOffsets,F=i.vertexOffsets,B=i.containsPolygonGeometry(),j=i.vertexBuffer;for(let G=0;G<i.numGeometries;G++){const Q=i.geometryType(G);if(Q===Hr.POINT){if(F&&F.length!==0)if(i.vertexBufferType===an.VEC_2){const q=2*F[x++],H=new D(j[q],j[q+1]);e[p++]=f.createPoint(H)}else{const q=Cf(j[F[x++]],S.numBits,S.coordinateShift),H=new D(q.x,q.y);e[p++]=f.createPoint(H)}else{const q=new D(j[y++],j[y++]);e[p++]=f.createPoint(q)}E&&c++,k&&r++,z&&a++}else if(Q===Hr.MULTIPOINT){const q=E[c]-E[c-1];c++;const H=new Array(q);if(F&&F.length!==0){for(let te=0;te<q;te++){const ae=2*F[x++];H[te]=new D(j[ae],j[ae+1])}e[p++]=f.createMultiPoint(H)}else{for(let te=0;te<q;te++){const ae=j[y++],_e=j[y++];H[te]=new D(ae,_e)}e[p++]=f.createMultiPoint(H)}}else if(Q===Hr.LINESTRING){let q,H=0;B?(H=z[a]-z[a-1],a++):H=k[r]-k[r-1],r++,F&&F.length!==0?(q=i.vertexBufferType===an.VEC_2?Df(j,F,x,H,!1):zf(j,F,x,H,!1,S),x+=H):(q=kf(j,y,H,!1),y+=2*H),e[p++]=f.createLineString(q),E&&c++}else if(Q===Hr.POLYGON){const q=k[r]-k[r-1];r++;const H=new Array(q-1);let te=z[a]-z[a-1];if(a++,F&&F.length!==0){const ae=i.vertexBufferType===an.VEC_2?Sp(j,F,x,te):Mp(j,F,x,te,0,S);x+=te;for(let _e=0;_e<H.length;_e++)te=z[a]-z[a-1],a++,H[_e]=i.vertexBufferType===an.VEC_2?Sp(j,F,x,te):Mp(j,F,x,te,0,S),x+=te;e[p++]=f.createPolygon(ae,H)}else{const ae=Tp(j,y,te);y+=2*te;for(let _e=0;_e<H.length;_e++)te=z[a]-z[a-1],a++,H[_e]=Tp(j,y,te),y+=2*te;e[p++]=f.createPolygon(ae,H)}E&&c++}else if(Q===Hr.MULTILINESTRING){const q=E[c]-E[c-1];c++;const H=new Array(q);if(F&&F.length!==0){for(let te=0;te<q;te++){let ae=0;B?(ae=z[a]-z[a-1],a++):ae=k[r]-k[r-1],r++;const _e=i.vertexBufferType===an.VEC_2?Df(j,F,x,ae,!1):zf(j,F,x,ae,!1,S);H[te]=_e,x+=ae}e[p++]=f.createMultiLineString(H)}else{for(let te=0;te<q;te++){let ae=0;B?(ae=z[a]-z[a-1],a++):ae=k[r]-k[r-1],r++,H[te]=kf(j,y,ae,!1),y+=2*ae}e[p++]=f.createMultiLineString(H)}}else{if(Q!==Hr.MULTIPOLYGON)throw new Error("The specified geometry type is currently not supported.");{const q=E[c]-E[c-1];c++;const H=new Array(q);let te=0;if(F&&F.length!==0){for(let ae=0;ae<q;ae++){const _e=k[r]-k[r-1];r++;const De=new Array(_e-1);te=z[a]-z[a-1],a++;const Ee=i.vertexBufferType===an.VEC_2?Sp(j,F,x,te):Mp(j,F,x,te,0,S);x+=te;for(let Le=0;Le<De.length;Le++)te=z[a]-z[a-1],a++,De[Le]=i.vertexBufferType===an.VEC_2?Sp(j,F,x,te):Mp(j,F,x,te,0,S),x+=te;H[ae]=f.createPolygon(Ee,De)}e[p++]=f.createMultiPolygon(H)}else{for(let ae=0;ae<q;ae++){const _e=k[r]-k[r-1];r++;const De=new Array(_e-1);te=z[a]-z[a-1],a++;const Ee=Tp(j,y,te);y+=2*te;for(let Le=0;Le<De.length;Le++){const Ge=z[a]-z[a-1];a++,De[Le]=Tp(j,y,Ge),y+=2*Ge}H[ae]=f.createPolygon(Ee,De)}e[p++]=f.createMultiPolygon(H)}}}}return e}function Tp(i,e,r){return kf(i,e,r,!0)}function Sp(i,e,r,a){return Df(i,e,r,a,!0)}function Mp(i,e,r,a,c,p){return zf(i,e,r,a,!0,p)}function kf(i,e,r,a){const c=new Array(a?r+1:r);for(let p=0;p<2*r;p+=2)c[p/2]=new D(i[e+p],i[e+p+1]);return a&&(c[c.length-1]=c[0]),c}function Df(i,e,r,a,c){const p=new Array(c?a+1:a);for(let f=0;f<2*a;f+=2){const y=2*e[r+f/2];p[f/2]=new D(i[y],i[y+1])}return c&&(p[p.length-1]=p[0]),p}function zf(i,e,r,a,c,p){const f=new Array(c?a+1:a);for(let y=0;y<a;y++){const x=Cf(i[e[r+y]],p.numBits,p.coordinateShift);f[y]=new D(x.x,x.y)}return c&&(f[f.length-1]=f[0]),f}class Dy{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(e,r,a,c,p){this._vertexBufferType=e,this._topologyVector=r,this._vertexOffsets=a,this._vertexBuffer=c,this._mortonSettings=p}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){const e=ky(this);let r=0;for(;r<this.numGeometries;)yield{coordinates:e[r],type:this.geometryType(r)},r++}getSimpleEncodedVertex(e){const r=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){const a=Cf(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}const r=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getGeometries(){return ky(this)}get mortonSettings(){return this._mortonSettings}}class zy extends Dy{_numGeometries;_geometryType;constructor(e,r,a,c,p,f,y){super(a,c,p,f,y),this._numGeometries=e,this._geometryType=r}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Hr.POLYGON||this._geometryType===Hr.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class Ly extends Dy{_geometryTypes;constructor(e,r,a,c,p,f){super(e,a,c,p,f),this._geometryTypes=r}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Hr.POLYGON||this.geometryType(e)===Hr.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class Ry{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(e,r,a,c){this._triangleOffsets=e,this._indexBuffer=r,this._vertexBuffer=a,this._topologyVector=c}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");const e=new Array(this.numGeometries),r=this._topologyVector,a=r.partOffsets,c=r.ringOffsets,p=r.geometryOffsets;let f=0,y=1,x=1,S=1;for(let P=0;P<this.numGeometries;P++)switch(this.geometryType(P)){case Hr.POLYGON:{const E=a[y]-a[y-1];y++;const k=[];for(let z=0;z<E;z++){const F=c[x]-c[x-1];x++;const B=[];for(let j=0;j<F;j++){const G=this._vertexBuffer[f++],Q=this._vertexBuffer[f++];B.push(new D(G,Q))}B.length>0&&B.push(B[0]),k.push(B)}e[P]=k,p&&S++}break;case Hr.MULTIPOLYGON:{const E=p[S]-p[S-1];S++;const k=[];for(let z=0;z<E;z++){const F=a[y]-a[y-1];y++;for(let B=0;B<F;B++){const j=c[x]-c[x-1];x++;const G=[];for(let Q=0;Q<j;Q++){const q=this._vertexBuffer[f++],H=this._vertexBuffer[f++];G.push(new D(q,H))}G.length>0&&G.push(G[0]),k.push(G)}}e[P]=k}}return e}[Symbol.iterator](){return null}}function Fy(i,e,r,a,c,p){return new Ob(i,e,r,a,c,p)}class Ob extends Ry{_numGeometries;_geometryType;constructor(e,r,a,c,p,f){super(a,c,p,f),this._numGeometries=e,this._geometryType=r}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function By(i,e,r,a,c){return new Nb(i,e,r,a,c)}class Nb extends Ry{_geometryTypes;constructor(e,r,a,c,p){super(r,a,c,p),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function jb(i,e,r,a,c){const p=Ii(i,r);let f=null,y=null,x=null,S=null,P=null,E=null,k=null,z=null;if(wp(p,a,i,r)===Wr.CONST){const B=Af(i,r,p,!1);for(let j=0;j<e-1;j++){const G=Ii(i,r);switch(G.physicalStreamType){case ni.LENGTH:switch(G.logicalStreamType.lengthType){case $i.GEOMETRIES:f=Mo(i,r,G);break;case $i.PARTS:y=Mo(i,r,G);break;case $i.RINGS:x=Mo(i,r,G);break;case $i.TRIANGLES:k=Mo(i,r,G)}break;case ni.OFFSET:switch(G.logicalStreamType.offsetType){case Cs.VERTEX:S=Pi(i,r,G,!1);break;case Cs.INDEX:z=Pi(i,r,G,!1)}break;case ni.DATA:Dn.VERTEX===G.logicalStreamType.dictionaryType?P=Pi(i,r,G,!0):(E={numBits:G.numBits,coordinateShift:G.coordinateShift},P=Pi(i,r,G,!1))}}return z!==null?f!=null||y!=null?Fy(a,B,k,z,P,new Kl(f,y,x)):Fy(a,B,k,z,P):E===null?(function(j,G,Q,q,H){return new zy(j,G,an.VEC_2,Q,q,H)}
2)(a,B,new Kl(f,y,x),S,P):(function(j,G,Q,q,H,te){return new zy(j,G,an.MORTON,Q,q,H,te)})(a,B,new Kl(f,y,x),S,P,E)}const F=Pi(i,r,p,!1);for(let B=0;B<e-1;B++){const j=Ii(i,r);switch(j.physicalStreamType){case ni.LENGTH:switch(j.logicalStreamType.lengthType){case $i.GEOMETRIES:f=Pi(i,r,j,!1);break;case $i.PARTS:y=Pi(i,r,j,!1);break;case $i.RINGS:x=Pi(i,r,j,!1);break;case $i.TRIANGLES:k=Mo(i,r,j)}break;case ni.OFFSET:switch(j.logicalStreamType.offsetType){case Cs.VERTEX:S=Pi(i,r,j,!1);break;case Cs.INDEX:z=Pi(i,r,j,!1)}break;case ni.DATA:Dn.VERTEX===j.logicalStreamType.dictionaryType?P=Pi(i,r,j,!0):(E={numBits:j.numBits,coordinateShift:j.coordinateShift},P=Pi(i,r,j,!1))}}return z!==null&&y===null?By(F,k,z,P):(f!==null?(f=Lf(F,f,2),y!==null&&x!==null?(y=Oy(F,f,y,!1),x=(function(B,j,G,Q){const q=new Int32Array(G[G.length-1]+1);let H=0;q[0]=H;let te=1,ae=1,_e=0;for(let De=0;De<B.length;De++){const Ee=B[De],Le=j[De+1]-j[De];if(Ee!==0&&Ee!==3)for(let Ge=0;Ge<Le;Ge++){const Be=G[te]-G[te-1];te++;for(let Ce=0;Ce<Be;Ce++)H=q[ae++]=H+Q[_e++]}else for(let Ge=0;Ge<Le;Ge++)q[ae++]=++H,te++}return q})(F,f,y,x)):y!==null&&(y=(function(B,j,G){const Q=new Int32Array(j[j.length-1]+1);let q=0;Q[0]=q;let H=1,te=0;for(let ae=0;ae<B.length;ae++){const _e=B[ae],De=j[ae+1]-j[ae];if(_e===4||_e===1)for(let Ee=0;Ee<De;Ee++)q=Q[H++]=q+G[te++];else for(let Ee=0;Ee<De;Ee++)Q[H++]=++q}return Q})(F,f,y))):y!==null&&x!==null?(y=Lf(F,y,1),x=Oy(F,y,x,!0)):y!==null&&(y=Lf(F,y,0)),z!==null?By(F,k,z,P,new Kl(f,y,x)):E===null?(function(B,j,G,Q){return new Ly(an.VEC_2,B,j,G,Q)})(F,new Kl(f,y,x),S,P):(function(B,j,G,Q,q){return new Ly(an.MORTON,B,j,G,Q,q)})(F,new Kl(f,y,x),S,P,E))}function Lf(i,e,r){const a=new Int32Array(i.length+1);let c=0;a[0]=c;let p=0;for(let f=0;f<i.length;f++)c=a[f+1]=c+(i[f]>r?e[p++]:1);return a}function Oy(i,e,r,a){const c=new Int32Array(e[e.length-1]+1);let p=0;c[0]=p;let f=1,y=0;for(let x=0;x<i.length;x++){const S=i[x],P=e[x+1]-e[x];if(S===5||S===2||a&&(S===4||S===1))for(let E=0;E<P;E++)p=c[f++]=p+r[y++];else for(let E=0;E<P;E++)c[f++]=++p}return c}class Vb extends Xl{dataVector;constructor(e,r,a){super(e,r.getBuffer(),a),this.dataVector=r}getValueFromBuffer(e){return this.dataVector.get(e)}}class Ub extends vp{getValueFromBuffer(e){return this.dataBuffer[e]}}class Ny extends Xl{constructor(e,r,a){super(e,BigInt64Array.of(r),a)}getValueFromBuffer(e){return this.dataBuffer[0]}}function Mu(i,e,r){return jy(i,Math.ceil(e/8),r)}function jy(i,e,r){const a=new Uint8Array(e);let c=0;for(;c<e;){const p=i[r.increment()];if(p<=127){const f=p+3,y=i[r.increment()],x=c+f;a.fill(y,c,x),c=x}else{const f=256-p;for(let y=0;y<f;y++)a[c++]=i[r.increment()]}}return a}const $b=new TextDecoder;function Rf(i,e,r){return r-e>=12?$b.decode(i.subarray(e,r)):(function(a,c,p){let f="",y=c;for(;y<p;){const x=a[y];let S,P,E,k=null,z=x>239?4:x>223?3:x>191?2:1;if(y+z>p)break;z===1?x<128&&(k=x):z===2?(S=a[y+1],(192&S)==128&&(k=(31&x)<<6|63&S,k<=127&&(k=null))):z===3?(S=a[y+1],P=a[y+2],(192&S)==128&&(192&P)==128&&(k=(15&x)<<12|(63&S)<<6|63&P,(k<=2047||k>=55296&&k<=57343)&&(k=null))):z===4&&(S=a[y+1],P=a[y+2],E=a[y+3],(192&S)==128&&(192&P)==128&&(192&E)==128&&(k=(15&x)<<18|(63&S)<<12|(63&P)<<6|63&E,(k<=65535||k>=1114112)&&(k=null))),k===null?(k=65533,z=1):k>65535&&(k-=65536,f+=String.fromCharCode(k>>>10&1023|55296),k=56320|1023&k),f+=String.fromCharCode(k),y+=z}return f})(i,e,r)}class Ff extends Xl{offsetBuffer;constructor(e,r,a,c){super(e,a,c),this.offsetBuffer=r}}class Vy extends Ff{textEncoder;constructor(e,r,a,c){super(e,r,a,c??r.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(e){return Rf(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Jl extends Ff{indexBuffer;textEncoder;constructor(e,r,a,c,p){super(e,a,c,p??r.length),this.indexBuffer=r,this.indexBuffer=r,this.textEncoder=new TextEncoder}getValueFromBuffer(e){const r=this.indexBuffer[e];return Rf(this.dataBuffer,this.offsetBuffer[r],this.offsetBuffer[r+1])}}class Uy extends Ff{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(e,r,a,c,p,f,y){super(e,a,c,y),this.indexBuffer=r,this.symbolOffsetBuffer=p,this.symbolTableBuffer=f,this.textEncoder=new TextEncoder}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=(function(a,c,p){const f=[],y=new Array(c.length).fill(0);for(let x=1;x<c.length;x++)y[x]=y[x-1]+c[x-1];for(let x=0;x<p.length;x++)if(p[x]===255)f.push(p[++x]);else{const S=c[p[x]],P=y[p[x]];for(let E=0;E<S;E++)f.push(a[P+E])}return new Uint8Array(f)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));const r=this.indexBuffer[e];return Rf(this.decodedDictionary,this.offsetBuffer[r],this.offsetBuffer[r+1])}
vendor: 4,366 bytes, line 2
2offsetToLengthBuffer(e){const r=new Uint32Array(e.length-1);let a=e[0];for(let c=1;c<e.length;c++){const p=e[c];r[c-1]=p-a,a=p}return r}}function Gb(i,e,r,a,c,p){return r.type==="scalarType"?(function(f,y,x,S,P,E){let k=null,z=0;if(f===0)return null;if(E.nullable){const B=Ii(y,x);z=B.numValues;const j=x.get(),G=Mu(y,z,x);x.set(j+B.byteLength),k=new zn(G,B.numValues)}const F=k??S;switch(P.physicalType){case 4:case 3:return(function(B,j,G,Q,q){const H=Ii(B,j),te=wp(H,q,B,j),ae=Q.physicalType===3;if(te===Wr.FLAT){const _e=Iu(q)?Ef(B,j,H,ae,q):Pi(B,j,H,ae);return new wf(G.name,_e,q)}if(te===Wr.SEQUENCE){const _e=Sy(B,j,H);return new Sf(G.name,_e[0],_e[1],H.numRleValues)}{const _e=Af(B,j,H,ae);return new Mf(G.name,_e,q)}})(y,x,E,P,F);case 9:return(function(B,j,G,Q,q){let H=null,te=null,ae=null,_e=null,De=null,Ee=null,Le=null,Ge=null;for(let Be=0;Be<Q;Be++){const Ce=Ii(j,G);if(Ce.byteLength!==0)switch(Ce.physicalStreamType){case ni.PRESENT:{const Ie=Mu(j,Ce.numValues,G);Ee=new zn(Ie,Ce.numValues);break}case ni.OFFSET:te=q!=null||Ee!=null?Ef(j,G,Ce,!1,q??Ee):Pi(j,G,Ce,!1);break;case ni.LENGTH:{const Ie=Mo(j,G,Ce);$i.DICTIONARY===Ce.logicalStreamType.lengthType?H=Ie:$i.SYMBOL===Ce.logicalStreamType.lengthType?_e=Ie:Le=Ie;break}case ni.DATA:{const Ie=j.subarray(G.get(),G.get()+Ce.byteLength);G.add(Ce.byteLength);const Qe=Ce.logicalStreamType.dictionaryType;Dn.FSST===Qe?De=Ie:Dn.SINGLE===Qe||Dn.SHARED===Qe?ae=Ie:Dn.NONE===Qe&&(Ge=Ie);break}}}return(function(Be,Ce,Ie,Qe,Ye,tt,We){return Ce?new Uy(Be,Ie,Qe,Ye,tt,Ce,We):null})(B,De,te,H,ae,_e,q??Ee)??(function(Be,Ce,Ie,Qe,Ye){return Ce?Ye?new Jl(Be,Ie,Qe,Ce,Ye):new Jl(Be,Ie,Qe,Ce):null})(B,ae,te,H,q??Ee)??(function(Be,Ce,Ie,Qe,Ye){if(!Ce||!Ie)return null;if(Qe)return Ye?new Jl(Be,Qe,Ce,Ie,Ye):new Jl(Be,Qe,Ce,Ie);if(Ye&&Ye.size()!==Ce.length-1){const tt=new Int32Array(Ye.size());let We=0;for(let ot=0;ot<Ye.size();ot++)tt[ot]=Ye.get(ot)?We++:0;return new Jl(Be,tt,Ce,Ie,Ye)}return Ye?new Vy(Be,Ce,Ie,Ye):new Vy(Be,Ce,Ie)})(B,Le,Ge,te,q??Ee)})(E.name,y,x,E.nullable?f-1:f,k);case 0:return(function(B,j,G,Q,q){const H=Ii(B,j),te=H.numValues,ae=j.get(),_e=Iu(q)?(function(Ee,Le,Ge,Be){const Ce=jy(Ee,Math.ceil(Le/8),Ge),Ie=new zn(Ce,Le),Qe=Be.size(),Ye=new zn(new Uint8Array(Qe),Qe);let tt=0;for(let We=0;We<Be.size();We++){const ot=!!Be.get(We)&&Ie.get(tt++);Ye.set(We,ot)}return Ye.getBuffer()})(B,te,j,q):Mu(B,te,j);j.set(ae+H.byteLength);const De=new zn(_e,te);return new Vb(G.name,De,q)})(y,x,E,0,F);case 6:case 5:return(function(B,j,G,Q,q){const H=Ii(B,j),te=wp(H,Q,B,j),ae=q.physicalType===5;if(te===Wr.FLAT){const _e=Iu(Q)?(function(De,Ee,Le,Ge,Be){return(function(Ce,Ie,Qe,Ye){switch(Ie.logicalLevelTechnique1){case Pt.DELTA:return Ie.logicalLevelTechnique2===Pt.RLE&&(Ce=by(Ce,Ie.runs,Ie.numRleValues)),(function(tt,We){const ot=new BigInt64Array(tt.size());let zt=0;tt.get(0)?(ot[0]=tt.get(0)?We[0]>>1n^-(1n&We[0]):0n,zt=1):ot[0]=0n;let St=1;for(;St!=ot.length;++St)ot[St]=tt.get(St)?ot[St-1]+(We[zt]>>1n^-(1n&We[zt++])):ot[St-1];return ot})(Ye,Ce);case Pt.RLE:return(function(tt,We,ot,zt){const St=We;return ot?(function(lr,oi,Fr){const cr=new BigInt64Array(lr.size());let nr=0;for(let Ft=0;Ft<Fr;Ft++){const _r=Number(oi[Ft]);let Sr=oi[Ft+Fr];Sr=Sr>>1n^-(1n&Sr);for(let tr=nr;tr<nr+_r;tr++)lr.get(tr)?cr[tr]=Sr:(cr[tr]=0n,nr++);nr+=_r}return cr})(zt,tt,St.runs):(function(lr,oi,Fr){const cr=new BigInt64Array(lr.size());let nr=0;for(let Ft=0;Ft<Fr;Ft++){const _r=Number(oi[Ft]),Sr=oi[Ft+Fr];for(let tr=nr;tr<nr+_r;tr++)lr.get(tr)?cr[tr]=Sr:(cr[tr]=0n,nr++);nr+=_r}return cr})(zt,tt,St.runs)})(Ce,Ie,Qe,Ye);case Pt.NONE:return Ce=Qe?(function(tt,We){const ot=new BigInt64Array(tt.size());let zt=0,St=0;for(;St!=ot.length;++St)if(tt.get(St)){const lr=We[zt++];ot[St]=lr>>1n^-(1n&lr)}else ot[St]=0n;return ot})(Ye,Ce):(function(tt,We){const ot=new BigInt64Array(tt.size());let zt=0,St=0;for(;St!=ot.length;++St)ot[St]=tt.get(St)?We[zt++]:0n;return ot})(Ye,Ce),Ce;default:throw new Error("The specified Logical level technique is not supported")}})(xp(De,Ee,Le.numValues),Le,Ge,Be)})(B,j,H,ae,Q):Iy(B,j,H,ae);return new Ay(G.name,_e,Q)}if(te===Wr.SEQUENCE){const _e=My(B,j,H);return new Ey(G.name,_e[0],_e[1],H.numRleValues)}{const _e=Py(B,j,H,ae);return new Ny(G.name,_e,Q)}})(y,x,E,F,P);case 7:return(function(B,j,G,Q){const q=Ii(B,j),H=Iu(Q)?(function(te,ae,_e,De){const Ee=ae.get(),Le=Ee+
2De*Float32Array.BYTES_PER_ELEMENT,Ge=new Uint8Array(te.subarray(Ee,Le)).buffer,Be=new Float32Array(Ge);ae.set(Le);const Ce=_e.size(),Ie=new Float32Array(Ce);let Qe=0;for(let Ye=0;Ye<Ce;Ye++)Ie[Ye]=_e.get(Ye)?Be[Qe++]:0;return Ie})(B,j,Q,q.numValues):(function(te,ae,_e){const De=ae.get(),Ee=De+_e*Float32Array.BYTES_PER_ELEMENT,Le=new Uint8Array(te.subarray(De,Ee)).buffer,Ge=new Float32Array(Le);return ae.set(Ee),Ge})(B,j,q.numValues);return new Ub(G.name,H,Q)})(y,x,E,F);case 8:return(function(B,j,G,Q){const q=Ii(B,j),H=Iu(Q)?(function(te,ae,_e,De){const Ee=ae.get(),Le=Ee+De*Float64Array.BYTES_PER_ELEMENT,Ge=new Uint8Array(te.subarray(Ee,Le)).buffer,Be=new Float64Array(Ge);ae.set(Le);const Ce=_e.size(),Ie=new Float64Array(Ce);let Qe=0;for(let Ye=0;Ye<Ce;Ye++)Ie[Ye]=_e.get(Ye)?Be[Qe++]:0;return Ie})(B,j,Q,q.numValues):(function(te,ae,_e){const De=ae.get(),Ee=De+_e*Float64Array.BYTES_PER_ELEMENT,Le=new Uint8Array(te.subarray(De,Ee)).buffer,Ge=new Float64Array(Le);return ae.set(Ee),Ge})(B,j,q.numValues);return new Tf(G.name,H,Q)})(y,x,E,F);default:throw new Error(`The specified data type for the field is currently not supported: ${P}`)}})(a,i,e,c,r.scalarType,r):a!=1?null:(function(f,y,x,S){let P=null,E=null,k=null,z=null,F=!1;for(;!F;){const Q=Ii(f,y);switch(Q.physicalStreamType){case ni.LENGTH:$i.DICTIONARY===Q.logicalStreamType.lengthType?P=Mo(f,y,Q):k=Mo(f,y,Q);break;case ni.DATA:Dn.SINGLE===Q.logicalStreamType.dictionaryType||Dn.SHARED===Q.logicalStreamType.dictionaryType?(E=f.subarray(y.get(),y.get()+Q.byteLength),F=!0):z=f.subarray(y.get(),y.get()+Q.byteLength),y.add(Q.byteLength)}}const B=x.complexType.children,j=[];let G=0;for(const Q of B){const q=ti(f,y,1)[0];if(q==0)continue;const H=`${x.name}${Q.name==="default"?"":":"+Q.name}`;if(q!==2||Q.type!=="scalarField"||Q.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");const te=Ii(f,y),ae=Mu(f,te.numValues,y),_e=Ii(f,y),De=_e.decompressedCount!==S?Ef(f,y,_e,!1,new zn(ae,te.numValues)):Pi(f,y,_e,!1);j[G++]=z?new Uy(H,De,P,E,k,z,new zn(ae,te.numValues)):new Jl(H,De,P,E,new zn(ae,te.numValues))}return j})(i,e,r,c)}function Iu(i){return i instanceof zn}function qb(i){if(i.name==="id")return!1;if(i.type==="scalarType"){const e=i.scalarType;if(e.type==="physicalType")switch(e.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(e.type==="logicalType")return!1}else if(i.type==="complexType"){const e=i.complexType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",i),!1}const Zb=new TextDecoder;function $y(i,e){const r=ti(i,e,1)[0];if(r===0)return"";const a=e.get(),c=i.subarray(a,a+r);return e.add(r),Zb.decode(c)}function Gy(i,e){const r=ti(i,e,1)[0]>>>0,a=!!(4&r),c=!!(2&r),p=ti(i,e,1)[0]>>>0,f={};if(1&r&&(f.nullable=!0),c){const y={};if(a?(y.type="logicalType",y.logicalType=p):(y.type="physicalType",y.physicalType=p),8&r){const x=ti(i,e,1)[0]>>>0;y.children=new Array(x);for(let S=0;S<x;S++)y.children[S]=Gy(i,e)}f.type="complexField",f.complexField=y}else{const y={};a?(y.type="logicalType",y.logicalType=p):(y.type="physicalType",y.physicalType=p),f.type="scalarField",f.scalarField=y}return f}function Wb(i,e){const r=ti(i,e,1)[0]>>>0,a=(function(c){switch(c){case 0:case 1:case 2:case 3:{const p={};p.nullable=!!(1&c),p.columnScope=0;const f={};return f.physicalType=c>1?6:4,f.type="physicalType",p.scalarType=f,p.type="scalarType",p}case 4:{const p={nullable:!1,columnScope:0},f={type:"physicalType",physicalType:0};return p.type="complexType",p.complexType=f,p}case 30:{const p={nullable:!1,columnScope:0},f={type:"physicalType",physicalType:1};return p.type="complexType",p.complexType=f,p}default:return(function(p){let f=null;switch(p){case 10:case 11:f=0;break;case 12:case 13:f=1;break;case 14:case 15:f=2;break;case 16:case 17:f=3;break;case 18:case 19:f=4;break;case 20:case 21:f=5;break;case 22:case 23:f=6;break;case 24:case 25:f=7;break;case 26:case 27:f=8;break;case 28:case 29:f=9;break;default:return null}const y={};y.nullable=!!(1&p),y.columnScope=0;const x={type:"physicalType"};return x.physicalType=f,y.type="scalarType",y.scalarType=x,y})(c)}})(r);
2if(!a)throw new Error(`Unsupported column type code: ${r}`);if((function(c){return c>=10})(r)?a.name=$y(i,e):r>=0&&r<=3?a.name="id":r===4&&(a.name="geometry"),(function(c){return c===30})(r)){const c=ti(i,e,1)[0]>>>0,p=a.complexType;p.children=new Array(c);for(let f=0;f<c;f++)p.children[f]=Gy(i,e)}return a}function Hb(i,e){const r={featureTables:[]},a={};a.name=$y(i,e);const c=ti(i,e,1)[0]>>>0,p=ti(i,e,1)[0]>>>0;a.columns=new Array(p);for(let f=0;f<p;f++)a.columns[f]=Wb(i,e);return r.featureTables.push(a),[r,c]}function Xb(i,e,r,a,c,p,f=!1){const y=e.scalarType.physicalType,x=wp(c,p,i,r);if(y===4)switch(x){case Wr.FLAT:{const S=Pi(i,r,c,!1);return new wf(a,S,p)}case Wr.SEQUENCE:{const S=Sy(i,r,c);return new Sf(a,S[0],S[1],c.numRleValues)}case Wr.CONST:{const S=Af(i,r,c,!1);return new Mf(a,S,p)}}else switch(x){case Wr.FLAT:{if(f){const P=(function(E,k,z,F){const B=(function(j,G,Q){const q=new Float64Array(G);for(let H=0;H<G;H++)q[H]=Rb(j,Q);return q})(E,z.numValues,k);return(function(j,G,Q){switch(G.logicalLevelTechnique1){case Pt.DELTA:return G.logicalLevelTechnique2===Pt.RLE&&(j=wy(j,G.runs,G.numRleValues)),(function(q){q[0]=q[0]%2==1?(q[0]+1)/-2:q[0]/2;const H=q.length/4*4;let te=1;if(H>=4)for(;te<H-4;te+=4){const ae=q[te],_e=q[te+1],De=q[te+2],Ee=q[te+3];q[te]=(ae%2==1?(ae+1)/-2:ae/2)+q[te-1],q[te+1]=(_e%2==1?(_e+1)/-2:_e/2)+q[te],q[te+2]=(De%2==1?(De+1)/-2:De/2)+q[te+1],q[te+3]=(Ee%2==1?(Ee+1)/-2:Ee/2)+q[te+2]}for(;te!=q.length;++te)q[te]=(q[te]%2==1?(q[te]+1)/-2:q[te]/2)+q[te-1]})(j),j;case Pt.RLE:return(function(q,H,te){return wy(q,H.runs,H.numRleValues)})(j,G);case Pt.NONE:return j;default:throw new Error(`The specified Logical level technique is not supported: ${G.logicalLevelTechnique1}`)}})(B,z)})(i,r,c);return new Tf(a,P,p)}const S=Iy(i,r,c,!1);return new Ay(a,S,p)}case Wr.SEQUENCE:{const S=My(i,r,c);return new Ey(a,S[0],S[1],c.numRleValues)}case Wr.CONST:{const S=Py(i,r,c,!1);return new Ny(a,S,p)}}throw new Error("Vector type not supported for id column.")}class Yb{constructor(e,r){var a;switch(this._featureData=e,this.properties=this._featureData.properties||{},(a=this._featureData.geometry)===null||a===void 0?void 0:a.type){case Hr.POINT:case Hr.MULTIPOINT:this.type=1;break;case Hr.LINESTRING:case Hr.MULTILINESTRING:this.type=2;break;case Hr.POLYGON:case Hr.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=r,this.id=Number(this._featureData.id)}loadGeometry(){const e=[];for(const r of this._featureData.geometry.coordinates){const a=[];for(const c of r)a.push(new D(c.x,c.y));e.push(a)}return e}}class Kb{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new Yb(this.features[e],this.extent)}}class qy{constructor(e){this.layers={};const r=(function(a,c,p=!0){const f=new Lb(0),y=[];for(;f.get()<a.length;){const x=ti(a,f,1)[0]>>>0,S=f.get()+x;if(S>a.length)throw new Error(`Block overruns tile: ${S} > ${a.length}`);if(ti(a,f,1)[0]>>>0!=1){f.set(S);continue}const P=Hb(a,f),E=P[1],k=P[0].featureTables[0];let z=null,F=null;const B=[];let j=0;for(const Q of k.columns){const q=Q.name;if(q==="id"){let H=null;if(Q.nullable){const ae=Ii(a,f),_e=f.get(),De=Mu(a,ae.numValues,f);f.set(_e+ae.byteLength),H=new zn(De,ae.numValues)}const te=Ii(a,f);j=te.decompressedCount,z=Xb(a,Q,f,q,te,H??j,p)}else if(q==="geometry"){const H=ti(a,f,1)[0];if(j===0){const te=f.get();j=Ii(a,f).decompressedCount,f.set(te)}F=jb(a,H,f,j)}else{const H=qb(Q)?ti(a,f,1)[0]:1;if(H===0&&Q.type==="scalarType")continue;const te=Gb(a,f,Q,H,j);if(te)if(Array.isArray(te))for(const ae of te)B.push(ae);else B.push(te)}}const G=new zb(k.name,F,z,B,E);y.push(G),f.set(S)}return y})(new Uint8Array(e));this.layers=r.reduce(((a,c)=>Object.assign(Object.assign({},a),{[c.name]:new Kb(c)})),{})}}class Jb{constructor(e,r){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{}
vendor: 31,441 bytes, line 2
2,this.extent=r,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id!="number"||isNaN(e.id)||(this.id=e.id))}loadGeometry(){const e=[],r=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(const a of r){const c=[];for(const p of a)c.push(new D(p[0],p[1]));e.push(c)}return e}}const Pu="_geojsonTileLayer";function Qb(i,e){e.writeVarintField(15,i.version||1),e.writeStringField(1,i.name||""),e.writeVarintField(5,i.extent||4096);const r={keys:[],values:[],keycache:{},valuecache:{}};for(let p=0;p<i.length;p++)r.feature=i.feature(p),e.writeMessage(2,e1,r);const a=r.keys;for(const p of a)e.writeStringField(3,p);const c=r.values;for(const p of c)e.writeMessage(4,i1,p)}function e1(i,e){if(!i.feature)return;const r=i.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,t1,i),e.writeVarintField(3,r.type),e.writeMessage(4,r1,r)}function t1(i,e){for(const r in i.feature?.properties){let a=i.feature.properties[r],c=i.keycache[r];if(a==null)continue;c===void 0&&(i.keys.push(r),c=i.keys.length-1,i.keycache[r]=c),e.writeVarint(c),typeof a!="string"&&typeof a!="boolean"&&typeof a!="number"&&(a=JSON.stringify(a));const p=typeof a+":"+a;let f=i.valuecache[p];f===void 0&&(i.values.push(a),f=i.values.length-1,i.valuecache[p]=f),e.writeVarint(f)}}function Bf(i,e){return(e<<3)+(7&i)}function Zy(i){return i<<1^i>>31}function r1(i,e){const r=i.loadGeometry(),a=i.type;let c=0,p=0;for(const f of r){let y=1;a===1&&(y=f.length),e.writeVarint(Bf(1,y));const x=a===3?f.length-1:f.length;for(let S=0;S<x;S++){S===1&&a!==1&&e.writeVarint(Bf(2,x-1));const P=f[S].x-c,E=f[S].y-p;e.writeVarint(Zy(P)),e.writeVarint(Zy(E)),c+=P,p+=E}i.type===3&&e.writeVarint(Bf(7,1))}}function i1(i,e){const r=typeof i;r==="string"?e.writeStringField(1,i):r==="boolean"?e.writeBooleanField(7,i):r==="number"&&(i%1!=0?e.writeDoubleField(3,i):i<0?e.writeSVarintField(6,i):e.writeVarintField(5,i))}class Wy{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new _o(Ot,16,0),this.grid3D=new _o(Ot,16,0),this.featureIndexArray=new $,this.promoteId=r}insert(e,r,a,c,p,f){const y=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,c,p);const x=f?this.grid3D:this.grid;for(let S=0;S<r.length;S++){const P=r[S],E=[1/0,1/0,-1/0,-1/0];for(let k=0;k<P.length;k++){const z=P[k];E[0]=Math.min(E[0],z.x),E[1]=Math.min(E[1],z.y),E[2]=Math.max(E[2],z.x),E[3]=Math.max(E[3],z.y)}E[0]<Ot&&E[1]<Ot&&E[2]>=0&&E[3]>=0&&x.insert(y,E[0],E[1],E[2],E[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Dg(new fp(this.rawTileData)).layers:new qy(this.rawTileData).layers,this.sourceLayerCoder=new my(this.vtLayers?Object.keys(this.vtLayers).sort():[Pu])),this.vtLayers}query(e,r,a,c){this.loadVTLayers();const p=e.params,f=Ot/e.tileSize/e.scale,y=as(p.filter,p.globalState),x=e.queryGeometry,S=e.queryPadding*f,P=Es.fromPoints(x),E=this.grid.query(P.minX-S,P.minY-S,P.maxX+S,P.maxY+S),k=Es.fromPoints(e.cameraQueryGeometry).expandBy(S),z=this.grid3D.query(k.minX,k.minY,k.maxX,k.maxY,((j,G,Q,q)=>(function(H,te,ae,_e,De){for(const Le of H)if(te<=Le.x&&ae<=Le.y&&_e>=Le.x&&De>=Le.y)return!0;const Ee=[new D(te,ae),new D(te,De),new D(_e,De),new D(_e,ae)];if(H.length>2){for(const Le of Ee)if(jl(H,Le))return!0}for(let Le=0;Le<H.length-1;Le++)if(ax(H[Le],H[Le+1],Ee))return!0;return!1})(e.cameraQueryGeometry,j-S,G-S,Q+S,q+S)));for(const j of z)E.push(j);E.sort(n1);const F={};let B;for(let j=0;j<E.length;j++){const G=E[j];if(G===B)continue;B=G;const Q=this.featureIndexArray.get(G);let q=null;this.loadMatchingFeature(F,Q.bucketIndex,Q.sourceLayerIndex,Q.featureIndex,y,p.layers,p.availableImages,r,a,c,((H,te,ae)=>(q||(q=ia(H)),te.queryIntersectsFeature({queryGeometry:x,feature:H,featureState:ae,geometry:q,zoom:this.z,transform:e.transform,pixelsToTileUnits:f,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return F}loadMatchingFeature(e,r,a,c,p,f,y,x,S,P,E){const k=this.bucketLayerIDs[r];if(f&&!k.some((j=>f.has(j))))return;const z=this.sourceLayerCoder.decode(a),F=this.vtLayers[z].feature(c);if(p.needGeometry){const j=na(F,!0);if(!p.filter(new $t(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!p.filter(new $t(this.tileID.overscaledZ),F))return;const B=this.getId(F,z);for(let j=0;j<k.length;j++){const G=k[j];if(f&&!f.has(G))continue;const Q=x[G];if(!Q)continue;let q={};B&&P&&(q=P.getState(Q.sourceLayer||Pu,B));const H=hi({},S[G]);H.paint=Hy(H.paint,Q.paint,F,q,y),H.layout=Hy(H.layout,Q.layout,F,q,y);const te=!E||E(F,Q,q);if(!te)continue;const ae=new gy(F,this.z,this.x,this.y,B);ae.layer=H;let _e=e[G];_e===void 0&&(_e=e[G]=[]),_e.push({featureIndex:c,feature:ae,intersectionZ:te})}}lookupSymbolFeatures(e,r,a,c,p,f,y,x){const S={};this.loadVTLayers();const P=as(p.filterSpec,p.globalState);for(const E of e)this.loadMatchingFeature(S,a,c,E,P,f,y,x,r);return S}hasLayer(e){for(const r of this.bucketLayerIDs)for(const a of r)if(e===a)return!0;return!1}getId(e,r){var a;let c=e.id;return this.promoteId&&(c=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof c=="boolean"&&(c=Number(c)),c===void 0&&(!((a=e.properties)===null||a===void 0)&&a.cluster)&&this.promoteId&&(c=Number(e.properties.cluster_id))),c}}function Hy(i,e,r,a,c){return Zi(i,((p,f)=>{const y=e instanceof _s?e.get(f):null;return y&&y.evaluate?y.evaluate(r,a,c):y}))}function n1(i,e){return e-i}function Xy(i,e,r,a,c){const p=[];for(let f=0;f<i.length;f++){const y=i[f];let x;for(let S=0;S<y.length-1;S++){let P=y[S],E=y[S+1];P.x<e&&E.x<e||(P.x<e?P=new D(e,P.y+(e-P.x)/(E.x-P.x)*(E.y-P.y))._round():E.x<e&&(E=new D(e,P.y+(e-P.x)/(E.x-P.x)*(E.y-P.y))._round()),P.y<r&&E.y<r||(P.y<r?P=new D(P.x+(r-P.y)/(E.y-P.y)*(E.x-P.x),r)._round():E.y<r&&(E=new D(P.x+(r-P.y)/(E.y-P.y)*(E.x-P.x),r)._round()),P.x>=a&&E.x>=a||(P.x>=a?P=new D(a,P.y+(a-P.x)/(E.x-P.x)*(E.y-P.y))._round():E.x>=a&&(E=new D(a,P.y+(a-P.x)/(E.x-P.x)*(E.y-P.y))._round()),P.y>=c&&E.y>=c||(P.y>=c?P=new D(P.x+(c-P.y)/(E.y-P.y)*(E.x-P.x),c)._round():E.y>=c&&(E=new D(P.x+(c-P.y)/(E.y-P.y)*(E.x-P.x),c)._round()),x&&P.equals(x[x.length-1])||(x=[P],p.push(x)),x.push(E)))))}}return p}function Yy(i,e,r,a,c){switch(e){case 1:return(function(p,f,y,x){const S=[];for(const P of p)for(const E of P){const k=x===0?E.x:E.y;k>=f&&k<=y&&S.push([E])}return S})(i,r,a,c);case 2:return Ky(i,r,a,c,!1);case 3:return Ky(i,r,a,c,!0)}return[]}function a1(i,e,r,a,c){const p=a===0?o1:s1;let f=[];const y=[];for(let P=0;P<i.length-1;P++){const E=i[P],k=i[P+1],z=a===0?E.x:E.y,F=a===0?k.x:k.y;let B=!1;z<e?F>e&&f.push(p(E,k,e)):z>r?F<r&&f.push(p(E,k,r)):f.push(E),F<e&&z>=e&&(f.push(p(E,k,e)),B=!0),F>r&&z<=r&&(f.push(p(E,k,r)),B=!0),!c&&B&&(y.push(f),f=[])}const x=i.length-1,S=a===0?i[x].x:i[x].y;return S>=e&&S<=r&&f.push(i[x]),c&&f.length>0&&!f[0].equals(f[f.length-1])&&f.push(new D(f[0].x,f[0].y)),f.length>0&&y.push(f),y}function Ky(i,e,r,a,c){const p=[];for(const f of i){const y=a1(f,e,r,a,c);y.length>0&&p.push(...y)}return p}function o1(i,e,r){return new D(r,i.y+(r-i.x)/(e.x-i.x)*(e.y-i.y))}function s1(i,e,r){return new D(i.x+(r-i.y)/(e.y-i.y)*(e.x-i.x),r)}et("FeatureIndex",Wy,{omit:["rawTileData","sourceLayerCoder"]});class Io extends D{constructor(e,r,a,c){super(e,r),this.angle=a,c!==void 0&&(this.segment=c)}clone(){return new Io(this.x,this.y,this.angle,this.segment)}}function Jy(i,e,r,a,c){if(e.segment===void 0||r===0)return!0;let p=e,f=e.segment+1,y=0;for(;y>-r/2;){if(f--,f<0)return!1;y-=i[f].dist(p),p=i[f]}y+=i[f].dist(i[f+1]),f++;const x=[];let S=0;for(;y<r/2;){const P=i[f],E=i[f+1];if(!E)return!1;let k=i[f-1].angleTo(P)-P.angleTo(E);for(k=Math.abs((k+3*Math.PI)%(2*Math.PI)-Math.PI),x.push({distance:y,angleDelta:k}),S+=k;y-x[0].distance>a;)S-=x.shift().angleDelta;if(S>c)return!1;f++,y+=P.dist(E)}return!0}function Qy(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function e_(i,e,r){return i?.6*e*r:0}function t_(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function l1(i,e,r,a,c,p){const f=e_(r,c,p),y=t_(r,a)*p;let x=0;const S=Qy(i)/2;for(let P=0;P<i.length-1;P++){const E=i[P],k=i[P+1],z=E.dist(k);if(x+z>S){const F=(S-x)/z,B=ar.number(E.x,k.x,F),j=ar.number(E.y,k.y,F),G=new Io(B,j,k.angleTo(E),P);return G._round(),!f||Jy(i,G,y,f,e)?G:void 0}x+=z}}function c1(i,e,r,a,c,p,f,y,x){const S=e_(a,p,f),P=t_(a,c),E=P*f,k=i[0].x===0||i[0].x===x||i[0].y===0||i[0].y===x;return e-E<e/4&&(e=E+e/4),r_(i,k?e/2*y%e:(P/2+2*p)*f*y%e,e,S,r,E,k,!1,x)}function r_(i,e,r,a,c,p,f,y,x){const S=p/2,P=Qy(i);let E=0,k=e-r,z=[];for(let F=0;F<i.length-1;F++){const B=i[F],j=i[F+1],G=B.dist(j),Q=j.angleTo(B);for(;k+r<E+G;){k+=r;const q=(k-E)/G,H=ar.number(B.x,j.x,q),te=ar.number(B.y,j.y,q);if(H>=0&&H<x&&te>=0&&te<x&&k-S>=0&&k+S<=P){const ae=new Io(H,te,Q,F);ae._round(),a&&!Jy(i,ae,p,a,c)||z.push(ae)}}E+=G}return y||z.length||f||(z=r_(i,E/2,r,a,c,p,f,!0,x)),z}function i_(i,e,r,a){const c=[],p=i.image,f=p.pixelRatio,y=p.paddedRect.w-2,x=p.paddedRect.h-2;let S={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const P=p.stretchX||[[0,y]],E=p.stretchY||[[0,x]],k=(Ie,Qe)=>Ie+Qe[1]-Qe[0],z=P.reduce(k,0),F=E.reduce(k,0),B=y-z,j=x-F;let G=0,Q=z,q=0,H=F,te=0,ae=B,_e=0,De=j;if(p.content&&a){const Ie=p.content,Qe=Ie[2]-Ie[0],Ye=Ie[3]-Ie[1];(p.textFitWidth||p.textFitHeight)&&(S=Jg(i)),G=Ip(P,0,Ie[0]),q=Ip(E,0,Ie[1]),Q=Ip(P,Ie[0],Ie[2]),H=Ip(E,Ie[1],Ie[3]),te=Ie[0]-G,_e=Ie[1]-q,ae=Qe-Q,De=Ye-H}const Ee=S.x1,Le=S.y1,Ge=S.x2-Ee,Be=S.y2-Le,Ce=(Ie,Qe,Ye,tt)=>{const We=Pp(Ie.stretch-G,Q,Ge,Ee),ot=Ap(Ie.fixed-te,ae,Ie.stretch,z),zt=Pp(Qe.stretch-q,H,Be,Le),St=Ap(Qe.fixed-_e,De,Qe.stretch,F),lr=Pp(Ye.stretch-G,Q,Ge,Ee),oi=Ap(Ye.fixed-te,ae,Ye.stretch,z),Fr=Pp(tt.stretch-q,H,Be,Le),cr=Ap(tt.fixed-_e,De,tt.stretch,F),nr=new D(We,zt),Ft=new D(lr,zt),_r=new D(lr,Fr),Sr=new D(We,Fr),tr=new D(ot/f,St/f),Di=new D(oi/f,cr/f),si=e*Math.PI/180;if(si){const Xr=Math.sin(si),pr=Math.cos(si),Br=[pr,-Xr,Xr,pr];nr._matMult(Br),Ft._matMult(Br),Sr._matMult(Br),_r._matMult(Br)}const zi=Ie.stretch+Ie.fixed,xn=Qe.stretch+Qe.fixed;return{tl:nr,tr:Ft,bl:Sr,br:_r,tex:{x:p.paddedRect.x+1+zi,y:p.paddedRect.y+1+xn,w:Ye.stretch+Ye.fixed-zi,h:tt.stretch+tt.fixed-xn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:tr,pixelOffsetBR:Di,minFontScaleX:ae/f/Ge,minFontScaleY:De/f/Be,isSDF:r}};if(a&&(p.stretchX||p.stretchY)){const Ie=n_(P,B,z),Qe=n_(E,j,F);for(let Ye=0;Ye<Ie.length-1;Ye++){const tt=Ie[Ye],We=Ie[Ye+1];for(let ot=0;ot<Qe.length-1;ot++)c.push(Ce(tt,Qe[ot],We,Qe[ot+1]))}}else c.push(Ce({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:y+1},{fixed:0,stretch:x+1}));return c}function Ip(i,e,r){let a=0;for(const c of i)a+=Math.max(e,Math.min(r,c[1]))-Math.max(e,Math.min(r,c[0]));return a}function n_(i,e,r){const a=[{fixed:-1,stretch:0}];for(const[c,p]of i){const f=a[a.length-1];a.push({fixed:c-f.stretch,stretch:f.stretch}),a.push({fixed:c-f.stretch,stretch:f.stretch+(p-c)})}return a.push({fixed:e+1,stretch:r}),a}function Pp(i,e,r,a){return i/e*r+a}function Ap(i,e,r,a){return i-e*r/a}et("Anchor",Io);class Ep{constructor(e,r,a,c,p,f,y,x,S,P){var E;if(this.boxStartIndex=e.length,S){let k=f.top,z=f.bottom;const F=f.collisionPadding;F&&(k-=F[1],z+=F[3]);let B=z-k;B>0&&(B=Math.max(10,B),this.circleDiameter=B)}else{const k=!((E=f.image)===null||E===void 0)&&E.content&&(f.image.textFitWidth||f.image.textFitHeight)?Jg(f):{x1:f.left,y1:f.top,x2:f.right,y2:f.bottom};k.y1=k.y1*y-x[0],k.y2=k.y2*y+x[2],k.x1=k.x1*y-x[3],k.x2=k.x2*y+x[1];const z=f.collisionPadding;if(z&&(k.x1-=z[0]*y,k.y1-=z[1]*y,k.x2+=z[2]*y,k.y2+=z[3]*y),P){const F=new D(k.x1,k.y1),B=new D(k.x2,k.y1),j=new D(k.x1,k.y2),G=new D(k.x2,k.y2),Q=P*Math.PI/180;F._rotate(Q),B._rotate(Q),j._rotate(Q),G._rotate(Q),k.x1=Math.min(F.x,B.x,j.x,G.x),k.x2=Math.max(F.x,B.x,j.x,G.x),k.y1=Math.min(F.y,B.y,j.y,G.y),k.y2=Math.max(F.y,B.y,j.y,G.y)}e.emplaceBack(r.x,r.y,k.x1,k.y1,k.x2,k.y2,a,c,p)}this.boxEndIndex=e.length}}class u1{constructor(e=[],r=(a,c)=>a<c?-1:a>c?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,c=r[e];for(;e>0;){const p=e-1>>1,f=r[p];if(a(c,f)>=0)break;r[e]=f,e=p}r[e]=c}_down(e){const{data:r,compare:a}=this,c=this.length>>1,p=r[e];for(;e<c;){let f=1+(e<<1);const y=f+1;if(y<this.length&&a(r[y],r[f])<0&&(f=y),a(r[f],p)>=0)break;r[e]=r[f],e=f}r[e]=p}}function h1(i,e=1,r=!1){const a=Es.fromPoints(i[0]),c=Math.min(a.width(),a.height());let p=c/2;const f=new u1([],p1),{minX:y,minY:x,maxX:S,maxY:P}=a;if(c===0)return new D(y,x);for(let z=y;z<S;z+=c)for(let F=x;F<P;F+=c)f.push(new Ql(z+p,F+p,p,i));let E=(function(z){let F=0,B=0,j=0;const G=z[0];for(let Q=0,q=G.length,H=q-1;Q<q;H=Q++){const te=G[Q],ae=G[H],_e=te.x*ae.y-ae.x*te.y;B+=(te.x+ae.x)*_e,j+=(te.y+ae.y)*_e,F+=3*_e}return new Ql(B/F,j/F,0,z)})(i),k=f.length;for(;f.length;){const z=f.pop();(z.d>E.d||!E.d)&&(E=z,r&&console.log("found best %d after %d probes",Math.round(1e4*z.d)/1e4,k)),z.max-E.d<=e||(p=z.h/2,f.push(new Ql(z.p.x-p,z.p.y-p,p,i)),f.push(new Ql(z.p.x+p,z.p.y-p,p,i)),f.push(new Ql(z.p.x-p,z.p.y+p,p,i)),f.push(new Ql(z.p.x+p,z.p.y+p,p,i)),k+=4)}return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${E.d}`)),E.p}function p1(i,e){return e.max-i.max}function Ql(i,e,r,a){this.p=new D(i,e),this.h=r,this.d=(function(c,p){let f=!1,y=1/0;for(let x=0;x<p.length;x++){const S=p[x];for(let P=0,E=S.length,k=E-1;P<E;k=P++){const z=S[P],F=S[k];z.y>c.y!=F.y>c.y&&c.x<(F.x-z.x)*(c.y-z.y)/(F.y-z.y)+z.x&&(f=!f),y=Math.min(y,cg(c,z,F))}}return(f?1:-1)*Math.sqrt(y)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}var ai;b.aP=void 0,(ai=b.aP||(b.aP={}))[ai.center=1]="center",ai[ai.left=2]="left",ai[ai.right=3]="right",ai[ai.top=4]="top",ai[ai.bottom=5]="bottom",ai[ai["top-left"]=6]="top-left",ai[ai["top-right"]=7]="top-right",ai[ai["bottom-left"]=8]="bottom-left",ai[ai["bottom-right"]=9]="bottom-right";const Of=Number.POSITIVE_INFINITY;function a_(i,e){return e[1]!==Of?(function(r,a,c){let p=0,f=0;switch(a=Math.abs(a),c=Math.abs(c),r){case"top-right":case"top-left":case"top":f=c-7;break;case"bottom-right":case"bottom-left":case"bottom":f=7-c}switch(r){case"top-right":case"bottom-right":case"right":p=-a;break;case"top-left":case"bottom-left":case"left":p=a}return[p,f]})(i,e[0],e[1]):(function(r,a){let c=0,p=0;a<0&&(a=0);const f=a/Math.SQRT2;switch(r){case"top-right":case"top-left":p=f-7;break;case"bottom-right":case"bottom-left":p=7-f;break;case"bottom":p=7-a;break;case"top":p=a-7}switch(r){case"top-right":case"bottom-right":c=-f;break;case"top-left":case"bottom-left":c=f;break;case"left":c=a;break;case"right":c=-a}return[c,p]})(i,e[0])}function o_(i,e,r){var a;const c=i.layout,p=(a=c.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(p){const y=p.values,x=[];for(let S=0;S<y.length;S+=2){const P=x[S]=y[S],E=y[S+1].map((k=>k*Zr));P.startsWith("top")?E[1]-=7:P.startsWith("bottom")&&(E[1]+=7),x[S+1]=E}return new mi(x)}const f=c.get("text-variable-anchor");if(f){let y;y=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[c.get("text-radial-offset").evaluate(e,{},r)*Zr,Of]:c.get("text-offset").evaluate(e,{},r).map((S=>S*Zr));const x=[];for(const S of f)x.push(S,a_(S,y));return new mi(x)}return null}function Nf(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function d1(i,e,r,a,c,p,f,y,x,S,P,E){let k=p.textMaxSize.evaluate(e,{});k===void 0&&(k=f);const z=i.layers[0].layout,F=z.get("icon-offset").evaluate(e,{},P),B=l_(r.horizontal),j=f/24,G=i.tilePixelRatio*j,Q=i.tilePixelRatio*k/24,q=i.tilePixelRatio*y,H=i.tilePixelRatio*z.get("symbol-spacing"),te=z.get("text-padding")*i.tilePixelRatio,ae=(function(Ye,tt,We,ot=1){const zt=Ye.get("icon-padding").evaluate(tt,{},We),St=zt&&zt.values;return[St[0]*ot,St[1]*ot,St[2]*ot,St[3]*ot]})(z,e,P,i.tilePixelRatio),_e=z.get("text-max-angle")/180*Math.PI,De=z.get("text-rotation-alignment")!=="viewport"&&z.get("symbol-placement")!=="point",Ee=z.get("icon-rotation-alignment")==="map"&&z.get("symbol-placement")!=="point",Le=z.get("symbol-placement"),Ge=H/2,Be=z.get("icon-text-fit");let Ce;a&&Be!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Ce=Qg(a,r.vertical,Be,z.get("icon-text-fit-padding"),F,j)),B&&(a=Qg(a,B,Be,z.get("icon-text-fit-padding"),F,j)));const Ie=P?E.line.getGranularityForZoomLevel(P.z):1,Qe=(Ye,tt)=>{tt.x<0||tt.x>=Ot||tt.y<0||tt.y>=Ot||(function(We,ot,zt,St,lr,oi,Fr,cr,nr,Ft,_r,Sr,tr,Di,si,zi,xn,Xr,pr,Br,vr,Yr,Ba,Ln,Cu){const Po=We.addToLineVertexArray(ot,zt);let Ds,ec,tc,rc,p_=0,d_=0,f_=0,m_=0,Wf=-1,Hf=-1;const Oa={};let g_=Tr("");if(We.allowVerticalPlacement&&St.vertical){const vi=cr.layout.get("text-rotate").evaluate(vr,{},Ln)+90;tc=new Ep(nr,ot,Ft,_r,Sr,St.vertical,tr,Di,si,vi),Fr&&(rc=new Ep(nr,ot,Ft,_r,Sr,Fr,xn,Xr,si,vi))}if(lr){const vi=cr.layout.get("icon-rotate").evaluate(vr,{}),on=cr.layout.get("icon-text-fit")!=="none",zs=i_(lr,vi,Ba,on),Fn=Fr?i_(Fr,vi,Ba,on):void 0;ec=new Ep(nr,ot,Ft,_r,Sr,lr,xn,Xr,!1,vi),p_=4*zs.length;const Ls=We.iconSizeData;let aa=null;Ls.kind==="source"?(aa=[Ra*cr.layout.get("icon-size").evaluate(vr,{})],aa[0]>To&&$r(`${We.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Ls.kind==="composite"&&(aa=[Ra*Yr.compositeIconSizes[0].evaluate(vr,{},Ln),Ra*Yr.compositeIconSizes[1].evaluate(vr,{},Ln)],(aa[0]>To||aa[1]>To)&&$r(`${We.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),We.addSymbols(We.icon,zs,aa,Br,pr,vr,b.az.none,ot,Po.lineStartIndex,Po.lineLength,-1,Ln),Wf=We.icon.placedSymbolArray.length-1,Fn&&(d_=4*Fn.length,We.addSymbols(We.icon,Fn,aa,Br,pr,vr,b.az.vertical,ot,Po.lineStartIndex,Po.lineLength,-1,Ln),Hf=We.icon.placedSymbolArray.length-1)}const y_=Object.keys(St.horizontal);for(const vi of y_){const on=St.horizontal[vi];if(!Ds){g_=Tr(on.text);const Fn=cr.layout.get("text-rotate").evaluate(vr,{},Ln);Ds=new Ep(nr,ot,Ft,_r,Sr,on,tr,Di,si,Fn)}const zs=on.positionedLines.length===1;if(f_+=s_(We,ot,on,oi,cr,si,vr,zi,Po,St.vertical?b.az.horizontal:b.az.horizontalOnly,zs?y_:[vi],Oa,Wf,Yr,Ln),zs)break}St.vertical&&(m_+=s_(We,ot,St.vertical,oi,cr,si,vr,zi,Po,b.az.vertical,["vertical"],Oa,Hf,Yr,Ln));const g1=Ds?Ds.boxStartIndex:We.collisionBoxArray.length,y1=Ds?Ds.boxEndIndex:We.collisionBoxArray.length,_1=tc?tc.boxStartIndex:We.collisionBoxArray.length,v1=tc?tc.boxEndIndex:We.collisionBoxArray.length,x1=ec?ec.boxStartIndex:We.collisionBoxArray.length,b1=ec?ec.boxEndIndex:We.collisionBoxArray.length,w1=rc?rc.boxStartIndex:We.collisionBoxArray.length,T1=rc?rc.boxEndIndex:We.collisionBoxArray.length;let Rn=-1;const kp=(vi,on)=>vi&&vi.circleDiameter?Math.max(vi.circleDiameter,on):on;Rn=kp(Ds,Rn),Rn=kp(tc,Rn),Rn=kp(ec,Rn),Rn=kp(rc,Rn);const __=Rn>-1?1:0;__&&(Rn*=Cu/Zr),We.glyphOffsetArray.length>=Wl.MAX_GLYPHS&&$r("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vr.sortKey!==void 0&&We.addToSortKeyRanges(We.symbolInstances.length,vr.sortKey);const S1=o_(cr,vr,Ln),[M1,I1]=(function(vi,on){const zs=vi.length,Fn=on?.values;if(Fn?.length>0)for(let Ls=0;Ls<Fn.length;Ls+=2){const aa=Fn[Ls+1];vi.emplaceBack(b.aP[Fn[Ls]],aa[0],aa[1])}return[zs,vi.length]})(We.textAnchorOffsets,S1);We.symbolInstances.emplaceBack(ot.x,ot.y,Oa.right>=0?Oa.right:-1,Oa.center>=0?Oa.center:-1,Oa.left>=0?Oa.left:-1,Oa.vertical||-1,Wf,Hf,g_,g1,y1,_1,v1,x1,b1,w1,T1,Ft,f_,m_,p_,d_,__,0,tr,Rn,M1,I1)})(i,tt,Ye,r,a,c,Ce,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,G,[te,te,te,te],De,x,q,ae,Ee,F,e,p,S,P,f)};if(Le==="line")for(const Ye of Xy(e.geometry,0,0,Ot,Ot)){const tt=As(Ye,Ie),We=c1(tt,H,_e,r.vertical||B,a,24,Q,i.overscaling,Ot);for(const ot of We)B&&f1(i,B.text,Ge,ot)||Qe(tt,ot)}else if(Le==="line-center"){for(const Ye of e.geometry)if(Ye.length>1){const tt=As(Ye,Ie),We=l1(tt,_e,r.vertical||B,a,24,Q);We&&Qe(tt,We)}}else if(e.type==="Polygon")for(const Ye of sl(e.geometry,0)){const tt=h1(Ye,16);Qe(As(Ye[0],Ie,!0),new Io(tt.x,tt.y,0))}else if(e.type==="LineString")for(const Ye of e.geometry){const tt=As(Ye,Ie);Qe(tt,new Io(tt[0].x,tt[0].y,0))}else if(e.type==="Point")for(const Ye of e.geometry)for(const tt of Ye)Qe([tt],new Io(tt.x,tt.y,0))}function s_(i,e,r,a,c,p,f,y,x,S,P,E,k,z,F){const B=(function(Q,q,H,te,ae,_e,De,Ee){const Le=te.layout.get("text-rotate").evaluate(_e,{})*Math.PI/180,Ge=[];for(const Be of q.positionedLines)for(const Ce of Be.positionedGlyphs){if(!Ce.rect)continue;const Ie=Ce.rect||{};let Qe=4,Ye=!0,tt=1,We=0;const ot=(ae||Ee)&&Ce.vertical,zt=Ce.metrics.advance*Ce.scale/2;if(Ee&&q.verticalizable&&(We=Be.lineOffset/2-(Ce.imageName?-(Zr-Ce.metrics.width*Ce.scale)/2:(Ce.scale-1)*Zr)),Ce.imageName){const Xr=De[Ce.imageName];Ye=Xr.sdf,tt=Xr.pixelRatio,Qe=1/tt}const St=ae?[Ce.x+zt,Ce.y]:[0,0];let lr=ae?[0,0]:[Ce.x+zt+H[0],Ce.y+H[1]-We],oi=[0,0];ot&&(oi=lr,lr=[0,0]);const Fr=Ce.metrics.isDoubleResolution?2:1,cr=(Ce.metrics.left-Qe)*Ce.scale-zt+lr[0],nr=(-Ce.metrics.top-Qe)*Ce.scale+lr[1],Ft=cr+Ie.w/Fr*Ce.scale/tt,_r=nr+Ie.h/Fr*Ce.scale/tt,Sr=new D(cr,nr),tr=new D(Ft,nr),Di=new D(cr,_r),si=new D(Ft,_r);if(ot){const Xr=new D(-zt,zt- -17),pr=-Math.PI/2,Br=12-zt,vr=new D(22-Br,-(Ce.imageName?Br:0)),Yr=new D(...oi);Sr._rotateAround(pr,Xr)._add(vr)._add(Yr),tr._rotateAround(pr,Xr)._add(vr)._add(Yr),Di._rotateAround(pr,Xr)._add(vr)._add(Yr),si._rotateAround(pr,Xr)._add(vr)._add(Yr)}if(Le){const Xr=Math.sin(Le),pr=Math.cos(Le),Br=[pr,-Xr,Xr,pr];Sr._matMult(Br),tr._matMult(Br),Di._matMult(Br),si._matMult(Br)}const zi=new D(0,0),xn=new D(0,0);Ge.push({tl:Sr,tr,bl:Di,br:si,tex:Ie,writingMode:q.writingMode,glyphOffset:St,sectionIndex:Ce.sectionIndex,isSDF:Ye,pixelOffsetTL:zi,pixelOffsetBR:xn,minFontScaleX:0,minFontScaleY:0})}return Ge})(0,r,y,c,p,f,a,i.allowVerticalPlacement),j=i.textSizeData;let G=null;j.kind==="source"?(G=[Ra*c.layout.get("text-size").evaluate(f,{})],G[0]>To&&$r(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):j.kind==="composite"&&(G=[Ra*z.compositeTextSizes[0].evaluate(f,{},F),Ra*z.compositeTextSizes[1].evaluate(f,{},F)],(G[0]>To||G[1]>To)&&$r(`${i.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),i.addSymbols(i.text,B,G,y,p,f,S,e,x.lineStartIndex,x.lineLength,k,F);for(const Q of P)E[Q]=i.text.placedSymbolArray.length-1;return 4*B.length}function l_(i){for(const e in i)return i[e];return null}function f1(i,e,r,a){const c=i.compareText;if(e in c){const p=c[e];for(let f=p.length-1;f>=0;f--)if(a.dist(p[f])<r)return!0}else c[e]=[];return c[e].push(a),!1}const c_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class jf{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,a]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const c=a>>4;if(c!==1)throw new Error(`Got v${c} data when expected v1.`);const p=c_[15&a];if(!p)throw new Error("Unrecognized array type.");const[f]=new Uint16Array(e,2,1),[y]=new Uint32Array(e,4,1);return new jf(y,f,p,e)}constructor(e,r=64,a=Float64Array,c){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=c_.indexOf(this.ArrayType),f=2*e*this.ArrayType.BYTES_PER_ELEMENT,y=e*this.IndexArrayType.BYTES_PER_ELEMENT,x=(8-y%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);c&&c instanceof ArrayBuffer?(this.data=c,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+y+x,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+f+y+x),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+y+x,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Vf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:f,nodeSize:y}=this,x=[0,p.length-1,0],S=[];for(;x.length;){const P=x.pop()||0,E=x.pop()||0,k=x.pop()||0;if(E-k<=y){for(let j=k;j<=E;j++){const G=f[2*j],Q=f[2*j+1];G>=e&&G<=a&&Q>=r&&Q<=c&&S.push(p[j])}continue}const z=k+E>>1,F=f[2*z],B=f[2*z+1];F>=e&&F<=a&&B>=r&&B<=c&&S.push(p[z]),(P===0?e<=F:r<=B)&&(x.push(k),x.push(z-1),x.push(1-P)),(P===0?a>=F:c>=B)&&(x.push(z+1),x.push(E),x.push(1-P))}return S}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:p,nodeSize:f}=this,y=[0,c.length-1,0],x=[],S=a*a;for(;y.length;){const P=y.pop()||0,E=y.pop()||0,k=y.pop()||0;if(E-k<=f){for(let j=k;j<=E;j++)h_(p[2*j],p[2*j+1],e,r)<=S&&x.push(c[j]);continue}const z=k+E>>1,F=p[2*z],B=p[2*z+1];h_(F,B,e,r)<=S&&x.push(c[z]),(P===0?e-a<=F:r-a<=B)&&(y.push(k),y.push(z-1),y.push(1-P)),(P===0?e+a>=F:r+a>=B)&&(y.push(z+1),y.push(E),y.push(1-P))}return x}}function Vf(i,e,r,a,c,p){if(c-a<=r)return;const f=a+c>>1;u_(i,e,f,a,c,p),Vf(i,e,r,a,f-1,1-p),Vf(i,e,r,f+1,c,1-p)}function u_(i,e,r,a,c,p){for(;c>a;){if(c-a>600){const S=c-a+1,P=r-a+1,E=Math.log(S),k=.5*Math.exp(2*E/3),z=.5*Math.sqrt(E*k*(S-k)/S)*(P-S/2<0?-1:1);u_(i,e,r,Math.max(a,Math.floor(r-P*k/S+z)),Math.min(c,Math.floor(r+(S-P)*k/S+z)),p)}const f=e[2*r+p];let y=a,x=c;for(Au(i,e,a,r),e[2*c+p]>f&&Au(i,e,a,c);y<x;){for(Au(i,e,y,x),y++,x--;e[2*y+p]<f;)y++;for(;e[2*x+p]>f;)x--}e[2*a+p]===f?Au(i,e,a,x):(x++,Au(i,e,x,c)),x<=r&&(a=x+1),r<=x&&(c=x-1)}}function Au(i,e,r,a){Uf(i,r,a),Uf(e,2*r,2*a),Uf(e,2*r+1,2*a+1)}function Uf(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function h_(i,e,r,a){const c=i-r,p=e-a;return c*c+p*p}var $f;b.cH=void 0,($f=b.cH||(b.cH={})).create="create",$f.load="load",$f.fullLoad="fullLoad";let Cp=null,Eu=[];const Gf=1e3/60,qf="loadTime",Zf="fullLoadTime",m1={mark(i){performance.mark(i)},frame(i){const e=i;Cp!=null&&Eu.push(e-Cp),Cp=e},clearMetrics(){Cp=null,Eu=[],performance.clearMeasures(qf),performance.clearMeasures(Zf);for(const i in b.cH)performance.clearMarks(b.cH[i])},getPerformanceMetrics(){performance.measure(qf,b.cH.create,b.cH.load),performance.measure(Zf,b.cH.create,b.cH.fullLoad);const i=performance.getEntriesByName(qf)[0].duration,e=performance.getEntriesByName(Zf)[0].duration,r=Eu.length,a=1/(Eu.reduce(((p,f)=>p+f),0)/r/1e3),c=Eu.filter((p=>p>Gf)).reduce(((p,f)=>p+(f-Gf)/Gf),0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:c/(r+c)*100,totalFrames:r}}};b.$=le,b.A=$e,b.B=yo,b.C=Gr,b.D=at,b.E=Lt,b.F=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}},b.G=ar,b.H=$t,b.I=pf,b.J=Hh,b.K=function(i){if(dr==null){const e=i.navigator?i.navigator.userAgent:null;dr=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return dr},b.L=class{constructor(i,e){this.target=i,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Cb((()=>this.process())),this.subscription=Wa(this.target,"message",(r=>this.receive(r)),!1),this.globalScope=mn(self)?i:window}registerMessageHandler(i,e){this.messageHandlers[i]=e}unregisterMessageHandler(i){delete this.messageHandlers[i]}sendAsync(i,e){return new Promise(((r,a)=>{const c=Math.round(1e18*Math.random()).toString(36).substring(0,10),p=e?Wa(e.signal,"abort",(()=>{p?.unsubscribe(),delete this.resolveRejects[c];const x={id:c,type:"<cancel>",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(x)}),kb):null;this.resolveRejects[c]={resolve:x=>{p?.unsubscribe(),r(x)},reject:x=>{p?.unsubscribe(),a(x)}};const f=[],y=Object.assign(Object.assign({},i),{id:c,sourceMapId:this.mapId,origin:location.origin,data:fs(i.data,f)});this.target.postMessage(y,{transfer:f})}))}receive(i){const e=i.data,r=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!=="resource://android"&&location.origin!=="resource://android"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[r];const a=this.abortControllers[r];return delete this.abortControllers[r],void(a&&a.abort())}if(mn(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){return s(this,void 0,void 0,(function*(){if(e.type==="<response>"){const c=this.resolveRejects[i];return delete this.resolveRejects[i],c?void(e.error?c.reject(ms(e.error)):c.resolve(ms(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=ms(e.data),a=new AbortController;this.abortControllers[i]=a;try{const c=yield this.messageHandlers[e.type](e.sourceMapId,r,a);this.completeTask(i,null,c)}catch(c){this.completeTask(i,c)}}))}completeTask(i,e,r){const a=[];delete this.abortControllers[i];const c={id:i,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?fs(e):null,data:fs(r,a)};this.target.postMessage(c,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},b.M=ge,b.N=function(){var i=new $e(16);return $e!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},b.O=function(i,e,r){var a,c,p,f,y,x,S,P,E,k,z,F,B=r[0],j=r[1],G=r[2];return e===i?(i[12]=e[0]*B+e[4]*j+e[8]*G+e[12],i[13]=e[1]*B+e[5]*j+e[9]*G+e[13],i[14]=e[2]*B+e[6]*j+e[10]*G+e[14],i[15]=e[3]*B+e[7]*j+e[11]*G+e[15]):(c=e[1],p=e[2],f=e[3],y=e[4],x=e[5],S=e[6],P=e[7],E=e[8],k=e[9],z=e[10],F=e[11],i[0]=a=e[0],i[1]=c,i[2]=p,i[3]=f,i[4]=y,i[5]=x,i[6]=S,i[7]=P,i[8]=E,i[9]=k,i[10]=z,i[11]=F,i[12]=a*B+y*j+E*G+e[12],i[13]=c*B+x*j+k*G+e[13],i[14]=p*B+S*j+z*G+e[14],i[15]=f*B+P*j+F*G+e[15]),i},b.P=D,b.Q=function(i,e,r){var a=r[0],c=r[1],p=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*c,i[5]=e[5]*c,i[6]=e[6]*c,i[7]=e[7]*c,i[8]=e[8]*p,i[9]=e[9]*p,i[10]=e[10]*p,i[11]=e[11]*p,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},b.R=ki,b.S=function(i,e,r){var a=e[0],c=e[1],p=e[2],f=e[3],y=e[4],x=e[5],S=e[6],P=e[7],E=e[8],k=e[9],z=e[10],F=e[11],B=e[12],j=e[13],G=e[14],Q=e[15],q=r[0],H=r[1],te=r[2],ae=r[3];return i[0]=q*a+H*y+te*E+ae*B,i[1]=q*c+H*x+te*k+ae*j,i[2]=q*p+H*S+te*z+ae*G,i[3]=q*f+H*P+te*F+ae*Q,i[4]=(q=r[4])*a+(H=r[5])*y+(te=r[6])*E+(ae=r[7])*B,i[5]=q*c+H*x+te*k+ae*j,i[6]=q*
2p+H*S+te*z+ae*G,i[7]=q*f+H*P+te*F+ae*Q,i[8]=(q=r[8])*a+(H=r[9])*y+(te=r[10])*E+(ae=r[11])*B,i[9]=q*c+H*x+te*k+ae*j,i[10]=q*p+H*S+te*z+ae*G,i[11]=q*f+H*P+te*F+ae*Q,i[12]=(q=r[12])*a+(H=r[13])*y+(te=r[14])*E+(ae=r[15])*B,i[13]=q*c+H*x+te*k+ae*j,i[14]=q*p+H*S+te*z+ae*G,i[15]=q*f+H*P+te*F+ae*Q,i},b.T=rf,b.U=function(i,e){const r={};for(let a=0;a<e.length;a++){const c=e[a];c in i&&(r[c]=i[c])}return r},b.V=So,b.W=Pn,b.X=ly,b.Y=sy,b.Z=se,b._=s,b.a=W,b.a$=dt,b.a0=He,b.a1=Za,b.a2=nn,b.a3=uy,b.a4=_p,b.a5=Ot,b.a6=function(i,e,r){if(!i)return e||{};if(!e)return i||{};const a=fy(i),c=fy(e);(function(f,y){y.removeAll&&(f.add.clear(),f.update.clear(),f.remove.clear(),y.remove.clear());for(const x of y.remove)f.add.delete(x),f.update.delete(x);for(const[x,S]of y.update){const P=f.update.get(x);P&&(y.update.set(x,Db(P,S)),f.update.delete(x))}})(a,c);const p={};if((a.removeAll||c.removeAll)&&(p.removeAll=!0),p.remove=new Set([...a.remove,...c.remove]),p.add=new Map([...a.add,...c.add]),p.update=new Map([...a.update,...c.update]),p.remove.size&&p.add.size)for(const f of p.add.keys())p.remove.delete(f);return(function(f){const y={};return f.removeAll&&(y.removeAll=f.removeAll),f.remove&&(y.remove=Array.from(f.remove)),f.add&&(y.add=Array.from(f.add.values())),f.update&&(y.update=Array.from(f.update.values())
2),y})(p)},b.a7=function(i,e){const r=new Map;if(i==null||i.type==null)return r;if(i.type==="Feature"){const a=bf(i,e);return a==null?void 0:(r.set(a,i),r)}if(i.type==="FeatureCollection"){const a=new Set;for(const c of i.features){const p=bf(c,e);if(p==null||a.has(p))return;a.add(p),r.set(p,c)}return r}},b.a8=function(i,e,r){var a,c;const p=[];if(e.removeAll)i.clear();else if(e.remove)for(const f of e.remove){const y=i.get(f);y&&(p.push(y.geometry),i.delete(f))}if(e.add)for(const f of e.add){const y=bf(f,r);if(y==null)continue;const x=i.get(y);x&&p.push(x.geometry),p.push(f.geometry),i.set(y,f)}if(e.update)for(const f of e.update){const y=i.get(f.id);if(!y)continue;const x=!!f.newGeometry,S=f.removeAllProperties||((a=f.removeProperties)===null||a===void 0?void 0:a.length)>0||((c=f.addOrUpdateProperties)===null||c===void 0?void 0:c.length)>0;if(!x&&!S)continue;p.push(y.geometry);const P=Object.assign({},y);if(i.set(f.id,P),x&&(p.push(f.newGeometry),P.geometry=f.newGeometry),S){if(P.properties=f.removeAllProperties?{}:Object.assign({},P.properties||{}),f.removeProperties)for(const E of f.removeProperties)delete P.properties[E];if(f.addOrUpdateProperties)for(const{key:E,value:k}of f.addOrUpdateProperties)P.properties[E]=k}}return p},b.a9=Su,b.aA=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:c}){return i.kind==="source"?a/Ra:i.kind==="composite"?ar.number(a/Ra,c/Ra,r):e},b.aB=function(i,e){var r=e[0],a=e[1],c=e[2],p=e[3],f=e[4],y=e[5],x=e[6],S=e[7],P=e[8],E=e[9],k=e[10],z=e[11],F=e[12],B=e[13],j=e[14],G=e[15],Q=r*y-a*f,q=r*x-c*f,H=r*S-p*f,te=a*x-c*y,ae=a*S-p*y,_e=c*S-p*x,De=P*B-E*F,Ee=P*j-k*F,Le=P*G-z*F,Ge=E*j-k*B,Be=E*G-z*B,Ce=k*G-z*j,Ie=Q*Ce-q*Be+H*Ge+te*Le-ae*Ee+_e*De;return Ie?(i[0]=(y*Ce-x*Be+S*Ge)*(Ie=1/Ie),i[1]=(c*Be-a*Ce-p*Ge)*Ie,i[2]=(B*_e-j*ae+G*te)*Ie,i[3]=(k*ae-E*_e-z*te)*Ie,i[4]=(x*Le-f*Ce-S*Ee)*Ie,i[5]=(r*Ce-c*Le+p*Ee)*Ie,i[6]=(j*H-F*_e-G*q)*Ie,i[7]=(P*_e-k*H+z*q)*Ie,i[8]=(f*Be-y*Le+S*De)*Ie,i[9]=(a*Le-r*Be-p*De)*Ie,i[10]=(F*ae-B*H+G*Q)*Ie,i[11]=(E*H-P*ae-z*Q)*Ie,i[12]=(y*Ee-f*Ge-x*De)*Ie,i[13]=(r*Ge-a*Ee+c*De)*Ie,i[14]=(B*q-F*te-j*Q)*Ie,i[15]=(P*te-E*q+k*Q)*Ie,i):null},b.aC=ui,b.aD=function(i){var e=i[0],r=i[1];return Math.sqrt(e*e+r*r)},b.aE=function(i){return i[0]=0,i[1]=0,i},b.aF=function(i,e,r){return i[0]=e[0]*r,i[1]=e[1]*r,i},b.aG=mf,b.aH=Tn,b.aI=function(i,e,r,a){const c=e.y-i.y,p=e.x-i.x,f=a.y-r.y,y=a.x-r.x,x=f*p-y*c;if(x===0)return null;const S=(y*(i.y-r.y)-f*(i.x-r.x))/x;return new D(i.x+S*p,i.y+S*c)},b.aJ=Xy,b.aK=Nl,b.aL=function(i){let e=1/0,r=1/0,a=-1/0,c=-1/0;for(const p of i)e=Math.min(e,p.x),r=Math.min(r,p.y),a=Math.max(a,p.x),c=Math.max(c,p.y);return[e,r,a,c]},b.aM=Zr,b.aN=Ga,b.aO=function(i,e,r,a,c=!1){if(!r[0]&&!r[1])return[0,0];const p=c?a==="map"?-i.bearingInRadians:0:a==="viewport"?i.bearingInRadians:0;if(p){const f=Math.sin(p),y=Math.cos(p);r=[r[0]*y-r[1]*f,r[0]*f+r[1]*y]}return[c?r[0]:Ga(e,r[0],i.zoom),c?r[1]:Ga(e,r[1],i.zoom)]},b.aQ=ff,b.aR=Nf,b.aS=df,b.aT=jf,b.aU=wr,b.aV=pp,b.aW=X,b.aX=Ze,b.aY=Se,b.aZ=wi,b.a_=hy,b.aa=Es,b.ab=25,b.ac=xf,b.ad=i=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((r=>{e.onloadstart=()=>{r(e)};for(const a of i){const c=window.document.createElement("source");ze(a)||(e.crossOrigin="Anonymous"),c.src=a,e.appendChild(c)}}))},b.ae=je,b.af=function(){return da++},b.ag=h,b.ah=Wl,b.ai=Pu,b.aj=as,b.ak=na,b.al=gy,b.am=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((r,a,c,p)=>{const f=c||p;return e[a]=!f||f.toLowerCase(),""})),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},b.an=qi,b.ao=85.051129,b.ap=Ha,b.aq=function(i){return Math.pow(2,i)},b.ar=Me,b.as=cy,b.at=function(i){return Math.log(i)/Math.LN2},b.au=function(i){var e=i[0],r=i[1];return e*e+r*r},b.av=function(i){if(!i.length)return new Set;const e=Math.max(...i.map((x=>x.canonical.z)));let r=1/0,a=-1/0,c=1/0,p=-1/0;const f=[];for(const x of i){const{x:S,y:P,z:E}=x.canonical,k=Math.pow(2,e-E),z=S*k,F=P*k;f.push({id:x,x:z,y:F}),z<r&&(r=z),z>a&&(a=z),F<c&&(c=F),F>p&&(p=F)}const y=new Set;for(const x of f)x.x!==r&&x.x!==a&&x.y!==c&&x.y!==p||y.add(x.id);return y},b.aw=function(i,e){const r=Math.abs(2*i.wrap)-+(i.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);
vendor: 50,758 bytes, line 2
2return i.overscaledZ-e.overscaledZ||a-r||e.canonical.y-i.canonical.y||e.canonical.x-i.canonical.x},b.ax=class{constructor(i,e){this.max=i,this.onRemove=e,this.reset()}reset(){for(const i in this.data)for(const e of this.data[i])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(i,e,r){const a=i.wrapped().key;this.data[a]===void 0&&(this.data[a]=[]);const c={value:e,timeout:void 0};if(r!==void 0&&(c.timeout=setTimeout((()=>{this.remove(i,c)}),r)),this.data[a].push(c),this.order.push(a),this.order.length>this.max){const p=this._getAndRemoveByKey(this.order[0]);p&&this.onRemove(p)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const e=this.data[i].shift();return e.timeout&&clearTimeout(e.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),e.value}getByKey(i){const e=this.data[i];return e?e[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,e){if(!this.has(i))return this;const r=i.wrapped().key,a=e===void 0?0:this.data[r].indexOf(e),c=this.data[r][a];return this.data[r].splice(a,1),c.timeout&&clearTimeout(c.timeout),this.data[r].length===0&&delete this.data[r],this.onRemove(c.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(i){const e=[];for(const r in this.data)for(const a of this.data[r])i(a.value)||e.push(a);for(const r of e)this.remove(r.value.tileID,r)}},b.ay=function(i,e){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:c,minZoom:p,maxZoom:f}=i,y=c?qi(yi.interpolationFactor(c,e,p,f),0,1):0;i.kind==="camera"?a=ar.number(i.minSize,i.maxSize,y):r=y}return{uSizeT:r,uSize:a}},b.b=Gn,b.b$=za,b.b0=It,b.b1=function(i){var e=new $e(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e},b.b2=function(i,e,r){return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],i},b.b3=function(i,e){var r=e[0],a=e[1],c=e[2],p=r*r+a*a+c*c;return p>0&&(p=1/Math.sqrt(p)),i[0]=e[0]*p,i[1]=e[1]*p,i[2]=e[2]*p,i},b.b4=Cr,b.b5=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]},b.b6=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},b.b7=rt,b.b8=function(i,e,r){const a=e[0]*r[0]+e[1]*r[1]+e[2]*r[2];return a===0?null:(-(i[0]*r[0]+i[1]*r[1]+i[2]*r[2])-r[3])/a},b.b9=ci,b.bA=function(i,e,r,a){return i[0]=e[0]+r[0]*a,i[1]=e[1]+r[1]*a,i[2]=e[2]+r[2]*a,i},b.bB=$a,b.bC=function(i,e,r){var a=r[0],c=r[1],p=r[2],f=r[3],y=e[0],x=e[1],S=e[2],P=c*S-p*x,E=p*y-a*S,k=a*x-c*y;return i[0]=y+f*(P+=P)+c*(k+=k)-p*(E+=E),i[1]=x+f*E+p*P-a*k,i[2]=S+f*k+a*E-c*P,i},b.bD=function(i,e,r){const a=(function(x){var S=x[3],P=x[4],E=x[5],k=x[6],z=x[7],F=x[8];return x[0]*(F*P-E*z)+x[1]*(-F*S+E*k)+x[2]*(z*S-P*k)})([i[0],i[1],i[2],e[0],e[1],e[2],r[0],r[1],r[2]]);if(a===0)return null;const c=Cr([],[e[0],e[1],e[2]],[r[0],r[1],r[2]]),p=Cr([],[r[0],r[1],r[2]],[i[0],i[1],i[2]]),f=Cr([],[i[0],i[1],i[2]],[e[0],e[1],e[2]]),y=dt([],c,-i[3]);return It(y,y,dt([],p,-e[3])),It(y,y,dt([],f,-r[3])),dt(y,y,1/a),y},b.bE=vf,b.bF=function(){return new Float64Array(4)},b.bG=function(i,e,r,a){var c=[],p=[];return c[0]=e[0]-r[0],c[1]=e[1]-r[1],c[2]=e[2]-r[2],p[0]=c[0]*Math.cos(a)-c[1]*Math.sin(a),p[1]=c[0]*Math.sin(a)+c[1]*Math.cos(a),p[2]=c[2],i[0]=p[0]+r[0],i[1]=p[1]+r[1],i[2]=p[2]+r[2],i},b.bH=function(i,e,r,a){var c=[],p=[];return c[0]=e[0]-r[0],c[1]=e[1]-r[1],c[2]=e[2]-r[2],p[0]=c[0],p[1]=c[1]*Math.cos(a)-c[2]*Math.sin(a),p[2]=c[1]*Math.sin(a)+c[2]*Math.cos(a),i[0]=p[0]+r[0],i[1]=p[1]+r[1],i[2]=p[2]+r[2],i},b.bI=function(i,e,r,a){var c=[],p=[];return c[0]=e[0]-r[0],c[1]=e[1]-r[1],c[2]=e[2]-r[2],p[0]=c[2]*Math.sin(a)+c[0]*Math.cos(a),p[1]=c[1],p[2]=c[2]*Math.cos(a)-c[0]*Math.sin(a),i[0]=p[0]+r[0],i[1]=p[1]+r[1],i[2]=p[2]+r[2],i},b.bJ=function(i,e,r){var a=Math.sin(r),c=Math.cos(r),p=e[0],f=e[1],y=e[2],x=e[3],S=e[8],P=e[9],E=e[10],k=e[11];return e!==i&&(i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=p*c-S*a,i[1]=f*c-P*a,i[2]=y*c-E*a,i[3]=x*c-k*a,i[8]=p*a+S*c,i[9]=f*a+P*c,i[10]=y*a+E*c,i[11]=x*a+k*c,i},b.bK=function(i,e){const r=In(i,360),a=In(e,360),c=a-r,p=a>r?c-360:c+360;return Math.abs(c)<Math.abs(p)?c:p},b.bL=function(i){return i[0]=0,i[1]=0,i[2]=0,i},b.bM=function(i,e,r,a){const c=Math.sqrt(i*i+e*e),p=Math.sqrt(r*r+a*a);i/=c,e/=c,r/=p,a/=p;const f=Math.acos(i*r+e*a);return-e*r+i*a>0?f:-f},b.bN=function(i,e){const r=In(i,2*Math.PI),a=In(e,2*Math.PI);return Math.min(Math.abs(r-a),Math.abs(r-a+2*Math.PI),Math.abs(r-a-2*Math.PI))},b.bO=function(){const i={},e=we.$version;for(const r in we.$root){const a=we.$root[r];if(a.required){let c=null;c=r==="version"?e:a.type==="array"?[]:{},c!=null&&(i[r]=c)}}return i},b.bP=Pe,b.bQ=Kc,b.bR=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let a=0;a<e.length;a++)if(!i(e[a],r[a]))return!1;return!0}if(typeof e=="object"&&e!==null&&r!==null){if(typeof r!="object"||Object.keys(e).length!==Object.keys(r).length)return!1;for(const a in e)if(!i(e[a],r[a]))return!1;return!0}return e===r},b.bS=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r<i.length;r++)e[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=Jr(i[r],e[i[r].ref]));return i},b.bT=function(i,e){if(i.type==="custom")return new Eb(i,e);switch(i.type){case"background":return new Ab(i,e);case"circle":return new px(i,e);case"color-relief":return new _x(i,e);case"fill":return new zx(i,e);case"fill-extrusion":return new qx(i,e);case"heatmap":return new fx(i,e);case"hillshade":return new gx(i,e);case"line":return new Jx(i,e);case"raster":return new Wd(i,e);case"symbol":return new yp(i,e)}},b.bU=i=>i.type==="raster",b.bV=Wi,b.bW=function(i,e){if(!i)return[{command:"setStyle",args:[e]}];let r=[];try{if(!mt(i.version,e.version))return[{command:"setStyle",args:[e]}];mt(i.center,e.center)||r.push({command:"setCenter",args:[e.center]}),mt(i.state,e.state)||r.push({command:"setGlobalState",args:[e.state]}),mt(i.centerAltitude,e.centerAltitude)||r.push({command:"setCenterAltitude",args:[e.centerAltitude]}),mt(i.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),mt(i.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),mt(i.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),mt(i.roll,e.roll)||r.push({command:"setRoll",args:[e.roll]}),mt(i.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),mt(i.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),mt(i.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),mt(i.light,e.light)||r.push({command:"setLight",args:[e.light]}),mt(i.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),mt(i.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),mt(i.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});const a={},c=[];(function(f,y,x,S){let P;for(P in y=y||{},f=f||{})Object.prototype.hasOwnProperty.call(f,P)&&(Object.prototype.hasOwnProperty.call(y,P)||rr(P,x,S));for(P in y)Object.prototype.hasOwnProperty.call(y,P)&&(Object.prototype.hasOwnProperty.call(f,P)?mt(f[P],y[P])||(f[P].type==="geojson"&&y[P].type==="geojson"&&Zt(f,y,P)?jt(x,{command:"setGeoJSONSourceData",args:[P,y[P].data]}):fr(P,y,x,S)):Qr(P,y,x))})(i.sources,e.sources,c,a);const p=[];i.layers&&i.layers.forEach((f=>{"source"in f&&a[f.source]?r.push({command:"removeLayer",args:[f.id]}):p.push(f)})),r=r.concat(c),(function(f,y,x){y=y||[];const S=(f=f||[]).map(No),P=y.map(No),E=f.reduce(jo,{}),k=y.reduce(jo,{}),z=S.slice(),F=Object.create(null);let B,j,G,Q,q;for(let H=0,te=0;H<S.length;H++)B=S[H],Object.prototype.hasOwnProperty.call(k,B)?te++:(jt(x,{command:"removeLayer",args:[B]}),z.splice(z.indexOf(B,te),1));for(let H=0,te=0;H<P.length;H++)B=P[P.length-1-H],z[z.length-1-H]!==B&&(Object.prototype.hasOwnProperty.call(E,B)?(jt(x,{command:"removeLayer",args:[B]}),z.splice(z.lastIndexOf(B,z.length-te),1)):te++,Q=z[z.length-H],jt(x,{command:"addLayer",args:[k[B],Q]}),z.splice(z.length-H,0,B),F[B]=!0);for(let H=0;H<P.length;H++)if(B=P[H],j=E[B],G=k[B],!F[B]&&!mt(j,G))if(mt(j.source,G.source)&&mt(j["source-layer"],G["source-layer"])&&mt(j.type,G.type)){for(q in Lr(j.layout,G.layout,x,B,null,"setLayoutProperty"),Lr(j.paint,G.paint,x,B,null,"setPaintProperty"),mt(j.filter,G.filter)||jt(x,{command:"setFilter",args:[B,G.filter]}),mt(j.minzoom,G.minzoom)&&mt(j.maxzoom,G.maxzoom)||jt(x,{command:"setLayerZoomRange",args:[B,G.minzoom,G.maxzoom]}),j)Object.prototype.hasOwnProperty.call(j,q)&&q!=="layout"&&q!=="paint"&&q!=="filter"&&q!=="metadata"&&q!=="minzoom"&&q!=="maxzoom"&&(q.indexOf("paint.")===0?Lr(j[q],G[q],x,B,q.slice(6),"setPaintProperty"):mt(j[q],G[q])||jt(x,{command:"setLayerProperty",args:[B,q,G[q]]}));for(q in G)Object.prototype.hasOwnProperty.call(G,q)&&!Object.prototype.hasOwnProperty.call(j,q)&&q!=="layout"&&q!=="paint"&&q!=="filter"&&q!=="metadata"&&q!=="minzoom"&&q!=="maxzoom"&&(q.indexOf("paint.")===0?Lr(j[q],G[q],x,B,q.slice(6),"setPaintProperty"):mt(j[q],G[q])||jt(x,{command:"setLayerProperty",args:[B,q,G[q]]}))}else jt(x,{command:"removeLayer",args:[B]}),Q=z[z.lastIndexOf(B)+1],jt(x,{command:"addLayer",args:[G,Q]})})(p,e.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:"setStyle",args:[e]}]}return r},b.bX=function(i){const e=[],r=i.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},b.bY=Zi,b.bZ=Bo,b.b_=class extends Mi{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},b.ba=function(i,e,r){return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3]*r,i},b.bb=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]},b.bc=dy,b.bd=Hl,b.be=function(i,e,r,a,c){var p=1/Math.tan(e/2);if(i[0]=p/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,c!=null&&c!==1/0){var f=1/(a-c);i[10]=(c+a)*f,i[14]=2*c*a*f}else i[10]=-1,i[14]=-2*a;return i},b.bf=function(i){var e=new $e(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},b.bg=function(i,e,r){var a=Math.sin(r),c=Math.cos(r),p=e[0],f=e[1],y=e[2],x=e[3],S=e[4],P=e[5],E=e[6],k=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=p*c+S*a,i[1]=f*c+P*a,i[2]=y*c+E*a,i[3]=x*c+k*a,i[4]=S*c-p*a,i[5]=P*c-f*a,i[6]=E*c-y*a,i[7]=k*c-x*a,i},b.bh=function(i,e,r){var a=Math.sin(r),c=Math.cos(r),p=e[4],f=e[5],y=e[6],x=e[7],S=e[8],P=e[9],E=e[10],k=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=p*c+S*a,i[5]=f*c+P*a,i[6]=y*c+E*a,i[7]=x*c+k*a,i[8]=S*c-p*a,i[9]=P*c-f*a,i[10]=E*c-y*a,i[11]=k*c-x*a,i},b.bi=function(){const i=new Float32Array(16);return Me(i),i},b.bj=function(){const i=new Float64Array(16);return Me(i),i},b.bk=function(){return new Float64Array(16)},b.bl=function(i,e,r){const a=new Float64Array(4);return $a(a,i,e-90,r),a},b.bm=function(i,e,r,a){var c,p,f,y,x,S=e[0],P=e[1],E=e[2],k=e[3],z=r[0],F=r[1],B=r[2],j=r[3];return(p=S*z+P*F+E*B+k*j)<0&&(p=-p,z=-z,F=-F,B=-B,j=-j),1-p>Ne?(c=Math.acos(p),f=Math.sin(c),y=Math.sin((1-a)*c)/f,x=Math.sin(a*c)/f):(y=1-a,x=a),i[0]=y*S+x*z,i[1]=y*P+x*F,i[2]=y*E+x*B,i[3]=y*k+x*j,i},b.bn=function(i){const e=new Float64Array(9);(function(p,f){var y=f[0],x=f[1],S=f[2],P=f[3],E=y+y,k=x+x,z=S+S,F=y*E,B=x*E,j=x*k,G=S*E,Q=S*k,q=S*z,H=P*E,te=P*k,ae=P*z;p[0]=1-j-q,p[3]=B-ae,p[6]=G+te,p[1]=B+ae,p[4]=1-F-q,p[7]=Q-H,p[2]=G-te,p[5]=Q+H,p[8]=1-F-j})(e,i);const r=wi(-Math.asin(qi(e[2],-1,1)));let a,c;return Math.hypot(e[5],e[8])<.001?(a=0,c=-wi(Math.atan2(e[3],e[4]))):(a=wi(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),c=wi(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:a,pitch:r+90,bearing:c}},b.bo=function(i,e){return i.roll==e.roll&&i.pitch==e.pitch&&i.bearing==e.bearing},b.bp=wt,b.bq=Da,b.br=Gl,b.bs=_u,b.bt=$l,b.bu=qa,b.bv=Fo,b.bw=gi,b.bx=function(i,e,r,a,c){return qa(a,c,qi((i-e)/(r-e),0,1))},b.by=In,b.bz=function(){return new Float64Array(3)},b.c=he,b.c$=function(i,e,r,a,c){return s(this,void 0,void 0,(function*(){if(He())try{return yield Za(i,e,r,a,c)}catch{}return(function(p,f,y,x,S){const P=p.width,E=p.height;qn&&Hi||(qn=new OffscreenCanvas(P,E),Hi=qn.getContext("2d",{willReadFrequently:!0})),qn.width=P,qn.height=E,Hi.drawImage(p,0,0,P,E);const k=Hi.getImageData(f,y,x,S);return Hi.clearRect(0,0,P,E),k.data})(i,e,r,a,c)}))},b.c0=class extends Mi{constructor(i,e){super(i,e),this.current=Ui}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},b.c1=Is,b.c2=class extends Mi{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},b.c3=class extends Mi{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},b.c4=ke,b.c5=function(i,e){var r=Math.sin(e),a=Math.cos(e);return i[0]=a,i[1]=r,i[2]=0,i[3]=-r,i[4]=a,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},b.c6=function(i,e,r){var a=e[0],c=e[1],p=e[2];return i[0]=a*r[0]+c*r[3]+p*r[6],i[1]=a*r[1]+c*r[4]+p*r[7],i[2]=a*r[2]+c*r[5]+p*r[8],i},b.c7=function(i,e,r,a,c,p,f){var y=1/(e-r),x=1/(a-c),S=1/(p-f);return i[0]=-2*y,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*x,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*S,i[11]=0,i[12]=(e+r)*y,i[13]=(c+a)*x,i[14]=(f+p)*S,i[15]=1,i},b.c8=class extends Mi{constructor(i,e){super(i,e),this.current=new Array}set(i){if(i!=this.current){this.current=i;const e=new Float32Array(4*i.length);for(let r=0;r<i.length;r++)e[4*r]=i[r].r,e[4*r+1]=i[r].g,e[4*r+2]=i[r].b,e[4*r+3]=i[r].a;this.gl.uniform4fv(this.location,e)}}},b.c9=class extends Mi{constructor(i,e){super(i,e),this.current=new Array}set(i){if(i!=this.current){this.current=i;const e=new Float32Array(i);this.gl.uniform1fv(this.location,e)}}},b.cA=function(i,e){return ye[e]&&"touches"in i},b.cB=function(i){return ye[i]||U[i]},b.cC=function(i,e,r){var a=e[0],c=e[1];return i[0]=r[0]*a+r[4]*c+r[12],i[1]=r[1]*a+r[5]*c+r[13],i},b.cD=function(i,e){const{x:r,y:a}=Su.fromLngLat(e);return!(i<0||i>25||a<0||a>=1||r<0||r>=1)},b.cE=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},b.cF=class extends Dl{},b.cG=m1,b.cI=de,b.cJ=function(i,e){he.REGISTERED_PROTOCOLS[i]=e},b.cK=function(i){delete he.REGISTERED_PROTOCOLS[i]},b.cL=function(i,e){const r={};for(let c=0;c<i.length;c++){const p=e&&e[i[c].id]||Bh(i[c]);e&&(e[i[c].id]=p);let f=r[p];f||(f=r[p]=[]),f.push(i[c])}const a=[];for(const c in r)a.push(r[c]);return a},b.cM=et,b.cN=my,b.cO=Wy,b.cP=Yg,b.cQ=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Ot/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],r=e.layout,a=e._unevaluatedLayout._values,c={layoutIconSize:a["icon-size"].possiblyEvaluate(new $t(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new $t(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new $t(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:S,maxZoom:P}=i.bucket.textSizeData;c.compositeTextSizes=[a["text-size"].possiblyEvaluate(new $t(S),i.canonical),a["text-size"].possiblyEvaluate(new $t(P),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:S,maxZoom:P}=i.bucket.iconSizeData;c.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new $t(S),i.canonical),a["icon-size"].possiblyEvaluate(new $t(P),i.canonical)]}const p=r.get("text-line-height")*Zr,f=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",y=r.get("text-keep-upright"),x=r.get("text-size");for(const S of i.bucket.features){const P=r.get("text-font").evaluate(S,{},i.canonical).join(","),E=x.evaluate(S,{},i.canonical),k=c.layoutTextSize.evaluate(S,{},i.canonical),z=c.layoutIconSize.evaluate(S,{},i.canonical),F={horizontal:{},vertical:void 0},B=S.text;let j,G=[0,0];if(B){const H=B.toString(),te=r.get("text-letter-spacing").evaluate(S,{},i.canonical)*Zr,ae=qd(H)?te:0,_e=r.get("text-anchor").evaluate(S,{},i.canonical),De=o_(e,S,i.canonical);if(!De){const Be=r.get("text-radial-offset").evaluate(S,{},i.canonical);G=Be?a_(_e,[Be*Zr,Of]):r.get("text-offset").evaluate(S,{},i.canonical).map((Ce=>Ce*Zr))}let Ee=f?"center":r.get("text-justify").evaluate(S,{},i.canonical);const Le=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(S,{},i.canonical)*Zr:1/0,Ge=()=>{i.bucket.allowVerticalPlacement&&xo(H)&&(F.vertical=mp(B,i.glyphMap,i.glyphPositions,i.imagePositions,P,Le,p,_e,"left",ae,G,b.az.vertical,!0,k,E))};if(!f&&De){const Be=new Set;if(Ee==="auto")for(let Ie=0;Ie<De.values.length;Ie+=2)Be.add(Nf(De.values[Ie]));else Be.add(Ee);let Ce=!1;for(const Ie of Be)if(!F.horizontal[Ie])if(Ce)F.horizontal[Ie]=F.horizontal[0];else{const Qe=mp(B,i.glyphMap,i.glyphPositions,i.imagePositions,P,Le,p,"center",Ie,ae,G,b.az.horizontal,!1,k,E);Qe&&(F.horizontal[Ie]=Qe,Ce=Qe.positionedLines.length===1)}Ge()}else{Ee==="auto"&&(Ee=Nf(_e));const Be=mp(B,i.glyphMap,i.glyphPositions,i.imagePositions,P,Le,p,_e,Ee,ae,G,b.az.horizontal,!1,k,E);Be&&(F.horizontal[Ee]=Be),Ge(),xo(H)&&f&&y&&(F.vertical=mp(B,i.glyphMap,i.glyphPositions,i.imagePositions,P,Le,p,_e,Ee,ae,G,b.az.vertical,!1,k,E))}}let Q=!1;if(S.icon&&S.icon.name){const H=i.imageMap[S.icon.name];H&&(j=Sb(i.imagePositions[S.icon.name],r.get("icon-offset").evaluate(S,{},i.canonical),r.get("icon-anchor").evaluate(S,{},i.canonical)),Q=!!H.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=Q:i.bucket.sdfIcons!==Q&&$r("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(H.pixelRatio!==i.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const q=l_(F.horizontal)||F.vertical;i.bucket.iconsInText=!!q&&q.iconsInText,(q||j)&&d1(i.bucket,S,F,j,i.imageMap,c,k,z,G,Q,i.canonical,i.subdivisionGranularity)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},b.cR=sf,b.cS=cf,b.cT=uf,b.cU=function(i){const e=new fp;return(function(r,a){for(const c in r.layers)a.writeMessage(3,Qb,r.layers[c])})(i,e),e.finish()},b.cV=function(i,e,r,a,c,p){let f=Yy(i,e,r,c,0);return f=Yy(f,e,a,p,1),f},b.cW=class{constructor(i){this.maxEntries=i,this.map=new Map}get(i){const e=this.map.get(i);return e!==void 0&&(this.map.delete(i),this.map.set(i,e)),e}set(i,e){if(this.map.has(i))this.map.delete(i);else if(this.map.size>=this.maxEntries){const r=this.map.keys().next().value;this.map.delete(r)}this.map.set(i,e)}clear(){this.map.clear()}},b.cX=Dg,b.cY=fp,b.cZ=qy,b.c_=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},b.ca=class extends Ca{},b.cb=rb,b.cc=class extends Ms{},b.cd=tf,b.ce=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},b.cf=yg,b.cg=function(i,e,r){var a=e[0],c=e[1],p=e[2],f=r[3]*a+r[7]*c+r[11]*p+r[15];return i[0]=(r[0]*a+r[4]*c+r[8]*p+r[12])/(f=f||1),i[1]=(r[1]*a+r[5]*c+r[9]*p+r[13])/f,i[2]=(r[2]*a+r[6]*c+r[10]*p+r[14])/f,i},b.ch=class extends nu{},b.ci=class extends t{},b.cj=function(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]&&i[6]===e[6]&&i[7]===e[7]&&i[8]===e[8]&&i[9]===e[9]&&i[10]===e[10]&&i[11]===e[11]&&i[12]===e[12]&&i[13]===e[13]&&i[14]===e[14]&&i[15]===e[15]},b.ck=function(i,e){var r=i[0],a=i[1],c=i[2],p=i[3],f=i[4],y=i[5],x=i[6],S=i[7],P=i[8],E=i[9],k=i[10],z=i[11],F=i[12],B=i[13],j=i[14],G=i[15],Q=e[0],q=e[1],H=e[2],te=e[3],ae=e[4],_e=e[5],De=e[6],Ee=e[7],Le=e[8],Ge=e[9],Be=e[10],Ce=e[11],Ie=e[12],Qe=e[13],Ye=e[14],tt=e[15];return Math.abs(r-Q)<=Ne*Math.max(1,Math.abs(r),Math.abs(Q))&&Math.abs(a-q)<=Ne*Math.max(1,Math.abs(a),Math.abs(q))&&Math.abs(c-H)<=Ne*Math.max(1,Math.abs(c),Math.abs(H))&&Math.abs(p-te)<=Ne*Math.max(1,Math.abs(p),Math.abs(te))&&Math.abs(f-ae)<=Ne*Math.max(1,Math.abs(f),Math.abs(ae))&&Math.abs(y-_e)<=Ne*Math.max(1,Math.abs(y),Math.abs(_e))&&Math.abs(x-De)<=Ne*Math.max(1,Math.abs(x),Math.abs(De))&&Math.abs(S-Ee)<=Ne*Math.max(1,Math.abs(S),Math.abs(Ee))&&Math.abs(P-Le)<=Ne*Math.max(1,Math.abs(P),Math.abs(Le))&&Math.abs(E-Ge)<=Ne*Math.max(1,Math.abs(E),Math.abs(Ge))&&Math.abs(k-Be)<=Ne*Math.max(1,Math.abs(k),Math.abs(Be))&&Math.abs(z-Ce)<=Ne*Math.max(1,Math.abs(z),Math.abs(Ce))&&Math.abs(F-Ie)<=Ne*Math.max(1,Math.abs(F),Math.abs(Ie))&&Math.abs(B-Qe)<=Ne*Math.max(1,Math.abs(B),Math.abs(Qe))&&Math.abs(j-Ye)<=Ne*Math.max(1,Math.abs(j),Math.abs(Ye))&&Math.abs(G-tt)<=Ne*Math.max(1,Math.abs(G),Math.abs(tt))},b.cl=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},b.cm=i=>i.type==="symbol",b.cn=i=>i.type==="circle",b.co=i=>i.type==="heatmap",b.cp=i=>i.type==="line",b.cq=i=>i.type==="fill",b.cr=i=>i.type==="fill-extrusion",b.cs=i=>i.type==="hillshade",b.ct=i=>i.type==="color-relief",b.cu=i=>i.type==="background",b.cv=i=>i.type==="custom",b.cw=pa,b.cx=function(i,e,r){const a=Mn(e.x-r.x,e.y-r.y),c=Mn(i.x-r.x,i.y-r.y),p=Math.atan2(a[0]*c[1]-a[1]*c[0],(function(f,y){return f[0]*y[0]+f[1]*y[1]})(a,c));return wi(p)},b.cy=ri,b.cz=function(i,e){return U[e]&&(i instanceof MouseEvent||i instanceof WheelEvent)},b.d=ze,b.d0=xg,b.d1=N,b.d2=class{constructor(i,e){this.layers={[Pu]:this},this.name=Pu,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=i.length,this.features=i}feature(i){return new Jb(this.features[i],this.extent)}},b.d3=ns,b.d4=ea,b.e=hi,b.f=i=>s(void 0,void 0,void 0,(function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(e)}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.`)}})),b.g=xe,b.h=i=>new Promise(((e,r)=>{const a=new Image;a.onload=()=>{e(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame((()=>{a.src=fa}))},a.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."));const c=new Blob([new Uint8Array(i)],{type:"image/png"});a.src=i.byteLength?URL.createObjectURL(c):fa})),b.i=mn,b.j=(i,e)=>Oe(hi(i,{type:"json"}),e),b.k=Ut,b.l=ft,b.m=Oe,b.n=(i,e)=>Oe(hi(i,{type:"arrayBuffer"}),e),b.o=function(i){return new fp(i).readFields(gb,[])},b.p=Xg,b.q=function(i){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(i))},b.r=du,b.s=Wa,b.t=_i,b.u=we,b.v=ps,b.w=$r,b.x=ru,b.y=ds,b.z=ys})),w("worker",["./shared"],(function(b){class s{constructor(U,V){this.keyCache={},U&&this.replace(U,V)}replace(U,V){this._layerConfigs={},this._layers={},this.update(U,[],V)}update(U,V,W){for(const he of U){this._layerConfigs[he.id]=he;const xe=this._layers[he.id]=b.bT(he,W);xe._featureFilter=b.aj(xe.filter,W),this.keyCache[he.id]&&delete this.keyCache[he.id]}for(const he of V)delete this.keyCache[he],delete this._layerConfigs[he],delete this._layers[he];this.familiesBySource={};const se=b.cL(Object.values(this._layerConfigs),this.keyCache);for(const he of se){const xe=he.map((Je=>this._layers[Je.id])),ge=xe[0];if(ge.isHidden())continue;const de=ge.source||"";let Pe=this.familiesBySource[de];Pe||(Pe=this.familiesBySource[de]={});const Oe=ge.sourceLayer||b.ai;let ze=Pe[Oe];ze||(ze=Pe[Oe]=[]),ze.push(xe)}}}class D{constructor(U){const V={},W=[];for(const ge in U){const de=U[ge],Pe=V[ge]={};for(const Oe in de){const ze=de[+Oe];if(!ze||ze.bitmap.width===0||ze.bitmap.height===0)continue;const Je={x:0,y:0,w:ze.bitmap.width+2,h:ze.bitmap.height+2};W.push(Je),Pe[Oe]={rect:Je,metrics:ze.metrics}}}const{w:se,h:he}=b.p(W),xe=new b.r({width:se||1,height:he||1});for(const ge in U){const de=U[ge];for(const Pe in de){const Oe=de[+Pe];if(!Oe||Oe.bitmap.width===0||Oe.bitmap.height===0)continue;const ze=V[ge][Pe].rect;b.r.copy(Oe.bitmap,xe,{x:0,y:0},{x:ze.x+1,y:ze.y+1},Oe.bitmap)}}this.image=xe,this.positions=V}}b.cM("GlyphAtlas",D);class N{constructor(U){this.tileID=new b.a2(U.tileID.overscaledZ,U.tileID.wrap,U.tileID.canonical.z,U.tileID.canonical.x,U.tileID.canonical.y),this.uid=U.uid,this.zoom=U.zoom,this.pixelRatio=U.pixelRatio,this.tileSize=U.tileSize,this.source=U.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=U.showCollisionBoxes,this.collectResourceTiming=!!U.collectResourceTiming,this.returnDependencies=!!U.returnDependencies,this.promoteId=U.promoteId,this.inFlightDependencies=[]}parse(U,V,W,se,he){return b._(this,void 0,void 0,(function*(){this.status="parsing",this.data=U,this.collisionBoxArray=new b.ag;const xe=new b.cN(Object.keys(U.layers).sort()),ge=new b.cO(this.tileID,this.promoteId);ge.bucketLayerIDs=[];const de={},Pe={featureIndex:ge,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:W,subdivisionGranularity:he},Oe=V.familiesBySource[this.source];for(const Zt in Oe){const Lr=U.layers[Zt];if(!Lr)continue;Lr.version===1&&b.w(`Vector tile source "${this.source}" layer "${Zt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const No=xe.encode(Zt),jo=[];for(let je=0;je<Lr.length;je++){const pi=Lr.feature(je),di=ge.getId(pi,Zt);jo.push({feature:pi,id:di,index:je,sourceLayerIndex:No})}for(const je of Oe[Zt]){const pi=je[0];pi.source!==this.source&&b.w(`layer.source = ${pi.source} does not equal this.source = ${this.source}`),pi.isHidden(this.zoom,!0)||(Z(je,this.zoom,W),(de[pi.id]=pi.createBucket({index:ge.bucketLayerIDs.length,layers:je,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:No,sourceID:this.source})).populate(jo,Pe,this.tileID.canonical),ge.bucketLayerIDs.push(je.map((di=>di.id))))}}const ze=b.bY(Pe.glyphDependencies,(Zt=>Object.keys(Zt).map(Number)));this.inFlightDependencies.forEach((Zt=>Zt?.abort())),this.inFlightDependencies=[];let Je=Promise.resolve({});if(Object.keys(ze).length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),Je=se.sendAsync({type:"GG",data:{stacks:ze,source:this.source,tileID:this.tileID,type:"glyphs"}},Zt)}const nt=Object.keys(Pe.iconDependencies);let ft=Promise.resolve({});if(nt.length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),ft=se.sendAsync({type:"GI",data:{icons:nt,source:this.source,tileID:this.tileID,type:"icons"}},Zt)}const Ut=Object.keys(Pe.patternDependencies);let Lt=Promise.resolve({});if(Ut.length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),Lt=se.sendAsync({type:"GI",data:{icons:Ut,source:this.source,tileID:this.tileID,type:"patterns"}},Zt)}const we=Pe.dashDependencies;let qt=Promise.resolve({});if(Object.keys(we).length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),qt=se.sendAsync({type:"GDA",data:{dashes:we}},Zt)}const[Jr,mt,jt,Qr]=yield Promise.all([Je,ft,Lt,qt]),rr=new D(Jr),fr=new b.cP(mt,jt);for(const Zt in de){const Lr=de[Zt];Lr instanceof b.ah?(Z(Lr.layers,this.zoom,W),b.cQ({bucket:Lr,glyphMap:Jr,glyphPositions:rr.positions,imageMap:mt,imagePositions:fr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Pe.subdivisionGranularity})):Lr.hasDependencies&&(Lr instanceof b.cR||Lr instanceof b.cS||Lr instanceof b.cT)&&(Z(Lr.layers,this.zoom,W),Lr.addFeatures(Pe,this.tileID.canonical,fr.patternPositions,Qr))}return this.status="done",{buckets:Object.values(de).filter((Zt=>!Zt.isEmpty())),featureIndex:ge,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:rr.image,imageAtlas:fr,dashPositions:Qr,glyphMap:this.returnDependencies?Jr:null,iconMap:this.returnDependencies?mt:null,glyphPositions:this.returnDependencies?rr.positions:null}}))}}function Z(ye,U,V){const W=new b.H(U);for(const se of ye)se.recalculate(W,V)}class re{constructor(U,V,W,se,he){this.type=U,this.properties=W||{},this.extent=he,this.pointsArray=V,this.id=se}loadGeometry(){return this.pointsArray.map((U=>U.map((V=>new b.P(V.x,V.y)))))}}class pe{constructor(U,V,W){this.version=2,this._myFeatures=U,this.name=V,this.length=U.length,this.extent=W}feature(U){return this._myFeatures[U]}}class ue{constructor(){this.layers={}}addLayer(U){this.layers[U.name]=U}}function ve(ye){let U=b.cU(ye);return U.byteOffset===0&&U.byteLength===U.buffer.byteLength||(U=new Uint8Array(U)),{vectorTile:ye,rawData:U.buffer}}function me(ye,U,V){const{extent:W}=ye,se=Math.pow(2,V.z-U.z),he=(V.x-U.x*se)*W,xe=(V.y-U.y*se)*W,ge=[];for(let de=0;de<ye.length;de++){const Pe=ye.feature(de);let Oe=Pe.loadGeometry();for(const Je of Oe)for(const nt of Je)nt.x=nt.x*se-he,nt.y=nt.y*se-xe;const ze=128;Oe=b.cV(Oe,Pe.type,-ze,-ze,W+ze,W+ze),Oe.length!==0&&ge.push(new re(Pe.type,Oe,Pe.properties,Pe.id,W))}return new pe(ge,ye.name,W)}class le{constructor(U,V,W){this.actor=U,this.layerIndex=V,this.availableImages=W,this.fetching={},this.loading={},this.loaded={},this.overzoomedTileResultCache=new b.cW(1e3)}loadVectorTile(U,V){return b._(this,void 0,void 0,(function*(){const W=yield b.n(U.request,V);try{return{vectorTile:U.encoding!=="mlt"?new b.cX(new b.cY(W.data)):new b.cZ(W.data),rawData:W.data,cacheControl:W.cacheControl,expires:W.expires}}catch(se){const he=new Uint8Array(W.data);let xe=`Unable to parse the tile at ${U.request.url}, `;throw xe+=he[0]===31&&he[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${se.message}`,new Error(xe)}}))}loadTile(U){return b._(this,void 0,void 0,(function*(){const{uid:V,overzoomParameters:W}=U;W&&(U.request=W.overzoomRequest);const se=!!(U&&U.request&&U.request.collectResourceTiming)&&new b.c_(U.request),he=new N(U);this.loading[V]=he;const xe=new AbortController;he.abort=xe;try{const ge=yield this.loadVectorTile(U,xe);if(delete this.loading[V],!ge)return null;if(W){const Je=this._getOverzoomTile(U,ge.vectorTile);ge.rawData=Je.rawData,ge.vectorTile=Je.vectorTile}const de=ge.rawData,Pe={};ge.expires&&(Pe.expires=ge.expires),ge.cacheControl&&(Pe.cacheControl=ge.cacheControl);const Oe={};if(se){const Je=se.finish();Je&&(Oe.resourceTiming=JSON.parse(JSON.stringify(Je)))}he.vectorTile=ge.vectorTile;const ze=he.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,U.subdivisionGranularity);this.loaded[V]=he,this.fetching[V]={rawTileData:de,cacheControl:Pe,resourceTiming:Oe};try{const Je=yield ze;return b.e({rawTileData:de.slice(0),encoding:U.encoding},Je,Pe,Oe)}finally{delete this.fetching[V]}}catch(ge){throw delete this.loading[V],he.status="done",this.loaded[V]=he,ge}}))}_getOverzoomTile(U,V){const{tileID:W,source:se,overzoomParameters:he}=U,{maxZoomTileID:xe}=he,ge=`${xe.key}_${W.key}`,de=this.overzoomedTileResultCache.get(ge);if(de)return de;const Pe=new ue,Oe=this.layerIndex.familiesBySource[se];for(const Je in Oe){const nt=V.layers[Je];if(!nt)continue;const ft=me(nt,xe,W.canonical);ft.length>0&&Pe.addLayer(ft)}const ze=ve(Pe);return this.overzoomedTileResultCache.set(ge,ze),ze}reloadTile(U){return b._(this,void 0,void 0,(function*(){const V=U.uid;if(!this.loaded||!this.loaded[V])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const W=this.loaded[V];if(W.showCollisionBoxes=U.showCollisionBoxes,W.status==="parsing"){const se=yield W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,U.subdivisionGranularity);let he;if(this.fetching[V]){const{rawTileData:xe,cacheControl:ge,resourceTiming:de}=this.fetching[V];delete this.fetching[V],he=b.e({rawTileData:xe.slice(0),encoding:U.encoding},se,ge,de)}else he=se;return he}if(W.status==="done"&&W.vectorTile)return W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,U.subdivisionGranularity)}))}abortTile(U){return b._(this,void 0,void 0,(function*(){const V=this.loading,W=U.uid;V&&V[W]&&V[W].abort&&(V[W].abort.abort(),delete V[W])}))}removeTile(U){return b._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[U.uid]&&delete this.loaded[U.uid]}))}}class He{constructor(){this.loaded={}}loadTile(U){return b._(this,void 0,void 0,(function*(){const{uid:V,encoding:W,rawImageData:se,redFactor:he,greenFactor:xe,blueFactor:ge,baseShift:de}=U,Pe=se.width+2,Oe=se.height+2,ze=b.b(se)?new b.R({width:Pe,height:Oe},yield b.c$(se,-1,-1,Pe,Oe)):se,Je=new b.d0(V,ze,W,he,xe,ge,de);return this.loaded=this.loaded||{},this.loaded[V]=Je,Je}))}removeTile(U){const V=this.loaded,W=U.uid;V&&V[W]&&delete V[W]}}var Ne,$e,ke=(function(){if($e)return Ne;function ye(V,W){if(V.length!==0){U(V[0],W);for(var se=1;se<V.length;se++)U(V[se],!W)}}function U(V,W){for(var se=0,he=0,xe=0,ge=V.length,de=ge-1;xe<ge;de=xe++){var Pe=(V[xe][0]-V[de][0])*(V[de][1]+V[xe][1]),Oe=se+Pe;he+=Math.abs(se)>=Math.abs(Pe)?se-Oe+Pe:Pe-Oe+se,se=Oe}se+he>=0!=!!W&&V.reverse()}return $e=1,Ne=function V(W,se){var he,xe=W&&W.type;if(xe==="FeatureCollection")for(he=0;he<W.features.length;he++)V(W.features[he],se);else if(xe==="GeometryCollection")for(he=0;he<W.geometries.length;he++)V(W.geometries[he],se);else if(xe==="Feature")V(W.geometry,se);else if(xe==="Polygon")ye(W.coordinates,se);else if(xe==="MultiPolygon")for(he=0;he<W.coordinates.length;he++)ye(W.coordinates[he],se);return W}})(),Me=b.d1(ke);const Re={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:ye=>ye},rt=Math.fround||(ut=new Float32Array(1),ye=>(ut[0]=+ye,ut[0]));var ut;class It{constructor(U){this.options=Object.assign(Object.create(Re),U),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(U){const{log:V,minZoom:W,maxZoom:se}=this.options;V&&console.time("total time");const he=`prepare ${U.length} points`;V&&console.time(he),this.points=U;const xe=[];for(let de=0;de<U.length;de++){const Pe=U[de];if(!Pe.geometry)continue;const[Oe,ze]=Pe.geometry.coordinates,Je=rt(Ur(Oe)),nt=rt(ci(ze));xe.push(Je,nt,1/0,de,-1,1),this.options.reduce&&xe.push(0)}let ge=this.trees[se+1]=this._createTree(xe);V&&console.timeEnd(he);for(let de=se;de>=W;de--){const Pe=+Date.now();ge=this.trees[de]=this._createTree(this._cluster(ge,de)),V&&console.log("z%d: %d clusters in %dms",de,ge.numItems,+Date.now()-Pe)}return V&&console.timeEnd("total time"),this}getClusters(U,V){let W=((U[0]+180)%360+360)%360-180;const se=Math.max(-90,Math.min(90,U[1]));let he=U[2]===180?180:((U[2]+180)%360+360)%360-180;const xe=Math.max(-90,Math.min(90,U[3]));if(U[2]-U[0]>=360)W=-180,he=180;else if(W>he){const ze=this.getClusters([W,se,180,xe],V),Je=this.getClusters([-180,se,he,xe],V);return ze.concat(Je)}const ge=this.trees[this._limitZoom(V)],de=ge.range(Ur(W),ci(xe),Ur(he),ci(se)),Pe=ge.data,Oe=[];for(const ze of de){const Je=this.stride*ze;Oe.push(Pe[Je+5]>1?dt(Pe,Je,this.clusterProps):this.points[Pe[Je+3]])}return Oe}getChildren(U){const V=this._getOriginId(U),W=this._getOriginZoom(U),se="No cluster with the specified id.",he=this.trees[W];if(!he)throw new Error(se);const xe=he.data;if(V*this.stride>=xe.length)throw new Error(se);const ge=this.options.radius/(this.options.extent*Math.pow(2,W-1)),de=he.within(xe[V*this.stride],xe[V*this.stride+1],ge),Pe=[];for(const Oe of de){const ze=Oe*this.stride;xe[ze+4]===U&&Pe.push(xe[ze+5]>1?dt(xe,ze,this.clusterProps):this.points[xe[ze+3]])}if(Pe.length===0)throw new Error(se);return Pe}getLeaves(U,V,W){const se=[];return this._appendLeaves(se,U,V=V||10,W=W||0,0),se}getTile(U,V,W){const se=this.trees[this._limitZoom(U)],he=Math.pow(2,U),{extent:xe,radius:ge}=this.options,de=ge/xe,Pe=(W-de)/he,Oe=(W+1+de)/he,ze={features:[]};return this._addTileFeatures(se.range((V-de)/he,Pe,(V+1+de)/he,Oe),se.data,V,W,he,ze),V===0&&this._addTileFeatures(se.range(1-de/he,Pe,1,Oe),se.data,he,W,he,ze),V===he-1&&this._addTileFeatures(se.range(0,Pe,de/he,Oe),se.data,-1,W,he,ze),ze.features.length?ze:null}getClusterExpansionZoom(U){let V=this._getOriginZoom(U)-1;for(;V<=this.options.maxZoom;){const W=this.getChildren(U);if(V++,W.length!==1)break;U=W[0].properties.cluster_id}return V}_appendLeaves(U,V,W,se,he){const xe=this.getChildren(V);for(const ge of xe){const de=ge.properties;if(de&&de.cluster?he+de.point_count<=se?he+=de.point_count:he=this._appendLeaves(U,de.cluster_id,W,se,he):he<se?he++:U.push(ge),U.length===W)break}return he}_createTree(U){const V=new b.aT(U.length/this.stride|0,this.options.nodeSize,Float32Array);for(let W=0;W<U.length;W+=this.stride)V.add(U[W],U[W+1]);return V.finish(),V.data=U,V}_addTileFeatures(U,V,W,se,he,xe){for(const ge of U){const de=ge*this.stride,Pe=V[de+5]>1;let Oe,ze,Je;if(Pe)Oe=Cr(V,de,this.clusterProps),ze=V[de],Je=V[de+1];else{const Ut=this.points[V[de+3]];Oe=Ut.properties;const[Lt,we]=Ut.geometry.coordinates;ze=Ur(Lt),Je=ci(we)}const nt={type:1,geometry:[[Math.round(this.options.extent*(ze*he-W)),Math.round(this.options.extent*(Je*he-se))]],tags:Oe};let ft;ft=Pe||this.options.generateId?V[de+3]:this.points[V[de+3]].id,ft!==void 0&&(nt.id=ft),xe.features.push(nt)}}_limitZoom(U){return Math.max(this.options.minZoom,Math.min(Math.floor(+U),this.options.maxZoom+1))}_cluster(U,V){const{radius:W,extent:se,reduce:he,minPoints:xe}=this.options,ge=W/(se*Math.pow(2,V)),de=U.data,Pe=[],Oe=this.stride;for(let ze=0;ze<de.length;ze+=Oe){if(de[ze+2]<=V)continue;de[ze+2]=V;const Je=de[ze],nt=de[ze+1],ft=U.within(de[ze],de[ze+1],ge),Ut=de[ze+5];let Lt=Ut;for(const we of ft){const qt=we*Oe;de[qt+2]>V&&(Lt+=de[qt+5])}if(Lt>Ut&&Lt>=xe){let we,qt=Je*Ut,Jr=nt*Ut,mt=-1;const jt=(ze/Oe<<5)+(V+1)+this.points.length;for(const Qr of ft){const rr=Qr*Oe;if(de[rr+2]<=V)continue;de[rr+2]=V;const fr=de[rr+5];qt+=de[rr]*fr,Jr+=de[rr+1]*fr,de[rr+4]=jt,he&&(we||(we=this._map(de,ze,!0),mt=this.clusterProps.length,this.clusterProps.push(we)),he(we,this._map(de,rr)))}de[ze+4]=jt,Pe.push(qt/Lt,Jr/Lt,1/0,jt,-1,Lt),he&&Pe.push(mt)}else{for(let we=0;we<Oe;we++)Pe.push(de[ze+we]);if(Lt>1)for(const we of ft){const qt=we*Oe;if(!(de[qt+2]<=V)){de[qt+2]=V;for(let Jr=0;Jr<Oe;Jr++)Pe.push(de[qt+Jr])}}}}return Pe}_getOriginId(U){return U-this.points.length>>5}_getOriginZoom(U){return(U-this.points.length)%32}_map(U,V,W){if(U[V+5]>1){const xe=this.clusterProps[U[V+6]];return W?Object.assign({},xe):xe}const se=this.points[U[V+3]].properties,he=this.options.map(se);return W&&he===se?Object.assign({},he):he}}function dt(ye,U,V){return{type:"Feature",id:ye[U+3],properties:Cr(ye,U,V),geometry:{type:"Point",coordinates:[(W=ye[U],360*(W-.5)),Tn(ye[U+1])]}};var W}function Cr(ye,U,V){const W=ye[U+5],se=W>=1e4?`${Math.round(W/1e3)}k`:W>=1e3?Math.round(W/100)/10+"k":W,he=ye[U+6],xe=he===-1?{}:Object.assign({},V[he]);return Object.assign(xe,{cluster:!0,cluster_id:ye[U+3],point_count:W,point_count_abbreviated:se})}function Ur(ye){return ye/360+.5}function ci(ye){const U=Math.sin(ye*Math.PI/180),V=.5-.25*Math.log((1+U)/(1-U))/Math.PI;return V<0?0:V>1?1:V}function Tn(ye){const U=(180-360*ye)*Math.PI/180;return 360*Math.atan(Math.exp(U))/Math.PI-90}function Sn(ye,U,V,W){let se=W;const he=U+(V-U>>1);let xe,ge=V-U;const de=ye[U],Pe=ye[U+1],Oe=ye[V],ze=ye[V+1];for(let Je=U+3;Je<V;Je+=3){const nt=$a(ye[Je],ye[Je+1],de,Pe,Oe,ze);if(nt>se)xe=Je,se=nt;else if(nt===se){const ft=Math.abs(Je-he);ft<ge&&(xe=Je,ge=ft)}}se>W&&(xe-U>3&&Sn(ye,U,xe,W),ye[xe+2]=se,V-xe>3&&Sn(ye,xe,V,W))}function $a(ye,U,V,W,se,he){let xe=se-V,ge=he-W;if(xe!==0||ge!==0){const de=((ye-V)*xe+(U-W)*ge)/(xe*xe+ge*ge);de>1?(V=se,W=he):de>0&&(V+=xe*de,W+=ge*de)}return xe=ye-V,ge=U-W,xe*xe+ge*ge}function ui(ye,U,V,W){const se={id:ye??null,type:U,geometry:V,tags:W,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(U==="Point"||U==="MultiPoint"||U==="LineString")Mn(se,V);else if(U==="Polygon")Mn(se,V[0]);else if(U==="MultiLineString")for(const he of V)Mn(se,he);else if(U==="MultiPolygon")for(const he of V)Mn(se,he[0]);return se}function Mn(ye,U){for(let V=0;V<U.length;V+=3)ye.minX=Math.min(ye.minX,U[V]),ye.minY=Math.min(ye.minY,U[V+1]),ye.maxX=Math.max(ye.maxX,U[V]),ye.maxY=Math.max(ye.maxY,U[V+1])}function Ot(ye,U,V,W){if(!U.geometry)return;const se=U.geometry.coordinates;if(se&&se.length===0)return;const he=U.geometry.type,xe=Math.pow(V.tolerance/((1<<V.maxZoom)*V.extent),2);let ge=[],de=U.id;if(V.promoteId?de=U.properties[V.promoteId]:V.generateId&&(de=W||0),he==="Point")Ga(se,ge);else if(he==="MultiPoint")for(const Pe of se)Ga(Pe,ge);else if(he==="LineString")In(se,ge,xe,!1);else if(he==="MultiLineString"){if(V.lineMetrics){for(const Pe of se)ge=[],In(Pe,ge,xe,!1),ye.push(ui(de,"LineString",ge,U.properties));return}qa(se,ge,xe,!1)}else if(he==="Polygon")qa(se,ge,xe,!0);else{if(he!=="MultiPolygon"){if(he==="GeometryCollection"){for(const Pe of U.geometry.geometries)Ot(ye,{id:de,geometry:Pe,properties:U.properties},V,W);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Pe of se){const Oe=[];qa(Pe,Oe,xe,!0),ge.push(Oe)}}ye.push(ui(de,he,ge,U.properties))}function Ga(ye,U){U.push(Fo(ye[0]),pa(ye[1]),0)}function In(ye,U,V,W){let se,he,xe=0;for(let de=0;de<ye.length;de++){const Pe=Fo(ye[de][0]),Oe=pa(ye[de][1]);U.push(Pe,Oe,0),de>0&&(xe+=W?(se*Oe-Pe*he)/2:Math.sqrt(Math.pow(Pe-se,2)+Math.pow(Oe-he,2))),se=Pe,he=Oe}const ge=U.length-3;U[2]=1,Sn(U,0,ge,V),U[ge+2]=1,U.size=Math.abs(xe),U.start=0,U.end=U.size}function qa(ye,U,V,W){for(let se=0;se<ye.length;se++){const he=[];In(ye[se],he,V,W),U.push(he)}}function Fo(ye){return ye/360+.5}function pa(ye){const U=Math.sin(ye*Math.PI/180),V=.5-.25*Math.log((1+U)/(1-U))/Math.PI;return V<0?0:V>1?1:V}function ri(ye,U,V,W,se,he,xe,ge){if(W/=U,he>=(V/=U)&&xe<W)return ye;if(xe<V||he>=W)return null;const de=[];for(const Pe of ye){const Oe=Pe.geometry;let ze=Pe.type;const Je=se===0?Pe.minX:Pe.minY,nt=se===0?Pe.maxX:Pe.maxY;if(Je>=V&&nt<W){de.push(Pe);continue}if(nt<V||Je>=W)continue;let ft=[];if(ze==="Point"||ze==="MultiPoint")qi(Oe,ft,V,W,se);else if(ze==="LineString")Pn(Oe,ft,V,W,se,!1,ge.lineMetrics);else if(ze==="MultiLineString")da(Oe,ft,V,W,se,!1);else if(ze==="Polygon")da(Oe,ft,V,W,se,!0);else if(ze==="MultiPolygon")for(const Ut of Oe){const Lt=[];da(Ut,Lt,V,W,se,!0),Lt.length&&ft.push(Lt)}if(ft.length){if(ge.lineMetrics&&ze==="LineString"){for(const Ut of ft)de.push(ui(Pe.id,ze,Ut,Pe.tags));continue}ze!=="LineString"&&ze!=="MultiLineString"||(ft.length===1?(ze="LineString",ft=ft[0]):ze="MultiLineString"),ze!=="Point"&&ze!=="MultiPoint"||(ze=ft.length===3?"Point":"MultiPoint"),de.push(ui(Pe.id,ze,ft,Pe.tags))}}return de.length?de:null}function qi(ye,U,V,W,se){for(let he=0;he<ye.length;he+=3){const xe=ye[he+se];xe>=V&&xe<=W&&Zi(U,ye[he],ye[he+1],ye[he+2])}}function Pn(ye,U,V,W,se,he,xe){let ge=hi(ye);const de=se===0?Bo:Wi;let Pe,Oe,ze=ye.start;for(let Lt=0;Lt<ye.length-3;Lt+=3){const we=ye[Lt],qt=ye[Lt+1],Jr=ye[Lt+2],mt=ye[Lt+3],jt=ye[Lt+4],Qr=se===0?we:qt,rr=se===0?mt:jt;let fr=!1;xe&&(Pe=Math.sqrt(Math.pow(we-mt,2)+Math.pow(qt-jt,2))),Qr<V?rr>V&&(Oe=de(ge,we,qt,mt,jt,V),xe&&(ge.start=ze+Pe*Oe)):Qr>W?rr<W&&(Oe=de(ge,we,qt,mt,jt,W),xe&&(ge.start=ze+Pe*Oe)):Zi(ge,we,qt,Jr),rr<V&&Qr>=V&&(Oe=de(ge,we,qt,mt,jt,V),fr=!0),rr>W&&Qr<=W&&(Oe=de(ge,we,qt,mt,jt,W),fr=!0),!he&&fr&&(xe&&(ge.end=ze+Pe*Oe),U.push(ge),ge=hi(ye)),xe&&(ze+=Pe)}let Je=ye.length-3;const nt=ye[Je],ft=ye[Je+1],Ut=se===0?nt:ft;Ut>=V&&Ut<=W&&Zi(ge,nt,ft,ye[Je+2]),Je=ge.length-3,he&&Je>=3&&(ge[Je]!==ge[0]||ge[Je+1]!==ge[1])&&Zi(ge,ge[0],ge[1],ge[2]),ge.length&&U.push(ge)}function hi(ye){const U=[];return U.size=ye.size,U.start=ye.start,U.end=ye.end,U}function da(ye,U,V,W,se,he){for(const xe of ye)Pn(xe,U,V,W,se,he,!1)}function Zi(ye,U,V,W){ye.push(U,V,W)}function Bo(ye,U,V,W,se,he){const xe=(he-U)/(W-U);return Zi(ye,he,V+(se-V)*xe,1),xe}function Wi(ye,U,V,W,se,he){const xe=(he-V)/(se-V);return Zi(ye,U+(W-U)*xe,he,1),xe}function Oo(ye,U){const V=[];for(let W=0;W<ye.length;W++){const se=ye[W],he=se.type;let xe;if(he==="Point"||he==="MultiPoint"||he==="LineString")xe=$r(se.geometry,U);else if(he==="MultiLineString"||he==="Polygon"){xe=[];for(const ge of se.geometry)xe.push($r(ge,U))}else if(he==="MultiPolygon"){xe=[];for(const ge of se.geometry){const de=[];for(const Pe of ge)de.push($r(Pe,U));xe.push(de)}}V.push(ui(se.id,he,xe,se.tags))}return V}function $r(ye,U){const V=[];V.size=ye.size,ye.start!==void 0&&(V.start=ye.start,V.end=ye.end);for(let W=0;W<ye.length;W+=3)V.push(ye[W]+U,ye[W+1],ye[W+2]);return V}function Fi(ye,U){if(ye.transformed)return ye;const V=1<<ye.z,W=ye.x,se=ye.y;for(const he of ye.features){const xe=he.geometry,ge=he.type;if(he.geometry=[],ge===1)for(let de=0;de<xe.length;de+=2)he.geometry.push(mn(xe[de],xe[de+1],U,V,W,se));else for(let de=0;de<xe.length;de++){const Pe=[];for(let Oe=0;Oe<xe[de].length;Oe+=2)Pe.push(mn(xe[de][Oe],xe[de][Oe+1],U,V,W,se));he.geometry.push(Pe)}}return ye.transformed=!0,ye}function mn(ye,U,V,W,se,he){return[Math.round(V*(ye*W-se)),Math.round(V*(U*W-he))]}function dr(ye,U,V,W,se){const he=U===se.maxZoom?0:se.tolerance/((1<<U)*se.extent),xe={features:[],numPoints:0,numSimplified:0,numFeatures:ye.length,source:null,x:V,y:W,z:U,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const ge of ye)Gn(xe,ge,he,se);return xe}function Gn(ye,U,V,W){const se=U.geometry,he=U.type,xe=[];if(ye.minX=Math.min(ye.minX,U.minX),ye.minY=Math.min(ye.minY,U.minY),ye.maxX=Math.max(ye.maxX,U.maxX),ye.maxY=Math.max(ye.maxY,U.maxY),he==="Point"||he==="MultiPoint")for(let ge=0;ge<se.length;ge+=3)xe.push(se[ge],se[ge+1]),ye.numPoints++,ye.numSimplified++;else if(he==="LineString")fa(xe,se,ye,V,!1,!1);else if(he==="MultiLineString"||he==="Polygon")for(let ge=0;ge<se.length;ge++)fa(xe,se[ge],ye,V,he==="Polygon",ge===0);else if(he==="MultiPolygon")for(let ge=0;ge<se.length;ge++){const de=se[ge];for(let Pe=0;Pe<de.length;Pe++)fa(xe,de[Pe],ye,V,!0,Pe===0)}if(xe.length){let ge=U.tags||null;if(he==="LineString"&&W.lineMetrics){ge={};for(const Pe in U.tags)ge[Pe]=U.tags[Pe];ge.mapbox_clip_start=se.start/se.size,ge.mapbox_clip_end=se.end/se.size}const de={geometry:xe,type:he==="Polygon"||he==="MultiPolygon"?3:he==="LineString"||he==="MultiLineString"?2:1,tags:ge};U.id!==null&&(de.id=U.id),ye.features.push(de)}}function fa(ye,U,V,W,se,he){const xe=W*W;if(W>0&&U.size<(se?xe:W))return void(V.numPoints+=U.length/3);const ge=[];for(let de=0;de<U.length;de+=3)(W===0||U[de+2]>xe)&&(V.numSimplified++,ge.push(U[de],U[de+1])),V.numPoints++;se&&(function(de,Pe){let Oe=0;for(let ze=0,Je=de.length,nt=Je-2;ze<Je;nt=ze,ze+=2)Oe+=(de[ze]-de[nt])*(de[ze+1]+de[nt+1]);if(Oe>0===Pe)for(let ze=0,Je=de.length;ze<Je/2;ze+=2){const nt=de[ze],ft=de[ze+1];de[ze]=de[Je-2-ze],de[ze+1]=de[Je-1-ze],de[Je-2-ze]=nt,de[Je-1-ze]=ft}})(ge,he),ye.push(ge)}const Za={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class qn{constructor(U,V){const W=(V=this.options=(function(he,xe){for(const ge in xe)he[ge]=xe[ge];return he})(Object.create(Za),V)).debug;if(W&&console.time("preprocess data"),V.maxZoom<0||V.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");let se=(function(he,xe){const ge=[];if(he.type==="FeatureCollection")for(let de=0;de<he.features.length;de++)Ot(ge,he.features[de],xe,de);else Ot(ge,he.type==="Feature"?he:{geometry:he},xe);return ge})(U,V);this.tiles={},this.tileCoords=[],W&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",V.indexMaxZoom,V.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),se=(function(he,xe){const ge=xe.buffer/xe.extent;let de=he;const Pe=ri(he,1,-1-ge,ge,0,-1,2,xe),Oe=ri(he,1,1-ge,2+ge,0,-1,2,xe);return(Pe||Oe)&&(de=ri(he,1,-ge,1+ge,0,-1,2,xe)||[],Pe&&(de=Oo(Pe,1).concat(de)),Oe&&(de=de.concat(Oo(Oe,-1)))),de})(se,V),se.length&&this.splitTile(se,0,0,0),W&&(se.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(U,V,W,se,he,xe,ge){const de=[U,V,W,se],Pe=this.options,Oe=Pe.debug;for(;de.length;){se=de.pop(),W=de.pop(),V=de.pop(),U=de.pop();const ze=1<<V,Je=Hi(V,W,se);let nt=this.tiles[Je];if(!nt&&(Oe>1&&console.time("creation"),nt=this.tiles[Je]=dr(U,V,W,se,Pe),this.tileCoords.push({z:V,x:W,y:se}),Oe)){Oe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,W,se,nt.numFeatures,nt.numPoints,nt.numSimplified),console.timeEnd("creation"));const fr=`z${V}`;this.stats[fr]=(this.stats[fr]||0)+1,this.total++}if(nt.source=U,he==null){if(V===Pe.indexMaxZoom||nt.numPoints<=Pe.indexMaxPoints)continue}else{if(V===Pe.maxZoom||V===he)continue;if(he!=null){const fr=he-V;if(W!==xe>>fr||se!==ge>>fr)continue}}if(nt.source=null,U.length===0)continue;Oe>1&&console.time("clipping");
2const ft=.5*Pe.buffer/Pe.extent,Ut=.5-ft,Lt=.5+ft,we=1+ft;let qt=null,Jr=null,mt=null,jt=null,Qr=ri(U,ze,W-ft,W+Lt,0,nt.minX,nt.maxX,Pe),rr=ri(U,ze,W+Ut,W+we,0,nt.minX,nt.maxX,Pe);U=null,Qr&&(qt=ri(Qr,ze,se-ft,se+Lt,1,nt.minY,nt.maxY,Pe),Jr=ri(Qr,ze,se+Ut,se+we,1,nt.minY,nt.maxY,Pe),Qr=null),rr&&(mt=ri(rr,ze,se-ft,se+Lt,1,nt.minY,nt.maxY,Pe),jt=ri(rr,ze,se+Ut,se+we,1,nt.minY,nt.maxY,Pe),rr=null),Oe>1&&console.timeEnd("clipping"),de.push(qt||[],V+1,2*W,2*se),de.push(Jr||[],V+1,2*W,2*se+1),de.push(mt||[],V+1,2*W+1,2*se),de.push(jt||[],V+1,2*W+1,2*se+1)}}getTile(U,V,W){U=+U,V=+V,W=+W;const se=this.options,{extent:he,debug:xe}=se;if(U<0||U>24)return null;const ge=1<<U,de=Hi(U,V=V+ge&ge-1,W);if(this.tiles[de])return Fi(this.tiles[de],he);xe>1&&console.log("drilling down to z%d-%d-%d",U,V,W);let Pe,Oe=U,ze=V,Je=W;for(;!Pe&&Oe>0;)Oe--,ze>>=1,Je>>=1,Pe=this.tiles[Hi(Oe,ze,Je)];return Pe&&Pe.source?(xe>1&&(console.log("found parent tile z%d-%d-%d",Oe,ze,Je),console.time("drilling down")),this.splitTile(Pe.source,Oe,ze,Je,U,V,W),xe>1&&console.timeEnd("drilling down"),this.tiles[de]?Fi(this.tiles[de],he):null):null}}function Hi(ye,U,V){return 32*((1<<ye)*V+U)+ye}class Wa extends le{constructor(U,V,W,se=Ha){super(U,V,W),this._dataUpdateable=new Map,this._createGeoJSONIndex=se}loadVectorTile(U,V){return b._(this,void 0,void 0,(function*(){const W=U.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const se=this._geoJSONIndex.getTile(W.z,W.x,W.y);return se?ve(new b.d2(se.features,{version:2,extent:b.a5})):null}))}loadData(U){return b._(this,void 0,void 0,(function*(){var V;(V=this._pendingRequest)===null||V===void 0||V.abort();const W=this._startPerformance(U);this._pendingRequest=new AbortController;try{(!this._pendingData||U.request||U.data||U.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(U,this._pendingRequest));const se=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(se,U),this.loaded={};const he={};return U.request&&(he.data=se),this._finishPerformance(W,U,he),he}catch(se){if(delete this._pendingRequest,b.Z(se))return{abandoned:!0};throw se}}))}_startPerformance(U){var V;if(!((V=U?.request)===null||V===void 0)&&V.collectResourceTiming)return new b.c_(U.request)}_finishPerformance(U,V,W){if(!U)return;const se=U.finish();se&&(W.resourceTiming={},W.resourceTiming[V.source]=JSON.parse(JSON.stringify(se)))}getData(){return b._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(U){const V=this.loaded;return V&&V[U.uid]?super.reloadTile(U):this.loadTile(U)}loadAndProcessGeoJSON(U,V){return b._(this,void 0,void 0,(function*(){let W;if(U.request?W=yield this.loadGeoJSONFromUrl(U.request,U.promoteId,V):U.data?W=this._loadGeoJSONFromObject(U.data,U.promoteId):U.dataDiff&&(W=this._loadGeoJSONFromDiff(U.dataDiff,U.promoteId,U.source)),delete this._pendingRequest,typeof W!="object")throw new Error(`Input data given to '${U.source}' is not a valid GeoJSON object.`);return Me(W,!0),U.filter&&(W=this._filterGeoJSON(W,U.filter)),W}))}loadGeoJSONFromUrl(U,V,W){return b._(this,void 0,void 0,(function*(){const se=yield b.j(U,W);return this._dataUpdateable=b.a7(se.data,V),se.data}))}_loadGeoJSONFromObject(U,V){return this._dataUpdateable=b.a7(U,V),U}_loadGeoJSONFromDiff(U,V,W){if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${W}`);b.a8(this._dataUpdateable,U,V);const se=Array.from(this._dataUpdateable.values());return this._toFeatureCollection(se)}_filterGeoJSON(U,V){const W=b.d3(V,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(W.result==="error")throw new Error(W.value.map((he=>`${he.key}: ${he.message}`)).join(", "));const se=U.features.filter((he=>W.value.evaluate({zoom:0},he)));return this._toFeatureCollection(se)}_toFeatureCollection(U){return{type:"FeatureCollection",features:U}}removeSource(U){return b._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(U){return this._geoJSONIndex.getClusterExpansionZoom(U.clusterId)}getClusterChildren(U){return this._geoJSONIndex.getChildren(U.clusterId)}getClusterLeaves(U){return this._geoJSONIndex.getLeaves(U.clusterId,U.limit,U.offset)}}function Ha(ye,U){return U.cluster?new It((function({superclusterOptions:V,clusterProperties:W}){if(!W||!V)return V;const se={},he={},xe={accumulated:null,zoom:0},ge={properties:null},de=Object.keys(W);for(const Pe of de){const[Oe,ze]=W[Pe],Je=b.d3(ze),nt=b.d3(typeof Oe=="string"?[Oe,["accumulated"],["get",Pe]]:Oe);se[Pe]=Je.value,he[Pe]=nt.value}return V.map=Pe=>{ge.properties=Pe;const Oe={};for(const ze of de)Oe[ze]=se[ze].evaluate(xe,ge);return Oe},V.reduce=(Pe,Oe)=>{ge.properties=Oe;for(const ze of de)xe.accumulated=Pe[ze],Pe[ze]=he[ze].evaluate(xe,ge)},V})(U)).load(ye.features):(function(V,W){return new qn(V,W)}
vendor: 13,017 bytes, line 2
2)(ye,U.geojsonVtOptions)}class wi{constructor(U){this.self=U,this.actor=new b.L(U),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(V,W)=>{if(this.externalWorkerSourceTypes[V])throw new Error(`Worker source with name "${V}" already registered.`);this.externalWorkerSourceTypes[V]=W},this.self.addProtocol=b.cJ,this.self.removeProtocol=b.cK,this.self.registerRTLTextPlugin=V=>{b.d4.setMethods(V)},this.actor.registerMessageHandler("LDT",((V,W)=>this._getDEMWorkerSource(V,W.source).loadTile(W))),this.actor.registerMessageHandler("RDT",((V,W)=>b._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(V,W.source).removeTile(W)})))),this.actor.registerMessageHandler("GCEZ",((V,W)=>b._(this,void 0,void 0,(function*(){return this._getWorkerSource(V,W.type,W.source).getClusterExpansionZoom(W)})))),this.actor.registerMessageHandler("GCC",((V,W)=>b._(this,void 0,void 0,(function*(){return this._getWorkerSource(V,W.type,W.source).getClusterChildren(W)})))),this.actor.registerMessageHandler("GCL",((V,W)=>b._(this,void 0,void 0,(function*(){return this._getWorkerSource(V,W.type,W.source).getClusterLeaves(W)})))),this.actor.registerMessageHandler("LD",((V,W)=>this._getWorkerSource(V,W.type,W.source).loadData(W))),this.actor.registerMessageHandler("GD",((V,W)=>this._getWorkerSource(V,W.type,W.source).getData())),this.actor.registerMessageHandler("LT",((V,W)=>this._getWorkerSource(V,W.type,W.source).loadTile(W))),this.actor.registerMessageHandler("RT",((V,W)=>this._getWorkerSource(V,W.type,W.source).reloadTile(W))),this.actor.registerMessageHandler("AT",((V,W)=>this._getWorkerSource(V,W.type,W.source).abortTile(W))),this.actor.registerMessageHandler("RMT",((V,W)=>this._getWorkerSource(V,W.type,W.source).removeTile(W))),this.actor.registerMessageHandler("RS",((V,W)=>b._(this,void 0,void 0,(function*(){if(!this.workerSources[V]||!this.workerSources[V][W.type]||!this.workerSources[V][W.type][W.source])return;const se=this.workerSources[V][W.type][W.source];delete this.workerSources[V][W.type][W.source],se.removeSource!==void 0&&se.removeSource(W)})))),this.actor.registerMessageHandler("RM",(V=>b._(this,void 0,void 0,(function*(){delete this.layerIndexes[V],delete this.availableImages[V],delete this.workerSources[V],delete this.demWorkerSources[V],this.globalStates.delete(V)})))),this.actor.registerMessageHandler("SR",((V,W)=>b._(this,void 0,void 0,(function*(){this.referrer=W})))),this.actor.registerMessageHandler("SRPS",((V,W)=>this._syncRTLPluginState(V,W))),this.actor.registerMessageHandler("IS",((V,W)=>b._(this,void 0,void 0,(function*(){this.self.importScripts(W)})))),this.actor.registerMessageHandler("SI",((V,W)=>this._setImages(V,W))),this.actor.registerMessageHandler("UL",((V,W)=>b._(this,void 0,void 0,(function*(){this._getLayerIndex(V).update(W.layers,W.removedIds,this._getGlobalState(V))})))),this.actor.registerMessageHandler("UGS",((V,W)=>b._(this,void 0,void 0,(function*(){const se=this._getGlobalState(V);for(const he in W)se[he]=W[he]})))),this.actor.registerMessageHandler("SL",((V,W)=>b._(this,void 0,void 0,(function*(){this._getLayerIndex(V).replace(W,this._getGlobalState(V))}))))}_getGlobalState(U){let V=this.globalStates.get(U);return V||(V={},this.globalStates.set(U,V)),V}_setImages(U,V){return b._(this,void 0,void 0,(function*(){this.availableImages[U]=V;for(const W in this.workerSources[U]){const se=this.workerSources[U][W];for(const he in se)se[he].availableImages=V}}))}_syncRTLPluginState(U,V){return b._(this,void 0,void 0,(function*(){return yield b.d4.syncState(V,this.self.importScripts)}))}_getAvailableImages(U){let V=this.availableImages[U];return V||(V=[]),V}_getLayerIndex(U){let V=this.layerIndexes[U];return V||(V=this.layerIndexes[U]=new s),V}_getWorkerSource(U,V,W){if(this.workerSources[U]||(this.workerSources[U]={}),this.workerSources[U][V]||(this.workerSources[U][V]={}),!this.workerSources[U][V][W]){const se={sendAsync:(he,xe)=>(he.targetMapId=U,this.actor.sendAsync(he,xe))};switch(V){case"vector":this.workerSources[U][V][W]=new le(se,this._getLayerIndex(U),this._getAvailableImages(U));break;case"geojson":this.workerSources[U][V][W]=new Wa(se,this._getLayerIndex(U),this._getAvailableImages(U));break;default:this.workerSources[U][V][W]=new this.externalWorkerSourceTypes[V](se,this._getLayerIndex(U),this._getAvailableImages(U))}}return this.workerSources[U][V][W]}_getDEMWorkerSource(U,V){return this.demWorkerSources[U]||(this.demWorkerSources[U]={}),this.demWorkerSources[U][V]||(this.demWorkerSources[U][V]=new He),this.demWorkerSources[U][V]}}return b.i(self)&&(self.worker=new wi(self)),wi})),w("index",["exports","./shared"],(function(b,s){var D="5.16.0";function N(){var m=new s.A(4);return s.A!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m}let Z,re,pe;const ue={frame(m,t,n){const l=requestAnimationFrame((g=>{h(),t(g)})),{unsubscribe:h}=s.s(m.signal,"abort",(()=>{h(),cancelAnimationFrame(l),n(new s.a(m.signal.reason))}),!1)},frameAsync(m){return new Promise(((t,n)=>{this.frame(m,t,n)}))},getImageData(m,t=0){return this.getImageCanvasContext(m).getImageData(-t,-t,m.width+2*t,m.height+2*t)},getImageCanvasContext(m){const t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return t.width=m.width,t.height=m.height,n.drawImage(m,0,0,m.width,m.height),n},resolveURL:m=>(Z||(Z=document.createElement("a")),Z.href=m,Z.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return pe!==void 0?pe:!!matchMedia&&(re==null&&(re=matchMedia("(prefers-reduced-motion: reduce)")),re.matches)},set prefersReducedMotion(m){pe=m}},ve=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(m){this._frozenAt=m}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function me(){return ve.getCurrentTime()}class le{static testProp(t){if(!le.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in le.docStyle)return t[n];return t[0]}static create(t,n,l){const h=window.document.createElement(t);return n!==void 0&&(h.className=n),l&&l.appendChild(h),h}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){le.docStyle&&le.selectProp&&(le.userSelect=le.docStyle[le.selectProp],le.docStyle[le.selectProp]="none")}static enableDrag(){le.docStyle&&le.selectProp&&(le.docStyle[le.selectProp]=le.userSelect)}static setTransform(t,n){t.style[le.transformProp]=n}static addEventListener(t,n,l,h={}){t.addEventListener(n,l,"passive"in h?h:h.capture)}static removeEventListener(t,n,l,h={}){t.removeEventListener(n,l,"passive"in h?h:h.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",le.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",le.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",le.suppressClickInternal,!0)}),0)}static getScale(t){const n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,n,l){const h=n.boundingClientRect;return new s.P((l.clientX-h.left)/n.x-t.clientLeft,(l.clientY-h.top)/n.y-t.clientTop)}static mousePos(t,n){const l=le.getScale(t);return le.getPoint(t,l,n)}static touchPos(t,n){const l=[],h=le.getScale(t);for(let g=0;g<n.length;g++)l.push(le.getPoint(t,h,n[g]));return l}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){const n=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),l=n.querySelectorAll("script");for(const h of l)h.remove();return le.clean(n),n.innerHTML}static isPossiblyDangerous(t,n){const l=n.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!l.includes("javascript:")&&!l.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const n=t.children;for(const l of n)le.removeAttributes(l),le.clean(l)}static removeAttributes(t){for(const{name:n,value:l}of t.attributes)le.isPossiblyDangerous(n,l)&&t.removeAttribute(n)}}le.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,le.selectProp=le.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),le.transformProp=le.testProp(["transform","WebkitTransform"]);const He={supported:!1,testSupport:function(m){!ke&&$e&&(Me?Re(m):Ne=m)}};let Ne,$e,ke=!1,Me=!1;function Re(m){const t=m.createTexture();m.bindTexture(m.TEXTURE_2D,t);try{if(m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,$e),m.isContextLost())return;He.supported=!0}catch{}m.deleteTexture(t),ke=!0}var rt;typeof document<"u"&&($e=document.createElement("img"),$e.onload=()=>{Ne&&Re(Ne),Ne=null,Me=!0},$e.onerror=()=>{ke=!0,Ne=null},$e.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(m){let t,n,l,h;m.resetRequestQueue=()=>{t=[],n=0,l=0,h={}},m.addThrottleControl=I=>{const A=l++;return h[A]=I,A},m.removeThrottleControl=I=>{delete h[I],_()},m.getImage=(I,A,C=!0)=>new Promise(((R,L)=>{He.supported&&(I.headers||(I.headers={}),I.headers.accept="image/webp,*/*"),s.e(I,{type:"image"}),t.push({abortController:A,requestParameters:I,supportImageRefresh:C,state:"queued",onError:O=>{L(O)},onSuccess:O=>{R(O)}}),_()}));const g=I=>s._(this,void 0,void 0,(function*(){I.state="running";const{requestParameters:A,supportImageRefresh:C,onError:R,onSuccess:L,abortController:O}=I,$=C===!1&&!s.i(self)&&!s.g(A.url)&&(!A.headers||Object.keys(A.headers).reduce(((Y,ee)=>Y&&ee==="accept"),!0));n++;const X=$?T(A,O):s.m(A,O);try{const Y=yield X;delete I.abortController,I.state="completed",Y.data instanceof HTMLImageElement||s.b(Y.data)?L(Y):Y.data&&L({data:yield(K=Y.data,typeof createImageBitmap=="function"?s.f(K):s.h(K)),cacheControl:Y.cacheControl,expires:Y.expires})}catch(Y){delete I.abortController,R(Y)}finally{n--,_()}var K})),_=()=>{const I=(()=>{for(const A of Object.keys(h))if(h[A]())return!0;return!1})()?s.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:s.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let A=n;A<I&&t.length>0;A++){const C=t.shift();C.abortController.signal.aborted?A--:g(C)}},T=(I,A)=>new Promise(((C,R)=>{const L=new Image,O=I.url,$=I.credentials;$&&$==="include"?L.crossOrigin="use-credentials":($&&$==="same-origin"||!s.d(O))&&(L.crossOrigin="anonymous"),A.signal.addEventListener("abort",(()=>{L.src="",R(new s.a(A.signal.reason))})),L.fetchPriority="high",L.onload=()=>{L.onerror=L.onload=null,C({data:L})},L.onerror=()=>{L.onerror=L.onload=null,A.signal.aborted||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."))},L.src=O}))})(rt||(rt={})),rt.resetRequestQueue();class ut{constructor(t){this._transformRequestFn=t??null}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function It(m){const t=[];if(typeof m=="string")t.push({id:"default",url:m});else if(m&&m.length>0){const n=[];for(const{id:l,url:h}of m){const g=`${l}${h}`;n.indexOf(g)===-1&&(n.push(g),t.push({id:l,url:h}))}}return t}function dt(m,t,n){try{const l=new URL(m);return l.pathname+=`${t}${n}`,l.toString()}catch{throw new Error(`Invalid sprite URL "${m}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Cr(m){const{userImage:t}=m;return!!(t&&t.render&&t.render())&&(m.data.replace(new Uint8Array(t.data.buffer)),!0)}class Ur extends s.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(const t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new s.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,promiseResolve:l}of this.requestors)l(this._getImagesForIds(n));this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const l=n.spriteData;n.data=new s.R({width:l.width,height:l.height},l.context.getImageData(l.x,l.y,l.width,l.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let l=!0;const h=n.data||n.spriteData;return this._validateStretch(n.stretchX,h&&h.width)||(this.fire(new s.k(new Error(`Image "${t}
2" has invalid "stretchX" value`))),l=!1),this._validateStretch(n.stretchY,h&&h.height)||(this.fire(new s.k(new Error(`Image "${t}" has invalid "stretchY" value`))),l=!1),this._validateContent(n.content,n)||(this.fire(new s.k(new Error(`Image "${t}" has invalid "content" value`))),l=!1),l}_validateStretch(t,n){if(!t)return!0;let l=0;for(const h of t){if(h[0]<l||h[1]<h[0]||n<h[1])return!1;l=h[1]}return!0}_validateContent(t,n){if(!t)return!0;if(t.length!==4)return!1;const l=n.spriteData,h=l&&l.width||n.data.width,g=l&&l.height||n.data.height;return!(t[0]<0||h<t[0]||t[1]<0||g<t[1]||t[2]<0||h<t[2]||t[3]<0||g<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,n,l=!0){const h=this.getImage(t);if(l&&(h.data.width!==n.data.width||h.data.height!==n.data.height))throw new Error(`size mismatch between old image (${h.data.width}x${h.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=h.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){const n=this.images[t];delete this.images[t],delete this.patterns[t],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((n,l)=>{let h=!0;if(!this.isLoaded())for(const g of t)this.images[g]||(h=!1);this.isLoaded()||h?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})}
vendor: 17,073 bytes, line 2
2))}_getImagesForIds(t){const n={};for(const l of t){let h=this.getImage(l);h||(this.fire(new s.l("styleimagemissing",{id:l})),h=this.getImage(l)),h?n[l]={data:h.data.clone(),pixelRatio:h.pixelRatio,sdf:h.sdf,version:h.version,stretchX:h.stretchX,stretchY:h.stretchY,content:h.content,textFitWidth:h.textFitWidth,textFitHeight:h.textFitHeight,hasRenderCallback:!!(h.userImage&&h.userImage.render)}:s.w(`Image "${l}" 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 n}getPixelSize(){const{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],l=this.getImage(t);if(!l)return null;if(n&&n.position.version===l.version)return n.position;if(n)n.position.version=l.version;else{const h={w:l.data.width+2,h:l.data.height+2,x:0,y:0},g=new s.I(h,l);this.patterns[t]={bin:h,position:g}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new s.T(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const g in this.patterns)t.push(this.patterns[g].bin);const{w:n,h:l}=s.p(t),h=this.atlasImage;h.resize({width:n||1,height:l||1});for(const g in this.patterns){const{bin:_}=this.patterns[g],T=_.x+1,I=_.y+1,A=this.getImage(g).data,C=A.width,R=A.height;s.R.copy(A,h,{x:0,y:0},{x:T,y:I},{width:C,height:R}),s.R.copy(A,h,{x:0,y:R-1},{x:T,y:I-1},{width:C,height:1}),s.R.copy(A,h,{x:0,y:0},{x:T,y:I+R},{width:C,height:1}),s.R.copy(A,h,{x:C-1,y:0},{x:T-1,y:I},{width:1,height:R}),s.R.copy(A,h,{x:0,y:0},{x:T+C,y:I},{width:1,height:R})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const l=this.getImage(n);l||s.w(`Image with ID: "${n}" was not found`),Cr(l)&&this.updateImage(n,l)}}cloneImages(){const t={};for(const n in this.images){const l=this.images[n];t[n]=Object.assign(Object.assign({},l),{data:l.data?l.data.clone():null})}return t}}const ci=1e20;function Tn(m,t,n,l,h,g,_,T,I){for(let A=t;A<t+l;A++)Sn(m,n*g+A,g,h,_,T,I);for(let A=n;A<n+h;A++)Sn(m,A*g+t,1,l,_,T,I)}function Sn(m,t,n,l,h,g,_){g[0]=0,_[0]=-ci,_[1]=ci,h[0]=m[t];for(let T=1,I=0,A=0;T<l;T++){h[T]=m[t+T*n];const C=T*T;do{const R=g[I];A=(h[T]-h[R]+C-R*R)/(T-R)/2}while(A<=_[I]&&--I>-1);I++,g[I]=T,_[I]=A,_[I+1]=ci}for(let T=0,I=0;T<l;T++){for(;_[I+1]<T;)I++;const A=g[I],C=T-A;m[t+T*n]=h[A]+C*C}}const $a=s.v.layout_symbol["text-font"].default.join(",");class ui{constructor(t,n,l){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={},this.lang=l}setURL(t){this.url=t}getGlyphs(t){return s._(this,void 0,void 0,(function*(){const n=[];for(const g in t)for(const _ of t[g])n.push(this._getAndCacheGlyphsPromise(g,_));const l=yield Promise.all(n),h={};for(const{stack:g,id:_,glyph:T}of l)h[g]||(h[g]={}),h[g][_]=T&&{id:T.id,bitmap:T.bitmap.clone(),metrics:T.metrics};return h}))}_getAndCacheGlyphsPromise(t,n){return s._(this,void 0,void 0,(function*(){let l=this.entries[t];l||(l=this.entries[t]={glyphs:{},requests:{},ranges:{}});let h=l.glyphs[n];return h!==void 0?{stack:t,id:n,glyph:h}:!this.url||this._charUsesLocalIdeographFontFamily(n)?(h=l.glyphs[n]=this._drawGlyph(l,t,n),{stack:t,id:n,glyph:h}):yield this._downloadAndCacheRangePromise(t,n)}))}_downloadAndCacheRangePromise(t,n){return s._(this,void 0,void 0,(function*(){const l=this.entries[t],h=Math.floor(n/256);if(l.ranges[h])return{stack:t,id:n,glyph:null};if(!l.requests[h]){const g=ui.loadGlyphRange(t,h,this.url,this.requestManager);l.requests[h]=g}try{const g=yield l.requests[h];for(const _ in g)l.glyphs[+_]=g[+_];return l.ranges[h]=!0,{stack:t,id:n,glyph:g[n]||null}}catch(g){const _=l.glyphs[n]=this._drawGlyph(l,t,n);return this._warnOnMissingGlyphRange(_,h,n,g),{stack:t,id:n,glyph:_}}}))}_warnOnMissingGlyphRange(t,n,l,h){const g=256*n,_=g+255,T=l.toString(16).padStart(4,"0").toUpperCase();s.w(`Unable to load glyph range ${n}, ${g}-${_}. Rendering codepoint U+${T} locally instead. ${h}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&s.q(t)}_drawGlyph(t,n,l){const h=n===$a&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(l),g=h?"ideographTinySDF":"tinySDF";t[g]||(t[g]=this._createTinySDF(h?this.localIdeographFontFamily:n));const _=t[g].draw(String.fromCodePoint(l)),T=new RegExp("^\\p{gc=Cf}+$","u").test(String.fromCodePoint(l));return{id:l,bitmap:new s.r({width:_.width||60,height:_.height||60},_.data),metrics:{width:T?0:_.glyphWidth/2||24,height:_.glyphHeight/2||24,left:_.glyphLeft/2+.5||0,top:_.glyphTop/2-27.5||-8,advance:T?0:_.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){const n=t?t.split(","):[];n.push("sans-serif");const l=n.map((h=>/[-\w]+/.test(h)?h:`'${CSS.escape(h)}'`)).join(",");return new ui.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:this._fontWeight(n[0]),fontStyle:this._fontStyle(n[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){const n={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};let l;for(const[h,g]of Object.entries(n))new RegExp(`\\b${h}\\b`,"i").test(t)&&(l=`${g}`);return l}destroy(){for(const t in this.entries){const n=this.entries[t];n.tinySDF&&(n.tinySDF=null),n.ideographTinySDF&&(n.ideographTinySDF=null),n.glyphs={},n.requests={},n.ranges={}}this.entries={}}}ui.loadGlyphRange=function(m,t,n,l){return s._(this,void 0,void 0,(function*(){const h=256*t,g=h+255,_=l.transformRequest(n.replace("{fontstack}",m).replace("{range}",`${h}-${g}`),"Glyphs"),T=yield s.n(_,new AbortController);if(!T||!T.data)throw new Error(`Could not load glyph range. range: ${t}, ${h}-${g}`);const I={};for(const A of s.o(T.data))I[A.id]=A;return I}))},ui.TinySDF=class{constructor({fontSize:m=24,buffer:t=3,radius:n=8,cutoff:l=.25,fontFamily:h="sans-serif",fontWeight:g="normal",fontStyle:_="normal",lang:T=null}={}){this.buffer=t,this.cutoff=l,this.radius=n,this.lang=T;const I=this.size=m+4*t,A=this._createCanvas(I),C=this.ctx=A.getContext("2d",{willReadFrequently:!0});C.font=`${_} ${g} ${m}px ${h}`,C.textBaseline="alphabetic",C.textAlign="left",C.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(m){const t=document.createElement("canvas");return t.width=t.height=m,t}draw(m){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:l,actualBoundingBoxLeft:h,actualBoundingBoxRight:g}=this.ctx.measureText(m),_=Math.ceil(n),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(g-h))),I=Math.min(this.size-this.buffer,_+Math.ceil(l)),A=T+2*this.buffer,C=I+2*this.buffer,R=Math.max(A*C,0),L=new Uint8ClampedArray(R),O={data:L,width:A,height:C,glyphWidth:T,glyphHeight:I,glyphTop:_,glyphLeft:0,glyphAdvance:t};if(T===0||I===0)return O;const{ctx:$,buffer:X,gridInner:K,gridOuter:Y}=this;this.lang&&($.lang=this.lang),$.clearRect(X,X,T,I),$.fillText(m,X,X+_);const ee=$.getImageData(X,X,T,I);Y.fill(ci,0,R),K.fill(0,0,R);for(let oe=0;oe<I;oe++)for(let J=0;J<T;J++){const ne=ee.data[4*(oe*T+J)+3]/255;if(ne===0)continue;const ce=(oe+X)*A+J+X;if(ne===1)Y[ce]=0,K[ce]=ci;else{const ie=.5-ne;Y[ce]=ie>0?ie*ie:0,K[ce]=ie<0?ie*ie:0}}Tn(Y,0,0,A,C,A,this.f,this.v,this.z),Tn(K,X,X,T,I,A,this.f,this.v,this.z);for(let oe=0;oe<R;oe++){const J=Math.sqrt(Y[oe])-Math.sqrt(K[oe]);L[oe]=Math.round(255-255*(J/this.radius+this.cutoff))}return O}};class Mn{constructor(){this.specification=s.u.light.position}possiblyEvaluate(t,n){return s.F(t.expression.evaluate(n))}interpolate(t,n,l){return{x:s.G.number(t.x,n.x,l),y:s.G.number(t.y,n.y,l),z:s.G.number(t.z,n.z,l)}}}let Ot;class Ga extends s.E{constructor(t){super(),Ot=Ot||new s.t({anchor:new s.D(s.u.light.anchor),position:new Mn,color:new s.D(s.u.light.color),intensity:new s.D(s.u.light.intensity)}),this._transitionable=new s.x(Ot,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(s.y,t,n))for(const l in t){const h=t[l];l.endsWith(s.z)?this._transitionable.setTransition(l.slice(0,-s.z.length),h):this._transitionable.setValue(l,h)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,l){return(!l||l.validate!==!1)&&s.B(this,t.call(s.C,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:s.u}))}}const In=new s.t({"sky-color":new s.D(s.u.sky["sky-color"]),"horizon-color":new s.D(s.u.sky["horizon-color"]),"fog-color":new s.D(s.u.sky["fog-color"]),"fog-ground-blend":new s.D(s.u.sky["fog-ground-blend"]),"horizon-fog-blend":new s.D(s.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new s.D(s.u.sky["sky-horizon-blend"]),"atmosphere-blend":new s.D(s.u.sky["atmosphere-blend"])});class qa extends s.E{constructor(t){super(),this._transitionable=new s.x(In,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new s.H(0))}setSky(t,n={}){if(!this._validate(s.J,t,n)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const l in t){const h=t[l];l.endsWith(s.z)?this._transitionable.setTransition(l.slice(0,-s.z.length),h):this._transitionable.setValue(l,h)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,l={}){return l?.validate!==!1&&s.B(this,t.call(s.C,s.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:s.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Fo{constructor(t,n){this.width=t,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,n){const l=t.join(",")+String(n);return this.dashEntry[l]||(this.dashEntry[l]=this.addDash(t,n)),this.dashEntry[l]}getDashRanges(t,n,l){const h=[];let g=t.length%2==1?-t[t.length-1]*l:0,_=t[0]*l,T=!0;h.push({left:g,right:_,isDash:T,zeroLength:t[0]===0});let I=t[0];for(let A=1;A<t.length;A++){T=!T;const C=t[A];g=I*l,I+=C,_=I*l,h.push({left:g,right:_,isDash:T,zeroLength:C===0})}return h}addRoundDash(t,n,l){const h=n/2;for(let g=-l;g<=l;g++){const _=this.width*(this.nextRow+l+g);let T=0,I=t[T];for(let A=0;A<this.width;A++){A/I.right>1&&(I=t[++T]);const C=Math.abs(A-I.left),R=Math.abs(A-I.right),L=Math.min(C,R);let O;const $=g/l*(h+1);if(I.isDash){const X=h-Math.abs($);O=Math.sqrt(L*L+X*X)}else O=h-Math.sqrt(L*L+$*$);this.data[_+A]=Math.max(0,Math.min(255,O+128))}}}addRegularDash(t){for(let T=t.length-1;T>=0;--T){const I=t[T],A=t[T+1];I.zeroLength?t.splice(T,1):A&&A.isDash===I.isDash&&(A.left=I.left,t.splice(T,1))}const n=t[0],l=t[t.length-1];n.isDash===l.isDash&&(n.left=l.left-this.width,l.right=n.right+this.width);const h=this.width*this.nextRow;let g=0,_=t[g];for(let T=0;T<this.width;T++){T/_.right>1&&(_=t[++g]);const I=Math.abs(T-_.left),A=Math.abs(T-_.right),C=Math.min(I,A);this.data[h+T]=Math.max(0,Math.min(255,(_.isDash?C:-C)+128))}}addDash(t,n){const l=n?7:0,h=2*l+1;if(this.nextRow+h>this.height)return s.w("LineAtlas out of space"),null;let g=0;for(let T=0;T<t.length;T++)g+=t[T];if(g!==0){const T=this.width/g,I=this.getDashRanges(t,this.width,T);n?this.addRoundDash(I,T,l):this.addRegularDash(I)}const _={y:this.nextRow+l,height:2*l,width:g};return this.nextRow+=h,this.dirty=!0,_}bind(t){const n=t.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}const pa="maplibre_preloaded_worker_pool";class ri{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<ri.workerCount;)this.workers.push(new Worker(s.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach((n=>{n.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[pa]}numActive(){return Object.keys(this.active).length}}const qi=Math.floor(ue.hardwareConcurrency/2);let Pn,hi;function da(){return Pn||(Pn=new ri),Pn}ri.workerCount=s.K(globalThis)?Math.max(Math.min(qi,3),1):1;class Zi{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const l=this.workerPool.acquire(n);for(let h=0;h<l.length;h++){const g=new s.L(l[h],n);g.name=`Worker ${h}`,this.actors.push(g)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n){const l=[];for(const h of this.actors)l.push(h.sendAsync({type:t,data:n}));return Promise.all(l)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach((n=>{n.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(const l of this.actors)l.registerMessageHandler(t,n)}unregisterMessageHandler(t){for(const n of this.actors)n.unregisterMessageHandler(t)}}function Bo(){return hi||(hi=new Zi(da(),s.M),hi.registerMessageHandler("GR",((m,t,n)=>s.m(t,n)))),hi}function Wi(m,t){const n=s.N();return s.O(n,n,[1,1,0]),s.Q(n,n,[.5*m.width,.5*m.height,1]),m.calculatePosMatrix?s.S(n,n,m.calculatePosMatrix(t.toUnwrapped())):n}function Oo(m,t,n,l,h,g,_){var T;const I=(function(L,O,$){if(L)for(const X of L){const K=O[X];if(K&&K.source===$&&K.type==="fill-extrusion")return!0}else for(const X in O){const K=O[X];if(K.source===$&&K.type==="fill-extrusion")return!0}return!1})((T=h?.layers)!==null&&T!==void 0?T:null,t,m.id),A=g.maxPitchScaleFactor(),C=m.tilesIn(l,A,I);C.sort($r);const R=[];for(const L of C)R.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(t,n,m.getState(),L.queryGeometry,L.cameraQueryGeometry,L.scale,h,g,A,Wi(g,L.tileID),_?(O,$)=>_(L.tileID,O,$):void 0)});return(function(L,O){for(const $ in L)for(const X of L[$])Fi(X,O);return L})((function(L){const O={},$={};for(const X of L){const K=X.queryResults,Y=X.wrappedTileID,ee=$[Y]=$[Y]||{};for(const oe in K){const J=K[oe],ne=ee[oe]=ee[oe]||{},ce=O[oe]=O[oe]||[];for(const ie of J)ne[ie.featureIndex]||(ne[ie.featureIndex]=!0,ce.push(ie))}}return O})(R),m)}function $r(m,t){const n=m.tileID,l=t.tileID;return n.overscaledZ-l.overscaledZ||n.canonical.y-l.canonical.y||n.wrap-l.wrap||n.canonical.x-l.canonical.x}function Fi(m,t){const n=m.feature,l=t.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=l}function mn(m,t,n){return s._(this,void 0,void 0,(function*(){let l=m;if(m.url?l=(yield s.j(t.transformRequest(m.url,"Source"),n)).data:yield ue.frameAsync(n),!l)return null;const h=s.U(s.e(l,m),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in l&&l.vector_layers&&(h.vectorLayerIds=l.vector_layers.map((g=>g.id))),h}))}class dr{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof s.V?new s.V(t.lng,t.lat):s.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof s.V?new s.V(t.lng,t.lat):s.V.convert(t),this}extend(t){const n=this._sw,l=this._ne;let h,g;if(t instanceof s.V)h=t,g=t;else{if(!(t instanceof dr))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(dr.convert(t)):this.extend(s.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(s.V.convert(t)):this;if(h=t._sw,g=t._ne,!h||!g)return this}return n||l?(n.lng=Math.min(h.lng,n.lng),n.lat=Math.min(h.lat,n.lat),l.lng=Math.max(g.lng,l.lng),l.lat=Math.max(g.lat,l.lat)):(this._sw=new s.V(h.lng,h.lat),this._ne=new s.V(g.lng,g.lat)),this}getCenter(){return new s.V((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}
2getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new s.V(this.getWest(),this.getNorth())}getSouthEast(){return new s.V(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(t){const{lng:n,lat:l}=s.V.convert(t);let h=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(h=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=l&&l<=this._ne.lat&&h}intersects(t){if(!((t=dr.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;const n=Math.abs(this.getEast()-this.getWest()),l=Math.abs(t.getEast()-t.getWest());if(n>=360||l>=360)return!0;const h=s.W(this.getWest(),-180,180),g=s.W(this.getEast(),-180,180),_=s.W(t.getWest(),-180,180),T=s.W(t.getEast(),-180,180),I=h>=g,A=_>=T;return!(!I||!A)||(I?T>=h||_<=g:A?g>=_||h<=T:_<=g&&T>=h)}static convert(t){return t instanceof dr?t:t&&new dr(t)}static fromLngLat(t,n=0){const l=360*n/40075017,h=l/Math.cos(Math.PI/180*t.lat);return new dr(new s.V(t.lng-h,t.lat-l),new s.V(t.lng+h,t.lat+l))}adjustAntiMeridian(){const t=new s.V(this._sw.lng,this._sw.lat),n=new s.V(this._ne.lng,this._ne.lat);return new dr(t,t.lng>n.lng?new s.V(n.lng+360,n.lat):n)}}class Gn{constructor(t,n,l){this.bounds=dr.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=l||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),l=Math.floor(s.Y(this.bounds.getWest())*n),h=Math.floor(s.X(this.bounds.getNorth())*n),g=Math.ceil(s.Y(this.bounds.getEast())*n),_=Math.ceil(s.X(this.bounds.getSouth())*n);return t.x>=l&&t.x<g&&t.y>=h&&t.y<_}}class fa extends s.E{constructor(t,n,l,h){if(super(),this.id=t,this.dispatcher=l,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.e(this,s.U(n,["url","scheme","tileSize","promoteId","encoding"])),this._options=s.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(h)}load(){return s._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield mn(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),t&&(s.e(this,t),t.bounds&&(this.tileBounds=new Gn(t.bounds,this.minzoom,this.maxzoom)),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.l("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,s.Z(t)||this.fire(new s.k(t))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return s.e({},this._options)}loadTile(t){return s._(this,void 0,void 0,(function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
vendor: 7,903 bytes, line 2
2ype,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(t)};l.request.collectResourceTiming=this._collectResourceTiming;let h="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((g,_)=>{t.reloadPromise={resolve:g,reject:_}}))}else t.actor=this.dispatcher.getActor(),h="LT";t.abortController=new AbortController;try{const g=yield t.actor.sendAsync({type:h,data:l},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,g)}catch(g){if(delete t.abortController,t.aborted)return;if(g&&g.status!==404)throw g;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;const n=t.tileID.scaledTo(this.maxzoom).canonical,l=n.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:n,overzoomRequest:this.map._requestManager.transformRequest(l,"Tile")}}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){const l=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(l.resolve).catch(l.reject)}}abortTile(t){return s._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return s._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Za extends s.E{constructor(t,n,l,h){super(),this.id=t,this.dispatcher=l,this.setEventedParent(h),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.e({type:"raster"},n),s.e(this,s.U(n,["url","scheme","tileSize"]))}load(){return s._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const n=yield mn(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,n&&(s.e(this,n),n.bounds&&(this.tileBounds=new Gn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(n){this._tileJSONRequest=null,this._loaded=!0,s.Z(n)||this.fire(new s.k(n))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return s.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return s._(this,void 0,void 0,(function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const l=yield rt.getImage(this.map._requestManager.transformRequest(n,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(l&&l.data){this.map._refreshExpiredTiles&&(l.cacheControl||l.expires)&&t.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});const h=this.map.painter.context,g=h.gl,_=l.data;t.texture=this.map.painter.getTileTexture(_.width),t.texture?t.texture.update(_,{useMipmap:!0}):(t.texture=new s.T(h,_,g.RGBA,{useMipmap:!0}),t.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE,g.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(l){if(delete t.abortController,t.aborted)t.state="unloaded";else if(l)throw t.state="errored",l}}))}abortTile(t){return s._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return s._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class qn extends Za{constructor(t,n,l,h){super(t,n,l,h),this.type="raster-dem",this.maxzoom=22,this._options=s.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t){return s._(this,void 0,void 0,(function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(n,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const h=yield rt.getImage(l,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(h&&h.data){const g=h.data;this.map._refreshExpiredTiles&&(h.cacheControl||h.expires)&&t.setExpiryData({cacheControl:h.cacheControl,expires:h.expires});const _=s.b(g)&&s.$()?g:yield this.readImageNow(g),T={type:this.type,uid:t.uid,source:this.id,rawImageData:_,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const I=yield t.actor.sendAsync({type:"LDT",data:T});t.dem=I,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(h){if(delete t.abortController,t.aborted)t.state="unloaded";else if(h)throw t.state="errored",h}}))}readImageNow(t){return s._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&s.a0()){const n=t.width+2,l=t.height+2;try{return new s.R({width:n,height:l},yield s.a1(t,-1,-1,n,l))}catch{}}return ue.getImageData(t,1)}))}_getNeighboringTiles(t){const n=t.canonical,l=Math.pow(2,n.z),h=(n.x-1+l)%l,g=n.x===0?t.wrap-1:t.wrap,_=(n.x+1+l)%l,T=n.x+1===l?t.wrap+1:t.wrap,I={};return I[new s.a2(t.overscaledZ,g,n.z,h,n.y).key]={backfilled:!1},I[new s.a2(t.overscaledZ,T,n.z,_,n.y).key]={backfilled:!1},n.y>0&&(I[new s.a2(t.overscaledZ,g,n.z,h,n.y-1).key]={backfilled:!1},I[new s.a2(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},I[new s.a2(t.overscaledZ,T,n.z,_,n.y-1).key]={backfilled:!1}),n.y+1<l&&(I[new s.a2(t.overscaledZ,g,n.z,h,n.y+1).key]={backfilled:!1},I[new s.a2(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},I[new s.a2(t.overscaledZ,T,n.z,_,n.y+1).key]={backfilled:!1}),I}unloadTile(t){return s._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function Hi(m){return m.type==="GeometryCollection"?m.geometries.map((t=>t.coordinates)).flat(1/0):m.coordinates.flat(1/0)}function Wa(m){const t=new dr;let n;switch(m.type){case"FeatureCollection":n=m.features.map((l=>Hi(l.geometry))).flat(1/0);break;case"Feature":n=Hi(m.geometry);break;default:n=Hi(m)}if(n.length==0)return t;for(let l=0;l<n.length-1;l+=2)t.extend([n[l],n[l+1]]);return t}class Ha extends s.E{constructor(t,n,l,h){super(),this.id=t,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:n.data},this.actor=l.getActor(),this.setEventedParent(h),this._data=typeof n.data=="str
2ing"?{url:n.data}:{geojson:n.data},this._options=s.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId,n.clusterMaxZoom!==void 0&&this.maxzoom<=n.clusterMaxZoom&&s.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=s.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(n.buffer!==void 0?n.buffer:128),tolerance:this._pixelsToTileUnits(n.tolerance!==void 0?n.tolerance:.375),extent:s.a5,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(n.clusterMaxZoom),minPoints:Math.max(2,n.clusterMinPoints||2),extent:s.a5,radius:this._pixelsToTileUnits(n.clusterRadius||50),log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.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(t){return t*(s.a5/this.tileSize)}_getClusterMaxZoom(t){const n=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||s.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${n}"`),n}load(){return s._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,n){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};const l=this._updateWorkerData();return n?l:this}updateData(t,n){this._pendingWorkerUpdate.diff=s.a6(this._pendingWorkerUpdate.diff,t);const l=this._updateWorkerData();return n?l:this}getData(){return s._(this,void 0,void 0,(function*(){const t=s.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})}))}getBounds(){return s._(this,void 0,void 0,(function*(){return Wa(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMa
2xZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,n,l){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:n,offset:l}})}_updateWorkerData(){return s._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void s.w(`No pending worker updates for GeoJSONSource ${this.id}.`);const{data:t,diff:n}=this._pendingWorkerUpdate,l=s.e({type:this.type},this.workerOptions);t!==void 0?(typeof t=="string"?(l.request=this.map._requestManager.transformRequest(ue.resolveURL(t),"Source"),l.request.collectResourceTiming=this._collectResourceTiming):l.data=t,this._pendingWorkerUpdate.data=void 0):n&&(l.dataDiff=n,this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,this._isUpdatingWorker=!0,this.fire(new s.l("dataloading",{dataType:"source"}));try{const h=yield this.actor.sendAsync({type:"LD",data:l});if(this._isUpdatingWorker=!1,this._removed||h.abandoned)return void this.fire(new s.l("dataabort",{dataType:"source"}));h.data&&(this._data={geojson:h.data});const g=this._applyDiffToSource(n),_=this._getShouldReloadTileOptions(g);let T=null;h.resourceTiming&&h.resourceTiming[this.id]&&(T=h.resourceTiming[this.id].slice(0));const I={dataType:"source"};this._collectResourceTiming&&T&&T.length>0&&s.e(I,{resourceTiming:T}),this.fire(new s.l("data",Object.assign(Object.assign({},I),{sourceDataType:"metadata"}))),this.fire(new s.l("data",Object.assign(Object.assign({},I),{sourceDataType:"content",shouldReloadTileOptions:_})))}catch(h){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new s.l("dataabort",{dataType:"source"}));this.fire(new s.k(h))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyDiffToSource(t){if(!t)return;const n=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){const h=s.a7(this._data.geojson,n);if(!h)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:h}}if(!this._data.updateable)return;const l=s.a8(this._data.updateable,t,n);return t.removeAll||this._options.cluster?void 0:l}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((n=>Wa(n)))}}shouldReloadTile(t,{affectedBounds:n}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;const{buffer:l,extent:h}=this.workerOptions.geojsonVtOptions,g=(function({x:_,y:T,z:I},A=0){const C=s.a3((_-A)/Math.pow(2,I)),R=s.a4((T+1+A)/Math.pow(2,I)),L=s.a3((_+1+A)/Math.pow(2,I)),O=s.a4((T-A)/Math.pow(2,I));return new dr([C,R],[L,O])})(t.tileID.canonical,l/h);for(const _ of n)if(g.intersects(_))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return s._(this,void 0,void 0,(function*(){const n=t.actor?"RT":"LT";t.actor=this.actor;const l={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.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};t.abortController=new AbortController;const h=yield this.actor.sendAsync({type:n,data:l},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(h,this.map.painter,n==="RT")}))}abortTile(t){return s._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return s._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
vendor: 8,437 bytes, line 2
2ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return s.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class wi extends s.E{constructor(t,n,l,h){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=l,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(h),this.options=n}load(t){return s._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new s.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield rt.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,s.Z(n)||this.fire(new s.k(n))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(s.a9.fromLngLat);var l;return this.tileID=(function(h){const g=s.aa.fromPoints(h),_=g.width(),T=g.height(),I=Math.max(_,T),A=Math.max(0,Math.floor(-Math.log(I)/Math.LN2)),C=Math.pow(2,A);return new s.ac(A,Math.floor((g.minX+g.maxX)/2*C),Math.floor((g.minY+g.maxY)/2*C))})(n),this.terrainTileRanges=this._getOverlappingTileRanges(n),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=n.map((h=>this.tileID.getTilePoint(h)._round())),this.flippedWindingOrder=((l=this.tileCoords)[1].x-l[0].x)*(l[2].y-l[0].y)-(l[1].y-l[0].y)*(l[2].x-l[0].x)<0,this.fire(new s.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,n=t.gl;this.texture||(this.texture=new s.T(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let l=!1;for(const h in this.tiles){const g=this.tiles[h];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture,l=!0)}l&&this.fire(new s.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return s._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){const{minX:n,minY:l,maxX:h,maxY:g}=s.aa.fromPoints(t),_={};for(let T=0;T<=s.ab;T++){const I=Math.pow(2,T),A=Math.floor(n*I),C=Math.floor(l*I),R=Math.floor(h*I),L=Math.floor(g*I),O=(A%I+I)%I,$=R%I,X=Math.floor(A/I),K=Math.floor(R/I);_[T]={minWrap:X,maxWrap:K,minTileXWrapped:O,maxTileXWrapped:$,minTileY:C,maxTileY:L}}return _}}class ye extends wi{constructor(t,n,l,h){super(t,n,l,h),this.roundZoom=!0,this.type="video",this.options=n}load(){return s._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield s.ad(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new s.k(n))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new s.k(new s.ae(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new s.T(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let l=!1;for(const h in this.tiles){const g=this.tiles[h];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture,l=!0)}l&&this.fire(new s.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 U extends wi{constructor(t,n,l,h){super(t,n,l,h),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((g=>!Array.isArray(g)||g.length!==2||g.some((_=>typeof _!="number"))))||this.fire(new s.k(new s.ae(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.k(new s.ae(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new s.k(new s.ae(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new s.k(new s.ae(`sources.${t}`,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 s.k(new s.ae(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return s._(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 s.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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,l=n.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new s.T(n,this.canvas,l.RGBA,{premultiply:!0}),this.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE));let h=!1;for(const g in this.tiles){const _=this.tiles[g];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture,h=!0)}h&&this.fire(new s.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(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const V={},W=m=>{switch(m){case"geojson":return Ha;case"image":return wi;case"raster":return Za;case"raster-dem":return qn;case"vector":return fa;case"video":return ye;case"canvas":return U}return V[m]},se="RTLPluginLoaded";class he extends s.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Bo()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((n=>{throw this.status="error",n}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return s._(this,arguments,void 0,(function*(n,l=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ue.resolveURL(n),!this.url)throw new Error(`requested url ${n}
2 is invalid`);if(this.status==="unavailable"){if(!l)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return s._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new s.l(se))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let xe=null;function ge(){return xe||(xe=new he),xe}var de,Pe;(function(m){m[m.Base=0]="Base",m[m.Parent=1]="Parent"})(de||(de={})),(function(m){m[m.Departing=0]="Departing",m[m.Incoming=1]="Incoming"})(Pe||(Pe={}));class Oe{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=s.af(),this.uses=0,this.tileSize=n,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(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:n,fadingParentID:l,fadeEndTime:h}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=n,this.fadingParentID=l,this.fadeEndTime=h}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=me(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,n,l){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=(function(h,g){const _={};if(!g)return _;for(const T of h){const I=T.layerIds.map((A=>g.getLayer(A))).filter(Boolean);if(I.length!==0){T.layers=I,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map((A=>I.filter((C=>C.id===A))[0])));for(const A of I)_[A.id]=T}}return _})(t.buckets,n?.style),this.hasSymbolBuckets=!1;for(const h in this.buckets){const g=this.buckets[h];if(g instanceof s.ah){if(this.hasSymbolBuckets=!0,!l)break;g.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const h in this.buckets){const g=this.buckets[h];if(g instanceof s.ah&&g.hasRTLText){this.hasRTLText=!0,ge().lazyLoad();break}}this.queryPadding=0;for(const h in this.buckets){const g=this.buckets[h];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(h).queryRadius(g))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new s.ag}unloadVectorData(){for(const t in this.buckets)this.buckets[t].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(t){return this.buckets[t.id]}upload(t){for(const l in this.buckets){const h=this.buckets[l];h.uploadPending()&&h.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new s.T(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new s.T(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,l,h,g,_,T,I,A,C,R){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:h,cameraQueryGeometry:g,
vendor: 6,865 bytes, line 2
2scale:_,tileSize:this.tileSize,pixelPosMatrix:C,transform:I,params:T,queryPadding:this.queryPadding*A,getElevation:R},t,n,l):{}}querySourceFeatures(t,n){const l=this.latestFeatureIndex;if(!l||!l.rawTileData)return;const h=l.loadVTLayers(),g=n&&n.sourceLayer?n.sourceLayer:"",_=h[s.ai]||h[g];if(!_)return;const T=s.aj(n?.filter,n?.globalState),{z:I,x:A,y:C}=this.tileID.canonical,R={z:I,x:A,y:C};for(let L=0;L<_.length;L++){const O=_.feature(L);if(T.needGeometry){const K=s.ak(O,!0);if(!T.filter(new s.H(this.tileID.overscaledZ),K,this.tileID.canonical))continue}else if(!T.filter(new s.H(this.tileID.overscaledZ),O))continue;const $=l.getId(O,g),X=new s.al(O,I,A,C,$);X.tile=R,t.push(X)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const n=this.expirationTime;if(t.cacheControl){const l=s.am(t.cacheControl);l["max-age"]&&(this.expirationTime=Date.now()+1e3*l["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const l=Date.now();let h=!1;if(this.expirationTime>l)h=!1;else if(n)if(this.expirationTime<n)h=!0;else{const g=this.expirationTime-n;g?this.expirationTime=l+Math.max(g,3e4):h=!0}else h=!0;h?(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(t,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const l=this.latestFeatureIndex.loadVTLayers();for(const h in this.buckets){if(!n.style.hasLayer(h))continue;const g=this.buckets[h],_=g.layers[0].sourceLayer||s.ai,T=l[_],I=t[_];if(!T||!I||Object.keys(I).length===0)continue;g.update(I,T,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const A=n&&n.style&&n.style.getLayer(h);A&&(this.queryPadding=Math.max(this.queryPadding,A.queryRadius(g)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<me()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=me()+t}setDependencies(t,n){const l={};for(const h of n)l[h]=!0;this.dependencies[t]=l}hasDependency(t,n){for(const l of t){const h=this.dependencies[l];if(h){for(const g of n)if(h[g])return!0}}return!1}}class ze{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,l){const h=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][h]=this.stateChanges[t][h]||{},s.e(this.stateChanges[t][h],l),this.deletedStates[t]===null){this.deletedStates[t]={};for(const g in this.state[t])g!==h&&(this.deletedStates[t][g]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][h]===null){this.deletedStates[t][h]={};for(const g in this.state[t][h])l[g]||(this.deletedStates[t][h][g]=null)}else for(const g in l)this.deletedStates[t]&&this.deletedStates[t][h]&&this.deletedStates[t][h][g]===null&&delete this.deletedStates[t][h][g]}removeFeatureState(t,n,l){if(this.deletedStates[t]===null)return;const h=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},l&&n!==void 0)this.deletedStates[t][h]!==null&&(this.deletedStates[t][h]=this.deletedStates[t][h]||{},this.deletedStates[t][h][l]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][h])for(l in this.deletedStates[t][h]={},this.stateChanges[t][h])this.deletedStates[t][h][l]=null;else this.deletedStates[t][h]=null;else this.deletedStates[t]=null}getState(t,n){const l=String(n),h=s.e({},(this.state[t]||{})[l],(this.stateChanges[t]||{})[l]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const g=this.deletedStates[t][n];if(g===null)return{};for(const _ in g)delete h[_]}return h}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const l={};for(const h in this.stateChanges){this.state[h]=this.state[h]||{};const g={};for(const _ in this.stateChanges[h])this.state[h][_]||(this.state[h][_]={}),s.e(this.state[h][_],this.stateChanges[h][_]),g[_]=this.state[h][_];l[h]=g}for(const h in this.deletedStates){this.state[h]=this.state[h]||{};const g={};if(this.deletedStates[h]===null)for(const _ in this.state[h])g[_]={},this.state[h][_]={};else for(const _ in this.deletedStates[h]){if(this.deletedStates[h][_]===null)this.state[h][_]={};else for(const T of Object.keys(this.deletedStates[h][_]))delete this.state[h][_][T];g[_]=this.state[h][_]}l[h]=l[h]||{},s.e(l[h],g)}this.stateChanges={},this.deletedStates={},Object.keys(l).length!==0&&t.setFeatureState(l,n)}}const Je=89.25;function nt(m,t){const n=s.an(t.lat,-s.ao,s.ao);return new s.P(s.Y(t.lng)*m,s.X(n)*m)}function ft(m,t){return new s.a9(t.x/m,t.y/m).toLngLat()}function Ut(m){return m.cameraToCenterDistance*Math.min(.85*Math.tan(s.ap(90-m.pitch)),Math.tan(s.ap(Je-m.pitch)))}function Lt(m,t){const n=m.canonical,l=t/s.aq(n.z),h=n.x+Math.pow(2,n.z)*m.wrap,g=s.ar(new Float64Array(16));return s.O(g,g,[h*l,n.y*l,0]),s.Q(g,g,[l/s.a5,l/s.a5,1]),g}function we(m,t,n,l,h){const g=s.a9.fromLngLat(m,t),_=h*s.as(1,m.lat),{x:T,y:I,z:A}=qt(n,l);return new s.a9(g.x+_*-T,g.y+_*-I,g.z+_*-A)}function qt(m,t){const n=s.ap(m),l=s.ap(t),h=Math.cos(-n),g=Math.sin(n);return{x:g*Math.sin(l),y:-g*Math.cos(l),z:h}}function Jr(m,t,n){const l=t.intersectsFrustum(m);if(!n||l===0)return l;const h=t.intersectsPlane(n);return h===0?0:l===2&&h===2?2:1}function mt(m,t,n){let l=0;const h=(n-t)/10;for(let g=0;g<10;g++)l+=h*Math.pow(Math.cos(t+(g+.5)/10*(n-t)),m);return l}function jt(m,t){return function(n,l,h,g,_){const T=2*((m-1)/s.at(Math.cos(s.ap(Je-_))/Math.cos(s.ap(Je)))-1),I=Math.acos(h/g),A=2*mt(T-1,0,s.ap(_/2)),C=Math.min(s.ap(Je),I+s.ap(_/2)),R=mt(T-1,Math.min(C,I-s.ap(_/2)),C),L=Math.atan(l/h),O=Math.hypot(l,h);let $=n;return $+=s.at(g/O/Math.max(.5,Math.cos(s.ap(_/2)))),$+=T*s.at(Math.cos(L))/2,$-=s.at(Math.max(1,R/A/t))/2,$}}const Qr=jt(9.314,3);function rr(m,t){const n=(t.roundZoom?Math.round:Math.floor)(m.zoom+s.at(m.tileSize/t.tileSize));return Math.max(0,n)}function fr(m,t){const n=m.getCameraFrustum(),l=m.getClippingPlane(),h=m.screenPointToMercatorCoordinate(m.getCameraPoint()),g=s.a9.fromLngLat(m.center,m.elevation);h.z=g.z+Math.cos(m.pitchInRadians)*m.cameraToCenterDistance/m.worldSize;const _=m.getCoveringTilesDetailsProvider(),T=_.allowVariableZoom(m,t),I=rr(m,t),A=t.minzoom||0,C=t.maxzoom!==void 0?t.maxzoom:m.maxZoom,R=Math.min(Math.max(0,I),C),L=Math.pow(2,R),O=[L*h.x,L*h.y,0],$=[L*g.x,L*g.y,0],X=Math.hypot(g.x-h.x,g.y-h.y),K=Math.abs(g.z-h.z),Y=Math.hypot(X,K),ee=ne=>({zoom:0,x:0,y:0,wrap:ne,fullyVisible:!1}),oe=[],J=[];
2if(m.renderWorldCopies&&_.allowWorldCopies())for(let ne=1;ne<=3;ne++)oe.push(ee(-ne)),oe.push(ee(ne));for(oe.push(ee(0));oe.length>0;){const ne=oe.pop(),ce=ne.x,ie=ne.y;let fe=ne.fullyVisible;const Ae={x:ce,y:ie,z:ne.zoom},be=_.getTileBoundingVolume(Ae,ne.wrap,m.elevation,t);if(!fe){const Ue=Jr(n,be,l);if(Ue===0)continue;fe=Ue===2}const Te=_.distanceToTile2d(h.x,h.y,Ae,be);let Se=I;T&&(Se=(t.calculateTileZoom||Qr)(m.zoom+s.at(m.tileSize/t.tileSize),Te,K,Y,m.fov)),Se=(t.roundZoom?Math.round:Math.floor)(Se),Se=Math.max(0,Se);const Ve=Math.min(Se,C);if(ne.wrap=_.getWrap(g,Ae,ne.wrap),ne.zoom>=Ve){if(ne.zoom<A)continue;const Ue=R-ne.zoom,Fe=O[0]-.5-(ce<<Ue),Ze=O[1]-.5-(ie<<Ue),gt=t.reparseOverscaled?Math.max(ne.zoom,Se):ne.zoom;J.push({tileID:new s.a2(ne.zoom===C?gt:ne.zoom,ne.wrap,ne.zoom,ce,ie),distanceSq:s.au([$[0]-.5-ce,$[1]-.5-ie]),tileDistanceToCamera:Math.sqrt(Fe*Fe+Ze*Ze)})}else for(let Ue=0;Ue<4;Ue++)oe.push({zoom:ne.zoom+1,x:(ce<<1)+Ue%2,y:(ie<<1)+(Ue>>1),wrap:ne.wrap,fullyVisible:fe})}return J.sort(((ne,ce)=>ne.distanceSq-ce.distanceSq)).map((ne=>ne.tileID))}const Zt=s.aa.fromPoints([new s.P(0,0),new s.P(s.a5,s.a5)]);function Lr(m){return m==="raster"||m==="image"||m==="video"}function No(m,t,n,l,h,g,_){if(!t.hasData())return!1;const{tileID:T,fadingRole:I,fadingDirection:A,fadingParentID:C}=t;if(I===de.Base&&A===Pe.Incoming&&C)return n[C.key]=C,!0;const R=Math.max(T.overscaledZ-h,g);for(let L=T.overscaledZ-1;L>=R;L--){const O=T.scaledTo(L),$=m.getLoadedTile(O);if($)return t.setCrossFadeLogic({fadingRole:de.Base,fadingDirection:Pe.Incoming,fadingParentID:$.tileID,fadeEndTime:l+_}),$.setCrossFadeLogic({fadingRole:de.Parent,fadingDirection:Pe.Departing,fadeEndTime:l+_}),n[O.key]=O,!0}return!1}function jo(m,t,n,l,h,g){if(!t.hasData())return!1;const _=t.tileID.children(h);let T=je(m,t,_,n,l,h,g);if(T)return!0;for(const I of _)je(m,t,I.children(h),n,l,h,g)&&(T=!0);return T}function je(m,t,n,l,h,g,_){if(n[0].overscaledZ>=g)return!1;let T=!1;for(const I of n){const A=m.getLoadedTile(I);if(!A)continue;const{fadingRole:C,fadingDirection:R,fadingParentID:L}=A;C===de.Base&&R===Pe.Departing&&L||(A.setCrossFadeLogic({fadingRole:de.Base,fadingDirection:Pe.Departing,fadingParentID:t.tileID,fadeEndTime:h+_}),t.setCrossFadeLogic({fadingRole:de.Parent,fadingDirection:Pe.Incoming,fadeEndTime:h+_})),l[I.key]=I,T=!0}return T}function pi(m,t,n,l){const h=m.tileID;return!!m.selfFading||!m.hasData()&&!!t.has(h)&&(m.setSelfFadeLogic(n+l),!0)}function di(m,t){var n;m.needsHillshadePrepare=!0,m.needsTerrainPrepare=!0;let l=t.tileID.canonical.x-m.tileID.canonical.x;const h=t.tileID.canonical.y-m.tileID.canonical.y,g=Math.pow(2,m.tileID.canonical.z),_=t.tileID.key;l===0&&h===0||Math.abs(h)>1||(Math.abs(l)>1&&(Math.abs(l+g)===1?l+=g:Math.abs(l-g)===1&&(l-=g)),t.dem&&m.dem&&(m.dem.backfillBorder(t.dem,l,h),!((n=m.neighboringTiles)===null||n===void 0)&&n[_]&&(m.neighboringTiles[_].backfilled=!0)))}class Ys{constructor(){this._tiles={}}handleWrapJump(t){const n={};for(const l in this._tiles){const h=this._tiles[l];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+t),n[h.tileID.key]=h}this._tiles=n}setFeatureState(t,n){for(const l in this._tiles)this._tiles[l].setFeatureState(t,n)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((n=>n.tileID)).sort(s.aw).map((n=>n.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,n){this._tiles[t]=n}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){const n=this.getTileById(t.key);return n?.hasData()?n:null}isIdRenderable(t,n=!1){var l;return(l=this.getTileById(t))===null||l===void 0?void 0:l.isRenderable(n)}getRenderableIds(t=0,n){const l=[];for(const h of this.getAllIds())this.isIdRenderable(h,n)&&l.push(this.getTileById(h));return n?l.sort(((h,g)=>{const _=h.tileID,T=g.tileID,I=new s.P(_.canonical.x,_.canonical.y)._rotate(-t),A=new s.P(T.canonical.x,T.canonical.y)._rotate(-t);return _.overscaledZ-T.overscaledZ||A.y-I.y||A.x-I.x})).map((h=>h.tileID.key)):l.map((h=>h.tileID)).sort(s.aw).map((h=>h.key))}}class Bi extends s.E{constructor(t,n,l){super(),this.id=t,this.dispatcher=l,this.on("data",(h=>
2this._dataHandler(h))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((h,g,_,T)=>{const I=new(W(g.type))(h,g,_,T);if(I.id!==h)throw new Error(`Expected Source id to be ${h} instead of ${I.id}`);return I})(t,n,l,this),this._inViewTiles=new Ys,this._outOfViewCache=new s.ax(0,(h=>this._unloadTile(h))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new ze,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){for(const n of this._inViewTiles.getAllTiles())n.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new Ys}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(const t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n,l){return s._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,n,l)}catch(h){t.state="errored",h.status!==404?this._source.fire(new s.k(h,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new s.l("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(const n of this._inViewTiles.getAllTiles())n.upload(t),n.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var n;return this._inViewTiles.getRenderableIds((n=this.transform)===null||n===void 0?void 0:n.bearingInRadians,t)}hasRenderableParent(t){const n=t.overscaledZ-1;if(n>=this._source.minzoom){const l=this.getLoadedTile(t.scaledTo(n));if(l)return this._inViewTiles.isIdRenderable(l.tileID.key)}return!1}reload(t,n=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(const l of this._inViewTiles.getAllIds()){const h=this._inViewTiles.getTileById(l);n&&!this._source.shouldReloadTile(h,n)||(t?this._reloadTile(l,"expired"):h.state!=="errored"&&this._reloadTile(l,"reloading"))}}}_reloadTile(t,n){return s._(this,void 0,void 0,(function*(){const l=this._inViewTiles.getTileById(t);l&&(l.state!=="loading"&&(l.state=n),yield this._loadTile(l,t,n))}))}_tileLoaded(t,n,l){t.timeAdded=me(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),l==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&(function(h,g){var _,T;const I=g.getRenderableIds();for(const A of I){if(!h.neighboringTiles||!h.neighboringTiles[A])continue;const C=g.getTileById(A);h.neighboringTiles[A].backfilled||di(h,C),!((T=(_=C.neighboringTiles)===null||_===void 0?void 0:_[h.tileID.key])===null||T===void 0)&&T.backfilled||di(C,h)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new s.l("data",{dataType:"source",tile:t,coord:t.tileID}))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,n){const l=this._getLoadedDescendents(n),h=new Set;for(const g of n){const _=l[g.key];if(!_?.length){h.add(g);continue}const T=g.overscaledZ+Bi.maxOverzooming,I=_.filter((R=>R.tileID.overscaledZ<=T));if(!I.length){h.add(g);continue}const A=Math.min(...I.map((R=>
2R.tileID.overscaledZ))),C=I.filter((R=>R.tileID.overscaledZ===A)).map((R=>R.tileID));for(const R of C)t[R.key]=R;this._areDescendentsComplete(C,A,g.overscaledZ)||h.add(g)}return h}_getLoadedDescendents(t){var n;const l={};for(const h of this._inViewTiles.getAllTiles().filter((g=>g.hasData())))for(const g of t)h.tileID.isChildOf(g)&&(l[n=g.key]||(l[n]=[])).push(h);return l}_areDescendentsComplete(t,n,l){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===n:Math.pow(4,n-l)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,l=Math.ceil(t.height/this._source.tileSize)+1,h=Math.floor(n*l*(this._maxTileCacheZoomLevels===null?s.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),g=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,h):h;this._outOfViewCache.setMaxSize(g)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,n&&(this._inViewTiles.handleWrapJump(n),this._resetTileReloadTimers())}update(t,n){if(!this._sourceLoaded||this._paused)return;let l;this.transform=t,this.terrain=n,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?l=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((I=>new s.a2(I.canonical.z,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y))):(l=fr(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(l=l.filter((I=>this._source.hasTile(I))))):l=[],this.usedForTerrain&&(l=this._addTerrainIdealTiles(l));const h=l.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,h&&this.fire(new s.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const g=rr(t,this._source),_=this._updateRetainedTiles(l,g),T=Lr(this._source.type);T&&this._rasterFadeDuration>0&&!n&&(function(I,A,C,R,L,O,$){const X=me(),K=s.av(A);for(const Y of A){const ee=I.getTileById(Y.key);ee.fadingDirection!==Pe.Departing&&ee.fadeOpacity!==0||ee.resetFadeLogic(),No(I,ee,C,X,R,L,$)||jo(I,ee,C,X,O,$)||pi(ee,K,X,$)||ee.resetFadeLogic()}})(this._inViewTiles,l,_,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),T?this._cleanUpRasterTiles(_):this._cleanUpVectorTiles(_)}_cleanUpRasterTiles(t){for(const n of this._inViewTiles.getAllIds())t[n]||this._removeTile(n)}_cleanUpVectorTiles(t){for(const n of this._inViewTiles.getAllIds()){const l=this._inViewTiles.getTileById(n);t[n]?l.clearSymbolFadeHold():l.hasSymbolBuckets?l.holdingForSymbolFade()?l.symbolFadeFinished()&&this._removeTile(n):l.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(n)}}_addTerrainIdealTiles(t){const n=[];for(const l of t)if(l.canonical.z>this._source.minzoom){const h=l.scaledTo(l.canonical.z-1);n.push(h);const g=l.scaledTo(Math.max(this._source.minzoom,Math.min(l.canonical.z,5)));n.push(g)}return t.concat(n)}releaseSymbolFadeTiles(){for(const t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){var l;const h=new Set;for(const A of t)this._addTile(A).hasData()||h.add(A);const g=t.reduce(((A,C)=>(A[C.key]=C,A)),{}),_=this._retainLoadedChildren(g,h),T={},I=Math.max(n-Bi.maxUnderzooming,this._source.minzoom);for(const A of _){let C=this._inViewTiles.getTileById(A.key),R=C?.wasRequested();for(let L=A.overscaledZ-1;L>=I;--L){const O=A.scaledTo(L);if(T[O.key])break;if(T[O.key]=!0,C=this.getTile(O),!C&&R&&(C=this._addTile(O)),C){const $=C.hasData();if(($||!(!((l=this.map)===null||l===void 0)&&l.cancelPendingTileRequestsWhileZooming)||R)&&(g[O.key]=O),R=C.wasRequested(),$)break}}}return g}_addTile(t){let n=this._inViewTiles.getTileById(t.key);if(n)return n;n=this._outOfViewCache.getAndRemove(t),n&&(n.resetFadeLogic(),this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null));const l=n;return n||(n=new Oe(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._inViewTiles.setTile(t.key,n),l||this._source.fire(new s.l("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){this._clearTileReloadTimer(t);const l=n.getExpiryTimeout();l&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),l))}_clearTileReloadTimer(t){const n=this._timers[t];
2n&&(clearTimeout(n),delete this._timers[t])}_resetTileReloadTimers(){for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t of this._inViewTiles.getAllIds()){const n=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,n)}}refreshTiles(t){for(const n of this._inViewTiles.getAllIds()){const l=this._inViewTiles.getTileById(n);(this._inViewTiles.isIdRenderable(n)||l.state=="errored")&&t.some((h=>h.equals(l.tileID.canonical)))&&this._reloadTile(n,"expired")}}_removeTile(t){const n=this._inViewTiles.getTileById(t);n&&(n.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._outOfViewCache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType!=="metadata"?t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,n,l){const h=[],g=this.transform;if(!g)return h;const _=g.getCoveringTilesDetailsProvider().allowWorldCopies(),T=l?g.getCameraQueryGeometry(t):t,I=O=>g.screenPointToMercatorCoordinate(O,this.terrain),A=this.transformBbox(t,I,!_),C=this.transformBbox(T,I,!_),R=this.getIds(),L=s.aa.fromPoints(C);for(let O=0;O<R.length;O++){const $=this._inViewTiles.getTileById(R[O]);if($.holdingForSymbolFade())continue;const X=_?[$.tileID]:[$.tileID.unwrapTo(-1),$.tileID.unwrapTo(0)],K=Math.pow(2,g.zoom-$.tileID.overscaledZ),Y=n*$.queryPadding*s.a5/$.tileSize/K;for(const ee of X){const oe=L.map((J=>ee.getTilePoint(new s.a9(J.x,J.y))));if(oe.expandBy(Y),oe.intersects(Zt)){const J=A.map((ce=>ee.getTilePoint(ce))),ne=C.map((ce=>ee.getTilePoint(ce)));h.push({tile:$,tileID:_?ee:ee.unwrapTo(0),queryGeometry:J,cameraQueryGeometry:ne,scale:K})}}}return h}transformBbox(t,n,l){let h=t.map(n);if(l){const g=s.aa.fromPoints(t);g.shrinkBy(.001*Math.min(g.width(),g.height()));const _=g.map(n);s.aa.fromPoints(h).covers(_)||(h=h.map((T=>T.x>.5?new s.a9(T.x-1,T.y,T.z):T)))}return h}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map((l=>this._inViewTiles.getTileById(l).tileID));return this.transform&&this.transform.populateCache(n),n}hasTransition(){return!!this._source.hasTransition()||!(!Lr(this._source.type)||!(function(t,n){if(n<=0)return!1;const l=me();for(const h of t.getAllTiles())if(h.fadeEndTime>=l)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,n,l){this._state.updateState(t=t||s.ai,n,l)}removeFeatureState(t,n,l){this._state.removeFeatureState(t=t||s.ai,n,l)}getFeatureState(t,n){return this._state.getState(t=t||s.ai,n)}setDependencies(t,n,l){const h=this._inViewTiles.getTileById(t);h&&h.setDependencies(n,l)}reloadTilesForDependencies(t,n){for(const l of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(l).hasDependency(t,n)&&this._reloadTile(l,"reloading");this._outOfViewCache.filter((l=>!l.hasDependency(t,n)))}areTilesLoaded(){for(const t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}Bi.maxUnderzooming=10,Bi.maxOverzooming=3;class Xe{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let l=1;l<this.points.length;l++)this._distances[l]=this._distances[l-1]+this.points[l].dist(this.points[l-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=s.an(t,0,1);let n=1,l=this._distances[n];const h=t*this.paddedLength+this.padding;for(;l<h&&n<this._distances.length;)l=this._distances[++n];const g=n-1,_=this._distances[g],T=l-_,I=T>0?(h-_)/T:0;return this.points[g].mult(1-I).add(this.points[n].mult(I))}}function xt(m,t){let n=!0;return m==="always"||m!=="never"&&t!=="never"||(n=!1),n}class bt{constructor(t,n,l){const h=this.boxCells=[],g=this.circleCells=[];this.xCellCount=Math.ceil(t/l),this.yCellCount=Math.ceil(n/l);for(let _=0;_<this.xCellCount*this.yCellCount;_++)h.push([]),g.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}
vendor: 42,464 bytes, lines 2-29
2insert(t,n,l,h,g){this._forEachCell(n,l,h,g,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(l),this.bboxes.push(h),this.bboxes.push(g)}insertCircle(t,n,l,h){this._forEachCell(n-h,l-h,n+h,l+h,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(l),this.circles.push(h)}_insertBoxCell(t,n,l,h,g,_){this.boxCells[g].push(_)}_insertCircleCell(t,n,l,h,g,_){this.circleCells[g].push(_)}_query(t,n,l,h,g,_,T){if(l<0||t>this.width||h<0||n>this.height)return[];const I=[];if(t<=0&&n<=0&&this.width<=l&&this.height<=h){if(g)return[{key:null,x1:t,y1:n,x2:l,y2:h}];for(let A=0;A<this.boxKeys.length;A++)I.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++){const C=this.circles[3*A],R=this.circles[3*A+1],L=this.circles[3*A+2];I.push({key:this.circleKeys[A],x1:C-L,y1:R-L,x2:C+L,y2:R+L})}}else this._forEachCell(t,n,l,h,this._queryCell,I,{hitTest:g,overlapMode:_,seenUids:{box:{},circle:{}}},T);return I}query(t,n,l,h){return this._query(t,n,l,h,!1,null)}hitTest(t,n,l,h,g,_){return this._query(t,n,l,h,!0,g,_).length>0}hitTestCircle(t,n,l,h,g){const _=t-l,T=t+l,I=n-l,A=n+l;if(T<0||_>this.width||A<0||I>this.height)return!1;const C=[];return this._forEachCell(_,I,T,A,this._queryCellCircle,C,{hitTest:!0,overlapMode:h,circle:{x:t,y:n,radius:l},seenUids:{box:{},circle:{}}},g),C.length>0}_queryCell(t,n,l,h,g,_,T,I){const{seenUids:A,hitTest:C,overlapMode:R}=T,L=this.boxCells[g];if(L!==null){const $=this.bboxes;for(const X of L)if(!A.box[X]){A.box[X]=!0;const K=4*X,Y=this.boxKeys[X];if(t<=$[K+2]&&n<=$[K+3]&&l>=$[K+0]&&h>=$[K+1]&&(!I||I(Y))&&(!C||!xt(R,Y.overlapMode))&&(_.push({key:Y,x1:$[K],y1:$[K+1],x2:$[K+2],y2:$[K+3]}),C))return!0}}const O=this.circleCells[g];if(O!==null){const $=this.circles;for(const X of O)if(!A.circle[X]){A.circle[X]=!0;const K=3*X,Y=this.circleKeys[X];if(this._circleAndRectCollide($[K],$[K+1],$[K+2],t,n,l,h)&&(!I||I(Y))&&(!C||!xt(R,Y.overlapMode))){const ee=$[K],oe=$[K+1],J=$[K+2];if(_.push({key:Y,x1:ee-J,y1:oe-J,x2:ee+J,y2:oe+J}),C)return!0}}}return!1}_queryCellCircle(t,n,l,h,g,_,T,I){const{circle:A,seenUids:C,overlapMode:R}=T,L=this.boxCells[g];if(L!==null){const $=this.bboxes;for(const X of L)if(!C.box[X]){C.box[X]=!0;const K=4*X,Y=this.boxKeys[X];if(this._circleAndRectCollide(A.x,A.y,A.radius,$[K+0],$[K+1],$[K+2],$[K+3])&&(!I||I(Y))&&!xt(R,Y.overlapMode))return _.push(!0),!0}}const O=this.circleCells[g];if(O!==null){const $=this.circles;for(const X of O)if(!C.circle[X]){C.circle[X]=!0;const K=3*X,Y=this.circleKeys[X];if(this._circlesCollide($[K],$[K+1],$[K+2],A.x,A.y,A.radius)&&(!I||I(Y))&&!xt(R,Y.overlapMode))return _.push(!0),!0}}}_forEachCell(t,n,l,h,g,_,T,I){const A=this._convertToXCellCoord(t),C=this._convertToYCellCoord(n),R=this._convertToXCellCoord(l),L=this._convertToYCellCoord(h);for(let O=A;O<=R;O++)for(let $=C;$<=L;$++)if(g.call(this,t,n,l,h,this.xCellCount*$+O,_,T,I))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,l,h,g,_){const T=h-t,I=g-n,A=l+_;return A*A>T*T+I*I}_circleAndRectCollide(t,n,l,h,g,_,T){const I=(_-h)/2,A=Math.abs(t-(h+I));if(A>I+l)return!1;const C=(T-g)/2,R=Math.abs(n-(g+C));if(R>C+l)return!1;if(A<=I||R<=C)return!0;const L=A-I,O=R-C;return L*L+O*O<=l*l}}function Ai(m,t,n){const l=s.N();if(!m){const{vecSouth:R,vecEast:L}=An(t),O=N();O[0]=L[0],O[1]=L[1],O[2]=R[0],O[3]=R[1],h=O,(C=(_=(g=O)[0])*(A=g[3])-(I=g[2])*(T=g[1]))&&(h[0]=A*(C=1/C),h[1]=-T*C,h[2]=-I*C,h[3]=_*C),l[0]=O[0],l[1]=O[1],l[4]=O[2],l[5]=O[3]}var h,g,_,T,I,A,C;return s.Q(l,l,[1/n,1/n,1]),l}function Ks(m,t,n,l){if(m){const h=s.N();if(!t){const{vecSouth:g,vecEast:_}=An(n);h[0]=_[0],h[1]=_[1],h[4]=g[0],h[5]=g[1]}return s.Q(h,h,[l,l,1]),h}return n.pixelsToClipSpaceMatrix}function An(m){const t=Math.cos(m.rollInRadians),n=Math.sin(m.rollInRadians),l=Math.cos(m.pitchInRadians),h=Math.cos(m.bearingInRadians),g=Math.sin(m.bearingInRadians),_=s.aC();_[0]=-h*l*n-g*t,_[1]=-g*l*n+h*t;const T=s.aD(_);T<1e-9?s.aE(_):s.aF(_,_,1/T);const I=s.aC();I[0]=h*l*t-g*n,I[1]=g*l*t+h*n;const A=s.aD(I);return A<1e-9?s.aE(I):s.aF(I,I,1/A),{vecEast:I,vecSouth:_}}function yt(m,t,n,l){let h;l?(h=[m,t,l(m,t),1],s.aH(h,h,n)):(h=[m,t,0,1],el(h,h,n));const g=h[3];return{point:new s.P(h[0]/g,h[1]/g),signedDistanceFromCamera:g,isOccluded:!1}}function Vo(m,t){return .5+m/t*.5}function Uo(m,t){return m.x>=-t[0]&&m.x<=t[0]&&m.y>=-t[1]&&m.y<=t[1]}function Js(m,t,n,l,h,g,_,T,I,A,C,R,L){const O=n?m.textSizeData:m.iconSizeData,$=s.ay(O,t.transform.zoom),X=[256/t.width*2+1,256/t.height*2+1],K=n?m.text.dynamicLayoutVertexArray:m.icon.dynamicLayoutVertexArray;K.clear();const Y=m.lineVertexArray,ee=n?m.text.placedSymbolArray:m.icon.placedSymbolArray,oe=t.transform.width/t.transform.height;let J=!1;for(let ne=0;ne<ee.length;ne++){const ce=ee.get(ne);if(ce.hidden||ce.writingMode===s.az.vertical&&!J){ga(ce.numGlyphs,K);continue}J=!1;const ie=new s.P(ce.anchorX,ce.anchorY),fe={getElevation:L,pitchedLabelPlaneMatrix:l,lineVertexArray:Y,pitchWithMap:g,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:ie,unwrappedTileID:I,width:A,height:C,translation:R},Ae=Ka(ce.anchorX,ce.anchorY,fe);if(!Uo(Ae.point,X)){ga(ce.numGlyphs,K);continue}const be=Vo(t.transform.cameraToCenterDistance,Ae.signedDistanceFromCamera),Te=s.aA(O,$,ce),Se=g?Te*t.transform.getPitchedTextCorrection(ce.anchorX,ce.anchorY,I)/be:Te*be,Ve=Ya({projectionContext:fe,pitchedLabelPlaneMatrixInverse:h,symbol:ce,fontSize:Se,flip:!1,keepUpright:_,glyphOffsetArray:m.glyphOffsetArray,dynamicLayoutVertexArray:K,aspectRatio:oe,rotateToLine:T});J=Ve.useVertical,(Ve.notEnoughRoom||J||Ve.needsFlipping&&Ya({projectionContext:fe,pitchedLabelPlaneMatrixInverse:h,symbol:ce,fontSize:Se,flip:!0,keepUpright:_,glyphOffsetArray:m.glyphOffsetArray,dynamicLayoutVertexArray:K,aspectRatio:oe,rotateToLine:T}).notEnoughRoom)&&ga(ce.numGlyphs,K)}n?m.text.dynamicLayoutVertexBuffer.updateData(K):m.icon.dynamicLayoutVertexBuffer.updateData(K)}function Xa(m,t,n,l,h,g,_,T){const I=g.glyphStartIndex+g.numGlyphs,A=g.lineStartIndex,C=g.lineStartIndex+g.lineLength,R=t.getoffsetX(g.glyphStartIndex),L=t.getoffsetX(I-1),O=Xi(m*R,n,l,h,g.segment,A,C,T,_);if(!O)return null;const $=Xi(m*L,n,l,h,g.segment,A,C,T,_);return $?T.projectionCache.anyProjectionOccluded?null:{first:O,last:$}:null}function $o(m,t,n,l){return m===s.az.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*l?{useVertical:!0}:(m===s.az.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function Ya(m){const{projectionContext:t,pitchedLabelPlaneMatrixInverse:n,symbol:l,fontSize:h,flip:g,keepUpright:_,glyphOffsetArray:T,dynamicLayoutVertexArray:I,aspectRatio:A,rotateToLine:C}=m,R=h/24,L=l.lineOffsetX*R,O=l.lineOffsetY*R;let $;if(l.numGlyphs>1){const X=l.glyphStartIndex+l.numGlyphs,K=l.lineStartIndex,Y=l.lineStartIndex+l.lineLength,ee=Xa(R,T,L,O,g,l,C,t);if(!ee)return{notEnoughRoom:!0};const oe=Qs(ee.first.point.x,ee.first.point.y,t,n),J=Qs(ee.last.point.x,ee.last.point.y,t,n);if(_&&!g){const ne=$o(l.writingMode,oe,J,A);if(ne)return ne}$=[ee.first];for(let ne=l.glyphStartIndex+1;ne<X-1;ne++){const ce=Xi(R*T.getoffsetX(ne),L,O,g,l.segment,K,Y,t,C);if(!ce)return{notEnoughRoom:!0};$.push(ce)}$.push(ee.last)}else{if(_&&!g){const K=Vt(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,Y=l.lineStartIndex+l.segment+1,ee=new s.P(t.lineVertexArray.getx(Y),t.lineVertexArray.gety(Y)),oe=Vt(ee.x,ee.y,t),J=oe.signedDistanceFromCamera>0?oe.point:Go(t.tileAnchorPoint,ee,K,1,t),ne=Qs(K.x,K.y,t,n),ce=Qs(J.x,J.y,t,n),ie=$o(l.writingMode,ne,ce,A);if(ie)return ie}const X=Xi(R*T.getoffsetX(l.glyphStartIndex),L,O,g,l.segment,l.lineStartIndex,l.lineStartIndex+l.lineLength,t,C);if(!X||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};$=[X]}for(const X of $)s.aG(I,X.point,X.angle);return{}}function Go(m,t,n,l,h){const g=m.add(m.sub(t)._unit()),_=Vt(g.x,g.y,h).point,T=n.sub(_);return n.add(T._mult(l/T.mag()))}function fi(m,t,n){const l=t.projectionCache;if(l.projections[m])return l.projections[m];const h=new s.P(t.lineVertexArray.getx(m),t.lineVertexArray.gety(m)),g=Vt(h.x,h.y,t);if(g.signedDistanceFromCamera>0)return l.projections[m]=g.point,l.anyProjectionOccluded=l.anyProjectionOccluded||g.isOccluded,g.point;const _=m-n.direction;return Go(n.distanceFromAnchor===0?t.tileAnchorPoint:new s.P(t.lineVertexArray.getx(_),t.lineVertexArray.gety(_)),h,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,t)}function Vt(m,t,n){const l=m+n.translation[0],h=t+n.translation[1];let g;return n.pitchWithMap?(g=yt(l,h,n.pitchedLabelPlaneMatrix,n.getElevation),g.isOccluded=!1):(g=n.transform.projectTileCoordinates(l,h,n.unwrappedTileID,n.getElevation),g.point.x=(.5*g.point.x+.5)*n.width,g.point.y=(.5*-g.point.y+.5)*n.height),g}function Qs(m,t,n,l){if(n.pitchWithMap){const h=[m,t,0,1];return s.aH(h,h,l),n.transform.projectTileCoordinates(h[0]/h[3],h[1]/h[3],n.unwrappedTileID,n.getElevation).point}return{x:m/n.width*2-1,y:1-t/n.height*2}}function Ka(m,t,n){return n.transform.projectTileCoordinates(m,t,n.unwrappedTileID,n.getElevation)}function qo(m,t,n){return m._unit()._perp()._mult(t*n)}function ma(m,t,n,l,h,g,_,T,I){if(T.projectionCache.offsets[m])return T.projectionCache.offsets[m];const A=n.add(t);if(m+I.direction<l||m+I.direction>=h)return T.projectionCache.offsets[m]=A,A;const C=fi(m+I.direction,T,I),R=qo(C.sub(n),_,I.direction),L=n.add(R),O=C.add(R);return T.projectionCache.offsets[m]=s.aI(g,A,L,O)||A,T.projectionCache.offsets[m]}function Xi(m,t,n,l,h,g,_,T,I){const A=l?m-t:m+t;let C=A>0?1:-1,R=0;l&&(C*=-1,R=Math.PI),C<0&&(R+=Math.PI);let L,O=C>0?g+h:g+h+1;T.projectionCache.cachedAnchorPoint?L=T.projectionCache.cachedAnchorPoint:(L=Vt(T.tileAnchorPoint.x,T.tileAnchorPoint.y,T).point,T.projectionCache.cachedAnchorPoint=L);let $,X,K=L,Y=L,ee=0,oe=0;const J=Math.abs(A),ne=[];let ce;for(;ee+oe<=J;){if(O+=C,O<g||O>=_)return null;ee+=oe,Y=K,X=$;const Ae={absOffsetX:J,direction:C,distanceFromAnchor:ee,previousVertex:Y};if(K=fi(O,T,Ae),n===0)ne.push(Y),ce=K.sub(Y);else{let be;const Te=K.sub(Y);be=Te.mag()===0?qo(fi(O+C,T,Ae).sub(K),n,C):qo(Te,n,C),X||(X=Y.add(be)),$=ma(O,be,K,g,_,X,n,T,Ae),ne.push(X),ce=$.sub(X)}oe=ce.mag()}const ie=ce._mult((J-ee)/oe)._add(X||Y),fe=R+Math.atan2(K.y-Y.y,K.x-Y.x);return ne.push(ie),{point:ie,angle:I?fe:0,path:ne}}const ih=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ga(m,t){for(let n=0;n<m;n++){const l=t.length;t.resize(l+4),t.float32.set(ih,3*l)}}function el(m,t,n){const l=t[0],h=t[1];return m[0]=n[0]*l+n[4]*h+n[12],m[1]=n[1]*l+n[5]*h+n[13],m[3]=n[3]*l+n[7]*h+n[15],m}const mr=100;class nh{constructor(t,n=new bt(t.width+200,t.height+200,25),l=new bt(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=l,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+mr,this.screenBottomBoundary=t.height+mr,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,l,h,g,_,T,I,A,C,R,L){const O=this.projectAndGetPerspectiveRatio(t.anchorPointX+I[0],t.anchorPointY+I[1],g,C,L),$=l*O.perspectiveRatio;let X;if(_||T)X=this._projectCollisionBox(t,$,h,g,_,T,I,O,C,R,L);else{const ce=O.x+(R?R.x*$:0),ie=O.y+(R?R.y*$:0);X={allPointsOccluded:!1,box:[ce+t.x1*$,ie+t.y1*$,ce+t.x2*$,ie+t.y2*$]}}const[K,Y,ee,oe]=X.box,J=_?X.allPointsOccluded:O.isOccluded;let ne=J;return ne||(ne=O.perspectiveRatio<this.perspectiveRatioCutoff),ne||(ne=!this.isInsideGrid(K,Y,ee,oe)),ne||n!=="always"&&this.grid.hitTest(K,Y,ee,oe,n,A)?{box:[K,Y,ee,oe],placeable:!1,offscreen:!1,occluded:J}:{box:[K,Y,ee,oe],placeable:!0,offscreen:this.isOffscreen(K,Y,ee,oe),occluded:J}}placeCollisionCircles(t,n,l,h,g,_,T,I,A,C,R,L,O,$){const X=[],K=new s.P(n.anchorX,n.anchorY),Y=this.getPerspectiveRatio(K.x,K.y,_,$),ee=(A?g*this.transform.getPitchedTextCorrection(n.anchorX,n.anchorY,_)/Y:g*Y)/s.aM,oe={getElevation:$,pitchedLabelPlaneMatrix:T,lineVertexArray:l,pitchWithMap:A,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:K,unwrappedTileID:_,width:this.transform.width,height:this.transform.height,translation:O},J=Xa(ee,h,n.lineOffsetX*ee,n.lineOffsetY*ee,!1,n,!1,oe);let ne=!1,ce=!1,ie=!0;if(J){const fe=.5*R*Y+L,Ae=new s.P(-100,-100),be=new s.P(this.screenRightBoundary,this.screenBottomBoundary),Te=new Xe,Se=J.first,Ve=J.last;let Ue=[];for(let gt=Se.path.length-1;gt>=1;gt--)Ue.push(Se.path[gt]);for(let gt=1;gt<Ve.path.length;gt++)Ue.push(Ve.path[gt]);const Fe=2.5*fe;if(A){const gt=this.projectPathToScreenSpace(Ue,oe);Ue=gt.some((Nt=>Nt.signedDistanceFromCamera<=0))?[]:gt.map((Nt=>Nt.point))}let Ze=[];if(Ue.length>0){const gt=Ue[0].clone(),Nt=Ue[0].clone();for(let ir=1;ir<Ue.length;ir++)gt.x=Math.min(gt.x,Ue[ir].x),gt.y=Math.min(gt.y,Ue[ir].y),Nt.x=Math.max(Nt.x,Ue[ir].x),Nt.y=Math.max(Nt.y,Ue[ir].y);Ze=gt.x>=Ae.x&&Nt.x<=be.x&>.y>=Ae.y&&Nt.y<=be.y?[Ue]:Nt.x<Ae.x||gt.x>be.x||Nt.y<Ae.y||gt.y>be.y?[]:s.aJ([Ue],Ae.x,Ae.y,be.x,be.y)}for(const gt of Ze){Te.reset(gt,.25*fe);let Nt=0;Nt=Te.length<=.5*fe?1:Math.ceil(Te.paddedLength/Fe)+1;for(let ir=0;ir<Nt;ir++){const Xt=ir/Math.max(Nt-1,1),or=Te.lerp(Xt),Yt=or.x+mr,yr=or.y+mr;X.push(Yt,yr,fe,0);const sr=Yt-fe,qr=yr-fe,kr=Yt+fe,Tr=yr+fe;if(ie=ie&&this.isOffscreen(sr,qr,kr,Tr),ce=ce||this.isInsideGrid(sr,qr,kr,Tr),t!=="always"&&this.grid.hitTestCircle(Yt,yr,fe,t,C)&&(ne=!0,!I))return{circles:[],offscreen:!1,collisionDetected:ne}}}}return{circles:!I&&ne||!ce||Y<this.perspectiveRatioCutoff?[]:X,offscreen:ie,collisionDetected:ne}}projectPathToScreenSpace(t,n){const l=(function(h,g){const _=s.N();return s.aB(_,g.pitchedLabelPlaneMatrix),h.map((T=>{const I=yt(T.x,T.y,_,g.getElevation),A=g.transform.projectTileCoordinates(I.point.x,I.point.y,g.unwrappedTileID,g.getElevation);return A.point.x=(.5*A.point.x+.5)*g.width,A.point.y=(.5*-A.point.y+.5)*g.height,A}))})(t,n);return(function(h){let g=0,_=0,T=0,I=0;for(let A=0;A<h.length;A++)h[A].isOccluded?(T=A+1,I=0):(I++,I>_&&(_=I,g=T));return h.slice(g,g+_)})(l)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[],l=new s.aa;for(const R of t){const L=new s.P(R.x+mr,R.y+mr);l.extend(L),n.push(L)}const{minX:h,minY:g,maxX:_,maxY:T}=l,I=this.grid.query(h,g,_,T).concat(this.ignoredGrid.query(h,g,_,T)),A={},C={};for(const R of I){const L=R.key;if(A[L.bucketInstanceId]===void 0&&(A[L.bucketInstanceId]={}),A[L.bucketInstanceId][L.featureIndex])continue;const O=[new s.P(R.x1,R.y1),new s.P(R.x2,R.y1),new s.P(R.x2,R.y2),new s.P(R.x1,R.y2)];s.aK(n,O)&&(A[L.bucketInstanceId][L.featureIndex]=!0,C[L.bucketInstanceId]===void 0&&(C[L.bucketInstanceId]=[]),C[L.bucketInstanceId].push(L.featureIndex))}return C}insertCollisionBox(t,n,l,h,g,_){(l?this.ignoredGrid:this.grid).insert({bucketInstanceId:h,featureIndex:g,collisionGroupID:_,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,l,h,g,_){const T=l?this.ignoredGrid:this.grid,I={bucketInstanceId:h,featureIndex:g,collisionGroupID:_,overlapMode:n};for(let A=0;A<t.length;A+=4)T.insertCircle(I,t[A],t[A+1],t[A+2])}projectAndGetPerspectiveRatio(t,n,l,h,g){if(g){let _;h?(_=[t,n,h(t,n),1],s.aH(_,_,g)):(_=[t,n,0,1],el(_,_,g));const T=_[3];return{x:(_[0]/T+1)/2*this.transform.width+mr,y:(-_[1]/T+1)/2*this.transform.height+mr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/T*.5,isOccluded:!1,signedDistanceFromCamera:T}}{const _=this.transform.projectTileCoordinates(t,n,l,h);return{x:(_.point.x+1)/2*this.transform.width+mr,y:(1-_.point.y)/2*this.transform.height+mr,perspectiveRatio:.5+this.transform.cameraToCenterDistance/_.signedDistanceFromCamera*.5,isOccluded:_.isOccluded,signedDistanceFromCamera:_.signedDistanceFromCamera}}}getPerspectiveRatio(t,n,l,h){const g=this.transform.projectTileCoordinates(t,n,l,h);return .5+this.transform.cameraToCenterDistance/g.signedDistanceFromCamera*.5}isOffscreen(t,n,l,h){return l<mr||t>=this.screenRightBoundary||h<mr||n>this.screenBottomBoundary}isInsideGrid(t,n,l,h){return l>=0&&t<this.gridRightBoundary&&h>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const t=s.ar([]);return s.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,n,l,h,g,_,T,I,A,C,R){let L=1,O=0,$=0,X=1;const K=t.anchorPointX+T[0],Y=t.anchorPointY+T[1];if(_&&!g){const Ue=this.projectAndGetPerspectiveRatio(K+1,Y,h,A,R),Fe=Ue.x-I.x,Ze=Math.atan((Ue.y-I.y)/Fe)+(Fe<0?Math.PI:0),gt=Math.sin(Ze),Nt=Math.cos(Ze);L=Nt,O=gt,$=-gt,X=Nt}else if(!_&&g){const Ue=An(this.transform);L=Ue.vecEast[0],O=Ue.vecEast[1],$=Ue.vecSouth[0],X=Ue.vecSouth[1]}let ee=I.x,oe=I.y,J=n;g&&(ee=K,oe=Y,J=Math.pow(2,-(this.transform.zoom-l.overscaledZ)),J*=this.transform.getPitchedTextCorrection(K,Y,h),C||(J*=s.an(.5+I.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),C&&(ee+=L*C.x*J+$*C.y*J,oe+=O*C.x*J+X*C.y*J);const ne=t.x1*J,ce=t.x2*J,ie=(ne+ce)/2,fe=t.y1*J,Ae=t.y2*J,be=(fe+Ae)/2,Te=[{offsetX:ne,offsetY:fe},{offsetX:ie,offsetY:fe},{offsetX:ce,offsetY:fe},{offsetX:ce,offsetY:be},{offsetX:ce,offsetY:Ae},{offsetX:ie,offsetY:Ae},{offsetX:ne,offsetY:Ae},{offsetX:ne,offsetY:be}];let Se=[];for(const{offsetX:Ue,offsetY:Fe}of Te)Se.push(new s.P(ee+L*Ue+$*Fe,oe+O*Ue+X*Fe));let Ve=!1;if(g){const Ue=Se.map((Fe=>this.projectAndGetPerspectiveRatio(Fe.x,Fe.y,h,A,R)));Ve=Ue.some((Fe=>!Fe.isOccluded)),Se=Ue.map((Fe=>new s.P(Fe.x,Fe.y)))}else Ve=!0;return{box:s.aL(Se),allPointsOccluded:!Ve}}}class ah{constructor(t,n,l,h){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):h&&l?1:0,this.placed=l}isHidden(){return this.opacity===0&&!this.placed}}class Zo{constructor(t,n,l,h,g){this.text=new ah(t?t.text:null,n,l,g),this.icon=new ah(t?t.icon:null,n,h,g)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class oh{constructor(t,n,l){this.text=t,this.icon=n,this.skipFade=l}}class sh{constructor(t,n,l,h,g){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=l,this.bucketIndex=h,this.tileID=g}}class lh{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const n=++this.maxGroupID;this.collisionGroups[t]={ID:n,predicate:l=>l.collisionGroupID===n}}return this.collisionGroups[t]}}function tl(m,t,n,l,h){const{horizontalAlign:g,verticalAlign:_}=s.aS(m);return new s.P(-(g-.5)*t+l[0]*h,-(_-.5)*n+l[1]*h)}class gc{constructor(t,n,l,h,g){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new nh(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=l,this.retainedQueryData={},this.collisionGroups=new lh(h),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const n=this.terrain;return n?(l,h)=>n.getElevation(t,l,h):null}getBucketParts(t,n,l,h){const g=l.getBucket(n),_=l.latestFeatureIndex;if(!g||!_||n.id!==g.layerIds[0])return;const T=l.collisionBoxArray,I=g.layers[0].layout,A=g.layers[0].paint,C=Math.pow(2,this.transform.zoom-l.tileID.overscaledZ),R=l.tileSize/s.a5,L=l.tileID.toUnwrapped(),O=I.get("text-rotation-alignment")==="map",$=s.aN(l,1,this.transform.zoom),X=s.aO(this.collisionIndex.transform,l,A.get("text-translate"),A.get("text-translate-anchor")),K=s.aO(this.collisionIndex.transform,l,A.get("icon-translate"),A.get("icon-translate-anchor")),Y=Ai(O,this.transform,$);this.retainedQueryData[g.bucketInstanceId]=new sh(g.bucketInstanceId,_,g.sourceLayerIndex,g.index,l.tileID);const ee={bucket:g,layout:I,translationText:X,translationIcon:K,unwrappedTileID:L,pitchedLabelPlaneMatrix:Y,scale:C,textPixelRatio:R,holdingForFade:l.holdingForSymbolFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:s.ay(g.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(g.sourceID)};if(h)for(const oe of g.sortKeyRanges){const{sortKey:J,symbolInstanceStart:ne,symbolInstanceEnd:ce}=oe;t.push({sortKey:J,symbolInstanceStart:ne,symbolInstanceEnd:ce,parameters:ee})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:g.symbolInstances.length,parameters:ee})}attemptAnchorPlacement(t,n,l,h,g,_,T,I,A,C,R,L,O,$,X,K,Y,ee,oe,J){const ne=s.aP[t.textAnchor],ce=[t.textOffset0,t.textOffset1],ie=tl(ne,l,h,ce,g),fe=this.collisionIndex.placeCollisionBox(n,L,I,A,C,T,_,K,R.predicate,oe,ie,J);if((!ee||this.collisionIndex.placeCollisionBox(ee,L,I,A,C,T,_,Y,R.predicate,oe,ie,J).placeable)&&fe.placeable){let Ae;if(this.prevPlacement&&this.prevPlacement.variableOffsets[O.crossTileID]&&this.prevPlacement.placements[O.crossTileID]&&this.prevPlacement.placements[O.crossTileID].text&&(Ae=this.prevPlacement.variableOffsets[O.crossTileID].anchor),O.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[O.crossTileID]={textOffset:ce,width:l,height:h,anchor:ne,textBoxScale:g,prevAnchor:Ae},this.markUsedJustification($,ne,O,X),$.allowVerticalPlacement&&(this.markUsedOrientation($,X,O),this.placedOrientations[O.crossTileID]=X),{shift:ie,placedGlyphBoxes:fe}}}placeLayerBucketPart(t,n,l){const{bucket:h,layout:g,translationText:_,translationIcon:T,unwrappedTileID:I,pitchedLabelPlaneMatrix:A,textPixelRatio:C,holdingForFade:R,collisionBoxArray:L,partiallyEvaluatedTextSize:O,collisionGroup:$}=t.parameters,X=g.get("text-optional"),K=g.get("icon-optional"),Y=s.aQ(g,"text-overlap","text-allow-overlap"),ee=Y==="always",oe=s.aQ(g,"icon-overlap","icon-allow-overlap"),J=oe==="always",ne=g.get("text-rotation-alignment")==="map",ce=g.get("text-pitch-alignment")==="map",ie=g.get("icon-text-fit")!=="none",fe=g.get("symbol-z-order")==="viewport-y",Ae=ee&&(J||!h.hasIconData()||K),be=J&&(ee||!h.hasTextData()||X);!h.collisionArrays&&L&&h.deserializeCollisionBoxes(L);const Te=this.retainedQueryData[h.bucketInstanceId].tileID,Se=this._getTerrainElevationFunc(Te),Ve=this.transform.getFastPathSimpleProjectionMatrix(Te),Ue=(Fe,Ze,gt)=>{var Nt,ir;if(n[Fe.crossTileID])return;if(R)return void(this.placements[Fe.crossTileID]=new oh(!1,!1,!1));let Xt=!1,or=!1,Yt=!0,yr=null,sr={box:null,placeable:!1,offscreen:null,occluded:!1},qr={placeable:!1},kr=null,Tr=null,ei=null,ta=0,kn=0,_n=0;Ze.textFeatureIndex?ta=Ze.textFeatureIndex:Fe.useRuntimeCollisionCircles&&(ta=Fe.featureIndex),Ze.verticalTextFeatureIndex&&(kn=Ze.verticalTextFeatureIndex);const Mi=Ze.textBox;if(Mi){const Ui=er=>{let Kt=s.az.horizontal;if(h.allowVerticalPlacement&&!er&&this.prevPlacement){const jr=this.prevPlacement.placedOrientations[Fe.crossTileID];jr&&(this.placedOrientations[Fe.crossTileID]=jr,Kt=jr,this.markUsedOrientation(h,Kt,Fe))}return Kt},vn=(er,Kt)=>{if(h.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&Ze.verticalTextBox){for(const jr of h.writingModes)if(jr===s.az.vertical?(sr=Kt(),qr=sr):sr=er(),sr&&sr.placeable)break}else sr=er()},tn=Fe.textAnchorOffsetStartIndex,rn=Fe.textAnchorOffsetEndIndex;if(rn===tn){const er=(Kt,jr)=>{const Vr=this.collisionIndex.placeCollisionBox(Kt,Y,C,Te,I,ce,ne,_,$.predicate,Se,void 0,Ve);return Vr&&Vr.placeable&&(this.markUsedOrientation(h,jr,Fe),this.placedOrientations[Fe.crossTileID]=jr),Vr};vn((()=>er(Mi,s.az.horizontal)),(()=>{const Kt=Ze.verticalTextBox;return h.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&Kt?er(Kt,s.az.vertical):{box:null,offscreen:null}})),Ui(sr&&sr.placeable)}else{let er=s.aP[(ir=(Nt=this.prevPlacement)===null||Nt===void 0?void 0:Nt.variableOffsets[Fe.crossTileID])===null||ir===void 0?void 0:ir.anchor];const Kt=(Vr,ip,np)=>{const La=Vr.x2-Vr.x1,Xd=Vr.y2-Vr.y1,ap=Fe.textBoxScale,uu=ie&&oe==="never"?ip:null;let ra=null,ia=Y==="never"?1:2,na="never";er&&ia++;for(let hu=0;hu<ia;hu++){for(let pu=tn;pu<rn;pu++){const Ol=h.textAnchorOffsets.get(pu);if(er&&Ol.textAnchor!==er)continue;const Nl=this.attemptAnchorPlacement(Ol,Vr,La,Xd,ap,ne,ce,C,Te,I,$,na,Fe,h,np,_,T,uu,Se);if(Nl&&(ra=Nl.placedGlyphBoxes,ra&&ra.placeable))return Xt=!0,yr=Nl.shift,ra}er?er=null:na=Y}return l&&!ra&&(ra={box:this.collisionIndex.placeCollisionBox(Mi,"always",C,Te,I,ce,ne,_,$.predicate,Se,void 0,Ve).box,offscreen:!1,placeable:!1,occluded:!1}),ra};vn((()=>Kt(Mi,Ze.iconBox,s.az.horizontal)),(()=>{const Vr=Ze.verticalTextBox;return h.allowVerticalPlacement&&(!sr||!sr.placeable)&&Fe.numVerticalGlyphVertices>0&&Vr?Kt(Vr,Ze.verticalIconBox,s.az.vertical):{box:null,occluded:!0,offscreen:null}})),sr&&(Xt=sr.placeable,Yt=sr.offscreen);const jr=Ui(sr&&sr.placeable);if(!Xt&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[Fe.crossTileID];Vr&&(this.variableOffsets[Fe.crossTileID]=Vr,this.markUsedJustification(h,Vr.anchor,Fe,jr))}}}if(kr=sr,Xt=kr&&kr.placeable,Yt=kr&&kr.offscreen,Fe.useRuntimeCollisionCircles&&Fe.centerJustifiedTextSymbolIndex>=0){const Ui=h.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),vn=s.aA(h.textSizeData,O,Ui),tn=g.get("text-padding");Tr=this.collisionIndex.placeCollisionCircles(Y,Ui,h.lineVertexArray,h.glyphOffsetArray,vn,I,A,l,ce,$.predicate,Fe.collisionCircleDiameter,tn,_,Se),Tr.circles.length&&Tr.collisionDetected&&!l&&s.w("Collisions detected, but collision boxes are not shown"),Xt=ee||Tr.circles.length>0&&!Tr.collisionDetected,Yt=Yt&&Tr.offscreen}if(Ze.iconFeatureIndex&&(_n=Ze.iconFeatureIndex),Ze.iconBox){const Ui=vn=>this.collisionIndex.placeCollisionBox(vn,oe,C,Te,I,ce,ne,T,$.predicate,Se,ie&&yr?yr:void 0,Ve);qr&&qr.placeable&&Ze.verticalIconBox?(ei=Ui(Ze.verticalIconBox),or=ei.placeable):(ei=Ui(Ze.iconBox),or=ei.placeable),Yt=Yt&&ei.offscreen}const Da=X||Fe.numHorizontalGlyphVertices===0&&Fe.numVerticalGlyphVertices===0,Is=K||Fe.numIconVertices===0;Da||Is?Is?Da||(or=or&&Xt):Xt=or&&Xt:or=Xt=or&&Xt;const za=or&&ei.placeable;if(Xt&&kr.placeable&&this.collisionIndex.insertCollisionBox(kr.box,Y,g.get("text-ignore-placement"),h.bucketInstanceId,qr&&qr.placeable&&kn?kn:ta,$.ID),za&&this.collisionIndex.insertCollisionBox(ei.box,oe,g.get("icon-ignore-placement"),h.bucketInstanceId,_n,$.ID),Tr&&Xt&&this.collisionIndex.insertCollisionCircles(Tr.circles,Y,g.get("text-ignore-placement"),h.bucketInstanceId,ta,$.ID),l&&this.storeCollisionData(h.bucketInstanceId,gt,Ze,kr,ei,Tr),Fe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(h.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Fe.crossTileID]=new oh((Xt||Ae)&&!kr?.occluded,(or||be)&&!ei?.occluded,Yt||h.justReloaded),n[Fe.crossTileID]=!0};if(fe){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Fe=h.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let Ze=Fe.length-1;Ze>=0;--Ze){const gt=Fe[Ze];Ue(h.symbolInstances.get(gt),h.collisionArrays[gt],gt)}}else for(let Fe=t.symbolInstanceStart;Fe<t.symbolInstanceEnd;Fe++)Ue(h.symbolInstances.get(Fe),h.collisionArrays[Fe],Fe);h.justReloaded=!1}storeCollisionData(t,n,l,h,g,_){if(l.textBox||l.iconBox){let T,I;this.collisionBoxArrays.has(t)?T=this.collisionBoxArrays.get(t):(T=new Map,this.collisionBoxArrays.set(t,T)),T.has(n)?I=T.get(n):(I={text:null,icon:null},T.set(n,I)),l.textBox&&(I.text=h.box),l.iconBox&&(I.icon=g.box)}if(_){let T=this.collisionCircleArrays[t];T===void 0&&(T=this.collisionCircleArrays[t]=[]);for(let I=0;I<_.circles.length;I+=4)T.push(_.circles[I+0]-mr),T.push(_.circles[I+1]-mr),T.push(_.circles[I+2]),T.push(_.collisionDetected?1:0)}}markUsedJustification(t,n,l,h){let g;g=h===s.az.vertical?l.verticalPlacedTextSymbolIndex:{left:l.leftJustifiedTextSymbolIndex,center:l.centerJustifiedTextSymbolIndex,right:l.rightJustifiedTextSymbolIndex}[s.aR(n)];const _=[l.leftJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.rightJustifiedTextSymbolIndex,l.verticalPlacedTextSymbolIndex];for(const T of _)T>=0&&(t.text.placedSymbolArray.get(T).crossTileID=g>=0&&T!==g?0:l.crossTileID)}markUsedOrientation(t,n,l){const h=n===s.az.horizontal||n===s.az.horizontalOnly?n:0,g=n===s.az.vertical?n:0,_=[l.leftJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.rightJustifiedTextSymbolIndex];for(const T of _)t.text.placedSymbolArray.get(T).placedOrientation=h;l.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(l.verticalPlacedTextSymbolIndex).placedOrientation=g)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let l=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const h=n?n.symbolFadeChange(t):1,g=n?n.opacities:{},_=n?n.variableOffsets:{},T=n?n.placedOrientations:{};for(const I in this.placements){const A=this.placements[I],C=g[I];C?(this.opacities[I]=new Zo(C,h,A.text,A.icon),l=l||A.text!==C.text.placed||A.icon!==C.icon.placed):(this.opacities[I]=new Zo(null,h,A.text,A.icon,A.skipFade),l=l||A.text||A.icon)}for(const I in g){const A=g[I];if(!this.opacities[I]){const C=new Zo(A,h,!1,!1);C.isHidden()||(this.opacities[I]=C,l=l||A.text.placed||A.icon.placed)}}for(const I in _)this.variableOffsets[I]||!this.opacities[I]||this.opacities[I].isHidden()||(this.variableOffsets[I]=_[I]);for(const I in T)this.placedOrientations[I]||!this.opacities[I]||this.opacities[I].isHidden()||(this.placedOrientations[I]=T[I]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");l?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const l={};for(const h of n){const g=h.getBucket(t);g&&h.latestFeatureIndex&&t.id===g.layerIds[0]&&this.updateBucketOpacities(g,h.tileID,l,h.collisionBoxArray)}}updateBucketOpacities(t,n,l,h){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const g=t.layers[0],_=g.layout,T=new Zo(null,0,!1,!1,!0),I=_.get("text-allow-overlap"),A=_.get("icon-allow-overlap"),C=g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"),R=_.get("text-rotation-alignment")==="map",L=_.get("text-pitch-alignment")==="map",O=_.get("icon-text-fit")!=="none",$=new Zo(null,0,I&&(A||!t.hasIconData()||_.get("icon-optional")),A&&(I||!t.hasTextData()||_.get("text-optional")),!0);!t.collisionArrays&&h&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(h);const X=(Y,ee,oe)=>{for(let J=0;J<ee/4;J++)Y.opacityVertexArray.emplaceBack(oe);Y.hasVisibleVertices=Y.hasVisibleVertices||oe!==Ho},K=this.collisionBoxArrays.get(t.bucketInstanceId);for(let Y=0;Y<t.symbolInstances.length;Y++){const ee=t.symbolInstances.get(Y),{numHorizontalGlyphVertices:oe,numVerticalGlyphVertices:J,crossTileID:ne}=ee;let ce=this.opacities[ne];l[ne]?ce=T:ce||(ce=$,this.opacities[ne]=ce),l[ne]=!0;const ie=ee.numIconVertices>0,fe=this.placedOrientations[ee.crossTileID],Ae=fe===s.az.vertical,be=fe===s.az.horizontal||fe===s.az.horizontalOnly;if(oe>0||J>0){const Se=xc(ce.text);X(t.text,oe,Ae?Ho:Se),X(t.text,J,be?Ho:Se);const Ve=ce.text.isHidden();[ee.rightJustifiedTextSymbolIndex,ee.centerJustifiedTextSymbolIndex,ee.leftJustifiedTextSymbolIndex].forEach((Ze=>{Ze>=0&&(t.text.placedSymbolArray.get(Ze).hidden=Ve||Ae?1:0)})),ee.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(ee.verticalPlacedTextSymbolIndex).hidden=Ve||be?1:0);const Ue=this.variableOffsets[ee.crossTileID];Ue&&this.markUsedJustification(t,Ue.anchor,ee,fe);const Fe=this.placedOrientations[ee.crossTileID];Fe&&(this.markUsedJustification(t,"left",ee,Fe),this.markUsedOrientation(t,Fe,ee))}if(ie){const Se=xc(ce.icon),Ve=!(O&&ee.verticalPlacedIconSymbolIndex&&Ae);ee.placedIconSymbolIndex>=0&&(X(t.icon,ee.numIconVertices,Ve?Se:Ho),t.icon.placedSymbolArray.get(ee.placedIconSymbolIndex).hidden=ce.icon.isHidden()),ee.verticalPlacedIconSymbolIndex>=0&&(X(t.icon,ee.numVerticalIconVertices,Ve?Ho:Se),t.icon.placedSymbolArray.get(ee.verticalPlacedIconSymbolIndex).hidden=ce.icon.isHidden())}const Te=K&&K.has(Y)?K.get(Y):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Se=t.collisionArrays[Y];if(Se){let Ve=new s.P(0,0);if(Se.textBox||Se.verticalTextBox){let Ue=!0;if(C){const Fe=this.variableOffsets[ne];Fe?(Ve=tl(Fe.anchor,Fe.width,Fe.height,Fe.textOffset,Fe.textBoxScale),R&&Ve._rotate(L?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Ue=!1}if(Se.textBox||Se.verticalTextBox){let Fe;Se.textBox&&(Fe=Ae),Se.verticalTextBox&&(Fe=be),yc(t.textCollisionBox.collisionVertexArray,ce.text.placed,!Ue||Fe,Te.text,Ve.x,Ve.y)}}if(Se.iconBox||Se.verticalIconBox){const Ue=!!(!be&&Se.verticalIconBox);let Fe;Se.iconBox&&(Fe=Ue),Se.verticalIconBox&&(Fe=!Ue),yc(t.iconCollisionBox.collisionVertexArray,ce.icon.placed,Fe,Te.icon,O?Ve.x:0,O?Ve.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,n){const l=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*l>t}setStale(){this.stale=!0}}function yc(m,t,n,l,h,g){l&&l.length!==0||(l=[0,0,0,0]);const _=l[0]-mr,T=l[1]-mr,I=l[2]-mr,A=l[3]-mr;m.emplaceBack(t?1:0,n?1:0,h||0,g||0,_,T),m.emplaceBack(t?1:0,n?1:0,h||0,g||0,I,T),m.emplaceBack(t?1:0,n?1:0,h||0,g||0,I,A),m.emplaceBack(t?1:0,n?1:0,h||0,g||0,_,A)}const _c=Math.pow(2,25),vc=Math.pow(2,24),Sd=Math.pow(2,17),Wo=Math.pow(2,16),rl=Math.pow(2,9),ch=Math.pow(2,8),Ja=Math.pow(2,1);function xc(m){if(m.opacity===0&&!m.placed)return 0;if(m.opacity===1&&m.placed)return 4294967295;const t=m.placed?1:0,n=Math.floor(127*m.opacity);return n*_c+t*vc+n*Sd+t*Wo+n*rl+t*ch+n*Ja+t}const Ho=0;class Zn{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,l,h,g){const _=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(_,h,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,g())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,_.sort(((T,I)=>T.sortKey-I.sortKey)));this._currentPartIndex<_.length;)if(n.placeLayerBucketPart(_[this._currentPartIndex],this._seenCrossTileIDs,l),this._currentPartIndex++,g())return!0;return!1}}class Qa{constructor(t,n,l,h,g,_,T,I){this.placement=new gc(t,n,_,T,I),this._currentPlacementIndex=l.length-1,this._forceFullPlacement=h,this._showCollisionBoxes=g,this._done=!1}isDone(){return this._done}continuePlacement(t,n,l){const h=me(),g=()=>!this._forceFullPlacement&&me()-h>2;for(;this._currentPlacementIndex>=0;){const _=n[t[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if(_.type==="symbol"&&(!_.minzoom||_.minzoom<=T)&&(!_.maxzoom||_.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Zn(_)),this._inProgressLayer.continuePlacement(l[_.source],this.placement,this._showCollisionBoxes,_,g))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const wt=512/s.a5/2;class bc{constructor(t,n,l){this.tileID=t,this.bucketInstanceId=l,this._symbolsByKey={};const h=new Map;for(let g=0;g<n.length;g++){const _=n.get(g),T=_.key,I=h.get(T);I?I.push(_):h.set(T,[_])}for(const[g,_]of h){const T={positions:_.map((I=>({x:Math.floor(I.anchorX*wt),y:Math.floor(I.anchorY*wt)}))),crossTileIDs:_.map((I=>I.crossTileID))};if(T.positions.length>128){const I=new s.aT(T.positions.length,16,Uint16Array);for(const{x:A,y:C}of T.positions)I.add(A,C);I.finish(),delete T.positions,T.index=I}this._symbolsByKey[g]=T}}getScaledCoordinates(t,n){const{x:l,y:h,z:g}=this.tileID.canonical,{x:_,y:T,z:I}=n.canonical,A=wt/Math.pow(2,I-g),C=(T*s.a5+t.anchorY)*A,R=h*s.a5*wt;return{x:Math.floor((_*s.a5+t.anchorX)*A-l*s.a5*wt),y:Math.floor(C-R)}}findMatches(t,n,l){const h=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let g=0;g<t.length;g++){const _=t.get(g);if(_.crossTileID)continue;const T=this._symbolsByKey[_.key];if(!T)continue;const I=this.getScaledCoordinates(_,n);if(T.index){const A=T.index.range(I.x-h,I.y-h,I.x+h,I.y+h).sort();for(const C of A){const R=T.crossTileIDs[C];if(!l[R]){l[R]=!0,_.crossTileID=R;break}}}else if(T.positions)for(let A=0;A<T.positions.length;A++){const C=T.positions[A],R=T.crossTileIDs[A];if(Math.abs(C.x-I.x)<=h&&Math.abs(C.y-I.y)<=h&&!l[R]){l[R]=!0,_.crossTileID=R;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class Md{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class wc{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const l in this.indexes){const h=this.indexes[l],g={};for(const _ in h){const T=h[_];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+n),g[T.tileID.key]=T}this.indexes[l]=g}this.lng=t}addBucket(t,n,l){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let g=0;g<n.symbolInstances.length;g++)n.symbolInstances.get(g).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const h=this.usedCrossTileIDs[t.overscaledZ];for(const g in this.indexes){const _=this.indexes[g];if(Number(g)>t.overscaledZ)for(const T in _){const I=_[T];I.tileID.isChildOf(t)&&I.findMatches(n.symbolInstances,t,h)}else{const T=_[t.scaledTo(Number(g)).key];T&&T.findMatches(n.symbolInstances,t,h)}}for(let g=0;g<n.symbolInstances.length;g++){const _=n.symbolInstances.get(g);_.crossTileID||(_.crossTileID=l.generate(),h[_.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new bc(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(const l of n.getCrossTileIDsLists())for(const h of l)delete this.usedCrossTileIDs[t][h]}removeStaleBuckets(t){let n=!1;for(const l in this.indexes){const h=this.indexes[l];for(const g in h)t[h[g].bucketInstanceId]||(this.removeBucketCrossTileIDs(l,h[g]),delete h[g],n=!0)}return n}}class Ti{constructor(){this.layerIndexes={},this.crossTileIDs=new Md,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,l){let h=this.layerIndexes[t.id];h===void 0&&(h=this.layerIndexes[t.id]=new wc);let g=!1;const _={};h.handleWrapJump(l);for(const T of n){const I=T.getBucket(t);I&&t.id===I.layerIds[0]&&(I.bucketInstanceId||(I.bucketInstanceId=++this.maxBucketInstanceId),h.addBucket(T.tileID,I,this.crossTileIDs)&&(g=!0),_[I.bucketInstanceId]=!0)}return h.removeStaleBuckets(_)&&(g=!0),g}pruneUnusedLayers(t){const n={};t.forEach((l=>{n[l]=!0}));for(const l in this.layerIndexes)n[l]||delete this.layerIndexes[l]}}var ii="void main() {fragColor=vec4(1.0);}";const ur={prelude:ht(`#ifdef GL_ES 3precision mediump float; 4#else 5#if !defined(lowp) 6#define lowp 7#endif 8#if !defined(mediump) 9#define mediump 10#endif 11#if !defined(highp) 12#define highp 13#endif 14#endif 15out highp vec4 fragColor;`,`#ifdef GL_ES 16precision highp float; 17#else 18#if !defined(lowp) 19#define lowp 20#endif 21#if !defined(mediump) 22#define mediump 23#endif 24#if !defined(highp) 25#define highp 26#endif 27#endif 28vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 29);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
29return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c 30);} 31#ifdef TERRAIN3D 32uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; 33#endif 34const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { 35#ifdef TERRAIN3D 36highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 37#else 38return 1.0; 39#endif 40}float calculate_visibility(vec4 pos) { 41#ifdef TERRAIN3D 42vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; 43#else 44return 1.0; 45#endif 46}float ele(vec2 pos) { 47#ifdef TERRAIN3D 48vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 49#else 50return 0.0; 51#endif 52}float get_elevation(vec2 pos) { 53#ifdef TERRAIN3D 54#ifdef GLOBE 55if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} 56#endif 57vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; 58#else 59return 0.0; 60#endif 61}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:ht("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:ht("",`#define GLOBE_RADIUS 6371008.8 62uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos 63);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); 64if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len 65);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:ht(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity; 66#ifdef OVERDRAW_INSPECTOR 67fragColor=vec4(1.0); 68#endif 69}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:ht(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
69uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity; 70#ifdef OVERDRAW_INSPECTOR 71fragColor=vec4(1.0); 72#endif 73}`,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ht(`in vec3 v_data;in float v_visibility; 74#pragma mapbox: define highp vec4 color 75#pragma mapbox: define mediump float radius 76#pragma mapbox: define lowp float blur 77#pragma mapbox: define lowp float opacity 78#pragma mapbox: define highp vec4 stroke_color 79#pragma mapbox: define mediump float stroke_width 80#pragma mapbox: define lowp float stroke_opacity 81void main() { 82#pragma mapbox: initialize highp vec4 color 83#pragma mapbox: initialize mediump float radius 84#pragma mapbox: initialize lowp float blur 85#pragma mapbox: initialize lowp float opacity 86#pragma mapbox: initialize highp vec4 stroke_color 87#pragma mapbox: initialize mediump float stroke_width 88#pragma mapbox: initialize lowp float stroke_opacity 89vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;} 90#ifdef OVERDRAW_INSPECTOR 91fragColor=vec4(1.0); 92#endif 93}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility; 94#pragma mapbox: define highp vec4 color 95#pragma mapbox: define mediump float radius 96#pragma mapbox: define lowp float blur 97#pragma mapbox: define lowp float opacity 98#pragma mapbox: define highp vec4 stroke_color 99#pragma mapbox: define mediump float stroke_width 100#pragma mapbox: define lowp float stroke_opacity 101void main(void) { 102#pragma mapbox: initialize highp vec4 color 103#pragma mapbox: initialize mediump float radius 104#pragma mapbox: initialize lowp float blur 105#pragma mapbox: initialize lowp float opacity 106#pragma mapbox: initialize highp vec4 stroke_color 107#pragma mapbox: initialize mediump float stroke_width 108#pragma mapbox: initialize lowp float stroke_opacity 109vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { 110#ifdef GLOBE 111vec3 center_vector=projectToSphere(circle_center); 112#endif 113float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { 114#ifdef GLOBE 115vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); 116#else 117vec4 projected_center=projectTileWithElevation(circle_center,ele); 118#endif 119corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} 120#ifdef GLOBE 121vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); 122#else 123gl_Position=projectTileWithElevation(corner_position,ele); 124#endif 125} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:ht(ii,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:ht(`uniform highp float u_intensity;in vec2 v_extrude; 126#pragma mapbox: define highp float weight 127#define GAUSS_COEF 0.3989422804014327 128void main() { 129#pragma mapbox: initialize highp float weight 130float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); 131#ifdef OVERDRAW_INSPECTOR 132fragColor=vec4(1.0); 133#endif 134}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude; 135#pragma mapbox: define highp float weight 136#pragma mapbox: define mediump float radius 137const highp float ZERO=1.0/255.0/16.0; 138#define GAUSS_COEF 0.3989422804014327 139void main(void) { 140#pragma mapbox: initialize highp float weight 141#pragma mapbox: initialize mediump float radius 142vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0); 143#ifdef GLOBE 144vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); 145#else 146gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); 147#endif 148}`),heatmapTexture:ht(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; 149#ifdef OVERDRAW_INSPECTOR 150fragColor=vec4(0.0); 151#endif 152}`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ht("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ht("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:ht(`#ifdef GL_ES 153precision highp float; 154#endif 155uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else 156{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); 157#ifdef OVERDRAW_INSPECTOR 158fragColor=vec4(1.0); 159#endif 160}`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:ht("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:ht(ii,`in vec2 a_pos;void main() { 161#ifdef GLOBE 162gl_Position=projectTileFor3D(a_pos,0.0); 163#else 164gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); 165#endif 166}`),fill:ht(`#pragma mapbox: define highp vec4 color 167#pragma mapbox: define lowp float opacity 168void main() { 169#pragma mapbox: initialize highp vec4 color 170#pragma mapbox: initialize lowp float opacity 171fragColor=color*opacity; 172#ifdef OVERDRAW_INSPECTOR 173fragColor=vec4(1.0); 174#endif 175}`,`uniform vec2 u_fill_translate;in vec2 a_pos; 176#pragma mapbox: define highp vec4 color 177#pragma mapbox: define lowp float opacity 178void main() { 179#pragma mapbox: initialize highp vec4 color 180#pragma mapbox: initialize lowp float opacity 181gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:ht(`in vec2 v_pos; 182#ifdef GLOBE 183in float v_depth; 184#endif 185#pragma mapbox: define highp vec4 outline_color 186#pragma mapbox: define lowp float opacity 187void main() { 188#pragma mapbox: initialize highp vec4 outline_color 189#pragma mapbox: initialize lowp float opacity 190float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); 191#ifdef GLOBE 192if (v_depth > 1.0) {discard;} 193#endif 194#ifdef OVERDRAW_INSPECTOR 195fragColor=vec4(1.0); 196#endif 197}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos; 198#ifdef GLOBE 199out float v_depth; 200#endif 201#pragma mapbox: define highp vec4 outline_color 202#pragma mapbox: define lowp float opacity 203void main() { 204#pragma mapbox: initialize highp vec4 outline_color 205#pragma mapbox: initialize lowp float opacity 206gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 207#ifdef GLOBE 208v_depth=gl_Position.z/gl_Position.w; 209#endif 210}`),fillOutlinePattern:ht(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; 211#ifdef GLOBE 212in float v_depth; 213#endif 214#pragma mapbox: define lowp float opacity 215#pragma mapbox: define lowp vec4 pattern_from 216#pragma mapbox: define lowp vec4 pattern_to 217void main() { 218#pragma mapbox: initialize lowp float opacity 219#pragma mapbox: initialize mediump vec4 pattern_from 220#pragma mapbox: initialize mediump vec4 pattern_to 221vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity; 222#ifdef GLOBE 223if (v_depth > 1.0) {discard;} 224#endif 225#ifdef OVERDRAW_INSPECTOR 226fragColor=vec4(1.0); 227#endif 228}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; 229#ifdef GLOBE 230out float v_depth; 231#endif 232#pragma mapbox: define lowp float opacity 233#pragma mapbox: define lowp vec4 pattern_from 234#pragma mapbox: define lowp vec4 pattern_to 235#pragma mapbox: define lowp float pixel_ratio_from 236#pragma mapbox: define lowp float pixel_ratio_to 237void main() { 238#pragma mapbox: initialize lowp float opacity 239#pragma mapbox: initialize mediump vec4 pattern_from 240#pragma mapbox: initialize mediump vec4 pattern_to 241#pragma mapbox: initialize lowp float pixel_ratio_from 242#pragma mapbox: initialize lowp float pixel_ratio_to 243vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 244#ifdef GLOBE 245v_depth=gl_Position.z/gl_Position.w; 246#endif 247}`),fillPattern:ht(`#ifdef GL_ES 248precision highp float; 249#endif 250uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; 251#pragma mapbox: define lowp float opacity 252#pragma mapbox: define lowp vec4 pattern_from 253#pragma mapbox: define lowp vec4 pattern_to 254void main() { 255#pragma mapbox: initialize lowp float opacity 256#pragma mapbox: initialize mediump vec4 pattern_from 257#pragma mapbox: initialize mediump vec4 pattern_to 258vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity; 259#ifdef OVERDRAW_INSPECTOR 260fragColor=vec4(1.0); 261#endif 262}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; 263#pragma mapbox: define lowp float opacity 264#pragma mapbox: define lowp vec4 pattern_from 265#pragma mapbox: define lowp vec4 pattern_to 266#pragma mapbox: define lowp float pixel_ratio_from 267#pragma mapbox: define lowp float pixel_ratio_to 268void main() { 269#pragma mapbox: initialize lowp float opacity 270#pragma mapbox: initialize mediump vec4 pattern_from 271#pragma mapbox: initialize mediump vec4 pattern_to 272#pragma mapbox: initialize lowp float pixel_ratio_from 273#pragma mapbox: initialize lowp float pixel_ratio_to 274vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_siz
274e_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:ht(`in vec4 v_color;void main() {fragColor=v_color; 275#ifdef OVERDRAW_INSPECTOR 276fragColor=vec4(1.0); 277#endif 278}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed; 279#ifdef TERRAIN3D 280in vec2 a_centroid; 281#endif 282out vec4 v_color; 283#pragma mapbox: define highp float base 284#pragma mapbox: define highp float height 285#pragma mapbox: define highp vec4 color 286void main() { 287#pragma mapbox: initialize highp float base 288#pragma mapbox: initialize highp float height 289#pragma mapbox: initialize highp vec4 color 290vec3 normal=a_normal_ed.xyz; 291#ifdef TERRAIN3D 292float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 293#else 294float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 295#endif 296base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 297#ifdef GLOBE 298vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 299#else 300gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 301#endif 302float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); 303#ifdef GLOBE 304mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); 305#endif 306directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:ht(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; 307#pragma mapbox: define lowp float base 308#pragma mapbox: define lowp float height 309#pragma mapbox: define lowp vec4 pattern_from 310#pragma mapbox: define lowp vec4 pattern_to 311#pragma mapbox: define lowp float pixel_ratio_from 312#pragma mapbox: define lowp float pixel_ratio_to 313void main() { 314#pragma mapbox: initialize lowp float base 315#pragma mapbox: initialize lowp float height 316#pragma mapbox: initialize mediump vec4 pattern_from 317#pragma mapbox: initialize mediump vec4 pattern_to 318#pragma mapbox: initialize lowp float pixel_ratio_from 319#pragma mapbox: initialize lowp float pixel_ratio_to 320vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; 321#ifdef OVERDRAW_INSPECTOR 322fragColor=vec4(1.0); 323#endif 324}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed; 325#ifdef TERRAIN3D 326in vec2 a_centroid; 327#endif 328#ifdef GLOBE 329out vec3 v_sphere_pos; 330#endif 331out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; 332#pragma mapbox: define lowp float base 333#pragma mapbox: define lowp float height 334#pragma mapbox: define lowp vec4 pattern_from 335#pragma mapbox: define lowp vec4 pattern_to 336#pragma mapbox: define lowp float pixel_ratio_from 337#pragma mapbox: define lowp float pixel_ratio_to 338void main() { 339#pragma mapbox: initialize lowp float base 340#pragma mapbox: initialize lowp float height 341#pragma mapbox: initialize mediump vec4 pattern_from 342#pragma mapbox: initialize mediump vec4 pattern_to 343#pragma mapbox: initialize lowp float pixel_ratio_from 344#pragma mapbox: initialize lowp float pixel_ratio_to 345vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; 346#ifdef TERRAIN3D 347float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 348#else 349float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 350#endif 351base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 352#ifdef GLOBE 353vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 354#else 355gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 356#endif 357vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 358? a_pos 359: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:ht(`#ifdef GL_ES 360precision highp float; 361#endif 362uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
362ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); 363#ifdef OVERDRAW_INSPECTOR 364fragColor=vec4(1.0); 365#endif 366}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ht(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; 367#define PI 3.141592653589793 368#define STANDARD 0 369#define COMBINED 1 370#define IGOR 2 371#define MULTIDIRECTIONAL 3 372#define BASIC 4 373float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else 374{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else 375{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} 376#ifdef OVERDRAW_INSPECTOR 377fragColor=vec4(1.0); 378#endif 379}`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:ht(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; 380#ifdef GLOBE 381in float v_depth; 382#endif 383#pragma mapbox: define highp vec4 color 384#pragma mapbox: define lowp float blur 385#pragma mapbox: define lowp float opacity 386void main() { 387#pragma mapbox: initialize highp vec4 color 388#pragma mapbox: initialize lowp float blur 389#pragma mapbox: initialize lowp float opacity 390float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity); 391#ifdef GLOBE 392if (v_depth > 1.0) {discard;} 393#endif 394#ifdef OVERDRAW_INSPECTOR 395fragColor=vec4(1.0); 396#endif 397}`,` 398#define scale 0.015873016 399in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; 400#ifdef GLOBE 401out float v_depth; 402#endif 403#pragma mapbox: define highp vec4 color 404#pragma mapbox: define lowp float blur 405#pragma mapbox: define lowp float opacity 406#pragma mapbox: define mediump float gapwidth 407#pragma mapbox: define lowp float offset 408#pragma mapbox: define mediump float width 409void main() { 410#pragma mapbox: initialize highp vec4 color 411#pragma mapbox: initialize lowp float blur 412#pragma mapbox: initialize lowp float opacity 413#pragma mapbox: initialize mediump float gapwidth 414#pragma mapbox: initialize lowp float offset 415#pragma mapbox: initialize mediump float width 416float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
416float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 417#ifdef GLOBE 418v_depth=gl_Position.z/gl_Position.w; 419#endif 420#ifdef TERRAIN3D 421v_gamma_scale=1.0; 422#else 423float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 424#endif 425v_width2=vec2(outset,inset);}`),lineGradient:ht(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; 426#ifdef GLOBE 427in float v_depth; 428#endif 429#pragma mapbox: define lowp float blur 430#pragma mapbox: define lowp float opacity 431void main() { 432#pragma mapbox: initialize lowp float blur 433#pragma mapbox: initialize lowp float opacity 434float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); 435#ifdef GLOBE 436if (v_depth > 1.0) {discard;} 437#endif 438#ifdef OVERDRAW_INSPECTOR 439fragColor=vec4(1.0); 440#endif 441}`,` 442#define scale 0.015873016 443in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; 444#ifdef GLOBE 445out float v_depth; 446#endif 447#pragma mapbox: define lowp float blur 448#pragma mapbox: define lowp float opacity 449#pragma mapbox: define mediump float gapwidth 450#pragma mapbox: define lowp float offset 451#pragma mapbox: define mediump float width 452void main() { 453#pragma mapbox: initialize lowp float blur 454#pragma mapbox: initialize lowp float opacity 455#pragma mapbox: initialize mediump float gapwidth 456#pragma mapbox: initialize lowp float offset 457#pragma mapbox: initialize mediump float width 458float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 459#ifdef GLOBE 460v_depth=gl_Position.z/gl_Position.w; 461#endif 462#ifdef TERRAIN3D 463v_gamma_scale=1.0; 464#else 465float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 466#endif 467v_width2=vec2(outset,inset);}`),linePattern:ht(`#ifdef GL_ES 468precision highp float; 469#endif 470uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width; 471#ifdef GLOBE 472in float v_depth; 473#endif 474#pragma mapbox: define lowp vec4 pattern_from 475#pragma mapbox: define lowp vec4 pattern_to 476#pragma mapbox: define lowp float pixel_ratio_from 477#pragma mapbox: define lowp float pixel_ratio_to 478#pragma mapbox: define lowp float blur 479#pragma mapbox: define lowp float opacity 480void main() { 481#pragma mapbox: initialize mediump vec4 pattern_from 482#pragma mapbox: initialize mediump vec4 pattern_to 483#pragma mapbox: initialize lowp float pixel_ratio_from 484#pragma mapbox: initialize lowp float pixel_ratio_to 485#pragma mapbox: initialize lowp float blur 486#pragma mapbox: initialize lowp float opacity 487vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; 488#ifdef GLOBE 489if (v_depth > 1.0) {discard;} 490#endif 491#ifdef OVERDRAW_INSPECTOR 492fragColor=vec4(1.0); 493#endif 494}`,` 495#define scale 0.015873016 496#define LINE_DISTANCE_SCALE 2.0 497in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width; 498#ifdef GLOBE 499out float v_depth; 500#endif 501#pragma mapbox: define lowp float blur 502#pragma mapbox: define lowp float opacity 503#pragma mapbox: define lowp float offset 504#pragma mapbox: define mediump float gapwidth 505#pragma mapbox: define mediump float width 506#pragma mapbox: define lowp float floorwidth 507#pragma mapbox: define lowp vec4 pattern_from 508#pragma mapbox: define lowp vec4 pattern_to 509#pragma mapbox: define lowp float pixel_ratio_from 510#pragma mapbox: define lowp float pixel_ratio_to 511void main() { 512#pragma mapbox: initialize lowp float blur 513#pragma mapbox: initialize lowp float opacity 514#pragma mapbox: initialize lowp float offset 515#pragma mapbox: initialize mediump float gapwidth 516#pragma mapbox: initialize mediump float width 517#pragma mapbox: initialize lowp float floorwidth 518#pragma mapbox: initialize mediump vec4 pattern_from 519#pragma mapbox: initialize mediump vec4 pattern_to 520#pragma mapbox: initialize lowp float pixel_ratio_from 521#pragma mapbox: initialize lowp float pixel_ratio_to 522float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
522float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 523#ifdef GLOBE 524v_depth=gl_Position.z/gl_Position.w; 525#endif 526#ifdef TERRAIN3D 527v_gamma_scale=1.0; 528#else 529float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 530#endif 531v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ht(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; 532#ifdef GLOBE 533in float v_depth; 534#endif 535#pragma mapbox: define highp vec4 color 536#pragma mapbox: define lowp float blur 537#pragma mapbox: define lowp float opacity 538#pragma mapbox: define mediump float width 539#pragma mapbox: define lowp float floorwidth 540#pragma mapbox: define mediump vec4 dasharray_from 541#pragma mapbox: define mediump vec4 dasharray_to 542void main() { 543#pragma mapbox: initialize highp vec4 color 544#pragma mapbox: initialize lowp float blur 545#pragma mapbox: initialize lowp float opacity 546#pragma mapbox: initialize mediump float width 547#pragma mapbox: initialize lowp float floorwidth 548#pragma mapbox: initialize mediump vec4 dasharray_from 549#pragma mapbox: initialize mediump vec4 dasharray_to 550float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
550float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); 551#ifdef GLOBE 552if (v_depth > 1.0) {discard;} 553#endif 554#ifdef OVERDRAW_INSPECTOR 555fragColor=vec4(1.0); 556#endif 557}`,` 558#define scale 0.015873016 559#define LINE_DISTANCE_SCALE 2.0 560in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; 561#ifdef GLOBE 562out float v_depth; 563#endif 564#pragma mapbox: define highp vec4 color 565#pragma mapbox: define lowp float blur 566#pragma mapbox: define lowp float opacity 567#pragma mapbox: define mediump float gapwidth 568#pragma mapbox: define lowp float offset 569#pragma mapbox: define mediump float width 570#pragma mapbox: define lowp float floorwidth 571#pragma mapbox: define mediump vec4 dasharray_from 572#pragma mapbox: define mediump vec4 dasharray_to 573void main() { 574#pragma mapbox: initialize highp vec4 color 575#pragma mapbox: initialize lowp float blur 576#pragma mapbox: initialize lowp float opacity 577#pragma mapbox: initialize mediump float gapwidth 578#pragma mapbox: initialize lowp float offset 579#pragma mapbox: initialize mediump float width 580#pragma mapbox: initialize lowp float floorwidth 581#pragma mapbox: initialize mediump vec4 dasharray_from 582#pragma mapbox: initialize mediump vec4 dasharray_to 583float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 584#ifdef GLOBE 585v_depth=gl_Position.z/gl_Position.w; 586#endif 587#ifdef TERRAIN3D 588v_gamma_scale=1.0; 589#else 590float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 591#endif 592float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:ht(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; 593#ifdef GLOBE 594in float v_depth; 595#endif 596#pragma mapbox: define lowp float blur 597#pragma mapbox: define lowp float opacity 598#pragma mapbox: define mediump float width 599#pragma mapbox: define lowp float floorwidth 600#pragma mapbox: define mediump vec4 dasharray_from 601#pragma mapbox: define mediump vec4 dasharray_to 602void main() { 603#pragma mapbox: initialize lowp float blur 604#pragma mapbox: initialize lowp float opacity 605#pragma mapbox: initialize mediump float width 606#pragma mapbox: initialize lowp float floorwidth 607#pragma mapbox: initialize mediump vec4 dasharray_from 608#pragma mapbox: initialize mediump vec4 dasharray_to 609float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
609float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); 610#ifdef GLOBE 611if (v_depth > 1.0) {discard;} 612#endif 613#ifdef OVERDRAW_INSPECTOR 614fragColor=vec4(1.0); 615#endif 616}`,` 617#define scale 0.015873016 618#define LINE_DISTANCE_SCALE 2.0 619in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; 620#ifdef GLOBE 621out float v_depth; 622#endif 623#pragma mapbox: define lowp float blur 624#pragma mapbox: define lowp float opacity 625#pragma mapbox: define mediump float gapwidth 626#pragma mapbox: define lowp float offset 627#pragma mapbox: define mediump float width 628#pragma mapbox: define lowp float floorwidth 629#pragma mapbox: define mediump vec4 dasharray_from 630#pragma mapbox: define mediump vec4 dasharray_to 631void main() { 632#pragma mapbox: initialize lowp float blur 633#pragma mapbox: initialize lowp float opacity 634#pragma mapbox: initialize mediump float gapwidth 635#pragma mapbox: initialize lowp float offset 636#pragma mapbox: initialize mediump float width 637#pragma mapbox: initialize lowp float floorwidth 638#pragma mapbox: initialize mediump vec4 dasharray_from 639#pragma mapbox: initialize mediump vec4 dasharray_to 640float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 641#ifdef GLOBE 642v_depth=gl_Position.z/gl_Position.w; 643#endif 644#ifdef TERRAIN3D 645v_gamma_scale=1.0; 646#else 647float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 648#endif 649float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:ht(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 650#ifdef OVERDRAW_INSPECTOR 651fragColor=vec4(1.0); 652#endif 653}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5; 654#ifdef GLOBE 655if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;} 656#endif 657v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:ht(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity; 658#pragma mapbox: define lowp float opacity 659void main() { 660#pragma mapbox: initialize lowp float opacity 661lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha; 662#ifdef OVERDRAW_INSPECTOR 663fragColor=vec4(1.0); 664#endif 665}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity; 666#pragma mapbox: define lowp float opacity 667void main() { 668#pragma mapbox: initialize lowp float opacity 669vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 670camera_to_anchor_distance/u_camera_to_center_distance : 671u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 672#ifdef GLOBE 673if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 674#endif 675vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ht(`#define SDF_PX 8.0 676uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; 677#pragma mapbox: define highp vec4 fill_color 678#pragma mapbox: define highp vec4 halo_color 679#pragma mapbox: define lowp float opacity 680#pragma mapbox: define lowp float halo_width 681#pragma mapbox: define lowp float halo_blur 682void main() { 683#pragma mapbox: initialize highp vec4 fill_color 684#pragma mapbox: initialize highp vec4 halo_color 685#pragma mapbox: initialize lowp float opacity 686#pragma mapbox: initialize lowp float halo_width 687#pragma mapbox: initialize lowp float halo_blur 688float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity); 689#ifdef OVERDRAW_INSPECTOR 690fragColor=vec4(1.0); 691#endif 692}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1; 693#pragma mapbox: define highp vec4 fill_color 694#pragma mapbox: define highp vec4 halo_color 695#pragma mapbox: define lowp float opacity 696#pragma mapbox: define lowp float halo_width 697#pragma mapbox: define lowp float halo_blur 698void main() { 699#pragma mapbox: initialize highp vec4 fill_color 700#pragma mapbox: initialize highp vec4 halo_color 701#pragma mapbox: initialize lowp float opacity 702#pragma mapbox: initialize lowp float halo_width 703#pragma mapbox: initialize lowp float halo_blur 704vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 705camera_to_anchor_distance/u_camera_to_center_distance : 706u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 707#ifdef GLOBE 708if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 709#endif 710vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ht(`#define SDF_PX 8.0 711#define SDF 1.0 712#define ICON 0.0 713uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1; 714#pragma mapbox: define highp vec4 fill_color 715#pragma mapbox: define highp vec4 halo_color 716#pragma mapbox: define lowp float opacity 717#pragma mapbox: define lowp float halo_width 718#pragma mapbox: define lowp float halo_blur 719void main() { 720#pragma mapbox: initialize highp vec4 fill_color 721#pragma mapbox: initialize highp vec4 halo_color 722#pragma mapbox: initialize lowp float opacity 723#pragma mapbox: initialize lowp float halo_width 724#pragma mapbox: initialize lowp float halo_blur 725float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
725fragColor=texture(u_texture_icon,tex_icon)*alpha; 726#ifdef OVERDRAW_INSPECTOR 727fragColor=vec4(1.0); 728#endif 729return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity); 730#ifdef OVERDRAW_INSPECTOR 731fragColor=vec4(1.0); 732#endif 733}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1; 734#pragma mapbox: define highp vec4 fill_color 735#pragma mapbox: define highp vec4 halo_color 736#pragma mapbox: define lowp float opacity 737#pragma mapbox: define lowp float halo_width 738#pragma mapbox: define lowp float halo_blur 739void main() { 740#pragma mapbox: initialize highp vec4 fill_color 741#pragma mapbox: initialize highp vec4 halo_color 742#pragma mapbox: initialize lowp float opacity 743#pragma mapbox: initialize lowp float halo_width 744#pragma mapbox: initialize lowp float halo_blur 745vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 746camera_to_anchor_distance/u_camera_to_center_distance : 747u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; 748#ifdef GLOBE 749if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 750#endif 751vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:ht("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
751float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ht("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ht("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:ht("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:ht(`#ifdef GL_ES 752precision highp float; 753#endif 754in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 755);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:ht("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
vendor: 10,849 bytes, lines 755-804
755function ht(m,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,l=t.match(/in ([\w]+) ([\w]+)/g),h=m.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_=g?g.concat(h):h,T={};return{fragmentSource:m=m.replace(n,((I,A,C,R,L)=>(T[L]=!0,A==="define"?` 756#ifndef HAS_UNIFORM_u_${L} 757in ${C} ${R} ${L}; 758#else 759uniform ${C} ${R} u_${L}; 760#endif 761`:` 762#ifdef HAS_UNIFORM_u_${L} 763 ${C} ${R} ${L} = u_${L}; 764#endif 765`))),vertexSource:t=t.replace(n,((I,A,C,R,L)=>{const O=R==="float"?"vec2":"vec4",$=L.match(/color/)?"color":O;return T[L]?A==="define"?` 766#ifndef HAS_UNIFORM_u_${L} 767uniform lowp float u_${L}_t; 768in ${C} ${O} a_${L}; 769out ${C} ${R} ${L}; 770#else 771uniform ${C} ${R} u_${L}; 772#endif 773`:$==="vec4"?` 774#ifndef HAS_UNIFORM_u_${L} 775 ${L} = a_${L}; 776#else 777 ${C} ${R} ${L} = u_${L}; 778#endif 779`:` 780#ifndef HAS_UNIFORM_u_${L} 781 ${L} = unpack_mix_${$}(a_${L}, u_${L}_t); 782#else 783 ${C} ${R} ${L} = u_${L}; 784#endif 785`:A==="define"?` 786#ifndef HAS_UNIFORM_u_${L} 787uniform lowp float u_${L}_t; 788in ${C} ${O} a_${L}; 789#else 790uniform ${C} ${R} u_${L}; 791#endif 792`:$==="vec4"?` 793#ifndef HAS_UNIFORM_u_${L} 794 ${C} ${R} ${L} = a_${L}; 795#else 796 ${C} ${R} ${L} = u_${L}; 797#endif 798`:` 799#ifndef HAS_UNIFORM_u_${L} 800 ${C} ${R} ${L} = unpack_mix_${$}(a_${L}, u_${L}_t); 801#else 802 ${C} ${R} ${L} = u_${L}; 803#endif 804`})),staticAttributes:l,staticUniforms:_}}class Wt{constructor(t,n,l){this.vertexBuffer=t,this.indexBuffer=n,this.segments=l}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Wn=s.aU([{name:"a_pos",type:"Int16",components:2}]);const mi="#define PROJECTION_MERCATOR",Ei="mercator";class gi{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ei}get shaderDefine(){return mi}get shaderPreludeCode(){return ur.projectionMercator}get vertexShaderPreludeCode(){return ur.projectionMercator.vertexSource}get subdivisionGranularity(){return s.aV.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,n,l,h,g){if(this._cachedMesh)return this._cachedMesh;const _=new s.aW;_.emplaceBack(0,0),_.emplaceBack(s.a5,0),_.emplaceBack(0,s.a5),_.emplaceBack(s.a5,s.a5);const T=t.createVertexBuffer(_,Wn.members),I=s.aX.simpleSegment(0,0,4,2),A=new s.aY;A.emplaceBack(1,0,2),A.emplaceBack(1,2,3);const C=t.createIndexBuffer(A);return this._cachedMesh=new Wt(T,C,I),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class eo{constructor(t=0,n=0,l=0,h=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(l)||l<0||isNaN(h)||h<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=l,this.right=h}interpolate(t,n,l){return n.top!=null&&t.top!=null&&(this.top=s.G.number(t.top,n.top,l)),n.bottom!=null&&t.bottom!=null&&(this.bottom=s.G.number(t.bottom,n.bottom,l)),n.left!=null&&t.left!=null&&(this.left=s.G.number(t.left,n.left,l)),n.right!=null&&t.right!=null&&(this.right=s.G.number(t.right,n.right,l)),this}getCenter(t,n){const l=s.an((this.left+t-this.right)/2,0,t),h=s.an((this.top+n-this.bottom)/2,0,n);return new s.P(l,h)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new eo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Hn(m,t){if(!m.renderWorldCopies||m.lngRange)return;const n=t.lng-m.center.lng;t.lng+=n>180?-360:n<-180?360:0}function xr(m){return Math.max(0,Math.floor(m))}class ya{constructor(t,n){var l;this.applyConstrain=(h,g)=>this._constrainOverride!==null?this._constrainOverride(h,g):this._callbacks.defaultConstrain(h,g),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=n?.renderWorldCopies===void 0||!!n?.renderWorldCopies,this._minZoom=n?.minZoom||0,this._maxZoom=n?.maxZoom||22,this._minPitch=n?.minPitch==null?0:n?.minPitch,this._maxPitch=n?.maxPitch==null?60:n?.maxPitch,this._constrainOverride=(l=n?.constrainOverride)!==null&&l!==void 0?l:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new s.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=xr(this._zoom),this._scale=s.aq(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new eo,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,n,l){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=xr(this._zoom),this._scale=s.aq(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new eo(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!l&&t.autoCalculateNearFarZ,n&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const n=s.W(t,-180,180)*Math.PI/180;var l,h,g,_,T,I,A,C,R;this._bearingInRadians!==n&&(this._unmodified=!1,this._bearingInRadians=n,this._calcMatrices(),this._rotationMatrix=N(),l=this._rotationMatrix,g=-this._bearingInRadians,_=(h=this._rotationMatrix)[0],T=h[1],I=h[2],A=h[3],C=Math.sin(g),R=Math.cos(g),l[0]=_*R+I*C,l[1]=T*R+A*C,l[2]=_*-C+I*R,l[3]=T*-C+A*R)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const n=s.an(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==n&&(this._unmodified=!1,this._pitchInRadians=n,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const n=t/180*Math.PI;this._rollInRadians!==n&&(this._unmodified=!1,this._rollInRadians=n,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return s.aZ(this._fovInRadians)}setFov(t){t=s.an(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=s.ap(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const n=this.applyConstrain(this._center,t).zoom;this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this._tileZoom=Math.max(0,Math.floor(n)),this._scale=s.aq(n),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,n){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=n,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,l){this._unmodified=!1,this._edgeInsets.interpolate(t,n,l),this.constrainInternal(),this._calcMatrices()}resize(t,n,l=!0){this._width=t,this._height=n,l&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new dr([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-s.ao,s.ao])}getCameraQueryGeometry(t,n){if(n.length===1)return[n[0],t];{const{minX:l,minY:h,maxX:g,maxY:_}=s.aa.fromPoints(n).extend(t);return[new s.P(l,h),new s.P(g,h),new s.P(g,_),new s.P(l,_),new s.P(l,h)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:n,zoom:l}=this.applyConstrain(this.center,this.zoom);this.setCenter(n),this.setZoom(l),this._unmodified=t,this._constraining=!1}
804_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=s.ar(new Float64Array(16));s.Q(t,t,[this._width/2,-this._height/2,1]),s.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=s.ar(new Float64Array(16)),s.Q(t,t,[1,-1,1]),s.O(t,t,[-1,-1,0]),s.Q(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,n,l,h){const g=l!==void 0?l:this.bearing,_=h=h!==void 0?h:this.pitch,{distanceToCenter:T,clampedElevation:I}=this._distanceToCenterFromAltElevationPitch(n,this.elevation,_),{x:A,y:C}=qt(_,g),R=s.a9.fromLngLat(t,n);let L,O,$=s.a_(1,R.y),X=0;do{if(X+=1,X>10)break;O=T/$,L=new s.a9(R.x+A*O,R.y+C*O),$=1/L.meterInMercatorCoordinateUnits()}while(Math.abs(T-O*$)>1e-12);return{center:L.toLngLat(),elevation:I,zoom:s.at(this.height/2/Math.tan(this.fovInRadians/2)/O/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const n=1/this.worldSize,l=s.as(1,this.center.lat)*this.worldSize,h=s.a9.fromLngLat(this.center,this.elevation),g=h.x/n,_=h.y/n,T=h.z/n,I=this.pitch,A=this.bearing,{x:C,y:R,z:L}=qt(I,A),O=this.cameraToCenterDistance,$=g+O*-C,X=_+O*-R,K=T+O*L,{distanceToCenter:Y,clampedElevation:ee}=this._distanceToCenterFromAltElevationPitch(K/l,t,I),oe=Y*l,J=new s.a9(($+C*oe)*n,(X+R*oe)*n,0).toLngLat(),ne=s.as(1,J.lat),ce=s.at(this.height/2/Math.tan(this.fovInRadians/2)/Y/ne/this.tileSize);this._elevation=ee,this._center=J,this.setZoom(ce)}_distanceToCenterFromAltElevationPitch(t,n,l){const h=-Math.cos(s.ap(l)),g=t-n;let _,T=n;return h*g>=0||Math.abs(h)<.1?(_=1e4,T=t+_*h):_=-g/h,{distanceToCenter:_,clampedElevation:T}}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=s.as(1,this.center.lat)*this.worldSize;return we(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const n=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/n,t.canonical.y/n,1/n/s.a5,1/n/s.a5]}}class gn{constructor(t,n){this.min=t,this.max=n,this.center=s.a$([],s.b0([],this.min,this.max),.5)}quadrant(t){const n=[t%2==0,t<2],l=s.b1(this.min),h=s.b1(this.max);for(let g=0;g<n.length;g++)l[g]=n[g]?this.min[g]:this.center[g],h[g]=n[g]?this.center[g]:this.max[g];return h[2]=this.max[2],new gn(l,h)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let n=!0;for(let l=0;l<t.planes.length;l++){const h=this.intersectsPlane(t.planes[l]);if(h===0)return 0;h===1&&(n=!1)}return n?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let n=t[3],l=t[3];for(let h=0;h<3;h++)t[h]>0?(n+=t[h]*this.min[h],l+=t[h]*this.max[h]):(l+=t[h]*this.min[h],n+=t[h]*this.max[h]);return n>=0?2:l<0?0:1}}class il{distanceToTile2d(t,n,l,h){const g=h.distanceX([t,n]),_=h.distanceY([t,n]);return Math.hypot(g,_)}getWrap(t,n,l){return l}getTileBoundingVolume(t,n,l,h){var g,_;let T=0,I=0;if(h?.terrain){const C=new s.a2(t.z,n,t.z,t.x,t.y),R=h.terrain.getMinMaxElevation(C);T=(g=R.minElevation)!==null&&g!==void 0?g:Math.min(0,l),I=(_=R.maxElevation)!==null&&_!==void 0?_:Math.max(0,l)}const A=1<<t.z;return new gn([n+t.x/A,t.y/A,T],[n+(t.x+1)/A,(t.y+1)/A,I])}allowVariableZoom(t,n){const l=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,h=s.an(78.5-l/2,0,60);return!!n.terrain||t.pitch>h}allowWorldCopies(){return!0}prepareNextFrame(){}}class Si{constructor(t,n,l){this.points=t,this.planes=n,this.aabb=l}static fromInvProjectionMatrix(t,n=1,l=0,h,g){const _=g?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],T=
vendor: 50,381 bytes, line 804
804Math.pow(2,l),I=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((L=>(function(O,$,X,K){const Y=s.aH([],O,$),ee=1/Y[3]/X*K;return s.b6(Y,Y,[ee,ee,1/Y[3],ee])})(L,t,n,T)));h&&(function(L,O,$,X){const K=X?4:0,Y=X?0:4;let ee=0;const oe=[],J=[];for(let ie=0;ie<4;ie++){const fe=s.b2([],L[ie+Y],L[ie+K]),Ae=s.b7(fe);s.a$(fe,fe,1/Ae),oe.push(Ae),J.push(fe)}for(let ie=0;ie<4;ie++){const fe=s.b8(L[ie+K],J[ie],$);ee=fe!==null&&fe>=0?Math.max(ee,fe):Math.max(ee,oe[ie])}const ne=(function(ie,fe){const Ae=s.b2([],ie[fe[0]],ie[fe[1]]),be=s.b2([],ie[fe[2]],ie[fe[1]]),Te=[0,0,0,0];return s.b3(Te,s.b4([],Ae,be)),Te[3]=-s.b5(Te,ie[fe[0]]),Te})(L,O),ce=(function(ie,fe){const Ae=s.b9(ie),be=s.ba([],ie,1/Ae),Te=s.b2([],fe,s.a$([],be,s.b5(fe,be))),Se=s.b9(Te);if(Se>0){const Ve=Math.sqrt(1-be[3]*be[3]),Ue=s.a$([],be,-be[3]),Fe=s.b0([],Ue,s.a$([],Te,Ve/Se));return s.bb(fe,Fe)}return null})($,ne);if(ce!==null){const ie=ce/s.b5(J[0],ne);ee=Math.min(ee,ie)}for(let ie=0;ie<4;ie++){const fe=Math.min(ee,oe[ie]);L[ie+Y]=[L[ie+K][0]+J[ie][0]*fe,L[ie+K][1]+J[ie][1]*fe,L[ie+K][2]+J[ie][2]*fe,1]}})(I,_[0],h,g);const A=_.map((L=>{const O=s.b2([],I[L[0]],I[L[1]]),$=s.b2([],I[L[2]],I[L[1]]),X=s.b3([],s.b4([],O,$)),K=-s.b5(X,I[L[1]]);return X.concat(K)})),C=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],R=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const L of I)for(let O=0;O<3;O++)C[O]=Math.min(C[O],L[O]),R[O]=Math.max(R[O],L[O]);return new Si(I,A,new gn(C,R))}}class _a{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,l){return this._helper.interpolatePadding(t,n,l)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,l=!0){this._helper.resize(t,n,l)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,n){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(n,l)=>{l=s.an(+l,this.minZoom,this.maxZoom);const h={center:new s.V(n.lng,n.lat),zoom:l};let g=this._helper._lngRange;if(!this._helper._renderWorldCopies&&g===null){const J=179.9999999999;g=[-J,J]}const _=this.tileSize*s.aq(h.zoom);let T=0,I=_,A=0,C=_,R=0,L=0;const{x:O,y:$}=this.size;if(this._helper._latRange){const J=this._helper._latRange;T=s.X(J[1])*_,I=s.X(J[0])*_,I-T<$&&(R=$/(I-T))}g&&(A=s.W(s.Y(g[0])*_,0,_),C=s.W(s.Y(g[1])*_,0,_),C<A&&(C+=_),C-A<O&&(L=O/(C-A)));const{x:X,y:K}=nt(_,n);let Y,ee;const oe=Math.max(L||0,R||0);if(oe){const J=new s.P(L?(C+A)/2:X,R?(I+T)/2:K);return h.center=ft(_,J).wrap(),h.zoom+=s.at(oe),h}if(this._helper._latRange){const J=$/2;K-J<T&&(ee=T+J),K+J>I&&(ee=I-J)}if(g){const J=(A+C)/2;let ne=X;this._helper._renderWorldCopies&&(ne=s.W(X,J-_/2,J+_/2));const ce=O/2;ne-ce<A&&(Y=A+ce),ne+ce>C&&(Y=C-ce)}if(Y!==void 0||ee!==void 0){const J=new s.P(Y??X,ee??K);h.center=ft(_,J).wrap()}return h},this.applyConstrain=(n,l)=>this._helper.applyConstrain(n,l),this._helper=new ya({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,l)=>this.defaultConstrain(n,l)},t),this._coveringTilesDetailsProvider=new il}clone(){const t=new _a;return t.apply(this,!1),t}apply(t,n,l){this._helper.apply(t,n,l)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){const n=[new s.bc(0,t)];if(this._helper._renderWorldCopies){const l=this.screenPointToMercatorCoordinate(new s.P(0,0)),h=this.screenPointToMercatorCoordinate(new s.P(this._helper._width,0)),g=this.screenPointToMercatorCoordinate(new s.P(this._helper._width,this._helper._height)),_=this.screenPointToMercatorCoordinate(new s.P(0,this._helper._height)),T=Math.floor(Math.min(l.x,h.x,g.x,_.x)),I=Math.floor(Math.max(l.x,h.x,g.x,_.x)),A=1;for(let C=T-A;C<=I+A;C++)C!==0&&n.push(new s.bc(C,t))}return n}getCameraFrustum(){return Si.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const n=this.screenPointToLocation(this.centerPoint,t),l=t?t.getElevationForLngLatZoom(n,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(l)}setLocationAtPoint(t,n){const l=s.as(this.elevation,this.center.lat),h=this.screenPointToMercatorCoordinateAtZ(n,l),g=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,l),_=s.a9.fromLngLat(t),T=new s.a9(_.x-(h.x-g.x),_.y-(h.y-g.y));this.setCenter(T?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,n){return n?this.coordinatePoint(s.a9.fromLngLat(t),n.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(s.a9.fromLngLat(t))}screenPointToLocation(t,n){var l;return(l=this.screenPointToMercatorCoordinate(t,n))===null||l===void 0?void 0:l.toLngLat()}screenPointToMercatorCoordinate(t,n){if(n){const l=n.pointCoordinate(t);if(l!=null)return l}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,n){const l=n||0,h=[t.x,t.y,0,1],g=[t.x,t.y,1,1];s.aH(h,h,this._pixelMatrixInverse),s.aH(g,g,this._pixelMatrixInverse);const _=h[3],T=g[3],I=h[1]/_,A=g[1]/T,C=h[2]/_,R=g[2]/T,L=C===R?0:(l-C)/(R-C);return new s.a9(s.G.number(h[0]/_,g[0]/T,L)/this.worldSize,s.G.number(I,A,L)/this.worldSize,l)}coordinatePoint(t,n=0,l=this._pixelMatrix){const h=[t.x*this.worldSize,t.y*this.worldSize,n,1];return s.aH(h,h,l),new s.P(h[0]/h[3],h[1]/h[3])}getBounds(){const t=Math.max(0,this._helper._height/2-Ut(this));return new dr().extend(this.screenPointToLocation(new s.P(0,t))).extend(this.screenPointToLocation(new s.P(this._helper._width,t))).extend(this.screenPointToLocation(new s.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new s.P(0,this._helper._height)))}isPointOnMapSurface(t,n){return n?n.pointCoordinate(t)!=null:t.y>this.height/2-Ut(this)}calculatePosMatrix(t,n=!1,l){var h;const g=(h=t.key)!==null&&h!==void 0?h:s.bd(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),_=n?this._alignedPosMatrixCache:this._posMatrixCache;if(_.has(g)){const A=_.get(g);return l?A.f32:A.f64}const T=Lt(t,this.worldSize);s.S(T,n?this._alignedProjMatrix:this._viewProjMatrix,T);const I={f64:T,f32:new Float32Array(T)};return _.set(g,I),l?I.f32:I.f64}calculateFogMatrix(t){const n=t.key,l=this._fogMatrixCacheF32;if(l.has(n))return l.get(n);const h=Lt(t,this.worldSize);return s.S(h,this._fogMatrix,h),l.set(n,new Float32Array(h)),l.get(n)}calculateCenterFromCameraLngLatAlt(t,n,l,h){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,l,h)}_calculateNearFarZIfNeeded(t,n,l){if(!this._helper.autoCalculateNearFarZ)return;const h=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),g=t-h*this._helper._pixelPerMeter/Math.cos(n),_=h<0?g:t,T=Math.PI/2+this.pitchInRadians,I=s.ap(this.fov)*(Math.abs(Math.cos(s.ap(this.roll)))*this.height+Math.abs(Math.sin(s.ap(this.roll)))*this.width)/this.height*(.5+l.y/this.height),A=Math.sin(I)*_/Math.sin(s.an(Math.PI-T-I,.01,Math.PI-.01)),C=Ut(this),R=Math.atan(C/this._helper.cameraToCenterDistance),L=s.ap(.75),O=R>L?2*R*(.5+l.y/(2*C)):L,$=Math.sin(O)*_/Math.sin(s.an(Math.PI-T-O,.01,Math.PI-.01)),X=Math.min(A,$);this._helper._farZ=1.01*(Math.cos(Math.PI/2-n)*X+_),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,n=nt(this.worldSize,this.center),l=n.x,h=n.y;this._helper._pixelPerMeter=s.as(1,this.center.lat)*this.worldSize;const g=s.ap(Math.min(this.pitch,Je)),_=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(g));let T;this._calculateNearFarZIfNeeded(_,g,t),T=new Float64Array(16),s.be(T,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),s.aB(this._invProjMatrix,T),T[8]=2*-t.x/this._helper._width,T[9]=2*t.y/this._helper._height,this._projectionMatrix=s.bf(T),s.Q(T,T,[1,-1,1]),s.O(T,T,[0,0,-this._helper.cameraToCenterDistance]),s.bg(T,T,-this.rollInRadians),s.bh(T,T,this.pitchInRadians),s.bg(T,T,-this.bearingInRadians),s.O(T,T,[-l,-h,0]),this._mercatorMatrix=s.Q([],T,[this.worldSize,this.worldSize,this.worldSize]),s.Q(T,T,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=s.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,T),s.O(T,T,[0,0,-this.elevation]),this._viewProjMatrix=T,this._invViewProjMatrix=s.aB([],T);const I=[0,0,-1,1];s.aH(I,I,this._invViewProjMatrix),this._cameraPosition=[I[0]/I[3],I[1]/I[3],I[2]/I[3]],this._fogMatrix=new Float64Array(16),s.be(this._fogMatrix,this.fovInRadians,this.width/this.height,_,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,s.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),s.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),s.bg(this._fogMatrix,this._fogMatrix,-this.rollInRadians),s.bh(this._fogMatrix,this._fogMatrix,this.pitchInRadians),s.bg(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),s.O(this._fogMatrix,this._fogMatrix,[-l,-h,0]),s.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),s.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=s.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,T);const A=this._helper._width%2/2,C=this._helper._height%2/2,R=Math.cos(this.bearingInRadians),L=Math.sin(-this.bearingInRadians),O=l-Math.round(l)+R*A+L*C,$=h-Math.round(h)+R*C+L*A,X=new Float64Array(T);if(s.O(X,X,[O>.5?O-1:O,$>.5?$-1:$,0]),this._alignedProjMatrix=X,T=s.aB(new Float64Array(16),this._pixelMatrix),!T)throw new Error("failed to invert matrix");this._pixelMatrixInverse=T,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new s.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return s.aH(n,n,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=s.as(1,this.center.lat)*this.worldSize;return we(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,n){const l=s.a9.fromLngLat(t),h=[l.x*this.worldSize,l.y*this.worldSize,n,1];return s.aH(h,h,this._viewProjMatrix),h[2]/h[3]}getProjectionData(t){const{overscaledTileID:n,aligned:l,applyTerrainMatrix:h}=t,g=this._helper.getMercatorTileCoordinates(n),_=n?this.calculatePosMatrix(n,l,!0):null;let T;return T=n&&n.terrainRttPosMatrix32f&&h?n.terrainRttPosMatrix32f:_||s.bi(),{mainMatrix:T,tileMercatorCoords:g,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:T}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,n,l){return 1}transformLightDirection(t){return s.b1(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,n,l,h){const g=this.calculatePosMatrix(l);let _;h?(_=[t,n,h(t,n),1],s.aH(_,_,g)):(_=[t,n,0,1],el(_,_,g));const T=_[3];return{point:new s.P(_[0]/T,_[1]/T),signedDistanceFromCamera:T,isOccluded:!1}}populateCache(t){for(const n of t)this.calculatePosMatrix(n)}getMatrixForModel(t,n){const l=s.a9.fromLngLat(t,n),h=l.meterInMercatorCoordinateUnits(),g=s.bj();return s.O(g,g,[l.x,l.y,l.z]),s.bg(g,g,Math.PI),s.bh(g,g,Math.PI/2),s.Q(g,g,[-h,h,h]),g}getProjectionDataForCustomLayer(t=!0){const n=new s.a2(0,0,0,0,0),l=this.getProjectionData({overscaledTileID:n,applyGlobeMatrix:t}),h=Lt(n,this.worldSize);s.S(h,this._viewProjMatrix,h),l.tileMercatorCoords=[0,0,1,1];const g=[s.a5,s.a5,this.worldSize/this._helper.pixelsPerMeter],_=s.bk();return s.Q(_,h,g),l.fallbackMatrix=_,l.mainMatrix=_,l}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function En(){s.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function uh(m){if(m.useSlerp)if(m.k<1){const t=s.bl(m.startEulerAngles.roll,m.startEulerAngles.pitch,m.startEulerAngles.bearing),n=s.bl(m.endEulerAngles.roll,m.endEulerAngles.pitch,m.endEulerAngles.bearing),l=new Float64Array(4);s.bm(l,t,n,m.k);const h=s.bn(l);m.tr.setRoll(h.roll),m.tr.setPitch(h.pitch),m.tr.setBearing(h.bearing)}else m.tr.setRoll(m.endEulerAngles.roll),m.tr.setPitch(m.endEulerAngles.pitch),m.tr.setBearing(m.endEulerAngles.bearing);else m.tr.setRoll(s.G.number(m.startEulerAngles.roll,m.endEulerAngles.roll,m.k)),m.tr.setPitch(s.G.number(m.startEulerAngles.pitch,m.endEulerAngles.pitch,m.k)),m.tr.setBearing(s.G.number(m.startEulerAngles.bearing,m.endEulerAngles.bearing,m.k))}function Tc(m,t,n,l,h){const g=h.padding,_=nt(h.worldSize,n.getNorthWest()),T=nt(h.worldSize,n.getNorthEast()),I=nt(h.worldSize,n.getSouthEast()),A=nt(h.worldSize,n.getSouthWest()),C=s.ap(-l),R=_.rotate(C),L=T.rotate(C),O=I.rotate(C),$=A.rotate(C),X=new s.P(Math.max(R.x,L.x,$.x,O.x),Math.max(R.y,L.y,$.y,O.y)),K=new s.P(Math.min(R.x,L.x,$.x,O.x),Math.min(R.y,L.y,$.y,O.y)),Y=X.sub(K),ee=(h.width-(g.left+g.right+t.left+t.right))/Y.x,oe=(h.height-(g.top+g.bottom+t.top+t.bottom))/Y.y;if(oe<0||ee<0)return void En();const J=Math.min(s.at(h.scale*Math.min(ee,oe)),m.maxZoom),ne=s.P.convert(m.offset),ce=new s.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(s.ap(l)),ie=ne.add(ce).mult(h.scale/s.aq(J));return{center:ft(h.worldSize,_.add(I).div(2).sub(ie)),zoom:J,bearing:l}}class va{get useGlobeControls(){return!1}handlePanInertia(t,n){const l=t.mag(),h=Math.abs(Ut(n));return{easingOffset:t.mult(Math.min(.75*h/l,1)),easingCenter:n.center}}handleMapControlsRollPitchBearingZoom(t,n){t.bearingDelta&&n.setBearing(n.bearing+t.bearingDelta),t.pitchDelta&&n.setPitch(n.pitch+t.pitchDelta),t.rollDelta&&n.setRoll(n.roll+t.rollDelta),t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta)}handleMapControlsPan(t,n,l){t.around.distSqr(n.centerPoint)<.01||n.setLocationAtPoint(l,t.around)}cameraForBoxAndBearing(t,n,l,h,g){return Tc(t,n,l,h,g)}handleJumpToCenterZoom(t,n){t.zoom!==(n.zoom!==void 0?+n.zoom:t.zoom)&&t.setZoom(+n.zoom),n.center!==void 0&&t.setCenter(s.V.convert(n.center))}handleEaseTo(t,n){const l=t.zoom,h=t.padding,g={roll:t.roll,pitch:t.pitch,bearing:t.bearing},_={roll:n.roll===void 0?t.roll:n.roll,pitch:n.pitch===void 0?t.pitch:n.pitch,bearing:n.bearing===void 0?t.bearing:n.bearing},T=n.zoom!==void 0,I=!t.isPaddingEqual(n.padding);let A=!1;const C=T?+n.zoom:t.zoom;let R=t.centerPoint.add(n.offsetAsPoint);const L=t.screenPointToLocation(R),{center:O,zoom:$}=t.applyConstrain(s.V.convert(n.center||L),C??l);Hn(t,O);const X=nt(t.worldSize,L),K=nt(t.worldSize,O).sub(X),Y=s.aq($-l);return A=$!==l,{easeFunc:ee=>{if(A&&t.setZoom(s.G.number(l,$,ee)),s.bo(g,_)||uh({startEulerAngles:g,endEulerAngles:_,tr:t,k:ee,useSlerp:g.roll!=_.roll}),I&&(t.interpolatePadding(h,n.padding,ee),R=t.centerPoint.add(n.offsetAsPoint)),n.around)t.setLocationAtPoint(n.around,n.aroundPoint);else{const oe=s.aq(t.zoom-l),J=$>l?Math.min(2,Y):Math.max(.5,Y),ne=Math.pow(J,1-ee),ce=ft(t.worldSize,X.add(K.mult(ee*ne)).mult(oe));t.setLocationAtPoint(t.renderWorldCopies?ce.wrap():ce,R)}},isZooming:A,elevationCenter:O}}handleFlyTo(t,n){const l=n.zoom!==void 0,h=t.zoom,g=t.applyConstrain(s.V.convert(n.center||n.locationAtOffset),l?+n.zoom:h),_=g.center,T=g.zoom;Hn(t,_);const I=nt(t.worldSize,n.locationAtOffset),A=nt(t.worldSize,_).sub(I),C=A.mag(),R=s.aq(T-h);let L;if(n.minZoom!==void 0){const O=Math.min(+n.minZoom,h,T),$=t.applyConstrain(_,O).zoom;L=s.aq($-h)}return{easeFunc:(O,$,X,K)=>{t.setZoom(O===1?T:h+s.at($));const Y=O===1?_:ft(t.worldSize,I.add(A.mult(X)).mult($));t.setLocationAtPoint(t.renderWorldCopies?Y.wrap():Y,K)},scaleOfZoom:R,targetCenter:_,scaleOfMinZoom:L,pixelPathLength:C}}}class Ht{constructor(t,n,l){this.blendFunction=t,this.blendColor=n,this.mask=l}}Ht.Replace=[1,0],Ht.disabled=new Ht(Ht.Replace,s.bp.transparent,[!1,!1,!1,!1]),Ht.unblended=new Ht(Ht.Replace,s.bp.transparent,[!0,!0,!0,!0]),Ht.alphaBlended=new Ht([1,771],s.bp.transparent,[!0,!0,!0,!0]);const to=2305;class Ct{constructor(t,n,l){this.enable=t,this.mode=n,this.frontFace=l}}Ct.disabled=new Ct(!1,1029,to),Ct.backCCW=new Ct(!0,1029,to),Ct.frontCCW=new Ct(!0,1028,to);class _t{constructor(t,n,l){this.func=t,this.mask=n,this.range=l}}_t.ReadOnly=!1,_t.ReadWrite=!0,_t.disabled=new _t(519,_t.ReadOnly,[0,1]);const ro=7680;class Dt{constructor(t,n,l,h,g,_){this.test=t,this.ref=n,this.mask=l,this.fail=h,this.depthFail=g,this.pass=_}}Dt.disabled=new Dt({func:519,mask:0},0,0,ro,ro,ro);const Xo=new WeakMap;function Oi(m){var t;if(Xo.has(m))return Xo.get(m);{const n=(t=m.getParameter(m.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return Xo.set(m,n),n}}class io{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;const n=t.context,l=n.gl;this._texFormat=l.RGBA,this._texType=l.UNSIGNED_BYTE;const h=new s.aW;h.emplaceBack(-1,-1),h.emplaceBack(2,-1),h.emplaceBack(-1,2);const g=new s.aY;g.emplaceBack(0,1,2),this._fullscreenTriangle=new Wt(n.createVertexBuffer(h,Wn.members),n.createIndexBuffer(g),s.aX.simpleSegment(0,0,h.length,g.length)),this._resultBuffer=new Uint8Array(4),n.activeTexture.set(l.TEXTURE1);const _=l.createTexture();l.bindTexture(l.TEXTURE_2D,_),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texImage2D(l.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=n.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(_),Oi(l)&&(this._pbo=l.createBuffer(),l.bindBuffer(l.PIXEL_PACK_BUFFER,this._pbo),l.bufferData(l.PIXEL_PACK_BUFFER,4,l.STREAM_READ),l.bindBuffer(l.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,n){const l=this._updateCount;return this._readbackQueue?l>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():l>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,n),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,n=t.gl;t.activeTexture.set(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,n){const l=this._cachedRenderContext.context,h=l.gl;if(this._bindFramebuffer(),l.viewport.set([0,0,this._texWidth,this._texHeight]),l.clear({color:s.bp.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(l,h.TRIANGLES,_t.disabled,Dt.disabled,Ht.unblended,Ct.disabled,((g,_)=>({u_input:g,u_output_expected:_}))(t,n),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&Oi(h)){h.bindBuffer(h.PIXEL_PACK_BUFFER,this._pbo),h.readBuffer(h.COLOR_ATTACHMENT0),h.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const g=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);h.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:g}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&Oi(t)){const n=t.clientWaitSync(this._readbackQueue.sync,0,0);if(n===t.WAIT_FAILED)return s.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(n===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=io._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let n=0;return n+=t[0]/256,n+=t[1]/65536,n+=t[2]/16777216,t[3]<127&&(n=-n),n/128}}const Xn=s.a5/128;function hh(m,t){const n=m.granularity!==void 0?Math.max(m.granularity,1):1,l=n+(m.generateBorders?2:0),h=n+(m.extendToNorthPole||m.generateBorders?1:0)+(m.extendToSouthPole||m.generateBorders?1:0),g=l+1,_=h+1,T=m.generateBorders?-1:0,I=m.generateBorders||m.extendToNorthPole?-1:0,A=n+(m.generateBorders?1:0),C=n+(m.generateBorders||m.extendToSouthPole?1:0),R=g*_,L=l*h*6,O=g*_>65536;if(O&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const $=O||t==="32bit",X=new Int16Array(2*R);let K=0;for(let oe=I;oe<=C;oe++)for(let J=T;J<=A;J++){let ne=J/n*s.a5;J===-1&&(ne=-Xn),J===n+1&&(ne=s.a5+Xn);let ce=oe/n*s.a5;oe===-1&&(ce=m.extendToNorthPole?s.br:-Xn),oe===n+1&&(ce=m.extendToSouthPole?s.bs:s.a5+Xn),X[K++]=ne,X[K++]=ce}const Y=$?new Uint32Array(L):new Uint16Array(L);let ee=0;for(let oe=0;oe<h;oe++)for(let J=0;J<l;J++){const ne=J+1+oe*g,ce=J+(oe+1)*g,ie=J+1+(oe+1)*g;Y[ee++]=J+oe*g,Y[ee++]=ce,Y[ee++]=ne,Y[ee++]=ne,Y[ee++]=ce,Y[ee++]=ie}return{vertices:X.buffer.slice(0),indices:Y.buffer.slice(0),uses32bitIndices:$}}const Yo=new s.aV({fill:new s.bt(128,2),line:new s.bt(512,0),tile:new s.bt(128,32),stencil:new s.bt(128,1),circle:3});class Sc{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return ur.projectionGlobe}get vertexShaderPreludeCode(){return ur.projectionMercator.vertexSource}get subdivisionGranularity(){return Yo}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new io(t));const n=s.X(this._errorQueryLatitudeDegrees),l=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI,h=this._errorMeasurement.updateErrorLoop(n,l),g=me();h!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=h,this._errorMeasurementLastChangeTime=g);const _=Math.min(Math.max((g-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=s.bu(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,s.bv(_))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,n,l,h,g){const _=(g==="stencil"?Yo.stencil:Yo.tile).getGranularityForZoomLevel(n.z);return this._getMesh(t,{granularity:_,generateBorders:l,extendToNorthPole:n.y===0&&h,extendToSouthPole:n.y===(1<<n.z)-1&&h})}_getMesh(t,n){const l=this._getMeshKey(n);if(l in this._tileMeshCache)return this._tileMeshCache[l];const h=(function(g,_){const T=hh(_,"16bit"),I=s.aW.deserialize({arrayBuffer:T.vertices,length:T.vertices.byteLength/2/2}),A=s.aY.deserialize({arrayBuffer:T.indices,length:T.indices.byteLength/2/3});return new Wt(g.createVertexBuffer(I,Wn.members),g.createIndexBuffer(A),s.aX.simpleSegment(0,0,I.length,A.length))})(t,n);return this._tileMeshCache[l]=h,h}recalculate(t){}hasTransition(){const t=me();let n=!1;return n=n||(t-this._errorMeasurementLastChangeTime)/1e3<.7,n=n||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,n}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const Id=new s.t({type:new s.D(s.u.projection.type)});class ph extends s.E{constructor(t){super(),this._transitionable=new s.x(Id,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new s.H(0)),this._mercatorProjection=new gi,this._verticalPerspectiveProjection=new Sc}get transitionState(){const t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof s.bw){if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,n,l,h,g){return this.currentProjection.getMeshFromTileID(t,n,l,h,g)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function yi(m){const t=xa(m.worldSize,m.center.lat);return 2*Math.PI*t}function yn(m,t,n,l,h){const g=1/(1<<h),_=t/s.a5*g+l*g,T=s.by((m/s.a5*g+n*g)*Math.PI*2+Math.PI,2*Math.PI),I=2*Math.atan(Math.exp(Math.PI-_*Math.PI*2))-.5*Math.PI,A=Math.cos(I),C=new Float64Array(3);return C[0]=Math.sin(T)*A,C[1]=Math.sin(I),C[2]=Math.cos(T)*A,C}function ar(m){return(function(t,n){const l=Math.cos(n),h=new Float64Array(3);return h[0]=Math.sin(t)*l,h[1]=Math.sin(n),h[2]=Math.cos(t)*l,h})(m.lng*Math.PI/180,m.lat*Math.PI/180)}function xa(m,t){return m/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Mc(m){const t=Math.asin(m[1])/Math.PI*180,n=Math.sqrt(m[0]*m[0]+m[2]*m[2]);if(n>1e-6){const l=m[0]/n,h=Math.acos(m[2]/n),g=(l>0?h:-h)/Math.PI*180;return new s.V(s.W(g,-180,180),t)}return new s.V(0,t)}function Ko(m){return Math.cos(m*Math.PI/180)}function gr(m,t){const n=Ko(m),l=Ko(t);return s.at(l/n)}function dh(m,t){const n=m.rotate(t.bearingInRadians),l=t.zoom+gr(t.center.lat,0),h=s.bu(1/Ko(t.center.lat),1/Ko(Math.min(Math.abs(t.center.lat),60)),s.bx(l,7,3,0,1)),g=360/yi({worldSize:t.worldSize,center:{lat:t.center.lat}});return new s.V(t.center.lng-n.x*g*h,s.an(t.center.lat+n.y*g,-s.ao,s.ao))}function Ic(m){const t=.5*m,n=Math.sin(t),l=Math.cos(t);return Math.log(n+l)-Math.log(l-n)}function fh(m,t,n,l){const h=m.lat+n*l;if(Math.abs(n)>1){const g=(Math.sign(m.lat+n)!==Math.sign(m.lat)?-Math.abs(m.lat):Math.abs(m.lat))*Math.PI/180,_=Math.abs(m.lat+n)*Math.PI/180,T=Ic(g+l*(_-g)),I=Ic(g),A=Ic(_);return new s.V(m.lng+t*((T-I)/(A-I)),h)}return new s.V(m.lng+t*l,h)}class Pd{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,n,l,h){const g=`${t.z}_${t.x}_${t.y}_${h?.terrain?"t":""}`,_=this._cache.get(g);if(_)return _;const T=this._cachePrevious.get(g);if(T)return this._cache.set(g,T),T;const I=this._boundingVolumeFactory(t,n,l,h);return this._cache.set(g,I),this._hadAnyChanges=!0,I}}class no{constructor(t,n,l,h){this.min=l,this.max=h,this.points=t,this.planes=n}static fromAabb(t,n){const l=[];for(let h=0;h<8;h++)l.push([1&~h?t[0]:n[0],(h>>1&1)==1?n[1]:t[1],(h>>2&1)==1?n[2]:t[2]]);return new no(l,[[-1,0,0,n[0]],[1,0,0,-t[0]],[0,-1,0,n[1]],[0,1,0,-t[1]],[0,0,-1,n[2]],[0,0,1,-t[2]]],t,n)}static fromCenterSizeAngles(t,n,l){const h=s.bB([],l[0],l[1],l[2]),g=s.bC([],[n[0],0,0],h),_=s.bC([],[0,n[1],0],h),T=s.bC([],[0,0,n[2]],h),I=[...t],A=[...t];for(let R=0;R<8;R++)for(let L=0;L<3;L++){const O=t[L]+g[L]*(1&~R?-1:1)+_[L]*((R>>1&1)==1?1:-1)+T[L]*((R>>2&1)==1?1:-1);I[L]=Math.min(I[L],O),A[L]=Math.max(A[L],O)}const C=[];for(let R=0;R<8;R++){const L=[...t];s.b0(L,L,s.a$([],g,1&~R?-1:1)),s.b0(L,L,s.a$([],_,(R>>1&1)==1?1:-1)),s.b0(L,L,s.a$([],T,(R>>2&1)==1?1:-1)),C.push(L)}return new no(C,[[...g,-s.b5(g,C[0])],[..._,-s.b5(_,C[0])],[...T,-s.b5(T,C[0])],[-g[0],-g[1],-g[2],-s.b5(g,C[7])],[-_[0],-_[1],-_[2],-s.b5(_,C[7])],[-T[0],-T[1],-T[2],-s.b5(T,C[7])]],I,A)}intersectsFrustum(t){let n=!0;const l=this.points.length,h=this.planes.length,g=t.planes.length,_=t.points.length;for(let T=0;T<g;T++){const I=t.planes[T];let A=0;for(let C=0;C<l;C++){const R=this.points[C];I[0]*R[0]+I[1]*R[1]+I[2]*R[2]+I[3]>=0&&A++}if(A===0)return 0;A<l&&(n=!1)}if(n)return 2;for(let T=0;T<h;T++){const I=this.planes[T];let A=0;for(let C=0;C<_;C++){const R=t.points[C];I[0]*R[0]+I[1]*R[1]+I[2]*R[2]+I[3]>=0&&A++}if(A===0)return 0}return 1}intersectsPlane(t){const n=this.points.length;let l=0;for(let h=0;h<n;h++){const g=this.points[h];t[0]*g[0]+t[1]*g[1]+t[2]*g[2]+t[3]>=0&&l++}return l===n?2:l===0?0:1}}function nl(m,t,n){const l=m-t;return l<0?-l:Math.max(0,l-n)}function ao(m,t,n,l,h){const g=m-n;let _;return _=g<0?Math.min(-g,1+g-h):g>1?Math.min(Math.max(g-h,0),1-g):0,Math.max(_,nl(t,l,h))}class Pc{constructor(){this._boundingVolumeCache=new Pd(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,n,l,h){const g=1<<l.z,_=1/g,T=l.x/g,I=l.y/g;let A=2;return A=Math.min(A,ao(t,n,T,I,_)),A=Math.min(A,ao(t,n,T+.5,-I-_,_)),A=Math.min(A,ao(t,n,T+.5,2-I-_,_)),A}getWrap(t,n,l){const h=1<<n.z,g=1/h,_=n.x/h,T=nl(t.x,_,g),I=nl(t.x,_-1,g),A=nl(t.x,_+1,g),C=Math.min(T,I,A);return C===A?1:C===I?-1:0}allowVariableZoom(t,n){return rr(t,n)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,n,l,h){return this._boundingVolumeCache.getTileBoundingVolume(t,n,l,h)}_computeTileBoundingVolume(t,n,l,h){var g,_;let T=0,I=0;if(h?.terrain){const A=new s.a2(t.z,n,t.z,t.x,t.y),C=h.terrain.getMinMaxElevation(A);T=(g=C.minElevation)!==null&&g!==void 0?g:Math.min(0,l),I=(_=C.maxElevation)!==null&&_!==void 0?_:Math.max(0,l)}if(T/=s.bE,I/=s.bE,T+=1,I+=1,t.z<=0)return no.fromAabb([-I,-I,-I],[I,I,I]);if(t.z===1)return no.fromAabb([t.x===0?-I:0,t.y===0?0:-I,-I],[t.x===0?0:I,t.y===0?I:0,I]);{const A=[yn(0,0,t.x,t.y,t.z),yn(s.a5,0,t.x,t.y,t.z),yn(s.a5,s.a5,t.x,t.y,t.z),yn(0,s.a5,t.x,t.y,t.z)],C=[];for(const Te of A)C.push(s.a$([],Te,I));if(I!==T)for(const Te of A)C.push(s.a$([],Te,T));t.y===0&&C.push([0,1,0]),t.y===(1<<t.z)-1&&C.push([0,-1,0]);const R=[1,1,1],L=[-1,-1,-1];for(const Te of C)for(let Se=0;Se<3;Se++)R[Se]=Math.min(R[Se],Te[Se]),L[Se]=Math.max(L[Se],Te[Se]);const O=yn(s.a5/2,s.a5/2,t.x,t.y,t.z),$=s.b4([],[0,1,0],O);s.b3($,$);const X=s.b4([],O,$);s.b3(X,X);const K=s.b4([],A[2],A[1]);s.b3(K,K);const Y=s.b4([],A[0],A[3]);s.b3(Y,Y),C.push(s.a$([],O,I)),t.y>=(1<<t.z)/2&&C.push(s.a$([],yn(s.a5/2,0,t.x,t.y,t.z),I)),t.y<(1<<t.z)/2&&C.push(s.a$([],yn(s.a5/2,s.a5,t.x,t.y,t.z),I));const ee=Jo(O,C),oe=Jo(X,C),J=[-O[0],-O[1],-O[2],ee.max],ne=[O[0],O[1],O[2],-ee.min],ce=[-X[0],-X[1],-X[2],oe.max],ie=[X[0],X[1],X[2],-oe.min],fe=[...K,0],Ae=[...Y,0],be=[];return t.y===0?be.push(s.bD(Ae,fe,J),s.bD(Ae,fe,ne)):be.push(s.bD(ce,fe,J),s.bD(ce,fe,ne),s.bD(ce,Ae,J),s.bD(ce,Ae,ne)),t.y===(1<<t.z)-1?be.push(s.bD(Ae,fe,J),s.bD(Ae,fe,ne)):be.push(s.bD(ie,fe,J),s.bD(ie,fe,ne),s.bD(ie,Ae,J),s.bD(ie,Ae,ne)),new no(be,[J,ne,ce,ie,fe,Ae],R,L)}}}function Jo(m,t){let n=1/0,l=-1/0;for(const h of t){const g=s.b5(m,h);n=Math.min(n,g),l=Math.max(l,g)}return{min:n,max:l}}class oo{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,l){return this._helper.interpolatePadding(t,n,l)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n){this._helper.resize(t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=s.bF(),this._projectionMatrix=s.bj(),this._globeViewProjMatrix32f=s.bi(),this._globeViewProjMatrixNoCorrection=s.bj(),this._globeViewProjMatrixNoCorrectionInverted=s.bj(),this._globeProjMatrixInverted=s.bj(),this._cameraPosition=s.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(n,l)=>{const h=s.an(n.lat,-s.ao,s.ao),g=s.an(+l,this.minZoom+gr(0,h),this.maxZoom);return{center:new s.V(n.lng,h),zoom:g}},this.applyConstrain=(n,l)=>this._helper.applyConstrain(n,l),this._helper=new ya({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,l)=>this.defaultConstrain(n,l)},t),this._coveringTilesDetailsProvider=new Pc}clone(){const t=new oo;return t.apply(this,!1),t}apply(t,n,l){this._globeLatitudeErrorCorrectionRadians=l||0,this._helper.apply(t,n)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=s.bz();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:n,applyGlobeMatrix:l}=t,h=this._helper.getMercatorTileCoordinates(n);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:h,clippingPlane:this._cachedClippingPlane,projectionTransition:l?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const n=this.pitchInRadians,l=this.cameraToCenterDistance/t,h=Math.sin(n)*l,g=Math.cos(n)*l+1,_=1/Math.sqrt(h*h+g*g)*1;let T=-h,I=g;const A=Math.sqrt(T*T+I*I);T/=A,I/=A;const C=[0,T,I];s.bG(C,C,[0,0,0],-this.bearingInRadians),s.bH(C,C,[0,0,0],-1*this.center.lat*Math.PI/180),s.bI(C,C,[0,0,0],this.center.lng*Math.PI/180);const R=1/s.b7(C);return s.a$(C,C,R),[...C,-_*R]}isLocationOccluded(t){return!this.isSurfacePointVisible(ar(t))}transformLightDirection(t){const n=this._helper._center.lng*Math.PI/180,l=this._helper._center.lat*Math.PI/180,h=Math.cos(l),g=[Math.sin(n)*h,Math.sin(l),Math.cos(n)*h],_=[g[2],0,-g[0]],T=[0,0,0];s.b4(T,_,g),s.b3(_,_),s.b3(T,T);const I=[0,0,0];return s.b3(I,[_[0]*t[0]+T[0]*t[1]+g[0]*t[2],_[1]*t[0]+T[1]*t[1]+g[1]*t[2],_[2]*t[0]+T[2]*t[1]+g[2]*t[2]]),I}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,n,l){const h=(function(T,I,A){const C=1/(1<<A.z);return new s.a9(T/s.a5*C+A.x*C,I/s.a5*C+A.y*C)})(t,n,l.canonical),g=(_=h.y,[s.by(h.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-_*Math.PI*2))-.5*Math.PI]);var _;return this.getCircleRadiusCorrection()/Math.cos(g[1])}projectTileCoordinates(t,n,l,h){const g=l.canonical,_=yn(t,n,g.x,g.y,g.z),T=1+(h?h(t,n):0)/s.bE,I=[_[0]*T,_[1]*T,_[2]*T,1];s.aH(I,I,this._globeViewProjMatrixNoCorrection);const A=this._cachedClippingPlane,C=A[0]*_[0]+A[1]*_[1]+A[2]*_[2]+A[3]<0;return{point:new s.P(I[0]/I[3],I[1]/I[3]),signedDistanceFromCamera:I[3],isOccluded:C}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=xa(this.worldSize,this.center.lat),n=s.bk(),l=s.bk();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),s.be(n,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const h=this.centerOffset;n[8]=2*-h.x/this._helper._width,n[9]=2*h.y/this._helper._height,this._projectionMatrix=s.bf(n),this._globeProjMatrixInverted=s.bk(),s.aB(this._globeProjMatrixInverted,n),s.O(n,n,[0,0,-this.cameraToCenterDistance]),s.bg(n,n,this.rollInRadians),s.bh(n,n,-this.pitchInRadians),s.bg(n,n,this.bearingInRadians),s.O(n,n,[0,0,-t]);const g=s.bz();g[0]=t,g[1]=t,g[2]=t,s.bh(l,n,this.center.lat*Math.PI/180),s.bJ(l,l,-this.center.lng*Math.PI/180),s.Q(l,l,g),this._globeViewProjMatrixNoCorrection=l,s.bh(n,n,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),s.bJ(n,n,-this.center.lng*Math.PI/180),s.Q(n,n,g),this._globeViewProjMatrix32f=new Float32Array(n),this._globeViewProjMatrixNoCorrectionInverted=s.bk(),s.aB(this._globeViewProjMatrixNoCorrectionInverted,l);const _=s.bz();this._cameraPosition=s.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/t,s.bG(this._cameraPosition,this._cameraPosition,_,-this.rollInRadians),s.bH(this._cameraPosition,this._cameraPosition,_,this.pitchInRadians),s.bG(this._cameraPosition,this._cameraPosition,_,-this.bearingInRadians),s.b0(this._cameraPosition,this._cameraPosition,[0,0,1]),s.bH(this._cameraPosition,this._cameraPosition,_,-this.center.lat*Math.PI/180),s.bI(this._cameraPosition,this._cameraPosition,_,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const T=s.bf(this._globeViewProjMatrixNoCorrectionInverted);s.Q(T,T,[1,1,-1]),this._cachedFrustum=Si.fromInvProjectionMatrix(T,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){s.w("calculateFogMatrix is not supported on globe projection.");const n=s.bk();return s.ar(n),n}getVisibleUnwrappedCoordinates(t){return[new s.bc(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&s.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,n){if(!this._globeViewProjMatrixNoCorrection)return 1;const l=ar(t);s.a$(l,l,1+n/s.bE);const h=s.bF();return s.aH(h,[l[0],l[1],l[2],1],this._globeViewProjMatrixNoCorrection),h[2]/h[3]}populateCache(t){}getBounds(){const t=.5*this.width,n=.5*this.height,l=[new s.P(0,0),new s.P(t,0),new s.P(this.width,0),new s.P(this.width,n),new s.P(this.width,this.height),new s.P(t,this.height),new s.P(0,this.height),new s.P(0,n)],h=[];for(const R of l)h.push(this.unprojectScreenPoint(R));let g=0,_=0,T=0,I=0;const A=this.center;for(const R of h){const L=s.bK(A.lng,R.lng),O=s.bK(A.lat,R.lat);L<_&&(_=L),L>g&&(g=L),O<I&&(I=O),O>T&&(T=O)}const C=[A.lng+_,A.lat+I,A.lng+g,A.lat+T];return this.isSurfacePointOnScreen([0,1,0])&&(C[3]=90,C[0]=-180,C[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(C[1]=-90,C[0]=-180,C[2]=180),new dr(C)}calculateCenterFromCameraLngLatAlt(t,n,l,h){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,l,h)}setLocationAtPoint(t,n){const l=ar(this.unprojectScreenPoint(n)),h=ar(t),g=s.bz();s.bL(g);const _=s.bz();s.bI(_,l,g,-this.center.lng*Math.PI/180),s.bH(_,_,g,this.center.lat*Math.PI/180);const T=h[0]*h[0]+h[2]*h[2],I=_[0]*_[0];if(T<I)return;const A=Math.sqrt(T-I),C=-A,R=s.bM(h[0],h[2],_[0],A),L=s.bM(h[0],h[2],_[0],C),O=s.bz();s.bI(O,h,g,-R);const $=s.bM(O[1],O[2],_[1],_[2]),X=s.bz();s.bI(X,h,g,-L);const K=s.bM(X[1],X[2],_[1],_[2]),Y=.5*Math.PI,ee=$>=-Y&&$<=Y,oe=K>=-Y&&K<=Y;let J,ne;if(ee&&oe){const Ae=this.center.lng*Math.PI/180,be=this.center.lat*Math.PI/180;s.bN(R,Ae)+s.bN($,be)<s.bN(L,Ae)+s.bN(K,be)?(J=R,ne=$):(J=L,ne=K)}else if(ee)J=R,ne=$;else{if(!oe)return;J=L,ne=K}const ce=J/Math.PI*180,ie=ne/Math.PI*180,fe=this.center.lat;this.setCenter(new s.V(ce,s.an(ie,-90,90))),this.setZoom(this.zoom+gr(fe,this.center.lat))}locationToScreenPoint(t,n){const l=ar(t);if(n){const h=n.getElevationForLngLatZoom(t,this._helper._tileZoom);s.a$(l,l,1+h/s.bE)}return this._projectSurfacePointToScreen(l)}_projectSurfacePointToScreen(t){const n=s.bF();return s.aH(n,[...t,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],new s.P((.5*n[0]+.5)*this.width,(.5*-n[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,n){if(n){const l=n.pointCoordinate(t);if(l)return l}return s.a9.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,n){var l;return(l=this.screenPointToMercatorCoordinate(t,n))===null||l===void 0?void 0:l.toLngLat()}isPointOnMapSurface(t,n){const l=this._cameraPosition,h=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(l,h)}getRayDirectionFromPixel(t){const n=s.bF();n[0]=t.x/this.width*2-1,n[1]=-1*(t.y/this.height*2-1),n[2]=1,n[3]=1,s.aH(n,n,this._globeViewProjMatrixNoCorrectionInverted),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3];const l=s.bz();l[0]=n[0]-this._cameraPosition[0],l[1]=n[1]-this._cameraPosition[1],l[2]=n[2]-this._cameraPosition[2];const h=s.bz();return s.b3(h,l),h}isSurfacePointVisible(t){const n=this._cachedClippingPlane;return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;const n=s.bF();return s.aH(n,[...t,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3],n[0]>-1&&n[0]<1&&n[1]>-1&&n[1]<1&&n[2]>-1&&n[2]<1}rayPlanetIntersection(t,n){const l=s.b5(t,n),h=s.bz(),g=s.bz();s.a$(g,n,l),s.b2(h,t,g);const _=1-s.b5(h,h);if(_<0)return null;const T=s.b5(t,t)-1,I=-l+(l<0?1:-1)*Math.sqrt(_),A=T/I,C=I;return{tMin:Math.min(A,C),tMax:Math.max(A,C)}}unprojectScreenPoint(t){const n=this._cameraPosition,l=this.getRayDirectionFromPixel(t),h=this.rayPlanetIntersection(n,l);if(h){const C=s.bz();s.b0(C,n,[l[0]*h.tMin,l[1]*h.tMin,l[2]*h.tMin]);const R=s.bz();return s.b3(R,C),Mc(R)}const g=this._cachedClippingPlane,_=g[0]*l[0]+g[1]*l[1]+g[2]*l[2],T=-s.bb(g,n)/_,I=s.bz();if(T>0)s.b0(I,n,[l[0]*T,l[1]*T,l[2]*T]);else{const C=s.bz();s.b0(C,n,[2*l[0],2*l[1],2*l[2]]);const R=s.bb(this._cachedClippingPlane,C);s.b2(I,C,[this._cachedClippingPlane[0]*R,this._cachedClippingPlane[1]*R,this._cachedClippingPlane[2]*R])}const A=(function(C){const R=s.bz();return R[0]=C[0]*-C[3],R[1]=C[1]*-C[3],R[2]=C[2]*-C[3],{center:R,radius:Math.sqrt(1-C[3]*C[3])}})(g);return Mc((function(C,R,L){const O=s.bz();s.b2(O,L,C);const $=s.bz();return s.bA($,C,O,R/s.b9(O)),$})(A.center,A.radius,I))}getMatrixForModel(t,n){const l=s.V.convert(t),h=1/s.bE,g=s.bj();return s.bJ(g,g,l.lng/180*Math.PI),s.bh(g,g,-l.lat/180*Math.PI),s.O(g,g,[0,0,1+n/s.bE]),s.bh(g,g,.5*Math.PI),s.Q(g,g,[h,h,h]),g}getProjectionDataForCustomLayer(t=!0){const n=this.getProjectionData({overscaledTileID:new s.a2(0,0,0,0,0),applyGlobeMatrix:t});return n.tileMercatorCoords=[0,0,1,1],n}getFastPathSimpleProjectionMatrix(t){}}class so{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}
vendor: 6,743 bytes, line 804
804interpolatePadding(t,n,l){return this._helper.interpolatePadding(t,n,l)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,l=!0){this._helper.resize(t,n,l)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,n){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=n,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(n,l)=>this.currentTransform.defaultConstrain(n,l),this.applyConstrain=(n,l)=>this._helper.applyConstrain(n,l),this._helper=new ya({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,l)=>this.defaultConstrain(n,l)},t),this._globeness=1,this._mercatorTransform=new _a,this._verticalPerspectiveTransform=new oo}clone(){const t=new so;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,n){this._helper.apply(t,n),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){const n=this._mercatorTransform.getProjectionData(t),l=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?l.mainMatrix:n.mainMatrix,clippingPlane:l.clippingPlane,tileMercatorCoords:l.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:n.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return s.bu(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return s.bu(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,n,l){const h=this._mercatorTransform.getPitchedTextCorrection(t,n,l),g=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,n,l);return s.bu(h,g,this._globeness)}projectTileCoordinates(t,n,l,h){return this.currentTransform.projectTileCoordinates(t,n,l,h)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,n){return this.currentTransform.lngLatToCameraDepth(t,n)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,n,l,h){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,l,h)}setLocationAtPoint(t,n){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,n),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,n),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,n){return this.currentTransform.locationToScreenPoint(t,n)}screenPointToMercatorCoordinate(t,n){return this.currentTransform.screenPointToMercatorCoordinate(t,n)}screenPointToLocation(t,n){return this.currentTransform.screenPointToLocation(t,n)}
vendor: 57,131 bytes, lines 804-806
804isPointOnMapSurface(t,n){return this.currentTransform.isPointOnMapSurface(t,n)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,n){return this.currentTransform.getMatrixForModel(t,n)}getProjectionDataForCustomLayer(t=!0){const n=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return n;const l=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return l.fallbackMatrix=n.mainMatrix,l}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Rr{get useGlobeControls(){return!0}handlePanInertia(t,n){const l=dh(t,n);return Math.abs(l.lng-n.center.lng)>180&&(l.lng=n.center.lng+179.5*Math.sign(l.lng-n.center.lng)),{easingCenter:l,easingOffset:new s.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,n){const l=t.around,h=n.screenPointToLocation(l);t.bearingDelta&&n.setBearing(n.bearing+t.bearingDelta),t.pitchDelta&&n.setPitch(n.pitch+t.pitchDelta),t.rollDelta&&n.setRoll(n.roll+t.rollDelta);const g=n.zoom;t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta);const _=n.zoom-g;if(_===0)return;const T=s.bK(n.center.lng,h.lng),I=T/(Math.abs(T/180)+1),A=s.bK(n.center.lat,h.lat),C=n.getRayDirectionFromPixel(l),R=n.cameraPosition,L=-1*s.b5(R,C),O=s.bz();s.b0(O,R,[C[0]*L,C[1]*L,C[2]*L]);const $=s.b7(O)-1,X=Math.exp(.5*-Math.max($-.3,0)),K=xa(n.worldSize,n.center.lat)/Math.min(n.width,n.height),Y=s.bx(K,.9,.5,1,.25),ee=(1-s.aq(-_))*Math.min(X,Y),oe=n.center.lat,J=n.zoom,ne=new s.V(n.center.lng+I*ee,s.an(n.center.lat+A*ee,-s.ao,s.ao));n.setLocationAtPoint(h,l);const ce=n.center,ie=s.bx(Math.abs(T),45,85,0,1),fe=s.bx(K,.75,.35,0,1),Ae=Math.pow(Math.max(ie,fe),.25),be=s.bK(ce.lng,ne.lng),Te=s.bK(ce.lat,ne.lat);n.setCenter(new s.V(ce.lng+be*Ae,ce.lat+Te*Ae).wrap()),n.setZoom(J+gr(oe,n.center.lat))}handleMapControlsPan(t,n,l){if(!t.panDelta)return;const h=n.center.lat,g=n.zoom;n.setCenter(dh(t.panDelta,n).wrap()),n.setZoom(g+gr(h,n.center.lat))}cameraForBoxAndBearing(t,n,l,h,g){const _=Tc(t,n,l,h,g),T=n.left/g.width*2-1,I=(g.width-n.right)/g.width*2-1,A=n.top/g.height*-2+1,C=(g.height-n.bottom)/g.height*-2+1,R=s.bK(l.getWest(),l.getEast())<0,L=R?l.getEast():l.getWest(),O=R?l.getWest():l.getEast(),$=Math.max(l.getNorth(),l.getSouth()),X=Math.min(l.getNorth(),l.getSouth()),K=L+.5*s.bK(L,O),Y=$+.5*s.bK($,X),ee=g.clone();ee.setCenter(_.center),ee.setBearing(_.bearing),ee.setPitch(0),ee.setRoll(0),ee.setZoom(_.zoom);const oe=ee.modelViewProjectionMatrix,J=[ar(l.getNorthWest()),ar(l.getNorthEast()),ar(l.getSouthWest()),ar(l.getSouthEast()),ar(new s.V(O,Y)),ar(new s.V(L,Y)),ar(new s.V(K,$)),ar(new s.V(K,X))],ne=ar(_.center);let ce=Number.POSITIVE_INFINITY;for(const ie of J)T<0&&(ce=Rr.getLesserNonNegativeNonNull(ce,Rr.solveVectorScale(ie,ne,oe,"x",T))),I>0&&(ce=Rr.getLesserNonNegativeNonNull(ce,Rr.solveVectorScale(ie,ne,oe,"x",I))),A>0&&(ce=Rr.getLesserNonNegativeNonNull(ce,Rr.solveVectorScale(ie,ne,oe,"y",A))),C<0&&(ce=Rr.getLesserNonNegativeNonNull(ce,Rr.solveVectorScale(ie,ne,oe,"y",C)));if(Number.isFinite(ce)&&ce!==0)return _.zoom=ee.zoom+s.at(ce),_;En()}handleJumpToCenterZoom(t,n){const l=t.center.lat,h=t.applyConstrain(n.center?s.V.convert(n.center):t.center,t.zoom).center;t.setCenter(h.wrap());const g=n.zoom!==void 0?+n.zoom:t.zoom+gr(l,h.lat);t.zoom!==g&&t.setZoom(g)}handleEaseTo(t,n){const l=t.zoom,h=t.center,g=t.padding,_={roll:t.roll,pitch:t.pitch,bearing:t.bearing},T={roll:n.roll===void 0?t.roll:n.roll,pitch:n.pitch===void 0?t.pitch:n.pitch,bearing:n.bearing===void 0?t.bearing:n.bearing},I=n.zoom!==void 0,A=!t.isPaddingEqual(n.padding);let C=!1;const R=n.center?s.V.convert(n.center):h,L=t.applyConstrain(R,l).center;Hn(t,L);const O=t.clone();O.setCenter(L),O.setZoom(I?+n.zoom:l+gr(h.lat,R.lat)),O.setBearing(n.bearing);const $=new s.P(s.an(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),s.an(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));O.setLocationAtPoint(L,$);const X=(n.offset&&n.offsetAsPoint.mag())>0?O.center:L,K=I?+n.zoom:l+gr(h.lat,X.lat),Y=l+gr(h.lat,0),ee=K+gr(X.lat,0),oe=s.bK(h.lng,X.lng),J=s.bK(h.lat,X.lat),ne=s.aq(ee-Y);return C=K!==l,{easeFunc:ce=>{if(s.bo(_,T)||uh({startEulerAngles:_,endEulerAngles:T,tr:t,k:ce,useSlerp:_.roll!=T.roll}),A&&t.interpolatePadding(g,n.padding,ce),n.around)s.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(n.around,n.aroundPoint);else{const ie=ee>Y?Math.min(2,ne):Math.max(.5,ne),fe=Math.pow(ie,1-ce),Ae=fh(h,oe,J,ce*fe);t.setCenter(Ae.wrap())}if(C){const ie=s.G.number(Y,ee,ce)+gr(0,t.center.lat);t.setZoom(ie)}},isZooming:C,elevationCenter:X}}handleFlyTo(t,n){const l=n.zoom!==void 0,h=t.center,g=t.zoom,_=t.padding,T=!t.isPaddingEqual(n.padding),I=t.applyConstrain(s.V.convert(n.center||n.locationAtOffset),g).center,A=l?+n.zoom:t.zoom+gr(t.center.lat,I.lat),C=t.clone();C.setCenter(I),C.setZoom(A),C.setBearing(n.bearing);const R=new s.P(s.an(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),s.an(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));C.setLocationAtPoint(I,R);const L=C.center;Hn(t,L);const O=(function(J,ne,ce){const ie=ar(ne),fe=ar(ce),Ae=s.b5(ie,fe),be=Math.acos(Ae),Te=yi(J);return be/(2*Math.PI)*Te})(t,h,L),$=g+gr(h.lat,0),X=A+gr(L.lat,0),K=s.aq(X-$);let Y;if(typeof n.minZoom=="number"){const J=+n.minZoom+gr(L.lat,0),ne=Math.min(J,$,X)+gr(0,L.lat),ce=t.applyConstrain(L,ne).zoom+gr(L.lat,0);Y=s.aq(ce-$)}const ee=s.bK(h.lng,L.lng),oe=s.bK(h.lat,L.lat);return{easeFunc:(J,ne,ce,ie)=>{const fe=fh(h,ee,oe,ce);T&&t.interpolatePadding(_,n.padding,J);const Ae=J===1?L:fe;t.setCenter(Ae.wrap());const be=$+s.at(ne);t.setZoom(J===1?A:be+gr(0,Ae.lat))},scaleOfZoom:K,targetCenter:L,scaleOfMinZoom:Y,pixelPathLength:O}}static solveVectorScale(t,n,l,h,g){const _=h==="x"?[l[0],l[4],l[8],l[12]]:[l[1],l[5],l[9],l[13]],T=[l[3],l[7],l[11],l[15]],I=t[0]*_[0]+t[1]*_[1]+t[2]*_[2],A=t[0]*T[0]+t[1]*T[1]+t[2]*T[2],C=n[0]*_[0]+n[1]*_[1]+n[2]*_[2],R=n[0]*T[0]+n[1]*T[1]+n[2]*T[2];return C+g*A===I+g*R||T[3]*(I-C)+_[3]*(R-A)+I*R==C*A?null:(C+_[3]-g*R-g*T[3])/(C-I-g*R+g*A)}static getLesserNonNegativeNonNull(t,n){return n!==null&&n>=0&&n<t?n:t}}class mh{constructor(t){this._globe=t,this._mercatorCameraHelper=new va,this._verticalPerspectiveCameraHelper=new Rr}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,n){return this.currentHelper.handlePanInertia(t,n)}handleMapControlsRollPitchBearingZoom(t,n){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,n)}handleMapControlsPan(t,n,l){this.currentHelper.handleMapControlsPan(t,n,l)}cameraForBoxAndBearing(t,n,l,h,g){return this.currentHelper.cameraForBoxAndBearing(t,n,l,h,g)}handleJumpToCenterZoom(t,n){this.currentHelper.handleJumpToCenterZoom(t,n)}handleEaseTo(t,n){return this.currentHelper.handleEaseTo(t,n)}handleFlyTo(t,n){return this.currentHelper.handleFlyTo(t,n)}}const lo=(m,t)=>s.B(m,t&&t.filter((n=>n.identifier!=="source.canvas"))),Qo=s.bO();class ba extends s.E{constructor(t,n={}){var l,h;super(),this._rtlPluginLoaded=()=>{for(const _ in this.tileManagers){const T=this.tileManagers[_].getSource().type;T!=="vector"&&T!=="geojson"||this.tileManagers[_].reload()}},this.map=t,this.dispatcher=new Zi(da(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((_,T)=>this.getGlyphs(_,T))),this.dispatcher.registerMessageHandler("GI",((_,T)=>this.getImages(_,T))),this.dispatcher.registerMessageHandler("GDA",((_,T)=>this.getDashes(_,T))),this.imageManager=new Ur,this.imageManager.setEventedParent(this);const g=((l=t._container)===null||l===void 0?void 0:l.lang)||typeof document<"u"&&((h=document.documentElement)===null||h===void 0?void 0:h.lang)||void 0;this.glyphManager=new ui(t._requestManager,n.localIdeographFontFamily,g),this.lineAtlas=new Fo(256,512),this.crossTileSymbolIndex=new Ti,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",s.bP()),ge().on(se,this._rtlPluginLoaded),this.on("data",(_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const T=this.tileManagers[_.sourceId];if(!T)return;const I=T.getSource();if(I&&I.vectorLayerIds)for(const A in this._layers){const C=this._layers[A];C.source===I.id&&this._validateLayer(C)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new s.bQ,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((t=this.crossTileSymbolIndex)===null||t===void 0?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,n){var l,h,g;this._checkLoaded();const _=n===null?(g=(h=(l=this.stylesheet.state)===null||l===void 0?void 0:l[t])===null||h===void 0?void 0:h.default)!==null&&g!==void 0?g:null:n;if(s.bR(_,this._globalState[t]))return this;this._globalState[t]=_,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const n=[];for(const l in t)!s.bR(this._globalState[l],t[l].default)&&(n.push(l),this._globalState[l]=t[l].default);this._applyGlobalStateChanges(n)}_applyGlobalStateChanges(t){if(t.length===0)return;const n=new Set,l={};for(const h of t){l[h]=this._globalState[h];for(const g in this._layers){const _=this._layers[g],T=_.getLayoutAffectingGlobalStateRefs(),I=_.getPaintAffectingGlobalStateRefs(),A=_.getVisibilityAffectingGlobalStateRefs();if(T.has(h)&&n.add(_.source),I.has(h))for(const{name:C,value:R}of I.get(h))this._updatePaintProperty(_,C,R);A?.has(h)&&(_.recalculateVisibility(),this._updateLayer(_))}}this.dispatcher.broadcast("UGS",l);for(const h in this.tileManagers)n.has(h)&&(this._reloadSource(h),this._changed=!0)}loadURL(t,n={},l){this.fire(new s.l("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const h=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const g=this._loadStyleRequest;s.j(h,this._loadStyleRequest).then((_=>{this._loadStyleRequest=null,this._load(_.data,n,l)})).catch((_=>{this._loadStyleRequest=null,_&&!g.signal.aborted&&this.fire(new s.k(_))}))}loadJSON(t,n={},l){this.fire(new s.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,ue.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,l)})).catch((()=>{}))}loadEmpty(){this.fire(new s.l("dataloading",{dataType:"style"})),this._load(Qo,{validate:!1})}_load(t,n,l){var h,g;let _=n.transformStyle?n.transformStyle(l,t):t;if(!n.validate||!lo(this,s.C(_))){_=Object.assign({},_),this._loaded=!0,this.stylesheet=_;for(const T in _.sources)this.addSource(T,_.sources[T],{validate:!1});_.sprite?this._loadSprite(_.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(_.glyphs),this._createLayers(),this.light=new Ga(this.stylesheet.light),this._setProjectionInternal(((h=this.stylesheet.projection)===null||h===void 0?void 0:h.type)||"mercator"),this.sky=new qa(this.stylesheet.sky),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new s.l("data",{dataType:"style"})),this.fire(new s.l("style.load"))}}_createLayers(){var t,n,l;const h=s.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",h),this._order=h.map((g=>g.id)),this._layers={},this._serializedLayers=null;for(const g of h){const _=s.bT(g,this._globalState);if(_.setEventedParent(this,{layer:{id:g.id}}),this._layers[g.id]=_,s.bU(_)&&this.tileManagers[_.source]){const T=(l=(n=g.paint)===null||n===void 0?void 0:n["raster-fade-duration"])!==null&&l!==void 0?l:_.paint.get("raster-fade-duration");this.tileManagers[_.source].setRasterFadeDuration(T)}}}_loadSprite(t,n=!1,l=void 0){this.imageManager.setLoaded(!1);const h=new AbortController;let g;this._spriteRequest=h,(function(_,T,I,A){return s._(this,void 0,void 0,(function*(){const C=It(_),R=I>1?"@2x":"",L={},O={};for(const{id:$,url:X}of C){const K=T.transformRequest(dt(X,R,".json"),"SpriteJSON");L[$]=s.j(K,A);const Y=T.transformRequest(dt(X,R,".png"),"SpriteImage");O[$]=rt.getImage(Y,A)}return yield Promise.all([...Object.values(L),...Object.values(O)]),(function($,X){return s._(this,void 0,void 0,(function*(){const K={};for(const Y in $){K[Y]={};const ee=ue.getImageCanvasContext((yield X[Y]).data),oe=(yield $[Y]).data;for(const J in oe){const{width:ne,height:ce,x:ie,y:fe,sdf:Ae,pixelRatio:be,stretchX:Te,stretchY:Se,content:Ve,textFitWidth:Ue,textFitHeight:Fe}=oe[J];K[Y][J]={data:null,pixelRatio:be,sdf:Ae,stretchX:Te,stretchY:Se,content:Ve,textFitWidth:Ue,textFitHeight:Fe,spriteData:{width:ne,height:ce,x:ie,y:fe,context:ee}}}}return K}))})(L,O)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((_=>{if(this._spriteRequest=null,_)for(const T in _){this._spritesImagesIds[T]=[];const I=this._spritesImagesIds[T]?this._spritesImagesIds[T].filter((A=>!(A in _))):[];for(const A of I)this.imageManager.removeImage(A),this._changedImages[A]=!0;for(const A in _[T]){const C=T==="default"?A:`${T}:${A}`;this._spritesImagesIds[T].push(C),C in this.imageManager.images?this.imageManager.updateImage(C,_[T][A],!1):this.imageManager.addImage(C,_[T][A]),n&&(this._changedImages[C]=!0)}}})).catch((_=>{this._spriteRequest=null,g=_,h.signal.aborted||this.fire(new s.k(g))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"})),l&&l(g)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}_validateLayer(t){const n=this.tileManagers[t.source];if(!n)return;const l=t.sourceLayer;if(!l)return;const h=n.getSource();(h.type==="geojson"||h.vectorLayerIds&&h.vectorLayerIds.indexOf(l)===-1)&&this.fire(new s.k(new Error(`Source layer "${l}" does not exist on source "${h.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,n=!1){const l=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n?s.bV(l):l);const h=[];for(const g of t)if(l[g]){const _=n?s.bV(l[g]):l[g];h.push(_)}return h}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const l of n){const h=this._layers[l];h.type!=="custom"&&(t[l]=h.serialize())}return t}hasTransitions(){var t,n,l;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((n=this.sky)===null||n===void 0)&&n.hasTransition()||!((l=this.projection)===null||l===void 0)&&l.hasTransition())return!0;for(const h in this.tileManagers)if(this.tileManagers[h].hasTransition())return!0;for(const h in this._layers)if(this._layers[h].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(n){const h=Object.keys(this._updatedLayers),g=Object.keys(this._removedLayers);(h.length||g.length)&&this._updateWorkerLayers(h,g);for(const _ in this._updatedSources){const T=this._updatedSources[_];if(T==="reload")this._reloadSource(_);else{if(T!=="clear")throw new Error(`Invalid action ${T}`);this._clearSource(_)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const _ in this._updatedPaintProps)this._layers[_].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const l={};for(const h in this.tileManagers){const g=this.tileManagers[h];l[h]=g.used,g.used=!1}for(const h of this._order){const g=this._layers[h];g.recalculate(t,this._availableImages),!g.isHidden(t.zoom)&&g.source&&(this.tileManagers[g.source].used=!0)}for(const h in l){const g=this.tileManagers[h];!!l[h]!=!!g.used&&g.fire(new s.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:h}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,n&&this.fire(new s.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.tileManagers)this.tileManagers[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){var l;this._checkLoaded();const h=this.serialize();if(t=n.transformStyle?n.transformStyle(h,t):t,((l=n.validate)===null||l===void 0||l)&&lo(this,s.C(t)))return!1;(t=s.bV(t)).layers=s.bS(t.layers);const g=s.bW(h,t),_=this._getOperationsToPerform(g);if(_.unimplemented.length>0)throw new Error(`Unimplemented: ${_.unimplemented.join(", ")}.`);if(_.operations.length===0)return!1;for(const T of _.operations)T();return this.stylesheet=t,this._serializedLayers=null,this.fire(new s.l("style.load",{style:this})),!0}_getOperationsToPerform(t){const n=[],l=[];for(const h of t)switch(h.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":n.push((()=>this.addLayer.apply(this,h.args)));break;case"removeLayer":n.push((()=>this.removeLayer.apply(this,h.args)));break;case"setPaintProperty":n.push((()=>this.setPaintProperty.apply(this,h.args)));break;case"setLayoutProperty":n.push((()=>this.setLayoutProperty.apply(this,h.args)));break;case"setFilter":n.push((()=>this.setFilter.apply(this,h.args)));break;case"addSource":n.push((()=>this.addSource.apply(this,h.args)));break;case"removeSource":n.push((()=>this.removeSource.apply(this,h.args)));break;case"setLayerZoomRange":n.push((()=>this.setLayerZoomRange.apply(this,h.args)));break;case"setLight":n.push((()=>this.setLight.apply(this,h.args)));break;case"setGeoJSONSourceData":n.push((()=>this.setGeoJSONSourceData.apply(this,h.args)));break;case"setGlyphs":n.push((()=>this.setGlyphs.apply(this,h.args)));break;case"setSprite":n.push((()=>this.setSprite.apply(this,h.args)));break;case"setTerrain":n.push((()=>this.map.setTerrain.apply(this,h.args)));break;case"setSky":n.push((()=>this.setSky.apply(this,h.args)));break;case"setProjection":this.setProjection.apply(this,h.args);break;case"setGlobalState":n.push((()=>this.setGlobalState.apply(this,h.args)));break;case"setTransition":n.push((()=>{}));break;default:l.push(h.command)}return{operations:n,unimplemented:l}}addImage(t,n){if(this.getImage(t))return this.fire(new s.k(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new s.k(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,l={}){if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(s.C.source,`sources.${t}`,n,null,l))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const h=this.tileManagers[t]=new Bi(t,n,this.dispatcher);h.style=this,h.setEventedParent(this,(()=>({isSourceLoaded:h.loaded(),source:h.serialize(),sourceId:t}))),h.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error("There is no source with this ID");for(const l in this._layers)if(this._layers[l].source===t)return this.fire(new s.k(new Error(`Source "${t}" cannot be removed while layer "${l}" is using it.`)));const n=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],n.fire(new s.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const l=this.tileManagers[t].getSource();if(l.type!=="geojson")throw new Error(`geojsonSource.type is ${l.type}, which is !== 'geojson`);l.setData(n),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,n,l={}){this._checkLoaded();const h=t.id;if(this.getLayer(h))return void this.fire(new s.k(new Error(`Layer "${h}" already exists on this map.`)));let g;if(t.type==="custom"){if(lo(this,s.bX(t)))return;g=s.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(h,t.source),t=s.bV(t),t=s.e(t,{source:h})),this._validate(s.C.layer,`layers.${h}`,t,{arrayIndex:-1},l))return;g=s.bT(t,this._globalState),this._validateLayer(g),g.setEventedParent(this,{layer:{id:h}})}const _=n?this._order.indexOf(n):this._order.length;if(n&&_===-1)this.fire(new s.k(new Error(`Cannot add layer "${h}" before non-existing layer "${n}".`)));else{if(this._order.splice(_,0,h),this._layerOrderChanged=!0,this._layers[h]=g,this._removedLayers[h]&&g.source&&g.type!=="custom"){const T=this._removedLayers[h];delete this._removedLayers[h],T.type!==g.type?this._updatedSources[g.source]="clear":(this._updatedSources[g.source]="reload",this.tileManagers[g.source].pause())}this._updateLayer(g),g.onAdd&&g.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new s.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const l=this._order.indexOf(t);this._order.splice(l,1);const h=n?this._order.indexOf(n):this._order.length;n&&h===-1?this.fire(new s.k(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(h,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new s.k(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const l=this._order.indexOf(t);this._order.splice(l,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,l){this._checkLoaded();const h=this.getLayer(t);h?h.minzoom===n&&h.maxzoom===l||(n!=null&&(h.minzoom=n),l!=null&&(h.maxzoom=l),this._updateLayer(h)):this.fire(new s.k(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,l={}){this._checkLoaded();const h=this.getLayer(t);if(h){if(!s.bR(h.filter,n))return n==null?(h.setFilter(void 0),void this._updateLayer(h)):void(this._validate(s.C.filter,`layers.${h.id}.filter`,n,null,l)||(h.setFilter(s.bV(n)),this._updateLayer(h)))}else this.fire(new s.k(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return s.bV(this.getLayer(t).filter)}setLayoutProperty(t,n,l,h={}){this._checkLoaded();const g=this.getLayer(t);g?s.bR(g.getLayoutProperty(n),l)||(g.setLayoutProperty(n,l,h),this._updateLayer(g)):this.fire(new s.k(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const l=this.getLayer(t);if(l)return l.getLayoutProperty(n);this.fire(new s.k(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,l,h={}){this._checkLoaded();const g=this.getLayer(t);g?s.bR(g.getPaintProperty(n),l)||this._updatePaintProperty(g,n,l,h):this.fire(new s.k(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,n,l,h={}){t.setPaintProperty(n,l,h)&&this._updateLayer(t),s.bU(t)&&n==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(l),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const l=t.source,h=t.sourceLayer,g=this.tileManagers[l];if(g===void 0)return void this.fire(new s.k(new Error(`The source '${l}' does not exist in the map's style.`)));const _=g.getSource().type;_==="geojson"&&h?this.fire(new s.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):_!=="vector"||h?(t.id===void 0&&this.fire(new s.k(new Error("The feature id parameter must be provided."))),g.setFeatureState(h,t.id,n)):this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const l=t.source,h=this.tileManagers[l];if(h===void 0)return void this.fire(new s.k(new Error(`The source '${l}' does not exist in the map's style.`)));const g=h.getSource().type,_=g==="vector"?t.sourceLayer:void 0;g!=="vector"||_?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new s.k(new Error("A feature id is required to remove its specific state property."))):h.removeFeatureState(_,t.id,n):this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,l=t.sourceLayer,h=this.tileManagers[n];if(h!==void 0)return h.getSource().type!=="vector"||l?(t.id===void 0&&this.fire(new s.k(new Error("The feature id parameter must be provided."))),h.getFeatureState(l,t.id)):void this.fire(new s.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new s.k(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return s.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=s.bY(this.tileManagers,(g=>g.serialize())),n=this._serializeByIds(this._order,!0),l=this.map.getTerrain()||void 0,h=this.stylesheet;return s.bZ({version:h.version,name:h.name,metadata:h.metadata,light:h.light,sky:h.sky,center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,sprite:h.sprite,glyphs:h.glyphs,transition:h.transition,projection:h.projection,sources:t,layers:n,terrain:l},(g=>g!==void 0))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=_=>this._layers[_].type==="fill-extrusion",l={},h=[];for(let _=this._order.length-1;_>=0;_--){const T=this._order[_];if(n(T)){l[T]=_;for(const I of t){const A=I[T];if(A)for(const C of A)h.push(C)}}}h.sort(((_,T)=>T.intersectionZ-_.intersectionZ));const g=[];for(let _=this._order.length-1;_>=0;_--){const T=this._order[_];if(n(T))for(let I=h.length-1;I>=0;I--){const A=h[I].feature;if(l[A.layer.id]<_)break;g.push(A),h.pop()}else for(const I of t){const A=I[T];if(A)for(const C of A)g.push(C.feature)}}return g}queryRenderedFeatures(t,n,l){n&&n.filter&&this._validate(s.C.filter,"queryRenderedFeatures.filter",n.filter,null,n);const h={};if(n&&n.layers){if(!(Array.isArray(n.layers)||n.layers instanceof Set))return this.fire(new s.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const A of n.layers){const C=this._layers[A];if(!C)return this.fire(new s.k(new Error(`The layer '${A}' does not exist in the map's style and cannot be queried for features.`))),[];h[C.source]=!0}}const g=[];n.availableImages=this._availableImages;const _=this._serializedAllLayers(),T=n.layers instanceof Set?n.layers:Array.isArray(n.layers)?new Set(n.layers):null,I=Object.assign(Object.assign({},n),{layers:T,globalState:this._globalState});for(const A in this.tileManagers)n.layers&&!h[A]||g.push(Oo(this.tileManagers[A],this._layers,_,t,I,l,this.map.terrain?(C,R,L)=>this.map.terrain.getElevation(C,R,L):void 0));return this.placement&&g.push((function(A,C,R,L,O,$,X){const K={},Y=$.queryRenderedSymbols(L),ee=[];for(const oe of Object.keys(Y).map(Number))ee.push(X[oe]);ee.sort($r);for(const oe of ee){const J=oe.featureIndex.lookupSymbolFeatures(Y[oe.bucketInstanceId],C,oe.bucketIndex,oe.sourceLayerIndex,{filterSpec:O.filter,globalState:O.globalState},O.layers,O.availableImages,A);for(const ne in J){const ce=K[ne]=K[ne]||[],ie=J[ne];ie.sort(((fe,Ae)=>{const be=oe.featureSortOrder;if(be){const Te=be.indexOf(fe.featureIndex);return be.indexOf(Ae.featureIndex)-Te}return Ae.featureIndex-fe.featureIndex}));for(const fe of ie)ce.push(fe)}}return(function(oe,J,ne){for(const ce in oe)for(const ie of oe[ce])Fi(ie,ne[J[ce].source]);return oe})(K,A,R)})(this._layers,_,this.tileManagers,t,I,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(g)}querySourceFeatures(t,n){n?.filter&&this._validate(s.C.filter,"querySourceFeatures.filter",n.filter,null,n);const l=this.tileManagers[t];return l?(function(h,g){const _=h.getRenderableIds().map((A=>h.getTileByID(A))),T=[],I={};for(let A=0;A<_.length;A++){const C=_[A],R=C.tileID.canonical.key;I[R]||(I[R]=!0,C.querySourceFeatures(T,g))}return T})(l,n?Object.assign(Object.assign({},n),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const l=this.light.getLight();let h=!1;for(const _ in t)if(!s.bR(t[_],l[_])){h=!0;break}if(!h)return;const g={now:me(),transition:s.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(g)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=t,this._setProjectionInternal(t.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,n={}){this._checkLoaded();const l=this.getSky();let h=!1;if(!t&&!l)return;if(t&&!l)h=!0;else if(!t&&l)h=!0;else for(const _ in t)if(!s.bR(t[_],l[_])){h=!0;break}if(!h)return;const g={now:me(),transition:s.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,n),this.sky.updateTransitions(g)}_setProjectionInternal(t){const n=(function(l,h){const g={constrainOverride:h};if(Array.isArray(l)){const _=new ph({type:l});return{projection:_,transform:new so(g),cameraHelper:new mh(_)}}switch(l){case"mercator":return{projection:new gi,transform:new _a(g),cameraHelper:new va};case"globe":{const _=new ph({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:_,transform:new so(g),cameraHelper:new mh(_)}}case"vertical-perspective":return{projection:new Sc,transform:new oo(g),cameraHelper:new Rr};default:return s.w(`Unknown projection name: ${l}. Falling back to mercator projection.`),{projection:new gi,transform:new _a(g),cameraHelper:new va}}})(t,this.map.transformConstrain);this.projection=n.projection,this.map.migrateProjection(n.transform,n.cameraHelper);for(const l in this.tileManagers)this.tileManagers[l].reload()}_validate(t,n,l,h,g={}){return(!g||g.validate!==!1)&&lo(this,t.call(s.C,s.e({key:n,style:this.serialize(),value:l,styleSpec:s.u},h)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),ge().off(se,this._rtlPluginLoaded);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.tileManagers){const l=this.tileManagers[n];l.setEventedParent(null),l.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(const n in this.tileManagers)this.tileManagers[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,n,l,h,g=!1){let _=!1,T=!1;const I={};for(const A of this._order){const C=this._layers[A];if(C.type!=="symbol")continue;if(!I[C.source]){const L=this.tileManagers[C.source];I[C.source]=L.getRenderableIds(!0).map((O=>L.getTileByID(O))).sort(((O,$)=>$.tileID.overscaledZ-O.tileID.overscaledZ||(O.tileID.isLessThan($.tileID)?-1:1)))}const R=this.crossTileSymbolIndex.addLayer(C,I[C.source],t.center.lng);_=_||R}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((g=g||this._layerOrderChanged||l===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(me(),t.zoom))&&(this.pauseablePlacement=new Qa(t,this.map.terrain,this._order,g,n,l,h,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,I),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(me()),T=!0),_&&this.pauseablePlacement.placement.setStale()),T||_)for(const A of this._order){const C=this._layers[A];C.type==="symbol"&&this.placement.updateLayerOpacities(C,I[C.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(me())}_releaseSymbolFadeTiles(){for(const t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,n){return s._(this,void 0,void 0,(function*(){const l=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const h=this.tileManagers[n.source];return h&&h.setDependencies(n.tileID.key,n.type,n.icons),l}))}getGlyphs(t,n){return s._(this,void 0,void 0,(function*(){const l=yield this.glyphManager.getGlyphs(n.stacks),h=this.tileManagers[n.source];return h&&h.setDependencies(n.tileID.key,n.type,[""]),l}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(s.C.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,n){return s._(this,void 0,void 0,(function*(){const l={};for(const[h,g]of Object.entries(n.dashes))l[h]=this.lineAtlas.getDash(g.dasharray,g.round);return l}))}addSprite(t,n,l={},h){this._checkLoaded();const g=[{id:t,url:n}],_=[...It(this.stylesheet.sprite),...g];this._validate(s.C.sprite,"sprite",_,null,l)||(this.stylesheet.sprite=_,this._loadSprite(g,!0,h))}removeSprite(t){this._checkLoaded();const n=It(this.stylesheet.sprite);if(n.find((l=>l.id===t))){if(this._spritesImagesIds[t])for(const l of this._spritesImagesIds[t])this.imageManager.removeImage(l),this._changedImages[l]=!0;n.splice(n.findIndex((l=>l.id===t)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.l("data",{dataType:"style"}))}else this.fire(new s.k(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return It(this.stylesheet.sprite)}setSprite(t,n={},l){this._checkLoaded(),t&&this._validate(s.C.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,l):(this._unloadSprite(),l&&l(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(const t in this.tileManagers){const n=this.tileManagers[t];n.setEventedParent(null),n.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(const t in this._layers){const n=this._layers[t];n.setEventedParent(null),n.onRemove&&n.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var Ad=s.aU([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class al{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,l,h,g,_,T,I,A){this.context=t;let C=this.boundPaintVertexBuffers.length!==h.length;for(let R=0;!C&&R<h.length;R++)this.boundPaintVertexBuffers[R]!==h[R]&&(C=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==l||C||this.boundIndexBuffer!==g||this.boundVertexOffset!==_||this.boundDynamicVertexBuffer!==T||this.boundDynamicVertexBuffer2!==I||this.boundDynamicVertexBuffer3!==A?this.freshBind(n,l,h,g,_,T,I,A):(t.bindVertexArray.set(this.vao),T&&T.bind(),g&&g.dynamicDraw&&g.bind(),I&&I.bind(),A&&A.bind())}freshBind(t,n,l,h,g,_,T,I){const A=t.numAttributes,C=this.context,R=C.gl;this.vao&&this.destroy(),this.vao=C.createVertexArray(),C.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=l,this.boundIndexBuffer=h,this.boundVertexOffset=g,this.boundDynamicVertexBuffer=_,this.boundDynamicVertexBuffer2=T,this.boundDynamicVertexBuffer3=I,n.enableAttributes(R,t);for(const L of l)L.enableAttributes(R,t);_&&_.enableAttributes(R,t),T&&T.enableAttributes(R,t),I&&I.enableAttributes(R,t),n.bind(),n.setVertexAttribPointers(R,t,g);for(const L of l)L.bind(),L.setVertexAttribPointers(R,t,g);_&&(_.bind(),_.setVertexAttribPointers(R,t,g)),h&&h.bind(),T&&(T.bind(),T.setVertexAttribPointers(R,t,g)),I&&(I.bind(),I.setVertexAttribPointers(R,t,g)),C.currentNumAttributes=A}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Ed=(m,t,n,l,h)=>({u_texture:0,u_ele_delta:m,u_fog_matrix:t,u_fog_color:n?n.properties.get("fog-color"):s.bp.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:h?0:n?n.calculateFogBlendOpacity(l):0,u_horizon_color:n?n.properties.get("horizon-color"):s.bp.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1,u_is_globe_mode:h?1:0}),co={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function ol(m){const t=[];for(let n=0;n<m.length;n++){if(m[n]===null)continue;const l=m[n].split(" ");t.push(l.pop())}return t}class gh{constructor(t,n,l,h,g,_,T,I,A=[]){const C=t.gl;this.program=C.createProgram();const R=ol(n.staticAttributes),L=l?l.getBinderAttributes():[],O=R.concat(L),$=ur.prelude.staticUniforms?ol(ur.prelude.staticUniforms):[],X=T.staticUniforms?ol(T.staticUniforms):[],K=n.staticUniforms?ol(n.staticUniforms):[],Y=l?l.getBinderUniforms():[],ee=$.concat(X).concat(K).concat(Y),oe=[];for(const be of ee)oe.indexOf(be)<0&&oe.push(be);const J=l?l.defines():[];Oi(C)&&J.unshift("#version 300 es"),g&&J.push("#define OVERDRAW_INSPECTOR;"),_&&J.push("#define TERRAIN3D;"),I&&J.push(I),A&&J.push(...A);let ne=J.concat(ur.prelude.fragmentSource,T.fragmentSource,n.fragmentSource).join(` 805`),ce=J.concat(ur.prelude.vertexSource,T.vertexSource,n.vertexSource).join(` 806`);Oi(C)||(ne=(function(be){return be.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(ne),ce=(function(be){return be.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(ce));const ie=C.createShader(C.FRAGMENT_SHADER);if(C.isContextLost())return void(this.failedToCreate=!0);if(C.shaderSource(ie,ne),C.compileShader(ie),!C.getShaderParameter(ie,C.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${C.getShaderInfoLog(ie)}`);C.attachShader(this.program,ie);const fe=C.createShader(C.VERTEX_SHADER);if(C.isContextLost())return void(this.failedToCreate=!0);if(C.shaderSource(fe,ce),C.compileShader(fe),!C.getShaderParameter(fe,C.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${C.getShaderInfoLog(fe)}`);C.attachShader(this.program,fe),this.attributes={};const Ae={};this.numAttributes=O.length;for(let be=0;be<this.numAttributes;be++)O[be]&&(C.bindAttribLocation(this.program,be,O[be]),this.attributes[O[be]]=be);if(C.linkProgram(this.program),!C.getProgramParameter(this.program,C.LINK_STATUS))throw new Error(`Program failed to link: ${C.getProgramInfoLog(this.program)}`);C.deleteShader(fe),C.deleteShader(ie);for(let be=0;be<oe.length;be++){const Te=oe[be];if(Te&&!Ae[Te]){const Se=C.getUniformLocation(this.program,Te);Se&&(Ae[Te]=Se)}}this.fixedUniforms=h(t,Ae),this.terrainUniforms=((be,Te)=>({u_depth:new s.b_(be,Te.u_depth),u_terrain:new s.b_(be,Te.u_terrain),u_terrain_dim:new s.bq(be,Te.u_terrain_dim),u_terrain_matrix:new s.c0(be,Te.u_terrain_matrix),u_terrain_unpack:new s.c1(be,Te.u_terrain_unpack),u_terrain_exaggeration:new s.bq(be,Te.u_terrain_exaggeration)}))(t,Ae),this.projectionUniforms=((be,Te)=>({u_projection_matrix:new s.c0(be,Te.u_projection_matrix),u_projection_tile_mercator_coords:new s.c1(be,Te.u_projection_tile_mercator_coords),u_projection_clipping_plane:new s.c1(be,Te.u_projection_clipping_plane),u_projection_transition:new s.bq(be,Te.u_projection_transition),u_projection_fallback_matrix:new s.c0(be,Te.u_projection_fallback_matrix)}))(t,Ae),this.binderUniforms=l?l.getUniforms(t,Ae):[]}draw(t,n,l,h,g,_,T,I,A,C,R,L,O,$,X,K,Y,ee,oe){const J=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(l),t.setStencilMode(h),t.setColorMode(g),t.setCullFace(_),I){t.activeTexture.set(J.TEXTURE2),J.bindTexture(J.TEXTURE_2D,I.depthTexture),t.activeTexture.set(J.TEXTURE3),J.bindTexture(J.TEXTURE_2D,I.texture);for(const ce in this.terrainUniforms)this.terrainUniforms[ce].set(I[ce])}if(A)for(const ce in A)this.projectionUniforms[co[ce]].set(A[ce]);if(T)for(const ce in this.fixedUniforms)this.fixedUniforms[ce].set(T[ce]);K&&K.setUniforms(t,this.binderUniforms,$,{zoom:X});let ne=0;switch(n){case J.LINES:ne=2;break;case J.TRIANGLES:ne=3;break;case J.LINE_STRIP:ne=1}for(const ce of O.get()){const ie=ce.vaos||(ce.vaos={});(ie[C]||(ie[C]=new al)).bind(t,this,R,K?K.getPaintVertexBuffers():[],L,ce.vertexOffset,Y,ee,oe),J.drawElements(n,ce.primitiveLength*ne,J.UNSIGNED_SHORT,ce.primitiveOffset*ne*2)}}}function yh(m,t,n){const l=1/s.aN(n,1,t.transform.tileZoom),h=Math.pow(2,n.tileID.overscaledZ),g=n.tileSize*Math.pow(2,t.transform.tileZoom)/h,_=g*(n.tileID.canonical.x+n.tileID.wrap*h),T=g*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[l,m.fromScale,m.toScale],u_fade:m.t,u_pixel_coord_upper:[_>>16,T>>16],u_pixel_coord_lower:[65535&_,65535&T]}}const Ac=(m,t,n,l)=>{const h=m.style.light,g=h.properties.get("position"),_=[g.x,g.y,g.z],T=s.c4();h.properties.get("anchor")==="viewport"&&s.c5(T,m.transform.bearingInRadians),s.c6(_,_,T);const I=m.transform.transformLightDirection(_),A=h.properties.get("color");return{u_lightpos:_,u_lightpos_globe:I,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_vertical_gradient:+t,u_opacity:n,u_fill_translate:l}},Ec=(m,t,n,l,h,g,_)=>s.e(Ac(m,t,n,l),yh(g,m,_),{u_height_factor:-Math.pow(2,h.overscaledZ)/_.tileSize/8}),Cc=(m,t,n,l)=>s.e(yh(t,m,n),{u_fill_translate:l}),_h=(m,t)=>({u_world:m,u_fill_translate:t}),vh=(m,t,n,l,h)=>s.e(Cc(m,t,n,h),{u_world:l}),xh=(m,t,n,l,h)=>{const g=m.transform;let _,T,I=0;if(n.paint.get("circle-pitch-alignment")==="map"){const A=s.aN(t,1,g.zoom);_=!0,T=[A,A],I=A/(s.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*h}else _=!1,T=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+_,u_device_pixel_ratio:m.pixelRatio,u_extrude_scale:T,u_globe_extrude_scale:I,u_translate:l}},wa=m=>({u_pixel_extrude_scale:[1/m.width,1/m.height]}),bh=m=>({u_viewport_size:[m.width,m.height]}),kc=(m,t=1)=>({u_color:m,u_overlay:0,u_overlay_scale:t}),uo=(m,t,n,l)=>{const h=s.aN(m,1,t)/(s.a5*Math.pow(2,m.tileID.overscaledZ))*2*Math.PI*l;return{u_extrude_scale:s.aN(m,1,t),u_intensity:n,u_globe_extrude_scale:h}},wh=(m,t,n,l)=>{const h=s.N();s.c7(h,0,m.width,m.height,0,0,1);const g=m.context.gl;return{u_matrix:h,u_world:[g.drawingBufferWidth,g.drawingBufferHeight],u_image:n,u_color_ramp:l,u_opacity:t.paint.get("heatmap-opacity")}},sl=(m,t,n)=>{const l=n.paint.get("hillshade-accent-color");let h;switch(n.paint.get("hillshade-method")){case"basic":h=4;break;case"combined":h=1;break;case"igor":h=2;break;case"multidirectional":h=3;break;default:h=0}const g=n.getIlluminationProperties();for(let _=0;_<g.directionRadians.length;_++)n.paint.get("hillshade-illumination-anchor")==="viewport"&&(g.directionRadians[_]+=m.transform.bearingInRadians);return{u_image:0,u_latrange:kd(0,t.tileID),u_exaggeration:n.paint.get("hillshade-exaggeration"),u_altitudes:g.altitudeRadians,u_azimuths:g.directionRadians,u_accent:l,u_method:h,u_highlights:g.highlightColor,u_shadows:g.shadowColor}},Cd=(m,t)=>{const n=t.stride,l=s.N();return s.c7(l,0,s.a5,-s.a5,0,0,1),s.O(l,l,[0,-s.a5,0]),{u_matrix:l,u_image:1,u_dimension:[n,n],u_zoom:m.overscaledZ,u_unpack:t.getUnpackVector()}};function kd(m,t){const n=Math.pow(2,t.canonical.z),l=t.canonical.y;return[new s.a9(0,l/n).toLngLat().lat,new s.a9(0,(l+1)/n).toLngLat().lat]}const Th=(m,t,n=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:n,u_opacity:m.paint.get("color-relief-opacity")}),es=(m,t,n,l)=>{const h=m.transform;return{u_translation:cl(m,t,n),u_ratio:l/s.aN(t,1,h.zoom),u_device_pixel_ratio:m.pixelRatio,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},Sh=(m,t,n,l,h)=>s.e(es(m,t,n,l),{u_image:0,u_image_height:h}),Dc=(m,t,n,l,h)=>{const g=m.transform,_=Yi(t,g);return{u_translation:cl(m,t,n),u_texsize:t.imageAtlasTexture.size,u_ratio:l/s.aN(t,1,g.zoom),u_device_pixel_ratio:m.pixelRatio,u_image:0,u_scale:[_,h.fromScale,h.toScale],u_fade:h.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},Mh=(m,t,n,l,h)=>{const g=Yi(t,m.transform);return s.e(es(m,t,n,l),{u_tileratio:g,u_crossfade_from:h.fromScale,u_crossfade_to:h.toScale,u_image:0,u_mix:h.t,u_lineatlas_width:m.lineAtlas.width,u_lineatlas_height:m.lineAtlas.height})},ll=(m,t,n,l,h,g)=>{const _=Yi(t,m.transform);return s.e(es(m,t,n,l),{u_image:0,u_image_height:g,u_tileratio:_,u_crossfade_from:h.fromScale,u_crossfade_to:h.toScale,u_image_dash:1,u_mix:h.t,u_lineatlas_width:m.lineAtlas.width,u_lineatlas_height:m.lineAtlas.height})};function Yi(m,t){return 1/s.aN(m,1,t.tileZoom)}function cl(m,t,n){return s.aO(m.transform,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const zc=(m,t,n,l,h)=>{return{u_tl_parent:m,u_scale_parent:t,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(_=l.paint.get("raster-saturation"),_>0?1-1/(1.001-_):-_),u_contrast_factor:(g=l.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:Lc(l.paint.get("raster-hue-rotate")),u_coords_top:[h[0].x,h[0].y,h[1].x,h[1].y],u_coords_bottom:[h[3].x,h[3].y,h[2].x,h[2].y]};var g,_};function Lc(m){m*=Math.PI/180;const t=Math.sin(m),n=Math.cos(m);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Rc=(m,t,n,l,h,g,_,T,I,A,C,R,L)=>{const O=_.transform;return{u_is_size_zoom_constant:+(m==="constant"||m==="source"),u_is_size_feature_constant:+(m==="constant"||m==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:O.cameraToCenterDistance,u_pitch:O.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:O.width/O.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_label_plane_matrix:T,u_coord_matrix:I,u_is_text:+C,u_pitch_with_map:+l,u_is_along_line:h,u_is_variable_anchor:g,u_texsize:R,u_texture:0,u_translation:A,u_pitched_scale:L}},ul=(m,t,n,l,h,g,_,T,I,A,C,R,L,O)=>{const $=_.transform;return s.e(Rc(m,t,n,l,h,g,_,T,I,A,C,R,O),{u_gamma_scale:l?Math.cos($.pitch*Math.PI/180)*$.cameraToCenterDistance:1,u_device_pixel_ratio:_.pixelRatio,u_is_halo:1})},Ta=(m,t,n,l,h,g,_,T,I,A,C,R,L)=>s.e(ul(m,t,n,l,h,g,_,T,I,A,!0,C,0,L),{u_texsize_icon:R,u_texture_icon:1}),Fc=(m,t)=>({u_opacity:m,u_color:t}),Dd=(m,t,n,l,h)=>s.e((function(g,_,T,I){const A=T.imageManager.getPattern(g.from.toString()),C=T.imageManager.getPattern(g.to.toString()),{width:R,height:L}=T.imageManager.getPixelSize(),O=Math.pow(2,I.tileID.overscaledZ),$=I.tileSize*Math.pow(2,T.transform.tileZoom)/O,X=$*(I.tileID.canonical.x+I.tileID.wrap*O),K=$*I.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:A.tl,u_pattern_br_a:A.br,u_pattern_tl_b:C.tl,u_pattern_br_b:C.br,u_texsize:[R,L],u_mix:_.t,u_pattern_size_a:A.displaySize,u_pattern_size_b:C.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/s.aN(I,1,T.transform.tileZoom),u_pixel_coord_upper:[X>>16,K>>16],u_pixel_coord_lower:[65535&X,65535&K]}})(n,h,t,l),{u_opacity:m}),Ih=(m,t)=>{},zd={fillExtrusion:(m,t)=>({u_lightpos:new s.c2(m,t.u_lightpos),u_lightpos_globe:new s.c2(m,t.u_lightpos_globe),u_lightintensity:new s.bq(m,t.u_lightintensity),u_lightcolor:new s.c2(m,t.u_lightcolor),u_vertical_gradient:new s.bq(m,t.u_vertical_gradient),u_opacity:new s.bq(m,t.u_opacity),u_fill_translate:new s.c3(m,t.u_fill_translate)}),fillExtrusionPattern:(m,t)=>({u_lightpos:new s.c2(m,t.u_lightpos),u_lightpos_globe:new s.c2(m,t.u_lightpos_globe),u_lightintensity:new s.bq(m,t.u_lightintensity),u_lightcolor:new s.c2(m,t.u_lightcolor),u_vertical_gradient:new s.bq(m,t.u_vertical_gradient),u_height_factor:new s.bq(m,t.u_height_factor),u_opacity:new s.bq(m,t.u_opacity),u_fill_translate:new s.c3(m,t.u_fill_translate),u_image:new s.b_(m,t.u_image),u_texsize:new s.c3(m,t.u_texsize),u_pixel_coord_upper:new s.c3(m,t.u_pixel_coord_upper),u_pixel_coord_lower:new s.c3(m,t.u_pixel_coord_lower),u_scale:new s.c2(m,t.u_scale),u_fade:new s.bq(m,t.u_fade)}),fill:(m,t)=>({u_fill_translate:new s.c3(m,t.u_fill_translate)}),fillPattern:(m,t)=>({u_image:new s.b_(m,t.u_image),u_texsize:new s.c3(m,t.u_texsize),u_pixel_coord_upper:new s.c3(m,t.u_pixel_coord_upper),u_pixel_coord_lower:new s.c3(m,t.u_pixel_coord_lower),u_scale:new s.c2(m,t.u_scale),u_fade:new s.bq(m,t.u_fade),u_fill_translate:new s.c3(m,t.u_fill_translate)}),fillOutline:(m,t)=>({u_world:new s.c3(m,t.u_world),u_fill_translate:new s.c3(m,t.u_fill_translate)}),fillOutlinePattern:(m,t)=>({u_world:new s.c3(m,t.u_world),u_image:new s.b_(m,t.u_image),u_texsize:new s.c3(m,t.u_texsize),u_pixel_coord_upper:new s.c3(m,t.u_pixel_coord_upper),u_pixel_coord_lower:new s.c3(m,t.u_pixel_coord_lower),u_scale:new s.c2(m,t.u_scale),u_fade:new s.bq(m,t.u_fade),u_fill_translate:new s.c3(m,t.u_fill_translate)}),circle:(m,t)=>({u_camera_to_center_distance:new s.bq(m,t.u_camera_to_center_distance),u_scale_with_map:new s.b_(m,t.u_scale_with_map),u_pitch_with_map:new s.b_(m,t.u_pitch_with_map),u_extrude_scale:new s.c3(m,t.u_extrude_scale),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_globe_extrude_scale:new s.bq(m,t.u_globe_extrude_scale),u_translate:new s.c3(m,t.u_translate)}),collisionBox:(m,t)=>({u_pixel_extrude_scale:new s.c3(m,t.u_pixel_extrude_scale)}),collisionCircle:(m,t)=>({u_viewport_size:new s.c3(m,t.u_viewport_size)}),debug:(m,t)=>({u_color:new s.b$(m,t.u_color),u_overlay:new s.b_(m,t.u_overlay),u_overlay_scale:new s.bq(m,t.u_overlay_scale)}),depth:Ih,clippingMask:Ih,heatmap:(m,t)=>({u_extrude_scale:new s.bq(m,t.u_extrude_scale),u_intensity:new s.bq(m,t.u_intensity),u_globe_extrude_scale:new s.bq(m,t.u_globe_extrude_scale)}),heatmapTexture:(m,t)=>({u_matrix:new s.c0(m,t.u_matrix),u_world:new s.c3(m,t.u_world),u_image:new s.b_(m,t.u_image),u_color_ramp:new s.b_(m,t.u_color_ramp),u_opacity:new s.bq(m,t.u_opacity)}),hillshade:(m,t)=>({u_image:new s.b_(m,t.u_image),u_latrange:new s.c3(m,t.u_latrange),u_exaggeration:new s.bq(m,t.u_exaggeration),u_altitudes:new s.c9(m,t.u_altitudes),u_azimuths:new s.c9(m,t.u_azimuths),u_accent:new s.b$(m,t.u_accent),u_method:new s.b_(m,t.u_method),u_shadows:new s.c8(m,t.u_shadows),u_highlights:new s.c8(m,t.u_highlights)}),hillshadePrepare:(m,t)=>({u_matrix:new s.c0(m,t.u_matrix),u_image:new s.b_(m,t.u_image),u_dimension:new s.c3(m,t.u_dimension),u_zoom:new s.bq(m,t.u_zoom),u_unpack:new s.c1(m,t.u_unpack)}),colorRelief:(m,t)=>({u_image:new s.b_(m,t.u_image),u_unpack:new s.c1(m,t.u_unpack),u_dimension:new s.c3(m,t.u_dimension),u_elevation_stops:new s.b_(m,t.u_elevation_stops),u_color_stops:new s.b_(m,t.u_color_stops),u_color_ramp_size:new s.b_(m,t.u_color_ramp_size),u_opacity:new s.bq(m,t.u_opacity)}),line:(m,t)=>({u_translation:new s.c3(m,t.u_translation),u_ratio:new s.bq(m,t.u_ratio),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_units_to_pixels:new s.c3(m,t.u_units_to_pixels)}),lineGradient:(m,t)=>({u_translation:new s.c3(m,t.u_translation),u_ratio:new s.bq(m,t.u_ratio),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_units_to_pixels:new s.c3(m,t.u_units_to_pixels),u_image:new s.b_(m,t.u_image),u_image_height:new s.bq(m,t.u_image_height)}),linePattern:(m,t)=>({u_translation:new s.c3(m,t.u_translation),u_texsize:new s.c3(m,t.u_texsize),u_ratio:new s.bq(m,t.u_ratio),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_image:new s.b_(m,t.u_image),u_units_to_pixels:new s.c3(m,t.u_units_to_pixels),u_scale:new s.c2(m,t.u_scale),u_fade:new s.bq(m,t.u_fade)}),lineSDF:(m,t)=>({u_translation:new s.c3(m,t.u_translation),u_ratio:new s.bq(m,t.u_ratio),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_units_to_pixels:new s.c3(m,t.u_units_to_pixels),u_image:new s.b_(m,t.u_image),u_mix:new s.bq(m,t.u_mix),u_tileratio:new s.bq(m,t.u_tileratio),u_crossfade_from:new s.bq(m,t.u_crossfade_from),u_crossfade_to:new s.bq(m,t.u_crossfade_to),u_lineatlas_width:new s.bq(m,t.u_lineatlas_width),u_lineatlas_height:new s.bq(m,t.u_lineatlas_height)}),lineGradientSDF:(m,t)=>({u_translation:new s.c3(m,t.u_translation),u_ratio:new s.bq(m,t.u_ratio),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_units_to_pixels:new s.c3(m,t.u_units_to_pixels),u_image:new s.b_(m,t.u_image),u_image_height:new s.bq(m,t.u_image_height),u_tileratio:new s.bq(m,t.u_tileratio),u_crossfade_from:new s.bq(m,t.u_crossfade_from),u_crossfade_to:new s.bq(m,t.u_crossfade_to),u_image_dash:new s.b_(m,t.u_image_dash),u_mix:new s.bq(m,t.u_mix),u_lineatlas_width:new s.bq(m,t.u_lineatlas_width),u_lineatlas_height:new s.bq(m,t.u_lineatlas_height)}),raster:(m,t)=>({u_tl_parent:new s.c3(m,t.u_tl_parent),u_scale_parent:new s.bq(m,t.u_scale_parent),u_buffer_scale:new s.bq(m,t.u_buffer_scale),u_fade_t:new s.bq(m,t.u_fade_t),u_opacity:new s.bq(m,t.u_opacity),u_image0:new s.b_(m,t.u_image0),u_image1:new s.b_(m,t.u_image1),u_brightness_low:new s.bq(m,t.u_brightness_low),u_brightness_high:new s.bq(m,t.u_brightness_high),u_saturation_factor:new s.bq(m,t.u_saturation_factor),u_contrast_factor:new s.bq(m,t.u_contrast_factor),u_spin_weights:new s.c2(m,t.u_spin_weights),u_coords_top:new s.c1(m,t.u_coords_top),u_coords_bottom:new s.c1(m,t.u_coords_bottom)}),symbolIcon:(m,t)=>
806({u_is_size_zoom_constant:new s.b_(m,t.u_is_size_zoom_constant),u_is_size_feature_constant:new s.b_(m,t.u_is_size_feature_constant),u_size_t:new s.bq(m,t.u_size_t),u_size:new s.bq(m,t.u_size),u_camera_to_center_distance:new s.bq(m,t.u_camera_to_center_distance),u_pitch:new s.bq(m,t.u_pitch),u_rotate_symbol:new s.b_(m,t.u_rotate_symbol),u_aspect_ratio:new s.bq(m,t.u_aspect_ratio),u_fade_change:new s.bq(m,t.u_fade_change),u_label_plane_matrix:new s.c0(m,t.u_label_plane_matrix),u_coord_matrix:new s.c0(m,t.u_coord_matrix),u_is_text:new s.b_(m,t.u_is_text),u_pitch_with_map:new s.b_(m,t.u_pitch_with_map),u_is_along_line:new s.b_(m,t.u_is_along_line),u_is_variable_anchor:new s.b_(m,t.u_is_variable_anchor),u_texsize:new s.c3(m,t.u_texsize),u_texture:new s.b_(m,t.u_texture),u_translation:new s.c3(m,t.u_translation),u_pitched_scale:new s.bq(m,t.u_pitched_scale)}),symbolSDF:(m,t)=>({u_is_size_zoom_constant:new s.b_(m,t.u_is_size_zoom_constant),u_is_size_feature_constant:new s.b_(m,t.u_is_size_feature_constant),u_size_t:new s.bq(m,t.u_size_t),u_size:new s.bq(m,t.u_size),u_camera_to_center_distance:new s.bq(m,t.u_camera_to_center_distance),u_pitch:new s.bq(m,t.u_pitch),u_rotate_symbol:new s.b_(m,t.u_rotate_symbol),u_aspect_ratio:new s.bq(m,t.u_aspect_ratio),u_fade_change:new s.bq(m,t.u_fade_change),u_label_plane_matrix:new s.c0(m,t.u_label_plane_matrix),u_coord_matrix:new s.c0(m,t.u_coord_matrix),u_is_text:new s.b_(m,t.u_is_text),u_pitch_with_map:new s.b_(m,t.u_pitch_with_map),u_is_along_line:new s.b_(m,t.u_is_along_line),u_is_variable_anchor:new s.b_(m,t.u_is_variable_anchor),u_texsize:new s.c3(m,t.u_texsize),u_texture:new s.b_(m,t.u_texture),u_gamma_scale:new s.bq(m,t.u_gamma_scale),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_is_halo:new s.b_(m,t.u_is_halo),u_translation:new s.c3(m,t.u_translation),u_pitched_scale:new s.bq(m,t.u_pitched_scale)}),symbolTextAndIcon:(m,t)=>({u_is_size_zoom_constant:new s.b_(m,t.u_is_size_zoom_constant),u_is_size_feature_constant:new s.b_(m,t.u_is_size_feature_constant),u_size_t:new s.bq(m,t.u_size_t),u_size:new s.bq(m,t.u_size),u_camera_to_center_distance:new s.bq(m,t.u_camera_to_center_distance),u_pitch:new s.bq(m,t.u_pitch),u_rotate_symbol:new s.b_(m,t.u_rotate_symbol),u_aspect_ratio:new s.bq(m,t.u_aspect_ratio),u_fade_change:new s.bq(m,t.u_fade_change),u_label_plane_matrix:new s.c0(m,t.u_label_plane_matrix),u_coord_matrix:new s.c0(m,t.u_coord_matrix),u_is_text:new s.b_(m,t.u_is_text),u_pitch_with_map:new s.b_(m,t.u_pitch_with_map),u_is_along_line:new s.b_(m,t.u_is_along_line),u_is_variable_anchor:new s.b_(m,t.u_is_variable_anchor),u_texsize:new s.c3(m,t.u_texsize),u_texsize_icon:new s.c3(m,t.u_texsize_icon),u_texture:new s.b_(m,t.u_texture),u_texture_icon:new s.b_(m,t.u_texture_icon),u_gamma_scale:new s.bq(m,t.u_gamma_scale),u_device_pixel_ratio:new s.bq(m,t.u_device_pixel_ratio),u_is_halo:new s.b_(m,t.u_is_halo),u_translation:new s.c3(m,t.u_translation),u_pitched_scale:new s.bq(m,t.u_pitched_scale)}),background:(m,t)=>({u_opacity:new s.bq(m,t.u_opacity),u_color:new s.b$(m,t.u_color)}),backgroundPattern:(m,t)=>({u_opacity:new s.bq(m,t.u_opacity),u_image:new s.b_(m,t.u_image),u_pattern_tl_a:new s.c3(m,t.u_pattern_tl_a),u_pattern_br_a:new s.c3(m,t.u_pattern_br_a),u_pattern_tl_b:new s.c3(m,t.u_pattern_tl_b),u_pattern_br_b:new s.c3(m,t.u_pattern_br_b),u_texsize:new s.c3(m,t.u_texsize),u_mix:new s.bq(m,t.u_mix),u_pattern_size_a:new s.c3(m,t.u_pattern_size_a),u_pattern_size_b:new s.c3(m,t.u_pattern_size_b),u_scale_a:new s.bq(m,t.u_scale_a),u_scale_b:new s.bq(m,t.u_scale_b),u_pixel_coord_upper:new s.c3(m,t.u_pixel_coord_upper),u_pixel_coord_lower:new s.c3(m,t.u_pixel_coord_lower),u_tile_units_to_pixels:new s.bq(m,t.u_tile_units_to_pixels)}),terrain:(m,t)=>({u_texture:new s.b_(m,t.u_texture),u_ele_delta:new s.bq(m,t.u_ele_delta),u_fog_matrix:new s.c0(m,t.u_fog_matrix),u_fog_color:new s.b$(m,t.u_fog_color),u_fog_ground_blend:new s.bq(m,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new s.bq(m,t.u_fog_ground_blend_opacity),u_horizon_color:new s.b$(m,t.u_horizon_color),u_horizon_fog_blend:new s.bq(m,t.u_horizon_fog_blend),u_is_globe_mode:new s.bq(m,t.u_is_globe_mode)}),terrainDepth:(m,t)=>
vendor: 121,701 bytes, lines 806-808
806({u_ele_delta:new s.bq(m,t.u_ele_delta)}),terrainCoords:(m,t)=>({u_texture:new s.b_(m,t.u_texture),u_terrain_coords_id:new s.bq(m,t.u_terrain_coords_id),u_ele_delta:new s.bq(m,t.u_ele_delta)}),projectionErrorMeasurement:(m,t)=>({u_input:new s.bq(m,t.u_input),u_output_expected:new s.bq(m,t.u_output_expected)}),atmosphere:(m,t)=>({u_sun_pos:new s.c2(m,t.u_sun_pos),u_atmosphere_blend:new s.bq(m,t.u_atmosphere_blend),u_globe_position:new s.c2(m,t.u_globe_position),u_globe_radius:new s.bq(m,t.u_globe_radius),u_inv_proj_matrix:new s.c0(m,t.u_inv_proj_matrix)}),sky:(m,t)=>({u_sky_color:new s.b$(m,t.u_sky_color),u_horizon_color:new s.b$(m,t.u_horizon_color),u_horizon:new s.c3(m,t.u_horizon),u_horizon_normal:new s.c3(m,t.u_horizon_normal),u_sky_horizon_blend:new s.bq(m,t.u_sky_horizon_blend),u_sky_blend:new s.bq(m,t.u_sky_blend)})};class Ld{constructor(t,n,l){this.context=t;const h=t.gl;this.buffer=h.createBuffer(),this.dynamicDraw=!!l,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ph={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Rd{constructor(t,n,l,h){this.length=n.length,this.attributes=l,this.itemSize=n.bytesPerElement,this.dynamicDraw=h,this.context=t;const g=t.gl;this.buffer=g.createBuffer(),t.bindVertexBuffer.set(this.buffer),g.bufferData(g.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let l=0;l<this.attributes.length;l++){const h=n.attributes[this.attributes[l].name];h!==void 0&&t.enableVertexAttribArray(h)}}setVertexAttribPointers(t,n,l){for(let h=0;h<this.attributes.length;h++){const g=this.attributes[h],_=n.attributes[g.name];_!==void 0&&t.vertexAttribPointer(_,g.components,t[Ph[g.type]],!1,this.itemSize,g.offset+this.itemSize*(l||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Rt{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class hl extends Rt{getDefault(){return s.bp.transparent}set(t){const n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class pl extends Rt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class dl extends Rt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Bc extends Rt{getDefault(){return[!0,!0,!0,!0]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Sa extends Rt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class ts extends Rt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class ho extends Rt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const n=this.current;(t.func!==n.func||t.ref!==n.ref||t.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Ni extends Rt{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Ah extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=t,this.dirty=!1}}class Eh extends Rt{getDefault(){return[0,1]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Oc extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=t,this.dirty=!1}}class Ma extends Rt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class fl extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.BLEND):n.disable(n.BLEND),this.current=t,this.dirty=!1}}class ml extends Rt{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class rs extends Rt{getDefault(){return s.bp.transparent}set(t){const n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class gl extends Rt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Ch extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=t,this.dirty=!1}}class po extends Rt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class fo extends Rt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class kh extends Rt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Nc extends Rt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Tt extends Rt{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class yl extends Rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Fd extends Rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Dh extends Rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindTexture(n.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class is extends Rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Bd extends Rt{getDefault(){return null}set(t){const n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Od extends Rt{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;const l=this.gl;Oi(l)?l.bindVertexArray(t):(n=l.getExtension("OES_vertex_array_object"))===null||n===void 0||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class zh extends Rt{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Nd extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class jc extends Rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class mo extends Rt{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class ns extends mo{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class _l extends mo{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Vc extends mo{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}const Uc="Framebuffer is not complete";class vl{constructor(t,n,l,h,g){this.context=t,this.width=n,this.height=l;const _=t.gl,T=this.framebuffer=_.createFramebuffer();if(this.colorAttachment=new ns(t,T),h)this.depthAttachment=g?new Vc(t,T):new _l(t,T);else if(g)throw new Error("Stencil cannot be set without depth");if(_.checkFramebufferStatus(_.FRAMEBUFFER)!==_.FRAMEBUFFER_COMPLETE)throw new Error(Uc)}destroy(){const t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){const l=this.depthAttachment.get();l&&t.deleteRenderbuffer(l)}t.deleteFramebuffer(this.framebuffer)}}class xl{constructor(t){var n,l;if(this.gl=t,this.clearColor=new hl(this),this.clearDepth=new pl(this),this.clearStencil=new dl(this),this.colorMask=new Bc(this),this.depthMask=new Sa(this),this.stencilMask=new ts(this),this.stencilFunc=new ho(this),this.stencilOp=new Ni(this),this.stencilTest=new Ah(this),this.depthRange=new Eh(this),this.depthTest=new Oc(this),this.depthFunc=new Ma(this),this.blend=new fl(this),this.blendFunc=new ml(this),this.blendColor=new rs(this),this.blendEquation=new gl(this),this.cullFace=new Ch(this),this.cullFaceSide=new po(this),this.frontFace=new fo(this),this.program=new kh(this),this.activeTexture=new Nc(this),this.viewport=new Tt(this),this.bindFramebuffer=new yl(this),this.bindRenderbuffer=new Fd(this),this.bindTexture=new Dh(this),this.bindVertexBuffer=new is(this),this.bindElementBuffer=new Bd(this),this.bindVertexArray=new Od(this),this.pixelStoreUnpack=new zh(this),this.pixelStoreUnpackPremultiplyAlpha=new Nd(this),this.pixelStoreUnpackFlipY=new jc(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Oi(t)){this.HALF_FLOAT=t.HALF_FLOAT;const h=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(n=t.RGBA16F)!==null&&n!==void 0?n:h?.RGBA16F_EXT,this.RGB16F=(l=t.RGB16F)!==null&&l!==void 0?l:h?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const h=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=h?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,n){return new Ld(this,t,n)}createVertexBuffer(t,n,l){return new Rd(this,t,n,l)}createRenderbuffer(t,n,l){const h=this.gl,g=h.createRenderbuffer();return this.bindRenderbuffer.set(g),h.renderbufferStorage(h.RENDERBUFFER,t,n,l),this.bindRenderbuffer.set(null),g}createFramebuffer(t,n,l,h){return new vl(this,t,n,l,h)}clear({color:t,depth:n,stencil:l}){const h=this.gl;let g=0;t&&(g|=h.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(g|=h.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),l!==void 0&&(g|=h.STENCIL_BUFFER_BIT,this.clearStencil.set(l),this.stencilMask.set(255)),h.clear(g)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){s.bR(t.blendFunction,Ht.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Oi(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var n;return Oi(this.gl)?this.gl.deleteVertexArray(t):(n=this.gl.getExtension("OES_vertex_array_object"))===null||n===void 0?void 0:n.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Yn;function Ia(m,t,n,l,h){const g=m.context,_=m.transform,T=g.gl,I=m.useProgram("collisionBox"),A=[];let C=0,R=0;for(let Y=0;Y<l.length;Y++){const ee=l[Y],oe=t.getTile(ee).getBucket(n);if(!oe)continue;const J=h?oe.textCollisionBox:oe.iconCollisionBox,ne=oe.collisionCircleArray;ne.length>0&&(A.push({circleArray:ne,circleOffset:R,coord:ee}),C+=ne.length/4,R=C),J&&I.draw(g,T.LINES,_t.disabled,Dt.disabled,m.colorModeForRenderPass(),Ct.disabled,wa(m.transform),m.style.map.terrain&&m.style.map.terrain.getTerrainData(ee),_.getProjectionData({overscaledTileID:ee,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),n.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,null,m.transform.zoom,null,null,J.collisionVertexBuffer)}if(!h||!A.length)return;const L=m.useProgram("collisionCircle"),O=new s.ca;O.resize(4*C),O._trim();let $=0;for(const Y of A)for(let ee=0;ee<Y.circleArray.length/4;ee++){const oe=4*ee,J=Y.circleArray[oe+0],ne=Y.circleArray[oe+1],ce=Y.circleArray[oe+2],ie=Y.circleArray[oe+3];O.emplace($++,J,ne,ce,ie,0),O.emplace($++,J,ne,ce,ie,1),O.emplace($++,J,ne,ce,ie,2),O.emplace($++,J,ne,ce,ie,3)}(!Yn||Yn.length<2*C)&&(Yn=(function(Y){const ee=2*Y,oe=new s.cc;oe.resize(ee),oe._trim();for(let J=0;J<ee;J++){const ne=6*J;oe.uint16[ne+0]=4*J+0,oe.uint16[ne+1]=4*J+1,oe.uint16[ne+2]=4*J+2,oe.uint16[ne+3]=4*J+2,oe.uint16[ne+4]=4*J+3,oe.uint16[ne+5]=4*J+0}return oe})(C));const X=g.createIndexBuffer(Yn,!0),K=g.createVertexBuffer(O,s.cb.members,!0);for(const Y of A){const ee=bh(m.transform);L.draw(g,T.TRIANGLES,_t.disabled,Dt.disabled,m.colorModeForRenderPass(),Ct.disabled,ee,m.style.map.terrain&&m.style.map.terrain.getTerrainData(Y.coord),null,n.id,K,X,s.aX.simpleSegment(0,2*Y.circleOffset,Y.circleArray.length,Y.circleArray.length/2),null,m.transform.zoom,null,null,null)}K.destroy(),X.destroy()}const $c=s.ar(new Float32Array(16));function jd(m,t,n,l,h,g){const{horizontalAlign:_,verticalAlign:T}=s.aS(m);return new s.P((-(_-.5)*t/h+l[0])*g,(-(T-.5)*n/h+l[1])*g)}function as(m,t,n,l,h,g){const _=t.tileAnchorPoint.add(new s.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let T=l.mult(g);n||(T=T.rotate(-h));const I=_.add(T);return yt(I.x,I.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(n){const T=Vt(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(m),I=Math.atan(T.y/T.x)+(T.x<0?Math.PI:0);return m.add(l.rotate(I))}return m.add(l)}function Vd(m,t,n,l,h,g,_,T,I,A,C,R){const L=m.text.placedSymbolArray,O=m.text.dynamicLayoutVertexArray,$=m.icon.dynamicLayoutVertexArray,X={};O.clear();for(let K=0;K<L.length;K++){const Y=L.get(K),ee=Y.hidden||!Y.crossTileID||m.allowVerticalPlacement&&!Y.placedOrientation?null:l[Y.crossTileID];if(ee){const oe=new s.P(Y.anchorX,Y.anchorY),J={getElevation:R,width:h.width,height:h.height,pitchedLabelPlaneMatrix:g,pitchWithMap:n,transform:h,tileAnchorPoint:oe,translation:A,unwrappedTileID:C},ne=n?Ka(oe.x,oe.y,J):Vt(oe.x,oe.y,J),ce=Vo(h.cameraToCenterDistance,ne.signedDistanceFromCamera);let ie=s.aA(m.textSizeData,T,Y)*ce/s.aM;n&&(ie*=m.tilePixelRatio/_);const{width:fe,height:Ae,anchor:be,textOffset:Te,textBoxScale:Se}=ee,Ve=jd(be,fe,Ae,Te,Se,ie),Ue=h.getPitchedTextCorrection(oe.x+A[0],oe.y+A[1],C),Fe=as(ne.point,J,t,Ve,-h.bearingInRadians,Ue),Ze=m.allowVerticalPlacement&&Y.placedOrientation===s.az.vertical?Math.PI/2:0;for(let gt=0;gt<Y.numGlyphs;gt++)s.aG(O,Fe,Ze);I&&Y.associatedIconIndex>=0&&(X[Y.associatedIconIndex]={shiftedAnchor:Fe,angle:Ze})}else ga(Y.numGlyphs,O)}if(I){$.clear();const K=m.icon.placedSymbolArray;for(let Y=0;Y<K.length;Y++){const ee=K.get(Y);if(ee.hidden)ga(ee.numGlyphs,$);else{const oe=X[Y];if(oe)for(let J=0;J<ee.numGlyphs;J++)s.aG($,oe.shiftedAnchor,oe.angle);else ga(ee.numGlyphs,$)}}m.icon.dynamicLayoutVertexBuffer.updateData($)}m.text.dynamicLayoutVertexBuffer.updateData(O)}function Lh(m,t,n){return n.iconsInText&&t?"symbolTextAndIcon":m?"symbolSDF":"symbolIcon"}function os(m,t,n,l,h,g,_,T,I,A,C,R,L){const O=m.context,$=O.gl,X=m.transform,K=T==="map",Y=I==="map",ee=T!=="viewport"&&n.layout.get("symbol-placement")!=="point",oe=K&&!Y&&!ee,J=!n.layout.get("symbol-sort-key").isConstant();let ne=!1;const ce=m.getDepthModeForSublayer(0,_t.ReadOnly),ie=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),fe=[],Ae=X.getCircleRadiusCorrection();for(const be of l){const Te=t.getTile(be),Se=Te.getBucket(n);if(!Se)continue;const Ve=h?Se.text:Se.icon;if(!Ve||!Ve.segments.get().length||!Ve.hasVisibleVertices)continue;const Ue=Ve.programConfigurations.get(n.id),Fe=h||Se.sdfIcons,Ze=h?Se.textSizeData:Se.iconSizeData,gt=Y||X.pitch!==0,Nt=m.useProgram(Lh(Fe,h,Se),Ue),ir=s.ay(Ze,X.zoom),Xt=m.style.map.terrain&&m.style.map.terrain.getTerrainData(be);let or,Yt,yr,sr,qr=[0,0],kr=null;if(h)Yt=Te.glyphAtlasTexture,yr=$.LINEAR,or=Te.glyphAtlasTexture.size,Se.iconsInText&&(qr=Te.imageAtlasTexture.size,kr=Te.imageAtlasTexture,sr=gt||m.options.rotating||m.options.zooming||Ze.kind==="composite"||Ze.kind==="camera"?$.LINEAR:$.NEAREST);else{const er=n.layout.get("icon-size").constantOr(0)!==1||Se.iconsNeedLinear;Yt=Te.imageAtlasTexture,yr=Fe||m.options.rotating||m.options.zooming||er||gt?$.LINEAR:$.NEAREST,or=Te.imageAtlasTexture.size}const Tr=s.aN(Te,1,m.transform.zoom),ei=Ai(K,m.transform,Tr),ta=s.N();s.aB(ta,ei);const kn=Ks(Y,K,m.transform,Tr),_n=s.aO(X,Te,g,_),Mi=X.getProjectionData({overscaledTileID:be,applyGlobeMatrix:!L,applyTerrainMatrix:!0}),Da=ie&&Se.hasTextData(),Is=n.layout.get("icon-text-fit")!=="none"&&Da&&Se.hasIconData();if(ee){const er=m.style.map.terrain?(jr,Vr)=>m.style.map.terrain.getElevation(be,jr,Vr):null,Kt=n.layout.get("text-rotation-alignment")==="map";Js(Se,m,h,ei,ta,Y,A,Kt,be.toUnwrapped(),X.width,X.height,_n,er)}const za=h&&ie||Is,Ui=ee||za?$c:Y?ei:m.transform.clipSpaceToPixelsMatrix,vn=Fe&&n.paint.get(h?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let tn;tn=Fe?Se.iconsInText?Ta(Ze.kind,ir,oe,Y,ee,za,m,Ui,kn,_n,or,qr,Ae):ul(Ze.kind,ir,oe,Y,ee,za,m,Ui,kn,_n,h,or,0,Ae):Rc(Ze.kind,ir,oe,Y,ee,za,m,Ui,kn,_n,h,or,Ae);const rn={program:Nt,buffers:Ve,uniformValues:tn,projectionData:Mi,atlasTexture:Yt,atlasTextureIcon:kr,atlasInterpolation:yr,atlasInterpolationIcon:sr,isSDF:Fe,hasHalo:vn};if(J&&Se.canOverlap){ne=!0;const er=Ve.segments.get();for(const Kt of er)fe.push({segments:new s.aX([Kt]),sortKey:Kt.sortKey,state:rn,terrainData:Xt})}else fe.push({segments:Ve.segments,sortKey:0,state:rn,terrainData:Xt})}ne&&fe.sort(((be,Te)=>be.sortKey-Te.sortKey));for(const be of fe){const Te=be.state;if(O.activeTexture.set($.TEXTURE0),Te.atlasTexture.bind(Te.atlasInterpolation,$.CLAMP_TO_EDGE),Te.atlasTextureIcon&&(O.activeTexture.set($.TEXTURE1),Te.atlasTextureIcon&&Te.atlasTextureIcon.bind(Te.atlasInterpolationIcon,$.CLAMP_TO_EDGE)),Te.isSDF){const Se=Te.uniformValues;Te.hasHalo&&(Se.u_is_halo=1,bl(Te.buffers,be.segments,n,m,Te.program,ce,C,R,Se,Te.projectionData,be.terrainData)),Se.u_is_halo=0}bl(Te.buffers,be.segments,n,m,Te.program,ce,C,R,Te.uniformValues,Te.projectionData,be.terrainData)}}function bl(m,t,n,l,h,g,_,T,I,A,C){const R=l.context;h.draw(R,R.gl.TRIANGLES,g,_,T,Ct.backCCW,I,C,A,n.id,m.layoutVertexBuffer,m.indexBuffer,t,n.paint,l.transform.zoom,m.programConfigurations.get(n.id),m.dynamicLayoutVertexBuffer,m.opacityVertexBuffer)}function Rh(m,t,n,l,h){const g=m.context,_=g.gl,T=Dt.disabled,I=new Ht([_.ONE,_.ONE],s.bp.transparent,[!0,!0,!0,!0]),A=t.getBucket(n);if(!A)return;const C=l.key;let R=n.heatmapFbos.get(C);R||(R=ss(g,t.tileSize,t.tileSize),n.heatmapFbos.set(C,R)),g.bindFramebuffer.set(R.framebuffer),g.viewport.set([0,0,t.tileSize,t.tileSize]),g.clear({color:s.bp.transparent});const L=A.programConfigurations.get(n.id),O=m.useProgram("heatmap",L,!h),$=m.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),X=m.style.map.terrain.getTerrainData(l);O.draw(g,_.TRIANGLES,_t.disabled,T,I,Ct.disabled,uo(t,m.transform.zoom,n.paint.get("heatmap-intensity"),1),X,$,n.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,n.paint,m.transform.zoom,L)}function Fh(m,t,n,l,h){const g=m.context,_=g.gl,T=m.transform;g.setColorMode(m.colorModeForRenderPass());const I=wl(g,t),A=n.key,C=t.heatmapFbos.get(A);if(!C)return;g.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,C.colorAttachment.get()),g.activeTexture.set(_.TEXTURE1),I.bind(_.LINEAR,_.CLAMP_TO_EDGE);const R=T.getProjectionData({overscaledTileID:n,applyTerrainMatrix:h,applyGlobeMatrix:!l});m.useProgram("heatmapTexture").draw(g,_.TRIANGLES,_t.disabled,Dt.disabled,m.colorModeForRenderPass(),Ct.disabled,wh(m,t,0,1),null,R,t.id,m.rasterBoundsBuffer,m.quadTriangleIndexBuffer,m.rasterBoundsSegments,t.paint,T.zoom),C.destroy(),t.heatmapFbos.delete(A)}function ss(m,t,n){var l,h;const g=m.gl,_=g.createTexture();g.bindTexture(g.TEXTURE_2D,_),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR);const T=(l=m.HALF_FLOAT)!==null&&l!==void 0?l:g.UNSIGNED_BYTE,I=(h=m.RGBA16F)!==null&&h!==void 0?h:g.RGBA;g.texImage2D(g.TEXTURE_2D,0,I,t,n,0,g.RGBA,T,null);const A=m.createFramebuffer(t,n,!1,!1);return A.colorAttachment.set(_),A}function wl(m,t){return t.colorRampTexture||(t.colorRampTexture=new s.T(m,t.colorRamp,m.gl.RGBA)),t.colorRampTexture}function Bh(m,t,n,l,h,g,_,T){let I=256;if(h.stepInterpolant){const A=t.getSource().maxzoom,C=_.canonical.z===A?Math.ceil(1<<m.transform.maxZoom-_.canonical.z):1;I=s.an(s.ce(g.maxLineLength/s.a5*1024*C),256,n.maxTextureSize)}return T.gradient=s.cf({expression:h.gradientExpression(),evaluationKey:"lineProgress",resolution:I,image:T.gradient||void 0,clips:g.lineClipsArray}),T.texture?T.texture.update(T.gradient):T.texture=new s.T(n,T.gradient,l.RGBA),T.version=h.gradientVersion,T.texture}function Oh(m,t,n,l,h){m.activeTexture.set(t.TEXTURE0),n.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),l.updatePaintBuffers(h)}function br(m,t,n,l,h,g){(h||m.lineAtlas.dirty)&&(t.activeTexture.set(n.TEXTURE0),m.lineAtlas.bind(t)),l.updatePaintBuffers(g)}function Pa(m,t,n,l,h,g,_){const T=g.gradients[h.id];let I=T.texture;h.gradientVersion!==T.version&&(I=Bh(m,t,n,l,h,g,_,T)),n.activeTexture.set(l.TEXTURE0),I.bind(h.stepInterpolant?l.NEAREST:l.LINEAR,l.CLAMP_TO_EDGE)}function Ci(m,t,n,l,h,g,_,T,I){const A=g.gradients[h.id];let C=A.texture;h.gradientVersion!==A.version&&(C=Bh(m,t,n,l,h,g,_,A)),n.activeTexture.set(l.TEXTURE0),C.bind(h.stepInterpolant?l.NEAREST:l.LINEAR,l.CLAMP_TO_EDGE),n.activeTexture.set(l.TEXTURE1),m.lineAtlas.bind(n),T.updatePaintBuffers(I)}function Tl(m,t,n,l,h){if(!n||!l||!l.imageAtlas)return;const g=l.imageAtlas.patternPositions;let _=g[n.to.toString()],T=g[n.from.toString()];if(!_&&T&&(_=T),!T&&_&&(T=_),!_||!T){const I=h.getPaintProperty(t);_=g[I],T=g[I]}_&&T&&m.setConstantPatternPositions(_,T)}function ls(m,t,n,l,h,g,_,T){const I=m.context.gl,A="fill-pattern",C=n.paint.get(A),R=C&&C.constantOr(1),L=n.getCrossfadeParameters();let O,$,X,K,Y;const ee=m.transform,oe=n.paint.get("fill-translate"),J=n.paint.get("fill-translate-anchor");_?($=R&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=I.LINES):($=R?"fillPattern":"fill",O=I.TRIANGLES);const ne=C.constantOr(null);for(const ce of l){const ie=t.getTile(ce);if(R&&!ie.patternsLoaded())continue;const fe=ie.getBucket(n);if(!fe)continue;const Ae=fe.programConfigurations.get(n.id),be=m.useProgram($,Ae),Te=m.style.map.terrain&&m.style.map.terrain.getTerrainData(ce);R&&(m.context.activeTexture.set(I.TEXTURE0),ie.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Ae.updatePaintBuffers(L)),Tl(Ae,A,ne,ie,n);const Se=ee.getProjectionData({overscaledTileID:ce,applyGlobeMatrix:!T,applyTerrainMatrix:!0}),Ve=s.aO(ee,ie,oe,J);if(_){K=fe.indexBuffer2,Y=fe.segments2;const Fe=[I.drawingBufferWidth,I.drawingBufferHeight];X=$==="fillOutlinePattern"&&R?vh(m,L,ie,Fe,Ve):_h(Fe,Ve)}else K=fe.indexBuffer,Y=fe.segments,X=R?Cc(m,L,ie,Ve):{u_fill_translate:Ve};const Ue=m.stencilModeForClipping(ce);be.draw(m.context,O,h,Ue,g,Ct.backCCW,X,Te,Se,n.id,fe.layoutVertexBuffer,K,Y,n.paint,m.transform.zoom,Ae)}}function Sl(m,t,n,l,h,g,_,T){const I=m.context,A=I.gl,C="fill-extrusion-pattern",R=n.paint.get(C),L=R.constantOr(1),O=n.getCrossfadeParameters(),$=n.paint.get("fill-extrusion-opacity"),X=R.constantOr(null),K=m.transform;for(const Y of l){const ee=t.getTile(Y),oe=ee.getBucket(n);if(!oe)continue;const J=m.style.map.terrain&&m.style.map.terrain.getTerrainData(Y),ne=oe.programConfigurations.get(n.id),ce=m.useProgram(L?"fillExtrusionPattern":"fillExtrusion",ne);L&&(m.context.activeTexture.set(A.TEXTURE0),ee.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),ne.updatePaintBuffers(O));const ie=K.getProjectionData({overscaledTileID:Y,applyGlobeMatrix:!T,applyTerrainMatrix:!0});Tl(ne,C,X,ee,n);const fe=s.aO(K,ee,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Ae=n.paint.get("fill-extrusion-vertical-gradient"),be=L?Ec(m,Ae,$,fe,Y,O,ee):Ac(m,Ae,$,fe);ce.draw(I,I.gl.TRIANGLES,h,g,_,Ct.backCCW,be,J,ie,n.id,oe.layoutVertexBuffer,oe.indexBuffer,oe.segments,n.paint,m.transform.zoom,ne,m.style.map.terrain&&oe.centroidVertexBuffer)}}function Kn(m,t,n,l,h,g,_,T,I){var A;const C=m.style.projection,R=m.context,L=m.transform,O=R.gl,$=[`#define NUM_ILLUMINATION_SOURCES ${n.paint.get("hillshade-highlight-color").values.length}`],X=m.useProgram("hillshade",null,!1,$),K=!m.options.moving;for(const Y of l){const ee=t.getTile(Y),oe=ee.fbo;if(!oe)continue;const J=C.getMeshFromTileID(R,Y.canonical,T,!0,"raster"),ne=(A=m.style.map.terrain)===null||A===void 0?void 0:A.getTerrainData(Y);R.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,oe.colorAttachment.get());const ce=L.getProjectionData({overscaledTileID:Y,aligned:K,applyGlobeMatrix:!I,applyTerrainMatrix:!0});X.draw(R,O.TRIANGLES,g,h[Y.overscaledZ],_,Ct.backCCW,sl(m,ee,n),ne,ce,n.id,J.vertexBuffer,J.indexBuffer,J.segments)}}function cs(m,t,n,l,h,g,_,T,I){var A;const C=m.style.projection,R=m.context,L=m.transform,O=R.gl,$=m.useProgram("colorRelief"),X=!m.options.moving;let K=!0,Y=0;for(const ee of l){const oe=t.getTile(ee),J=oe.dem;if(K){const be=O.getParameter(O.MAX_TEXTURE_SIZE),{elevationTexture:Te,colorTexture:Se}=n.getColorRampTextures(R,be,J.getUnpackVector());R.activeTexture.set(O.TEXTURE1),Te.bind(O.NEAREST,O.CLAMP_TO_EDGE),R.activeTexture.set(O.TEXTURE4),Se.bind(O.LINEAR,O.CLAMP_TO_EDGE),K=!1,Y=Te.size[0]}if(!J||!J.data)continue;const ne=J.stride,ce=J.getPixels();if(R.activeTexture.set(O.TEXTURE0),R.pixelStoreUnpackPremultiplyAlpha.set(!1),oe.demTexture=oe.demTexture||m.getTileTexture(ne),oe.demTexture){const be=oe.demTexture;be.update(ce,{premultiply:!1}),be.bind(O.LINEAR,O.CLAMP_TO_EDGE)}else oe.demTexture=new s.T(R,ce,O.RGBA,{premultiply:!1}),oe.demTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE);const ie=C.getMeshFromTileID(R,ee.canonical,T,!0,"raster"),fe=(A=m.style.map.terrain)===null||A===void 0?void 0:A.getTerrainData(ee),Ae=L.getProjectionData({overscaledTileID:ee,aligned:X,applyGlobeMatrix:!I,applyTerrainMatrix:!0});$.draw(R,O.TRIANGLES,g,h[ee.overscaledZ],_,Ct.backCCW,Th(n,oe.dem,Y),fe,Ae,n.id,ie.vertexBuffer,ie.indexBuffer,ie.segments)}}const Aa=[new s.P(0,0),new s.P(s.a5,0),new s.P(s.a5,s.a5),new s.P(0,s.a5)];function go(m,t,n,l,h,g,_,T,I=!1,A=!1){const C=l[l.length-1].overscaledZ,R=m.context,L=R.gl,O=m.useProgram("raster"),$=m.transform,X=m.style.projection,K=m.colorModeForRenderPass(),Y=!m.options.moving,ee=n.paint.get("raster-opacity"),oe=n.paint.get("raster-resampling"),J=n.paint.get("raster-fade-duration"),ne=!!m.style.map.terrain;for(const ce of l){const ie=m.getDepthModeForSublayer(ce.overscaledZ-C,ee===1?_t.ReadWrite:_t.ReadOnly,L.LESS),fe=t.getTile(ce),Ae=oe==="nearest"?L.NEAREST:L.LINEAR;R.activeTexture.set(L.TEXTURE0),fe.texture.bind(Ae,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),R.activeTexture.set(L.TEXTURE1);const{parentTile:be,parentScaleBy:Te,parentTopLeft:Se,fadeValues:Ve}=Nh(fe,t,J,ne);fe.fadeOpacity=Ve.tileOpacity,be?(be.fadeOpacity=Ve.parentTileOpacity,be.texture.bind(Ae,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST)):fe.texture.bind(Ae,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),fe.texture.useMipmap&&R.extTextureFilterAnisotropic&&m.transform.pitch>20&&L.texParameterf(L.TEXTURE_2D,R.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,R.extTextureFilterAnisotropicMax);const Ue=m.style.map.terrain&&m.style.map.terrain.getTerrainData(ce),Fe=$.getProjectionData({overscaledTileID:ce,aligned:Y,applyGlobeMatrix:!A,applyTerrainMatrix:!0}),Ze=zc(Se,Te,Ve.fadeMix,n,T),gt=X.getMeshFromTileID(R,ce.canonical,g,_,"raster");O.draw(R,L.TRIANGLES,ie,h?h[ce.overscaledZ]:Dt.disabled,K,I?Ct.frontCCW:Ct.backCCW,Ze,Ue,Fe,n.id,gt.vertexBuffer,gt.indexBuffer,gt.segments)}}function Nh(m,t,n,l){const h={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(n===0||l)return h;if(m.fadingParentID){const g=t.getLoadedTile(m.fadingParentID);if(!g)return h;const _=Math.pow(2,g.tileID.overscaledZ-m.tileID.overscaledZ),T=[m.tileID.canonical.x*_%1,m.tileID.canonical.y*_%1],I=(function(A,C,R){const L=me(),O=(L-C.timeAdded)/R,$=A.fadingDirection===Pe.Incoming,X=s.an((L-A.timeAdded)/R,0,1),K=s.an(1-O,0,1),Y=$?X:K;return{tileOpacity:Y,parentTileOpacity:$?K:X,fadeMix:{opacity:1,mix:1-Y}}})(m,g,n);return{parentTile:g,parentScaleBy:_,parentTopLeft:T,fadeValues:I}}if(m.selfFading){const g=(function(_,T){const I=(me()-_.timeAdded)/T,A=s.an(I,0,1);return{tileOpacity:A,fadeMix:{opacity:A,mix:0}}})(m,n);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:g}}return h}const jh=new s.bp(1,0,0,1),Vh=new s.bp(0,1,0,1),Uh=new s.bp(0,0,1,1),$h=new s.bp(1,0,1,1),Jn=new s.bp(0,1,1,1);function Gc(m,t,n,l){us(m,0,t+n/2,m.transform.width,n,l)}function qc(m,t,n,l){us(m,t-n/2,0,n,m.transform.height,l)}function us(m,t,n,l,h,g){const _=m.context,T=_.gl;T.enable(T.SCISSOR_TEST),T.scissor(t*m.pixelRatio,n*m.pixelRatio,l*m.pixelRatio,h*m.pixelRatio),_.clear({color:g}),T.disable(T.SCISSOR_TEST)}function Gh(m,t,n){const l=m.context,h=l.gl,g=m.useProgram("debug"),_=_t.disabled,T=Dt.disabled,I=m.colorModeForRenderPass(),A="$debug",C=m.style.map.terrain&&m.style.map.terrain.getTerrainData(n);l.activeTexture.set(h.TEXTURE0);const R=t.getTileByID(n.key).latestRawTileData,L=Math.floor((R&&R.byteLength||0)/1024),O=t.getTile(n).tileSize,$=512/Math.min(O,512)*(n.overscaledZ/m.transform.zoom)*.5;let X=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(X+=` => ${n.overscaledZ}`),(function(Y,ee){Y.initDebugOverlayCanvas();const oe=Y.debugOverlayCanvas,J=Y.context.gl,ne=Y.debugOverlayCanvas.getContext("2d");ne.clearRect(0,0,oe.width,oe.height),ne.shadowColor="white",ne.shadowBlur=2,ne.lineWidth=1.5,ne.strokeStyle="white",ne.textBaseline="top",ne.font="bold 36px Open Sans, sans-serif",ne.fillText(ee,5,5),ne.strokeText(ee,5,5),Y.debugOverlayTexture.update(oe),Y.debugOverlayTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE)})(m,`${X} ${L}kB`);const K=m.transform.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});g.draw(l,h.TRIANGLES,_,T,Ht.alphaBlended,Ct.disabled,kc(s.bp.transparent,$),null,K,A,m.debugBuffer,m.quadTriangleIndexBuffer,m.debugSegments),g.draw(l,h.LINE_STRIP,_,T,I,Ct.disabled,kc(s.bp.red),C,K,A,m.debugBuffer,m.tileBorderIndexBuffer,m.debugSegments)}function Zc(m,t,n,l){const{isRenderingGlobe:h}=l,g=m.context,_=g.gl,T=m.transform,I=m.colorModeForRenderPass(),A=m.getDepthModeFor3D(),C=m.useProgram("terrain");g.bindFramebuffer.set(null),g.viewport.set([0,0,m.width,m.height]);for(const R of n){const L=t.getTerrainMesh(R.tileID),O=m.renderToTexture.getTexture(R),$=t.getTerrainData(R.tileID);g.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,O.texture);const X=t.getMeshFrameDelta(T.zoom),K=T.calculateFogMatrix(R.tileID.toUnwrapped()),Y=Ed(X,K,m.style.sky,T.pitch,h),ee=T.getProjectionData({overscaledTileID:R.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});C.draw(g,_.TRIANGLES,A,Dt.disabled,I,Ct.backCCW,Y,$,ee,"terrain",L.vertexBuffer,L.indexBuffer,L.segments)}}function Wc(m,t){if(!t.mesh){const n=new s.aW;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1);const l=new s.aY;l.emplaceBack(0,1,2),l.emplaceBack(0,2,3),t.mesh=new Wt(m.createVertexBuffer(n,Wn.members),m.createIndexBuffer(l),s.aX.simpleSegment(0,0,n.length,l.length))}return t.mesh}class qh{constructor(t,n){this.context=new xl(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:s.ar(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Bi.maxOverzooming+Bi.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ti}resize(t,n,l){if(this.width=Math.floor(t*l),this.height=Math.floor(n*l),this.pixelRatio=l,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style._order)this.style._layers[h].resize()}setup(){const t=this.context,n=new s.aW;n.emplaceBack(0,0),n.emplaceBack(s.a5,0),n.emplaceBack(0,s.a5),n.emplaceBack(s.a5,s.a5),this.tileExtentBuffer=t.createVertexBuffer(n,Wn.members),this.tileExtentSegments=s.aX.simpleSegment(0,0,4,2);const l=new s.aW;l.emplaceBack(0,0),l.emplaceBack(s.a5,0),l.emplaceBack(0,s.a5),l.emplaceBack(s.a5,s.a5),this.debugBuffer=t.createVertexBuffer(l,Wn.members),this.debugSegments=s.aX.simpleSegment(0,0,4,5);const h=new s.ch;h.emplaceBack(0,0,0,0),h.emplaceBack(s.a5,0,s.a5,0),h.emplaceBack(0,s.a5,0,s.a5),h.emplaceBack(s.a5,s.a5,s.a5,s.a5),this.rasterBoundsBuffer=t.createVertexBuffer(h,Ad.members),this.rasterBoundsSegments=s.aX.simpleSegment(0,0,4,2);const g=new s.aW;g.emplaceBack(0,0),g.emplaceBack(s.a5,0),g.emplaceBack(0,s.a5),g.emplaceBack(s.a5,s.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(g,Wn.members),this.rasterBoundsSegmentsPosOnly=s.aX.simpleSegment(0,0,4,5);const _=new s.aW;_.emplaceBack(0,0),_.emplaceBack(1,0),_.emplaceBack(0,1),_.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(_,Wn.members),this.viewportSegments=s.aX.simpleSegment(0,0,4,2);const T=new s.ci;T.emplaceBack(0),T.emplaceBack(1),T.emplaceBack(3),T.emplaceBack(2),T.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(T);const I=new s.aY;I.emplaceBack(1,0,2),I.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(I);const A=this.context.gl;this.stencilClearMode=new Dt({func:A.ALWAYS,mask:0},0,255,A.ZERO,A.ZERO,A.ZERO),this.tileExtentMesh=new Wt(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const l=s.N();s.c7(l,0,this.width,this.height,0,0,1),s.Q(l,l,[n.drawingBufferWidth,n.drawingBufferHeight,0]);const h={mainMatrix:l,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:l};this.useProgram("clippingMask",null,!0).draw(t,n.TRIANGLES,_t.disabled,this.stencilClearMode,Ht.disabled,Ct.disabled,null,null,h,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n,l){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();const h=this.context;h.setColorMode(Ht.disabled),h.setDepthMode(_t.disabled);const g={};for(const _ of n)g[_.key]=this.nextStencilID++;this._renderTileMasks(g,n,l,!0),this._renderTileMasks(g,n,l,!1),this._tileClippingMaskIDs=g}_renderTileMasks(t,n,l,h){const g=this.context,_=g.gl,T=this.style.projection,I=this.transform,A=this.useProgram("clippingMask");for(const C of n){const R=t[C.key],L=this.style.map.terrain&&this.style.map.terrain.getTerrainData(C),O=T.getMeshFromTileID(this.context,C.canonical,h,!0,"stencil"),$=I.getProjectionData({overscaledTileID:C,applyGlobeMatrix:!l,applyTerrainMatrix:!0});A.draw(g,_.TRIANGLES,_t.disabled,new Dt({func:_.ALWAYS,mask:0},R,255,_.KEEP,_.KEEP,_.REPLACE),Ht.disabled,l?Ct.disabled:Ct.backCCW,null,L,$,"$clipping",O.vertexBuffer,O.indexBuffer,O.segments)}}_renderTilesDepthBuffer(){const t=this.context,n=t.gl,l=this.style.projection,h=this.transform,g=this.useProgram("depth"),_=this.getDepthModeFor3D(),T=fr(h,{tileSize:h.tileSize});for(const I of T){const A=this.style.map.terrain&&this.style.map.terrain.getTerrainData(I),C=l.getMeshFromTileID(this.context,I.canonical,!0,!0,"raster"),R=h.getProjectionData({overscaledTileID:I,applyGlobeMatrix:!0,applyTerrainMatrix:!0});g.draw(t,n.TRIANGLES,_,Dt.disabled,Ht.disabled,Ct.backCCW,null,A,R,"$clipping",C.vertexBuffer,C.indexBuffer,C.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new Dt({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new Dt({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const n=this.context.gl,l=t.sort(((_,T)=>T.overscaledZ-_.overscaledZ)),h=l[l.length-1].overscaledZ,g=l[0].overscaledZ-h+1;if(g>1){this.currentStencilSource=void 0,this.nextStencilID+g>256&&this.clearStencil();const _={};for(let T=0;T<g;T++)_[T+h]=new Dt({func:n.GEQUAL,mask:255},T+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=g,[_,l]}return[{[h]:Dt.disabled},l]}stencilConfigForOverlapTwoPass(t){const n=this.context.gl,l=t.sort(((_,T)=>T.overscaledZ-_.overscaledZ)),h=l[l.length-1].overscaledZ,g=l[0].overscaledZ-h+1;if(this.clearStencil(),g>1){const _={},T={};for(let I=0;I<g;I++)_[I+h]=new Dt({func:n.GREATER,mask:255},g+1+I,255,n.KEEP,n.KEEP,n.REPLACE),T[I+h]=new Dt({func:n.GREATER,mask:255},1+I,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*g+1,[_,T,l]}return this.nextStencilID=3,[{[h]:new Dt({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[h]:new Dt({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},l]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new Ht([t.CONSTANT_COLOR,t.ONE],new s.bp(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ht.unblended:Ht.alphaBlended}getDepthModeForSublayer(t,n,l){if(!this.opaquePassEnabledForLayer())return _t.disabled;const h=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new _t(l||this.context.gl.LEQUAL,n,[h,h])}getDepthModeFor3D(){return new _t(this.context.gl.LEQUAL,_t.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){var l,h;this.style=t,this.options=n,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(me()),this.imageManager.beginFrame();const g=this.style._order,_=this.style.tileManagers,T={},I={},A={},C={isRenderingToTexture:!1,isRenderingGlobe:((l=t.projection)===null||l===void 0?void 0:l.transitionState)>0};for(const L in _){const O=_[L];O.used&&O.prepare(this.context),T[L]=O.getVisibleCoordinates(!1),I[L]=T[L].slice().reverse(),A[L]=O.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let L=0;L<g.length;L++)if(this.style._layers[g[L]].is3D()){this.opaquePassCutoff=L;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const L of g){const O=this.style._layers[L];if(!O.hasOffscreenPass()||O.isHidden(this.transform.zoom))continue;const $=I[O.source];(O.type==="custom"||$.length)&&this.renderLayer(this,_[O.source],O,$,C)}if((h=this.style.projection)===null||h===void 0||h.updateGPUdependent({context:this.context,useProgram:L=>this.useProgram(L)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?s.bp.black:s.bp.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(L,O){const $=L.context,X=$.gl,K=((ce,ie,fe)=>{const Ae=Math.cos(ie.rollInRadians),be=Math.sin(ie.rollInRadians),Te=Ut(ie),Se=ie.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:ce.properties.get("sky-color"),u_horizon_color:ce.properties.get("horizon-color"),u_horizon:[(ie.width/2-Te*be)*fe,(ie.height/2+Te*Ae)*fe],u_horizon_normal:[-be,Ae],u_sky_horizon_blend:ce.properties.get("sky-horizon-blend")*ie.height/2*fe,u_sky_blend:Se}})(O,L.style.map.transform,L.pixelRatio),Y=new _t(X.LEQUAL,_t.ReadWrite,[0,1]),ee=Dt.disabled,oe=L.colorModeForRenderPass(),J=L.useProgram("sky"),ne=Wc($,O);J.draw($,X.TRIANGLES,Y,ee,oe,Ct.disabled,K,null,void 0,"sky",ne.vertexBuffer,ne.indexBuffer,ne.segments)})(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=g.length-1;this.currentLayer>=0;this.currentLayer--){const L=this.style._layers[g[this.currentLayer]],O=_[L.source],$=T[L.source];this._renderTileClippingMasks(L,$,!1),this.renderLayer(this,O,L,$,C)}this.renderPass="translucent";let R=!1;for(this.currentLayer=0;this.currentLayer<g.length;this.currentLayer++){const L=this.style._layers[g[this.currentLayer]],O=_[L.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(L,C))continue;this.opaquePassEnabledForLayer()||R||(R=!0,C.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const $=(L.type==="symbol"?A:I)[L.source];this._renderTileClippingMasks(L,T[L.source],!!this.renderToTexture),this.renderLayer(this,O,L,$,C)}if(C.isRenderingGlobe&&(function(L,O,$){const X=L.context,K=X.gl,Y=L.useProgram("atmosphere"),ee=new _t(K.LEQUAL,_t.ReadOnly,[0,1]),oe=L.transform,J=(function(Se,Ve){const Ue=Se.properties.get("position"),Fe=[-Ue.x,-Ue.y,-Ue.z],Ze=s.ar(new Float64Array(16));return Se.properties.get("anchor")==="map"&&(s.bg(Ze,Ze,Ve.rollInRadians),s.bh(Ze,Ze,-Ve.pitchInRadians),s.bg(Ze,Ze,Ve.bearingInRadians),s.bh(Ze,Ze,Ve.center.lat*Math.PI/180),s.bJ(Ze,Ze,-Ve.center.lng*Math.PI/180)),s.cg(Fe,Fe,Ze),Fe})($,L.transform),ne=oe.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),ce=O.properties.get("atmosphere-blend")*ne.projectionTransition;if(ce===0)return;const ie=xa(oe.worldSize,oe.center.lat),fe=oe.inverseProjectionMatrix,Ae=new Float64Array(4);Ae[3]=1,s.aH(Ae,Ae,oe.modelViewProjectionMatrix),Ae[0]/=Ae[3],Ae[1]/=Ae[3],Ae[2]/=Ae[3],Ae[3]=1,s.aH(Ae,Ae,fe),Ae[0]/=Ae[3],Ae[1]/=Ae[3],Ae[2]/=Ae[3],Ae[3]=1;const be=((Se,Ve,Ue,Fe,Ze)=>({u_sun_pos:Se,u_atmosphere_blend:Ve,u_globe_position:Ue,u_globe_radius:Fe,u_inv_proj_matrix:Ze}))(J,ce,[Ae[0],Ae[1],Ae[2]],ie,fe),Te=Wc(X,O);Y.draw(X,K.TRIANGLES,ee,Dt.disabled,Ht.alphaBlended,Ct.disabled,be,null,null,"atmosphere",Te.vertexBuffer,Te.indexBuffer,Te.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const L=(function(O,$){let X=null;const K=Object.values(O._layers).flatMap((J=>J.source&&!J.isHidden($)?[O.tileManagers[J.source]]:[])),Y=K.filter((J=>J.getSource().type==="vector")),ee=K.filter((J=>J.getSource().type!=="vector")),oe=J=>{(!X||X.getSource().maxzoom<J.getSource().maxzoom)&&(X=J)};return Y.forEach((J=>oe(J))),X||ee.forEach((J=>oe(J))),X})(this.style,this.transform.zoom);L&&(function(O,$,X){for(let K=0;K<X.length;K++)Gh(O,$,X[K])})(this,L,L.getVisibleCoordinates())}this.options.showPadding&&(function(L){const O=L.transform.padding;Gc(L,L.transform.height-(O.top||0),3,jh),Gc(L,O.bottom||0,3,Vh),qc(L,O.left||0,3,Uh),qc(L,L.transform.width-(O.right||0),3,$h);const $=L.transform.centerPoint;(function(X,K,Y,ee){us(X,K-1,Y-10,2,20,ee),us(X,K-10,Y-1,20,2,ee)})(L,$.x,L.transform.height-$.y,Jn)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const n=this.terrainFacilitator.matrix,l=this.transform.modelViewProjectionMatrix;let h=this.terrainFacilitator.dirty;h||(h=t?!s.cj(n,l):!s.ck(n,l)),h||(h=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),h&&(s.cl(n,l),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(g,_){const T=g.context,I=T.gl,A=g.transform,C=Ht.unblended,R=new _t(I.LEQUAL,_t.ReadWrite,[0,1]),L=_.tileManager.getRenderableTiles(),O=g.useProgram("terrainDepth");T.bindFramebuffer.set(_.getFramebuffer("depth").framebuffer),T.viewport.set([0,0,g.width/devicePixelRatio,g.height/devicePixelRatio]),T.clear({color:s.bp.transparent,depth:1});for(const $ of L){const X=_.getTerrainMesh($.tileID),K=_.getTerrainData($.tileID),Y=A.getProjectionData({overscaledTileID:$.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),ee={u_ele_delta:_.getMeshFrameDelta(A.zoom)};O.draw(T,I.TRIANGLES,R,Dt.disabled,C,Ct.backCCW,ee,K,Y,"terrain",X.vertexBuffer,X.indexBuffer,X.segments)}T.bindFramebuffer.set(null),T.viewport.set([0,0,g.width,g.height])})(this,this.style.map.terrain),(function(g,_){const T=g.context,I=T.gl,A=g.transform,C=Ht.unblended,R=new _t(I.LEQUAL,_t.ReadWrite,[0,1]),L=_.getCoordsTexture(),O=_.tileManager.getRenderableTiles(),$=g.useProgram("terrainCoords");T.bindFramebuffer.set(_.getFramebuffer("coords").framebuffer),T.viewport.set([0,0,g.width/devicePixelRatio,g.height/devicePixelRatio]),T.clear({color:s.bp.transparent,depth:1}),_.coordsIndex=[];for(const X of O){const K=_.getTerrainMesh(X.tileID),Y=_.getTerrainData(X.tileID);T.activeTexture.set(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,L.texture);const ee={u_terrain_coords_id:(255-_.coordsIndex.length)/255,u_texture:0,u_ele_delta:_.getMeshFrameDelta(A.zoom)},oe=A.getProjectionData({overscaledTileID:X.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});$.draw(T,I.TRIANGLES,R,Dt.disabled,C,Ct.backCCW,ee,Y,oe,"terrain",K.vertexBuffer,K.indexBuffer,K.segments),_.coordsIndex.push(X.tileID.key)}T.bindFramebuffer.set(null),T.viewport.set([0,0,g.width,g.height])})(this,this.style.map.terrain))}renderLayer(t,n,l,h,g){l.isHidden(this.transform.zoom)||(l.type==="background"||l.type==="custom"||(h||[]).length)&&(this.id=l.id,s.cm(l)?(function(_,T,I,A,C,R){if(_.renderPass!=="translucent")return;const{isRenderingToTexture:L}=R,O=Dt.disabled,$=_.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(X,K,Y,ee,oe,J,ne,ce,ie){const fe=K.transform,Ae=K.style.map.terrain,be=oe==="map",Te=J==="map";for(const Se of X){const Ve=ee.getTile(Se),Ue=Ve.getBucket(Y);if(!Ue||!Ue.text||!Ue.text.segments.get().length)continue;const Fe=s.ay(Ue.textSizeData,fe.zoom),Ze=s.aN(Ve,1,K.transform.zoom),gt=Ai(be,K.transform,Ze),Nt=Y.layout.get("icon-text-fit")!=="none"&&Ue.hasIconData();if(Fe){const ir=Math.pow(2,fe.zoom-Ve.tileID.overscaledZ),Xt=Ae?(or,Yt)=>Ae.getElevation(Se,or,Yt):null;Vd(Ue,be,Te,ie,fe,gt,ir,Fe,Nt,s.aO(fe,Ve,ne,ce),Se.toUnwrapped(),Xt)}}})(A,_,I,T,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),C),I.paint.get("icon-opacity").constantOr(1)!==0&&os(_,T,I,A,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),O,$,L),I.paint.get("text-opacity").constantOr(1)!==0&&os(_,T,I,A,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),O,$,L),T.map.showCollisionBoxes&&(Ia(_,T,I,A,!0),Ia(_,T,I,A,!1))})(t,n,l,h,this.style.placement.variableOffsets,g):s.cn(l)?(function(_,T,I,A,C){if(_.renderPass!=="translucent")return;const{isRenderingToTexture:R}=C,L=I.paint.get("circle-opacity"),O=I.paint.get("circle-stroke-width"),$=I.paint.get("circle-stroke-opacity"),X=!I.layout.get("circle-sort-key").isConstant();if(L.constantOr(1)===0&&(O.constantOr(1)===0||$.constantOr(1)===0))return;const K=_.context,Y=K.gl,ee=_.transform,oe=_.getDepthModeForSublayer(0,_t.ReadOnly),J=Dt.disabled,ne=_.colorModeForRenderPass(),ce=[],ie=ee.getCircleRadiusCorrection();for(let fe=0;fe<A.length;fe++){const Ae=A[fe],be=T.getTile(Ae),Te=be.getBucket(I);if(!Te)continue;const Se=I.paint.get("circle-translate"),Ve=I.paint.get("circle-translate-anchor"),Ue=s.aO(ee,be,Se,Ve),Fe=Te.programConfigurations.get(I.id),Ze=_.useProgram("circle",Fe),gt=Te.layoutVertexBuffer,Nt=Te.indexBuffer,ir=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Ae),Xt={programConfiguration:Fe,program:Ze,layoutVertexBuffer:gt,indexBuffer:Nt,uniformValues:xh(_,be,I,Ue,ie),terrainData:ir,projectionData:ee.getProjectionData({overscaledTileID:Ae,applyGlobeMatrix:!R,applyTerrainMatrix:!0})};if(X){const or=Te.segments.get();for(const Yt of or)ce.push({segments:new s.aX([Yt]),sortKey:Yt.sortKey,state:Xt})}else ce.push({segments:Te.segments,sortKey:0,state:Xt})}X&&ce.sort(((fe,Ae)=>fe.sortKey-Ae.sortKey));for(const fe of ce){const{programConfiguration:Ae,program:be,layoutVertexBuffer:Te,indexBuffer:Se,uniformValues:Ve,terrainData:Ue,projectionData:Fe}=fe.state;be.draw(K,Y.TRIANGLES,oe,J,ne,Ct.backCCW,Ve,Ue,Fe,I.id,Te,Se,fe.segments,I.paint,_.transform.zoom,Ae)}})(t,n,l,h,g):s.co(l)?(function(_,T,I,A,C){if(I.paint.get("heatmap-opacity")===0)return;const R=_.context,{isRenderingToTexture:L,isRenderingGlobe:O}=C;if(_.style.map.terrain){for(const $ of A){const X=T.getTile($);T.hasRenderableParent($)||(_.renderPass==="offscreen"?Rh(_,X,I,$,O):_.renderPass==="translucent"&&Fh(_,I,$,L,O))}R.viewport.set([0,0,_.width,_.height])}else _.renderPass==="offscreen"?(function($,X,K,Y){const ee=$.context,oe=ee.gl,J=$.transform,ne=Dt.disabled,ce=new Ht([oe.ONE,oe.ONE],s.bp.transparent,[!0,!0,!0,!0]);(function(ie,fe,Ae){const be=ie.gl;ie.activeTexture.set(be.TEXTURE1),ie.viewport.set([0,0,fe.width/4,fe.height/4]);let Te=Ae.heatmapFbos.get(s.cd);Te?(be.bindTexture(be.TEXTURE_2D,Te.colorAttachment.get()),ie.bindFramebuffer.set(Te.framebuffer)):(Te=ss(ie,fe.width/4,fe.height/4),Ae.heatmapFbos.set(s.cd,Te))})(ee,$,K),ee.clear({color:s.bp.transparent});for(let ie=0;ie<Y.length;ie++){const fe=Y[ie];if(X.hasRenderableParent(fe))continue;const Ae=X.getTile(fe),be=Ae.getBucket(K);if(!be)continue;const Te=be.programConfigurations.get(K.id),Se=$.useProgram("heatmap",Te),Ve=J.getProjectionData({overscaledTileID:fe,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Ue=J.getCircleRadiusCorrection();Se.draw(ee,oe.TRIANGLES,_t.disabled,ne,ce,Ct.backCCW,uo(Ae,J.zoom,K.paint.get("heatmap-intensity"),Ue),null,Ve,K.id,be.layoutVertexBuffer,be.indexBuffer,be.segments,K.paint,J.zoom,Te)}ee.viewport.set([0,0,$.width,$.height])})(_,T,I,A):_.renderPass==="translucent"&&(function($,X){const K=$.context,Y=K.gl;K.setColorMode($.colorModeForRenderPass());const ee=X.heatmapFbos.get(s.cd);ee&&(K.activeTexture.set(Y.TEXTURE0),Y.bindTexture(Y.TEXTURE_2D,ee.colorAttachment.get()),K.activeTexture.set(Y.TEXTURE1),wl(K,X).bind(Y.LINEAR,Y.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(K,Y.TRIANGLES,_t.disabled,Dt.disabled,$.colorModeForRenderPass(),Ct.disabled,wh($,X,0,1),null,null,X.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,X.paint,$.transform.zoom))})(_,I)})(t,n,l,h,g):s.cp(l)?(function(_,T,I,A,C){if(_.renderPass!=="translucent")return;const{isRenderingToTexture:R}=C,L=I.paint.get("line-opacity"),O=I.paint.get("line-width");if(L.constantOr(1)===0||O.constantOr(1)===0)return;const $=_.getDepthModeForSublayer(0,_t.ReadOnly),X=_.colorModeForRenderPass(),K=I.paint.get("line-dasharray"),Y=K.constantOr(1),ee=I.paint.get("line-pattern"),oe=ee.constantOr(1),J=I.paint.get("line-gradient"),ne=I.getCrossfadeParameters();let ce;ce=oe?"linePattern":Y&&J?"lineGradientSDF":Y?"lineSDF":J?"lineGradient":"line";const ie=_.context,fe=ie.gl,Ae=_.transform;let be=!0;for(const Te of A){const Se=T.getTile(Te);if(oe&&!Se.patternsLoaded())continue;const Ve=Se.getBucket(I);if(!Ve)continue;const Ue=Ve.programConfigurations.get(I.id),Fe=_.context.program.get(),Ze=_.useProgram(ce,Ue),gt=be||Ze.program!==Fe,Nt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Te),ir=ee.constantOr(null),Xt=K&&K.constantOr(null);if(ir&&Se.imageAtlas){const qr=Se.imageAtlas,kr=qr.patternPositions[ir.to.toString()],Tr=qr.patternPositions[ir.from.toString()];kr&&Tr&&Ue.setConstantPatternPositions(kr,Tr)}else if(Xt){const qr=I.layout.get("line-cap")==="round",kr=_.lineAtlas.getDash(Xt.to,qr),Tr=_.lineAtlas.getDash(Xt.from,qr);Ue.setConstantDashPositions(kr,Tr)}const or=Ae.getProjectionData({overscaledTileID:Te,applyGlobeMatrix:!R,applyTerrainMatrix:!0}),Yt=Ae.getPixelScale();let yr;oe?(yr=Dc(_,Se,I,Yt,ne),Oh(ie,fe,Se,Ue,ne)):Y&&J?(yr=ll(_,Se,I,Yt,ne,Ve.lineClipsArray.length),Ci(_,T,ie,fe,I,Ve,Te,Ue,ne)):Y?(yr=Mh(_,Se,I,Yt,ne),br(_,ie,fe,Ue,gt,ne)):J?(yr=Sh(_,Se,I,Yt,Ve.lineClipsArray.length),Pa(_,T,ie,fe,I,Ve,Te)):yr=es(_,Se,I,Yt);const sr=_.stencilModeForClipping(Te);Ze.draw(ie,fe.TRIANGLES,$,sr,X,Ct.disabled,yr,Nt,or,I.id,Ve.layoutVertexBuffer,Ve.indexBuffer,Ve.segments,I.paint,_.transform.zoom,Ue,Ve.layoutVertexBuffer2),be=!1}})(t,n,l,h,g):s.cq(l)?(function(_,T,I,A,C){const R=I.paint.get("fill-color"),L=I.paint.get("fill-opacity");if(L.constantOr(1)===0)return;const{isRenderingToTexture:O}=C,$=_.colorModeForRenderPass(),X=I.paint.get("fill-pattern"),K=_.opaquePassEnabledForLayer()&&!X.constantOr(1)&&R.constantOr(s.bp.transparent).a===1&&L.constantOr(0)===1?"opaque":"translucent";if(_.renderPass===K){const Y=_.getDepthModeForSublayer(1,_.renderPass==="opaque"?_t.ReadWrite:_t.ReadOnly);ls(_,T,I,A,Y,$,!1,O)}if(_.renderPass==="translucent"&&I.paint.get("fill-antialias")){const Y=_.getDepthModeForSublayer(I.getPaintProperty("fill-outline-color")?2:0,_t.ReadOnly);ls(_,T,I,A,Y,$,!0,O)}})(t,n,l,h,g):s.cr(l)?(function(_,T,I,A,C){const R=I.paint.get("fill-extrusion-opacity");if(R===0)return;const{isRenderingToTexture:L}=C;if(_.renderPass==="translucent"){const O=new _t(_.context.gl.LEQUAL,_t.ReadWrite,_.depthRangeFor3D);if(R!==1||I.paint.get("fill-extrusion-pattern").constantOr(1))Sl(_,T,I,A,O,Dt.disabled,Ht.disabled,L),Sl(_,T,I,A,O,_.stencilModeFor3D(),_.colorModeForRenderPass(),L);else{const $=_.colorModeForRenderPass();Sl(_,T,I,A,O,Dt.disabled,$,L)}}})(t,n,l,h,g):s.cs(l)?(function(_,T,I,A,C){if(_.renderPass!=="offscreen"&&_.renderPass!=="translucent")return;const{isRenderingToTexture:R}=C,L=_.context,O=_.style.projection.useSubdivision,$=_.getDepthModeForSublayer(0,_t.ReadOnly),X=_.colorModeForRenderPass();if(_.renderPass==="offscreen")(function(K,Y,ee,oe,J,ne,ce){const ie=K.context,fe=ie.gl;for(const Ae of ee){const be=Y.getTile(Ae),Te=be.dem;if(!Te||!Te.data||!be.needsHillshadePrepare)continue;const Se=Te.dim,Ve=Te.stride,Ue=Te.getPixels();if(ie.activeTexture.set(fe.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),be.demTexture=be.demTexture||K.getTileTexture(Ve),be.demTexture){const Ze=be.demTexture;Ze.update(Ue,{premultiply:!1}),Ze.bind(fe.NEAREST,fe.CLAMP_TO_EDGE)}else be.demTexture=new s.T(ie,Ue,fe.RGBA,{premultiply:!1}),be.demTexture.bind(fe.NEAREST,fe.CLAMP_TO_EDGE);ie.activeTexture.set(fe.TEXTURE0);let Fe=be.fbo;if(!Fe){const Ze=new s.T(ie,{width:Se,height:Se,data:null},fe.RGBA);Ze.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),Fe=be.fbo=ie.createFramebuffer(Se,Se,!0,!1),Fe.colorAttachment.set(Ze.texture)}ie.bindFramebuffer.set(Fe.framebuffer),ie.viewport.set([0,0,Se,Se]),K.useProgram("hillshadePrepare").draw(ie,fe.TRIANGLES,J,ne,ce,Ct.disabled,Cd(be.tileID,Te),null,null,oe.id,K.rasterBoundsBuffer,K.quadTriangleIndexBuffer,K.rasterBoundsSegments),be.needsHillshadePrepare=!1}})(_,T,A,I,$,Dt.disabled,X),L.viewport.set([0,0,_.width,_.height]);else if(_.renderPass==="translucent")if(O){const[K,Y,ee]=_.stencilConfigForOverlapTwoPass(A);Kn(_,T,I,ee,K,$,X,!1,R),Kn(_,T,I,ee,Y,$,X,!0,R)}else{const[K,Y]=_.getStencilConfigForOverlapAndUpdateStencilID(A);Kn(_,T,I,Y,K,$,X,!1,R)}})(t,n,l,h,g):s.ct(l)?(function(_,T,I,A,C){if(_.renderPass!=="translucent"||!A.length)return;const{isRenderingToTexture:R}=C,L=_.style.projection.useSubdivision,O=_.getDepthModeForSublayer(0,_t.ReadOnly),$=_.colorModeForRenderPass();if(L){const[X,K,Y]=_.stencilConfigForOverlapTwoPass(A);cs(_,T,I,Y,X,O,$,!1,R),cs(_,T,I,Y,K,O,$,!0,R)}else{const[X,K]=_.getStencilConfigForOverlapAndUpdateStencilID(A);cs(_,T,I,K,X,O,$,!1,R)}})(t,n,l,h,g):s.bU(l)?(function(_,T,I,A,C){if(_.renderPass!=="translucent"||I.paint.get("raster-opacity")===0||!A.length)return;const{isRenderingToTexture:R}=C,L=T.getSource(),O=_.style.projection.useSubdivision;if(L instanceof wi)go(_,T,I,A,null,!1,!1,L.tileCoords,L.flippedWindingOrder,R);else if(O){const[$,X,K]=_.stencilConfigForOverlapTwoPass(A);go(_,T,I,K,$,!1,!0,Aa,!1,R),go(_,T,I,K,X,!0,!0,Aa,!1,R)}else{const[$,X]=_.getStencilConfigForOverlapAndUpdateStencilID(A);go(_,T,I,X,$,!1,!0,Aa,!1,R)}})(t,n,l,h,g):s.cu(l)?(function(_,T,I,A,C){const R=I.paint.get("background-color"),L=I.paint.get("background-opacity");if(L===0)return;const{isRenderingToTexture:O}=C,$=_.context,X=$.gl,K=_.style.projection,Y=_.transform,ee=Y.tileSize,oe=I.paint.get("background-pattern");if(_.isPatternMissing(oe))return;const J=!oe&&R.a===1&&L===1&&_.opaquePassEnabledForLayer()?"opaque":"translucent";if(_.renderPass!==J)return;const ne=Dt.disabled,ce=_.getDepthModeForSublayer(0,J==="opaque"?_t.ReadWrite:_t.ReadOnly),ie=_.colorModeForRenderPass(),fe=_.useProgram(oe?"backgroundPattern":"background"),Ae=A||fr(Y,{tileSize:ee,terrain:_.style.map.terrain});oe&&($.activeTexture.set(X.TEXTURE0),_.imageManager.bind(_.context));const be=I.getCrossfadeParameters();for(const Te of Ae){const Se=Y.getProjectionData({overscaledTileID:Te,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),Ve=oe?Dd(L,_,oe,{tileID:Te,tileSize:ee},be):Fc(L,R),Ue=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Te),Fe=K.getMeshFromTileID($,Te.canonical,!1,!0,"raster");fe.draw($,X.TRIANGLES,ce,ne,ie,Ct.backCCW,Ve,Ue,Se,I.id,Fe.vertexBuffer,Fe.indexBuffer,Fe.segments)}})(t,0,l,h,g):s.cv(l)&&(function(_,T,I,A){const{isRenderingGlobe:C}=A,R=_.context,L=I.implementation,O=_.style.projection,$=_.transform,X=$.getProjectionDataForCustomLayer(C),K={farZ:$.farZ,nearZ:$.nearZ,fov:$.fov*Math.PI/180,modelViewProjectionMatrix:$.modelViewProjectionMatrix,projectionMatrix:$.projectionMatrix,shaderData:{variantName:O.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; 807uniform mat4 u_projection_matrix; 808${O.shaderPreludeCode.vertexSource}`,define:O.shaderDefine},defaultProjectionData:X},Y=L.renderingMode?L.renderingMode:"2d";if(_.renderPass==="offscreen"){const ee=L.prerender;ee&&(_.setCustomLayerDefaults(),R.setColorMode(_.colorModeForRenderPass()),ee.call(L,R.gl,K),R.setDirty(),_.setBaseState())}else if(_.renderPass==="translucent"){_.setCustomLayerDefaults(),R.setColorMode(_.colorModeForRenderPass()),R.setStencilMode(Dt.disabled);const ee=Y==="3d"?_.getDepthModeFor3D():_.getDepthModeForSublayer(0,_t.ReadOnly);R.setDepthMode(ee),L.render(R.gl,K),R.setDirty(),_.setBaseState(),R.bindFramebuffer.set(null)}})(t,0,l,g))}saveTileTexture(t){const n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),l=this.imageManager.getPattern(t.to.toString());return!n||!l}useProgram(t,n,l=!1,h=[]){this.cache=this.cache||{};const g=!!this.style.map.terrain,_=this.style.projection,T=l?ur.projectionMercator:_.shaderPreludeCode,I=l?mi:_.shaderDefine,A=t+(n?n.cacheKey:"")+`/${l?Ei:_.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(g?"/terrain":"")+(h?`/${h.join("/")}`:"");return this.cache[A]||(this.cache[A]=new gh(this.context,ur[t],n,zd[t],this._showOverdrawInspector,g,T,I,h)),this.cache[A]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new s.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,n;if(this._tileTextures){for(const l in this._tileTextures){const h=this._tileTextures[l];if(h)for(const g of h)g.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((t=this.tileExtentMesh.vertexBuffer)===null||t===void 0||t.destroy()),this.tileExtentMesh&&((n=this.tileExtentMesh.indexBuffer)===null||n===void 0||n.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(const l in this.cache){const h=this.cache[l];h&&h.program&&this.context.gl.deleteProgram(h.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}function Hc(m,t){let n,l=!1,h=null,g=null;const _=()=>{h=null,l&&(m.apply(g,n),h=setTimeout(_,t),l=!1)};return(...T)=>(l=!0,g=this,n=T,h||_(),h)}class Xc{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let l;return n.split("&").map((h=>h.split("="))).forEach((h=>{h[0]===this._hashName&&(l=h)})),(l&&l[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(!this._isValidHash(n))return!1;const l=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:l,pitch:+(n[4]||0)}),!0},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(n.length===0)return;const l=n.join("/");let h=l;h.split("&").length>0&&(h=h.split("&")[0]),this._hashName&&(h=`${this._hashName}=${l}`);let g=window.location.hash.replace(h,"");g.startsWith("#&")?g=g.slice(0,1)+g.slice(2):g==="#"&&(g="");let _=window.location.href.replace(/(#.+)?$/,g);_=_.replace("&&","&"),window.history.replaceState(window.history.state,null,_)},this._updateHash=Hc(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const n=this._map.getCenter(),l=Math.round(100*this._map.getZoom())/100,h=Math.ceil((l*Math.LN2+Math.log(512/360/.5))/Math.LN10),g=Math.pow(10,h),_=Math.round(n.lng*g)/g,T=Math.round(n.lat*g)/g,I=this._map.getBearing(),A=this._map.getPitch();let C="";if(C+=t?`/${_}/${T}/${l}`:`${l}/${T}/${_}`,(I||A)&&(C+="/"+Math.round(10*I)/10),A&&(C+=`/${Math.round(A)}`),this._hashName){const R=this._hashName;let L=!1;const O=window.location.hash.slice(1).split("&").map(($=>{const X=$.split("=")[0];return X===R?(L=!0,`${X}=${C}`):$})).filter(($=>$));return L||O.push(`${R}=${C}`),`#${O.join("&")}`}return`#${C}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new s.V(+t[2],+t[1])}catch{return!1}const n=+t[0],l=+(t[3]||0),h=+(t[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&l>=-180&&l<=180&&h>=this._map.getMinPitch()&&h<=this._map.getMaxPitch()}}const Qn={linearity:.3,easing:s.cw(0,0,.3,1)},Zh=s.e({deceleration:2500,maxSpeed:1400},Qn),ji=s.e({deceleration:20,maxSpeed:1400},Qn),Ki=s.e({deceleration:1e3,maxSpeed:360},Qn),Wh=s.e({deceleration:1e3,maxSpeed:90},Qn),Ji=s.e({deceleration:1e3,maxSpeed:360},Qn);class Ud{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:me(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=me();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,roll:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:g}of this._inertiaBuffer)n.zoom+=g.zoomDelta||0,n.bearing+=g.bearingDelta||0,n.pitch+=g.pitchDelta||0,n.roll+=g.rollDelta||0,g.panDelta&&n.pan._add(g.panDelta),g.around&&(n.around=g.around),g.pinchAround&&(n.pinchAround=g.pinchAround);const l=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,h={};if(n.pan.mag()){const g=ps(n.pan.mag(),l,s.e({},Zh,t||{})),_=n.pan.mult(g.amount/n.pan.mag()),T=this._map.cameraHelper.handlePanInertia(_,this._map.transform);h.center=T.easingCenter,h.offset=T.easingOffset,hs(h,g)}if(n.zoom){const g=ps(n.zoom,l,ji);h.zoom=this._map.transform.zoom+g.amount,hs(h,g)}if(n.bearing){const g=ps(n.bearing,l,Ki);h.bearing=this._map.transform.bearing+s.an(g.amount,-179,179),hs(h,g)}if(n.pitch){const g=ps(n.pitch,l,Wh);h.pitch=this._map.transform.pitch+g.amount,hs(h,g)}if(n.roll){const g=ps(n.roll,l,Ji);h.roll=this._map.transform.roll+s.an(g.amount,-179,179),hs(h,g)}if(h.zoom||h.bearing){const g=n.pinchAround===void 0?n.around:n.pinchAround;h.around=g?this._map.unproject(g):this._map.getCenter()}return this.clear(),s.e(h,{noMoveStart:!0})}}function hs(m,t){(!m.duration||m.duration<t.duration)&&(m.duration=t.duration,m.easing=t.easing)}function ps(m,t,n){const{maxSpeed:l,linearity:h,deceleration:g}=n,_=s.an(m*h/(t/1e3),-l,l),T=Math.abs(_)/(g*h);return{easing:n.easing,duration:1e3*T,amount:_*(T/2)}}class Gr extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,l,h={}){l=l instanceof MouseEvent?l:new MouseEvent(t,l);const g=le.mousePos(n.getCanvas(),l),_=n.unproject(g);super(t,s.e({point:g,lngLat:_,originalEvent:l},h)),this._defaultPrevented=!1,this.target=n}}class ds extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,l){const h=t==="touchend"?l.changedTouches:l.touches,g=le.touchPos(n.getCanvasContainer(),h),_=g.map((I=>n.unproject(I))),T=g.reduce(((I,A,C,R)=>I.add(A.div(R.length))),new s.P(0,0));super(t,{points:g,point:T,lngLats:_,lngLat:n.unproject(T),originalEvent:l}),this._defaultPrevented=!1}}class Hh extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,l){super(t,{originalEvent:l}),this._defaultPrevented=!1}}class $d{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Hh(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Gr(t.type,this._map,t))}mouseup(t){this._map.fire(new Gr(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Gr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Gr(t.type,this._map,t))}mouseover(t){this._map.fire(new Gr(t.type,this._map,t))}mouseout(t){this._map.fire(new Gr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ds(t.type,this._map,t))}touchmove(t){this._map.fire(new ds(t.type,this._map,t))}touchend(t){this._map.fire(new ds(t.type,this._map,t))}touchcancel(t){this._map.fire(new ds(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gd{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Gr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Gr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Gr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class yo{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(s.P.convert(t),this._map.terrain)}}class _o{constructor(t,n){this._map=t,this._tr=new yo(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(le.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const l=n;if(this._lastPos.equals(l)||!this._box&&l.dist(this._startPos)<this._clickTolerance)return;const h=this._startPos;this._lastPos=l,this._box||(this._box=le.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const g=Math.min(h.x,l.x),_=Math.max(h.x,l.x),T=Math.min(h.y,l.y),I=Math.max(h.y,l.y);le.setTransform(this._box,`translate(${g}px,${T}px)`),this._box.style.width=_-g+"px",this._box.style.height=I-T+"px"}mouseupWindow(t,n){if(!this._active||t.button!==0)return;const l=this._startPos,h=n;if(this.reset(),le.suppressClick(),l.x!==h.x||l.y!==h.y)return this._map.fire(new s.l("boxzoomend",{originalEvent:t})),{cameraAnimation:g=>g.fitScreenCoordinates(l,h,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(le.remove(this._box),this._box=null),le.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new s.l(t,{originalEvent:n}))}}function Qi(m,t){if(m.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${m.length}, points ${t.length}`);const n={};for(let l=0;l<m.length;l++)n[m[l].identifier]=t[l];return n}class et{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,l){(this.centroid||l.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),l.length===this.numTouches&&(this.centroid=(function(h){const g=new s.P(0,0);for(const _ of h)g._add(_);return g.div(h.length)})(n),this.touches=Qi(l,n)))}touchmove(t,n,l){if(this.aborted||!this.centroid)return;const h=Qi(l,n);for(const g in this.touches){const _=h[g];(!_||_.dist(this.touches[g])>30)&&(this.aborted=!0)}}touchend(t,n,l){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),l.length===0){const h=!this.aborted&&this.centroid;if(this.reset(),h)return h}}}class Ml{constructor(t){this.singleTap=new et(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,l){this.singleTap.touchstart(t,n,l)}touchmove(t,n,l){this.singleTap.touchmove(t,n,l)}touchend(t,n,l){const h=this.singleTap.touchend(t,n,l);if(h){const g=t.timeStamp-this.lastTime<500,_=!this.lastTap||this.lastTap.dist(h)<30;if(g&&_||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=h,this.count===this.numTaps)return this.reset(),h}}}class Yc{constructor(t){this._tr=new yo(t),this._zoomIn=new Ml({numTouches:1,numTaps:2}),this._zoomOut=new Ml({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,l){this._zoomIn.touchstart(t,n,l),this._zoomOut.touchstart(t,n,l)}touchmove(t,n,l){this._zoomIn.touchmove(t,n,l),this._zoomOut.touchmove(t,n,l)}touchend(t,n,l){const h=this._zoomIn.touchend(t,n,l),g=this._zoomOut.touchend(t,n,l),_=this._tr;return h?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:_.zoom+1,around:_.unproject(h)},{originalEvent:t})}):g?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:T=>T.easeTo({duration:300,zoom:_.zoom-1,around:_.unproject(g)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vo{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const l=this._lastPoint;if(!l)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const h=Array.isArray(n)?n[0]:n;return!this._moved&&h.dist(l)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=h,this._move(l,h))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&le.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const fs=0,ms=2,Kc={[fs]:1,[ms]:2};class gs{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const n=le.mouseButton(t);this._eventButton=n}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(n,l){const h=Kc[l];return n.buttons===void 0||(n.buttons&h)!==h})(t,this._eventButton)}isValidEndEvent(t){return le.mouseButton(t)===this._eventButton}}class Jc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class Xh{constructor(t=new gs({checkCorrectEvent:()=>!0}),n=new Jc){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,l){return t instanceof MouseEvent?n(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?l(t):void 0}startMove(t){this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.startMove(n)),(n=>this.oneFingerTouchMoveStateManager.startMove(n)))}endMove(t){this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.endMove(n)),(n=>this.oneFingerTouchMoveStateManager.endMove(n)))}isValidStartEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidStartEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidStartEvent(n)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidMoveEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(n)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidEndEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidEndEvent(n)))}}const xo=m=>{m.mousedown=m.dragStart,m.mousemoveWindow=m.dragMove,m.mouseup=m.dragEnd,m.contextmenu=t=>{t.preventDefault()}};class qd{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,l){return this._calculateTransform(t,n,l)}touchmove(t,n,l){if(this._active){if(!this._shouldBePrevented(l.length))return t.preventDefault(),this._calculateTransform(t,n,l);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,n,l){this._calculateTransform(t,n,l),this._active&&this._shouldBePrevented(l.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,l){l.length>0&&(this._active=!0);const h=Qi(l,n),g=new s.P(0,0),_=new s.P(0,0);let T=0;for(const A in h){const C=h[A],R=this._touches[A];R&&(g._add(C),_._add(C.sub(R)),T++,h[A]=C)}if(this._touches=h,this._shouldBePrevented(T)||!_.mag())return;const I=_.div(T);return this._sum._add(I),this._sum.mag()<this._clickTolerance?void 0:{around:g.div(T),panDelta:I}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Il{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,l){this._firstTwoTouches||l.length<2||(this._firstTwoTouches=[l[0].identifier,l[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,l){if(!this._firstTwoTouches)return;t.preventDefault();const[h,g]=this._firstTwoTouches,_=Pl(l,n,h),T=Pl(l,n,g);if(!_||!T)return;const I=this._aroundCenter?null:_.add(T).div(2);return this._move([_,T],I,t)}touchend(t,n,l){if(!this._firstTwoTouches)return;const[h,g]=this._firstTwoTouches,_=Pl(l,n,h),T=Pl(l,n,g);_&&T||(this._active&&le.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Pl(m,t,n){for(let l=0;l<m.length;l++)if(m[l].identifier===n)return t[l]}function Yh(m,t){return Math.log(m/t)/Math.LN2}class Qc extends Il{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){const l=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Yh(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yh(this._distance,l),pinchAround:n}}}function Kh(m,t){return 180*m.angleWith(t)/Math.PI}class eu extends Il{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,l){const h=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Kh(this._vector,h),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const n=25/(Math.PI*this._minDiameter)*360,l=Kh(t,this._startVector);return Math.abs(l)<n}}function tu(m){return Math.abs(m.y)>Math.abs(m.x)}class Jh extends Il{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,l){super.touchstart(t,n,l),this._currentTouchCount=l.length}_start(t){this._lastPoints=t,tu(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,l){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const h=t[0].sub(this._lastPoints[0]),g=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(h,g,l.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(h.y+g.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,l){if(this._valid!==void 0)return this._valid;const h=t.mag()>=2,g=n.mag()>=2;if(!h&&!g)return;if(!h||!g)return this._firstMove===void 0&&(this._firstMove=l),l-this._firstMove<100&&void 0;const _=t.y>0==n.y>0;return tu(t)&&tu(n)&&_}}const ea={panStep:100,bearingStep:15,pitchStep:10};class $t{constructor(t){this._tr=new yo(t);const n=ea;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,l=0,h=0,g=0,_=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?l=-1:(t.preventDefault(),g=-1);break;case 39:t.shiftKey?l=1:(t.preventDefault(),g=1);break;case 38:t.shiftKey?h=1:(t.preventDefault(),_=-1);break;case 40:t.shiftKey?h=-1:(t.preventDefault(),_=1);break;default:return}return this._rotationDisabled&&(l=0,h=0),{cameraAnimation:T=>{const I=this._tr;T.easeTo({duration:300,easeId:"keyboardHandler",easing:Zd,zoom:n?Math.round(I.zoom)+n*(t.shiftKey?2:1):I.zoom,bearing:I.bearing+l*this._bearingStep,pitch:I.pitch+h*this._pitchStep,offset:[-g*this._panStep,-_*this._panStep],center:I.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Zd(m){return m*(2-m)}const ys=4.000244140625,Al=1/450;class El{constructor(t,n){this._onTimeout=l=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(l)},this._map=t,this._tr=new yo(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Al}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const l=me(),h=l-(this._lastWheelEventTime||0);this._lastWheelEventTime=l,n!==0&&n%ys==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":h>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(h*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=le.mousePos(this._map.getCanvas(),t),l=this._tr;this._aroundPoint=this._aroundCenter?l.transform.locationToScreenPoint(s.V.convert(l.center)):n,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const T=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=T),typeof this._targetZoom=="number"&&(this._targetZoom+=T)}if(this._delta!==0){const T=this._type==="wheel"&&Math.abs(this._delta)>ys?this._wheelZoomRate:this._defaultZoomRate;let I=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&I!==0&&(I=1/I);const A=typeof this._targetZoom!="number"?t.scale:s.aq(this._targetZoom);this._targetZoom=t.applyConstrain(t.getCameraLngLat(),s.at(A*I)).zoom,this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,l=this._startZoom,h=this._easing;let g,_=!1;if(this._type==="wheel"&&l&&h){const T=me()-this._lastWheelEventTime,I=Math.min((T+5)/200,1),A=h(I);g=s.G.number(l,n,A),I<1?this._frameId||(this._frameId=!0):_=!0}else g=n,_=!0;return this._active=!0,_&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=g,{noInertia:!0,needsRenderFrame:!_,zoomDelta:g-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=s.cy;if(this._prevEase){const l=this._prevEase,h=(me()-l.start)/l.duration,g=l.easing(h+.01)-l.easing(h),_=.27/Math.sqrt(g*g+1e-4)*.01,T=Math.sqrt(.0729-_*_);n=s.cw(_,T,.25,1)}return this._prevEase={start:me(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ru{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Qh{constructor(t){this._tr=new yo(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:l=>{l.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ep{constructor(){this._tap=new Ml({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,l){if(!this._swipePoint)if(this._tapTime){const h=n[0],g=t.timeStamp-this._tapTime<500,_=this._tapPoint.dist(h)<30;g&&_?l.length>0&&(this._swipePoint=h,this._swipeTouch=l[0].identifier):this.reset()}else this._tap.touchstart(t,n,l)}touchmove(t,n,l){if(this._tapTime){if(this._swipePoint){if(l[0].identifier!==this._swipeTouch)return;const h=n[0],g=h.y-this._swipePoint.y;return this._swipePoint=h,t.preventDefault(),this._active=!0,{zoomDelta:g/128}}}else this._tap.touchmove(t,n,l)}touchend(t,n,l){if(this._tapTime)this._swipePoint&&l.length===0&&this.reset();else{const h=this._tap.touchend(t,n,l);h&&(this._tapTime=t.timeStamp,this._tapPoint=h)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class tp{constructor(t,n,l){this._el=t,this._mousePan=n,this._touchPan=l}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class en{constructor(t,n,l,h){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=l,this._mouseRoll=h}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class _s{constructor(t,n,l,h){this._el=t,this._touchZoom=n,this._touchRotate=l,this._tapDragZoom=h,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class at{constructor(t,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=le.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const l=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),h=document.createElement("div");h.className="maplibregl-desktop-message",h.textContent=n,this._container.appendChild(h);const g=document.createElement("div");g.className="maplibregl-mobile-message",g.textContent=l,this._container.appendChild(g),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(le.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,n){this._enabled&&(this._map.fire(new s.l("cooperativegestureprevented",{gestureType:t,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const lt=m=>m.zoom||m.drag||m.roll||m.pitch||m.rotate;class vs extends s.l{}function Cl(m){return m.panDelta&&m.panDelta.mag()||m.zoomDelta||m.bearingDelta||m.pitchDelta||m.rollDelta}class kl{constructor(t,n){this.handleWindowEvent=h=>{this.handleEvent(h,`${h.type}Window`)},this.handleEvent=(h,g)=>{if(h.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const _=h.type==="renderFrame"?void 0:h,T={needsRenderFrame:!1},I={},A={};for(const{handlerName:L,handler:O,allowed:$}of this._handlers){if(!O.isEnabled())continue;let X;if(this._blockedByActive(A,$,L))O.reset();else if(O[g||h.type]){if(s.cz(h,g||h.type)){const K=le.mousePos(this._map.getCanvas(),h);X=O[g||h.type](h,K)}else if(s.cA(h,g||h.type)){const K=this._getMapTouches(h.touches),Y=le.touchPos(this._map.getCanvas(),K);X=O[g||h.type](h,Y,K)}else s.cB(g||h.type)||(X=O[g||h.type](h));this.mergeHandlerResult(T,I,X,L,_),X&&X.needsRenderFrame&&this._triggerRenderFrame()}(X||O.isActive())&&(A[L]=O)}const C={};for(const L in this._previousActiveHandlers)A[L]||(C[L]=_);this._previousActiveHandlers=A,(Object.keys(C).length||Cl(T))&&(this._changes.push([T,I,C]),this._triggerRenderFrame()),(Object.keys(A).length||Cl(T))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:R}=T;R&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],R(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ud(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const l=this._el;this._listeners=[[l,"touchstart",{passive:!0}],[l,"touchmove",{passive:!1}],[l,"touchend",void 0],[l,"touchcancel",void 0],[l,"mousedown",void 0],[l,"mousemove",void 0],[l,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[l,"mouseover",void 0],[l,"mouseout",void 0],[l,"dblclick",void 0],[l,"click",void 0],[l,"keydown",{capture:!1}],[l,"keyup",void 0],[l,"wheel",{passive:!1}],[l,"contextmenu",void 0],[window,"blur",void 0]];for(const[h,g,_]of this._listeners)le.addEventListener(h,g,h===document?this.handleWindowEvent:this.handleEvent,_)}destroy(){for(const[t,n,l]of this._listeners)le.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,l)}_addDefaultHandlers(t){const n=this._map,l=n.getCanvasContainer();this._add("mapEvent",new $d(n,t));const h=n.boxZoom=new _o(n,t);this._add("boxZoom",h),t.interactive&&t.boxZoom&&h.enable();const g=n.cooperativeGestures=new at(n,t.cooperativeGestures);this._add("cooperativeGestures",g),t.cooperativeGestures&&g.enable();const _=new Yc(n),T=new Qh(n);n.doubleClickZoom=new ru(T,_),this._add("tapZoom",_),this._add("clickZoom",T),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const I=new ep;this._add("tapDragZoom",I);const A=n.touchPitch=new Jh(n);this._add("touchPitch",A),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const C=()=>n.project(n.getCenter()),R=(function({enable:J,clickTolerance:ne,aroundCenter:ce=!0,minPixelCenterThreshold:ie=100,rotateDegreesPerPixelMoved:fe=.8},Ae){const be=new gs({checkCorrectEvent:Te=>le.mouseButton(Te)===0&&Te.ctrlKey||le.mouseButton(Te)===2&&!Te.ctrlKey});return new vo({clickTolerance:ne,move:(Te,Se)=>{const Ve=Ae();if(ce&&Math.abs(Ve.y-Te.y)>ie)return{bearingDelta:s.cx(new s.P(Te.x,Se.y),Se,Ve)};let Ue=(Se.x-Te.x)*fe;return ce&&Se.y<Ve.y&&(Ue=-Ue),{bearingDelta:Ue}},moveStateManager:be,enable:J,assignEvents:xo})})(t,C),L=(function({enable:J,clickTolerance:ne,pitchDegreesPerPixelMoved:ce=-.5}){const ie=new gs({checkCorrectEvent:fe=>le.mouseButton(fe)===0&&fe.ctrlKey||le.mouseButton(fe)===2});return new vo({clickTolerance:ne,move:(fe,Ae)=>({pitchDelta:(Ae.y-fe.y)*ce}),moveStateManager:ie,enable:J,assignEvents:xo})})(t),O=(function({enable:J,clickTolerance:ne,rollDegreesPerPixelMoved:ce=.3},ie){const fe=new gs({checkCorrectEvent:Ae=>le.mouseButton(Ae)===2&&Ae.ctrlKey});return new vo({clickTolerance:ne,move:(Ae,be)=>{const Te=ie();let Se=(be.x-Ae.x)*ce;return be.y<Te.y&&(Se=-Se),{rollDelta:Se}},moveStateManager:fe,enable:J,assignEvents:xo})})(t,C);n.dragRotate=new en(t,R,L,O),this._add("mouseRotate",R,["mousePitch"]),this._add("mousePitch",L,["mouseRotate","mouseRoll"]),this._add("mouseRoll",O,["mousePitch"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const $=(function({enable:J,clickTolerance:ne}){const ce=new gs({checkCorrectEvent:ie=>le.mouseButton(ie)===0&&!ie.ctrlKey});return new vo({clickTolerance:ne,move:(ie,fe)=>({around:fe,panDelta:fe.sub(ie)}),activateOnStart:!0,moveStateManager:ce,enable:J,assignEvents:xo})})(t),X=new qd(t,n);n.dragPan=new tp(l,$,X),this._add("mousePan",$),this._add("touchPan",X,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const K=new eu,Y=new Qc;n.touchZoomRotate=new _s(l,Y,K,I),this._add("touchRotate",K,["touchPan","touchZoom"]),this._add("touchZoom",Y,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new Gd(n));const ee=n.scrollZoom=new El(n,(()=>this._triggerRenderFrame()));this._add("scrollZoom",ee,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const oe=n.keyboard=new $t(n);this._add("keyboard",oe),t.interactive&&t.keyboard&&n.keyboard.enable()}_add(t,n,l){this._handlers.push({handlerName:t,handler:n,allowed:l}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!lt(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,l){for(const h in t)if(h!==l&&(!n||n.indexOf(h)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const l of t)this._el.contains(l.target)&&n.push(l);return n}mergeHandlerResult(t,n,l,h,g){if(!l)return;s.e(t,l);const _={handlerName:h,originalEvent:l.originalEvent||g};l.zoomDelta!==void 0&&(n.zoom=_),l.panDelta!==void 0&&(n.drag=_),l.rollDelta!==void 0&&(n.roll=_),l.pitchDelta!==void 0&&(n.pitch=_),l.bearingDelta!==void 0&&(n.rotate=_)}_applyChanges(){const t={},n={},l={};for(const[h,g,_]of this._changes)h.panDelta&&(t.panDelta=(t.panDelta||new s.P(0,0))._add(h.panDelta)),h.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+h.zoomDelta),h.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+h.bearingDelta),h.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+h.pitchDelta),h.rollDelta&&(t.rollDelta=(t.rollDelta||0)+h.rollDelta),h.around!==void 0&&(t.around=h.around),h.pinchAround!==void 0&&(t.pinchAround=h.pinchAround),h.noInertia&&(t.noInertia=h.noInertia),s.e(n,g),s.e(l,_);this._updateMapTransform(t,n,l),this._changes=[]}_updateMapTransform(t,n,l){const h=this._map,g=h._getTransformForUpdate(),_=h.terrain;if(!(Cl(t)||_&&this._terrainMovement))return this._fireEvents(n,l,!0);h._stop(!0);let{panDelta:T,zoomDelta:I,bearingDelta:A,pitchDelta:C,rollDelta:R,around:L,pinchAround:O}=t;O!==void 0&&(L=O),L=L||h.transform.centerPoint,_&&!g.isPointOnMapSurface(L)&&(L=g.centerPoint);const $={panDelta:T,zoomDelta:I,rollDelta:R,pitchDelta:C,bearingDelta:A,around:L};this._map.cameraHelper.useGlobeControls&&!g.isPointOnMapSurface(L)&&(L=g.centerPoint);const X=L.distSqr(g.centerPoint)<.01?g.center:g.screenPointToLocation(T?L.sub(T):L);this._handleMapControls({terrain:_,tr:g,deltasForHelper:$,preZoomAroundLoc:X,combinedEventsInProgress:n,panDelta:T}),h._applyUpdatedTransform(g),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,l,!0)}_handleMapControls({terrain:t,tr:n,deltasForHelper:l,preZoomAroundLoc:h,combinedEventsInProgress:g,panDelta:_}){const T=this._map.cameraHelper;if(T.handleMapControlsRollPitchBearingZoom(l,n),t)return T.useGlobeControls?(this._terrainMovement||!g.drag&&!g.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void T.handleMapControlsPan(l,n,h)):this._terrainMovement||!g.drag&&!g.zoom?void(g.drag&&this._terrainMovement&&_?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(_))):T.handleMapControlsPan(l,n,h)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void T.handleMapControlsPan(l,n,h));T.handleMapControlsPan(l,n,h)}_fireEvents(t,n,l){const h=lt(this._eventsInProgress),g=lt(t),_={};for(const R in t){const{originalEvent:L}=t[R];this._eventsInProgress[R]||(_[`${R}start`]=L),this._eventsInProgress[R]=t[R]}!h&&g&&this._fireEvent("movestart",g.originalEvent);for(const R in _)this._fireEvent(R,_[R]);g&&this._fireEvent("move",g.originalEvent);for(const R in t){const{originalEvent:L}=t[R];this._fireEvent(R,L)}const T={};let I;for(const R in this._eventsInProgress){const{handlerName:L,originalEvent:O}=this._eventsInProgress[R];this._handlersById[L].isActive()||(delete this._eventsInProgress[R],I=n[L]||O,T[`${R}end`]=I)}for(const R in T)this._fireEvent(R,T[R]);const A=lt(this._eventsInProgress),C=(h||g)&&!A;if(C&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const R=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&R.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(R)}if(l&&C){this._updatingCamera=!0;const R=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),L=O=>O!==0&&-this._bearingSnap<O&&O<this._bearingSnap;!R||!R.essential&&ue.prefersReducedMotion?(this._map.fire(new s.l("moveend",{originalEvent:I})),L(this._map.getBearing())&&this._map.resetNorth()):(L(R.bearing||this._map.getBearing())&&(R.bearing=0),R.freezeElevation=!0,this._map.easeTo(R,{originalEvent:I})),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new s.l(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new vs("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class _i extends s.E{constructor(t,n,l){super(),this._renderFrameCallback=()=>{const h=Math.min((me()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(h)),h<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=l.bearingSnap,this.cameraHelper=n,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new s.V(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,n,l){return t=s.P.convert(t).mult(-1),this.panTo(this.transform.center,s.e({offset:t},n),l)}panTo(t,n,l){return this.easeTo(s.e({center:t},n),l)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,l){return this.easeTo(s.e({zoom:t},n),l)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,n){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new s.l("movestart",n)).fire(new s.l("move",n)).fire(new s.l("moveend",n))),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,l){return this.easeTo(s.e({bearing:t},n),l)}resetNorth(t,n){return this.rotateTo(0,s.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(s.e({bearing:0,pitch:0,roll:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=dr.convert(t).adjustAntiMeridian();const l=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),l,n)}_cameraForBoxAndBearing(t,n,l,h){const g={top:0,bottom:0,right:0,left:0};if(typeof(h=s.e({padding:g,offset:[0,0],maxZoom:this.transform.maxZoom},h)).padding=="number"){const A=h.padding;h.padding={top:A,bottom:A,right:A,left:A}}const _=s.e(g,h.padding);h.padding=_;const T=this.transform,I=new dr(t,n);return this.cameraHelper.cameraForBoxAndBearing(h,_,I,l,T)}fitBounds(t,n,l){return this._fitInternal(this.cameraForBounds(t,n),n,l)}fitScreenCoordinates(t,n,l,h,g){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(s.P.convert(t)),this.transform.screenPointToLocation(s.P.convert(n)),l,h),h,g)}_fitInternal(t,n,l){return t?(delete(n=s.e(t,n)).padding,n.linear?this.easeTo(n,l):this.flyTo(n,l)):this}jumpTo(t,n){this.stop();const l=this._getTransformForUpdate();let h=!1,g=!1,_=!1;const T=l.zoom;this.cameraHelper.handleJumpToCenterZoom(l,t);const I=l.zoom!==T;return"elevation"in t&&l.elevation!==+t.elevation&&l.setElevation(+t.elevation),"bearing"in t&&l.bearing!==+t.bearing&&(h=!0,l.setBearing(+t.bearing)),"pitch"in t&&l.pitch!==+t.pitch&&(g=!0,l.setPitch(+t.pitch)),"roll"in t&&l.roll!==+t.roll&&(_=!0,l.setRoll(+t.roll)),t.padding==null||l.isPaddingEqual(t.padding)||l.setPadding(t.padding),this._applyUpdatedTransform(l),this.fire(new s.l("movestart",n)).fire(new s.l("move",n)),I&&this.fire(new s.l("zoomstart",n)).fire(new s.l("zoom",n)).fire(new s.l("zoomend",n)),h&&this.fire(new s.l("rotatestart",n)).fire(new s.l("rotate",n)).fire(new s.l("rotateend",n)),g&&this.fire(new s.l("pitchstart",n)).fire(new s.l("pitch",n)).fire(new s.l("pitchend",n)),_&&this.fire(new s.l("rollstart",n)).fire(new s.l("roll",n)).fire(new s.l("rollend",n)),this.fire(new s.l("moveend",n))}calculateCameraOptionsFromTo(t,n,l,h=0){const g=s.a9.fromLngLat(t,n),_=s.a9.fromLngLat(l,h),T=_.x-g.x,I=_.y-g.y,A=_.z-g.z,C=Math.hypot(T,I,A);if(C===0)throw new Error("Can't calculate camera options with same From and To");const R=Math.hypot(T,I),L=s.at(this.transform.cameraToCenterDistance/C/this.transform.tileSize),O=180*Math.atan2(T,-I)/Math.PI;let $=180*Math.acos(R/C)/Math.PI;return $=A<0?90-$:90+$,{center:_.toLngLat(),elevation:h,zoom:L,pitch:$,bearing:O}}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,l,h,g){const _=this.transform.calculateCenterFromCameraLngLatAlt(t,n,l,h);return{center:_.center,elevation:_.elevation,zoom:_.zoom,bearing:l,pitch:h,roll:g}}easeTo(t,n){this._stop(!1,t.easeId),((t=s.e({offset:[0,0],duration:500,easing:s.cy},t)).animate===!1||!t.essential&&ue.prefersReducedMotion)&&(t.duration=0);const l=this._getTransformForUpdate(),h=this.getBearing(),g=l.pitch,_=l.roll,T="bearing"in t?this._normalizeBearing(t.bearing,h):h,I="pitch"in t?+t.pitch:g,A="roll"in t?this._normalizeBearing(t.roll,_):_,C="padding"in t?t.padding:l.padding,R=s.P.convert(t.offset);let L,O;t.around&&(L=s.V.convert(t.around),O=l.locationToScreenPoint(L));const $={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},X=this.cameraHelper.handleEaseTo(l,{bearing:T,pitch:I,roll:A,padding:C,around:L,aroundPoint:O,offsetAsPoint:R,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||h!==T,this._pitching=this._pitching||I!==g,this._rolling=this._rolling||A!==_,this._padding=!l.isPaddingEqual(C),this._zooming=this._zooming||X.isZooming,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,$),this.terrain&&this._prepareElevation(X.elevationCenter),this._ease((K=>{X.easeFunc(K),this.terrain&&!t.freezeElevation&&this._updateElevation(K),this._applyUpdatedTransform(l),this._fireMoveEvents(n)}),(K=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n,K)}),t),this}_prepareEase(t,n,l={}){this._moving=!0,n||l.moving||this.fire(new s.l("movestart",t)),this._zooming&&!l.zooming&&this.fire(new s.l("zoomstart",t)),this._rotating&&!l.rotating&&this.fire(new s.l("rotatestart",t)),this._pitching&&!l.pitching&&this.fire(new s.l("pitchstart",t)),this._rolling&&!l.rolling&&this.fire(new s.l("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const l=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(l-(n-(l*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.setElevation(s.G.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const n=t.getCameraLngLat(),l=t.getCameraAltitude(),h=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(l<h){const g=this.calculateCameraOptionsFromTo(n,h,t.center,t.elevation);return{pitch:g.pitch,zoom:g.zoom}}return{}}_applyUpdatedTransform(t){const n=[];if(n.push((h=>this._elevateCameraIfInsideTerrain(h))),this.transformCameraUpdate&&n.push((h=>this.transformCameraUpdate(h))),!n.length)return;const l=t.clone();for(const h of n){const g=l.clone(),{center:_,zoom:T,roll:I,pitch:A,bearing:C,elevation:R}=h(g);_&&g.setCenter(_),R!==void 0&&g.setElevation(R),T!==void 0&&g.setZoom(T),I!==void 0&&g.setRoll(I),A!==void 0&&g.setPitch(A),C!==void 0&&g.setBearing(C),l.apply(g,!1)}this.transform.apply(l,!1)}_fireMoveEvents(t){this.fire(new s.l("move",t)),this._zooming&&this.fire(new s.l("zoom",t)),this._rotating&&this.fire(new s.l("rotate",t)),this._pitching&&this.fire(new s.l("pitch",t)),this._rolling&&this.fire(new s.l("roll",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const l=this._zooming,h=this._rotating,g=this._pitching,_=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,l&&this.fire(new s.l("zoomend",t)),h&&this.fire(new s.l("rotateend",t)),g&&this.fire(new s.l("pitchend",t)),_&&this.fire(new s.l("rollend",t)),this.fire(new s.l("moveend",t))}flyTo(t,n){if(!t.essential&&ue.prefersReducedMotion){const Se=s.U(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(Se,n)}this.stop(),t=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.cy},t);const l=this._getTransformForUpdate(),h=l.bearing,g=l.pitch,_=l.roll,T=l.padding,I="bearing"in t?this._normalizeBearing(t.bearing,h):h,A="pitch"in t?+t.pitch:g,C="roll"in t?this._normalizeBearing(t.roll,_):_,R="padding"in t?t.padding:l.padding,L=s.P.convert(t.offset);let O=l.centerPoint.add(L);const $=l.screenPointToLocation(O),X=this.cameraHelper.handleFlyTo(l,{bearing:I,pitch:A,roll:C,padding:R,locationAtOffset:$,offsetAsPoint:L,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let K=t.curve;const Y=Math.max(l.width,l.height),ee=Y/X.scaleOfZoom,oe=X.pixelPathLength;typeof X.scaleOfMinZoom=="number"&&(K=Math.sqrt(Y/X.scaleOfMinZoom/oe*2));const J=K*K;function ne(Se){const Ve=(ee*ee-Y*Y+(Se?-1:1)*J*J*oe*oe)/(2*(Se?ee:Y)*J*oe);return Math.log(Math.sqrt(Ve*Ve+1)-Ve)}function ce(Se){return(Math.exp(Se)-Math.exp(-Se))/2}function ie(Se){return(Math.exp(Se)+Math.exp(-Se))/2}const fe=ne(!1);let Ae=function(Se){return ie(fe)/ie(fe+K*Se)},be=function(Se){return Y*((ie(fe)*(ce(Ve=fe+K*Se)/ie(Ve))-ce(fe))/J)/oe;var Ve},Te=(ne(!0)-fe)/K;if(Math.abs(oe)<2e-6||!isFinite(Te)){if(Math.abs(Y-ee)<1e-6)return this.easeTo(t,n);const Se=ee<Y?-1:1;Te=Math.abs(Math.log(ee/Y))/K,be=()=>0,Ae=Ve=>Math.exp(Se*K*Ve)}return t.duration="duration"in t?+t.duration:1e3*Te/("screenSpeed"in t?+t.screenSpeed/K:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=h!==I,this._pitching=A!==g,this._rolling=C!==_,this._padding=!l.isPaddingEqual(R),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(X.targetCenter),this._ease((Se=>{const Ve=Se*Te,Ue=1/Ae(Ve),Fe=be(Ve);this._rotating&&l.setBearing(s.G.number(h,I,Se)),this._pitching&&l.setPitch(s.G.number(g,A,Se)),this._rolling&&l.setRoll(s.G.number(_,C,Se)),this._padding&&(l.interpolatePadding(T,R,Se),O=l.centerPoint.add(L)),X.easeFunc(Se,Ue,Fe,O),this.terrain&&!t.freezeElevation&&this._updateElevation(Se),this._applyUpdatedTransform(l),this._fireMoveEvents(n)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){var l;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const h=this._onEaseEnd;delete this._onEaseEnd,h.call(this,n)}return t||(l=this.handlers)===null||l===void 0||l.stop(!1),this}_ease(t,n,l){l.animate===!1||l.duration===0?(t(1),n()):(this._easeStart=me(),this._easeOptions=l,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=s.W(t,-180,180);const l=Math.abs(t-n);return Math.abs(t-360-n)<l&&(t-=360),Math.abs(t+360-n)<l&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(s.V.convert(t),this.transform):null}}const Vi={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class iu{constructor(t=Vi){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=le.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=le.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=le.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){le.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const l=this._map._getUIString(`AttributionControl.${n}`);t.title=l,t.setAttribute("aria-label",l)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((h=>typeof h!="string"?"":h))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const h=this._map.style.stylesheet;this.styleOwner=h.owner,this.styleId=h.id}const n=this._map.style.tileManagers;for(const h in n){const g=n[h];if(g.used||g.usedForTerrain){const _=g.getSource();_.attribution&&t.indexOf(_.attribution)<0&&t.push(_.attribution)}}t=t.filter((h=>String(h).trim())),t.sort(((h,g)=>h.length-g.length)),t=t.filter(((h,g)=>{for(let _=g+1;_<t.length;_++)if(t[_].indexOf(h)>=0)return!1;return!0}));const l=t.join(" | ");l!==this._attribHTML&&(this._attribHTML=l,t.length?(this._innerContainer.innerHTML=le.sanitize(l),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class rp{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const l=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&l.classList.add("maplibregl-compact"):l.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=le.create("div","maplibregl-ctrl");const n=le.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){le.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Wd{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,l=n?this._queue.concat(n):this._queue;
808for(const h of l)if(h.id===t)return void(h.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const l of n)if(!l.cancelled&&(l.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Hd=s.aU([{name:"a_pos3d",type:"Int16",components:3}]);class xs extends s.E{constructor(t){super(),this._lastTilesetChange=me(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,n){this.tileManager.update(t,n),this._renderableTilesKeys=[];const l={};for(const h of fr(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n,calculateTileZoom:this.tileManager._source.calculateTileZoom}))l[h.key]=!0,this._renderableTilesKeys.push(h.key),this._tiles[h.key]||(h.terrainRttPosMatrix32f=new Float64Array(16),s.c7(h.terrainRttPosMatrix32f,0,s.a5,s.a5,0,0,1),this._tiles[h.key]=new Oe(h,this.tileSize),this._lastTilesetChange=me());for(const h in this._tiles)l[h]||delete this._tiles[h]}freeRtt(t){for(const n in this._tiles){const l=this._tiles[n];(!t||l.tileID.equals(t)||l.tileID.isChildOf(t)||t.isChildOf(l.tileID))&&(l.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,n){return n?this._getTerrainCoordsForTileRanges(t,n):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const n={};for(const l of this._renderableTilesKeys){const h=this._tiles[l].tileID,g=t.clone(),_=s.bk();if(h.canonical.equals(t.canonical))s.c7(_,0,s.a5,s.a5,0,0,1);else if(h.canonical.isChildOf(t.canonical)){const T=h.canonical.z-t.canonical.z,I=h.canonical.x-(h.canonical.x>>T<<T),A=h.canonical.y-(h.canonical.y>>T<<T),C=s.a5>>T;s.c7(_,0,C,C,0,0,1),s.O(_,_,[-I*C,-A*C,0])}else{if(!t.canonical.isChildOf(h.canonical))continue;{const T=t.canonical.z-h.canonical.z,I=t.canonical.x-(t.canonical.x>>T<<T),A=t.canonical.y-(t.canonical.y>>T<<T),C=s.a5>>T;s.c7(_,0,s.a5,s.a5,0,0,1),s.O(_,_,[I*C,A*C,0]),s.Q(_,_,[1/2**T,1/2**T,0])}}g.terrainRttPosMatrix32f=new Float32Array(_),n[l]=g}return n}_getTerrainCoordsForTileRanges(t,n){const l={};for(const h of this._renderableTilesKeys){const g=this._tiles[h].tileID;if(!this._isWithinTileRanges(g,n))continue;const _=t.clone(),T=s.bk();if(g.canonical.z===t.canonical.z){const I=t.canonical.x-g.canonical.x+t.wrap*(1<<t.canonical.z),A=t.canonical.y-g.canonical.y;s.c7(T,0,s.a5,s.a5,0,0,1),s.O(T,T,[I*s.a5,A*s.a5,0])}else if(g.canonical.z>t.canonical.z){const I=g.canonical.z-t.canonical.z,A=g.canonical.x-(g.canonical.x>>I<<I)+t.wrap*(1<<g.canonical.z),C=g.canonical.y-(g.canonical.y>>I<<I),R=t.canonical.x-(g.canonical.x>>I),L=t.canonical.y-(g.canonical.y>>I),O=s.a5>>I;s.c7(T,0,O,O,0,0,1),s.O(T,T,[-A*O+R*s.a5,-C*O+L*s.a5,0])}else{const I=t.canonical.z-g.canonical.z,A=t.canonical.x-(t.canonical.x>>I<<I)+t.wrap*(1<<t.canonical.z),C=t.canonical.y-(t.canonical.y>>I<<I),R=(t.canonical.x>>I)-g.canonical.x,L=(t.canonical.y>>I)-g.canonical.y,O=s.a5<<I;s.c7(T,0,O,O,0,0,1),s.O(T,T,[A*s.a5+R*O,C*s.a5+L*O,0])}_.terrainRttPosMatrix32f=new Float32Array(T),l[h]=_}return l}getSourceTile(t,n){const l=this.tileManager._source;let h=t.overscaledZ-this.deltaZoom;if(h>l.maxzoom&&(h=l.maxzoom),h<l.minzoom)return;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(h).key);let g=this.findTileInCaches(this._sourceTileCache[t.key]);if(!g?.dem&&n)for(;h>=l.minzoom&&!g?.dem;)g=this.findTileInCaches(t.scaledTo(h--).key);return g}findTileInCaches(t){let n=this.tileManager.getTileByID(t);return n||(n=this.tileManager._outOfViewCache.getByKey(t),n)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){const l=n[t.canonical.z];return!!l&&(t.wrap>l.minWrap||t.wrap<l.maxWrap||t.canonical.x>=l.minTileXWrapped&&t.canonical.x<=l.maxTileXWrapped&&t.canonical.y>=l.minTileY&&t.canonical.y<=l.maxTileY)}}class hr{constructor(t,n,l){this._meshCache={},this.painter=t,this.tileManager=new xs(n),this.options=l,this.exaggeration=typeof l.exaggeration=="number"?l.exaggeration:1,this.qual
vendor: 9,227 bytes, line 808
808ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,l,h=s.a5){var g;if(!(n>=0&&n<h&&l>=0&&l<h))return 0;const _=this.getTerrainData(t),T=(g=_.tile)===null||g===void 0?void 0:g.dem;if(!T)return 0;const I=s.cC([],[n/h*s.a5,l/h*s.a5],_.u_terrain_matrix),A=[I[0]*T.dim,I[1]*T.dim],C=Math.floor(A[0]),R=Math.floor(A[1]),L=A[0]-C,O=A[1]-R;return T.get(C,R)*(1-L)*(1-O)+T.get(C+1,R)*L*(1-O)+T.get(C,R+1)*(1-L)*O+T.get(C+1,R+1)*L*O}getElevationForLngLatZoom(t,n){if(!s.cD(n,t.wrap()))return 0;const{tileID:l,mercatorX:h,mercatorY:g}=this._getOverscaledTileIDFromLngLatZoom(t,n);return this.getElevation(l,h%s.a5,g%s.a5,s.a5)}getElevationForLngLat(t,n){const l=fr(n,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this});let h=0;for(const g of l)g.canonical.z>h&&(h=Math.min(g.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,h)}getElevation(t,n,l,h=s.a5){return this.getDEMElevation(t,n,l,h)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const h=this.painter.context,g=new s.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new s.T(h,g,h.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new s.T(h,new s.R({width:1,height:1}),h.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(h.gl.NEAREST,h.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=s.ar([])}const n=this.tileManager.getSourceTile(t,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){const h=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new s.T(h,n.dem.getPixels(),h.gl.RGBA,{premultiply:!1}),n.demTexture.bind(h.gl.NEAREST,h.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}const l=n&&n.toString()+n.tileID.key+t.key;if(l&&!this._demMatrixCache[l]){const h=this.tileManager.getSource().maxzoom;let g=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=h?g=t.canonical.z-h:s.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const _=t.canonical.x-(t.canonical.x>>g<<g),T=t.canonical.y-(t.canonical.y>>g<<g),I=s.cE(new Float64Array(16),[1/(s.a5<<g),1/(s.a5<<g),0]);s.O(I,I,[_*s.a5,T*s.a5,0]),this._demMatrixCache[t.key]={matrix:I,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:l?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(t){const n=this.painter,l=n.width/devicePixelRatio,h=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===l&&this._fbo.height===h||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new s.T(n.context,{width:l,height:h,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new s.T(n.context,{width:l,height:h,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(l,h,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,l,h))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let g=0,_=0;g<this._coordsTextureSize;g++)for(let T=0;T<this._coordsTextureSize;T++,_+=4)n[_+0]=255&T,n[_+1]=255&g,n[_+2]=T>>8<<4|g>>8,n[_+3]=0;const l=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),h=new s.T(t,l,t.gl.RGBA,{premultiply:!1});return h.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=h,h}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),l=this.painter.context,h=l.gl,g=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),_=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),T=Math.round(this.painter.height/devicePixelRatio);l.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),h.readPixels(g,T-_-1,1,1,h.RGBA,h.UNSIGNED_BYTE,n),l.bindFramebuffer.set(null);const I=n[0]+(n[2]>>4<<8),A=n[1]+((15&n[2])<<8),C=this.coordsIndex[255-n[3]],R=C&&this.tileManager.getTileByID(C);if(!R)return null;const L=this._coordsTextureSize,O=(1<<R.tileID.canonical.z)*L;return new s.a9((R.tileID.canonical.x*L+I)/O+R.tileID.wrap,(R.tileID.canonical.y*L+A)/O,this.getElevation(R.tileID,I,A,L))}depthAtPoint(t){const n=new Uint8Array(4),l=this.painter.context,h=l.gl;return l.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),h.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,h.RGBA,h.UNSIGNED_BYTE,n),l.bindFramebuffer.set(null),(n[0]/16777216+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(t){var n;const l=((n=this.painter.style.projection)===null||n===void 0?void 0:n.transitionState)>0,h=l&&t.canonical.y===0,g=l&&t.canonical.y===(1<<t.canonical.z)-1,_=`m_${h?"n":""}_${g?"s":""}`;if(this._meshCache[_])return this._meshCache[_];const T=this.painter.context,I=new s.cF,A=new s.aY,C=this.meshSize,R=s.a5/C,L=C*C;for(let ie=0;ie<=C;ie++)for(let fe=0;fe<=C;fe++)I.emplaceBack(fe*R,ie*R,0);for(let ie=0;ie<L;ie+=C+1)for(let fe=0;fe<C;fe++)A.emplaceBack(fe+ie,C+fe+ie+1,C+fe+ie+2),A.emplaceBack(fe+ie,C+fe+ie+2,fe+ie+1);const O=I.length,$=O+(C+1),X=(C+1)*C,K=h?s.br:0,Y=h?0:1,ee=g?s.bs:s.a5,oe=g?0:1;for(let ie=0;ie<=C;ie++)I.emplaceBack(ie*R,K,Y);for(let ie=0;ie<=C;ie++)I.emplaceBack(ie*R,ee,oe);for(let ie=0;ie<C;ie++)A.emplaceBack(X+ie,$+ie,$+ie+1),A.emplaceBack(X+ie,$+ie+1,X+ie+1),A.emplaceBack(0+ie,O+ie+1,O+ie),A.emplaceBack(0+ie,0+ie+1,O+ie+1);const J=I.length,ne=J+2*(C+1);for(const ie of[0,1])for(let fe=0;fe<=C;fe++)for(const Ae of[0,1])I.emplaceBack(ie*s.a5,fe*R,Ae);for(let ie=0;ie<2*C;ie+=2)A.emplaceBack(J+ie,J+ie+1,J+ie+3),A.emplaceBack(J+ie,J+ie+3,J+ie+2),A.emplaceBack(ne+ie,ne+ie+3,ne+ie+1),A.emplaceBack(ne+ie,ne+ie+2,ne+ie+3);const ce=new Wt(T.createVertexBuffer(I,Hd.members),T.createIndexBuffer(A),s.aX.simpleSegment(0,0,I.length,A.length));return this._meshCache[_]=ce,ce}getMeshFrameDelta(t){return 2*Math.PI*s.bE/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,n){var l;if(!s.cD(n,t.wrap()))return 0;const{tileID:h}=this._getOverscaledTileIDFromLngLatZoom(t,n);return(l=this.getMinMaxElevation(h).minElevation)!==null&&l!==void 0?l:0}getMinMaxElevation(t){const n=this.getTerrainData(t).tile,l={minElevation:null,maxElevation:null};return n&&n.dem&&(l.minElevation=n.dem.min*this.exaggeration,l.maxElevation=n.dem.max*this.exaggeration),l}_getOverscaledTileIDFromLngLatZoom(t,n){const l=s.a9.fromLngLat(t.wrap()),h=(1<<n)*s.a5,g=l.x*h,_=l.y*h,T=Math.floor(g/s.a5),I=Math.floor(_/s.a5);return{tileID:new s.a2(n,0,n,T,I),mercatorX:g,mercatorY:_}}}class wr{constructor(t,n,l){this._context=t,this._size=n,this._tileSize=l,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),l=new s.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return l.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(l.texture),{id:t,fbo:n,texture:l,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((n=>t.id!==n)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}const Ea={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class bs{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new wr(t.context,30,n.tileManager.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}
vendor: 4,234 bytes, line 808
808prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((l=>!t._layers[l].isHidden(n))),this._coordsAscending={};for(const l in t.tileManagers){this._coordsAscending[l]={};const h=t.tileManagers[l].getVisibleCoordinates(),g=t.tileManagers[l].getSource(),_=g instanceof wi?g.terrainTileRanges:null;for(const T of h){const I=this.terrain.tileManager.getTerrainCoords(T,_);for(const A in I)this._coordsAscending[l][A]||(this._coordsAscending[l][A]=[]),this._coordsAscending[l][A].push(I[A])}}this._coordsAscendingStr={};for(const l of t._order){const h=t._layers[l],g=h.source;if(Ea[h.type]&&!this._coordsAscendingStr[g]){this._coordsAscendingStr[g]={};for(const _ in this._coordsAscending[g])this._coordsAscendingStr[g][_]=this._coordsAscending[g][_].map((T=>T.key)).sort().join()}}for(const l of this._renderableTiles)for(const h in this._coordsAscendingStr){const g=this._coordsAscendingStr[h][l.tileID.key];g&&g!==l.rttCoords[h]&&(l.rtt=[])}}renderLayer(t,n){if(t.isHidden(this.painter.transform.zoom))return!1;const l=Object.assign(Object.assign({},n),{isRenderingToTexture:!0}),h=t.type,g=this.painter,_=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Ea[h]&&(this._prevType&&Ea[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(t.id),!_))return!0;if(Ea[this._prevType]||Ea[h]&&_){this._prevType=h;const T=this._stacks.length-1,I=this._stacks[T]||[];for(const A of this._renderableTiles){if(this.pool.isFull()&&(Zc(this.painter,this.terrain,this._rttTiles,l),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(A),A.rtt[T]){const R=this.pool.getObjectForId(A.rtt[T].id);if(R.stamp===A.rtt[T].stamp){this.pool.useObject(R);continue}}const C=this.pool.getOrCreateFreeObject();this.pool.useObject(C),this.pool.stampObject(C),A.rtt[T]={id:C.id,stamp:C.stamp},g.context.bindFramebuffer.set(C.fbo.framebuffer),g.context.clear({color:s.bp.transparent,stencil:0}),g.currentStencilSource=void 0;for(let R=0;R<I.length;R++){const L=g.style._layers[I[R]],O=L.source?this._coordsAscending[L.source][A.tileID.key]:[A.tileID];g.context.viewport.set([0,0,C.fbo.width,C.fbo.height]),g._renderTileClippingMasks(L,O,!0),g.renderLayer(g,g.style.tileManagers[L.source],L,O,l),L.source&&(A.rttCoords[L.source]=this._coordsAscendingStr[L.source][A.tileID.key])}}return Zc(this.painter,this.terrain,this._rttTiles,l),this._rttTiles=[],this.pool.freeAllObjects(),Ea[h]}return!1}}const Dl={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use â + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},nu=D,zl={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Vi,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileC
vendor: 21,954 bytes, line 808
808acheSize:null,maxTileCacheZoomLevels:s.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0},au={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class ws{constructor(t,n,l=!1){this.mousedown=g=>{this.startMove(g,le.mousePos(this.element,g)),le.addEventListener(window,"mousemove",this.mousemove),le.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=g=>{this.move(g,le.mousePos(this.element,g))},this.mouseup=g=>{this._rotatePitchHandler.dragEnd(g),this.offTemp()},this.touchstart=g=>{g.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=le.touchPos(this.element,g.targetTouches)[0],this.startMove(g,this._startPos),le.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),le.addEventListener(window,"touchend",this.touchend))},this.touchmove=g=>{g.targetTouches.length!==1?this.reset():(this._lastPos=le.touchPos(this.element,g.targetTouches)[0],this.move(g,this._lastPos))},this.touchend=g=>{g.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;const h=new Xh;this._rotatePitchHandler=new vo({clickTolerance:3,move:(g,_)=>{const T=n.getBoundingClientRect(),I=new s.P((T.bottom-T.top)/2,(T.right-T.left)/2);return{bearingDelta:s.cx(new s.P(g.x,_.y),_,I),pitchDelta:l?-.5*(_.y-g.y):void 0}},moveStateManager:h,enable:!0,assignEvents:()=>{}}),this.map=t,le.addEventListener(n,"mousedown",this.mousedown),le.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),le.addEventListener(n,"touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),le.disableDrag()}move(t,n){const l=this.map,{bearingDelta:h,pitchDelta:g}=this._rotatePitchHandler.dragMove(t,n)||{};h&&l.setBearing(l.getBearing()+h),g&&l.setPitch(l.getPitch()+g)}off(){const t=this.element;le.removeEventListener(t,"mousedown",this.mousedown),le.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),le.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),le.removeEventListener(window,"touchend",this.touchend),le.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){le.enableDrag(),le.removeEventListener(window,"mousemove",this.mousemove),le.removeEventListener(window,"mouseup",this.mouseup),le.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),le.removeEventListener(window,"touchend",this.touchend)}}let Cn;function Ll(m,t,n,l=!1){if(l||!n.getCoveringTilesDetailsProvider().allowWorldCopies())return m?.wrap();const h=new s.V(m.lng,m.lat);if(m=new s.V(m.lng,m.lat),t){const g=new s.V(m.lng-360,m.lat),_=new s.V(m.lng+360,m.lat),T=n.locationToScreenPoint(m).distSqr(t);n.locationToScreenPoint(g).distSqr(t)<T?m=g:n.locationToScreenPoint(_).distSqr(t)<T&&(m=_)}for(;Math.abs(m.lng-n.center.lng)>180;){const g=n.locationToScreenPoint(m);if(g.x>=0&&g.y>=0&&g.x<=n.width&&g.y<=n.height)break;m.lng>n.center.lng?m.lng-=360:m.lng+=360}return m.lng!==h.lng&&n.isPointOnMapSurface(n.locationToScreenPoint(m))?m:h}const Ts={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Rl(m,t,n){const l=m.classList;for(const h in Ts)l.remove(`maplibregl-${n}-anchor-${h}`);l.add(`maplibregl-${n}-anchor-${t}`)}class Ss extends s.E{constructor(t){if(super(),this._onKeyPress=n=>{const l=n.code,h=n.charCode||n.keyCode;l!=="Space"&&l!=="Enter"&&h!==32&&h!==13||this.togglePopup()},this._onMapClick=n=>{const l=n.originalEvent.target,h=this._element;this._popup&&(l===h||h.contains(l))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const l=this._map.loaded()&&!this._map.isMoving();(n?.type==="terrain"||n?.type==="render"&&!l)&&this._map.once("render",this._update),this._lngLat=Ll(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let g="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?g="rotateX(0deg)":this._pitchAlignment==="map"&&(g=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),le.setTransform(this._element,`${Ts[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${h}`),ue.frameAsync(new AbortController).then((()=>{this._updateOpacity(n&&n.type==="moveend")})).catch((()=>{}))},this._onMove=n=>{if(!this._isDragging){const l=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=l}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.l("dragstart"))),this.fire(new s.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new s.l("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=s.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=le.create("div");const n=le.createNS("http://www.w3.org/2000/svg","svg"),l=41,h=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${l}px`),n.setAttributeNS(null,"width",`${h}px`),n.setAttributeNS(null,"viewBox",`0 0 ${h} ${l}`);const g=le.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"stroke","none"),g.setAttributeNS(null,"stroke-width","1"),g.setAttributeNS(null,"fill","none"),g.setAttributeNS(null,"fill-rule","evenodd");const _=le.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"fill-rule","nonzero");const T=le.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"transform","translate(3.0, 29.0)"),T.setAttributeNS(null,"fill","#000000");const I=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Y of I){const ee=le.createNS("http://www.w3.org/2000/svg","ellipse");ee.setAttributeNS(null,"opacity","0.04"),ee.setAttributeNS(null,"cx","10.5"),ee.setAttributeNS(null,"cy","5.80029008"),ee.setAttributeNS(null,"rx",Y.rx),ee.setAttributeNS(null,"ry",Y.ry),T.appendChild(ee)}const A=le.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"fill",this._color);const C=le.createNS("http://www.w3.org/2000/svg","path");C.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),A.appendChild(C);const R=le.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"opacity","0.25"),R.setAttributeNS(null,"fill","#000000");const L=le.createNS("http://www.w3.org/2000/svg","path");L.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),R.appendChild(L);const O=le.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(6.0, 7.0)"),O.setAttributeNS(null,"fill","#FFFFFF");const $=le.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(8.0, 8.0)");const X=le.createNS("http://www.w3.org/2000/svg","circle");X.setAttributeNS(null,"fill","#000000"),X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"cx","5.5"),X.setAttributeNS(null,"cy","5.5"),X.setAttributeNS(null,"r","5.4999962");const K=le.createNS("http://www.w3.org/2000/svg","circle");K.setAttributeNS(null,"fill","#FFFFFF"),K.setAttributeNS(null,"cx","5.5"),K.setAttributeNS(null,"cy","5.5"),K.setAttributeNS(null,"r","5.4999962"),$.appendChild(X),$.appendChild(K),_.appendChild(T),_.appendChild(A),_.appendChild(R),_.appendChild(O),_.appendChild($),n.appendChild(_),n.setAttributeNS(null,"height",l*this._scale+"px"),n.setAttributeNS(null,"width",h*this._scale+"px"),this._element.appendChild(n),this._offset=s.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(n=>{n.preventDefault()})),this._element.addEventListener("mousedown",(n=>{n.preventDefault()})),Rl(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),le.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=s.V.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const h=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[h,-1*(38.1-13.5+h)],"bottom-right":[-h,-1*(38.1-13.5+h)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var n,l;const h=(n=this._map)===null||n===void 0?void 0:n.terrain,g=this._map.transform.isLocationOccluded(this._lngLat);if(!h||g){const O=g?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==O&&(this._element.style.opacity=O))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const _=this._map,T=_.terrain.depthAtPoint(this._pos),I=_.terrain.getElevationForLngLat(this._lngLat,_.transform);if(_.transform.lngLatToCameraDepth(this._lngLat,I)-T<.006)return void(this._element.style.opacity=this._opacity);const A=-this._offset.y/_.transform.pixelsPerMeter,C=Math.sin(_.getPitch()*Math.PI/180)*A,R=_.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),L=_.transform.lngLatToCameraDepth(this._lngLat,I+C)-R>.006;!((l=this._popup)===null||l===void 0)&&l.isOpen()&&L&&this._popup.remove(),this._element.style.opacity=L?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=s.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(this._opacity===void 0||t===void 0&&n===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const ou={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let bo=0,Ca=!1;const su={maxWidth:100,unit:"metric"};function Ms(m,t,n){const l=n&&n.maxWidth||100,h=m._container.clientHeight/2,g=m._container.clientWidth/2,_=m.unproject([g-l/2,h]),T=m.unproject([g+l/2,h]),I=Math.round(m.project(T).x-m.project(_).x),A=Math.min(l,I,m._container.clientWidth),C=_.distanceTo(T);if(n&&n.unit==="imperial"){const R=3.2808*C;R>5280?ka(t,A,R/5280,m._getUIString("ScaleControl.Miles")):ka(t,A,R,m._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?ka(t,A,C/1852,m._getUIString("ScaleControl.NauticalMiles")):C>=1e3?ka(t,A,C/1e3,m._getUIString("ScaleControl.Kilometers")):ka(t,A,C,m._getUIString("ScaleControl.Meters"))}function ka(m,t,n,l){const h=(function(g){const _=Math.pow(10,`${Math.floor(g)}`.length-1);let T=g/_;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:(function(I){const A=Math.pow(10,Math.ceil(-Math.log(I)/Math.LN10));return Math.round(I*A)/A})(T),_*T})(n);m.style.width=t*(h/n)+"px",m.innerHTML=`${h} ${l}`}const lu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},Fl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Bl(m){if(m){if(typeof m=="number"){const t=Math.round(Math.abs(m)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,m),"top-left":new s.P(t,t),"top-right":new s.P(-t,t),bottom:new s.P(0,-m),"bottom-left":new s.P(t,-t),"bottom-right":new s.P(-t,-t),left:new s.P(m,0),right:new s.P(-m,0)}}if(m instanceof s.P||Array.isArray(m)){const t=s.P.convert(m);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:s.P.convert(m.center||[0,0]),top:s.P.convert(m.top||[0,0]),"top-left":s.P.convert(m["top-left"]||[0,0]),"top-right":s.P.convert(m["top-right"]||[0,0]),bottom:s.P.convert(m.bottom||[0,0]),"bottom-left":s.P.convert(m["bottom-left"]||[0,0]),"bottom-right":s.P.convert(m["bottom-right"]||[0,0]),left:s.P.convert(m.left||[0,0]),right:s.P.convert(m.right||[0,0])}}return Bl(new s.P(0,0))}const cu=D;b.AJAXError=s.cI,b.Event=s.l,b.Evented=s.E,b.LngLat=s.V,b.MercatorCoordinate=s.a9,b.Point=s.P,b.addProtocol=s.cJ,b.config=s.c,b.removeProtocol=s.cK,b.AttributionControl=iu,b.BoxZoomHandler=_o,b.CanvasSource=U,b.CooperativeGesturesHandler=at,b.DoubleClickZoomHandler=ru,b.DragPanHandler=tp,b.DragRotateHandler=en,b.EdgeInsets=eo,b.FullscreenControl=class extends s.E{constructor(m={}){super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((t=n?.shadowRoot)===null||t===void 0)&&t.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,m&&m.container&&(m.container instanceof HTMLElement?this._container=m.container:s.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(m){return this._map=m,this._container||(this._container=this._map.getContainer()),this._controlContainer=le.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){le.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const m=this._fullscreenButton=le.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);le.create("span","maplibregl-ctrl-icon",m).setAttribute("aria-hidden","true"),m.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const m=this._getTitle();this._fullscreenButton.setAttribute("aria-label",m),this._fullscreenButton.title=m}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new s.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},b.GeoJSONSource=Ha,b.GeolocateControl=class extends s.E{constructor(m){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new s.l("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
808RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new s.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new s.V(t.coords.longitude,t.coords.latitude),l=t.coords.accuracy,h=this._map.getBearing(),g=s.e({bearing:h},this.options.fitBoundsOptions),_=dr.fromLngLat(n,l);this._map.fitBounds(_,g,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new s.V(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Ca)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new s.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=le.create("button","maplibregl-ctrl-geolocate",this._container),le.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=le.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ss({element:this._dotElement}),this._circleElement=le.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ss({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(n=>{const l=n?.[0]instanceof ResizeObserverEntry;n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||l||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new s.l("trackuserlocationend")),this.fire(new s.l("userlocationlostfocus")))}))}},this.options=s.e({},ou,m)}onAdd(m){return this._map=m,this._container=le.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return s._(this,arguments,void 0,(function*(t=!1){if(Cn!==void 0&&!t)return Cn;if(window.navigator.permissions===void 0)return Cn=!!window.navigator.geolocation,Cn;try{Cn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Cn=!!window.navigator.geolocation}return Cn}))})().then((t=>this._finishSetupUI(t))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),le.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,bo=0,Ca=!1}_isOutOfMapMaxBounds(m){const t=this._map.getMaxBounds(),n=m.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
808RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){const m=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&m))return;const t=this._map.project(m),n=this._map.unproject([t.x+100,t.y]),l=m.distanceTo(n)/100,h=2*this._accuracy/l;this._circleElement.style.width=`${h.toFixed(2)}px`,this._circleElement.style.height=`${h.toFixed(2)}px`}trigger(){if(!this._setup)return s.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":bo--,Ca=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new s.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.l("trackuserlocationstart")),this.fire(new s.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let m;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),bo++,bo>1?(m={maximumAge:6e5,timeout:0},Ca=!0):(m=this.options.positionOptions,Ca=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,m)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},b.GlobeControl=class{constructor(){this._toggleProjection=()=>{var m;const t=(m=this._map.getProjection())===null||m===void 0?void 0:m.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var m;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((m=this._map.getProjection())===null||m===void 0?void 0:m.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(m){return this._map=m,this._container=le.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=le.create("button","maplibregl-ctrl-globe",this._container),le.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){le.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},b.Hash=Xc,b.ImageSource=wi,b.KeyboardHandler=$t,b.LngLatBounds=dr,b.L
vendor: 22,893 bytes, line 808
808ogoControl=rp,b.Map=class extends _i{constructor(m){var t,n;s.cG.mark(s.cH.create);const l=Object.assign(Object.assign(Object.assign({},zl),m),{canvasContextAttributes:Object.assign(Object.assign({},zl.canvasContextAttributes),m.canvasContextAttributes)});if(l.minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const h=new _a,g=new va;if(l.minZoom!==void 0&&h.setMinZoom(l.minZoom),l.maxZoom!==void 0&&h.setMaxZoom(l.maxZoom),l.minPitch!==void 0&&h.setMinPitch(l.minPitch),l.maxPitch!==void 0&&h.setMaxPitch(l.maxPitch),l.renderWorldCopies!==void 0&&h.setRenderWorldCopies(l.renderWorldCopies),l.transformConstrain!==null&&h.setConstrainOverride(l.transformConstrain),super(h,g,{bearingSnap:l.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Wd,this._controls=[],this._mapId=s.af(),this._lostContextStyle={style:null,images:null},this._contextLost=T=>{T.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy();for(const I of Object.values(this.style._layers))if(I.type==="custom"&&console.warn(`Custom layer with id '${I.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),I._listeners)for(const[A]of Object.entries(I._listeners))console.warn(`Custom layer with id '${I.id}' had event listeners for event '${A}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this._lostContextStyle=this._getStyleAndImages(),this.style.destroy(),this.style=null,this.fire(new s.l("webglcontextlost",{originalEvent:T}))},this._contextRestored=T=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new s.l("webglcontextrestored",{originalEvent:T}))},this._onMapScroll=T=>{if(T.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=l.interactive,this._maxTileCacheSize=l.maxTileCacheSize,this._maxTileCacheZoomLevels=l.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},l.canvasContextAttributes),this._trackResize=l.trackResize===!0,this._bearingSnap=l.bearingSnap,this._centerClampedToGround=l.centerClampedToGround,this._refreshExpiredTiles=l.refreshExpiredTiles===!0,this._fadeDuration=l.fadeDuration,this._crossSourceCollisions=l.crossSourceCollisions===!0,this._collectResourceTiming=l.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Dl),l.locale),this._clickTolerance=l.clickTolerance,this._overridePixelRatio=l.pixelRatio,this._maxCanvasSize=l.maxCanvasSize,this._zoomLevelsToOverscale=l.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=l.transformCameraUpdate,this.transformConstrain=l.transformConstrain,this.cancelPendingTileRequestsWhileZooming=l.cancelPendingTileRequestsWhileZooming===!0,l.reduceMotion!==void 0&&(ue.prefersReducedMotion=l.reduceMotion),this._imageQueueHandle=rt.addThrottleControl((()=>this.isMoving())),this._requestManager=new ut(l.transformRequest),typeof l.container=="string"){if(this._container=document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(l.maxBounds&&this.setMaxBounds(l.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),this.once("idle",(()=>{this._idleTriggered=!0})),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let T=!1;const I=Hc((A=>{this._trackResize&&!this._removed&&(this.resize(A),this.redraw())}),50);this._resizeObserver=new ResizeObserver((A=>{T?I(A):T=!0})),this._resizeObserver.observe(this._container)}this.handlers=new kl(this,l),this._hash=l.hash&&new Xc(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,elevation:l.elevation,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,roll:l.roll}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,s.e({},l.fitBoundsOptions,{duration:0}))));const _=typeof l.style=="string"||((n=(t=l.style)===null||t===void 0?void 0:t.projection)===null||n===void 0?void 0:n.type)!=="globe";this.resize(null,_),this._localIdeographFontFamily=l.localIdeographFontFamily,this._validateStyle=l.validateStyle,l.style&&this.setStyle(l.style,{localIdeographFontFamily:l.localIdeographFontFamily}),l.attributionControl&&this.addControl(new iu(typeof l.attributionControl=="boolean"?void 0:l.attributionControl)),l.maplibreLogo&&this.addControl(new rp,l.logoPosition),this.on("style.load",(()=>{if(_||this._resizeTransform(),this.transform.unmodified){const T=s.U(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(T)}})),this.on("data",(T=>{this._update(T.dataType==="style"),this.fire(new s.l(`${T.dataType}data`,T))})),this.on("dataloading",(T=>{this.fire(new s.l(`${T.dataType}dataloading`,T))})),this.on("dataabort",(T=>{this.fire(new s.l("sourcedataabort",T))}))}_getMapId(){return this._mapId}setGlobalStateProperty(m,t){return this.style.setGlobalStateProperty(m,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(m,t){if(t===void 0&&(t=m.getDefaultPosition?m.getDefaultPosition():"top-right"),!m||!m.onAdd)return this.fire(new s.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=m.onAdd(this);this._controls.push(m);const l=this._controlPositions[t];return t.indexOf("bottom")!==-1?l.insertBefore(n,l.firstChild):l.appendChild(n),this}removeControl(m){if(!m||!m.onRemove)return this.fire(new s.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(m);return t>-1&&this._controls.splice(t,1),m.onRemove(this),this}hasControl(m){return this._controls.indexOf(m)>-1}coveringTiles(m){return fr(this.transform,m)}calculateCameraOptionsFromTo(m,t,n,l){return l==null&&this.terrain&&(l=this.terrain.getElevationForLngLat(n,this.transform)),super.calculateCameraOptionsFromTo(m,t,n,l)}resize(m,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);const n=!this._moving;return n&&(this.stop(),this.fire(new s.l("movestart",m)).fire(new s.l("move",m))),this.fire(new s.l("resize",m)),n&&this.fire(new s.l("moveend",m)),this}_resizeInternal(m=!0){const[t,n]=this._containerDimensions(),l=this._getClampedPixelRatio(t,n);if(this._resizeCanvas(t,n,l),this.painter.resize(t,n,l),this.painter.overLimit()){const h=this.painter.context.gl;this._maxCanvasSize=[h.drawingBufferWidth,h.drawingBufferHeight];const g=this._getClampedPixelRatio(t,n);this._resizeCanvas(t,n,g),this.painter.resize(t,n,g)}this._resizeTransform(m)}_resizeTransform(m=!0){var t;const[n,l]=this._containerDimensions();this.transform.resize(n,l,m),(t=this._requestedCameraState)===null||t===void 0||t.resize(n,l,m)}_getClampedPixelRatio(m,t){const{0:n,1:l}=this._maxCanvasSize,h=this.getPixelRatio(),g=m*h,_=t*h;return Math.min(g>n?n/g:1,_>l?l/_:1)*h}getPixelRatio(){var m;return(m=this._overridePixelRatio)!==null&&m!==void 0?m:devicePixelRatio}setPixelRatio(m){this._overridePixelRatio=m,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(m){return this.transform.setMaxBounds(dr.convert(m)),this._update()}setMinZoom(m){if((m=m??-2)>=-2&&m<=this.transform.maxZoom){const t=this._getTransformForUpdate();return t.setMinZoom(m),this._applyUpdatedTransform(t),this._update(),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(m){if((m=m??22)>=this.transform.minZoom){const t=this._getTransformForUpdate();return t.setMaxZoom(m),this._applyUpdatedTransform(t),this._update(),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(m){if((m=m??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(m>=0&&m<=this.transform.maxPitch)return this.transform.setMinPitch(m),this._update(),this.getPitch()<m&&this.setPitch(m),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(m){if((m=m??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(m>=this.transform.minPitch)return this.transform.setMaxPitch(m),this._update(),this.getPitch()>m&&this.setPitch(m),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(m){return this.transform.setRenderWorldCopies(m),this._update()}setTransformConstrain(m){return this.transform.setConstrainOverride(m),this._update()}project(m){return this.transform.locationToScreenPoint(s.V.convert(m),this.style&&this.terrain)}unproject(m){return this.transform.screenPointToLocation(s.P.convert(m),this.terrain)}isMoving(){var m;return this._moving||((m=this.handlers)===null||m===void 0?void 0:m.isMoving())}isZooming(){var m;return this._zooming||((m=this.handlers)===null||m===void 0?void 0:m.isZooming())}isRotating(){var m;return this._rotating||((m=this.handlers)===null||m===void 0?void 0:m.isRotating())}_createDelegatedListener(m,t,n){if(m==="mouseenter"||m==="mouseover"){let l=!1;return{layers:t,listener:n,delegates:{mousemove:g=>{const _=t.filter((I=>this.getLayer(I))),T=_.length!==0?this.queryRenderedFeatures(g.point,{layers:_}):[];T.length?l||(l=!0,n.call(this,new Gr(m,this,g.originalEvent,{features:T}))):l=!1},mouseout:()=>{l=!1}}}}if(m==="mouseleave"||m==="mouseout"){let l=!1;return{layers:t,listener:n,delegates:{mousemove:_=>{const T=t.filter((I=>this.getLayer(I)));(T.length!==0?this.queryRenderedFeatures(_.point,{layers:T}):[]).length?l=!0:l&&(l=!1,n.call(this,new Gr(m,this,_.originalEvent)))},mouseout:_=>{l&&(l=!1,n.call(this,new Gr(m,this,_.originalEvent)))}}}}{const l=h=>{const g=t.filter((T=>this.getLayer(T))),_=g.length!==0?this.queryRenderedFeatures(h.point,{layers:g}):[];_.length&&(h.features=_,n.call(this,h),delete h.features)};return{layers:t,listener:n,delegates:{[m]:l}}}}_saveDelegatedListener(m,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[m]=this._delegatedListeners[m]||[],this._delegatedListeners[m].push(t)}_removeDelegatedListener(m,t,n){if(!this._delegatedListeners||!this._delegatedListeners[m])return;const l=this._delegatedListeners[m];for(let h=0;h<l.length;h++){const g=l[h];if(g.listener===n&&g.layers.length===t.length&&g.layers.every((_=>t.includes(_)))){for(const _ in g.delegates)this.off(_,g.delegates[_]);return void l.splice(h,1)}}}on(m,t,n){if(n===void 0)return super.on(m,t);const l=typeof t=="string"?[t]:t,h=this._createDelegatedListener(m,l,n);this._saveDelegatedListener(m,h);for(const g in h.delegates)this.on(g,h.delegates[g]);return{unsubscribe:()=>{this._removeDelegatedListener(m,l,n)}}}once(m,t,n){if(n===void 0)return super.once(m,t);const l=typeof t=="string"?[t]:t,h=this._createDelegatedListener(m,l,n);for(const g in h.delegates){const _=h.delegates[g];h.delegates[g]=(...T)=>{this._removeDelegatedListener(m,l,n),_(...T)}}this._saveDelegatedListener(m,h);for(const g in h.delegates)this.once(g,h.delegates[g]);return this}off(m,t,n){return n===void 0?super.off(m,t):(this._removeDelegatedListener(m,typeof t=="string"?[t]:t,n),this)}queryRenderedFeatures(m,t){if(!this.style)return[];let n;const l=m instanceof s.P||Array.isArray(m),h=l?m:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(l?{}:m)||{},h instanceof s.P||typeof h[0]=="number")n=[s.P.convert(h)];else{const g=s.P.convert(h[0]),_=s.P.convert(h[1]);n=[g,new s.P(_.x,g.y),_,new s.P(g.x,_.y),g]}return this.style.queryRenderedFeatures(n,t,this.transform)}querySourceFeatures(m,t){return this.style.querySourceFeatures(m,t)}setStyle(m,t){return(t=s.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&m?(this._diffStyle(m,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(m,t))}setTransformRequest(m){return this._requestManager.setTransformRequest(m),this}_getUIString(m){const t=this._locale[m];if(t==null)throw new Error(`Missing UI string '${m}'`);return t}_updateStyle(m,t){var n,l;if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(m,t)));const h=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!m)),m?(this.style=new ba(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof m=="string"?this.style.loadURL(m,t,h):this.style.loadJSON(m,t,h),this):((l=(n=this.style)===null||n===void 0?void 0:n.projection)===null||l===void 0||l.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ba(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(m,t){if(typeof m=="string"){const n=this._requestManager.transformRequest(m,"Style");s.j(n,new AbortController).then((l=>{this._updateDiff(l.data,t)})).catch((l=>{l&&this.fire(new s.k(l))}))}else typeof m=="object"&&this._updateDiff(m,t)}_updateDiff(m,t){try{this.style.setState(m,t)&&this._update(!0)}catch(n){s.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(m,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():s.w("There is no style added to the map.")}addSource(m,t){return this._lazyInitEmptyStyle(),this.style.addSource(m,t),this._update(!0)}isSourceLoaded(m){const t=this.style&&this.style.tileManagers[m];if(t!==void 0)return t.loaded();this.fire(new s.k(new Error(`There is no tile manager with ID '${m}'`)))}setTerrain(m){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),m){const t=this.style.tileManagers[m.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${m.source}`);this.terrain===null&&t.reload();for(const n in this.style._layers){const l=this.style._layers[n];l.type==="hillshade"&&l.source===m.source&&s.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),l.type==="color-relief"&&l.source===m.source&&s.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new hr(this.painter,t,m),this.painter.renderToTexture=new bs(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=n=>{var l;n.dataType==="style"?this.terrain.tileManager.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==m.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((l=n.source)===null||l===void 0?void 0:l.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new s.l("terrain",{terrain:m})),this}getTerrain(){var m,t;return(t=(m=this.terrain)===null||m===void 0?void 0:m.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const m=this.style&&this.style.tileManagers;for(const t of Object.values(m))if(!t.areTilesLoaded())return!1;return!0}removeSource(m){return this.style.removeSource(m),this._update(!0)}getSource(m){return this.style.getSource(m)}setSourceTileLodParams(m,t,n){if(n){const l=this.getSource(n);if(!l)throw new Error(`There is no source with ID "${n}", cannot set LOD parameters`);l.calculateTileZoom=jt(Math.max(1,m),Math.max(1,t))}else for(const l in this.style.tileManagers)this.style.tileManagers[l].getSource().calculateTileZoom=jt(Math.max(1,m),Math.max(1,t));return this._update(!0),this}refreshTiles(m,t){const n=this.style.tileManagers[m];if(!n)throw new Error(`There is no tile manager with ID "${m}", cannot refresh tile`);t===void 0?n.reload(!0):n.refreshTiles(t.map((l=>new s.ac(l.z,l.x,l.y))))}addImage(m,t,n={}){const{pixelRatio:l=1,sdf:h=!1,stretchX:g,stretchY:_,content:T,textFitWidth:I,textFitHeight:A}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||s.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:C,height:R,data:L}=t,O=t;return this.style.addImage(m,{data:new s.R({width:C,height:R},new Uint8Array(L)),pixelRatio:l,stretchX:g,stretchY:_,content:T,textFitWidth:I,textFitHeight:A,sdf:h,version:0,userImage:O}),O.onAdd&&O.onAdd(this,m),this}}{const{width:C,height:R,data:L}=ue.getImageData(t);this.style.addImage(m,{data:new s.R({width:C,height:R},L),pixelRatio:l,stretchX:g,stretchY:_,content:T,textFitWidth:I,textFitHeight:A,sdf:h,version:0})}}updateImage(m,t){const n=this.style.getImage(m);if(!n)return this.fire(new s.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const l=t instanceof HTMLImageElement||s.b(t)?ue.getImageData(t):t,{width:h,height:g,data:_}=l;if(h===void 0||g===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(h!==n.data.width||g!==n.data.height)return this.fire(new s.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(t instanceof HTMLImageElement||s.b(t));return n.data.replace(_,T),this.style.updateImage(m,n),this}getImage(m){return this.style.getImage(m)}hasImage(m){return m?!!this.style.getImage(m):(this.fire(new s.k(new Error("Missing required image id"))),!1)}removeImage(m){this.style.removeImage(m)}loadImage(m){return rt.getImage(this._requestManager.transformRequest(m,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(m,t){return this._lazyInitEmptyStyle(),this.style.addLayer(m,t),this._update(!0)}moveLayer(m,t){return this.style.moveLayer(m,t),this._update(!0)}removeLayer(m){return this.style.removeLayer(m),this._update(!0)}getLayer(m){return this.style.getLayer(m)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(m,t,n){return this.style.setLayerZoomRange(m,t,n),this._update(!0)}setFilter(m,t,n={}){return this.style.setFilter(m,t,n),this._update(!0)}getFilter(m){return this.style.getFilter(m)}setPaintProperty(m,t,n,l={}){return this.style.setPaintProperty(m,t,n,l),this._update(!0)}getPaintProperty(m,t){return this.style.getPaintProperty(m,t)}setLayoutProperty(m,t,n,l={}){return this.style.setLayoutProperty(m,t,n,l),this._update(!0)}getLayoutProperty(m,t){return this.style.getLayoutProperty(m,t)}setGlyphs(m,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(m,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(m,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(m,t,n,(l=>{l||this._update(!0)})),this}removeSprite(m){return this._lazyInitEmptyStyle(),this.style.removeSprite(m),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(m,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(m,t,(n=>{n||this._update(!0)})),this}setLight(m,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(m,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(m,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(m,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(m,t){return this.style.setFeatureState(m,t),this._update()}removeFeatureState(m,t){return this.style.removeFeatureState(m,t),this._update()}getFeatureState(m){return this.style.getFeatureState(m)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let m=0,t=0;return this._container&&(m=this._container.clientWidth||400,t=this._container.clientHeight||300),[m,t]}_setupContainer(){const m=this._container;m.classList.add("maplibregl-map");const t=this._canvasContainer=le.create("div","maplibregl-canvas-container",m);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=le.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
808on");const n=this._containerDimensions(),l=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],l);const h=this._controlContainer=le.create("div","maplibregl-control-container",m),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((_=>{g[_]=le.create("div",`maplibregl-ctrl-${_} `,h)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(m,t,n){this._canvas.width=Math.floor(n*m),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${m}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const m=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let t=null;this._canvas.addEventListener("webglcontextcreationerror",(l=>{t={requestedAttributes:m},l&&(t.statusMessage=l.statusMessage,t.type=l.type)}),{once:!0});let n=null;if(n=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,m):this._canvas.getContext("webgl2",m)||this._canvas.getContext("webgl",m),!n){const l="Failed to initialize WebGL";throw t?(t.message=l,new Error(JSON.stringify(t))):new Error(l)}this.painter=new qh(n,this.transform),He.testSupport(n)}migrateProjection(m,t){super.migrateProjection(m,t),this.painter.transform=m,this.fire(new s.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(m){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||m,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(m){return this._update(),this._renderTaskQueue.add(m)}_cancelRenderFrame(m){this._renderTaskQueue.remove(m)}_render(m){var t,n,l,h,g;const _=this._idleTriggered?this._fadeDuration:0,T=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(m),this._removed)return;let I=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const R=this.transform.zoom,L=me();this.style.zoomHistory.update(R,L);const O=new s.H(R,{now:L,fadeDuration:_,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),$=O.crossFadingFactor();$===1&&$===this._crossFadingFactor||(I=!0,this._crossFadingFactor=$),this.style.update(O)}const A=((n=this.style.projection)===null||n===void 0?void 0:n.transitionState)>0!==T;(l=this.style.projection)===null||l===void 0||l.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((h=this.style.projection)===null||h===void 0?void 0:h.transitionState,(g=this.style.projection)===null||g===void 0?void 0:g.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||A)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,_,this._crossSourceCollisions,A),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:_,showPadding:this.showPadding}),this.fire(new s.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,s.cG.mark(s.cH.load),this.fire(new s.l("load"))),this.style&&(this.style.hasTransitions()||I)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const C=this._sourcesDirty||this._styleDirty||this._placementDirty;return C||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new s.l("idle")),!this._loaded||this._fullyLoaded||C||(this._fullyLoaded=!0,s.cG.mark(s.cH.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var m;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),rt.removeThrottleControl(this._imageQueueHandle),(m=this._resizeObserver)===null||m===void 0||m.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),le.remove(this._canvasContainer),le.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),s.cG.clearMetrics(),this._removed=!0,this.fire(new s.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ue.frame(this._frameRequest,(m=>{s.cG.frame(m),this._frameRequest=null;try{this._render(m)}catch(t){if(!s.Z(t)&&!(function(n){return n.message===Uc})(t))throw t}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(m){this._showTileBoundaries!==m&&(this._showTileBoundaries=m,this._update())}get showPadding(){return!!this._showPadding}set showPadding(m){this._showPadding!==m&&(this._showPadding=m,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(m){this._showCollisionBoxes!==m&&(this._showCollisionBoxes=m,m?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(m){this._showOverdrawInspector!==m&&(this._showOverdrawInspector=m,this._update())}get repaint(){return!!this._repaint}set repaint(m){this._repaint!==m&&(this._repaint=m,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(m){this._vertices=m,this._update()}get version(){return nu}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(m){return this._lazyInitEmptyStyle(),this.style.setProjection(m),this._update(!0)}},b.MapMouseEvent=Gr,b.MapTouchEvent=ds,b.MapWheelEvent=Hh,b.Marker=Ss,b.NavigationControl
vendor: 9,556 bytes, line 808
808=class{constructor(m){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),l=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=l,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",l.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,n)=>{const l=this._map._getUIString(`NavigationControl.${n}`);t.title=l,t.setAttribute("aria-label",l)},this.options=s.e({},au,m),this._container=le.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),le.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),le.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=le.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(m){return this._map=m,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ws(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){le.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(m,t){const n=le.create("button",m,this._container);return n.type="button",n.addEventListener("click",t),n}},b.Popup=class extends s.E{constructor(m){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&le.remove(this._content),this._container&&(le.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new s.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=le.create("div","maplibregl-popup",this._map.getContainer()),this._tip=le.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const _ of this.options.className.split(" "))this._container.classList.add(_);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Ll(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;const n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let l=this.options.anchor;const h=Bl(this.options.offset);if(!l){const _=this._container.offsetWidth,T=this._container.offsetHeight,I=(function(C){var R,L,O,$;return C?{top:(R=C.top)!==null&&R!==void 0?R:0,right:(L=C.right)!==null&&L!==void 0?L:0,bottom:(O=C.bottom)!==null&&O!==void 0?O:0,left:($=C.left)!==null&&$!==void 0?$:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding);let A;A=n.y+h.bottom.y<T+I.top?["top"]:n.y>this._map.transform.height-T-I.bottom?["bottom"]:[],n.x<_/2+I.left?A.push("left"):n.x>this._map.transform.width-_/2-I.right&&A.push("right"),l=A.length===0?"bottom":A.join("-")}let g=n.add(h[l]);this.options.subpixelPositioning||(g=g.round()),le.setTransform(this._container,`${Ts[l]} translate(${g.x}px,${g.y}px)`),Rl(this._container,l,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=s.e(Object.create(lu),m)}addTo(m){return this._map&&this.remove(),this._map=m,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new s.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(m){return this._lngLat=s.V.convert(m),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(m){return this.setDOMContent(document.createTextNode(m))}setHTML(m){const t=document.createDocumentFragment(),n=document.createElement("body");let l;for(n.innerHTML=m;l=n.firstChild,l;)t.appendChild(l);return this.setDOMContent(t)}getMaxWidth(){var m;return(m=this._container)===null||m===void 0?void 0:m.style.maxWidth}setMaxWidth(m){return this.options.maxWidth=m,this._update(),this}setDOMContent(m){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=le.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(m),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(m){return this._container&&this._container.classList.add(m),this}removeClassName(m){return this._container&&this._container.classList.remove(m),this}setOffset(m){return this.options.offset=m,this._update(),this}toggleClassName(m){if(this._container)return this._container.classList.toggle(m)}setSubpixelPositioning(m){this.options.subpixelPositioning=m}setPadding(m){this.options.padding=m,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=le.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const m=this._container.querySelector(Fl);m&&m.focus()}},b.RasterDEMTileSource=qn,b.RasterTileSource=Za,b.ScaleControl=class{constructor(m){this._onMove=()=>{Ms(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ms(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},su),m)}getDefaultPosition(){return"bottom-left"}onAdd(m){return this._map=m,this._container=le.create("div","maplibregl-ctrl maplibregl-ctrl-scale",m.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){le.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}}
808,b.ScrollZoomHandler=El,b.Style=ba,b.TerrainControl=class{constructor(m){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=m}onAdd(m){return this._map=m,this._container=le.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=le.create("button","maplibregl-ctrl-terrain",this._container),le.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){le.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},b.TwoFingersTouchPitchHandler=Jh,b.TwoFingersTouchRotateHandler=eu,b.TwoFingersTouchZoomHandler=Qc,b.TwoFingersTouchZoomRotateHandler=_s,b.VectorTileSource=fa,b.VideoSource=ye,b.addSourceType=(m,t)=>s._(void 0,void 0,void 0,(function*(){if(W(m))throw new Error(`A source type called "${m}" already exists.`);((n,l)=>{V[n]=l})(m,t)})),b.clearPrewarmedResources=function(){const m=Pn;m&&(m.isPreloaded()&&m.numActive()===1?(m.release(pa),Pn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},b.createTileMesh=hh,b.getMaxParallelImageRequests=function(){return s.c.MAX_PARALLEL_IMAGE_REQUESTS},b.getRTLTextPluginStatus=function(){return ge().getRTLTextPluginStatus()},b.getVersion=function(){return cu},b.getWorkerCount=function(){return ri.workerCount},b.getWorkerUrl=function(){return s.c.WORKER_URL},b.importScriptInWorkers=function(m){return Bo().broadcast("IS",m)},b.isTimeFrozen=function(){return ve.isFrozen()},b.now=me,b.prewarm=function(){da().acquire(pa)},b.restoreNow=function(){ve.restoreNow()},b.setMaxParallelImageRequests=function(m){s.c.MAX_PARALLEL_IMAGE_REQUESTS=m},b.setNow=function(m){ve.setNow(m)},b.setRTLTextPlugin=function(m,t){return ge().setRTLTextPlugin(m,t)},b.setWorkerCount=function(m){ri.workerCount=m},b.setWorkerUrl=function(m){s.c.WORKER_URL=m}}));var M=d;return M}))})(Up)),Up.exports}var E1=A1();const st=A0(E1),C0="3.8.0",C1=C0,dc=typeof Buffer=="function",x_=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,b_=typeof TextEncoder=="function"?new TextEncoder:void 0,k1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",zu=Array.prototype.slice.call(k1),Dp=(u=>{let o={};return u.forEach((d,v)=>o[d]=v),o})(zu),D1=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,bi=String.fromCharCode.bind(String),w_=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):u=>new Uint8Array(Array.prototype.slice.call(u,0)),k0=u=>u.replace(/=/g,"").replace(/[+\/]/g,o=>o=="+"?"-":"_"),D0=u=>u.replace(/[^A-Za-z0-9\+\/]/g,""),z0=u=>{let o,d,v,w,M="";const b=u.length%3;for(let s=0;s<u.length;){if((d=u.charCodeAt(s++))>255||(v=u.charCodeAt(s++))>255||(w=u.charCodeAt(s++))>255)throw new TypeError("invalid character found");o=d<<16|v<<8|w,M+=zu[o>>18&63]+zu[o>>12&63]+zu[o>>6&63]+zu[o&63]}return b?M.slice(0,b-3)+"===".substring(b):M},zm=typeof btoa=="function"?u=>btoa(u):dc?u=>Buffer.from(u,"binary").toString("base64"):z0,um=dc?u=>Buffer.from(u).toString("base64"):u=>{let d=[];for(let v=0,w=u.length;v<w;v+=4096)d.push(bi.apply(null,u.subarray(v,v+4096)));return zm(d.join(""))},$p=(u,o=!1)=>o?k0(um(u)):um(u),z1=u=>{if(u.length<2){var o=u.charCodeAt(0);return o<128?u:o<2048?bi(192|o>>>6)+bi(128|o&63):bi(224|o>>>12&15)+bi(128|o>>>6&63)+bi(128|o&63)}else{var o=65536+(u.charCodeAt(0)-55296)*1024+(u.charCodeAt(1)-56320);return bi(240|o>>>18&7)+bi(128|o>>>12&63)+bi(128|o>>>6&63)+bi(128|o&63)}},L1=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,L0=u=>u.replace(L1,z1),T_=dc?u=>
808Buffer.from(u,"utf8").toString("base64"):b_?u=>um(b_.encode(u)):u=>zm(L0(u)),sc=(u,o=!1)=>o?k0(T_(u)):T_(u),S_=u=>sc(u,!0),R1=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,F1=u=>{switch(u.length){case 4:var o=(7&u.charCodeAt(0))<<18|(63&u.charCodeAt(1))<<12|(63&u.charCodeAt(2))<<6|63&u.charCodeAt(3),d=o-65536;return bi((d>>>10)+55296)+bi((d&1023)+56320);case 3:return bi((15&u.charCodeAt(0))<<12|(63&u.charCodeAt(1))<<6|63&u.charCodeAt(2));default:return bi((31&u.charCodeAt(0))<<6|63&u.charCodeAt(1))}},R0=u=>u.replace(R1,F1),F0=u=>{if(u=u.replace(/\s+/g,""),!D1.test(u))throw new TypeError("malformed base64.");u+="==".slice(2-(u.length&3));let o,d,v,w=[];for(let M=0;M<u.length;)o=Dp[u.charAt(M++)]<<18|Dp[u.charAt(M++)]<<12|(d=Dp[u.charAt(M++)])<<6|(v=Dp[u.charAt(M++)]),d===64?w.push(bi(o>>16&255)):v===64?w.push(bi(o>>16&255,o>>8&255)):w.push(bi(o>>16&255,o>>8&255,o&255));return w.join("")},Lm=typeof atob=="function"?u=>atob(D0(u)):dc?u=>Buffer.from(u,"base64").toString("binary"):F0,B0=dc?u=>w_(Buffer.from(u,"base64")):u=>w_(Lm(u).split("").map(o=>o.charCodeAt(0))),O0=u=>B0(N0(u)),B1=dc?u=>Buffer.from(u,"base64").toString("utf8"):x_?u=>x_.decode(B0(u)):u=>R0(Lm(u)),N0=u=>D0(u.replace(/[-_]/g,o=>o=="-"?"+":"/")),hm=u=>B1(N0(u)),O1=u=>{if(typeof u!="string")return!1;const o=u.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(o)||!/[^\s0-9a-zA-Z\-_]/.test(o)},j0=u=>({value:u,enumerable:!1,writable:!0,configurable:!0}),V0=function(){const u=(o,d)=>Object.defineProperty(String.prototype,o,j0(d));u("fromBase64",function(){return hm(this)}),u("toBase64",function(o){return sc(this,o)}),u("toBase64URI",function(){return sc(this,!0)}),u("toBase64URL",function(){return sc(this,!0)}),u("toUint8Array",function(){return O0(this)})},U0=function(){const u=(o,d)=>Object.defineProperty(Uint8Array.prototype,o,j0(d));u("toBase64",function(o){return $p(this,o)}),u("toBase64URI",function(){return $p(this,!0)}),u("toBase64URL",function(){return $p(this,!0)})},N1=()=>{V0(),U0()},j1={version:C0,VERSION:C1,atob:Lm,atobPolyfill:F0,btoa:zm,btoaPolyfill:z0,fromBase64:hm,toBase64:sc,encode:sc,encodeURI:S_,encodeURL:S_,utob:L0,btou:R0,decode:hm,isValid:O1,fromUint8Array:$p,toUint8Array:O0,extendString:V0,extendUint8Array:U0,extendBuiltins:N1};var zp={exports:{}},M_;function V1(){if(M_)return zp.exports;M_=1;var u=typeof Reflect=="object"?Reflect:null,o=u&&typeof u.apply=="function"?u.apply:function(Me,Re,rt){return Function.prototype.apply.call(Me,Re,rt)},d;u&&typeof u.ownKeys=="function"?d=u.ownKeys:Object.getOwnPropertySymbols?d=function(Me){return Object.getOwnPropertyNames(Me).concat(Object.getOwnPropertySymbols(Me))}:d=function(Me){return Object.getOwnPropertyNames(Me)};function v(ke){console&&console.warn&&console.warn(ke)}var w=Number.isNaN||function(Me){return Me!==Me};function M(){M.init.call(this)}zp.exports=M,zp.exports.once=He,M.EventEmitter=M,M.prototype._events=void 0,M.prototype._eventsCount=0,M.prototype._maxListeners=void 0;var b=10;function s(ke){if(typeof ke!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ke)}Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:function(){return b},set:function(ke){if(typeof ke!="number"||ke<0||w(ke))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ke+".");b=ke}}),M.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},M.prototype.setMaxListeners=function(Me){if(typeof Me!="number"||Me<0||w(Me))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Me+".");return this._maxListeners=Me,this};function D(ke){return ke._maxListeners===void 0?M.defaultMaxListeners:ke._maxListeners}M.prototype.getMaxListeners=function(){return D(this)},M.prototype.emit=function(Me){for(var Re=[],rt=1;rt<arguments.length;rt++)Re.push(arguments[rt]);var ut=Me==="error",It=this._events;if(It!==void 0)ut=ut&&It.error===void 0;else if(!ut)return!1;if(ut){var dt;if(Re.length>0&&(dt=Re[0]),dt instanceof Error)throw dt;var Cr=new Error("Unhandled error."+(dt?" ("+dt.message+")":""));throw Cr.context=dt,Cr}var Ur=It[Me];if(Ur===void 0)return!1;if(typeof Ur=="function")o(Ur,this,Re);else for(var ci=Ur.length,Tn=ve(Ur,ci),rt=0;rt<ci;++rt)o(Tn[rt],this,Re);return!0};function N(ke,Me,Re,rt){var ut,It,dt;if(s(Re),It=ke._events,It===void 0?(It=ke._events=Object.create(null),ke._eventsCount=0):(It.
vendor: 6,933 bytes, line 808
808newListener!==void 0&&(ke.emit("newListener",Me,Re.listener?Re.listener:Re),It=ke._events),dt=It[Me]),dt===void 0)dt=It[Me]=Re,++ke._eventsCount;else if(typeof dt=="function"?dt=It[Me]=rt?[Re,dt]:[dt,Re]:rt?dt.unshift(Re):dt.push(Re),ut=D(ke),ut>0&&dt.length>ut&&!dt.warned){dt.warned=!0;var Cr=new Error("Possible EventEmitter memory leak detected. "+dt.length+" "+String(Me)+" listeners added. Use emitter.setMaxListeners() to increase limit");Cr.name="MaxListenersExceededWarning",Cr.emitter=ke,Cr.type=Me,Cr.count=dt.length,v(Cr)}return ke}M.prototype.addListener=function(Me,Re){return N(this,Me,Re,!1)},M.prototype.on=M.prototype.addListener,M.prototype.prependListener=function(Me,Re){return N(this,Me,Re,!0)};function Z(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function re(ke,Me,Re){var rt={fired:!1,wrapFn:void 0,target:ke,type:Me,listener:Re},ut=Z.bind(rt);return ut.listener=Re,rt.wrapFn=ut,ut}M.prototype.once=function(Me,Re){return s(Re),this.on(Me,re(this,Me,Re)),this},M.prototype.prependOnceListener=function(Me,Re){return s(Re),this.prependListener(Me,re(this,Me,Re)),this},M.prototype.removeListener=function(Me,Re){var rt,ut,It,dt,Cr;if(s(Re),ut=this._events,ut===void 0)return this;if(rt=ut[Me],rt===void 0)return this;if(rt===Re||rt.listener===Re)--this._eventsCount===0?this._events=Object.create(null):(delete ut[Me],ut.removeListener&&this.emit("removeListener",Me,rt.listener||Re));else if(typeof rt!="function"){for(It=-1,dt=rt.length-1;dt>=0;dt--)if(rt[dt]===Re||rt[dt].listener===Re){Cr=rt[dt].listener,It=dt;break}if(It<0)return this;It===0?rt.shift():me(rt,It),rt.length===1&&(ut[Me]=rt[0]),ut.removeListener!==void 0&&this.emit("removeListener",Me,Cr||Re)}return this},M.prototype.off=M.prototype.removeListener,M.prototype.removeAllListeners=function(Me){var Re,rt,ut;if(rt=this._events,rt===void 0)return this;if(rt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):rt[Me]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete rt[Me]),this;if(arguments.length===0){var It=Object.keys(rt),dt;for(ut=0;ut<It.length;++ut)dt=It[ut],dt!=="removeListener"&&this.removeAllListeners(dt);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(Re=rt[Me],typeof Re=="function")this.removeListener(Me,Re);else if(Re!==void 0)for(ut=Re.length-1;ut>=0;ut--)this.removeListener(Me,Re[ut]);return this};function pe(ke,Me,Re){var rt=ke._events;if(rt===void 0)return[];var ut=rt[Me];return ut===void 0?[]:typeof ut=="function"?Re?[ut.listener||ut]:[ut]:Re?le(ut):ve(ut,ut.length)}M.prototype.listeners=function(Me){return pe(this,Me,!0)},M.prototype.rawListeners=function(Me){return pe(this,Me,!1)},M.listenerCount=function(ke,Me){return typeof ke.listenerCount=="function"?ke.listenerCount(Me):ue.call(ke,Me)},M.prototype.listenerCount=ue;function ue(ke){var Me=this._events;if(Me!==void 0){var Re=Me[ke];if(typeof Re=="function")return 1;if(Re!==void 0)return Re.length}return 0}M.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function ve(ke,Me){for(var Re=new Array(Me),rt=0;rt<Me;++rt)Re[rt]=ke[rt];return Re}function me(ke,Me){for(;Me+1<ke.length;Me++)ke[Me]=ke[Me+1];ke.pop()}function le(ke){for(var Me=new Array(ke.length),Re=0;Re<Me.length;++Re)Me[Re]=ke[Re].listener||ke[Re];return Me}function He(ke,Me){return new Promise(function(Re,rt){function ut(dt){ke.removeListener(Me,It),rt(dt)}function It(){typeof ke.removeListener=="function"&&ke.removeListener("error",ut),Re([].slice.call(arguments))}$e(ke,Me,It,{once:!0}),Me!=="error"&&Ne(ke,ut,{once:!0})})}function Ne(ke,Me,Re){typeof ke.on=="function"&&$e(ke,"error",Me,Re)}function $e(ke,Me,Re,rt){if(typeof ke.on=="function")rt.once?ke.once(Me,Re):ke.on(Me,Re);else if(typeof ke.addEventListener=="function")ke.addEventListener(Me,function ut(It){rt.once&&ke.removeEventListener(Me,ut),Re(It)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ke)}return zp.exports}var U1=V1();const $1=A0(U1);function G1(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class q1{constructor(){this._apiKey="",this._fetch=G1(),this.tileCacheSize=200}set apiKey(o){this._apiKey=o}get apiKey(){return this._apiKey}set fetch(o){this._fetch=o}get fetch(){return this._fetch}}const lc=new q1,Z1={AUTO:{code:null,flag:"auto",name:"Auto",latin:!1,isMode:!0,geocoding:!0},LATIN:{code:"latin",flag:"name:latin",name:"Latin",latin:!0,isMode:!1,geocoding:!1},NON_LATIN:{code:"nonlatin",flag:"name:nonlatin",name:"Non Latin",latin:!1,isMode:!1,geocoding:!1},LOCAL:{code:null,flag:"name",name:"Local",latin:!0,isMode:!1,geocoding:!1}},W1={ALBANIAN:{code:"sq",flag:"name:sq",name:"Albanian",latin:!0,isMode:!1,geocoding:!0},AMHARIC:{code:"am",flag:"name:am",name:"Amharic",latin:!1,isMode:!1,geocoding:!0},ARABIC:{code:"ar",flag:"name:ar",name:"Arabic",latin:!1,isMode:!1,geocoding:!0},ARMENIAN:{code:"hy",flag:"name:hy",name:"Armenian",latin:!1,isMode:!1,geocoding:!0},AZERBAIJANI:{code:"az",flag:"name:az",name:"Azerbaijani",latin:!0,isMode:!1,geocoding:!0},BASQUE:{code:"eu",flag:"name:eu",name:"Basque",latin:!0,isMode:!1,geocoding:!0},BELARUSIAN:{code:"be",flag:"name:be",name:"Belarusian",latin:!1,isMode:!1,geocoding:!0},BENGALI:{code:"bn",flag:"name:bn",name:"Bengali",latin:!0,isMode:!1,geocoding:!0},BOSNIAN:{code:"bs",flag:"name:bs",name:"Bosnian",latin:!0,isMode:!1,geocoding:!0},BRETON:{code:"br",flag:"name:br",name:"Breton",latin:!0,isMode:!1,geocoding:!0},BULGARIAN:{code:"bg",flag:"bg",name:"Bulgarian",latin:!1,isMode:!1,geocoding:!0},CATALAN:{code:"ca",flag:"name:ca",name:"Catalan",latin:!0,isMode:!1,geocoding:!0},CHINESE:{code:"zh",flag:"name:zh",name:"Chinese",latin:!1,isMode:!1,geocoding:!0},TRADITIONAL_CHINESE:{code:"zh-Hant",flag:"name:zh-Hant",name:"Chinese (traditional)",latin:!1,isMode:!1,geocoding:!1},SIMPLIFIED_CHINESE:{code:"zh-Hans",flag:"name:zh-Hans",name:"Chinese (simplified)",latin:!1,isMode:!1,geocoding:!1},CORSICAN:{code:"co",flag:"name:co",name:"Corsican",latin:!0,isMode:!1,geocoding:!0},CROATIAN:{code:"hr",flag:"name:hr",name:"Croatian",latin:!0,isMode:!1,geocoding:!0},CZECH:{code:"cs",flag:"name:cs",name:"Czech",latin:!0,isMode:!1,geocoding:!0},DANISH:{code:"da",flag:"name:da",name:"Danish",latin:!0,isMode:!1,geocoding:!0},DUTCH:{code:"nl",flag:"name:nl",name:"Dutch",latin:!0,isMode:!1,geocoding:!0},GERMAN:{code:"de",flag:"name:de",name:"German",latin:!0,isMode:!1,geocoding:!0},GREEK:{code:"el",flag:"name:el",name:"Greek",latin:!1,isMode:!1,geocoding:!0},ENGLISH:{code:"en",flag:"name:en",name:"English",latin:!0,isMode:!1,geocoding:!0},ESPERANTO:{code:"eo",flag:"name:eo",name:"Esperanto",latin:!0,isMode:!1,geocoding:!0}
808,ESTONIAN:{code:"et",flag:"name:et",name:"Estonian",latin:!0,isMode:!1,geocoding:!0},FINNISH:{code:"fi",flag:"name:fi",name:"Finnish",latin:!0,isMode:!1,geocoding:!0},FRENCH:{code:"fr",flag:"name:fr",name:"French",latin:!0,isMode:!1,geocoding:!0},FRISIAN:{code:"fy",flag:"name:fy",name:"Frisian (West)",latin:!0,isMode:!1,geocoding:!0},GEORGIAN:{code:"ka",flag:"name:ka",name:"Georgian",latin:!1,isMode:!1,geocoding:!0},HEBREW:{code:"he",flag:"name:he",name:"Hebrew",latin:!1,isMode:!1,geocoding:!0},HINDI:{code:"hi",flag:"name:hi",name:"Hindi",latin:!1,isMode:!1,geocoding:!0},HUNGARIAN:{code:"hu",flag:"name:hu",name:"Hungarian",latin:!0,isMode:!1,geocoding:!0},ICELANDIC:{code:"is",flag:"name:is",name:"Icelandic",latin:!0,isMode:!1,geocoding:!0},INDONESIAN:{code:"id",flag:"name:id",name:"Indonesian",latin:!0,isMode:!1,geocoding:!0},IRISH:{code:"ga",flag:"name:ga",name:"Irish",latin:!0,isMode:!1,geocoding:!0},ITALIAN:{code:"it",flag:"name:it",name:"Italian",latin:!0,isMode:!1,geocoding:!0},JAPANESE:{code:"ja",flag:"name:ja",name:"Japanese",latin:!1,isMode:!1,geocoding:!0},JAPANESE_HIRAGANA:{code:"ja-Hira",flag:"name:ja-Hira",name:"Japanese Hiragana form",latin:!1,isMode:!1,geocoding:!1},JAPANESE_2018:{code:"ja-Latn",flag:"name:ja-Latn",name:"Japanese (Latin 2018)",latin:!0,isMode:!1,geocoding:!1},JAPANESE_KANA:{code:"ja_kana",flag:"name:ja_kana",name:"Japanese (Kana)",latin:!1,isMode:!1,geocoding:!1},JAPANESE_LATIN:{code:"ja_rm",flag:"name:ja_rm",name:"Japanese (Latin script)",latin:!0,isMode:!1,geocoding:!1},KANNADA:{code:"kn",flag:"name:kn",name:"Kannada",latin:!0,isMode:!1,geocoding:!0},KAZAKH:{code:"kk",flag:"name:kk",name:"Kazakh",latin:!1,isMode:!1,geocoding:!0},KOREAN:{code:"ko",flag:"name:ko",name:"Korean",latin:!1,isMode:!1,geocoding:!0},KOREAN_LATIN:{code:"ko-Latn",flag:"name:ko-Latn",name:"Korean (Latin script)",latin:!0,isMode:!1,geocoding:!1},KURDISH:{code:"ku",flag:"name:ku",name:"Kurdish",latin:!0,isMode:!1,geocoding:!0},CLASSICAL_LATIN:{code:"la",flag:"name:la",name:"Latin",latin:!0,isMode:!1,geocoding:!0},LATVIAN:{code:"lv",flag:"name:lv",name:"Latvian",latin:!0,isMode:!1,geocoding:!0},LITHUANIAN:{code:"lt",flag:"name:lt",name:"Lithuanian",latin:!0,isMode:!1,geocoding:!0},LUXEMBOURGISH:{code:"lb",flag:"name:lb",name:"Luxembourgish",latin:!0,isMode:!1,geocoding:!0},MACEDONIAN:{code:"mk",flag:"name:mk",name:"Macedonian",latin:!1,isMode:!1,geocoding:!0},MALAYALAM:{code:"ml",flag:"name:ml",name:"Malayalam",latin:!1,isMode:!1,geocoding:!0},MALTESE:{code:"mt",flag:"name:mt",name:"Maltese",latin:!0,isMode:!1,geocoding:!0},NORWEGIAN:{code:"no",flag:"name:no",name:"Norwegian",latin:!0,isMode:!1,geocoding:!0},OCCITAN:{code:"oc",flag:"name:oc",name:"Occitan",latin:!0,isMode:!1,geocoding:!0},PERSIAN:{code:"fa",flag:"name:fa",name:"Persian",latin:!1,isMode:!1,geocoding:!0},POLISH:{code:"pl",flag:"name:pl",name:"Polish",latin:!0,isMode:!1,geocoding:!0},PORTUGUESE:{code:"pt",flag:"name:pt",name:"Portuguese",latin:!0,isMode:!1,geocoding:!0},PUNJABI:{code:"pa",flag:"name:pa",name:"Punjabi",latin:!1,isMode:!1,geocoding:!0},WESTERN_PUNJABI:{code:"pnb",flag:"name:pnb",name:"Western Punjabi",latin:!1,isMode:!1,geocoding:!1},ROMANIAN:{code:"ro",flag:"name:ro",name:"Romanian",latin:!0,isMode:!1,geocoding:!0},ROMANSH:{code:"rm",flag:"name:rm",name:"Romansh",latin:!0,isMode:!1,geocoding:!0},RUSSIAN:{code:"ru",flag:"name:ru",name:"Russian",latin:!1,isMode:!1,geocoding:!0},SERBIAN_CYRILLIC:{code:"sr",flag:"name:sr",name:"Serbian (Cyrillic script)",latin:!1,isMode:!1,geocoding:!0},SERBIAN_LATIN:{code:"sr-Latn",flag:"name:sr-Latn",name:"Serbian (Latin script)",latin:!0,isMode:!1,geocoding:!1},SCOTTISH_GAELIC:{code:"gd",flag:"name:gd",name:"Scottish Gaelic",latin:!0,isMode:!1,geocoding:!0},SLOVAK:{code:"sk",flag:"name:sk",name:"Slovak",latin:!0,isMode:!1,geocoding:!0},SLOVENE:{code:"sl",flag:"name:sl",name:"Slovene",latin:!0,isMode:!1,geocoding:!0},SPANISH:{code:"es",flag:"name:es",name:"Spanish",latin:!0,isMode:!1,geocoding:!0},SWEDISH:{code:"sv",flag:"name:sv",name:"Swedish",latin:!0,isMode:!1,geocoding:!0},TAMIL:{code:"ta",flag:"name:ta",name:"Tamil",latin:!1,isMode:!1,geocoding:!0},TELUGU:{code:"te",flag:"name:te",name:"Telugu",latin:!1,isMode:!1,geocoding:!0},THAI:{code:"th",flag:"name:th",name:"Thai",latin:!1,isMode:!1,geocoding:!0},TURKISH:{code:"tr",flag:"name:tr",name:"Turkish",latin:!0,isMode:!1,geocoding:!0},UKRAINIAN:{code:"uk",flag:"name:uk",name:"Ukrainian",latin:!1,isMode:!1,geocoding:!0},VIETNAMESE:{code:"vi",flag:"name:vi",name:"Vietnamese (Latin script)",latin:!0,isMode:!1,geocoding:!0},WELSH:{code:"cy",flag:"name:cy",name:"Welsh",latin:!0,isMode:!1,geocoding:!0}},Ku={...Z1,...W1};function H1(u,o=Ku){return u in o?u[u]:null}function pm(u,o=Ku){for(const d of Object.values(o))if(d.code===u)return d;return null}function dm(u,o=Ku){for(const d of Object.values(o))if(d.flag===u)return d;return null}function X1(u){return u!==null&&typeof u=="object"&&"code"in u&&"flag"in u&&"name"in u&&"latin"in u&&"isMode"in u&&"geocoding"in u&&(typeof u.code=="string"||u.code===null)&&typeof u.flag=="string"&&typeof u.name=="string"&&typeof u.latin=="boolean"&&typeof u.isMode=="boolean"&&typeof u.geocoding=="boolean"}function I_(u,o=Ku){return X1(u)?dm(u.flag,o):typeof u!="string"?null:H1(u,o)||pm(u,o)||dm(u,o)||null}async function Y1(u,o={}){if(lc.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");
808if(new URL(u).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return lc.fetch(u,o)}const $0={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze($0);class K1 extends Error{constructor(o,d=""){super(`Call to enpoint ${o.url} failed with the status code ${o.status}. ${d}`),this.res=o}}const P_={403:"Key is missing, invalid or restricted"};async function J1(u={}){const o=new URL("geolocation/ip.json",$0.maptilerApiURL);o.searchParams.set("key",u.apiKey??lc.apiKey),"elevation"in u&&o.searchParams.set("elevation",u.elevation?"true":"false");const d=o.toString(),v=await Y1(d);if(!v.ok)throw new K1(v,v.status in P_?P_[v.status]:"");return await v.json()}const A_={info:J1};function G0(u){const o=/^maptiler:\/\/(.*)/;let d;const v=u.trim();let w;return v.startsWith("http://")||v.startsWith("https://")?w=v:(d=o.exec(v))!==null?w=`https://api.maptiler.com/maps/${d[1]}/style.json`:w=`https://api.maptiler.com/maps/${v}/style.json`,w}class q0{constructor(o,d,v,w,M,b,s=!1,D){this.name=o,this.variantType=d,this.id=v,this.referenceStyle=w,this.description=M,this.imageURL=b,this.deprecated=s,this.deprecationMessage=D}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(o){return this.referenceStyle.hasVariant(o)}getVariant(o){const d=this.referenceStyle.getVariant(o);return this.warnIfDeprecated(d),d}getVariants(){return this.referenceStyle.getVariants().filter(o=>o!==this).map(o=>(this.warnIfDeprecated(o),o))}getImageURL(){return this.imageURL}getExpandedStyleURL(){return G0(this.getId())}warnIfDeprecated(o=this){if(!o.deprecated)return o;if(o.deprecationMessage)console.warn(o.deprecationMessage);else{const d=o.getFullName();console.warn(`Style "${d}" is deprecated and will be removed in a future version.`)}return o}}class Z0{constructor(o,d){this.name=o,this.id=d,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(o){this.variants[o.getType()]=o,this.orderedVariants.push(o)}hasVariant(o){return o in this.variants}getVariant(o){return o in this.variants?this.variants[o]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0].warnIfDeprecated()}}const Q1=[{referenceStyleID:"STREETS_V2",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default v2",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2" is deprecated, use "streets-v4" instead'},{id:"streets-v2-dark",name:"Dark v2",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-dark" is deprecated, use "streets-v4-dark" instead'},{id:"streets-v2-light",name:"Light v2",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-light" is deprecated, use "streets-v4-light" instead'},{id:"streets-v2-night",name:"Night v2",variantType:"NIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-night" is deprecated, use "streets-v4-night" instead'},{id:"streets-v2-pastel",name:"Pastel v2",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-pastel" is deprecated, use "streets-v4-pastel" instead'}]},{referenceStyleID:"STREETS_V4",name:"Streets",description:"",variants:[{id:"streets-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"BASE_V4",name:"Base",description:"",variants:[{id:"base-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"base-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"base-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"base-v4-ai",name:"Base AI",variantType:"AI",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2" is deprecated, use "outdoor-v4" instead'}
808,{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2-dark" is deprecated, use "outdoor-v4-dark" instead'}]},{referenceStyleID:"WINTER_V2",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER_V4",name:"Winter",description:"",variants:[{id:"winter-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V2",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"satellite" is deprecated, use "satellite-v4" instead'}]},{referenceStyleID:"HYBRID_V2",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID_V4",name:"Hybrid",description:"",variants:[{id:"hybrid-v4",name:"Default",variantType:"DEFAULT",imageURL:""},{id:"hybrid-v4-dark",name:"Dark",variantType:"DARK",imageURL:""}]},{referenceStyleID:"BASIC_V2",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP_V2",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"openstreetmap-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V2",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2" is deprecated, use "topo-v4" instead'},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-dark" is deprecated, use "topo-v4-dark" instead'},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:"",deprecated:!0},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-pastel" is deprecated, use "topo-v4-pastel" instead'},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-topographique" is deprecated, use "topo-v4-topographique" instead'}]},{referenceStyleID:"VOYAGER_V2",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",deprecated:!0,variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",deprecated:!0,variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",deprecated:!0,variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",deprecated:!0,variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER_V2",name:"Toner",description:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and will be no longer be a default style in the future',variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and may be removed in future versions.'}
808,{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",deprecated:!0,description:"",imageURL:"",deprecationMessage:'"toner-v2-background" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lite" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lines" is deprecated, and may be removed in future versions.'}]},{referenceStyleID:"DATAVIZ_V2",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz" is deprecated, use "dataviz-v4" instead'},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-dark" is deprecated, use "dataviz-v4-dark" instead'},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-light" is deprecated, use "dataviz-v4-light" instead'}]},{referenceStyleID:"BACKDROP_V2",name:"Backdrop",description:"",variants:[{id:"backdrop",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop" is deprecated, use "backdrop-v4" instead'},{id:"backdrop-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-dark" is deprecated, use "backdrop-v4-dark" instead'},{id:"backdrop-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-light" is deprecated, use "backdrop-v4-light" instead'}]},{referenceStyleID:"OCEAN_V2",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"ocean" is deprecated, use "ocean-v4" instead'}]},{referenceStyleID:"AQUARELLE_V2",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle" is deprecated, use "aquarelle-v4" instead'},{id:"aquarelle-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-dark" is deprecated, use "aquarelle-v4-dark" instead'},{id:"aquarelle-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-vivid" is deprecated, use "aquarelle-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V2",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape" is deprecated, use "landscape-v4" instead'},{id:"landscape-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-dark" is deprecated, use "landscape-v4-dark" instead'},{id:"landscape-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-vivid" is deprecated, use "landscape-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V4",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"landscape-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"landscape-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V4",name:"Satellite v4",description:"",variants:[{id:"satellite-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"satellite-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ_V4",name:"Dataviz",description:"",variants:[{id:"dataviz-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}
808,{id:"dataviz-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR_V4",name:"Outdoor",description:"",variants:[{id:"outdoor-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"BACKDROP_V4",name:"Backdrop",description:"",variants:[{id:"backdrop-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"backdrop-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"backdrop-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"AQUARELLE_V4",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"aquarelle-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"aquarelle-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"OCEAN_V4",name:"Ocean",description:"",variants:[{id:"ocean-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"ocean-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V4",name:"Topo",description:"",variants:[{id:"topo-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v4-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]}],ew={STREETS:"STREETS_V2",BASIC:"BASIC_V2",LANDSCAPE:"LANDSCAPE_V2",AQUARELLE:"AQUARELLE_V2",SATELLITE:"SATELLITE_V2",WINTER:"WINTER_V2",HYBRID:"HYBRID_V2",OCEAN:"OCEAN_V2",TONER:"TONER_V2",TOPO:"TOPO_V2",OPENSTREETMAP:"OPENSTREETMAP_V2",DATAVIZ:"DATAVIZ_V2",BACKDROP:"BACKDROP_V2",VOYAGER:"VOYAGER_V2"},ko=[...Q1];function tw(u,o){ko.find(w=>w.referenceStyleID===u)&&console.warn(`Default reference style ${u} already exists, it will be overwritten...`);const d=ko.find(w=>w.referenceStyleID===o);if(!d)throw new Error(`Versioned map style not found for reference style: ${o}`);const v={...d,referenceStyleID:u};ko.push(v)}Object.entries(ew).forEach(([u,o])=>{tw(u,o)});function rw(u){return new Proxy(u,{get(o,d,v){return o.hasVariant(d)?o.getVariant(d):d.toString().toUpperCase()===d?u.getDefaultVariant():Reflect.get(o,d,v)}})}function iw(){const u={};for(let o=0;o<ko.length;o+=1){const d=ko[o],v=rw(new Z0(d.name,d.referenceStyleID));for(let w=0;w<d.variants.length;w+=1){const M=d.variants[w],b=new q0(M.name,M.variantType,M.id,v,M.description,M.imageURL,M.deprecated);v.addVariant(b)}u[d.referenceStyleID]=v}return u}const Bu=iw(),xi=[];for(let u=0;u<256;++u)xi.push((u+256).toString(16).slice(1));function nw(u,o=0){return(xi[u[o+0]]+xi[u[o+1]]+xi[u[o+2]]+xi[u[o+3]]+"-"+xi[u[o+4]]+xi[u[o+5]]+"-"+xi[u[o+6]]+xi[u[o+7]]+"-"+xi[u[o+8]]+xi[u[o+9]]+"-"+xi[u[o+10]]+xi[u[o+11]]+xi[u[o+12]]+xi[u[o+13]]+xi[u[o+14]]+xi[u[o+15]]).toLowerCase()}let Xf;const aw=new Uint8Array(16);function ow(){if(!Xf){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Xf=crypto.getRandomValues.bind(crypto)}return Xf(aw)}const sw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),E_={randomUUID:sw};function lw(u,o,d){if(E_.randomUUID&&!u)return E_.randomUUID();u=u||{};const v=u.random??u.rng?.()??ow();if(v.length<16)throw new Error("Random bytes length must be >= 16");return v[6]=v[6]&15|64,v[8]=v[8]&63|128,nw(v)}var cw=Object.defineProperty,W0=u=>{throw TypeError(u)},uw=(u,o,d)=>o in u?cw(u,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[o]=d,it=(u,o,d)=>uw(u,typeof o!="symbol"?o+"":o,d),Rm=(u,o,d)=>o.has(u)||W0("Cannot "+d),ct=(u,o,d)=>(Rm(u,o,"read from private field"),d?d.call(u):o.get(u)),Gi=(u,o,d)=>o.has(u)?W0("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(u):o.set(u,d),un=(u,o,d,v)=>(Rm(u,o,"write to private field"),o.set(u,d),d),ln=(u,o,d)=>(Rm(u,o,"access private method"),d);(function(){typeof window>"u"||(window.requestIdleCallback=window.requestIdleCallback||function(u){const o=Date.now();return setTimeout(function(){u({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-o))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(u){clearTimeout(u)})})();(class extends st.Marker{addTo(u){return super.addTo(u)}});class pM extends st.Popup{addTo(o){return super.addTo(o)}}class dM extends st.Style{constructor(o,d={}){super(o,d)}}class fM extends st.CanvasSource{onAdd(o){super.onAdd(o)}}class mM extends st.GeoJSONSource{onAdd(o){super.onAdd(o)}}class gM extends st.ImageSource{onAdd(o){super.onAdd(o)}}class yM extends st.RasterTileSource{onAdd(o){super.onAdd(o)}}class _M extends st.RasterDEMTileSource{onAdd(o){super.onAdd(o)}}class vM extends st.VectorTileSource{onAdd(o){super.onAdd(o)}}class xM extends st.VideoSource{onAdd(o){super.onAdd(o)}}class hw extends st.NavigationControl{onAdd(o){return super.onAdd(o)}}class pw extends st.GeolocateControl{onAdd(o){return super.onAdd(o)}}class bM extends st.AttributionControl{onAdd(o){return super.onAdd(o)}}class dw extends st.LogoControl{onAdd(o){return super.onAdd(o)}}class fw extends st.ScaleControl{onAdd(o){return super.onAdd(o)}}class mw extends st.FullscreenControl{onAdd(o){return super.onAdd(o)}}class wM extends st.TerrainControl{onAdd(o){return super.onAdd(o)}}class TM extends st.BoxZoomHandler{constructor(o,d){super(o,d)}}class SM extends st.ScrollZoomHandler{constructor(o,d){super(o,d)}}class MM extends st.CooperativeGesturesHandler{constructor(o,d){super(o,d)}}class IM extends st.KeyboardHandler{constructor(o){super(o)}}class PM extends st.TwoFingersTouchPitchHandler{constructor(o){super(o)}}class AM extends st.MapWheelEvent{constructor(o,d,v){super(o,d,v)}}class EM extends st.MapTouchEvent{constructor(o,d,v){super(o,d,v)}}class CM extends st.MapMouseEvent{constructor(o,d,v,w={}){super(o,d,v,w)}}const Bt={VISITOR:{code:null,flag:"visitor",name:"Visitor",latin:!0,isMode:!0,geocoding:!1},VISITOR_ENGLISH:{code:null,flag:"visitor_en",name:"Visitor English",latin:!0,isMode:!0,geocoding:!1},STYLE:{code:null,flag:"style",name:"Style",latin:!1,isMode:!0,geocoding:!1},STYLE_LOCK:{code:null,flag:"style_lock",name:"Style Lock",latin:!1,isMode:!0,geocoding:!1},...Ku};
808function C_(){if(typeof navigator>"u"){const u=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];return pm(u)||Bt.ENGLISH}return Array.from(new Set(navigator.languages.map(u=>u.split("-")[0]))).map(u=>pm(u)).filter(u=>u)[0]??Bt.LOCAL}const Ri={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",telemetryURL:"https://api.maptiler.com/metrics",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:Bt.STYLE,secondaryLanguage:Bt.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(Ri);const Fm=lw();class gw extends $1{constructor(){super(...arguments),it(this,"primaryLanguage",Ri.primaryLanguage),it(this,"secondaryLanguage"),it(this,"session",!0),it(this,"caching",!0),it(this,"telemetry",!0),it(this,"_unit","metric"),it(this,"_apiKey","")}set unit(o){this._unit=o,this.emit("unit",o)}get unit(){return this._unit}set apiKey(o){this._apiKey=o,lc.apiKey=o,this.emit("apiKey",o)}get apiKey(){return this._apiKey}set fetch(o){lc.fetch=o}get fetch(){return lc.fetch}}const Or=new gw;class k_ extends dw{constructor(o={}){super(o),it(this,"logoURL",""),it(this,"linkURL",""),this.logoURL=o.logoURL??Ri.maptilerLogoURL,this.linkURL=o.linkURL??Ri.maptilerURL}onAdd(o){this._map=o,this._compact=this.options.compact??!1,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const d=window.document.createElement("a");return d.style.backgroundRepeat="no-repeat",d.style.cursor="pointer",d.style.display="block",d.style.height="23px",d.style.margin="0 0 -4px -4px",d.style.overflow="hidden",d.style.width="88px",d.style.backgroundImage=`url(${this.logoURL})`,d.style.backgroundSize="100px 30px",d.style.width="100px",d.style.height="30px",d.target="_blank",d.rel="noopener",d.href=this.linkURL,d.setAttribute("aria-label","MapTiler logo"),d.setAttribute("rel","noopener"),this._container.appendChild(d),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}const fm="localcache_source",mm="localcache",yw="maptiler_sdk",_w=1e3,vw=100,gm=typeof caches<"u",{addProtocol:D_}=st;function xw(u,o){if(gm&&Or.caching&&Or.session&&u.host===Ri.maptilerApiHost){if(o==="Source"&&u.href.includes("tiles.json"))return u.href.replace("https://",`${fm}://`);if(o==="Tile"||o==="Glyphs")return u.href.replace("https://",`${mm}://`)}return u.href}let Yf;async function H0(){return Yf||(Yf=await caches.open(yw)),Yf}let z_=0;async function bw(){const u=await H0(),o=await u.keys(),d=o.slice(0,Math.max(o.length-_w,0));for(const v of d)u.delete(v)}function ww(){D_(fm,async(u,o)=>{if(!u.url)throw new Error("");u.url=u.url.replace(`${fm}://`,"https://");const d=u;d.signal=o.signal;const v=await fetch(u.url,d),w=await v.json();return w.tiles&&w.tiles.length>0&&(w.tiles[0]+=`&last-modified=${v.headers.get("Last-Modified")}`),{data:w,cacheControl:v.headers.get("Cache-Control"),expires:v.headers.get("Expires")}}),D_(mm,async(u,o)=>{if(!u.url)throw new Error("");u.url=u.url.replace(`${mm}://`,"https://");const d=new URL(u.url),v=new URL(d);v.searchParams.delete("mtsid"),v.searchParams.delete("key");const w=v.toString(),M=new URL(d);M.searchParams.delete("last-modified");const b=M.toString(),s=async pe=>({data:await pe.arrayBuffer(),cacheControl:pe.headers.get("Cache-Control"),expires:pe.headers.get("Expires")}),D=await H0(),N=await D.match(w);if(N)return s(N);const Z=u;Z.signal=o.signal;const re=await fetch(b,Z);return re.status>=200&&re.status<300&&(D.put(w,re.clone()).catch(()=>{}),++z_>vw&&(bw(),z_=0)),s(re)})}async function Tw(u){if(typeof window>"u")return;const o=st.getRTLTextPluginStatus();if(o==="unavailable"||o==="requested")try{await st.setRTLTextPlugin(u??Ri.rtlPluginURL,!0)}catch(d){console.error("Error enabling RTL plugin. It is enabled by default and cannot be unset after. Are you attempting to enable it twice?",d)}}function Sw(u,o){for(const d of u)typeof o[d]=="function"&&(o[d]=o[d].bind(o))}function L_(u,o){let d=null;try{d=new URL(u)}catch{return{url:u}}
808return d.host===Ri.maptilerApiHost&&(d.searchParams.has("key")||d.searchParams.append("key",Or.apiKey),Or.session&&d.searchParams.append("mtsid",Fm)),{url:xw(d,o)}}function R_(u){return(o,d)=>{if(u!=null){const v=u(o,d),w=L_(v?.url??"",d);return{...v,...w}}return L_(o,d)}}function X0(){return Math.random().toString(36).substring(2)}function od(u){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(u)}function Mw(u){try{return JSON.parse(u)}catch{}return null}function Iw(){return document.createElement("canvas").getContext("webgl2")?null:typeof WebGL2RenderingContext<"u"?"Graphic rendering with WebGL2 has been disabled or is not supported by your graphic card. The map cannot be displayed.":"Your browser does not support graphic rendering with WebGL2. The map cannot be displayed."}function Pw(u){const o=Iw();if(!o)return;let d=null;if(typeof u=="string"?d=document.getElementById(u):u instanceof HTMLElement&&(d=u),!d)throw new Error("The Map container must be provided.");const v=document.createElement("div");throw v.innerHTML=o,v.classList.add("webgl-warning-div"),d.appendChild(v),new Error(o)}function F_(u,o){return!(!Array.isArray(u)||u.length!==2||u[0]!=="get"||typeof u[1]!="string"||o&&!u[1].startsWith("name:")||!o&&u[1]!=="name")}function Aw(u,o,d){const v=structuredClone(u),w=M=>{if(typeof M!="string")for(let b=0;b<M.length;b+=1)F_(M[b],d)?M[b]=structuredClone(o):w(M[b])};return F_(v,d)?o:(w(v),v)}function Ew(u,o){const d=o?/\{name:\S+\}/:/\{name\}/;return{contains:d.test(u),exactMatch:new RegExp(`^${d.source}$`).test(u)}}function Cw(u,o,d){const v=d?/\{name:\S+\}/:/\{name\}/,w=u.split(v);return["concat",...w.flatMap((M,b)=>b===w.length-1?[M]:[M,o])]}function kw(u){var o;const d=/\{name(?::(?<language>\S+))?\}/g,v=[];for(;;){const w=d.exec(u);if(!w)break;const M=((o=w.groups)==null?void 0:o.language)??null;v.push(M)}return v}function Dw(u){return!Array.isArray(u)||u.length!==2||u[0]!=="get"||typeof u[1]!="string"?null:u[1].trim()==="name"?{isLanguage:!0,localization:null}:u[1].trim().startsWith("name:")?{isLanguage:!0,localization:u[1].trim().split(":").pop()}:null}function zw(u){const o=[],d=structuredClone(u),v=w=>{if(typeof w!="string")for(let M=0;M<w.length;M+=1){const b=Dw(w[M]);b?o.push(b.localization):v(w[M])}};return v([d]),o}function Lw(u,o){const d=[];for(const M of u){if(M.type!=="symbol")continue;const b=M,{id:s,layout:D}=b;if(!D||!("text-field"in D))continue;const N=o.getLayoutProperty(s,"text-field");if(N)if(typeof N=="string"){const Z=kw(N);d.push(Z)}else{const Z=zw(N);d.push(Z)}}const v=d.flat(),w={unlocalized:0,localized:{}};for(const M of v)M===null?w.unlocalized+=1:(M in w.localized||(w.localized[M]=0),w.localized[M]+=1);return w}var Rw=8,Fw={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Bw={"*":{type:"source"}},Ow=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Nw={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:"*"}},jw={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:{}}
vendor: 4,107 bytes, line 808
808,default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Vw={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:"*"}},Uw={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},$w={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"}}},Gw={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"}}},qw={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"}},Zw=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Ww={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Hw={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Xw={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Yw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Kw={"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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Jw=
vendor: 8,512 bytes, line 808
808{"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",
vendor: 12,198 bytes, line 808
808expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},Qw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},e2={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},t2={type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},r2={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},i2={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},n2={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},a2={type:"array",value:"expression_name",minimum:1},o2={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}},s2={"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}},l2={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},c2={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},u2=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],h2={"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"}},p2={"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"}},d2={"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"}},f2={"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"}},m2={"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"}},g2={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}
808,"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"}},y2={"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"}},_2={"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"}},v2={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},x2={"*":{type:"string"}},b2={type:"array",value:"interpolation_name",minimum:1},w2={type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}},T2={$version:Rw,$root:Fw,sources:Bw,source:Ow,source_vector:Nw,source_raster:jw,source_raster_dem:Vw,source_geojson:Uw,source_video:$w,source_image:Gw,layer:qw,layout:Zw,layout_background:Ww,layout_fill:Hw,layout_circle:Xw,layout_heatmap:Yw,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:Kw,layout_symbol:Jw,layout_raster:Qw,layout_hillshade:e2,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:t2,filter_operator:r2,geometry_type:i2,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:n2,expression:a2,light:o2,sky:s2,terrain:l2,projection:c2,paint:u2,paint_fill:h2,"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:p2,paint_circle:d2,paint_heatmap:f2,paint_symbol:m2,paint_raster:g2,paint_hillshade:y2,"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:_2,transition:v2,"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:x2,interpolation:b2,interpolation_name:w2};class qe{constructor(o,d,v,w){this.message=(o?`${o}: `:"")+v,w&&(this.identifier=w),d!=null&&d.__line__&&(this.line=d.__line__)}}function Yp(u,...o){for(const d of o)for(const v in d)u[v]=d[v];return u}
808class sa extends Error{constructor(o,d){super(d),this.message=d,this.key=o}}class Bm{constructor(o,d=[]){this.parent=o,this.bindings={};for(const[v,w]of d)this.bindings[v]=w}concat(o){return new Bm(this,o)}get(o){if(this.bindings[o])return this.bindings[o];if(this.parent)return this.parent.get(o);throw new Error(`${o} not found in scope.`)}has(o){return this.bindings[o]?!0:this.parent?this.parent.has(o):!1}}const sd={kind:"null"},Ke={kind:"number"},Et={kind:"string"},At={kind:"boolean"},la={kind:"color"},ld={kind:"projectionDefinition"},$s={kind:"object"},Mt={kind:"value"},S2={kind:"error"},cd={kind:"collator"},ud={kind:"formatted"},hd={kind:"padding"},Vu={kind:"colorArray"},pd={kind:"numberArray"},Ju={kind:"resolvedImage"},dd={kind:"variableAnchorOffsetCollection"};function hn(u,o){return{kind:"array",itemType:u,N:o}}function Ir(u){if(u.kind==="array"){const o=Ir(u.itemType);return typeof u.N=="number"?`array<${o}, ${u.N}>`:u.itemType.kind==="value"?"array":`array<${o}>`}else return u.kind}const M2=[sd,Ke,Et,At,la,ld,ud,$s,hn(Mt),hd,pd,Vu,Ju,dd];function Uu(u,o){if(o.kind==="error")return null;if(u.kind==="array"){if(o.kind==="array"&&(o.N===0&&o.itemType.kind==="value"||!Uu(u.itemType,o.itemType))&&(typeof u.N!="number"||u.N===o.N))return null}else{if(u.kind===o.kind)return null;if(u.kind==="value"){for(const d of M2)if(!Uu(d,o))return null}}return`Expected ${Ir(u)} but found ${Ir(o)} instead.`}function Om(u,o){return o.some(d=>d.kind===u.kind)}function Gs(u,o){return o.some(d=>d==="null"?u===null:d==="array"?Array.isArray(u):d==="object"?u&&!Array.isArray(u)&&typeof u=="object":d===typeof u)}function Ao(u,o){return u.kind==="array"&&o.kind==="array"?u.itemType.kind===o.itemType.kind&&typeof u.N=="number":u.kind===o.kind}const Y0=.96422,K0=1,J0=.82521,Q0=4/29,cc=6/29,ev=3*cc*cc,I2=cc*cc*cc,P2=Math.PI/180,A2=180/Math.PI;function tv(u){return u=u%360,u<0&&(u+=360),u}function rv([u,o,d,v]){u=Kf(u),o=Kf(o),d=Kf(d);let w,M;const b=Jf((.2225045*u+.7168786*o+.0606169*d)/K0);u===o&&o===d?w=M=b:(w=Jf((.4360747*u+.3850649*o+.1430804*d)/Y0),M=Jf((.0139322*u+.0971045*o+.7141733*d)/J0));const s=116*b-16;return[s<0?0:s,500*(w-b),200*(b-M),v]}function Kf(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}function Jf(u){return u>I2?Math.pow(u,1/3):u/ev+Q0}function iv([u,o,d,v]){let w=(u+16)/116,M=isNaN(o)?w:w+o/500,b=isNaN(d)?w:w-d/200;return w=K0*em(w),M=Y0*em(M),b=J0*em(b),[Qf(3.1338561*M-1.6168667*w-.4906146*b),Qf(-.9787684*M+1.9161415*w+.033454*b),Qf(.0719453*M-.2289914*w+1.4052427*b),v]}function Qf(u){return u=u<=.00304?12.92*u:1.055*Math.pow(u,1/2.4)-.055,u<0?0:u>1?1:u}function em(u){return u>cc?u*u*u:ev*(u-Q0)}function E2(u){const[o,d,v,w]=rv(u),M=Math.sqrt(d*d+v*v);return[Math.round(M*1e4)?tv(Math.atan2(v,d)*A2):NaN,M,o,w]}function C2([u,o,d,v]){return u=isNaN(u)?0:u*P2,iv([d,Math.cos(u)*o,Math.sin(u)*o,v])}function k2([u,o,d,v]){u=tv(u),o/=100,d/=100;function w(M){const b=(M+u/30)%12,s=o*Math.min(d,1-d);return d-s*Math.max(-1,Math.min(b-3,9-b,1))}return[w(0),w(8),w(4),v]}const D2=Object.hasOwn||function(u,o){return Object.prototype.hasOwnProperty.call(u,o)};function Ou(u,o){return D2(u,o)?u[o]:void 0}function z2(u){if(u=u.toLowerCase().trim(),u==="transparent")return[0,0,0,0];const o=Ou(L2,u);if(o){const[w,M,b]=o;return[w/255,M/255,b/255,1]}if(u.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(u)){const w=u.length<6?1:2;let M=1;return[Lp(u.slice(M,M+=w)),Lp(u.slice(M,M+=w)),Lp(u.slice(M,M+=w)),Lp(u.slice(M,M+w)||"ff")]}if(u.startsWith("rgb")){const w=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,M=u.match(w);if(M){const[b,s,D,N,Z,re,pe,ue,ve,me,le,He]=M,Ne=[N||" ",pe||" ",me].join("");if(Ne===" "||Ne===" /"||Ne===",,"||Ne===",,,"){const $e=[D,re,ve].join(""),ke=$e==="%%%"?100:$e===""?255:0;if(ke){const Me=[nc(+s/ke,0,1),nc(+Z/ke,0,1),nc(+ue/ke,0,1),le?B_(+le,He):1];if(O_(Me))return Me}}return}}const d=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,v=u.match(d);if(v){const[w,M,b,s,D,N,Z,re,pe]=v,ue=[b||" ",D||" ",Z].join("");if(ue===" "||ue===" /"||ue===",,"||ue===",,,"){const ve=[+M,nc(+s,0,100),nc(+N,0,100),re?B_(+re,pe):1];if(O_(ve))return k2(ve)}}}function Lp(u){return parseInt(u.padEnd(2,u),16)/255}function B_(u,o){return nc(o?u/100:u,0,1)}function nc(u,o,d){return Math.min(Math.max(o,u),d)}function O_(u){return!u.some(Number.isNaN)}const L2={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],ol
808ive:[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 qs(u,o,d){return u+d*(o-u)}function $u(u,o,d){return u.map((v,w)=>qs(v,o[w],d))}class Qt{constructor(o,d,v,w=1,M=!0){this.r=o,this.g=d,this.b=v,this.a=w,M||(this.r*=w,this.g*=w,this.b*=w,w||this.overwriteGetter("rgb",[o,d,v,w]))}static parse(o){if(o instanceof Qt)return o;if(typeof o!="string")return;const d=z2(o);if(d)return new Qt(...d,!1)}get rgb(){const{r:o,g:d,b:v,a:w}=this,M=w||1/0;return this.overwriteGetter("rgb",[o/M,d/M,v/M,w])}get hcl(){return this.overwriteGetter("hcl",E2(this.rgb))}get lab(){return this.overwriteGetter("lab",rv(this.rgb))}overwriteGetter(o,d){return Object.defineProperty(this,o,{value:d}),d}toString(){const[o,d,v,w]=this.rgb;return`rgba(${[o,d,v].map(M=>Math.round(M*255)).join(",")},${w})`}static interpolate(o,d,v,w="rgb"){switch(w){case"rgb":{const[M,b,s,D]=$u(o.rgb,d.rgb,v);return new Qt(M,b,s,D,!1)}case"hcl":{const[M,b,s,D]=o.hcl,[N,Z,re,pe]=d.hcl;let ue,ve;if(!isNaN(M)&&!isNaN(N)){let $e=N-M;N>M&&$e>180?$e-=360:N<M&&M-N>180&&($e+=360),ue=M+v*$e}else isNaN(M)?isNaN(N)?ue=NaN:(ue=N,(s===1||s===0)&&(ve=Z)):(ue=M,(re===1||re===0)&&(ve=b));const[me,le,He,Ne]=C2([ue,ve??qs(b,Z,v),qs(s,re,v),qs(D,pe,v)]);return new Qt(me,le,He,Ne,!1)}case"lab":{const[M,b,s,D]=iv($u(o.lab,d.lab,v));return new Qt(M,b,s,D,!1)}}}}Qt.black=new Qt(0,0,0,1);Qt.white=new Qt(1,1,1,1);Qt.transparent=new Qt(0,0,0,0);Qt.red=new Qt(1,0,0,1);class Nm{constructor(o,d,v){o?this.sensitivity=d?"variant":"case":this.sensitivity=d?"accent":"base",this.locale=v,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,d){return this.collator.compare(o,d)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const R2=["bottom","center","top"];class ym{constructor(o,d,v,w,M,b){this.text=o,this.image=d,this.scale=v,this.fontStack=w,this.textColor=M,this.verticalAlign=b}}class ja{constructor(o){this.sections=o}static fromString(o){return new ja([new ym(o,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(o=>o.text.length!==0||o.image&&o.image.name.length!==0)}static factory(o){return o instanceof ja?o:ja.fromString(o)}toString(){return this.sections.length===0?"":this.sections.map(o=>o.text).join("")}}class Nn{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof Nn)return o;if(typeof o=="number")return new Nn([o,o,o,o]);if(Array.isArray(o)&&!(o.length<1||o.length>4)){for(const d of o)if(typeof d!="number")return;switch(o.length){case 1:o=[o[0],o[0],o[0],o[0]];break;case 2:o=[o[0],o[1],o[0],o[1]];break;case 3:o=[o[0],o[1],o[2],o[1]];break}return new Nn(o)}}toString(){return JSON.stringify(this.values)}static interpolate(o,d,v){return new Nn($u(o.values,d.values,v))}}class jn{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof jn)return o;if(typeof o=="number")return new jn([o]);if(Array.isArray(o)){for(const d of o)if(typeof d!="number")return;return new jn(o)}}toString(){return JSON.stringify(this.values)}static interpolate(o,d,v){return new jn($u(o.values,d.values,v))}}class pn{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof pn)return o;
808if(typeof o=="string"){const v=Qt.parse(o);return v?new pn([v]):void 0}if(!Array.isArray(o))return;const d=[];for(const v of o){if(typeof v!="string")return;const w=Qt.parse(v);if(!w)return;d.push(w)}return new pn(d)}toString(){return JSON.stringify(this.values)}static interpolate(o,d,v,w="rgb"){const M=[];if(o.values.length!=d.values.length)throw new Error(`colorArray: Arrays have mismatched length (${o.values.length} vs. ${d.values.length}), cannot interpolate.`);for(let b=0;b<o.values.length;b++)M.push(Qt.interpolate(o.values[b],d.values[b],v,w));return new pn(M)}}class zr extends Error{constructor(o){super(o),this.name="RuntimeError"}toJSON(){return this.message}}const F2=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ca{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof ca)return o;if(!(!Array.isArray(o)||o.length<1||o.length%2!==0)){for(let d=0;d<o.length;d+=2){const v=o[d],w=o[d+1];if(typeof v!="string"||!F2.has(v)||!Array.isArray(w)||w.length!==2||typeof w[0]!="number"||typeof w[1]!="number")return}return new ca(o)}}toString(){return JSON.stringify(this.values)}static interpolate(o,d,v){const w=o.values,M=d.values;if(w.length!==M.length)throw new zr(`Cannot interpolate values of different length. from: ${o.toString()}, to: ${d.toString()}`);const b=[];for(let s=0;s<w.length;s+=2){if(w[s]!==M[s])throw new zr(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${w[s]}, to[${s}]: ${M[s]}`);b.push(w[s]);const[D,N]=w[s+1],[Z,re]=M[s+1];b.push([qs(D,Z,v),qs(N,re,v)])}return new ca(b)}}class Ro{constructor(o){this.name=o.name,this.available=o.available}toString(){return this.name}static fromString(o){return o?new Ro({name:o,available:!1}):null}}class Bn{constructor(o,d,v){this.from=o,this.to=d,this.transition=v}static interpolate(o,d,v){return new Bn(o,d,v)}static parse(o){if(o instanceof Bn)return o;if(Array.isArray(o)&&o.length===3&&typeof o[0]=="string"&&typeof o[1]=="string"&&typeof o[2]=="number")return new Bn(o[0],o[1],o[2]);if(typeof o=="object"&&typeof o.from=="string"&&typeof o.to=="string"&&typeof o.transition=="number")return new Bn(o.from,o.to,o.transition);if(typeof o=="string")return new Bn(o,o,1)}}function nv(u,o,d,v){return typeof u=="number"&&u>=0&&u<=255&&typeof o=="number"&&o>=0&&o<=255&&typeof d=="number"&&d>=0&&d<=255?typeof v>"u"||typeof v=="number"&&v>=0&&v<=1?null:`Invalid rgba value [${[u,o,d,v].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof v=="number"?[u,o,d,v]:[u,o,d]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Gu(u){if(u===null||typeof u=="string"||typeof u=="boolean"||typeof u=="number"||u instanceof Bn||u instanceof Qt||u instanceof Nm||u instanceof ja||u instanceof Nn||u instanceof jn||u instanceof pn||u instanceof ca||u instanceof Ro)return!0;if(Array.isArray(u)){for(const o of u)if(!Gu(o))return!1;return!0}else if(typeof u=="object"){for(const o in u)if(!Gu(u[o]))return!1;return!0}else return!1}function Kr(u){if(u===null)return sd;if(typeof u=="string")return Et;if(typeof u=="boolean")return At;if(typeof u=="number")return Ke;if(u instanceof Qt)return la;if(u instanceof Bn)return ld;if(u instanceof Nm)return cd;if(u instanceof ja)return ud;if(u instanceof Nn)return hd;if(u instanceof jn)return pd;if(u instanceof pn)return Vu;if(u instanceof ca)return dd;if(u instanceof Ro)return Ju;if(Array.isArray(u)){const o=u.length;let d;for(const v of u){const w=Kr(v);if(!d)d=w;else{if(d===w)continue;d=Mt;break}}return hn(d||Mt,o)}else return $s}function Nu(u){const o=typeof u;return u===null?"":o==="string"||o==="number"||o==="boolean"?String(u):u instanceof Qt||u instanceof Bn||u instanceof ja||u instanceof Nn||u instanceof jn||u instanceof pn||u instanceof ca||u instanceof Ro?u.toString():JSON.stringify(u)}class uc{constructor(o,d){this.type=o,this.value=d}static parse(o,d){if(o.length!==2)return d.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!Gu(o[1]))return d.error("invalid value");const v=o[1];let w=Kr(v);const M=d.expectedType;return w.kind==="array"&&w.N===0&&M&&M.kind==="array"&&(typeof M.N!="number"||M.N===0)&&(w=M),new uc(w,v)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Rp={string:Et,number:Ke,boolean:At,object:$s};class On{constructor(o,d){this.type=o,this.args=d}static parse(o,d){if(o.length<2)return d.error("Expected at least one argument.");let v=1,w;const M=o[0];if(M==="array"){let s;if(o.length>2){const N=o[1];
808if(typeof N!="string"||!(N in Rp)||N==="object")return d.error('The item type argument of "array" must be one of string, number, boolean',1);s=Rp[N],v++}else s=Mt;let D;if(o.length>3){if(o[2]!==null&&(typeof o[2]!="number"||o[2]<0||o[2]!==Math.floor(o[2])))return d.error('The length argument to "array" must be a positive integer literal',2);D=o[2],v++}w=hn(s,D)}else{if(!Rp[M])throw new Error(`Types doesn't contain name = ${M}`);w=Rp[M]}const b=[];for(;v<o.length;v++){const s=d.parse(o[v],v,Mt);if(!s)return null;b.push(s)}return new On(w,b)}evaluate(o){for(let d=0;d<this.args.length;d++){const v=this.args[d].evaluate(o);if(Uu(this.type,Kr(v))){if(d===this.args.length-1)throw new zr(`Expected value to be of type ${Ir(this.type)}, but found ${Ir(Kr(v))} instead.`)}else return v}throw new Error}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const N_={"to-boolean":At,"to-color":la,"to-number":Ke,"to-string":Et};class Eo{constructor(o,d){this.type=o,this.args=d}static parse(o,d){if(o.length<2)return d.error("Expected at least one argument.");const v=o[0];if(!N_[v])throw new Error(`Can't parse ${v} as it is not part of the known types`);if((v==="to-boolean"||v==="to-string")&&o.length!==2)return d.error("Expected one argument.");const w=N_[v],M=[];for(let b=1;b<o.length;b++){const s=d.parse(o[b],b,Mt);if(!s)return null;M.push(s)}return new Eo(w,M)}evaluate(o){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(o);case"color":{let d,v;for(const w of this.args){if(d=w.evaluate(o),v=null,d instanceof Qt)return d;if(typeof d=="string"){const M=o.parseColor(d);if(M)return M}else if(Array.isArray(d)&&(d.length<3||d.length>4?v=`Invalid rgba value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.`:v=nv(d[0],d[1],d[2],d[3]),!v))return new Qt(d[0]/255,d[1]/255,d[2]/255,d[3])}throw new zr(v||`Could not parse color from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}case"padding":{let d;for(const v of this.args){d=v.evaluate(o);const w=Nn.parse(d);if(w)return w}throw new zr(`Could not parse padding from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}case"numberArray":{let d;for(const v of this.args){d=v.evaluate(o);const w=jn.parse(d);if(w)return w}throw new zr(`Could not parse numberArray from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}case"colorArray":{let d;for(const v of this.args){d=v.evaluate(o);const w=pn.parse(d);if(w)return w}throw new zr(`Could not parse colorArray from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}case"variableAnchorOffsetCollection":{let d;for(const v of this.args){d=v.evaluate(o);const w=ca.parse(d);if(w)return w}throw new zr(`Could not parse variableAnchorOffsetCollection from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}case"number":{let d=null;for(const v of this.args){if(d=v.evaluate(o),d===null)return 0;const w=Number(d);if(!isNaN(w))return w}throw new zr(`Could not convert ${JSON.stringify(d)} to number.`)}case"formatted":return ja.fromString(Nu(this.args[0].evaluate(o)));case"resolvedImage":return Ro.fromString(Nu(this.args[0].evaluate(o)));case"projectionDefinition":return this.args[0].evaluate(o);default:return Nu(this.args[0].evaluate(o))}}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}
808const B2=["Unknown","Point","LineString","Polygon"];class av{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"?B2[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(o){let d=this._parseColorCache.get(o);return d||(d=Qt.parse(o),this._parseColorCache.set(o,d)),d}}class fd{constructor(o,d,v=[],w,M=new Bm,b=[]){this.registry=o,this.path=v,this.key=v.map(s=>`[${s}]`).join(""),this.scope=M,this.errors=b,this.expectedType=w,this._isConstant=d}parse(o,d,v,w,M={}){return d?this.concat(d,v,w)._parse(o,M):this._parse(o,M)}_parse(o,d){(o===null||typeof o=="string"||typeof o=="boolean"||typeof o=="number")&&(o=["literal",o]);function v(w,M,b){return b==="assert"?new On(M,[w]):b==="coerce"?new Eo(M,[w]):w}if(Array.isArray(o)){if(o.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const w=o[0];if(typeof w!="string")return this.error(`Expression name must be a string, but found ${typeof w} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const M=this.registry[w];if(M){let b=M.parse(o,this);if(!b)return null;if(this.expectedType){const s=this.expectedType,D=b.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&D.kind==="value")b=v(b,s,d.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(D.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(D.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(D.kind)||s.kind==="colorArray"&&["value","string","array"].includes(D.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(D.kind))b=v(b,s,d.typeAnnotation||"coerce");else if(this.checkSubtype(s,D))return null}if(!(b instanceof uc)&&b.type.kind!=="resolvedImage"&&this._isConstant(b)){const s=new av;try{b=new uc(b.type,b.evaluate(s))}catch(D){return this.error(D.message),null}}return b}return this.error(`Unknown expression "${w}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof o>"u"?this.error("'undefined' value invalid. Use null instead."):typeof o=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof o} instead.`)}concat(o,d,v){const w=typeof o=="number"?this.path.concat(o):this.path,M=v?this.scope.concat(v):this.scope;return new fd(this.registry,this._isConstant,w,d||null,M,this.errors)}error(o,...d){const v=`${this.key}${d.map(w=>`[${w}]`).join("")}`;this.errors.push(new sa(v,o))}checkSubtype(o,d){const v=Uu(o,d);return v&&this.error(v),v}}class md{constructor(o,d){this.type=d.type,this.bindings=[].concat(o),this.result=d}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const d of this.bindings)o(d[1]);o(this.result)}static parse(o,d){if(o.length<4)return d.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const v=[];for(let M=1;M<o.length-1;M+=2){const b=o[M];if(typeof b!="string")return d.error(`Expected string, but found ${typeof b} instead.`,M);if(/[^a-zA-Z0-9_]/.test(b))return d.error("Variable names must contain only alphanumeric characters or '_'.",M);const s=d.parse(o[M+1],M+1);if(!s)return null;v.push([b,s])}const w=d.parse(o[o.length-1],o.length-1,d.expectedType,v);return w?new md(v,w):null}outputDefined(){return this.result.outputDefined()}}class gd{constructor(o,d){this.type=d.type,this.name=o,this.boundExpression=d}
808static parse(o,d){if(o.length!==2||typeof o[1]!="string")return d.error("'var' expression requires exactly one string literal argument.");const v=o[1];return d.scope.has(v)?new gd(v,d.scope.get(v)):d.error(`Unknown variable "${v}". Make sure "${v}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(o){return this.boundExpression.evaluate(o)}eachChild(){}outputDefined(){return!1}}class jm{constructor(o,d,v){this.type=o,this.index=d,this.input=v}static parse(o,d){if(o.length!==3)return d.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const v=d.parse(o[1],1,Ke),w=d.parse(o[2],2,hn(d.expectedType||Mt));if(!v||!w)return null;const M=w.type;return new jm(M.itemType,v,w)}evaluate(o){const d=this.index.evaluate(o),v=this.input.evaluate(o);if(d<0)throw new zr(`Array index out of bounds: ${d} < 0.`);if(d>=v.length)throw new zr(`Array index out of bounds: ${d} > ${v.length-1}.`);if(d!==Math.floor(d))throw new zr(`Array index must be an integer, but found ${d} instead.`);return v[d]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}}class Vm{constructor(o,d){this.type=At,this.needle=o,this.haystack=d}static parse(o,d){if(o.length!==3)return d.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const v=d.parse(o[1],1,Mt),w=d.parse(o[2],2,Mt);return!v||!w?null:Om(v.type,[At,Et,Ke,sd,Mt])?new Vm(v,w):d.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ir(v.type)} instead`)}evaluate(o){const d=this.needle.evaluate(o),v=this.haystack.evaluate(o);if(!v)return!1;if(!Gs(d,["boolean","string","number","null"]))throw new zr(`Expected first argument to be of type boolean, string, number or null, but found ${Ir(Kr(d))} instead.`);if(!Gs(v,["string","array"]))throw new zr(`Expected second argument to be of type array or string, but found ${Ir(Kr(v))} instead.`);return v.indexOf(d)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}}class Kp{constructor(o,d,v){this.type=Ke,this.needle=o,this.haystack=d,this.fromIndex=v}static parse(o,d){if(o.length<=2||o.length>=5)return d.error(`Expected 2 or 3 arguments, but found ${o.length-1} instead.`);const v=d.parse(o[1],1,Mt),w=d.parse(o[2],2,Mt);if(!v||!w)return null;if(!Om(v.type,[At,Et,Ke,sd,Mt]))return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ir(v.type)} instead`);if(o.length===4){const M=d.parse(o[3],3,Ke);return M?new Kp(v,w,M):null}else return new Kp(v,w)}evaluate(o){const d=this.needle.evaluate(o),v=this.haystack.evaluate(o);if(!Gs(d,["boolean","string","number","null"]))throw new zr(`Expected first argument to be of type boolean, string, number or null, but found ${Ir(Kr(d))} instead.`);let w;if(this.fromIndex&&(w=this.fromIndex.evaluate(o)),Gs(v,["string"])){const M=v.indexOf(d,w);return M===-1?-1:[...v.slice(0,M)].length}else{if(Gs(v,["array"]))return v.indexOf(d,w);throw new zr(`Expected second argument to be of type array or string, but found ${Ir(Kr(v))} instead.`)}}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}}class Um{constructor(o,d,v,w,M,b){this.inputType=o,this.type=d,this.input=v,this.cases=w,this.outputs=M,this.otherwise=b}static parse(o,d){if(o.length<5)return d.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!==1)return d.error("Expected an even number of arguments.");let v,w;d.expectedType&&d.expectedType.kind!=="value"&&(w=d.expectedType);const M={},b=[];for(let N=2;N<o.length-1;N+=2){let Z=o[N];const re=o[N+1];Array.isArray(Z)||(Z=[Z]);const pe=d.concat(N);if(Z.length===0)return pe.error("Expected at least one branch label.");for(const ve of Z){if(typeof ve!="number"&&typeof ve!="string")return pe.error("Branch labels must be numbers or strings.");if(typeof ve=="number"&&Math.abs(ve)>Number.MAX_SAFE_INTEGER)return pe.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ve=="number"&&Math.floor(ve)!==ve)return pe.error("Numeric branch labels must be integer values.");if(!v)v=Kr(ve);else if(pe.checkSubtype(v,Kr(ve)))return null;if(typeof M[String(ve)]<"u")return pe.error("Branch labels must be unique.");M[String(ve)]=b.length}const ue=d.parse(re,N,w);if(!ue)return null;w=w||ue.type,b.push(ue)}const s=d.parse(o[1],1,Mt);if(!s)return null;const D=d.parse(o[o.length-1],o.length-1,w);return!D||s.type.kind!=="value"&&d.concat(1).checkSubtype(v,s.type)?null:new Um(v,w,s,M,b,D)}evaluate(o){const d=this.input.evaluate(o);return(Kr(d)===this.inputType&&this.outputs[this.cases[d]]||this.otherwise).evaluate(o)}
808eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}}class $m{constructor(o,d,v){this.type=o,this.branches=d,this.otherwise=v}static parse(o,d){if(o.length<4)return d.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!==0)return d.error("Expected an odd number of arguments.");let v;d.expectedType&&d.expectedType.kind!=="value"&&(v=d.expectedType);const w=[];for(let b=1;b<o.length-1;b+=2){const s=d.parse(o[b],b,At);if(!s)return null;const D=d.parse(o[b+1],b+1,v);if(!D)return null;w.push([s,D]),v=v||D.type}const M=d.parse(o[o.length-1],o.length-1,v);if(!M)return null;if(!v)throw new Error("Can't infer output type");return new $m(v,w,M)}evaluate(o){for(const[d,v]of this.branches)if(d.evaluate(o))return v.evaluate(o);return this.otherwise.evaluate(o)}eachChild(o){for(const[d,v]of this.branches)o(d),o(v);o(this.otherwise)}outputDefined(){return this.branches.every(([o,d])=>d.outputDefined())&&this.otherwise.outputDefined()}}class Jp{constructor(o,d,v,w){this.type=o,this.input=d,this.beginIndex=v,this.endIndex=w}static parse(o,d){if(o.length<=2||o.length>=5)return d.error(`Expected 2 or 3 arguments, but found ${o.length-1} instead.`);const v=d.parse(o[1],1,Mt),w=d.parse(o[2],2,Ke);if(!v||!w)return null;if(!Om(v.type,[hn(Mt),Et,Mt]))return d.error(`Expected first argument to be of type array or string, but found ${Ir(v.type)} instead`);if(o.length===4){const M=d.parse(o[3],3,Ke);return M?new Jp(v.type,v,w,M):null}else return new Jp(v.type,v,w)}evaluate(o){const d=this.input.evaluate(o),v=this.beginIndex.evaluate(o);let w;if(this.endIndex&&(w=this.endIndex.evaluate(o)),Gs(d,["string"]))return[...d].slice(v,w).join("");if(Gs(d,["array"]))return d.slice(v,w);throw new zr(`Expected first argument to be of type array or string, but found ${Ir(Kr(d))} instead.`)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}}function ov(u,o){const d=u.length-1;let v=0,w=d,M=0,b,s;for(;v<=w;)if(M=Math.floor((v+w)/2),b=u[M],s=u[M+1],b<=o){if(M===d||o<s)return M;v=M+1}else if(b>o)w=M-1;else throw new zr("Input is not a number.");return 0}class yd{constructor(o,d,v){this.type=o,this.input=d,this.labels=[],this.outputs=[];for(const[w,M]of v)this.labels.push(w),this.outputs.push(M)}static parse(o,d){if(o.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!==0)return d.error("Expected an even number of arguments.");const v=d.parse(o[1],1,Ke);if(!v)return null;const w=[];let M=null;d.expectedType&&d.expectedType.kind!=="value"&&(M=d.expectedType);for(let b=1;b<o.length;b+=2){const s=b===1?-1/0:o[b],D=o[b+1],N=b,Z=b+1;if(typeof s!="number")return d.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',N);if(w.length&&w[w.length-1][0]>=s)return d.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',N);const re=d.parse(D,Z,M);if(!re)return null;M=M||re.type,w.push([s,re])}return new yd(M,v,w)}evaluate(o){const d=this.labels,v=this.outputs;if(d.length===1)return v[0].evaluate(o);const w=this.input.evaluate(o);if(w<=d[0])return v[0].evaluate(o);const M=d.length;if(w>=d[M-1])return v[M-1].evaluate(o);const b=ov(d,w);return v[b].evaluate(o)}eachChild(o){o(this.input);for(const d of this.outputs)o(d)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function O2(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var tm,j_;function N2(){if(j_)return tm;j_=1,tm=u;function u(o,d,v,w){this.cx=3*o,this.bx=3*(v-o)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*d,this.by=3*(w-d)-this.cy,this.ay=1-this.cy-this.by,this.p1x=o,this.p1y=d,this.p2x=v,this.p2y=w}return u.prototype={sampleCurveX:function(o){return((this.ax*o+this.bx)*o+this.cx)*o},sampleCurveY:function(o){return((this.ay*o+this.by)*o+this.cy)*o},sampleCurveDerivativeX:function(o){return(3*this.ax*o+2*this.bx)*o+this.cx},solveCurveX:function(o,d){if(d===void 0&&(d=1e-6),o<0)return 0;if(o>1)return 1;for(var v=o,w=0;w<8;w++){var M=this.sampleCurveX(v)-o;
808if(Math.abs(M)<d)return v;var b=this.sampleCurveDerivativeX(v);if(Math.abs(b)<1e-6)break;v=v-M/b}var s=0,D=1;for(v=o,w=0;w<20&&(M=this.sampleCurveX(v),!(Math.abs(M-o)<d));w++)o>M?s=v:D=v,v=(D-s)*.5+s;return v},solve:function(o,d){return this.sampleCurveY(this.solveCurveX(o,d))}},tm}var j2=N2(),V2=O2(j2);class ua{constructor(o,d,v,w,M){this.type=o,this.operator=d,this.interpolation=v,this.input=w,this.labels=[],this.outputs=[];for(const[b,s]of M)this.labels.push(b),this.outputs.push(s)}static interpolationFactor(o,d,v,w){let M=0;if(o.name==="exponential")M=rm(d,o.base,v,w);else if(o.name==="linear")M=rm(d,1,v,w);else if(o.name==="cubic-bezier"){const b=o.controlPoints;M=new V2(b[0],b[1],b[2],b[3]).solve(rm(d,1,v,w))}return M}static parse(o,d){let[v,w,M,...b]=o;if(!Array.isArray(w)||w.length===0)return d.error("Expected an interpolation type expression.",1);if(w[0]==="linear")w={name:"linear"};else if(w[0]==="exponential"){const N=w[1];if(typeof N!="number")return d.error("Exponential interpolation requires a numeric base.",1,1);w={name:"exponential",base:N}}else if(w[0]==="cubic-bezier"){const N=w.slice(1);if(N.length!==4||N.some(Z=>typeof Z!="number"||Z<0||Z>1))return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);w={name:"cubic-bezier",controlPoints:N}}else return d.error(`Unknown interpolation type ${String(w[0])}`,1,0);if(o.length-1<4)return d.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!==0)return d.error("Expected an even number of arguments.");if(M=d.parse(M,2,Ke),!M)return null;const s=[];let D=null;(v==="interpolate-hcl"||v==="interpolate-lab")&&d.expectedType!=Vu?D=la:d.expectedType&&d.expectedType.kind!=="value"&&(D=d.expectedType);for(let N=0;N<b.length;N+=2){const Z=b[N],re=b[N+1],pe=N+3,ue=N+4;if(typeof Z!="number")return d.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',pe);if(s.length&&s[s.length-1][0]>=Z)return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',pe);const ve=d.parse(re,ue,D);if(!ve)return null;D=D||ve.type,s.push([Z,ve])}return!Ao(D,Ke)&&!Ao(D,ld)&&!Ao(D,la)&&!Ao(D,hd)&&!Ao(D,pd)&&!Ao(D,Vu)&&!Ao(D,dd)&&!Ao(D,hn(Ke))?d.error(`Type ${Ir(D)} is not interpolatable.`):new ua(D,v,w,M,s)}evaluate(o){const d=this.labels,v=this.outputs;if(d.length===1)return v[0].evaluate(o);const w=this.input.evaluate(o);if(w<=d[0])return v[0].evaluate(o);const M=d.length;if(w>=d[M-1])return v[M-1].evaluate(o);const b=ov(d,w),s=d[b],D=d[b+1],N=ua.interpolationFactor(this.interpolation,w,s,D),Z=v[b].evaluate(o),re=v[b+1].evaluate(o);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return qs(Z,re,N);case"color":return Qt.interpolate(Z,re,N);case"padding":return Nn.interpolate(Z,re,N);case"colorArray":return pn.interpolate(Z,re,N);case"numberArray":return jn.interpolate(Z,re,N);case"variableAnchorOffsetCollection":return ca.interpolate(Z,re,N);case"array":return $u(Z,re,N);case"projectionDefinition":return Bn.interpolate(Z,re,N)}case"interpolate-hcl":switch(this.type.kind){case"color":return Qt.interpolate(Z,re,N,"hcl");case"colorArray":return pn.interpolate(Z,re,N,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Qt.interpolate(Z,re,N,"lab");case"colorArray":return pn.interpolate(Z,re,N,"lab")}}}eachChild(o){o(this.input);for(const d of this.outputs)o(d)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function rm(u,o,d,v){const w=v-d,M=u-d;return w===0?0:o===1?M/w:(Math.pow(o,M)-1)/(Math.pow(o,w)-1)}class qu{constructor(o,d){this.type=o,this.args=d}static parse(o,d){if(o.length<2)return d.error("Expected at least one argument.");let v=null;const w=d.expectedType;w&&w.kind!=="value"&&(v=w);const M=[];for(const b of o.slice(1)){const s=d.parse(b,1+M.length,v,void 0,{typeAnnotation:"omit"});if(!s)return null;v=v||s.type,M.push(s)}if(!v)throw new Error("No output type");return w&&M.some(b=>Uu(w,b.type))?new qu(Mt,M):new qu(v,M)}evaluate(o){let d=null,v=0,w;for(const M of this.args)if(v++,d=M.evaluate(o),d&&d instanceof Ro&&!d.available&&(w||(w=d.name),d=null,v===this.args.length&&(d=w)),d!==null)break;return d}
808eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}function V_(u,o){return u==="=="||u==="!="?o.kind==="boolean"||o.kind==="string"||o.kind==="number"||o.kind==="null"||o.kind==="value":o.kind==="string"||o.kind==="number"||o.kind==="value"}function U2(u,o,d){return o===d}function $2(u,o,d){return o!==d}function G2(u,o,d){return o<d}function q2(u,o,d){return o>d}function Z2(u,o,d){return o<=d}function W2(u,o,d){return o>=d}function sv(u,o,d,v){return v.compare(o,d)===0}function H2(u,o,d,v){return!sv(u,o,d,v)}function X2(u,o,d,v){return v.compare(o,d)<0}function Y2(u,o,d,v){return v.compare(o,d)>0}function K2(u,o,d,v){return v.compare(o,d)<=0}function J2(u,o,d,v){return v.compare(o,d)>=0}function fc(u,o,d){const v=u!=="=="&&u!=="!=";return class lv{constructor(M,b,s){this.type=At,this.lhs=M,this.rhs=b,this.collator=s,this.hasUntypedArgument=M.type.kind==="value"||b.type.kind==="value"}static parse(M,b){if(M.length!==3&&M.length!==4)return b.error("Expected two or three arguments.");const s=M[0];let D=b.parse(M[1],1,Mt);if(!D)return null;if(!V_(s,D.type))return b.concat(1).error(`"${s}" comparisons are not supported for type '${Ir(D.type)}'.`);let N=b.parse(M[2],2,Mt);if(!N)return null;if(!V_(s,N.type))return b.concat(2).error(`"${s}" comparisons are not supported for type '${Ir(N.type)}'.`);if(D.type.kind!==N.type.kind&&D.type.kind!=="value"&&N.type.kind!=="value")return b.error(`Cannot compare types '${Ir(D.type)}' and '${Ir(N.type)}'.`);v&&(D.type.kind==="value"&&N.type.kind!=="value"?D=new On(N.type,[D]):D.type.kind!=="value"&&N.type.kind==="value"&&(N=new On(D.type,[N])));let Z=null;if(M.length===4){if(D.type.kind!=="string"&&N.type.kind!=="string"&&D.type.kind!=="value"&&N.type.kind!=="value")return b.error("Cannot use collator to compare non-string types.");if(Z=b.parse(M[3],3,cd),!Z)return null}return new lv(D,N,Z)}evaluate(M){const b=this.lhs.evaluate(M),s=this.rhs.evaluate(M);if(v&&this.hasUntypedArgument){const D=Kr(b),N=Kr(s);if(D.kind!==N.kind||!(D.kind==="string"||D.kind==="number"))throw new zr(`Expected arguments for "${u}" to be (string, string) or (number, number), but found (${D.kind}, ${N.kind}) instead.`)}if(this.collator&&!v&&this.hasUntypedArgument){const D=Kr(b),N=Kr(s);if(D.kind!=="string"||N.kind!=="string")return o(M,b,s)}return this.collator?d(M,b,s,this.collator.evaluate(M)):o(M,b,s)}eachChild(M){M(this.lhs),M(this.rhs),this.collator&&M(this.collator)}outputDefined(){return!0}}}const Q2=fc("==",U2,sv),eT=fc("!=",$2,H2),tT=fc("<",G2,X2),rT=fc(">",q2,Y2),iT=fc("<=",Z2,K2),nT=fc(">=",W2,J2);class _d{constructor(o,d,v){this.type=cd,this.locale=v,this.caseSensitive=o,this.diacriticSensitive=d}static parse(o,d){if(o.length!==2)return d.error("Expected one argument.");const v=o[1];if(typeof v!="object"||Array.isArray(v))return d.error("Collator options argument must be an object.");const w=d.parse(v["case-sensitive"]===void 0?!1:v["case-sensitive"],1,At);if(!w)return null;const M=d.parse(v["diacritic-sensitive"]===void 0?!1:v["diacritic-sensitive"],1,At);if(!M)return null;let b=null;return v.locale&&(b=d.parse(v.locale,1,Et),!b)?null:new _d(w,M,b)}evaluate(o){return new Nm(this.caseSensitive.evaluate(o),this.diacriticSensitive.evaluate(o),this.locale?this.locale.evaluate(o):null)}eachChild(o){o(this.caseSensitive),o(this.diacriticSensitive),this.locale&&o(this.locale)}outputDefined(){return!1}}class Gm{constructor(o,d,v,w,M){this.type=Et,this.number=o,this.locale=d,this.currency=v,this.minFractionDigits=w,this.maxFractionDigits=M}static parse(o,d){if(o.length!==3)return d.error("Expected two arguments.");const v=d.parse(o[1],1,Ke);if(!v)return null;const w=o[2];if(typeof w!="object"||Array.isArray(w))return d.error("NumberFormat options argument must be an object.");let M=null;if(w.locale&&(M=d.parse(w.locale,1,Et),!M))return null;let b=null;if(w.currency&&(b=d.parse(w.currency,1,Et),!b))return null;let s=null;if(w["min-fraction-digits"]&&(s=d.parse(w["min-fraction-digits"],1,Ke),!s))return null;let D=null;return w["max-fraction-digits"]&&(D=d.parse(w["max-fraction-digits"],1,Ke),!D)?null:new Gm(v,M,b,s,D)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}}class qm{constructor(o){this.type=ud,this.sections=o}static parse(o,d){if(o.length<2)return d.error("Expected at least one argument.");const v=o[1];if(!Array.isArray(v)&&typeof v=="object")return d.error("First argument must be an image or text section.");const w=[];let M=!1;for(let b=1;b<=o.length-1;++b){const s=o[b];if(M&&typeof s=="object"&&!Array.isArray(s)){M=!1;let D=null;if(s["font-scale"]&&(D=d.parse(s["font-scale"],1,Ke),!D))return null;let N=null;if(s["text-font"]&&(N=d.parse(s["text-font"],1,hn(Et)),!N))return null;let Z=null;if(s["text-color"]&&(Z=d.parse(s["text-color"],1,la),!Z))return null;let re=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!R2.includes(s["vertical-align"]))return d.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(re=d.parse(s["vertical-align"],1,Et),!re)return null}const pe=w[w.length-1];pe.scale=D,pe.font=N,pe.textColor=Z,pe.verticalAlign=re}else{const D=d.parse(o[b],1,Mt);if(!D)return null;const N=D.type.kind;
808if(N!=="string"&&N!=="value"&&N!=="null"&&N!=="resolvedImage")return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");M=!0,w.push({content:D,scale:null,font:null,textColor:null,verticalAlign:null})}}return new qm(w)}evaluate(o){const d=v=>{const w=v.content.evaluate(o);return Kr(w)===Ju?new ym("",w,null,null,null,v.verticalAlign?v.verticalAlign.evaluate(o):null):new ym(Nu(w),null,v.scale?v.scale.evaluate(o):null,v.font?v.font.evaluate(o).join(","):null,v.textColor?v.textColor.evaluate(o):null,v.verticalAlign?v.verticalAlign.evaluate(o):null)};return new ja(this.sections.map(d))}eachChild(o){for(const d of this.sections)o(d.content),d.scale&&o(d.scale),d.font&&o(d.font),d.textColor&&o(d.textColor),d.verticalAlign&&o(d.verticalAlign)}outputDefined(){return!1}}class Zm{constructor(o){this.type=Ju,this.input=o}static parse(o,d){if(o.length!==2)return d.error("Expected two arguments.");const v=d.parse(o[1],1,Et);return v?new Zm(v):d.error("No image name provided.")}evaluate(o){const d=this.input.evaluate(o),v=Ro.fromString(d);return v&&o.availableImages&&(v.available=o.availableImages.indexOf(d)>-1),v}eachChild(o){o(this.input)}outputDefined(){return!1}}class Wm{constructor(o){this.type=Ke,this.input=o}static parse(o,d){if(o.length!==2)return d.error(`Expected 1 argument, but found ${o.length-1} instead.`);const v=d.parse(o[1],1);return v?v.type.kind!=="array"&&v.type.kind!=="string"&&v.type.kind!=="value"?d.error(`Expected argument of type string or array, but found ${Ir(v.type)} instead.`):new Wm(v):null}evaluate(o){const d=this.input.evaluate(o);if(typeof d=="string")return[...d].length;if(Array.isArray(d))return d.length;throw new zr(`Expected value to be of type string or array, but found ${Ir(Kr(d))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}}const ha=8192;function aT(u,o){const d=oT(u[0]),v=lT(u[1]),w=Math.pow(2,o.z);return[Math.round(d*w*ha),Math.round(v*w*ha)]}function Hm(u,o){const d=Math.pow(2,o.z),v=(u[0]/ha+o.x)/d,w=(u[1]/ha+o.y)/d;return[sT(v),cT(w)]}function oT(u){return(180+u)/360}function sT(u){return u*360-180}function lT(u){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360}function cT(u){return 360/Math.PI*Math.atan(Math.exp((180-u*360)*Math.PI/180))-90}function Qu(u,o){u[0]=Math.min(u[0],o[0]),u[1]=Math.min(u[1],o[1]),u[2]=Math.max(u[2],o[0]),u[3]=Math.max(u[3],o[1])}function Zu(u,o){return!(u[0]<=o[0]||u[2]>=o[2]||u[1]<=o[1]||u[3]>=o[3])}function uT(u,o,d){return o[1]>u[1]!=d[1]>u[1]&&u[0]<(d[0]-o[0])*(u[1]-o[1])/(d[1]-o[1])+o[0]}function hT(u,o,d){const v=u[0]-o[0],w=u[1]-o[1],M=u[0]-d[0],b=u[1]-d[1];return v*b-M*w===0&&v*M<=0&&w*b<=0}function vd(u,o,d,v){const w=[o[0]-u[0],o[1]-u[1]],M=[v[0]-d[0],v[1]-d[1]];return mT(M,w)===0?!1:!!(U_(u,o,d,v)&&U_(d,v,u,o))}function pT(u,o,d){for(const v of d)for(let w=0;w<v.length-1;++w)if(vd(u,o,v[w],v[w+1]))return!0;return!1}function mc(u,o,d=!1){let v=!1;for(const w of o)for(let M=0;M<w.length-1;M++){if(hT(u,w[M],w[M+1]))return d;uT(u,w[M],w[M+1])&&(v=!v)}return v}function dT(u,o){for(const d of o)if(mc(u,d))return!0;return!1}function cv(u,o){for(const d of u)if(!mc(d,o))return!1;for(let d=0;d<u.length-1;++d)if(pT(u[d],u[d+1],o))return!1;return!0}function fT(u,o){for(const d of o)if(cv(u,d))return!0;return!1}function mT(u,o){return u[0]*o[1]-u[1]*o[0]}function U_(u,o,d,v){const w=u[0]-d[0],M=u[1]-d[1],b=o[0]-d[0],s=o[1]-d[1],D=v[0]-d[0],N=v[1]-d[1],Z=w*N-D*M,re=b*N-D*s;return Z>0&&re<0||Z<0&&re>0}function Xm(u,o,d){const v=[];for(let w=0;w<u.length;w++){const M=[];for(let b=0;b<u[w].length;b++){const s=aT(u[w][b],d);Qu(o,s),M.push(s)}v.push(M)}return v}function uv(u,o,d){const v=[];for(let w=0;w<u.length;w++){const M=Xm(u[w],o,d);v.push(M)}return v}function hv(u,o,d,v){if(u[0]<d[0]||u[0]>d[2]){const w=v*.5;let M=u[0]-d[0]>w?-v:d[0]-u[0]>w?v:0;M===0&&(M=u[0]-d[2]>w?-v:d[2]-u[0]>w?v:0),u[0]+=M}Qu(o,u)}function gT(u){u[0]=u[1]=1/0,u[2]=u[3]=-1/0}function $_(u,o,d,v){const w=Math.pow(2,v.z)*ha,M=[v.x*ha,v.y*ha],b=[];for(const s of u)for(const D of s){const N=[D.x+M[0],D.y+M[1]];hv(N,o,d,w),b.push(N)}return b}function G_(u,o,d,v){const w=Math.pow(2,v.z)*ha,M=[v.x*ha,v.y*ha],b=[];for(const s of u){const D=[];for(const N of s){const Z=[N.x+M[0],N.y+M[1]];Qu(o,Z),D.push(Z)}b.push(D)}if(o[2]-o[0]<=w/2){gT(o);for(const s of b)for(const D of s)hv(D,o,d,w)}return b}function yT(u,o){const d=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],w=u.canonicalID();if(o.type==="Polygon"){const M=Xm(o.coordinates,v,w),b=$_(u.geometry(),d,v,w);if(!Zu(d,v))return!1;for(const s of b)if(!mc(s,M))return!1}if(o.type==="MultiPolygon"){const M=uv(o.coordinates,v,w),b=$_(u.geometry(),d,v,w);if(!Zu(d,v))return!1;for(const s of b)if(!dT(s,M))return!1}return!0}function _T(u,o){const d=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],w=u.canonicalID();if(o.type==="Polygon"){const M=Xm(o.coordinates,v,w),b=G_(u.geometry(),d,v,w);if(!Zu(d,v))return!1;for(const s of b)if(!cv(s,M))return!1}if(o.type==="MultiPolygon"){const M=uv(o.coordinates,v,w),b=G_(u.geometry(),d,v,w);if(!Zu(d,v))return!1;for(const s of b)if(!fT(s,M))return!1}return!0}class Zs{constructor(o,d){this.type=At,this.geojson=o,this.geometries=d}static parse(o,d){if(o.length!==2)return d.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(Gu(o[1])){const v=o[1];if(v.type==="FeatureCollection"){const w=[];for(const M of v.features){const{type:b,coordinates:s}=M.geometry;b==="Polygon"&&w.push(s),b==="MultiPolygon"&&w.push(...s)}if(w.length){const M={type:"MultiPolygon",coordinates:w};return new Zs(v,M)}}else if(v.type==="Feature"){const w=v.geometry.type;if(w==="Polygon"||w==="MultiPolygon")return new Zs(v,v.geometry)}else if(v.type==="Polygon"||v.type==="MultiPolygon")return new Zs(v,v)}return d.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.geometryType()==="Point")return yT(o,this.geometries);if(o.geometryType()==="LineString")return _T(o,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class pv{constructor(o=[],d=(v,w)=>v<w?-1:v>w?1:0){if(this.data=o,this.length=this.data.length,this.compare=d,this.length>0)for(let v=(this.length>>1)-1;v>=0;v--)this._down(v)}push(o){this.data.push(o),this._up(this.length++)}pop(){if(this.length===0)return;const o=this.data[0],d=this.data.pop();return--this.length>0&&(this.data[0]=d,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:d,compare:v}=this,w=d[o];for(;o>0;){const M=o-1>>1,b=d[M];if(v(w,b)>=0)break;d[o]=b,o=M}d[o]=w}_down(o){const{data:d,compare:v}=this,w=this.length>>1,M=d[o];for(;o<w;){let b=(o<<1)+1;const s=b+1;if(s<this.length&&v(d[s],d[b])<0&&(b=s),v(d[b],M)>=0)break;d[o]=d[b],o=b}d[o]=M}}function vT(u,o){if(u.length<=1)return[u];const d=[];let v,w;for(const M of u){const b=xT(M);b!==0&&(M.area=Math.abs(b),w===void 0&&(w=b<0),w===b<0?(v&&d.push(v),v=[M]):v.push(M))}return v&&d.push(v),d}function xT(u){let o=0;for(let d=0,v=u.length,w=v-1,M,b;d<v;w=d++)M=u[d],b=u[w],o+=(b.x-M.x)*(M.y+b.y);return o}const bT=6378.137,q_=1/298.257223563,Z_=q_*(2-q_),W_=Math.PI/180;class Ym{constructor(o){const d=W_*bT*1e3,v=Math.cos(o*W_),w=1/(1-Z_*(1-v*v)),M=Math.sqrt(w);this.kx=d*M*v,this.ky=d*M*w*(1-Z_)}distance(o,d){const v=this.wrap(o[0]-d[0])*this.kx,w=(o[1]-d[1])*this.ky;return Math.sqrt(v*v+w*w)}pointOnLine(o,d){let v=1/0,w,M,b,s;for(let D=0;D<o.length-1;D++){let N=o[D][0],Z=o[D][1],re=this.wrap(o[D+1][0]-N)*this.kx,pe=(o[D+1][1]-Z)*this.ky,ue=0;(re!==0||pe!==0)&&(ue=(this.wrap(d[0]-N)*this.kx*re+(d[1]-Z)*this.ky*pe)/(re*re+pe*pe),ue>1?(N=o[D+1][0],Z=o[D+1][1]):ue>0&&(N+=re/this.kx*ue,Z+=pe/this.ky*ue)),re=this.wrap(d[0]-N)*this.kx,pe=(d[1]-Z)*this.ky;const ve=re*re+pe*pe;ve<v&&(v=ve,w=N,M=Z,b=D,s=ue)}return{point:[w,M],index:b,t:Math.max(0,Math.min(1,s))}}wrap(o){for(;o<-180;)o+=360;for(;o>180;)o-=360;return o}}const _m=100,vm=50;function dv(u,o){return o[0]-u[0]}function Qp(u){return u[1]-u[0]+1}function Ua(u,o){return u[1]>=u[0]&&u[1]<o}function xm(u,o){if(u[0]>
808u[1])return[null,null];const d=Qp(u);if(o){if(d===2)return[u,null];const w=Math.floor(d/2);return[[u[0],u[0]+w],[u[0]+w,u[1]]]}if(d===1)return[u,null];const v=Math.floor(d/2)-1;return[[u[0],u[0]+v],[u[0]+v+1,u[1]]]}function bm(u,o){if(!Ua(o,u.length))return[1/0,1/0,-1/0,-1/0];const d=[1/0,1/0,-1/0,-1/0];for(let v=o[0];v<=o[1];++v)Qu(d,u[v]);return d}function wm(u){const o=[1/0,1/0,-1/0,-1/0];for(const d of u)for(const v of d)Qu(o,v);return o}function H_(u){return u[0]!==-1/0&&u[1]!==-1/0&&u[2]!==1/0&&u[3]!==1/0}function Km(u,o,d){if(!H_(u)||!H_(o))return NaN;let v=0,w=0;return u[2]<o[0]&&(v=o[0]-u[2]),u[0]>o[2]&&(v=u[0]-o[2]),u[1]>o[3]&&(w=u[1]-o[3]),u[3]<o[1]&&(w=o[1]-u[3]),d.distance([0,0],[v,w])}function Us(u,o,d){const v=d.pointOnLine(o,u);return d.distance(u,v.point)}function Jm(u,o,d,v,w){const M=Math.min(Us(u,[d,v],w),Us(o,[d,v],w)),b=Math.min(Us(d,[u,o],w),Us(v,[u,o],w));return Math.min(M,b)}function wT(u,o,d,v,w){if(!(Ua(o,u.length)&&Ua(v,d.length)))return 1/0;let M=1/0;for(let b=o[0];b<o[1];++b){const s=u[b],D=u[b+1];for(let N=v[0];N<v[1];++N){const Z=d[N],re=d[N+1];if(vd(s,D,Z,re))return 0;M=Math.min(M,Jm(s,D,Z,re,w))}}return M}function TT(u,o,d,v,w){if(!(Ua(o,u.length)&&Ua(v,d.length)))return NaN;let M=1/0;for(let b=o[0];b<=o[1];++b)for(let s=v[0];s<=v[1];++s)if(M=Math.min(M,w.distance(u[b],d[s])),M===0)return M;return M}function ST(u,o,d){if(mc(u,o,!0))return 0;let v=1/0;for(const w of o){const M=w[0],b=w[w.length-1];if(M!==b&&(v=Math.min(v,Us(u,[b,M],d)),v===0))return v;const s=d.pointOnLine(w,u);if(v=Math.min(v,d.distance(u,s.point)),v===0)return v}return v}function MT(u,o,d,v){if(!Ua(o,u.length))return NaN;for(let M=o[0];M<=o[1];++M)if(mc(u[M],d,!0))return 0;let w=1/0;for(let M=o[0];M<o[1];++M){const b=u[M],s=u[M+1];for(const D of d)for(let N=0,Z=D.length,re=Z-1;N<Z;re=N++){const pe=D[re],ue=D[N];if(vd(b,s,pe,ue))return 0;w=Math.min(w,Jm(b,s,pe,ue,v))}}return w}function X_(u,o){for(const d of u)for(const v of d)if(mc(v,o,!0))return!0;return!1}function IT(u,o,d,v=1/0){const w=wm(u),M=wm(o);if(v!==1/0&&Km(w,M,d)>=v)return v;if(Zu(w,M)){if(X_(u,o))return 0}else if(X_(o,u))return 0;let b=1/0;for(const s of u)for(let D=0,N=s.length,Z=N-1;D<N;Z=D++){const re=s[Z],pe=s[D];for(const ue of o)for(let ve=0,me=ue.length,le=me-1;ve<me;le=ve++){const He=ue[le],Ne=ue[ve];if(vd(re,pe,He,Ne))return 0;b=Math.min(b,Jm(re,pe,He,Ne,d))}}return b}function Y_(u,o,d,v,w,M){if(!M)return;const b=Km(bm(v,M),w,d);b<o&&u.push([b,M,[0,0]])}function Fp(u,o,d,v,w,M,b){if(!M||!b)return;const s=Km(bm(v,M),bm(w,b),d);s<o&&u.push([s,M,b])}function ed(u,o,d,v,w=1/0){let M=Math.min(v.distance(u[0],d[0][0]),w);if(M===0)return M;const b=new pv([[0,[0,u.length-1],[0,0]]],dv),s=wm(d);for(;b.length>0;){const D=b.pop();if(D[0]>=M)continue;const N=D[1],Z=o?vm:_m;if(Qp(N)<=Z){if(!Ua(N,u.length))return NaN;if(o){const re=MT(u,N,d,v);if(isNaN(re)||re===0)return re;M=Math.min(M,re)}else for(let re=N[0];re<=N[1];++re){const pe=ST(u[re],d,v);if(M=Math.min(M,pe),M===0)return 0}}else{const re=xm(N,o);Y_(b,M,v,u,s,re[0]),Y_(b,M,v,u,s,re[1])}}return M}function td(u,o,d,v,w,M=1/0){let b=Math.min(M,w.distance(u[0],d[0]));if(b===0)return b;const s=new pv([[0,[0,u.length-1],[0,d.length-1]]],dv);for(;s.length>0;){const D=s.pop();if(D[0]>=b)continue;const N=D[1],Z=D[2],re=o?vm:_m,pe=v?vm:_m;if(Qp(N)<=re&&Qp(Z)<=pe){if(!Ua(N,u.length)&&Ua(Z,d.length))return NaN;let ue;if(o&&v)ue=wT(u,N,d,Z,w),b=Math.min(b,ue);else if(o&&!v){const ve=u.slice(N[0],N[1]+1);for(let me=Z[0];me<=Z[1];++me)if(ue=Us(d[me],ve,w),b=Math.min(b,ue),b===0)return b}else if(!o&&v){const ve=d.slice(Z[0],Z[1]+1);for(let me=N[0];me<=N[1];++me)if(ue=Us(u[me],ve,w),b=Math.min(b,ue),b===0)return b}else ue=TT(u,N,d,Z,w),b=Math.min(b,ue)}else{const ue=xm(N,o),ve=xm(Z,v);Fp(s,b,w,u,d,ue[0],ve[0]),Fp(s,b,w,u,d,ue[0],ve[1]),Fp(s,b,w,u,d,ue[1],ve[0]),Fp(s,b,w,u,d,ue[1],ve[1])}}return b}function PT(u,o){const d=u.geometry(),v=d.flat().map(b=>Hm([b.x,b.y],u.canonical));if(d.length===0)return NaN;const w=new Ym(v[0][1]);let M=1/0;for(const b of o){switch(b.type){case"Point":M=Math.min(M,td(v,!1,[b.coordinates],!1,w,M));break;case"LineString":M=Math.min(M,td(v,!1,b.coordinates,!0,w,M));break;case"Polygon":M=Math.min(M,ed(v,!1,b.coordinates,w,M));break}if(M===0)return M}return M}function AT(u,o){const d=u.geometry(),v=d.flat().map(b=>Hm([b.x,b.y],u.canonical));if(d.length===0)return NaN;const w=new Ym(v[0][1]);let M=1/0;for(const b of o){switch(b.type){case"Point":M=Math.min(M,td(v,!0,[b.coordinates],!1,w,M));break;case"LineString":M=Math.min(M,td(v,!0,b.coordinates,!0,w,M));break;case"Polygon":M=Math.min(M,ed(v,!0,b.coordinates,w,M));break}if(M===0)return M}return M}function ET(u,o){const d=u.geometry();if(d.length===0||d[0].length===0)return NaN;const v=vT(d).map(b=>b.map(s=>s.map(D=>Hm([D.x,D.y],u.canonical)))),w=new Ym(v[0][0][0][1]);let M=1/0;for(const b of o)for(const s of v){switch(b.type){case"Point":M=Math.min(M,ed([b.coordinates],!1,s,w,M));break;case"LineString":M=Math.min(M,ed(b.coordinates,!0,s,w,M));break;case"Polygon":M=Math.min(M,IT(s,b.coordinates,w,M));break}if(M===0)return M}return M}function im(u){return u.type==="MultiPolygon"?u.coordinates.map(o=>({type:"Polygon",coordinates:o})):u.type==="MultiLineString"?u.coordinates.map(o=>({type:"LineString",coordinates:o})):u.type==="MultiPoint"?u.coordinates.map(o=>({type:"Point",coordinates:o})):[u]}class Ws{constructor(o,d){this.type=Ke,this.geojson=o,this.geometries=d}static parse(o,d){if(o.length!==2)return d.error(`'distance' expression requires exactly one argument, but found ${o.length-1} instead.`);if(Gu(o[1])){const v=o[1];if(v.type==="FeatureCollection")return new Ws(v,v.features.map(w=>im(w.geometry)).flat());if(v.type==="Feature")return new Ws(v,im(v.geometry));if("type"in v&&"coordinates"in v)return new Ws(v,im(v))}return d.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.geometryType()==="Point")return PT(o,this.geometries);if(o.geometryType()==="LineString")return AT(o,this.geometries);if(o.geometryType()==="Polygon")return ET(o,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class eh{constructor(o){this.type=Mt,this.key=o}static parse(o,d){if(o.length!==2)return d.error(`Expected 1 argument, but found ${o.length-1} instead.`);const v=o[1];return v==null?d.error("Global state property must be defined."):typeof v!="string"?d.error(`Global state property must be string, but found ${typeof o[1]} instead.`):new eh(v)}evaluate(o){var d;const v=(d=o.globals)===null||d===void 0?void 0:d.globalState;return!v||Object.keys(v).length===0?null:Ou(v,this.key)}eachChild(){}outputDefined(){return!1}}
808const Qm={"==":Q2,"!=":eT,">":rT,"<":tT,">=":nT,"<=":iT,array:On,at:jm,boolean:On,case:$m,coalesce:qu,collator:_d,format:qm,image:Zm,in:Vm,"index-of":Kp,interpolate:ua,"interpolate-hcl":ua,"interpolate-lab":ua,length:Wm,let:md,literal:uc,match:Um,number:On,"number-format":Gm,object:On,slice:Jp,step:yd,string:On,"to-boolean":Eo,"to-color":Eo,"to-number":Eo,"to-string":Eo,var:gd,within:Zs,distance:Ws,"global-state":eh};class Vn{constructor(o,d,v,w){this.name=o,this.type=d,this._evaluate=v,this.args=w}evaluate(o){return this._evaluate(o,this.args)}eachChild(o){this.args.forEach(o)}outputDefined(){return!1}static parse(o,d){const v=o[0],w=Vn.definitions[v];if(!w)return d.error(`Unknown expression "${v}". If you wanted a literal array, use ["literal", [...]].`,0);const M=Array.isArray(w)?w[0]:w.type,b=Array.isArray(w)?[[w[1],w[2]]]:w.overloads,s=b.filter(([N])=>!Array.isArray(N)||N.length===o.length-1);let D=null;for(const[N,Z]of s){D=new fd(d.registry,rd,d.path,null,d.scope);const re=[];let pe=!1;for(let ue=1;ue<o.length;ue++){const ve=o[ue],me=Array.isArray(N)?N[ue-1]:N.type,le=D.parse(ve,1+re.length,me);if(!le){pe=!0;break}re.push(le)}if(!pe){if(Array.isArray(N)&&N.length!==re.length){D.error(`Expected ${N.length} arguments, but found ${re.length} instead.`);continue}for(let ue=0;ue<re.length;ue++){const ve=Array.isArray(N)?N[ue]:N.type,me=re[ue];D.concat(ue+1).checkSubtype(ve,me.type)}if(D.errors.length===0)return new Vn(v,M,Z,re)}}if(s.length===1)d.errors.push(...D.errors);else{const N=(s.length?s:b).map(([re])=>kT(re)).join(" | "),Z=[];for(let re=1;re<o.length;re++){const pe=d.parse(o[re],1+Z.length);if(!pe)return null;Z.push(Ir(pe.type))}d.error(`Expected arguments of type ${N}, but found (${Z.join(", ")}) instead.`)}return null}static register(o,d){Vn.definitions=d;for(const v in d)o[v]=Vn}}function K_(u,[o,d,v,w]){o=o.evaluate(u),d=d.evaluate(u),v=v.evaluate(u);const M=w?w.evaluate(u):1,b=nv(o,d,v,M);if(b)throw new zr(b);return new Qt(o/255,d/255,v/255,M,!1)}function J_(u,o){return u in o}function nm(u,o){const d=o[u];return typeof d>"u"?null:d}function CT(u,o,d,v){for(;d<=v;){const w=d+v>>1;if(o[w]===u)return!0;o[w]>u?v=w-1:d=w+1}return!1}function Rs(u){return{type:u}}Vn.register(Qm,{error:[S2,[Et],(u,[o])=>{throw new zr(o.evaluate(u))}],typeof:[Et,[Mt],(u,[o])=>Ir(Kr(o.evaluate(u)))],"to-rgba":[hn(Ke,4),[la],(u,[o])=>{const[d,v,w,M]=o.evaluate(u).rgb;return[d*255,v*255,w*255,M]}],rgb:[la,[Ke,Ke,Ke],K_],rgba:[la,[Ke,Ke,Ke,Ke],K_],has:{type:At,overloads:[[[Et],(u,[o])=>J_(o.evaluate(u),u.properties())],[[Et,$s],(u,[o,d])=>J_(o.evaluate(u),d.evaluate(u))]]},get:{type:Mt,overloads:[[[Et],(u,[o])=>nm(o.evaluate(u),u.properties())],[[Et,$s],(u,[o,d])=>nm(o.evaluate(u),d.evaluate(u))]]},"feature-state":[Mt,[Et],(u,[o])=>nm(o.evaluate(u),u.featureState||{})],properties:[$s,[],u=>u.properties()],"geometry-type":[Et,[],u=>u.geometryType()],id:[Mt,[],u=>u.id()],zoom:[Ke,[],u=>u.globals.zoom],"heatmap-density":[Ke,[],u=>u.globals.heatmapDensity||0],elevation:[Ke,[],u=>u.globals.elevation||0],"line-progress":[Ke,[],u=>u.globals.lineProgress||0],accumulated:[Mt,[],u=>u.globals.accumulated===void 0?null:u.globals.accumulated],"+":[Ke,Rs(Ke),(u,o)=>{let d=0;for(const v of o)d+=v.evaluate(u);return d}],"*":[Ke,Rs(Ke),(u,o)=>{let d=1;for(const v of o)d*=v.evaluate(u);return d}],"-":{type:Ke,overloads:[[[Ke,Ke],(u,[o,d])=>o.evaluate(u)-d.evaluate(u)],[[Ke],(u,[o])=>-o.evaluate(u)]]},"/":[Ke,[Ke,Ke],(u,[o,d])=>o.evaluate(u)/d.evaluate(u)],"%":[Ke,[Ke,Ke],(u,[o,d])=>o.evaluate(u)%d.evaluate(u)],ln2:[Ke,[],()=>Math.LN2],pi:[Ke,[],()=>Math.PI],e:[Ke,[],()=>Math.E],"^":[Ke,[Ke,Ke],(u,[o,d])=>Math.pow(o.evaluate(u),d.evaluate(u))],sqrt:[Ke,[Ke],(u,[o])=>Math.sqrt(o.evaluate(u))],log10:[Ke,[Ke],(u,[o])=>Math.log(o.evaluate(u))/Math.LN10],ln:[Ke,[Ke],(u,[o])=>Math.log(o.evaluate(u))],log2:[Ke,[Ke],(u,[o])=>Math.log(o.evaluate(u))/Math.LN2],sin:[Ke,[Ke],(u,[o])=>Math.sin(o.evaluate(u))],cos:[Ke,[Ke],(u,[o])=>Math.cos(o.evaluate(u))],tan:[Ke,[Ke],(u,[o])=>Math.tan(o.evaluate(u))],asin:[Ke,[Ke],(u,[o])=>Math.asin(o.evaluate(u))],acos:[Ke,[Ke],(u,[o])=>Math.acos(o.evaluate(u))],atan:[Ke,[Ke],(u,[o])=>Math.atan(o.evaluate(u))],min:[Ke,Rs(Ke),(u,o)=>Math.min(...o.map(d=>d.evaluate(u)))],max:[Ke,Rs(Ke),(u,o)=>Math.max(...o.map(d=>d.evaluate(u)))],abs:[Ke,[Ke],(u,[o])=>Math.abs(o.evaluate(u))],round:[Ke,[Ke],(u,[o])=>{const d=o.evaluate(u);return d<0?-Math.round(-d):Math.round(d)}],floor:[Ke,[Ke],(u,[o])=>Math.floor(o.evaluate(u))],ceil:[Ke,[Ke],(u,[o])=>Math.ceil(o.evaluate(u))],"filter-==":[At,[Et,Mt],(u,[o,d])=>u.properties()[o.value]===d.value],"filter-id-==":[At,[Mt],(u,[o])=>
808u.id()===o.value],"filter-type-==":[At,[Et],(u,[o])=>u.geometryType()===o.value],"filter-<":[At,[Et,Mt],(u,[o,d])=>{const v=u.properties()[o.value],w=d.value;return typeof v==typeof w&&v<w}],"filter-id-<":[At,[Mt],(u,[o])=>{const d=u.id(),v=o.value;return typeof d==typeof v&&d<v}],"filter->":[At,[Et,Mt],(u,[o,d])=>{const v=u.properties()[o.value],w=d.value;return typeof v==typeof w&&v>w}],"filter-id->":[At,[Mt],(u,[o])=>{const d=u.id(),v=o.value;return typeof d==typeof v&&d>v}],"filter-<=":[At,[Et,Mt],(u,[o,d])=>{const v=u.properties()[o.value],w=d.value;return typeof v==typeof w&&v<=w}],"filter-id-<=":[At,[Mt],(u,[o])=>{const d=u.id(),v=o.value;return typeof d==typeof v&&d<=v}],"filter->=":[At,[Et,Mt],(u,[o,d])=>{const v=u.properties()[o.value],w=d.value;return typeof v==typeof w&&v>=w}],"filter-id->=":[At,[Mt],(u,[o])=>{const d=u.id(),v=o.value;return typeof d==typeof v&&d>=v}],"filter-has":[At,[Mt],(u,[o])=>o.value in u.properties()],"filter-has-id":[At,[],u=>u.id()!==null&&u.id()!==void 0],"filter-type-in":[At,[hn(Et)],(u,[o])=>o.value.indexOf(u.geometryType())>=0],"filter-id-in":[At,[hn(Mt)],(u,[o])=>o.value.indexOf(u.id())>=0],"filter-in-small":[At,[Et,hn(Mt)],(u,[o,d])=>d.value.indexOf(u.properties()[o.value])>=0],"filter-in-large":[At,[Et,hn(Mt)],(u,[o,d])=>CT(u.properties()[o.value],d.value,0,d.value.length-1)],all:{type:At,overloads:[[[At,At],(u,[o,d])=>o.evaluate(u)&&d.evaluate(u)],[Rs(At),(u,o)=>{for(const d of o)if(!d.evaluate(u))return!1;return!0}]]},any:{type:At,overloads:[[[At,At],(u,[o,d])=>o.evaluate(u)||d.evaluate(u)],[Rs(At),(u,o)=>{for(const d of o)if(d.evaluate(u))return!0;return!1}]]},"!":[At,[At],(u,[o])=>!o.evaluate(u)],"is-supported-script":[At,[Et],(u,[o])=>{const d=u.globals&&u.globals.isSupportedScript;return d?d(o.evaluate(u)):!0}],upcase:[Et,[Et],(u,[o])=>o.evaluate(u).toUpperCase()],downcase:[Et,[Et],(u,[o])=>o.evaluate(u).toLowerCase()],concat:[Et,Rs(Mt),(u,o)=>o.map(d=>Nu(d.evaluate(u))).join("")],"resolved-locale":[Et,[cd],(u,[o])=>o.evaluate(u).resolvedLocale()]});function kT(u){return Array.isArray(u)?`(${u.map(Ir).join(", ")})`:`(${Ir(u.type)}...)`}function rd(u){if(u instanceof gd)return rd(u.boundExpression);if(u instanceof Vn&&u.name==="error"||u instanceof _d||u instanceof Zs||u instanceof Ws||u instanceof eh)return!1;const o=u instanceof Eo||u instanceof On;let d=!0;return u.eachChild(v=>{o?d=d&&rd(v):d=d&&v instanceof uc}),d?xd(u)&&bd(u,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function xd(u){if(u instanceof Vn&&(u.name==="get"&&u.args.length===1||u.name==="feature-state"||u.name==="has"&&u.args.length===1||u.name==="properties"||u.name==="geometry-type"||u.name==="id"||/^filter-/.test(u.name))||u instanceof Zs||u instanceof Ws)return!1;let o=!0;return u.eachChild(d=>{o&&!xd(d)&&(o=!1)}),o}function Wu(u){if(u instanceof Vn&&u.name==="feature-state")return!1;let o=!0;return u.eachChild(d=>{o&&!Wu(d)&&(o=!1)}),o}function bd(u,o){if(u instanceof Vn&&o.indexOf(u.name)>=0)return!1;let d=!0;return u.eachChild(v=>{d&&!bd(v,o)&&(d=!1)}),d}function Tm(u){return{result:"success",value:u}}function ac(u){return{result:"error",value:u}}function id(u){return u["property-type"]==="data-driven"||u["property-type"]==="cross-faded-data-driven"}function fv(u){return!!u.expression&&u.expression.parameters.indexOf("zoom")>-1}function mv(u){return!!u.expression&&u.expression.interpolated}function kt(u){return u instanceof Number?"number":u instanceof String?"string":u instanceof Boolean?"boolean":Array.isArray(u)?"array":u===null?"null":typeof u}function eg(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&Kr(u)===$s}class DT{constructor(o,d,v){this.expression=o,this._warningHistory={},this._evaluator=new av,this._defaultValue=d?RT(d):null,this._enumValues=d&&d.type==="enum"?d.values:null,this._globalState=v}evaluateWithoutErrorHandling(o,d,v,w,M,b){return this._globalState&&(o=hc(o,this._globalState)),this._evaluator.globals=o,this._evaluator.feature=d,this._evaluator.featureState=v,this._evaluator.canonical=w,this._evaluator.availableImages=M||null,this._evaluator.formattedSection=b,this.expression.evaluate(this._evaluator)}evaluate(o,d,v,w,M,b){this._globalState&&(o=hc(o,this._globalState)),this._evaluator.globals=o,this._evaluator.feature=d||null,this._evaluator.featureState=v||null,this._evaluator.canonical=w,this._evaluator.availableImages=M||null,this._evaluator.formattedSection=b||null;try{const s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new zr(`Expected value to be one of ${Object.keys(this._enumValues).map(D=>JSON.stringify(D)).join(", ")}, but found ${JSON.stringify(s)} instead.`);return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}}
808function gv(u){return Array.isArray(u)&&u.length>0&&typeof u[0]=="string"&&u[0]in Qm}function yv(u,o,d){const v=new fd(Qm,rd,[],o?LT(o):void 0),w=v.parse(u,void 0,void 0,void 0,o&&o.type==="string"?{typeAnnotation:"coerce"}:void 0);return w?Tm(new DT(w,o,d)):ac(v.errors)}class Q_{constructor(o,d,v){this.kind=o,this._styleExpression=d,this.isStateDependent=o!=="constant"&&!Wu(d.expression),this.globalStateRefs=tg(d.expression),this._globalState=v}evaluateWithoutErrorHandling(o,d,v,w,M,b){return this._globalState&&(o=hc(o,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(o,d,v,w,M,b)}evaluate(o,d,v,w,M,b){return this._globalState&&(o=hc(o,this._globalState)),this._styleExpression.evaluate(o,d,v,w,M,b)}}class e0{constructor(o,d,v,w,M){this.kind=o,this.zoomStops=v,this._styleExpression=d,this.isStateDependent=o!=="camera"&&!Wu(d.expression),this.globalStateRefs=tg(d.expression),this.interpolationType=w,this._globalState=M}evaluateWithoutErrorHandling(o,d,v,w,M,b){return this._globalState&&(o=hc(o,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(o,d,v,w,M,b)}evaluate(o,d,v,w,M,b){return this._globalState&&(o=hc(o,this._globalState)),this._styleExpression.evaluate(o,d,v,w,M,b)}interpolationFactor(o,d,v){return this.interpolationType?ua.interpolationFactor(this.interpolationType,o,d,v):0}}function zT(u,o,d){const v=yv(u,o,d);if(v.result==="error")return v;const w=v.value.expression,M=xd(w);if(!M&&!id(o))return ac([new sa("","data expressions not supported")]);const b=bd(w,["zoom"]);if(!b&&!fv(o))return ac([new sa("","zoom expressions not supported")]);const s=Gp(w);if(!s&&!b)return ac([new sa("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof sa)return ac([s]);if(s instanceof ua&&!mv(o))return ac([new sa("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Tm(M?new Q_("constant",v.value,d):new Q_("source",v.value,d));const D=s instanceof ua?s.interpolation:void 0;return Tm(M?new e0("camera",v.value,s.labels,D,d):new e0("composite",v.value,s.labels,D,d))}function Gp(u){let o=null;if(u instanceof md)o=Gp(u.result);else if(u instanceof qu){for(const d of u.args)if(o=Gp(d),o)break}else(u instanceof yd||u instanceof ua)&&u.input instanceof Vn&&u.input.name==="zoom"&&(o=u);return o instanceof sa||u.eachChild(d=>{const v=Gp(d);v instanceof sa?o=v:!o&&v?o=new sa("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&v&&o!==v&&(o=new sa("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function tg(u,o=new Set){return u instanceof eh&&o.add(u.key),u.eachChild(d=>{tg(d,o)}),o}function LT(u){const o={color:la,string:Et,number:Ke,enum:Et,boolean:At,formatted:ud,padding:hd,numberArray:pd,colorArray:Vu,projectionDefinition:ld,resolvedImage:Ju,variableAnchorOffsetCollection:dd};return u.type==="array"?hn(o[u.value]||Mt,u.length):o[u.type]}function RT(u){if(u.type==="color"&&eg(u.default))return new Qt(0,0,0,0);switch(u.type){case"color":return Qt.parse(u.default)||null;case"padding":return Nn.parse(u.default)||null;case"numberArray":return jn.parse(u.default)||null;case"colorArray":return pn.parse(u.default)||null;case"variableAnchorOffsetCollection":return ca.parse(u.default)||null;case"projectionDefinition":return Bn.parse(u.default)||null;default:return u.default===void 0?null:u.default}}function hc(u,o){const{zoom:d,heatmapDensity:v,elevation:w,lineProgress:M,isSupportedScript:b,accumulated:s}=u??{};return{zoom:d,heatmapDensity:v,elevation:w,lineProgress:M,isSupportedScript:b,accumulated:s,globalState:o}}function _v(u){if(u===!0||u===!1)return!0;if(!Array.isArray(u)||u.length===0)return!1;switch(u[0]){case"has":return u.length>=2&&u[1]!=="$id"&&u[1]!=="$type";case"in":return u.length>=3&&(typeof u[1]!="string"||Array.isArray(u[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return u.length!==3||Array.isArray(u[1])||Array.isArray(u[2]);case"any":case"all":for(const o of u.slice(1))if(!_v(o)&&typeof o!="boolean")return!1;return!0;default:return!0}}function vv(u){const o=u.key,d=u.value;return d?[new qe(o,d,"constants have been deprecated as of v8")]:[]}function Nr(u){return u instanceof Number||u instanceof String||u instanceof Boolean?u.valueOf():u}function Xs(u){if(Array.isArray(u))return u.map(Xs);if(u instanceof Object&&!(u instanceof Number||u instanceof String||u instanceof Boolean)){const o={};for(const d in u)o[d]=Xs(u[d]);return o}return Nr(u)}function dn(u){const o=u.key,d=u.value,v=u.valueSpec||{},w=u.objectElementValidators||{},M=u.style,b=u.styleSpec,s=u.validateSpec;let D=[];const N=kt(d);if(N!=="object")return[new qe(o,d,`object expected, ${N} found`)];
vendor: 6,412 bytes, line 808
808for(const Z in d){const re=Z.split(".")[0],pe=Ou(v,re)||v["*"];let ue;if(Ou(w,re))ue=w[re];else if(Ou(v,re)){if(d[Z]===void 0)continue;ue=s}else if(w["*"])ue=w["*"];else if(v["*"])ue=s;else{D.push(new qe(o,d[Z],`unknown property "${Z}"`));continue}D=D.concat(ue({key:(o&&`${o}.`)+Z,value:d[Z],valueSpec:pe,style:M,styleSpec:b,object:d,objectKey:Z,validateSpec:s},d))}for(const Z in v)w[Z]||v[Z].required&&v[Z].default===void 0&&d[Z]===void 0&&D.push(new qe(o,d,`missing required property "${Z}"`));return D}function rg(u){const o=u.value,d=u.valueSpec,v=u.validateSpec,w=u.style,M=u.styleSpec,b=u.key,s=u.arrayElementValidator||v;if(kt(o)!=="array")return[new qe(b,o,`array expected, ${kt(o)} found`)];if(d.length&&o.length!==d.length)return[new qe(b,o,`array length ${d.length} expected, length ${o.length} found`)];let D={type:d.value,values:d.values};M.$version<7&&(D.function=d.function),kt(d.value)==="object"&&(D=d.value);let N=[];for(let Z=0;Z<o.length;Z++)N=N.concat(s({array:o,arrayIndex:Z,value:o[Z],valueSpec:D,validateSpec:u.validateSpec,style:w,styleSpec:M,key:`${b}[${Z}]`}));return N}function wd(u){const o=u.key,d=u.value,v=u.valueSpec;let w=kt(d);return w==="number"&&d!==d&&(w="NaN"),w!=="number"?[new qe(o,d,`number expected, ${w} found`)]:"minimum"in v&&d<v.minimum?[new qe(o,d,`${d} is less than the minimum value ${v.minimum}`)]:"maximum"in v&&d>v.maximum?[new qe(o,d,`${d} is greater than the maximum value ${v.maximum}`)]:[]}function xv(u){const o=u.valueSpec,d=Nr(u.value.type);let v,w={},M,b;const s=d!=="categorical"&&u.value.property===void 0,D=!s,N=kt(u.value.stops)==="array"&&kt(u.value.stops[0])==="array"&&kt(u.value.stops[0][0])==="object",Z=dn({key:u.key,value:u.value,valueSpec:u.styleSpec.function,validateSpec:u.validateSpec,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{stops:re,default:ve}});return d==="identity"&&s&&Z.push(new qe(u.key,u.value,'missing required property "property"')),d!=="identity"&&!u.value.stops&&Z.push(new qe(u.key,u.value,'missing required property "stops"')),d==="exponential"&&u.valueSpec.expression&&!mv(u.valueSpec)&&Z.push(new qe(u.key,u.value,"exponential functions not supported")),u.styleSpec.$version>=8&&(D&&!id(u.valueSpec)?Z.push(new qe(u.key,u.value,"property functions not supported")):s&&!fv(u.valueSpec)&&Z.push(new qe(u.key,u.value,"zoom functions not supported"))),(d==="categorical"||N)&&u.value.property===void 0&&Z.push(new qe(u.key,u.value,'"property" property is required')),Z;function re(me){if(d==="identity")return[new qe(me.key,me.value,'identity function may not have a "stops" property')];let le=[];const He=me.value;return le=le.concat(rg({key:me.key,value:He,valueSpec:me.valueSpec,validateSpec:me.validateSpec,style:me.style,styleSpec:me.styleSpec,arrayElementValidator:pe})),kt(He)==="array"&&He.length===0&&le.push(new qe(me.key,He,"array must have at least one stop")),le}function pe(me){let le=[];const He=me.value,Ne=me.key;if(kt(He)!=="array")return[new qe(Ne,He,`array expected, ${kt(He)} found`)];if(He.length!==2)return[new qe(Ne,He,`array length 2 expected, length ${He.length} found`)];if(N){if(kt(He[0])!=="object")return[new qe(Ne,He,`object expected, ${kt(He[0])} found`)];if(He[0].zoom===void 0)return[new qe(Ne,He,"object stop key must have zoom")];if(He[0].value===void 0)return[new qe(Ne,He,"object stop key must have value")];if(b&&b>Nr(He[0].zoom))return[new qe(Ne,He[0].zoom,"stop zoom values must appear in ascending order")];Nr(He[0].zoom)!==b&&(b=Nr(He[0].zoom),M=void 0,w={}),le=le.concat(dn({key:`${Ne}[0]`,value:He[0],valueSpec:{zoom:{}},validateSpec:me.validateSpec,style:me.style,styleSpec:me.styleSpec,objectElementValidators:{zoom:wd,value:ue}}))}else le=le.concat(ue({key:`${Ne}[0]`,value:He[0],validateSpec:me.validateSpec,style:me.style,styleSpec:me.styleSpec},He));return gv(Xs(He[1]))?le.concat([new qe(`${Ne}[1]`,He[1],"expressions are not allowed in function stops.")]):le.concat(me.validateSpec({key:`${Ne}[1]`,value:He[1],valueSpec:o,validateSpec:me.validateSpec,style:me.style,styleSpec:me.styleSpec}))}function ue(me,le){const He=kt(me.value),Ne=Nr(me.value),$e=me.value!==null?me.value:le;if(!v)v=He;else if(He!==v)return[new qe(me.key,$e,`${He} stop domain type must match previous stop domain type ${v}`)];if(He!=="number"&&He!=="string"&&He!=="boolean")return[new qe(me.key,$e,"stop domain value must be a number, string, or boolean")];if(He!=="number"&&d!=="categorical"){let ke=`number expected, ${He} found`;return id(o)&&d===void 0&&(ke+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new qe(me.key,$e,ke)]}return d==="categorical"&&He==="number"&&(!isFinite(Ne)||Math.floor(Ne)!==Ne)?[new qe(me.key,$e,`integer expected, found ${Ne}`)]:d!=="categorical"&&He==="number"&&M!==void 0&&Ne<M?[new qe(me.key,$e,"stop domain values must appear in ascending order")]:(M=Ne,d==="categorical"&&Ne in w?[new qe(me.key,$e,"stop domain values must be unique")]:(w[Ne]=!0,[]))}function ve(me){return me.validateSpec({key:me.key,value:me.value,valueSpec:o,validateSpec:me.validateSpec,style:me.style,styleSpec:me.styleSpec})}}function pc(u){const o=(u.expressionContext==="property"?zT:yv)(Xs(u.value),u.valueSpec);if(o.result==="error")return o.value.map(v=>new qe(`${u.key}${v.key}`,u.value,v.message));const d=o.value.expression||o.value._styleExpression.expression;if(u.expressionContext==="property"&&u.propertyKey==="text-font"&&!d.outputDefined())return[new qe(u.key,u.value,`Invalid data expression for "${u.propertyKey}". Output values must be contained as literals within the expression.`)];if(u.expressionContext==="property"&&u.propertyType==="layout"&&!Wu(d))return[new qe(u.key,u.value,'"feature-state" data expressions are not supported with layout properties.')];if(u.expressionContext==="filter"&&!Wu(d))return[new qe(u.key,u.value,'"feature-state" data expressions are not supported with filters.')];if(u.expressionContext&&u.expressionContext.indexOf("cluster")===0){if(!bd(d,["zoom","feature-state"]))return[new qe(u.key,u.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(u.expressionContext==="cluster-initial"&&!xd(d))return[new qe(u.key,u.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function FT(u){const o=u.value,d=u.key,v=kt(o);return v!=="boolean"?[new qe(d,o,`boolean expected, ${v}
808 found`)]:[]}function Sm(u){const o=u.key,d=u.value,v=kt(d);return v!=="string"?[new qe(o,d,`color expected, ${v} found`)]:Qt.parse(String(d))?[]:[new qe(o,d,`color expected, "${d}" found`)]}function Hu(u){const o=u.key,d=u.value,v=u.valueSpec,w=[];return Array.isArray(v.values)?v.values.indexOf(Nr(d))===-1&&w.push(new qe(o,d,`expected one of [${v.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(v.values).indexOf(Nr(d))===-1&&w.push(new qe(o,d,`expected one of [${Object.keys(v.values).join(", ")}], ${JSON.stringify(d)} found`)),w}function ig(u){return _v(Xs(u.value))?pc(Yp({},u,{expressionContext:"filter",valueSpec:{value:"boolean"}})):bv(u)}function bv(u){const o=u.value,d=u.key;if(kt(o)!=="array")return[new qe(d,o,`array expected, ${kt(o)} found`)];const v=u.styleSpec;let w,M=[];if(o.length<1)return[new qe(d,o,"filter array must have at least 1 element")];switch(M=M.concat(Hu({key:`${d}[0]`,value:o[0],valueSpec:v.filter_operator,style:u.style,styleSpec:u.styleSpec})),Nr(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&Nr(o[1])==="$type"&&M.push(new qe(d,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":o.length!==3&&M.push(new qe(d,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(w=kt(o[1]),w!=="string"&&M.push(new qe(`${d}[1]`,o[1],`string expected, ${w} found`)));for(let b=2;b<o.length;b++)w=kt(o[b]),Nr(o[1])==="$type"?M=M.concat(Hu({key:`${d}[${b}]`,value:o[b],valueSpec:v.geometry_type,style:u.style,styleSpec:u.styleSpec})):w!=="string"&&w!=="number"&&w!=="boolean"&&M.push(new qe(`${d}[${b}]`,o[b],`string, number, or boolean expected, ${w} found`));break;case"any":case"all":case"none":for(let b=1;b<o.length;b++)M=M.concat(bv({key:`${d}[${b}]`,value:o[b],style:u.style,styleSpec:u.styleSpec}));break;case"has":case"!has":w=kt(o[1]),o.length!==2?M.push(new qe(d,o,`filter array for "${o[0]}" operator must have 2 elements`)):w!=="string"&&M.push(new qe(`${d}[1]`,o[1],`string expected, ${w} found`));break}return M}function wv(u,o){const d=u.key,v=u.validateSpec,w=u.style,M=u.styleSpec,b=u.value,s=u.objectKey,D=M[`${o}_${u.layerType}`];if(!D)return[];const N=s.match(/^(.*)-transition$/);if(o==="paint"&&N&&D[N[1]]&&D[N[1]].transition)return v({key:d,value:b,valueSpec:M.transition,style:w,styleSpec:M});const Z=u.valueSpec||D[s];if(!Z)return[new qe(d,b,`unknown property "${s}"`)];let re;if(kt(b)==="string"&&id(Z)&&!Z.tokens&&(re=/^{([^}]+)}$/.exec(b)))return[new qe(d,b,`"${s}" does not support interpolation syntax 809Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(re[1])} }\`.`)];const pe=[];return u.layerType==="symbol"&&s==="text-font"&&eg(Xs(b))&&Nr(b.type)==="identity"&&pe.push(new qe(d,b,'"text-font" does not support identity functions')),pe.concat(v({key:u.key,value:b,valueSpec:Z,style:w,styleSpec:M,expressionContext:"property",propertyType:o,propertyKey:s}))}function Tv(u){return wv(u,"paint")}function Sv(u){return wv(u,"layout")}function Mv(u){let o=[];const d=u.value,v=u.key,w=u.style,M=u.styleSpec;if(kt(d)!=="object")return[new qe(v,d,`object expected, ${kt(d)} found`)];!d.type&&!d.ref&&o.push(new qe(v,d,'either "type" or "ref" is required'));let b=Nr(d.type);const s=Nr(d.ref);if(d.id){const D=Nr(d.id);for(let N=0;N<u.arrayIndex;N++){const Z=w.layers[N];Nr(Z.id)===D&&o.push(new qe(v,d.id,`duplicate layer id "${d.id}", previously used at line ${Z.id.__line__}`))}}if("ref"in d){["type","source","source-layer","filter","layout"].forEach(N=>{N in d&&o.push(new qe(v,d[N],`"${N}" is prohibited for ref layers`))});let D;w.layers.forEach(N=>{Nr(N.id)===s&&(D=N)}),D?D.ref?o.push(new qe(v,d.ref,"ref cannot reference another ref layer")):b=Nr(D.type):o.push(new qe(v,d.ref,`ref layer "${s}" not found`))}else if(b!=="background")if(!d.source)o.push(new qe(v,d,'missing required property "source"'));else{const D=w.sources&&w.sources[d.source],N=D&&Nr(D.type);D?N==="vector"&&b==="raster"?o.push(new qe(v,d.source,`layer "${d.id}" requires a raster source`)):N!=="raster-dem"&&b==="hillshade"?o.push(new qe(v,d.source,`layer "${d.id}" requires a raster-dem source`)):N!=="raster-dem"&&b==="color-relief"?o.push(new qe(v,d.source,`layer "${d.id}" requires a raster-dem source`)):N==="raster"&&b!=="raster"?o.push(new qe(v,d.source,`layer "${d.id}" requires a vector source`)):N==="vector"&&!d["source-layer"]?o.push(new qe(v,d,`layer "${d.id}" must specify a "source-layer"`)):N==="raster-dem"&&b!=="hillshade"&&b!=="color-relief"?o.push(new qe(v,d.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):b==="line"&&d.paint&&d.paint["line-gradient"]&&(N!=="geojson"||!D.lineMetrics)&&o.push(new qe(v,d,`layer "${d.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new qe(v,d.source,`source "${d.source}" not found`))}return o=o.concat(dn({key:v,value:d,valueSpec:M.layer,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(){return[]},type(){return u.validateSpec({key:`${v}.type`,value:d.type,valueSpec:M.layer.type,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,object:d,objectKey:"type"})},filter:ig,layout(D){return dn({layer:d,key:D.key,value:D.value,style:D.style,styleSpec:D.styleSpec,validateSpec:D.val
809idateSpec,objectElementValidators:{"*"(N){return Sv(Yp({layerType:b},N))}}})},paint(D){return dn({layer:d,key:D.key,value:D.value,style:D.style,styleSpec:D.styleSpec,validateSpec:D.validateSpec,objectElementValidators:{"*"(N){return Tv(Yp({layerType:b},N))}}})}}})),o}function Lo(u){const o=u.value,d=u.key,v=kt(o);return v!=="string"?[new qe(d,o,`string expected, ${v} found`)]:[]}function BT(u){var o;const d=(o=u.sourceName)!==null&&o!==void 0?o:"",v=u.value,w=u.styleSpec,M=w.source_raster_dem,b=u.style;let s=[];const D=kt(v);if(v===void 0)return s;if(D!=="object")return s.push(new qe("source_raster_dem",v,`object expected, ${D} found`)),s;const N=Nr(v.encoding)==="custom",Z=["redFactor","greenFactor","blueFactor","baseShift"],re=u.value.encoding?`"${u.value.encoding}"`:"Default";for(const pe in v)!N&&Z.includes(pe)?s.push(new qe(pe,v[pe],`In "${d}": "${pe}" is only valid when "encoding" is set to "custom". ${re} encoding found`)):M[pe]?s=s.concat(u.validateSpec({key:pe,value:v[pe],valueSpec:M[pe],validateSpec:u.validateSpec,style:b,styleSpec:w})):s.push(new qe(pe,v[pe],`unknown property "${pe}"`));return s}const t0={promoteId:OT};function Iv(u){const o=u.value,d=u.key,v=u.styleSpec,w=u.style,M=u.validateSpec;if(!o.type)return[new qe(d,o,'"type" is required')];const b=Nr(o.type);let s;switch(b){case"vector":case"raster":return s=dn({key:d,value:o,valueSpec:v[`source_${b.replace("-","_")}`],style:u.style,styleSpec:v,objectElementValidators:t0,validateSpec:M}),s;case"raster-dem":return s=BT({sourceName:d,value:o,style:u.style,styleSpec:v,validateSpec:M}),s;case"geojson":if(s=dn({key:d,value:o,valueSpec:v.source_geojson,style:w,styleSpec:v,validateSpec:M,objectElementValidators:t0}),o.cluster)for(const D in o.clusterProperties){const[N,Z]=o.clusterProperties[D],re=typeof N=="string"?[N,["accumulated"],["get",D]]:N;s.push(...pc({key:`${d}.${D}.map`,value:Z,expressionContext:"cluster-map"})),s.push(...pc({key:`${d}.${D}.reduce`,value:re,expressionContext:"cluster-reduce"}))}return s;case"video":return dn({key:d,value:o,valueSpec:v.source_video,style:w,validateSpec:M,styleSpec:v});case"image":return dn({key:d,value:o,valueSpec:v.source_image,style:w,validateSpec:M,styleSpec:v});case"canvas":return[new qe(d,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Hu({key:`${d}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function OT({key:u,value:o}){if(kt(o)==="string")return Lo({key:u,value:o});{const d=[];for(const v in o)d.push(...Lo({key:`${u}.${v}`,value:o[v]}));return d}}function Pv(u){const o=u.value,d=u.styleSpec,v=d.light,w=u.style;let M=[];const b=kt(o);if(o===void 0)return M;if(b!=="object")return M=M.concat([new qe("light",o,`object expected, ${b} found`)]),M;for(const s in o){const D=s.match(/^(.*)-transition$/);D&&v[D[1]]&&v[D[1]].transition?M=M.concat(u.validateSpec({key:s,value:o[s],valueSpec:d.transition,validateSpec:u.validateSpec,style:w,styleSpec:d})):v[s]?M=M.concat(u.validateSpec({key:s,value:o[s],valueSpec:v[s],validateSpec:u.validateSpec,style:w,styleSpec:d})):M=M.concat([new qe(s,o[s],`unknown property "${s}"`)])}return M}function Av(u){const o=u.value,d=u.styleSpec,v=d.sky,w=u.style,M=kt(o);if(o===void 0)return[];if(M!=="object")return[new qe("sky",o,`object expected, ${M} found`)];let b=[];for(const s in o)v[s]?b=b.concat(u.validateSpec({key:s,value:o[s],valueSpec:v[s],style:w,styleSpec:d})):b=b.concat([new qe(s,o[s],`unknown property "${s}"`)]);return b}function Ev(u){const o=u.value,d=u.styleSpec,v=d.terrain,w=u.style;let M=[];const b=kt(o);if(o===void 0)return M;if(b!=="object")return M=M.concat([new qe("terrain",o,`object expected, ${b} found`)]),M;for(const s in o)v[s]?M=M.concat(u.validateSpec({key:s,value:o[s],valueSpec:v[s],validateSpec:u.validateSpec,style:w,styleSpec:d})):M=M.concat([new qe(s,o[s],`unknown property "${s}"`)]);return M}function NT(u){return Lo(u).length===0?[]:pc(u)}function jT(u){return Lo(u).length===0?[]:pc(u)}function VT(u){const o=u.key,d=u.value;if(kt(d)==="array"){if(d.length<1||d.length>4)return[new qe(o,d,`padding requires 1 to 4 values; ${d.length} values found`)];const v={type:"number"};let w=[];for(let M=0;M<d.length;M++)w=w.concat(u.validateSpec({key:`${o}[${M}]`,value:d[M],validateSpec:u.validateSpec,valueSpec:v}));return w}
809else return wd({key:o,value:d,valueSpec:{}})}function UT(u){const o=u.key,d=u.value;if(kt(d)==="array"){const v={type:"number"};if(d.length<1)return[new qe(o,d,"array length at least 1 expected, length 0 found")];let w=[];for(let M=0;M<d.length;M++)w=w.concat(u.validateSpec({key:`${o}[${M}]`,value:d[M],validateSpec:u.validateSpec,valueSpec:v}));return w}else return wd({key:o,value:d,valueSpec:{}})}function $T(u){const o=u.key,d=u.value;if(kt(d)==="array"){if(d.length<1)return[new qe(o,d,"array length at least 1 expected, length 0 found")];let v=[];for(let w=0;w<d.length;w++)v=v.concat(Sm({key:`${o}[${w}]`,value:d[w]}));return v}else return Sm({key:o,value:d})}function GT(u){const o=u.key,d=u.value,v=kt(d),w=u.styleSpec;if(v!=="array"||d.length<1||d.length%2!==0)return[new qe(o,d,"variableAnchorOffsetCollection requires a non-empty array of even length")];let M=[];for(let b=0;b<d.length;b+=2)M=M.concat(Hu({key:`${o}[${b}]`,value:d[b],valueSpec:w.layout_symbol["text-anchor"]})),M=M.concat(rg({key:`${o}[${b+1}]`,value:d[b+1],valueSpec:{length:2,value:"number"},validateSpec:u.validateSpec,style:u.style,styleSpec:w}));return M}function Cv(u){let o=[];const d=u.value,v=u.key;if(Array.isArray(d)){const w=[],M=[];for(const b in d){d[b].id&&w.includes(d[b].id)&&o.push(new qe(v,d,`all the sprites' ids must be unique, but ${d[b].id} is duplicated`)),w.push(d[b].id),d[b].url&&M.includes(d[b].url)&&o.push(new qe(v,d,`all the sprites' URLs must be unique, but ${d[b].url} is duplicated`)),M.push(d[b].url);const s={id:{type:"string",required:!0},url:{type:"string",required:!0}};o=o.concat(dn({key:`${v}[${b}]`,value:d[b],valueSpec:s,validateSpec:u.validateSpec}))}return o}else return Lo({key:v,value:d})}function qT(u){const o=u.value,d=u.styleSpec,v=d.projection,w=u.style,M=kt(o);if(o===void 0)return[];if(M!=="object")return[new qe("projection",o,`object expected, ${M} found`)];let b=[];for(const s in o)v[s]?b=b.concat(u.validateSpec({key:s,value:o[s],valueSpec:v[s],style:w,styleSpec:d})):b=b.concat([new qe(s,o[s],`unknown property "${s}"`)]);return b}function ZT(u){const o=u.key;let d=u.value;d=d instanceof String?d.valueOf():d;const v=kt(d);return v==="array"&&!HT(d)&&!WT(d)?[new qe(o,d,`projection expected, invalid array ${JSON.stringify(d)} found`)]:["array","string"].includes(v)?[]:[new qe(o,d,`projection expected, invalid type "${v}" found`)]}function WT(u){return!!["interpolate","step","literal"].includes(u[0])}function HT(u){return Array.isArray(u)&&u.length===3&&typeof u[0]=="string"&&typeof u[1]=="string"&&typeof u[2]=="number"}function kv(u){return!!u&&u.constructor===Object}function Dv(u){return kv(u.value)?[]:[new qe(u.key,u.value,`object expected, ${kt(u.value)} found`)]}function XT(u){const o=u.key,d=u.value,v=u.validateSpec,w=u.styleSpec,M=u.style;if(!kv(d))return[new qe(o,d,`object expected, ${kt(d)} found`)];const b=[];for(const s in d){const D=d[s],N=kt(D);if(N==="string")b.push(...Lo({key:`${o}.${s}`,value:D}));else if(N==="array"){const Z={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[re,pe]of D.entries())b.push(...dn({key:`${o}.${s}[${re}]`,value:pe,valueSpec:Z,styleSpec:w,style:M,validateSpec:v}))}else b.push(new qe(`${o}.${s}`,D,`string or array expected, ${N} found`))}return b}const r0={"*"(){return[]},array:rg,boolean:FT,number:wd,color:Sm,constants:vv,enum:Hu,filter:ig,function:xv,layer:Mv,object:dn,source:Iv,light:Pv,sky:Av,terrain:Ev,projection:qT,projectionDefinition:ZT,string:Lo,formatted:NT,resolvedImage:jT,padding:VT,numberArray:UT,colorArray:$T,variableAnchorOffsetCollection:GT,sprite:Cv,state:Dv,fontFaces:XT};function nd(u){const o=u.value,d=u.valueSpec,v=u.styleSpec;return u.validateSpec=nd,d.expression&&eg(Nr(o))?xv(u):d.expression&&gv(Xs(o))?pc(u):d.type&&r0[d.type]?r0[d.type](u):dn(Yp({},u,{valueSpec:d.type?v[d.type]:d}))}function zv(u){const o=u.value,d=u.key,v=Lo(u);return v.length||(o.indexOf("{fontstack}")===-1&&v.push(new qe(d,o,'"glyphs" url must include a "{fontstack}" token')),o.indexOf("{range}")===-1&&v.push(new qe(d,o,'"glyphs" url must include a "{range}" token'))),v}function fn(u,o=T2){let d=[];return d=d.concat(nd({key:"",value:u,valueSpec:o.$root,styleSpec:o,style:u,validateSpec:nd,objectElementValidators:{glyphs:zv,"*"(){return[]}}})),u.constants&&(d=d.concat(vv({key:"constants",value:u.constants}))),Lv(d)}fn.source=$n(Un(Iv));fn.sprite=$n(Un(Cv));fn.glyphs=$n(Un(zv));fn.light=$n(Un(Pv));fn.sky=$n(Un(Av));fn.terrain=$n(Un(Ev));fn.state=$n(Un(Dv));fn.layer=$n(Un(Mv));fn.filter=$n(Un(ig));fn.paintProperty=$n(Un(Tv));fn.layoutProperty=$n(Un(Sv));function Un(u){return function(o){return u(Object.assign({},o,{validateSpec:nd}))}}function Lv(u){return[].concat(u).sort((o,d)=>o.line-d.line)}function $n(u){return function(...o){return Lv(u.apply(this,o))}}function i0(u){if(!u)return{style:Bu[ko[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0};if(typeof u=="string"){const o=KT(u);return o.isValidStyle?{style:o.styleObject,requiresUrlMonitoring:!1,isFallback:!1}:o.isValidJSON?{style:Bu[ko[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0}:u.startsWith("http")?{style:u,requiresUrlMonitoring:!0,isFallback:!1}:u.toLowerCase().includes(".json")?{style:YT(u),requiresUrlMonitoring:!0,isFallback:!1}:{style:G0(u),requiresUrlMonitoring:!0,isFallback:!1}}return u instanceof q0?{style:u.getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!1}:u instanceof Z0?{style:u.getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!1}:fn(u).length===0?{style:u,requiresUrlMonitoring:!1,isFallback:!1,isJSON:!0}:{style:Bu[ko[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),requiresUrlMonitoring:!1,isFallback:!0}}function YT(u){try{return new URL(u).href}catch{}return new URL(u,location.origin).href}function KT(u){try{const o=JSON.parse(u),d=fn(o);return{isValidJSON:!0,isValidStyle:d.length===0,styleObject:d.length===0?o:null}}catch{return{isValidJSON:!1,isValidStyle:!1,styleObject:null}}}function Va(u,o,d){const v=window.document.createElement(u);return o!==void 0&&(v.className=o),d&&d.appendChild(v),v}function Xu(u){u.parentNode&&u.parentNode.removeChild(u)}class JT{constructor(){it(this,"_map"),it(this,"_container"),it(this,"_terrainButton"),Sw(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(o){return this._map=o,this._container=Va("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Va("button","maplibregl-ctrl-terrain",this._container),Va("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
809ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Xu(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){Rv(this._map),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))}}function Rv(u){u.hasTerrain()?u.disableTerrain():u.enableTerrain()}class QT extends hw{constructor(o={}){super({showCompass:o.showCompass??!0,showZoom:o.showZoom??!0,visualizePitch:o.visualizePitch??!0}),it(this,"_rotateCompassArrow",()=>{const d=this._map.getBearing(),v=this._map.getPitch(),w=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.cos(v*(Math.PI/180))**.5)}) rotateX(${Math.min(70,v)}deg) rotateZ(${-d}deg)`:`rotate(${-d}deg)`;this._compassIcon.style.transform=w}),this._compass&&(this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",d=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:d}):this._map.resetNorth({},{originalEvent:d})}))}_createButton(o,d){const v=super._createButton(o,d);return v.clickFunction=d,v}}const n0=st.Marker,a0=st.LngLat,eS=st.LngLatBounds;class tS extends pw{constructor(){super(...arguments),it(this,"lastUpdatedCenter",new a0(0,0)),it(this,"_updateCamera",o=>{var d;const v=new a0(o.coords.longitude,o.coords.latitude),w=o.coords.accuracy,M={bearing:this._map.getBearing(),...this.options.fitBoundsOptions,linear:!0},b=this._map.getZoom();b>(((d=this.options.fitBoundsOptions)==null?void 0:d.maxZoom)??30)&&(M.zoom=b),this._map.fitBounds(eS.fromLngLat(v,w),M,{geolocateSource:!0});let s=!1;const D=()=>{s=!0};this._map.once("click",D),this._map.once("dblclick",D),this._map.once("dragstart",D),this._map.once("mousedown",D),this._map.once("touchstart",D),this._map.once("wheel",D),this._map.once("moveend",()=>{this._map.off("click",D),this._map.off("dblclick",D),this._map.off("dragstart",D),this._map.off("mousedown",D),this._map.off("touchstart",D),this._map.off("wheel",D),!s&&(this.lastUpdatedCenter=this._map.getCenter())})}),it(this,"_finishSetupUI",o=>{if(this._map){if(o===!1){const d=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d)}else{const d=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Va("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new n0({element:this._dotElement}),this._circleElement=Va("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new n0({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",d=>{const v=d.originalEvent&&d.originalEvent.type==="resize",w=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!d.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!v&&w>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}}),it(this,"_onZoom",()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const o=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],d=this._map.project(o),v=this._map.unproject([d.x,d.y]),w=this._map.unproject([d.x+20,d.y]),M=v.distanceTo(w)/20,b=Math.ceil(2*this._accuracy/M);this._circleElement.style.width=`${b}px`,this._circleElement.style.height=`${b}px`}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
809RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;case"BACKGROUND_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}}var Fs,sn,Bs,Os,Lu;class rS{constructor(o,d,v){if(Gi(this,Fs),Gi(this,sn),Gi(this,Bs),Gi(this,Os),Gi(this,Lu),typeof o=="string"){const w=document.querySelector(o);if(!w)throw new Error(`No element has been found with selector "${o}" when creating an external control.`);un(this,sn,w)}else un(this,sn,o);d&&un(this,Bs,w=>{d(ct(this,Fs),ct(this,sn),w)}),v&&un(this,Os,w=>{v(ct(this,Fs),ct(this,sn),w)}),un(this,Lu,ct(this,sn).parentElement)}onAdd(o){return un(this,Fs,o),ct(this,Bs)&&ct(this,sn).addEventListener("click",ct(this,Bs)),ct(this,Os)&&ct(this,Fs).on("render",ct(this,Os)),Xu(ct(this,sn)),ct(this,sn)}onRemove(){ct(this,Bs)&&ct(this,sn).removeEventListener("click",ct(this,Bs)),ct(this,Os)&&ct(this,Fs).off("render",ct(this,Os)),ct(this,Lu)?ct(this,Lu).appendChild(ct(this,sn)):Xu(ct(this,sn))}}Fs=new WeakMap,sn=new WeakMap,Bs=new WeakMap,Os=new WeakMap,Lu=new WeakMap;class iS{constructor(){it(this,"map"),it(this,"container"),it(this,"projectionButton")}onAdd(o){return this.map=o,this.container=Va("div","maplibregl-ctrl maplibregl-ctrl-group"),this.projectionButton=Va("button","maplibregl-ctrl-projection",this.container),Va("span","maplibregl-ctrl-icon",this.projectionButton).setAttribute("aria-hidden","true"),this.projectionButton.type="button",this.projectionButton.addEventListener("click",this.toggleProjection.bind(this)),o.on("projectiontransition",this.updateProjectionIcon.bind(this)),this.updateProjectionIcon(),this.container}onRemove(){Xu(this.container),this.map.off("projectiontransition",this.updateProjectionIcon),this.map=void 0}toggleProjection(){Fv(this.map),this.updateProjectionIcon()}updateProjectionIcon(){this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"),this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"),this.map.isGlobeProjection()?(this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"),this.projectionButton.title="Enable Mercator projection"):(this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"),this.projectionButton.title="Enable Globe projection")}}function Fv(u){u.getProjection()===void 0&&u.setProjection({type:"mercator"}),u.isGlobeProjection()?u.setProjection("mercator",{persist:!0}):u.setProjection("globe",{persist:!0})}const Ru={"zoom-in":u=>u.zoomIn(),"zoom-out":u=>u.zoomOut(),"toggle-projection":Fv,"toggle-terrain":Rv,"reset-view":u=>{u.getPitch()===0?u.easeTo({pitch:Math.min(u.getMaxPitch(),80)}):u.resetNorthPitch()},"reset-bearing":u=>{u.rotateTo(0)},"reset-pitch":u=>{u.setPitch(0)},"reset-roll":u=>{u.setRoll(0)}};var qp,Fu;class Mm extends rS{constructor(o,d){if(d&&!(d in Ru))throw new Error(`data-maptiler-control value "${d}" is invalid.`);super(o,d&&Ru[d]),Gi(this,qp),Gi(this,Fu,new Map)}onAdd(o){return un(this,qp,o),super.onAdd(o)}onRemove(){for(const[o,d]of ct(this,Fu)){const v=o.deref();v&&v.removeEventListener("click",d)}ct(this,Fu).clear(),super.onRemove()}configureGroupItem(o,d){if(!d)return;if(!(d in Ru))throw new Error(`data-maptiler-control value "${d}" is invalid.`);const v=w=>{Ru[d](ct(this,qp),o,w)};o.addEventListener("click",v),ct(this,Fu).set(new WeakRef(o),v)}}qp=new WeakMap,Fu=new WeakMap,it(Mm,"controlCallbacks",Ru);var cn,oa,Ns,js,bn,Zp,Li,Bv,wn,Ov;class am{constructor(o,d){Gi(this,Li),Gi(this,cn),it(this,"map"),Gi(this,oa),Gi(this,Ns),Gi(this,js),Gi(this,bn,!1),Gi(this,Zp),o.style!==void 0&&un(this,bn,!0),un(this,cn,{zoomAdjust:-4,position:"top-right",...d,forceNoAttributionControl:!0,attributionControl:!1,navigationControl:!1,geolocateControl:!1,maptilerLogo:!1,minimap:!1,hash:!1,pitchAdjust:!1,...o,containerStyle:{border:"1px solid #000",width:"400px",height:"300px",...o.containerStyle??{}}}
809),o.lockZoom!==void 0&&(ct(this,cn).minZoom=o.lockZoom,ct(this,cn).maxZoom=o.lockZoom)}setStyle(o,d){ct(this,bn)||this.map.setStyle(o,d),ln(this,Li,wn).call(this)}addLayer(o,d){return ct(this,bn)||this.map.addLayer(o,d),ln(this,Li,wn).call(this),this.map}moveLayer(o,d){return ct(this,bn)||this.map.moveLayer(o,d),ln(this,Li,wn).call(this),this.map}removeLayer(o){return ct(this,bn)||this.map.removeLayer(o),ln(this,Li,wn).call(this),this}setLayerZoomRange(o,d,v){return ct(this,bn)||this.map.setLayerZoomRange(o,d,v),ln(this,Li,wn).call(this),this}setFilter(o,d,v){return ct(this,bn)||this.map.setFilter(o,d,v),ln(this,Li,wn).call(this),this}setPaintProperty(o,d,v,w){return ct(this,bn)||this.map.setPaintProperty(o,d,v,w),ln(this,Li,wn).call(this),this}setLayoutProperty(o,d,v,w){return ct(this,bn)||this.map.setLayoutProperty(o,d,v,w),ln(this,Li,wn).call(this),this}setGlyphs(o,d){return ct(this,bn)||this.map.setGlyphs(o,d),ln(this,Li,wn).call(this),this}onAdd(o){un(this,oa,o),un(this,Ns,Va("div","maplibregl-ctrl maplibregl-ctrl-group"));for(const[d,v]of Object.entries(ct(this,cn).containerStyle))ct(this,Ns).style.setProperty(d,v);return ct(this,cn).container=ct(this,Ns),ct(this,cn).zoom=o.getZoom()+ct(this,cn).zoomAdjust,this.map=new Vv(ct(this,cn)),this.map.once("style.load",()=>{this.map.resize()}),this.map.once("load",()=>{ln(this,Li,Bv).call(this,ct(this,cn).parentRect),un(this,Zp,ln(this,Li,Ov).call(this))}),ct(this,Ns)}onRemove(){var o;(o=ct(this,Zp))==null||o.call(this),Xu(ct(this,Ns))}}cn=new WeakMap,oa=new WeakMap,Ns=new WeakMap,js=new WeakMap,bn=new WeakMap,Zp=new WeakMap,Li=new WeakSet,Bv=function(u){u===void 0||u.linePaint===void 0&&u.fillPaint===void 0||(un(this,js,{type:"Feature",properties:{name:"parentRect"},geometry:{type:"Polygon",coordinates:[[[],[],[],[],[]]]}}),this.map.addSource("parentRect",{type:"geojson",data:ct(this,js)}),(u.lineLayout!==void 0||u.linePaint!==void 0)&&this.map.addLayer({id:"parentRectOutline",type:"line",source:"parentRect",layout:{...u.lineLayout},paint:{"line-color":"#FFF","line-width":1,"line-opacity":.85,...u.linePaint}}),u.fillPaint!==void 0&&this.map.addLayer({id:"parentRectFill",type:"fill",source:"parentRect",layout:{},paint:{"fill-color":"#08F","fill-opacity":.135,...u.fillPaint}}),ln(this,Li,wn).call(this))},wn=function(){if(ct(this,js)===void 0)return;const{devicePixelRatio:u}=window,o=ct(this,oa).getCanvas(),d=o.width/u,v=o.height/u,w=ct(this,oa).unproject.bind(ct(this,oa)),M=w([0,0]),b=w([d,0]),s=w([0,v]),D=w([d,v]);ct(this,js).geometry.coordinates=[[s.toArray(),D.toArray(),b.toArray(),M.toArray(),s.toArray()]];const N=this.map.getSource("parentRect");N!==void 0&&N.setData(ct(this,js))},Ov=function(){const{pitchAdjust:u}=ct(this,cn),o=()=>{M("parent")},d=()=>{M("minimap")},v=()=>{ct(this,oa).on("move",o),this.map.on("move",d)},w=()=>{ct(this,oa).off("move",o),this.map.off("move",d)},M=b=>{w();const s=b==="parent"?ct(this,oa):this.map,D=b==="parent"?this.map:ct(this,oa),N=s.getCenter(),Z=s.getZoom()+ct(this,cn).zoomAdjust*(b==="parent"?1:-1),re=s.getBearing(),pe=s.getPitch();D.jumpTo({center:N,zoom:Z,bearing:re,pitch:u?pe:0}),ln(this,Li,wn).call(this),v()};return v(),()=>{w()}};class nS{constructor(o,d=2e3){it(this,"map"),it(this,"registeredModules",new Set),it(this,"viewerType"),this.map=o,this.viewerType="Map",setTimeout(async()=>{if(!Or.telemetry)return;const v=this.preparePayload();try{(await fetch(v,{method:"POST"})).ok||console.warn("The metrics could not be sent to MapTiler Cloud")}catch(w){console.warn("The metrics could not be sent to MapTiler Cloud",w)}},Math.max(1e3,d))}registerModule(o,d){this.registeredModules.add(`${o}:${d}`)}registerViewerType(o="Map"){this.viewerType=o}preparePayload(){const o=new URL(Ri.telemetryURL);return o.searchParams.append("sdk",rx()),o.searchParams.append("key",Or.apiKey),o.searchParams.append("mtsid",Fm),o.searchParams.append("session",Or.session?"1":"0"),o.searchParams.append("caching",Or.caching?"1":"0"),o.searchParams.append("lang-updated",this.map.isLanguageUpdated()?"1":"0"),o.searchParams.append("terrain",this.map.getTerrain()?"1":"0"),o.searchParams.append("globe",this.map.isGlobeProjection()?"1":"0"),o.searchParams.append("viewerType",this.viewerType),this.registeredModules.size>0&&o.searchParams.append("modules",Array.from(this.registeredModules).join("|")),o.href}}var Yu=typeof Float32Array<"u"?Float32Array:Array;function ju(){var u=new Yu(16);return Yu!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u}function aS(u,o,d,v,w,M,b,s,D,N,Z,re,pe,ue,ve,me,le){return u[0]=o,u[1]=d,u[2]=v,u[3]=w,u[4]=M,u[5]=b,u[6]=s,u[7]=D,u[8]=N,u[9]=Z,u[10
vendor: 5,432 bytes, line 809
809]=re,u[11]=pe,u[12]=ue,u[13]=ve,u[14]=me,u[15]=le,u}function oS(u,o,d){var v=o[0],w=o[1],M=o[2],b=o[3],s=o[4],D=o[5],N=o[6],Z=o[7],re=o[8],pe=o[9],ue=o[10],ve=o[11],me=o[12],le=o[13],He=o[14],Ne=o[15],$e=d[0],ke=d[1],Me=d[2],Re=d[3];return u[0]=$e*v+ke*s+Me*re+Re*me,u[1]=$e*w+ke*D+Me*pe+Re*le,u[2]=$e*M+ke*N+Me*ue+Re*He,u[3]=$e*b+ke*Z+Me*ve+Re*Ne,$e=d[4],ke=d[5],Me=d[6],Re=d[7],u[4]=$e*v+ke*s+Me*re+Re*me,u[5]=$e*w+ke*D+Me*pe+Re*le,u[6]=$e*M+ke*N+Me*ue+Re*He,u[7]=$e*b+ke*Z+Me*ve+Re*Ne,$e=d[8],ke=d[9],Me=d[10],Re=d[11],u[8]=$e*v+ke*s+Me*re+Re*me,u[9]=$e*w+ke*D+Me*pe+Re*le,u[10]=$e*M+ke*N+Me*ue+Re*He,u[11]=$e*b+ke*Z+Me*ve+Re*Ne,$e=d[12],ke=d[13],Me=d[14],Re=d[15],u[12]=$e*v+ke*s+Me*re+Re*me,u[13]=$e*w+ke*D+Me*pe+Re*le,u[14]=$e*M+ke*N+Me*ue+Re*He,u[15]=$e*b+ke*Z+Me*ve+Re*Ne,u}function sS(u,o,d){var v=d[0],w=d[1],M=d[2];return u[0]=o[0]*v,u[1]=o[1]*v,u[2]=o[2]*v,u[3]=o[3]*v,u[4]=o[4]*w,u[5]=o[5]*w,u[6]=o[6]*w,u[7]=o[7]*w,u[8]=o[8]*M,u[9]=o[9]*M,u[10]=o[10]*M,u[11]=o[11]*M,u[12]=o[12],u[13]=o[13],u[14]=o[14],u[15]=o[15],u}function o0(u,o,d){var v=Math.sin(d),w=Math.cos(d),M=o[4],b=o[5],s=o[6],D=o[7],N=o[8],Z=o[9],re=o[10],pe=o[11];return o!==u&&(u[0]=o[0],u[1]=o[1],u[2]=o[2],u[3]=o[3],u[12]=o[12],u[13]=o[13],u[14]=o[14],u[15]=o[15]),u[4]=M*w+N*v,u[5]=b*w+Z*v,u[6]=s*w+re*v,u[7]=D*w+pe*v,u[8]=N*w-M*v,u[9]=Z*w-b*v,u[10]=re*w-s*v,u[11]=pe*w-D*v,u}function lS(u,o,d){var v=Math.sin(d),w=Math.cos(d),M=o[0],b=o[1],s=o[2],D=o[3],N=o[8],Z=o[9],re=o[10],pe=o[11];return o!==u&&(u[4]=o[4],u[5]=o[5],u[6]=o[6],u[7]=o[7],u[12]=o[12],u[13]=o[13],u[14]=o[14],u[15]=o[15]),u[0]=M*w-N*v,u[1]=b*w-Z*v,u[2]=s*w-re*v,u[3]=D*w-pe*v,u[8]=M*v+N*w,u[9]=b*v+Z*w,u[10]=s*v+re*w,u[11]=D*v+pe*w,u}function s0(u,o,d){var v=Math.sin(d),w=Math.cos(d),M=o[0],b=o[1],s=o[2],D=o[3],N=o[4],Z=o[5],re=o[6],pe=o[7];return o!==u&&(u[8]=o[8],u[9]=o[9],u[10]=o[10],u[11]=o[11],u[12]=o[12],u[13]=o[13],u[14]=o[14],u[15]=o[15]),u[0]=M*w+N*v,u[1]=b*w+Z*v,u[2]=s*w+re*v,u[3]=D*w+pe*v,u[4]=N*w-M*v,u[5]=Z*w-b*v,u[6]=re*w-s*v,u[7]=pe*w-D*v,u}function cS(u,o,d,v,w){var M=1/Math.tan(o/2);if(u[0]=M/d,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=M,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=-1,u[12]=0,u[13]=0,u[15]=0,w!=null&&w!==1/0){var b=1/(v-w);u[10]=(w+v)*b,u[14]=2*w*v*b}else u[10]=-1,u[14]=-2*v;return u}var uS=cS;function Wp(){var u=new Yu(3);return Yu!=Float32Array&&(u[0]=0,u[1]=0,u[2]=0),u}function hS(u,o,d){var v=new Yu(3);return v[0]=u,v[1]=o,v[2]=d,v}function om(u,o){var d=o[0],v=o[1],w=o[2],M=d*d+v*v+w*w;return M>0&&(M=1/Math.sqrt(M)),u[0]=o[0]*M,u[1]=o[1]*M,u[2]=o[2]*M,u}function l0(u,o,d){var v=o[0],w=o[1],M=o[2],b=d[0],s=d[1],D=d[2];return u[0]=w*D-M*s,u[1]=M*b-v*D,u[2]=v*s-w*b,u}(function(){var u=Wp();return function(o,d,v,w,M,b){var s,D;for(d||(d=3),v||(v=0),w?D=Math.min(w*d+v,o.length):D=o.length,s=v;s<D;s+=d)u[0]=o[s],u[1]=o[s+1],u[2]=o[s+2],M(u,u,b),o[s]=u[0],o[s+1]=u[1],o[s+2]=u[2];return o}})();function pS(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var c0,u0;function dS(){return u0||(u0=1,c0={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],ol
vendor: 5,241 bytes, line 809
809ive:[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]}),c0}var sm,h0;function Nv(){if(h0)return sm;h0=1;const u=dS(),o={};for(const w of Object.keys(u))o[u[w]]=w;const d={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};sm=d;for(const w of Object.keys(d)){if(!("channels"in d[w]))throw new Error("missing channels property: "+w);if(!("labels"in d[w]))throw new Error("missing channel labels property: "+w);if(d[w].labels.length!==d[w].channels)throw new Error("channel and label counts mismatch: "+w);const{channels:M,labels:b}=d[w];delete d[w].channels,delete d[w].labels,Object.defineProperty(d[w],"channels",{value:M}),Object.defineProperty(d[w],"labels",{value:b})}d.rgb.hsl=function(w){const M=w[0]/255,b=w[1]/255,s=w[2]/255,D=Math.min(M,b,s),N=Math.max(M,b,s),Z=N-D;let re,pe;N===D?re=0:M===N?re=(b-s)/Z:b===N?re=2+(s-M)/Z:s===N&&(re=4+(M-b)/Z),re=Math.min(re*60,360),re<0&&(re+=360);const ue=(D+N)/2;return N===D?pe=0:ue<=.5?pe=Z/(N+D):pe=Z/(2-N-D),[re,pe*100,ue*100]},d.rgb.hsv=function(w){let M,b,s,D,N;const Z=w[0]/255,re=w[1]/255,pe=w[2]/255,ue=Math.max(Z,re,pe),ve=ue-Math.min(Z,re,pe),me=function(le){return(ue-le)/6/ve+1/2};return ve===0?(D=0,N=0):(N=ve/ue,M=me(Z),b=me(re),s=me(pe),Z===ue?D=s-b:re===ue?D=1/3+M-s:pe===ue&&(D=2/3+b-M),D<0?D+=1:D>1&&(D-=1)),[D*360,N*100,ue*100]},d.rgb.hwb=function(w){const M=w[0],b=w[1];let s=w[2];const D=d.rgb.hsl(w)[0],N=1/255*Math.min(M,Math.min(b,s));return s=1-1/255*Math.max(M,Math.max(b,s)),[D,N*100,s*100]},d.rgb.cmyk=function(w){const M=w[0]/255,b=w[1]/255,s=w[2]/255,D=Math.min(1-M,1-b,1-s),N=(1-M-D)/(1-D)||0,Z=(1-b-D)/(1-D)||0,re=(1-s-D)/(1-D)||0;return[N*100,Z*100,re*100,D*100]};function v(w,M){return(w[0]-M[0])**2+(w[1]-M[1])**2+(w[2]-M[2])**2}return d.rgb.keyword=function(w){const M=o[w];if(M)return M;let b=1/0,s;for(const D of Object.keys(u)){const N=u[D],Z=v(w,N);Z<b&&(b=Z,s=D)}return s},d.keyword.rgb=function(w){return u[w]},d.rgb.xyz=function(w){let M=w[0]/255,b=w[1]/255,s=w[2]/255;M=M>.04045?((M+.055)/1.055)**2.4:M/12.92,b=b>.04045?((b+.055)/1.055)**2.4:b/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;const D=M*.4124+b*.3576+s*.1805,N=M*.2126+b*.7152+s*.0722,Z=M*.0193+b*.1192+s*.9505;return[D*100,N*100,Z*100]},d.rgb.lab=function(w){const M=d.rgb.xyz(w);let b=M[0],s=M[1],D=M[2];b/=95.047,s/=100,D/=108.883,b=b>.008856?b**(1/3):7.787*b+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,D=D>.008856?D**(1/3):7.787*D+16/116;const N=116*s-16,Z=500*(b-s),re=200*(s-D);return[N,Z,re]},d.hsl.rgb=function(w){const M=w[0]/360,b=w[1]/100,s=w[2]/100;let D,N,Z;if(b===0)return Z=s*255,[Z,Z,Z];s<.5?D=s*(1+b):D=s+b-s*b;const re=2*s-D,pe=[0,0,0];for(let ue=0;ue<3;ue++)N=M+1/3*-(ue-1),N<0&&N++,N>1&&N--,6*N<1?Z=re+(D-re)*6*N:2*N<1?Z=D:3*N<2?Z=re+(D-re)*(2/3-N)*6:Z=re,pe[ue]=Z*255;return pe},d.hsl.hsv=function(w){const M=w[0];let b=w[1]/100,s=w[2]/100,D=b;const N=Math.max(s,.01);s*=2,b*=s<=1?s:2-s,D*=N<=1?N:2-N;const Z=(s+b)/2,re=s===0?2*D/(N+D):2*b/(s+b);return[M,re*100,Z*100]},d.hsv.rgb=function(w){const M=w[0]/60,b=w[1]/100;let s=w[2]/100;const D=Math.floor(M)%6,N=M-Math.floor(M),Z=255*s*(1-b),re=255*s*(1-b*N),pe=255*s*(1-b*(1-N));switch(s*=255,D){case 0:return[s,pe,Z];case 1:return[re,s,Z];case 2:return[Z,s,pe];case 3:return[Z,re,s];case 4:return[pe,Z,s];case 5:return[s,Z,re]}},d.hsv.hsl=function(w){const M=w[0],b=w[1]/100,s=w[2]/100,D=Math.max(s,.01);let N,Z;Z=(2-b)*s;const re=(2-b)*D;return N=b*D,N/=re<=1?re:2-re,N=N||0,Z/=2,[M,N*100,Z*100]},d.hwb.rgb=function(w){const M=w[0]/360;let b=w[1]/100,s=w[2]/100;const D=b+s;let N;D>1&&(b/=D,s/=D);const Z=Math.floor(6*M),re=1-s;N=6*M-Z,(Z&1)!==0&&(N=1-N);const pe=b+N*(re-b);let ue,ve,me;switch(Z){default:case 6:case 0:ue=re,ve=pe,me=b;break;case 1:ue=pe,ve=re,me=b;break;case 2:ue=b,ve=re,me=pe;break;case 3:ue=b,ve=pe,me=re;break;case 4:ue=pe,ve=b,me=re;break;case 5:ue=re,ve=b,me=pe;break}return[ue*255,ve*255,me*255]}
vendor: 6,036 bytes, line 809
809,d.cmyk.rgb=function(w){const M=w[0]/100,b=w[1]/100,s=w[2]/100,D=w[3]/100,N=1-Math.min(1,M*(1-D)+D),Z=1-Math.min(1,b*(1-D)+D),re=1-Math.min(1,s*(1-D)+D);return[N*255,Z*255,re*255]},d.xyz.rgb=function(w){const M=w[0]/100,b=w[1]/100,s=w[2]/100;let D,N,Z;return D=M*3.2406+b*-1.5372+s*-.4986,N=M*-.9689+b*1.8758+s*.0415,Z=M*.0557+b*-.204+s*1.057,D=D>.0031308?1.055*D**(1/2.4)-.055:D*12.92,N=N>.0031308?1.055*N**(1/2.4)-.055:N*12.92,Z=Z>.0031308?1.055*Z**(1/2.4)-.055:Z*12.92,D=Math.min(Math.max(0,D),1),N=Math.min(Math.max(0,N),1),Z=Math.min(Math.max(0,Z),1),[D*255,N*255,Z*255]},d.xyz.lab=function(w){let M=w[0],b=w[1],s=w[2];M/=95.047,b/=100,s/=108.883,M=M>.008856?M**(1/3):7.787*M+16/116,b=b>.008856?b**(1/3):7.787*b+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;const D=116*b-16,N=500*(M-b),Z=200*(b-s);return[D,N,Z]},d.lab.xyz=function(w){const M=w[0],b=w[1],s=w[2];let D,N,Z;N=(M+16)/116,D=b/500+N,Z=N-s/200;const re=N**3,pe=D**3,ue=Z**3;return N=re>.008856?re:(N-16/116)/7.787,D=pe>.008856?pe:(D-16/116)/7.787,Z=ue>.008856?ue:(Z-16/116)/7.787,D*=95.047,N*=100,Z*=108.883,[D,N,Z]},d.lab.lch=function(w){const M=w[0],b=w[1],s=w[2];let D;D=Math.atan2(s,b)*360/2/Math.PI,D<0&&(D+=360);const N=Math.sqrt(b*b+s*s);return[M,N,D]},d.lch.lab=function(w){const M=w[0],b=w[1],s=w[2]/360*2*Math.PI,D=b*Math.cos(s),N=b*Math.sin(s);return[M,D,N]},d.rgb.ansi16=function(w,M=null){const[b,s,D]=w;let N=M===null?d.rgb.hsv(w)[2]:M;if(N=Math.round(N/50),N===0)return 30;let Z=30+(Math.round(D/255)<<2|Math.round(s/255)<<1|Math.round(b/255));return N===2&&(Z+=60),Z},d.hsv.ansi16=function(w){return d.rgb.ansi16(d.hsv.rgb(w),w[2])},d.rgb.ansi256=function(w){const M=w[0],b=w[1],s=w[2];return M===b&&b===s?M<8?16:M>248?231:Math.round((M-8)/247*24)+232:16+36*Math.round(M/255*5)+6*Math.round(b/255*5)+Math.round(s/255*5)},d.ansi16.rgb=function(w){let M=w%10;if(M===0||M===7)return w>50&&(M+=3.5),M=M/10.5*255,[M,M,M];const b=(~~(w>50)+1)*.5,s=(M&1)*b*255,D=(M>>1&1)*b*255,N=(M>>2&1)*b*255;return[s,D,N]},d.ansi256.rgb=function(w){if(w>=232){const N=(w-232)*10+8;return[N,N,N]}w-=16;let M;const b=Math.floor(w/36)/5*255,s=Math.floor((M=w%36)/6)/5*255,D=M%6/5*255;return[b,s,D]},d.rgb.hex=function(w){const M=(((Math.round(w[0])&255)<<16)+((Math.round(w[1])&255)<<8)+(Math.round(w[2])&255)).toString(16).toUpperCase();return"000000".substring(M.length)+M},d.hex.rgb=function(w){const M=w.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!M)return[0,0,0];let b=M[0];M[0].length===3&&(b=b.split("").map(re=>re+re).join(""));const s=parseInt(b,16),D=s>>16&255,N=s>>8&255,Z=s&255;return[D,N,Z]},d.rgb.hcg=function(w){const M=w[0]/255,b=w[1]/255,s=w[2]/255,D=Math.max(Math.max(M,b),s),N=Math.min(Math.min(M,b),s),Z=D-N;let re,pe;return Z<1?re=N/(1-Z):re=0,Z<=0?pe=0:D===M?pe=(b-s)/Z%6:D===b?pe=2+(s-M)/Z:pe=4+(M-b)/Z,pe/=6,pe%=1,[pe*360,Z*100,re*100]},d.hsl.hcg=function(w){const M=w[1]/100,b=w[2]/100,s=b<.5?2*M*b:2*M*(1-b);let D=0;return s<1&&(D=(b-.5*s)/(1-s)),[w[0],s*100,D*100]},d.hsv.hcg=function(w){const M=w[1]/100,b=w[2]/100,s=M*b;let D=0;return s<1&&(D=(b-s)/(1-s)),[w[0],s*100,D*100]},d.hcg.rgb=function(w){const M=w[0]/360,b=w[1]/100,s=w[2]/100;if(b===0)return[s*255,s*255,s*255];const D=[0,0,0],N=M%1*6,Z=N%1,re=1-Z;let pe=0;switch(Math.floor(N)){case 0:D[0]=1,D[1]=Z,D[2]=0;break;case 1:D[0]=re,D[1]=1,D[2]=0;break;case 2:D[0]=0,D[1]=1,D[2]=Z;break;case 3:D[0]=0,D[1]=re,D[2]=1;break;case 4:D[0]=Z,D[1]=0,D[2]=1;break;default:D[0]=1,D[1]=0,D[2]=re}return pe=(1-b)*s,[(b*D[0]+pe)*255,(b*D[1]+pe)*255,(b*D[2]+pe)*255]},d.hcg.hsv=function(w){const M=w[1]/100,b=w[2]/100,s=M+b*(1-M);let D=0;return s>0&&(D=M/s),[w[0],D*100,s*100]},d.hcg.hsl=function(w){const M=w[1]/100,b=w[2]/100*(1-M)+.5*M;let s=0;return b>0&&b<.5?s=M/(2*b):b>=.5&&b<1&&(s=M/(2*(1-b))),[w[0],s*100,b*100]},d.hcg.hwb=function(w){const M=w[1]/100,b=w[2]/100,s=M+b*(1-M);return[w[0],(s-M)*100,(1-s)*100]},d.hwb.hcg=function(w){const M=w[1]/100,b=1-w[2]/100,s=b-M;let D=0;return s<1&&(D=(b-s)/(1-s)),[w[0],s*100,D*100]},d.apple.rgb=function(w){return[w[0]/65535*255,w[1]/65535*255,w[2]/65535*255]},d.rgb.apple=function(w){return[w[0]/255*65535,w[1]/255*65535,w[2]/255*65535]},d.gray.rgb=function(w){return[w[0]/100*255,w[0]/100*255,w[0]/100*255]},d.gray.hsl=function(w){return[0,0,w[0]]},d.gray.hsv=d.gray.hsl,d.gray.hwb=function(w){return[0,100,w[0]]},d.gray.cmyk=function(w){return[0,0,0,w[0]]},d.gray.lab=function(w){return[w[0],0,0]},d.gray.hex=function(w){const M=Math.round(w[0]/100*255)&255,b=((M<<16)+(M<<8)+M).toString(16).toUpperCase();return"000000".substring(b.length)+b},d.rgb.gray=function(w){return[(w[0]+w[1]+w[2])/3/255*100]},sm}var lm,p0;function fS(){if(p0)return lm;p0=1;const u=Nv();function o(){const M={},b=Object.keys(u);for(let s=b.length,D=0;D<s;D++)M[b[D]]={distance:-1,parent:null};return M}function d(M){const b=o(),s=[M];for(b[M].distance=0;s.length;){const D=s.pop(),N=Object.keys(u[D]);for(let Z=N.length,re=0;re<Z;re++){const pe=N[re],ue=b[pe];ue.distance===-1&&(ue.distance=b[D].distance+1,ue.parent=D,s.unshift(pe))}}return b}function v(M,b){return function(s){return b(M(s))}}function w(M,b){const s=[b[M].parent,M];let D=u[b[M].parent][M],N=b[M].parent;for(;b[N].parent;)s.unshift(b[N].parent),D=v(u[b[N].parent][N],D),N=b[N].parent;return D.conversion=s,D}return lm=function(M){const b=d(M),s={},D=Object.keys(b);for(let N=D.length,Z=0;Z<N;Z++){const re=D[Z];b[re].parent!==null&&(s[re]=w(re,b))}return s},lm}var cm,d0;function mS(){if(d0)return cm;d0=1;const u=Nv(),o=fS(),d={},v=Object.keys(u);function w(b){const s=function(...D){const N=D[0];return N==null?N:(N.length>1&&(D=N),b(D))};return"conversion"in b&&(s.conversion=b.conversion),s}function M(b){const s=function(...D){const N=D[0];if(N==null)return N;N.length>1&&(D=N);const Z=b(D);if(typeof Z=="object")for(let re=Z.length,pe=0;pe<re;pe++)Z[pe]=Math.round(Z[pe]);return Z};return"conversion"in b&&(s.conversion=b.conversion),s}return v.forEach(b=>{d[b]={},Object.defineProperty(d[b],"channels",{value:u[b].channels}),Object.defineProperty(d[b],"labels",{value:u[b].labels});const s=o(b);
809Object.keys(s).forEach(D=>{const N=s[D];d[b][D]=M(N),d[b][D].raw=w(N)})}),cm=d,cm}var gS=mS();const yS=pS(gS);function f0({gl:u,type:o,source:d}){const v=u.createShader(o);if(v===null)throw new Error("Cannot create shader");if(u.shaderSource(v,d),u.compileShader(v),!u.getShaderParameter(v,u.COMPILE_STATUS))throw console.error("Shader compilation error:",u.getShaderInfoLog(v)),u.deleteShader(v),new Error("Cannot compile shader");return v}function _S({gl:u,vertexShaderSource:o,fragmentShaderSource:d}){const v=f0({gl:u,type:u.VERTEX_SHADER,source:o}),w=f0({gl:u,type:u.FRAGMENT_SHADER,source:d}),M=u.createProgram();if(u.attachShader(M,v),u.attachShader(M,w),u.linkProgram(M),!u.getProgramParameter(M,u.LINK_STATUS))throw console.error("Error: ",u.getProgramInfoLog(M)),new Error("Cannot link shader program");return M}function vS(u,o,d){const v=u.getUniformLocation(o,d);if(v===null)throw new Error(`Cannot get uniform location for ${d}`);return v}function jv({gl:u,vertexShaderSource:o,fragmentShaderSource:d,attributesKeys:v,uniformsKeys:w,vertices:M,indices:b}){const s=_S({gl:u,vertexShaderSource:o,fragmentShaderSource:d}),D=v.reduce((ue,ve)=>(ue[ve]=u.getAttribLocation(s,`a_${ve}`),ue),{}),N=w.reduce((ue,ve)=>(ue[ve]=vS(u,s,`u_${ve}`),ue),{}),Z=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,Z),u.bufferData(u.ARRAY_BUFFER,new Float32Array(M),u.STATIC_DRAW);let re,pe;return b!==void 0&&(re=u.createBuffer(),pe=b.length,u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,re),u.bufferData(u.ELEMENT_ARRAY_BUFFER,new Uint16Array(b),u.STATIC_DRAW)),{shaderProgram:s,programInfo:{attributesLocations:D,uniformsLocations:N},positionBuffer:Z,indexBuffer:re,indexBufferLength:pe}}function Hp(u){if(!u)return[1,1,1,0];if(u==="transparent")return[1,1,1,0];try{const o=xS(u),d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(o);if(d!=null&&d.length){const w=!!d[4];return[...yS.hex.rgb(o).map(M=>M/255),w?parseInt(d[4],16)/255:1]}const v=o.match(/(\d\.\d(\d+)?|\d{3}|\d{2}|\d{1})/gi)??["0","0","0"];if(o.includes("rgb")){const w=o.includes("rgba"),M=[...v.map(b=>parseFloat(b)).map((b,s)=>s<3?b/255:b)];return w||M.push(1),M}}catch{}return console.warn([`[parseColorStringToVec4]: Color ${u} is either not a valid color or its type is not supported, defaulting to black`]),[0,0,0,1]}let ku;function xS(u){return ku=ku??document.createElement("canvas").getContext("2d"),ku?(ku.fillStyle=u,ku.fillStyle):"#000000"}const ng=1,Pr=ng/2,Ar=ng/2,Er=ng/2,bS=[-Pr,-Ar,Er,Pr,-Ar,Er,Pr,Ar,Er,-Pr,Ar,Er],wS=[-Pr,-Ar,-Er,-Pr,Ar,-Er,Pr,Ar,-Er,Pr,-Ar,-Er],TS=[-Pr,Ar,-Er,-Pr,Ar,Er,Pr,Ar,Er,Pr,Ar,-Er],SS=[-Pr,-Ar,-Er,Pr,-Ar,-Er,Pr,-Ar,Er,-Pr,-Ar,Er],MS=[Pr,-Ar,-Er,Pr,Ar,-Er,Pr,Ar,Er,Pr,-Ar,Er],IS=[-Pr,-Ar,-Er,-Pr,-Ar,Er,-Pr,Ar,Er,-Pr,Ar,-Er],PS=[...bS,...wS,...TS,...SS,...MS,...IS],AS=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],ES=`attribute vec3 a_vertexPosition; 810varying vec3 vTextureCoord; 811 812uniform mat4 u_projectionMatrix; 813uniform mat4 u_modelViewMatrix; 814 815void main(void) { 816 vTextureCoord = vec3(-a_vertexPosition.x, a_vertexPosition.y, a_vertexPosition.z); 817 gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_vertexPosition, 1.0
817); 818} 819`,m0=`precision mediump float; 820 821varying vec3 vTextureCoord; 822 823%USE_TEXTURE_MACRO_MARKER% 824 825# ifdef USE_TEXTURE 826uniform samplerCube u_cubeSampler; 827uniform float u_fadeOpacity; 828# endif 829 830uniform vec4 u_bgColor; 831 832void main(void) { 833 #ifdef USE_TEXTURE 834 vec4 texColor = textureCube(u_cubeSampler, vTextureCoord); 835 836 gl_FragColor = mix( 837 u_bgColor, 838 texColor, 839 min(texColor.a, u_fadeOpacity) 840 ); 841 842 gl_FragColor.a = max(gl_FragColor.a, u_fadeOpacity); 843 844 #else 845 gl_FragColor = u_bgColor; 846 #endif 847} 848`,Do={stars:{color:"hsl(233,100%,92%)",preset:"stars"},space:{color:"hsl(210, 100%, 4%)",preset:"space"},milkyway:{color:"hsl(233,100%,92%)",preset:"milkyway"},"milkyway-subtle":{color:"hsl(233,100%,92%)",preset:"milkyway-subtle"},"milkyway-bright":{color:"hsl(233,100%,92%)",preset:"milkyway-bright"},"milkyway-colored":{color:"black",preset:"milkyway-colored"}};var Vs=(u=>(u.POSITIVE_X="pX",u.NEGATIVE_X="nX",u.POSITIVE_Y="pY",u.NEGATIVE_Y="nY",u.POSITIVE_Z="pZ",u.NEGATIVE_Z="nZ",u))(Vs||{});const oc=new Map;function CS(u){const o=oc.get(u);o&&(oc.delete(u),u.deleteTexture(o))}const g0=new Map;let y0;function kS({gl:u,faces:o,onReady:d,forceRefresh:v}){if(oc.get(u)&&!v&&y0===JSON.stringify(o)){d(oc.get(u),g0.get(u));return}y0=JSON.stringify(o);const w=oc.get(u)??u.createTexture();if(u.bindTexture(u.TEXTURE_CUBE_MAP,w),!o){console.warn("[CubemapLayer][loadCubemapTexture]: Faces are null");return}const M=Object.keys(o).length;if(M!==6){console.warn(`[CubemapLayer][loadCubemapTexture]: Faces should contain exactly 6 images, but found ${M}`);return}const b=Object.entries(o).map(([s,D])=>new Promise((N,Z)=>{const re=s;if(D===void 0){Z(new Error(`[CubemapLayer][loadCubemapTexture]: Face ${s} is undefined`));return}const pe=new Image;pe.crossOrigin="anonymous";const ue=()=>{N({image:pe,key:re})};pe.src=D,pe.complete&&pe.naturalWidth>0?ue():pe.onload=ue,pe.onerror=()=>{Z(new Error(`[CubemapLayer][loadCubemapTexture]: Error loading image ${D}`))}}));Promise.all(b).then(s=>{for(let N=0;N<s.length;N++){const Z=u.RGBA,re=u.RGBA,pe=u.UNSIGNED_BYTE,{image:ue,key:ve}=s[N]??{};if(!ue||!ve){console.warn("[CubemapLayer][loadCubemapTexture]: Image or key is null");continue}const me=DS(u,ve);u.bindTexture(u.TEXTURE_CUBE_MAP,w),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(me,0,Z,re,pe,ue)}u.bindTexture(u.TEXTURE_CUBE_MAP,w),u.generateMipmap(u.TEXTURE_CUBE_MAP),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,u.LINEAR_MIPMAP_LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,u.LINEAR);const D=s.map(N=>N.image);d(w,D),g0.set(u,D),oc.set(u,w)}).catch(s=>{console.error("[CubemapLayer][loadCubemapTexture]: Error loading cubemap texture",s)})}function DS(u,o){if(o===Vs.POSITIVE_X)return u.TEXTURE_CUBE_MAP_POSITIVE_X;if(o===Vs.NEGATIVE_X)return u.TEXTURE_CUBE_MAP_NEGATIVE_X;if(o===Vs.POSITIVE_Y)return u.TEXTURE_CUBE_MAP_POSITIVE_Y;if(o===Vs.NEGATIVE_Y)return u.TEXTURE_CUBE_MAP_NEGATIVE_Y;if(o===Vs.POSITIVE_Z)return u.TEXTURE_CUBE_MAP_POSITIVE_Z;if(o===Vs.NEGATIVE_Z)return u.TEXTURE_CUBE_MAP_NEGATIVE_Z;throw new Error(`[CubemapLayer][loadCubemapTexture]: Invalid key ${o}`)}function zS(u,o,d){return[Co(u[0],o[0],d),Co(u[1],o[1],d),Co(u[2],o[2],d),Co(u[3],o[3],d)]}function Co(u,o,d){return u+(o-u)*d}function ad(u){if(!u)return{};const o=Object.keys(u).sort().map(d=>[d,u[d]]);return Object.fromEntries(o)}const ic="https://api.maptiler.com/resources/space",LS=["vertexPosition"],RS=["projectionMatrix","modelViewMatrix","cubeSampler","bgColor","fadeOpacity"],_0="%USE_TEXTURE_MACRO_MARKER%",FS="#define USE_TEXTURE",v0=Do.stars;function BS(u,o){if(!Im(u))return{color:"transparent"};if(u===!0)return o;const d={...u};if(u.faces||u.path)return delete d.preset,d;const v=u.preset;if(v!==void 0&&!(v in Do))throw new Error(`[CubemapLayer]: Invalid preset "${v}". Available presets: ${Object.keys(Do).join(", ")}`);return{...d,color:d.color??Do[v].color??"hsl(233,100%,92%)"}}class Bp{constructor(o){it(this,"id","Cubemap Layer"),it(this,"type","custom"),it(this,"renderingMode","3d"),it(this,"map"),it(this,"faces"),it(this,"useCubemapTexture",!0),it(this,"currentFadeOpacity",0),it(this,"cubeMapNeedsUpdate",!1),it(this,"bgColor"),it(this,"previousBgColor",[0,0,0,0]),it(this,"targetBgColor",[0,0,0,0]),it(this,"transitionDelta",0),it
848(this,"gl"),it(this,"cubemap"),it(this,"texture"),it(this,"currentFacesDefinitionKey",""),it(this,"options"),it(this,"animationActive",!0),it(this,"imageIsAnimating",!1),it(this,"imageFadeInDelta",0);const d=Im(o);if(d.length>0)throw new Error(`[CubemapLayer]: Invalid cubemap specification: 849- ${d.join(` 850 - `)}`);const v=BS(o,v0);this.options=v,this.currentFacesDefinitionKey=JSON.stringify(v.faces??v.preset??v.path),this.bgColor=[0,0,0,0],this.targetBgColor=Hp(v.color),this.faces=x0(v),this.useCubemapTexture=this.faces!==null}updateCubemap({facesNeedUpdate:o}={facesNeedUpdate:!0}){this.useCubemapTexture=this.faces!==null;const d=RS.filter(v=>v==="cubeSampler"||v==="fadeOpacity"?this.useCubemapTexture:!0);this.cubemap=jv({gl:this.gl,vertexShaderSource:ES,fragmentShaderSource:this.useCubemapTexture?m0.replace(_0,FS):m0.replace(_0,""),attributesKeys:LS,uniformsKeys:d,vertices:PS,indices:AS}),this.cubeMapNeedsUpdate=o,this.useCubemapTexture&&this.updateTexture(this.gl,this.faces),this.animateColorChange()}onAdd(o,d){this.map=o,this.gl=d,this.updateCubemap()}onRemove(o,d){this.cubemap&&(this.texture&&(CS(d),this.texture=void 0),d.deleteProgram(this.cubemap.shaderProgram),d.deleteBuffer(this.cubemap.positionBuffer))}updateTexture(o,d){if(this.cubeMapNeedsUpdate===!0&&!this.imageIsAnimating){if(this.cubeMapNeedsUpdate=!1,!this.useCubemapTexture)return;kS({gl:o,faces:d,onReady:v=>{this.texture=v,this.animateIn()}})}}prerender(o,d){this.faces&&this.updateTexture(this.gl,this.faces)}animateColorChange(){const o=()=>{this.transitionDelta<1&&(requestAnimationFrame(o),this.bgColor=zS(this.previousBgColor,this.targetBgColor,this.transitionDelta),this.transitionDelta+=.075,this.map.triggerRepaint())};requestAnimationFrame(o)}async animateIn(){if(!this.imageIsAnimating){if(!this.animationActive){this.currentFadeOpacity=1,this.imageFadeInDelta=1,this.map.triggerRepaint();return}return new Promise(o=>{this.imageIsAnimating=!0;const d=()=>{if(this.imageFadeInDelta=Math.min(this.imageFadeInDelta+.05,1),this.currentFadeOpacity=Co(0,1,this.imageFadeInDelta),this.map.triggerRepaint(),this.imageFadeInDelta<1){requestAnimationFrame(d);return}this.imageIsAnimating=!1,this.imageFadeInDelta=0,o()};requestAnimationFrame(d)})}}async animateOut(){if(!(this.imageIsAnimating||!this.animationActive))return new Promise(o=>{const d=()=>{if(this.imageFadeInDelta=Math.min(this.imageFadeInDelta+.05,1),this.currentFadeOpacity=Co(1,0,this.imageFadeInDelta),this.map.triggerRepaint(),this.imageFadeInDelta>=1){this.imageIsAnimating=!1,this.imageFadeInDelta=0,o();return}requestAnimationFrame(d)};requestAnimationFrame(d)})}setAnimationActive(o){this.animationActive=o}render(o,d){if(!this.map.isGlobeProjection())return;if(this.map===void 0)throw new Error("[CubemapLayer]: Map is undefined");if(this.cubemap===void 0)throw new Error("[CubemapLayer]: Cubemap is undefined");this.texture,o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.DST_ALPHA),o.useProgram(this.cubemap.shaderProgram),o.bindBuffer(o.ARRAY_BUFFER,this.cubemap.positionBuffer),o.vertexAttribPointer(this.cubemap.programInfo.attributesLocations.vertexPosition,3,o.FLOAT,!1,0,0),o.enableVertexAttribArray(this.cubemap.programInfo.attributesLocations.vertexPosition);const v=.1,w=1e4,M=o.canvas,b=M.clientWidth/M.clientHeight,s=this.map.transform,D=s.fov*(Math.PI/180),N=ju();uS(N,D,b,v,w),s0(N,N,s.rollInRadians),o0(N,N,-s.pitchInRadians),s0(N,N,s.bearingInRadians);const Z=s.center.lat*Math.PI/180,re=s.center.lng*Math.PI/180;o0(N,N,Z),lS(N,N,-re),o.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.projectionMatrix,!1,N);const pe=ju();if(o.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix,!1,pe),o.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor,new Float32Array(this.bgColor)),o.uniform1f(this.cubemap.programInfo.uniformsLocations.fadeOpacity,this.currentFadeOpacity),this.useCubemapTexture&&this.texture&&(o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_CUBE_MAP,this.texture),o.uniform1i(this.cubemap.programInfo.uniformsLocations.cubeSampler,0)),this.cubemap.indexBuffer===void 0)throw new Error("Index buffer is undefined");if(this.cubemap.indexBufferLength===void 0)throw new Error("Index buffer length is undefined");o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,this.cubemap.indexBuffer),o.drawElements(o.TRIANGLES,this.cubemap.indexBufferLength,o.UNSIGNED_SHORT,0)}setBgColor(o){this.targetBgColor=o,this.previousBgColor=this.bgColor,this.transitionDelta=0}getConfig(){return this.options}shouldUpdate(o){const d=this.getConfig();if(o===void 0&&d)return!0;const v=typeof o=="boolean"?o:ad(o),w=ad(d);return JSON.stringify(v)!==JSON.stringify(w)}async setCubemapFaces(o){if(await this.animateOut(),!o.faces&&!o.preset&&!o.path){this.faces=null,this.useCubemapTexture=!1,this.currentFacesDefinitionKey="empty",await this.animateIn();return}this.faces=x0(o),this.currentFacesDefinitionKey=JSON.stringify(o.faces??o.preset??o.path)}async setCubemap(o){const d=Im(o);if(d.length>0)throw new Error(`[CubemapLayer]: Invalid cubemap specification: 851- ${d.join(` 852 - `)}`);const v=typeof o=="boolean"?v0:o;this.options=v;const w=JSON.stringify(v.faces??v.preset??v.path),M=this.currentFacesDefinitionKey!==w;M&&(await this.setCubemapFaces(v),this.cubeMapNeedsUpdate=!0);const b=Hp(v.color);if(v.color&&this.targetBgColor.toString()!==b.toString())this.setBgColor(b);else if(!v.color&&v.preset&&v.preset in Do){const s=Do[v.preset];this.setBgColor(Hp(s.color))}this.updateCubemap({facesNeedUpdate:M})}
852show(){this.map.setLayoutProperty(this.id,"visibility","visible")}hide(){this.map.setLayoutProperty(this.id,"visibility","none")}}function Im(u){const o=[];if(typeof u>"u")return o.push("Space specification is undefined."),o;if(typeof u=="boolean")return[];if(Object.keys(u).length===0)return o.push("Space specification is an empty object."),o;const d=["color","preset","path","faces"],v=Object.keys(u).filter(M=>!d.includes(M));if(v.length>0)return o.push(`Space specification contains unsupported properties: ${v.map(M=>`\`${M}\``).join(", ")}. Supported properties: \`color\`, \`preset\`, \`path\`, \`faces\`.`),o;if(!u.path&&!u.preset&&!u.faces&&!u.color)return o.push("Space specification contains neither a path, preset, faces, nor color."),o;u.preset&&!(u.preset in Do)&&o.push(`Space preset "${u.preset}" is not a valid preset. Available presets: ${Object.keys(Do).join(", ")}`);const w=Object.keys(u).filter(M=>M!=="color").filter(M=>M==="preset"||M==="path"||M==="faces");return w.length>1&&o.push(`Space specification contains multiple properties for cubemap definition: ${w.join(", ")}. Only one of \`path\`, \`preset\`, or \`faces\` should be defined.`),u.faces&&(!u.faces.pX||!u.faces.nX||!u.faces.pY||!u.faces.nY||!u.faces.pZ||!u.faces.nZ)&&o.push("Space specification contains faces but one or more of the faces are undefined."),u.faces&&Object.values(u.faces).every(M=>typeof M!="string")&&o.push("Space specification contains faces but one or more of the faces are not strings."),o}function x0(u){if(u.faces)return u.faces;if(u.preset)return{pX:`${ic}/${u.preset}/px.webp`,nX:`${ic}/${u.preset}/nx.webp`,pY:`${ic}/${u.preset}/py.webp`,nY:`${ic}/${u.preset}/ny.webp`,pZ:`${ic}/${u.preset}/pz.webp`,nZ:`${ic}/${u.preset}/nz.webp`};if(u.path){const o=u.path.baseUrl,d=u.path.format??"png";return{pX:`${o}/px.${d}`,nX:`${o}/nx.${d}`,pY:`${o}/py.${d}`,nY:`${o}/ny.${d}`,pZ:`${o}/pz.${d}`,nZ:`${o}/nz.${d}`}}return null}const OS=`attribute vec3 a_position; 853 854uniform mat4 u_matrix; 855uniform mat4 u_rotationMatrix; 856 857uniform float u_scale; 858 859varying vec2 v_pos; 860varying float v_scale; 861 862void main() { 863 v_scale = u_scale; 864 v_pos = a_position.xy * u_scale; 865 gl_Position = u_matrix * u_rotationMatrix * vec4(a_position, 1.0); 866} 867`,NS=`precision mediump float; 868varying vec2 v_pos; 869 870uniform int u_stopsNumber; 871uniform float u_stops[100]; 872uniform vec4 u_colors[100]; 873uniform float u_maxDistance; 874 875varying float v_scale; 876 877const float EPSILON = 0.000001; 878 879vec2 center = vec2(0.0, 0.0); 880void main() { 881 float rawDistance = distance(center, v_pos); 882 float distanceFromGlobeEdge = rawDistance - 1.0; 883 884 vec4 color = u_colors[0]; 885 886 // if we're further than the max distance, we should not render anything. 887 // This is to always render a circle, otherwise we end up rendering 888 // to the corners of the plane. 889 if (distance(center, v_pos) > u_maxDistance * v_scale) { 890 discard; 891 } 892 893 for (int i = 1; i < 100; i++) { 894 // if we're past the last stop 895 // we should fill to the end with the last stop color 896 if (i >= u_stopsNumber) { 897 color = u_colors[i - 1]; 898 break; 899 } 900 901 float scaledStopPosition = u_stops[i] * pow(v_scale, 1.6); 902 float lastStopValue = u_stops[i - 1]; 903 float thisStopValue = u_stops[i]; 904 905 // this is to avoid blending errors when the stops are the same 906 // eg when you would want a sharp edge between two stops. 907 // \`numbersAreEqual\` will be 1.0 if the numbers are equal, 0.0 if they are not. 908 // We then subtract EPSILON from the last stop making the stop value _almost_ equal 909 // to the next stop but not enough to cause blending issues. 910 // It's more efficient to do this than an if / else statement. 911 float numbersAreEqual = 1.0 - step(EPSILON, abs(lastStopValue - thisStopValue)); 912 lastStopValue = lastStopValue - numbersAreEqual * EPSILON; 913 914 float lastScaledStopPosition = lastStopValue * pow(v_scale, 1.6); 915 916 if (distanceFromGlobeEdge <= scaledStopPosition) { 917 float stopBlendFactor = (distanceFromGlobeEdge - lastScaledStopPosition) / (scaledStopPosition - lastScaledStopPosition); 918 color = mix(u_colors[i - 1], u_colors[i], stopBlendFactor); 919 break; 920 } 921 } 922 923 // gl_FragColor = color;
924 gl_FragColor = vec4(color.rgb * color.a, color.a); 925} 926`,Na=2,jS=["position"],VS=["matrix","rotationMatrix","stopsNumber","stops","colors","maxDistance","scale"],US=[-Na,-Na,0,Na,-Na,0,-Na,Na,0,Na,Na,0],Op=[[0,"rgba(176, 208, 240, 1)"],[.1,"rgba(98, 168, 229, 0.3)"],[.2,"rgba(98, 168, 229, 0.0)"]],Np=.9,b0=.06;class jp{constructor(o){if(it(this,"id","Halo Layer"),it(this,"type","custom"),it(this,"renderingMode","3d"),it(this,"gradient"),it(this,"scale",0),it(this,"animationDelta",0),it(this,"map"),it(this,"plane"),it(this,"animationActive",!0),typeof o=="boolean"){this.gradient={scale:Np,stops:Op};return}const d=w0(o);if(d.length>0)throw new Error(`[RadialGradientLayer]: Invalid Halo specification: 927 - ${d.join(` 928 - `)} 929 `);this.gradient={scale:o.scale??Np,stops:o.stops??Op}}onAdd(o,d){this.map=o,this.plane=jv({gl:d,vertexShaderSource:OS,fragmentShaderSource:NS,attributesKeys:jS,uniformsKeys:VS,vertices:US}),this.animateIn()}getConfig(){return this.gradient}shouldUpdate(o){const d=this.getConfig();if(o===void 0&&d)return!0;const v=typeof o=="boolean"?o:ad(o),w=ad(d);return JSON.stringify(v)!==JSON.stringify(w)}async animateIn(){if(!this.animationActive){this.scale=this.gradient.scale,this.animationDelta=1,this.map.triggerRepaint();return}return new Promise(o=>{this.animationDelta=0;const d=()=>{if(this.animationDelta<=1){this.scale=Co(0,this.gradient.scale,this.animationDelta),this.animationDelta+=b0,this.map.triggerRepaint(),requestAnimationFrame(d);return}o()};requestAnimationFrame(d)})}async animateOut(){if(this.animationActive)return this.animationDelta=0,new Promise(o=>{const d=()=>{if(this.animationDelta<1){this.scale=Co(this.gradient.scale,0,this.animationDelta),this.animationDelta+=b0,this.map.triggerRepaint(),requestAnimationFrame(d);return}o()};d()})}onRemove(o,d){this.plane!==void 0&&(d.deleteProgram(this.plane.shaderProgram),d.deleteBuffer(this.plane.positionBuffer))}prerender(o,d){}render(o,d){if(this.map===void 0)throw new Error("[RadialGradientLayer]: Map is undefined");if(!this.map.isGlobeProjection())return;if(this.plane===void 0)throw new Error("[RadialGradientLayer]: Plane is undefined");o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.useProgram(this.plane.shaderProgram),o.bindBuffer(o.ARRAY_BUFFER,this.plane.positionBuffer);const v=this.plane.programInfo.attributesLocations.position;o.enableVertexAttribArray(v),o.vertexAttribPointer(v,3,o.FLOAT,!1,0,0);const w=ju(),M=this.scale;sS(w,w,[M,M,M]);const b=ju();oS(b,d.defaultProjectionData.mainMatrix,w);const s=this.plane.programInfo.uniformsLocations.matrix;o.uniformMatrix4fv(s,!1,b);const D=ju(),N=this.map.transform.cameraPosition,Z=om(Wp(),N),re=hS(0,1,0),pe=Wp();l0(pe,re,Z),om(pe,pe);const ue=Wp();l0(ue,Z,pe),om(ue,ue),aS(D,pe[0],pe[1],pe[2],0,ue[0],ue[1],ue[2],0,Z[0],Z[1],Z[2],0,0,0,0,1);const ve=this.plane.programInfo.uniformsLocations.rotationMatrix;o.uniformMatrix4fv(ve,!1,D);const me=this.gradient.stops.length,le=[],He=[];for(let Ne=0;Ne<=me;Ne++)if(Ne<me){le[Ne]=this.gradient.stops[Ne][0];const $e=Hp(this.gradient.stops[Ne][1]);He.push(...$e)}o.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber,me),o.uniform1fv(this.plane.programInfo.uniformsLocations.stops,new Float32Array(le)),o.uniform4fv(this.plane.programInfo.uniformsLocations.colors,new Float32Array(He)),o.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance,Na),o.uniform1f(this.plane.programInfo.uniformsLocations.scale,M),o.drawArrays(o.TRIANGLE_STRIP,0,4)}async setGradient(o){if(o===!1){await this.animateOut();return}await this.animateOut();const d=w0(o);if(d.length>0)throw new Error(`[RadialGradientLayer]: Invalid Halo specification: 930 - ${d.join(` 931 - `)} 932 `);o===!0?(this.gradient.scale=Np,this.gradient.stops=Op):(this.gradient.scale=o.scale??Np,this.gradient.stops=o.stops??Op),await this.animateIn()}setAnimationActive(o){this.animationActive=o}show(){this.map.setLayoutProperty(this.id,"visibility","visible")}hide(){this.map.setLayoutProperty(this.id,"visibility","none")}}const $S=["scale","stops"];function w0(u){var o;const d=[];if(typeof u=="boolean")return[];try{const v=Object.keys(u).filter(w=>!$S.includes(w));v.length>0&&d.push(`Properties ${v.map(w=>`\`${w}\``).join(", ")} are not supported.`)}catch{d.push("Halo specification is not an object.")}return typeof u.scale!="number"&&d.push("Halo `scale` property is not a number."),!u.stops||u.stops.length===0||!Array.isArray(u.stops)?(d.push("Halo `stops` property is not an array."),d):((o=u.stops)!=null&&o.some(v=>
932typeof v[0]!="number"||typeof v[1]!="string")&&d.push("Halo `stops` property is not an array of [number, string]"),d)}function GS(){const u="color: #3A1888; background: white; padding: 5px 0; font-weight: bold;",o="color: #FBC935; background: white; padding: 5px; font-weight: bold;",d="color: #F1175D; background: white; padding: 5px 0; font-weight: bold;";console.info(`%câ%câ%câ %cMapTiler SDK JS v${rx()} %câ%câ%câ`,o+"padding-right: 0;",u,d,"color: #333; background: white; padding: 5px 0; font-weight: bold;",d,u,o+"padding-left: 0;")}const qS={POINT:"POINT",COUNTRY:"COUNTRY"};let Vv=class Uv extends st.Map{constructor(o){o.logSDKVersion!==!1&&GS(),Pw(o.container),o.apiKey&&(Or.apiKey=o.apiKey);const{style:d,requiresUrlMonitoring:v,isFallback:w}=i0(o.style);w&&console.warn("Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style."),Or.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");const M=location.hash;let b={compact:!1};o.customAttribution?b.customAttribution=o.customAttribution:o.attributionControl&&typeof o.attributionControl=="object"&&(b={...b,...o.attributionControl});const s={...o,style:d,maplibreLogo:!1,transformRequest:R_(o.transformRequest),attributionControl:o.forceNoAttributionControl===!0?!1:b};delete s.style,super(s),it(this,"telemetry"),it(this,"space"),it(this,"halo"),it(this,"options"),it(this,"isTerrainEnabled",!1),it(this,"terrainExaggeration",1),it(this,"primaryLanguage"),it(this,"terrainGrowing",!1),it(this,"terrainFlattening",!1),it(this,"minimap"),it(this,"forceLanguageUpdate"),it(this,"languageAlwaysBeenStyle"),it(this,"isReady",!1),it(this,"terrainAnimationDuration",1e3),it(this,"monitoredStyleUrls"),it(this,"styleInProcess",!1),it(this,"curentProjection"),it(this,"originalLabelStyle",new window.Map),it(this,"isStyleLocalized",!1),it(this,"languageIsUpdated",!1),it(this,"spaceboxLoadingState",{styleLoadCallbackSet:!1,styleLoadedCallbackFired:!1}),this.options=o,this.setStyle(d),v&&this.monitorStyleUrl(d);const D=()=>{let ue="The distant style could not be loaded.";this.getStyle()?ue+=" Leaving the style as is.":(this.setStyle(Bu.STREETS),ue+=`Loading default MapTiler Cloud style "${Bu.STREETS.getDefaultVariant().getId()}" as a fallback.`),console.warn(ue)};if(this.on("style.load",()=>
932{this.styleInProcess=!1,(typeof o.rtlTextPlugin=="string"||typeof o.rtlTextPlugin>"u")&&Tw(o.rtlTextPlugin)}),this.on("error",ue=>{if(ue.error instanceof st.AJAXError){const ve=ue.error.url,me=new URL(ve);me.search="";const le=me.href;this.monitoredStyleUrls&&this.monitoredStyleUrls.has(le)&&(this.monitoredStyleUrls.delete(le),D());return}if(this.styleInProcess){D();return}}),Or.caching&&!gm&&console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"),Or.caching&&gm&&ww(),typeof o.language>"u")this.primaryLanguage=Or.primaryLanguage;else{const ue=I_(o.language,Bt);this.primaryLanguage=ue??Or.primaryLanguage}this.forceLanguageUpdate=!(this.primaryLanguage===Bt.STYLE||this.primaryLanguage===Bt.STYLE_LOCK),this.languageAlwaysBeenStyle=this.primaryLanguage===Bt.STYLE,this.terrainExaggeration=o.terrainExaggeration??this.terrainExaggeration,this.curentProjection=o.projection,this.on("style.load",ue=>{this.curentProjection==="mercator"?this.setProjection({type:"mercator"}):this.curentProjection==="globe"&&this.setProjection({type:"globe"})}),this.once("styledata",async()=>{if(!o.geolocate||o.center||o.hash&&M)return;try{if(o.geolocate===qS.COUNTRY){await this.fitToIpBounds();return}}catch(ve){console.warn(ve.message)}let ue;try{await this.centerOnIpPoint(o.zoom),ue=this.getCameraHash()}catch(ve){console.warn(ve.message)}(await navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(ve=>{ue===this.getCameraHash()&&(this.terrain?this.easeTo({center:[ve.coords.longitude,ve.coords.latitude],zoom:o.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[ve.coords.longitude,ve.coords.latitude],zoom:o.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})}),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",async()=>{let ue={logo:null};try{const ve=Object.keys(this.style.tileManagers).map(le=>this.getSource(le)).filter(le=>le&&"url"in le&&typeof le.url=="string"&&le.url.includes("tiles.json")),me=new URL(ve[0].url);me.searchParams.has("key")||me.searchParams.append("key",Or.apiKey),ue=await(await fetch(me.href)).json()}catch{}if(o.customControls){const ve="[data-maptiler-control-group]",me="[data-maptiler-control]",le=Me=>{let Re=Me.dataset.maptilerControl;return(Re==="true"||Re==="")&&(Re=void 0),Re},He=Me=>Me.dataset.maptilerPosition;let Ne=[...this._container.ownerDocument.querySelectorAll(ve)],$e=[...this._container.ownerDocument.querySelectorAll(me)].filter(Me=>Me.closest(ve)===null);if(typeof o.customControls=="string"){const Me=o.customControls;Ne=Ne.filter(Re=>Re.matches(Me)||Re.closest(Me)!==null),$e=$e.filter(Re=>Re.matches(Me)||Re.closest(Me)!==null)}for(const Me of Ne){const Re=new Mm(Me);this.addControl(Re,He(Me));for(const rt of Me.querySelectorAll(me))Re.configureGroupItem(rt,le(rt))}for(const Me of $e)this.addControl(new Mm(Me,le(Me)),He(Me));const ke=()=>{const{lng:Me,lat:Re}=this.getCenter();this._container.style.setProperty("--maptiler-center-lng",String(Me)),this._container.style.setProperty("--maptiler-center-lat",String(Re)),this._container.style.setProperty("--maptiler-zoom",String(this.getZoom())),this._container.style.setProperty("--maptiler-bearing",String(this.getBearing())),this._container.style.setProperty("--maptiler-pitch",String(this.getPitch())),this._container.style.setProperty("--maptiler-roll",String(this.getRoll())),this._container.style.setProperty("--maptiler-is-globe-projection",String(this.isGlobeProjection())),this._container.style.setProperty("--maptiler-has-terrain",String(this.hasTerrain()))};ke(),this.on("render",ke)}if(o.forceNoAttributionControl!==!0)if("logo"in ue&&ue.logo){const ve=ue.logo;this.addControl(new k_({logoURL:ve}),o.logoPosition)}else o.maptilerLogo&&this.addControl(new k_,o.logoPosition);if(o.scaleControl){const ve=o.scaleControl===!0||o.scaleControl===void 0?"bottom-right":o.scaleControl,me=new fw({unit:Or.unit});this.addControl(me,ve),Or.on("unit",le=>{me.setUnit(le)})}
932if(o.navigationControl!==!1){const ve=o.navigationControl===!0||o.navigationControl===void 0?"top-right":o.navigationControl;this.addControl(new QT,ve)}if(o.geolocateControl!==!1){const ve=o.geolocateControl===!0||o.geolocateControl===void 0?"top-right":o.geolocateControl;this.addControl(new tS({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),ve)}if(o.terrainControl){const ve=o.terrainControl===!0||o.terrainControl===void 0?"top-right":o.terrainControl;this.addControl(new JT,ve)}if(o.projectionControl){const ve=o.projectionControl===!0||o.projectionControl===void 0?"top-right":o.projectionControl;this.addControl(new iS,ve)}if(o.fullscreenControl){const ve=o.fullscreenControl===!0||o.fullscreenControl===void 0?"top-right":o.fullscreenControl;this.addControl(new mw({}),ve)}this.isReady=!0,this.fire("ready",{target:this})});let N=!1,Z=!1,re;this.once("ready",()=>{N=!0,Z&&this.fire("loadWithTerrain",re)}),this.once("style.load",()=>{const{minimap:ue}=o;if(typeof ue=="object"){const{zoom:ve,center:me,style:le,language:He,apiKey:Ne,maptilerLogo:$e,canvasContextAttributes:ke,refreshExpiredTiles:Me,maxBounds:Re,scrollZoom:rt,minZoom:ut,maxZoom:It,boxZoom:dt,locale:Cr,fadeDuration:Ur,crossSourceCollisions:ci,clickTolerance:Tn,bounds:Sn,fitBoundsOptions:$a,pixelRatio:ui,validateStyle:Mn}=o;this.minimap=new am(ue,{zoom:ve,center:me,style:le,language:He,apiKey:Ne,container:"null",maptilerLogo:$e,canvasContextAttributes:ke,refreshExpiredTiles:Me,maxBounds:Re,scrollZoom:rt,minZoom:ut,maxZoom:It,boxZoom:dt,locale:Cr,fadeDuration:Ur,crossSourceCollisions:ci,clickTolerance:Tn,bounds:Sn,fitBoundsOptions:$a,pixelRatio:ui,validateStyle:Mn}),this.addControl(this.minimap,ue.position??"bottom-left")}else ue===!0?(this.minimap=new am({},o),this.addControl(this.minimap,"bottom-left")):ue!==void 0&&ue!==!1&&(this.minimap=new am({},o),this.addControl(this.minimap,ue))});const pe=ue=>{ue.terrain&&(Z=!0,re={type:"loadWithTerrain",target:this,terrain:ue.terrain},this.off("terrain",pe),N&&this.fire("loadWithTerrain",re))};this.on("terrain",pe),o.terrain&&this.enableTerrain(o.terrainExaggeration??this.terrainExaggeration),this.once("load",()=>{this.getCanvas().addEventListener("webglcontextlost",ve=>{if(this._removed===!0){console.warn("[webglcontextlost]","WebGL context lost after map removal. This is harmless.");return}console.warn("[webglcontextlost]","Unexpected loss of WebGL context!"),this.fire("webglContextLost",ve)});const ue=this.getLayersOrder()[0];o.space&&this.initSpace({options:o,before:ue}),o.halo&&this.initHalo({options:o,before:ue})}),this.telemetry=new nS(this)}getSpace(){return this.space}setSpace(o,d=!0){if(d&&(this.options.space=o),o===!1){this.space=void 0;return}if(this.space){this.space.setCubemap(o),this.getLayer(this.space.id)||this.addLayer(this.space,this.getLayersOrder()[0]);return}this.space=new Bp(o),this.once("load",()=>{const v=this.getLayersOrder()[0];this.space&&this.addLayer(this.space,v)})}enableSpaceAnimations(){this.setSpaceAnimationActive(!0)}disableSpaceAnimations(){this.setSpaceAnimationActive(!1)}enableHaloAnimations(){this.setHaloAnimationActive(!0)}disableHaloAnimations(){this.setHaloAnimationActive(!1)}setHaloAnimationActive(o){this.halo?this.halo.setAnimationActive(o):this.once("load",()=>{var d;(d=this.halo)==null||d.setAnimationActive(o)})}setSpaceAnimationActive(o){this.space?this.space.setAnimationActive(o):this.once("load",()=>{var d;(d=this.space)==null||d.setAnimationActive(o)})}setSpaceFromStyle({style:o}){var d,v,w;if(this.options.space!==!0&&typeof this.options.space<"u"){this.setSpace(this.options.space);return}const M=(v=(d=o.metadata)==null?void 0:d.maptiler)==null?void 0:v.space;if(!this.options.space&&!M){this.setSpace(!1,!1);return}if(JSON.stringify((w=this.space)==null?void 0:w.getConfig())===JSON.stringify(M)){if(this.space&&!this.getLayer(this.space.id)){const b=this.getLayersOrder()[0];this.addLayer(this.space,b)}return}if(this.options.space===!0){this.setSpace(M??!0);return}
932if(this.space&&this.isGlobeProjection()){if(!this.getLayer(this.space.id)){const b=this.getLayersOrder()[0];this.addLayer(this.space,b)}this.space.setCubemap(M)}}setHaloFromStyle({style:o}){var d,v,w;if(this.options.halo===!1)return;const M=(d=o.metadata)==null?void 0:d.maptiler;if(JSON.stringify((v=this.halo)==null?void 0:v.getConfig())===JSON.stringify(M?.halo)){if(this.halo&&!this.getLayer(this.halo.id)){const b=this.getLayersOrder().indexOf(((w=this.space)==null?void 0:w.id)??"")+1,s=this.getLayersOrder()[b];this.addLayer(this.halo,s)}return}if(!(M!=null&&M.halo)&&!this.options.halo){this.setHalo({stops:[[0,"transparent"],[.01,"transparent"]],scale:1});return}(()=>{var b;if(this.halo){if(!this.getLayer(this.halo.id)){const D=this.getLayersOrder().indexOf(((b=this.space)==null?void 0:b.id)??"")+1,N=this.getLayersOrder()[D];this.addLayer(this.halo,N)}const s=M?.halo??this.options.halo;s&&this.halo.setGradient(s)}})()}initSpace({options:o=this.options,before:d,spec:v}){if(this.space){this.getLayer(this.space.id)||this.addLayer(this.space,d);return}if(o.space===!1)return;if(o.space&&o.space!==!0){this.space=new Bp(o.space),this.addLayer(this.space,d);return}const w=v;w&&(this.space=new Bp(w),this.addLayer(this.space,d)),this.options.space===!0&&(this.space=new Bp(!0),this.addLayer(this.space,d))}initHalo({options:o=this.options,before:d,spec:v}){if(this.halo&&this.getLayer(this.halo.id)||o.halo===!1)return;const w=v;if(o.halo&&o.halo!==!0){this.halo=new jp(o.halo),this.addLayer(this.halo,d);return}if(w&&(this.halo=new jp(w),this.addLayer(this.halo,d)),this.options.halo===!0){this.halo=new jp(!0),this.addLayer(this.halo,d);return}}getHalo(){return this.halo}setHalo(o){if(this.options.halo=o,!!this.isGlobeProjection()){if(this.halo){this.halo.setGradient(o);return}this.halo=new jp(o),this.once("load",()=>{var d;const v=this.getLayersOrder(),w=v[0],M=v.indexOf(((d=this.space)==null?void 0:d.id)??"")+2,b=v[M];this.halo&&this.addLayer(this.halo,this.space?b:w)})}}recreate(){const o={center:this.getCenter(),zoom:this.getZoom(),bearing:this.getBearing(),pitch:this.getPitch()};this.remove(),Object.assign(this,new Uv({...this.options})),this.once("load",()=>{this.jumpTo(o)})}setTerrainAnimationDuration(o){this.terrainAnimationDuration=Math.max(o,0)}async onLoadAsync(){return new Promise(o=>{if(this.loaded()){o(this);return}this.once("load",()=>{o(this)})})}async onReadyAsync(){return new Promise(o=>{if(this.isReady){o(this);return}this.once("ready",()=>{o(this)})})}async onLoadWithTerrainAsync(){return new Promise(o=>{if(this.isReady&&this.terrain){o(this);return}this.once("loadWithTerrain",()=>{o(this)})})}monitorStyleUrl(o){typeof this.monitoredStyleUrls>"u"&&(this.monitoredStyleUrls=new Set);const d=new URL(o);d.search="",this.monitoredStyleUrls.add(d.href)}setStyle(o,d){var v,w,M,b,s;this.originalLabelStyle.clear(),(v=this.minimap)==null||v.setStyle(o),this.forceLanguageUpdate=!0,this.once("idle",()=>{this.forceLanguageUpdate=!1});const D=i0(o);if(D.requiresUrlMonitoring&&this.monitorStyleUrl(D.style),D.isFallback){if(this.getStyle())return console.warn("[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Keeping the curent style instead."),this;console.warn("[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style.")}this.spaceboxLoadingState.styleLoadedCallbackFired=!1,this.spaceboxLoadingState.styleLoadCallbackSet=!1;const N=this.getStyle(),Z=D.style;try{super.setStyle(D.style,{...d,diff:typeof D.style!="string"}),this.styleInProcess=!0}catch(ue){this.styleInProcess=!1,console.error("[Map.setStyle]: Error while setting style:",ue)}const re=()=>{const ue=D.style;if(!ue.projection||ue.projection.type==="mercator"){console.warn("[Map.setStyle]: Neither space nor halo is supported for mercator projection. Ignoring...");return}this.setSpaceFromStyle({style:D.style}),this.setHaloFromStyle({style:D.style})},pe=ue=>{var ve,me,le,He;const Ne=ue?.target.getStyle()??D.style;if(!this.spaceboxLoadingState.styleLoadedCallbackFired&&(this.spaceboxLoadingState.styleLoadedCallbackFired=!0,this.spaceboxLoadingState.styleLoadCallbackSet=!1,typeof Ne!="string"))try{const $e=this.getLayersOrder()[0];this.space?this.setSpaceFromStyle({style:Ne}
932):this.initSpace({before:$e,spec:(me=(ve=Ne.metadata)==null?void 0:ve.maptiler)==null?void 0:me.space}),this.halo?this.setHaloFromStyle({style:Ne}):this.initHalo({before:$e,spec:(He=(le=Ne.metadata)==null?void 0:le.maptiler)==null?void 0:He.halo})}catch($e){console.error($e)}};return typeof D.style=="string"||D.requiresUrlMonitoring?(this.once("style.load",pe),this):(requestIdleCallback(()=>{try{pe()}catch(ue){console.error(ue)}}),this.spaceboxLoadingState.styleLoadCallbackSet?((w=N?.terrain)==null?void 0:w.source)!==((M=Z?.terrain)==null?void 0:M.source)||((b=N?.terrain)==null?void 0:b.exaggeration)!==((s=Z?.terrain)==null?void 0:s.exaggeration)?(this.once("terrain",re),this):this:(this.once("style.load",pe),this.once("projection.change",pe),this.spaceboxLoadingState.styleLoadCallbackSet=!0,this))}addLayer(o,d){var v;return(v=this.minimap)==null||v.addLayer(o,d),super.addLayer(o,d)}moveLayer(o,d){var v;return(v=this.minimap)==null||v.moveLayer(o,d),super.moveLayer(o,d)}removeLayer(o){var d;return(d=this.minimap)==null||d.removeLayer(o),super.removeLayer(o)}setLayerZoomRange(o,d,v){var w;return(w=this.minimap)==null||w.setLayerZoomRange(o,d,v),super.setLayerZoomRange(o,d,v)}setFilter(o,d,v){var w;return(w=this.minimap)==null||w.setFilter(o,d,v),super.setFilter(o,d,v)}setPaintProperty(o,d,v,w){var M;return(M=this.minimap)==null||M.setPaintProperty(o,d,v,w),super.setPaintProperty(o,d,v,w)}setLayoutProperty(o,d,v,w){var M;return(M=this.minimap)==null||M.setLayoutProperty(o,d,v,w),super.setLayoutProperty(o,d,v,w)}setGlyphs(o,d){var v;return(v=this.minimap)==null||v.setGlyphs(o,d),super.setGlyphs(o,d)}getStyleLanguage(){return!this.style||!this.style.stylesheet||!this.style.stylesheet.metadata||typeof this.style.stylesheet.metadata!="object"?null:"maptiler:language"in this.style.stylesheet.metadata&&typeof this.style.stylesheet.metadata["maptiler:language"]=="string"?dm(this.style.stylesheet.metadata["maptiler:language"]):null}setLanguage(o){var d;(d=this.minimap)==null||d.map.setLanguage(o),this.onStyleReady(()=>{this.setPrimaryLanguage(o)})}setPrimaryLanguage(o){const d=this.getStyleLanguage(),v=I_(o,Bt);if(!v){console.warn(`The language "${v}" is not supported.`);return}if(!(v.flag===Bt.STYLE.flag&&d&&(d.flag===Bt.AUTO.flag||d.flag===Bt.VISITOR.flag))&&(v.flag!==Bt.STYLE.flag&&(this.languageAlwaysBeenStyle=!1),this.languageAlwaysBeenStyle||this.primaryLanguage===v&&!this.forceLanguageUpdate))return;if(this.primaryLanguage.flag===Bt.STYLE_LOCK.flag){console.warn("The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag.");return}this.primaryLanguage=v;let w=v;if(v.flag===Bt.STYLE.flag){if(!d){console.warn("The style has no default languages or has an invalid one.");return}w=d}let M=Bt.LOCAL.flag,b=["get",M];w.flag===Bt.VISITOR.flag?(M=C_().flag,b=["case",["all",["has",M],["has",Bt.LOCAL.flag]],["case",["==",["get",M],["get",Bt.LOCAL.flag]],["get",Bt.LOCAL.flag],["format",["get",M],{"font-scale":.8},` 933`,["get",Bt.LOCAL.flag],{"font-scale":1.1}]],["get",Bt.LOCAL.flag]]):w.flag===Bt.VISITOR_ENGLISH.flag?(M=Bt.ENGLISH.flag,b=["case",["all",["has",M],["has",Bt.LOCAL.flag]],["case",["==",["get",M],["get",Bt.LOCAL.flag]],["get",Bt.LOCAL.flag],["format",["get",M],{"font-scale":.8},` 934`,["get",Bt.LOCAL.flag],{"font-scale":1.1}]],["get",Bt.LOCAL.flag]]):w.flag===Bt.AUTO.flag?(M=C_().flag,b=["coalesce",["get",M],["get",Bt.LOCAL.flag]]):w===Bt.LOCAL?(M=Bt.LOCAL.flag,b=["get",M]):(M=w.flag,b=["coalesce",["get",M],["get",Bt.LOCAL.flag]]);const{layers:s}=this.getStyle(),D=this.originalLabelStyle.size===0;if(D){const N=Lw(s,this);this.isStyleLocalized=Object.keys(N.localized).length>0}for(const N of s){if(N.type!=="symbol")continue;const Z=N,re=this.getSource(Z.source);if(!re||!("url"in re&&typeof re.url=="string")||new URL(re.url).host!==Ri.maptilerApiHost)continue;const{id:pe,layout:ue}=Z;if(!ue||!("text-field"in ue))continue;let ve;if(D?(ve=this.getLayoutProperty(pe,"text-field"),this.originalLabelStyle.set(pe,ve)):ve=this.originalLabelStyle.get(pe),typeof ve=="string"){const{contains:me,exactMatch:le}=Ew(ve,this.isStyleLocalized);if(!me)continue;if(le)this.setLayoutProperty(pe,"text-field",b);else{const He=Cw(ve,b,this.isStyleLocalized);this.setLayoutProperty(pe,"text-field",He)}}else{const me=Aw(ve,b,this.isStyleLocalized);this.setLayoutProperty(pe,"text-field",me)}}this.languageIsUpdated=!0}getPrimaryLanguage(){return this.primaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(o){if(!this.terrain)return;const d=performance.now(),v=this.terrain.exaggeration,w=o-v,M=()=>
934{if(!this.terrain||this.terrainFlattening)return;const b=(performance.now()-d)/this.terrainAnimationDuration;if(b<.99){const s=1-(1-b)**4,D=v+s*w;this.terrain.exaggeration=D,requestAnimationFrame(M)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=o,this.fire("terrainAnimationStop",{terrain:this.terrain});this._elevationFreeze=!1,this.triggerRepaint()};!this.terrainGrowing&&!this.terrainFlattening&&this.fire("terrainAnimationStart",{terrain:this.terrain}),this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(M)}enableTerrain(o=this.terrainExaggeration){if(o<0){console.warn("Terrain exaggeration cannot be negative.");return}const d=w=>{!this.terrain||w.type!=="data"||w.dataType!=="source"||!("source"in w)||w.sourceId!=="maptiler-terrain"||w.source.type!=="raster-dem"||w.isSourceLoaded&&(this.off("data",d),this.growTerrain(o))},v=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=o,this.on("data",d),this.addSource(Ri.terrainSourceId,{type:"raster-dem",url:Ri.terrainSourceURL}),this.setTerrain({source:Ri.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(o);return}if(this.loaded()||this.isTerrainEnabled)v();else{const w=()=>{this.getTerrain()&&this.getSource(Ri.terrainSourceId)||v()};this.once("load",()=>{w()}),this.once("moveend",()=>{w()})}}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const o=performance.now(),d=this.terrain.exaggeration,v=()=>{if(!this.terrain||this.terrainGrowing)return;const w=(performance.now()-o)/this.terrainAnimationDuration;if(this._elevationFreeze=!1,w<.99){const M=(1-w)**4,b=d*M;this.terrain.exaggeration=b,requestAnimationFrame(v)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(),this.get
934Source(Ri.terrainSourceId)&&this.removeSource(Ri.terrainSourceId),this.fire("terrainAnimationStop",{terrain:null});this.triggerRepaint()};!this.terrainGrowing&&!this.terrainFlattening&&this.fire("terrainAnimationStart",{terrain:this.terrain}),this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(v)}setTerrainExaggeration(o,d=!0){!d&&this.terrain?(this.terrainExaggeration=o,this.terrain.exaggeration=o,this.triggerRepaint()):this.enableTerrain(o)}onStyleReady(o){this.isStyleLoaded()?o():this.once("styledata",()=>{o()})}async fitToIpBounds(){const o=await A_.info();this.fitBounds(o.country_bounds,{duration:0,padding:100})}async centerOnIpPoint(o){const d=await A_.info();this.jumpTo({center:[d.longitude??0,d.latitude??0],zoom:o||11})}getCameraHash(){const o=new Float32Array(5),d=this.getCenter();return o[0]=d.lng,o[1]=d.lat,o[2]=this.getZoom(),o[3]=this.getPitch(),o[4]=this.getBearing(),j1.fromUint8Array(new Uint8Array(o.buffer))}getSdkConfig(){return Or}getMaptilerSessionId(){return Fm}setTransformRequest(o){return super.setTransformRequest(R_(o)),this}getProjection(){const o=this.style.getProjection();return o===void 0&&this.style.projection?{type:this.style.projection.name}:o}isGlobeProjection(){const o=this.getProjection();return o?o.type==="globe":!1}enableGlobeProjection(){this.curentProjection="globe",this.isGlobeProjection()!==!0&&this.setProjection({type:"globe"})}enableMercatorProjection(){this.curentProjection="mercator",this.isGlobeProjection()!==!1&&this.setProjection({type:"mercator"})}setProjection(o,d){return typeof o=="string"&&(o={type:o}),(o.type==="mercator"||o.type==="globe")&&d!=null&&d.persist&&(this.curentProjection=o.type),this.fire("projection.change",{target:this,projection:o}),super.setProjection(o)}forgetPersistedProjection(){return this.curentProjection=void 0,this}isLanguageUpdated(){return this.languageIsUpdated}};const{Evented:kM}=st,{Evented:DM}=st;function ag(u){if(typeof DOMParser<"u"){const o=new DOMParser().parseFromString(u,"application/xml");if(o.querySelector("parsererror"))throw new Error("The provided string is not valid XML");return o}throw new Error("No XML parser found")}function $v(u,o){if(!u.hasChildNodes())return!1;for(const d of Array.from(u.childNodes)){const v=d.nodeName;if(typeof v=="string"&&v.trim().toLowerCase()===o.toLowerCase())return!0}return!1}function T0(u){if(typeof XMLSerializer<"u")return new XMLSerializer().serializeToString(u);throw new Error("No XML serializer found")}function Gv(u){const o=typeof u=="string"?ag(u):u;if(!$v(o,"gpx"))throw new Error("The XML document is not valid GPX");const d=li(o,"trk"),v=li(o,"rte"),w=li(o,"wpt"),M={type:"FeatureCollection",features:[]};for(const b of Array.from(d)){const s=XS(b);s&&M.features.push(s)}for(const b of Array.from(v)){const s=YS(b);s&&M.features.push(s)}for(const b of Array.from(w))M.features.push(KS(b));return M}function qv(u,o){let d=u;if(typeof d=="string"&&(d=ag(d)),!$v(d,"kml"))throw new Error("The XML document is not valid KML");const v={type:"FeatureCollection",features:[]},w={},M={},b={},s=li(d,"Placemark"),D=li(d,"Style"),N=li(d,"StyleMap");for(const Z of Array.from(D)){const re=M0(T0(Z)).toString(16);w[`#${Hs(Z,"id")}`]=re,M[re]=Z}for(const Z of Array.from(N)){w[`#${Hs(Z,"id")}`]=M0(T0(Z)).toString(16);const re=li(Z,"Pair"),pe={};for(const ue of Array.from(re))pe[Jt(vt(ue,"key"))??""]=Jt(vt(ue,"styleUrl"));b[`#${Hs(Z,"id")}`]=pe}for(const Z of Array.from(s))v.features=v.features.concat(HS(Z,w,M,b));return v}function S0(u){if(u===null)return["#000000",1];let o="",d=1,v=u;return v.startsWith("#")&&(v=v.substring(1)),(v.length===6||v.length===3)&&(o=v),v.length===8&&(d=Number.parseInt(v.substring(0,2),16)/255,o=`#${v.substring(6,8)}${v.substring(4,6)}${v.substring(2,4)}`),[o??"#000000",d??1]}function ZS(u){return Hv(u.split(" "))}function WS(u){let o=li(u,"coord");const d=[],v=[];o.length===0&&(o=li(u,"gx:coord"));for(const M of Array.from(o))d.push(ZS(Jt(M)??""));const w=li(u,"when");for(const M of Array.from(w))v.push(Jt(M));return{coords:d,times:v}}function Xp(u){const o=["Polygon","LineString","Point","Track","gx:Track"];let d,v,w,M,b;const s=[],D=[];if(vt(u,"MultiGeometry")!==null)return Xp(vt(u,"MultiGeometry"));if(vt(u,"MultiTrack")!==null)return Xp(vt(u,"MultiTrack"));if(vt(u,"gx:MultiTrack")!==null)return Xp(vt(u,"gx:MultiTrack"));for(w=0;w<o.length;w++)if(v=li(u,o[w]),v){for(M=0;M<v.length;M++)if(d=v[M],o[w]==="Point")s.push({type:"Point",coordinates:Xv(Jt(vt(d,"coordinates"))??"")});else if(o[w]==="LineString")s.push({type:"LineString",coordinates:P0(Jt(vt(d,"coordinates"))??"")});else if(o[w]==="Polygon"){const N=li(d,"LinearRing"),Z=[];for(b=0;b<N.length;
934b++)Z.push(P0(Jt(vt(N[b],"coordinates"))??""));s.push({type:"Polygon",coordinates:Z})}else if(o[w]==="Track"||o[w]==="gx:Track"){const N=WS(d);s.push({type:"LineString",coordinates:N.coords}),N.times.length&&D.push(N.times)}}return{geoms:s,coordTimes:D}}function HS(u,o,d,v){const w=Xp(u),M={},b=Jt(vt(u,"name")),s=Jt(vt(u,"address")),D=Jt(vt(u,"description")),N=vt(u,"TimeSpan"),Z=vt(u,"TimeStamp"),re=vt(u,"ExtendedData"),pe=vt(u,"visibility");let ue,ve=Jt(vt(u,"styleUrl")),me=vt(u,"LineStyle"),le=vt(u,"PolyStyle");if(!w.geoms.length)return[];if(b&&(M.name=b),s&&(M.address=s),ve){ve.startsWith("#")||(ve=`#${ve}`),M.styleUrl=ve,o[ve]&&(M.styleHash=o[ve]),v[ve]&&(M.styleMapHash=v[ve],M.styleHash=o[v[ve].normal??""]);const Ne=d[M.styleHash??""];if(Ne){me||(me=vt(Ne,"LineStyle")),le||(le=vt(Ne,"PolyStyle"));const $e=vt(Ne,"IconStyle");if($e){const ke=vt($e,"Icon");if(ke){const Me=Jt(vt(ke,"href"));Me&&(M.icon=Me)}}}}if(D&&(M.description=D),N){const Ne=Jt(vt(N,"begin")),$e=Jt(vt(N,"end"));Ne&&$e&&(M.timespan={begin:Ne,end:$e})}if(Z!==null&&(M.timestamp=Jt(vt(Z,"when"))??new Date().toISOString()),me!==null){const Ne=S0(Jt(vt(me,"color"))),$e=Ne[0],ke=Ne[1],Me=Number.parseFloat(Jt(vt(me,"width"))??"");$e&&(M.stroke=$e),Number.isNaN(ke)||(M["stroke-opacity"]=ke),Number.isNaN(Me)||(M["stroke-width"]=Me)}if(le){const Ne=S0(Jt(vt(le,"color"))),$e=Ne[0],ke=Ne[1],Me=Jt(vt(le,"fill")),Re=Jt(vt(le,"outline"));$e&&(M.fill=$e),Number.isNaN(ke)||(M["fill-opacity"]=ke),Me&&(M["fill-opacity"]=Me==="1"?M["fill-opacity"]||1:0),Re&&(M["stroke-opacity"]=Re==="1"?M["stroke-opacity"]||1:0)}if(re){const Ne=li(re,"Data"),$e=li(re,"SimpleData");for(ue=0;ue<Ne.length;ue++)M[Ne[ue].getAttribute("name")??""]=Jt(vt(Ne[ue],"value"))??"";for(ue=0;ue<$e.length;ue++)M[$e[ue].getAttribute("name")??""]=Jt($e[ue])??""}pe!==null&&(M.visibility=Jt(pe)??""),w.coordTimes.length!==0&&(M.coordTimes=w.coordTimes.length===1?w.coordTimes[0]:w.coordTimes);const He={type:"Feature",geometry:w.geoms.length===1?w.geoms[0]:{type:"GeometryCollection",geometries:w.geoms},properties:M};return Hs(u,"id")&&(He.id=Hs(u,"id")??void 0),[He]}function Zv(u,o){const d=li(u,o),v=[],w=[];let M=[];const b=d.length;if(!(b<2)){for(let s=0;s<b;s++){const D=Yv(d[s]);v.push(D.coordinates),D.time&&w.push(D.time),(D.heartRate||M.length)&&(M.length===0&&(M=new Array(s).fill(null)),M.push(D.heartRate))}return{line:v,times:w,heartRates:M}}}function XS(u){const o=li(u,"trkseg"),d=[],v=[],w=[];let M;for(let s=0;s<o.length;s++)if(M=Zv(o[s],"trkpt"),M!==void 0&&(M.line&&d.push(M.line),M.times&&M.times.length&&v.push(M.times),w.length||M.heartRates&&M.heartRates.length)){if(!w.length)for(let D=0;D<s;D++)w.push(new Array(d[D].length).fill(null));M.heartRates&&M.heartRates.length?w.push(M.heartRates):w.push(new Array(M.line.length).fill(null))}if(d.length===0)return;const b={...og(u),...Wv(vt(u,"extensions"))};return v.length!==0&&(b.coordTimes=d.length===1?v[0]:v),w.length!==0&&(b.heartRates=d.length===1?w[0]:w),d.length===1?{type:"Feature",properties:b,geometry:{type:"LineString",coordinates:d[0]}}:{type:"Feature",properties:b,geometry:{type:"MultiLineString",coordinates:d}}}function YS(u){const o=Zv(u,"rtept");return o===void 0?void 0:{type:"Feature",properties:{...og(u),...Wv(vt(u,"extensions"))},geometry:{type:"LineString",coordinates:o.line}}}function KS(u){return{type:"Feature",properties:{...og(u),...Pm(u,["sym"])},geometry:{type:"Point",coordinates:Yv(u).coordinates}}}function Wv(u){const o={};if(u){const d=vt(u,"line");if(d){const v=Jt(vt(d,"color")),w=Number.parseFloat(Jt(vt(d,"opacity"))??"0"),M=Number.parseFloat(Jt(vt(d,"width"))??"0");v&&(o.stroke=v),Number.isNaN(w)||(o["stroke-opacity"]=w),Number.isNaN(M)||(o["stroke-width"]=M*96/25.4)}}return o}function og(u){const o=Pm(u,["name","cmt","desc","type","time","keywords"]),d=li(u,"link");if(d.length!==0){o.links=[];for(const v of Array.from(d)){const w={href:Hs(v,"href"),...Pm(v,["text","type"])};o.links.push(w)}}return o}function M0(u){let o=0;if(!u||!u.length)return o;for(let d=0;d<u.length;d++)o=(o<<5)-o+u.charCodeAt(d)|0;return o}function li(u,o){return u.getElementsByTagName(o)}function Hs(u,o){return u.getAttribute(o)}function I0(u,o){return Number.parseFloat(Hs(u,o)??"0")}function vt(u,o){const d=li(u,o);return d.length?d[0]:null}function JS(u){return u.normalize&&u.normalize(),u}function Hv(u){return u.map(Number.parseFloat).map(o=>
934Number.isNaN(o)?null:o)}function Jt(u){return u&&JS(u),u&&u.textContent}function Pm(u,o){const d={};let v,w;for(w=0;w<o.length;w++)v=vt(u,o[w]),v&&(d[o[w]]=Jt(v)??"");return d}function Xv(u){return Hv(u.replace(/\s*/g,"").split(","))}function P0(u){const o=u.replace(/^\s*|\s*$/g,"").split(/\s+/),d=[];for(const v of o)d.push(Xv(v));return d}function Yv(u){const o=[I0(u,"lon"),I0(u,"lat")],d=vt(u,"ele"),v=vt(u,"gpxtpx:hr")||vt(u,"hr"),w=vt(u,"time");let M;return d&&(M=Number.parseFloat(Jt(d)??"0"),Number.isNaN(M)||o.push(M)),{coordinates:o,time:w?Jt(w):null,heartRate:v!==null?Number.parseFloat(Jt(v)??"0"):null}}function QS(u){let o=u;try{typeof o=="string"&&(o=ag(o))}catch{return null}try{return Gv(o)}catch{}try{return qv(o)}catch{}return null}async function eM(u,o={}){const d=o.download??!1,v=await tM(u);if(d){const w=o.filename??"maptiler_screenshot.png",M=document.createElement("a");M.style.display="none",document.body.appendChild(M),M.href=URL.createObjectURL(v),M.download=w,M.click(),setTimeout(()=>{document.body.removeChild(M),URL.revokeObjectURL(M.href)},0)}return v}function tM(u){return new Promise((o,d)=>{u.redraw(),u.once("idle",()=>{u.getCanvas().toBlob(v=>{if(!v){d(Error("Screenshot could not be created."));return}o(v)},"image/png")})})}const Am=[["#1D5B79","#468B97","#EF6262","#F3AA60"],["#614BC3","#33BBC5","#85E6C5","#C8FFE0"],["#461959","#7A316F","#CD6688","#AED8CC"],["#0079FF","#00DFA2","#F6FA70","#FF0060"],["#39B5E0","#A31ACB","#FF78F0","#F5EA5A"],["#37E2D5","#590696","#C70A80","#FBCB0A"],["#FFD36E","#FFF56D","#99FFCD","#9FB4FF"],["#00EAD3","#FFF5B7","#FF449F","#005F99"],["#10A19D","#540375","#FF7000","#FFBF00"]];function Td(){return Am[~~(Math.random()*Am.length)][~~(Math.random()*4)]}function th(){return`maptiler_source_${X0()}`}function rh(){return`maptiler_layer_${X0()}`}function Em(u,o){if(o<=u[0].zoom)return u[0].value;if(o>=u[u.length-1].zoom)return u[u.length-1].value;for(let d=0;d<u.length-1;d+=1)if(o>=u[d].zoom&&o<u[d+1].zoom){const v=u[d+1].zoom-u[d].zoom,w=(o-u[d].zoom)/v;return w*u[d+1].value+(1-w)*u[d].value}return 0}function zo(u){return["interpolate",["linear"],["zoom"],...u.flatMap(o=>[o.zoom,o.value])]}function Gt(u){return["interpolate",["linear"],["zoom"],...u.flatMap(o=>[o.zoom,o.value])]}function Kv(u,o){if(typeof o=="number"&&typeof u=="number")return 2*o+u;if(typeof o=="number"&&Array.isArray(u))return["interpolate",["linear"],["zoom"],...u.flatMap(d=>[d.zoom,2*o+d.value])];if(typeof u=="number"&&Array.isArray(o))return["interpolate",["linear"],["zoom"],...o.flatMap(d=>[d.zoom,2*d.value+u])];if(Array.isArray(u)&&Array.isArray(o)){const d=Array.from(new Set([...u.map(v=>v.zoom),...o.map(v=>v.zoom)])).sort((v,w)=>v<w?-1:1);return["interpolate",["linear"],["zoom"],...d.flatMap(v=>[v,2*Em(o,v)+Em(u,v)])]}return 0}function Jv(u,o){return["interpolate",["linear"],["get",o],...u.flatMap(d=>[d.propertyValue,d.value])]}function sg(u){const o=u.trimStart(),d=`${o}${" ".repeat(u.length-o.length)}`,v=Array.from(d);if(!v.every(M=>M===" "||M==="_"))throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");if(!(v.some(M=>M==="_")&&v.some(M=>M===" ")))throw new Error("A dash pattern must contain at least one underscore and one whitespace character");const w=[1];for(let M=1;M<v.length;M+=1){const b=v[M-1],s=v[M];b===s?w[w.length-1]+=1:w.push(1)}return w}function Cm(u,o){return["interpolate",["linear"],["get",o],...u.flatMap(d=>[d.value,d.color])]}function km(u,o,d=!0){return d?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius*.025])],2,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius*.05])],4,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius*.1])],8,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius*.25])],16,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius])]]:["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.value,v.pointRadius])]}function Qv(u,o,d=!0){return d?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value*.025])],2,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value*.05])],4,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value*.1])],8,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value*.25])],16,["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value])]]:["interpolate",["linear"],["get",o],...u.flatMap(v=>[v.propertyValue,v.value])]}function Dm(u,o){return u.every(d=>d.color[3]===u[0].color[3])?u[0].color[3]?u[0].color[3]/255:1:["interpolate",["linear"],["get",o],...u.getRawColorStops().flatMap(d=>{const v=d.value,w=d.color;return[v,w.length===4?w[3]/255:1]})]}function ex(u,o=10){return["interpolate",["linear"],["heatmap-density"],...Array.from({length:o+1},(d,v)=>{const w=v/o;return[w,u.getColorHex(w)]}).flat()]}function Vp(u){const o=u.toString(16);return o.length===1?`0${o}`:o}function rM(u){return`#${Vp(u[0])}${Vp(u[1])}${Vp(u[2])}${u.length===4?Vp(u[3]):""}`}class pt extends Array{constructor(o={}
934){super(),it(this,"min",0),it(this,"max",1),"min"in o&&(this.min=o.min),"max"in o&&(this.max=o.max),"stops"in o&&this.setStops(o.stops,{clone:!1})}static fromArrayDefinition(o){return new pt({stops:o.map(d=>({value:d[0],color:d[1]}))})}setStops(o,d={clone:!0}){const v=d.clone?this.clone():this;v.length=0;let w=Number.POSITIVE_INFINITY,M=Number.NEGATIVE_INFINITY;for(let b=0;b<o.length;b+=1)w=Math.min(w,o[b].value),M=Math.max(M,o[b].value),v.push({value:o[b].value,color:o[b].color.slice()});return v.sort((b,s)=>b.value<s.value?-1:1),this.min=w,this.max=M,v}scale(o,d,v={clone:!0}){const w=v.clone,M=this[0].value,b=this.at(-1).value-M,s=d-o,D=[];for(let N=0;N<this.length;N+=1){const Z=(this[N].value-M)/b*s+o;w?D.push({value:Z,color:this[N].color.slice()}):this[N].value=Z}return w?new pt({stops:D}):this}at(o){return o<0?this[this.length+o]:this[o]}clone(){return new pt({stops:this.getRawColorStops()})}getRawColorStops(){const o=[];for(let d=0;d<this.length;d+=1)o.push({value:this[d].value,color:this[d].color});return o}reverse(o={clone:!0}){const d=o.clone?this.clone():this;for(let v=0;v<~~(d.length/2);v+=1){const w=d[v].color;d[v].color=d.at(-(v+1)).color,d.at(-(v+1)).color=w}return d}getBounds(){return{min:this.min,max:this.max}}getColor(o,d={smooth:!0}){if(o<=this[0].value)return this[0].color;if(o>=this.at(-1).value)return this.at(-1).color;for(let v=0;v<this.length-1;v+=1){if(o>this[v+1].value)continue;const w=this[v].color;if(!d.smooth)return w.slice();const M=this[v].value,b=this[v+1].value,s=this[v+1].color,D=(b-o)/(b-M);return w.map((N,Z)=>Math.round(N*D+s[Z]*(1-D)))}return[0,0,0]}getColorHex(o,d={smooth:!0,withAlpha:!1}){return rM(this.getColor(o,d))}getColorRelative(o,d={smooth:!0}){const v=this.getBounds();return this.getColor(v.min+o*(v.max-v.min),d)}getCanvasStrip(o={horizontal:!0,size:512,smooth:!0}){const d=document.createElement("canvas");d.width=o.horizontal?o.size:1,d.height=o.horizontal?1:o.size;const v=d.getContext("2d");if(!v)throw new Error("Canvs context is missing");const w=v.getImageData(0,0,d.width,d.height),M=w.data,b=o.size,s=this[0].value,D=(this.at(-1).value-s)/b;for(let N=0;N<b;N+=1){const Z=this.getColor(s+N*D,{smooth:o.smooth});M[N*4]=Z[0],M[N*4+1]=Z[1],M[N*4+2]=Z[2],M[N*4+3]=Z.length>3?Z[3]:255}return v.putImageData(w,0,0),d}resample(o,d=15){const v=this.getBounds(),w=this.scale(0,1),M=1/(d-1);let b;if(o==="ease-in-square")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=N**2,re=w.getColor(Z);return{value:N,color:re}});else if(o==="ease-out-square")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=1-(1-N)**2,re=w.getColor(Z);return{value:N,color:re}});else if(o==="ease-out-sqrt")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=N**.5,re=w.getColor(Z);return{value:N,color:re}});else if(o==="ease-in-sqrt")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=1-(1-N)**.5,re=w.getColor(Z);return{value:N,color:re}});else if(o==="ease-out-exp")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=1-2**(-10*N),re=w.getColor(Z);return{value:N,color:re}});else if(o==="ease-in-exp")b=Array.from({length:d},(s,D)=>{const N=D*M,Z=2**(10*N-10),re=w.getColor(Z);return{value:N,color:re}});else throw new Error("Invalid ressampling method.");return new pt({stops:b}).scale(v.min,v.max)}transparentStart(){const o=this.getRawColorStops();o.unshift({value:o[0].value,color:o[0].color.slice()}),o[1].value+=.001;for(const d of o)d.color.length===3&&d.color.push(255);return o[0].color[3]=0,new pt({stops:o})}hasTransparentStart(){return this[0].color.length===4&&this[0].color[3]===0}}const tx={NULL:new pt({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),GRAY:new pt({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),JET:new pt({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new pt({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new pt({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new pt({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new pt({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new pt({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new pt({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new pt({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new pt({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new pt({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new pt({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]}
934,{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new pt({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new pt({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]},{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new pt({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new pt({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new pt({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new pt({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]},{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new pt({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new pt({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new pt({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new pt({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new pt({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new pt({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new pt({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new pt({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new pt({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new pt({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new pt({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new pt({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]}
934,{value:.75,color:[120,206,163]},{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new pt({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new pt({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new pt({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new pt({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]},{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new pt({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new pt({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new pt({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new pt({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new pt({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new pt({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new pt({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new pt({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new pt({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new pt({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new pt({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]}
934,{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new pt({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new pt({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new pt({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]},{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]})};async function iM(u,o,d={}){var v,w;if(!o.sourceId&&!o.data)throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");let M=o.data;if(typeof M=="string"){if(od(M))M=`https://api.maptiler.com/data/${o.data}/features.json?key=${Or.apiKey}`;else if(((v=M.split(".").pop())==null?void 0:v.toLowerCase().trim())==="gpx"){const b=await(await fetch(M,d)).text();M=Gv(b)}else if(((w=M.split(".").pop())==null?void 0:w.toLowerCase().trim())==="kml"){const b=await(await fetch(M,d)).text();M=qv(b)}else{const b=Mw(M)??QS(M);b&&(M=b)}if(!M)throw new Error("Polyline data was provided as string but is incompatible with valid formats.")}return nM(u,{...o,data:M})}function nM(u,o){if(o.layerId&&u.getLayer(o.layerId))throw new Error(`A layer already exists with the layer id: ${o.layerId}`);const d=o.sourceId??th(),v=o.layerId??rh(),w={polylineLayerId:v,polylineOutlineLayerId:"",polylineSourceId:d};o.data&&!u.getSource(d)&&u.addSource(d,{type:"geojson",data:o.data});const M=o.lineWidth??3,b=o.lineColor??Td(),s=o.lineOpacity??1,D=o.lineBlur??0,N=o.lineGapWidth??0;let Z=o.lineDashArray??null;const re=o.outlineWidth??1,pe=o.outlineColor??"#FFFFFF",ue=o.outlineOpacity??1,ve=o.outlineBlur??0;if(typeof Z=="string"&&(Z=sg(Z)),o.outline===!0){const me=`${v}_outline`;w.polylineOutlineLayerId=me,u.addLayer({id:me,type:"line",source:d,layout:{"line-join":o.lineJoin??"round","line-cap":o.lineCap??"round"},minzoom:o.minzoom??0,maxzoom:o.maxzoom??23,paint:{"line-opacity":typeof ue=="number"?ue:Gt(ue),"line-color":typeof pe=="string"?pe:zo(pe),"line-width":Kv(M,re),"line-blur":typeof ve=="number"?ve:Gt(ve)}},o.beforeId)}return u.addLayer({id:v,type:"line",source:d,layout:{"line-join":o.lineJoin??"round","line-cap":o.lineCap??"round"},minzoom:o.minzoom??0,maxzoom:o.maxzoom??23,paint:{"line-opacity":typeof s=="number"?s:Gt(s),"line-color":typeof b=="string"?b:zo(b),"line-width":typeof M=="number"?M:Gt(M),"line-blur":typeof D=="number"?D:Gt(D),"line-gap-width":typeof N=="number"?N:Gt(N),...Z&&{"line-dasharray":Z}}},o.beforeId),w}function aM(u,o){if(o.layerId&&u.getLayer(o.layerId))throw new Error(`A layer already exists with the layer id: ${o.layerId}`);const d=o.sourceId??th(),v=o.layerId??rh(),w={polygonLayerId:v,polygonOutlineLayerId:o.outline?`${v}_outline`:"",polygonSourceId:d};if(o.data&&!u.getSource(d)){let me=o.data;typeof me=="string"&&od(me)&&(me=`https://api.maptiler.com/data/${me}/features.json?key=${Or.apiKey}`),u.addSource(d,{type:"geojson",data:me})}let M=o.outlineDashArray??null;const b=o.outlineWidth??1,s=o.outlineColor??"#FFFFFF",D=o.outlineOpacity??1,N=o.outlineBlur??0,Z=o.fillColor??Td(),re=o.fillOpacity??1,pe=o.outlinePosition??"center",ue=o.pattern??null;typeof M=="string"&&(M=sg(M));const ve=(me=null)=>{if(u.addLayer({id:v,type:"fill",source:d,minzoom:o.minzoom??0,maxzoom:o.maxzoom??23,paint:{"fill-color":typeof Z=="string"?Z:zo(Z),"fill-opacity":typeof re=="number"?re:Gt(re),...me&&{"fill-pattern":me}}},o.beforeId),o.outline===!0){let le;pe==="inside"?typeof b=="number"?le=.5*b:le=Gt(b.map(({zoom:He,value:Ne})=>({zoom:He,value:.5*Ne}))):pe==="outside"?typeof b=="number"?le=-.5*b:le=Gt(b.map(He=>({zoom:He.zoom,value:-.5*He.value}))):le=0,u.addLayer({id:w.polygonOutlineLayerId,type:"line",source:d,layout:{"line-join":o.outlineJoin??"round","line-cap":o.outlineCap??"butt"},minzoom:o.minzoom??0,maxzoom:o.maxzoom??23,paint:{"line-opacity":typeof D=="number"?D:Gt(D),"line-color":typeof s=="string"?s:zo(s),"line-width":typeof b=="number"?b:Gt(b),"line-blur"
934:typeof N=="number"?N:Gt(N),"line-offset":le,...M&&{"line-dasharray":M}}},o.beforeId)}};return ue?u.hasImage(ue)?ve(ue):u.loadImage(ue).then(me=>{u.addImage(ue,me.data),ve(ue)}).catch(me=>{console.error("Could not load the pattern image.",me.message),ve()}):ve(),w}function oM(u,o){if(o.layerId&&u.getLayer(o.layerId))throw new Error(`A layer already exists with the layer id: ${o.layerId}`);const d=o.minPointRadius??10,v=o.maxPointRadius??50,w=o.cluster??!1,M=20,b=Array.isArray(o.pointColor)?o.pointColor:tx.TURBO.scale(10,o.cluster?1e4:1e3).resample("ease-out-square"),s=b.getBounds(),D=o.sourceId??th(),N=o.layerId??rh(),Z=o.showLabel??w,re=o.alignOnViewport??!0,pe=o.outline??!1,ue=o.outlineOpacity??1,ve=o.outlineWidth??1,me=o.outlineColor??"#FFFFFF";let le;const He=o.zoomCompensation??!0,Ne=o.minzoom??0,$e=o.maxzoom??23;typeof o.pointOpacity=="number"?le=o.pointOpacity:Array.isArray(o.pointOpacity)?le=Gt(o.pointOpacity):o.cluster?le=Dm(b,"point_count"):o.property?le=Dm(b,o.property):le=Gt([{zoom:Ne,value:0},{zoom:Ne+.25,value:1},{zoom:$e-.25,value:1},{zoom:$e,value:0}]);const ke={pointLayerId:N,clusterLayerId:"",labelLayerId:"",pointSourceId:D};if(o.data&&!u.getSource(D)){let Me=o.data;typeof Me=="string"&&od(Me)&&(Me=`https://api.maptiler.com/data/${Me}/features.json?key=${Or.apiKey}`),u.addSource(D,{type:"geojson",data:Me,cluster:w})}if(w){ke.clusterLayerId=`${N}_cluster`;const Me=Array.from({length:M},(Re,rt)=>{const ut=s.min+rt*(s.max-s.min)/(M-1);return{value:ut,pointRadius:d+(v-d)*(rt/(M-1))**.5,color:b.getColorHex(ut)}});u.addLayer({id:ke.clusterLayerId,type:"circle",source:D,filter:["has","point_count"],paint:{"circle-color":typeof o.pointColor=="string"?o.pointColor:Cm(Me,"point_count"),"circle-radius":typeof o.pointRadius=="number"?o.pointRadius:Array.isArray(o.pointRadius)?Gt(o.pointRadius):km(Me,"point_count",!1),"circle-pitch-alignment":re?"viewport":"map","circle-pitch-scale":"map","circle-opacity":le,...pe&&{"circle-stroke-opacity":typeof ue=="number"?ue:Gt(ue),"circle-stroke-width":typeof ve=="number"?ve:Gt(ve),"circle-stroke-color":typeof me=="string"?me:zo(me)}},minzoom:Ne,maxzoom:$e},o.beforeId),u.addLayer({id:ke.pointLayerId,type:"circle",source:D,filter:["!",["has","point_count"]],paint:{"circle-pitch-alignment":re?"viewport":"map","circle-pitch-scale":"map","circle-color":typeof o.pointColor=="string"?o.pointColor:b.getColorHex(b.getBounds().min),"circle-radius":typeof o.pointRadius=="number"?o.pointRadius:Array.isArray(o.pointRadius)?Gt(o.pointRadius):Me[0].pointRadius*.75,"circle-opacity":le,...pe&&{"circle-stroke-opacity":typeof ue=="number"?ue:Gt(ue),"circle-stroke-width":typeof ve=="number"?ve:Gt(ve),"circle-stroke-color":typeof me=="string"?me:zo(me)}},minzoom:Ne,maxzoom:$e},o.beforeId)}else{let Me=typeof o.pointColor=="string"?o.pointColor:Array.isArray(o.pointColor)?o.pointColor.getColorHex(o.pointColor.getBounds().min):Td(),Re=typeof o.pointRadius=="number"?He?Gt([{zoom:0,value:o.pointRadius*.025},{zoom:2,value:o.pointRadius*.05},{zoom:4,value:o.pointRadius*.1},{zoom:8,value:o.pointRadius*.25},{zoom:16,value:o.pointRadius*1}]):o.pointRadius:Array.isArray(o.pointRadius)?Gt(o.pointRadius):He?Gt([{zoom:0,value:d*.05},{zoom:2,value:d*.1},{zoom:4,value:d*.2},{zoom:8,value:d*.5},{zoom:16,value:d*1}]):d;if(o.property&&Array.isArray(o.pointColor)){const rt=Array.from({length:M},(ut,It)=>{const dt=s.min+It*(s.max-s.min)/(M-1);return{value:dt,pointRadius:typeof o.pointRadius=="number"?o.pointRadius:d+(v-d)*(It/(M-1))**.5,color:typeof o.pointColor=="string"?o.pointColor:b.getColorHex(dt)}});Me=Cm(rt,o.property),Re=km(rt,o.property,He)}u.addLayer({id:ke.pointLayerId,type:"circle",source:D,layout:{"circle-sort-key":o.property?["/",1,["get",o.property]]:0},paint:{"circle-pitch-alignment":re?"viewport":"map","circle-pitch-scale":"map","circle-color":Me,"circle-opacity":le,"circle-radius":Re,...pe&&{"circle-stroke-opacity":typeof ue=="number"?ue:Gt(ue),"circle-stroke-width":typeof ve=="number"?ve:Gt(ve),"circle-stroke-color":typeof me=="string"?me:zo(me)}},minzoom:Ne,maxzoom:$e},o.beforeId)}if(Z!==!1&&(o.cluster||o.property)){ke.labelLayerId=`${N}_label`;const Me=o.labelColor??"#fff",Re=o.labelSize??12;u.addLayer({id:ke.labelLayerId,type:"symbol",source:D,filter:["has",o.cluster?"point_count":o.property],layout:{"text-field":o.cluster?"{point_count_abbreviated}":`{${o.property}}`,"text-font":["Noto Sans Regular"],"text-size":Re,"text-pitch-alignment":re?"viewport":"map","symbol-sort-key":["/",1,["get",o.cluster?"point_count":o.property]]},paint:{"text-color":Me,"text-opacity":le},minzoom:Ne,maxzoom:$e},o.beforeId)}return ke}function sM(u,o){if(o.layerId&&u.getLayer(o.layerId))throw new Error(`A layer already exists with the layer id: ${o.layerId}`);const d=o.sourceId??th(),v=o.layerId??rh(),w=o.minzoom??0,M=o.maxzoom??23,b=o.zoomCompensation??!0,s=o.opacity??[{zoom:w,value:0},{zoom:w+.25,value:1},{zoom:M-.25,value:1},{zoom:M,value:0}];let D=Array.isArray(o.colorRamp)?o.colorRamp:tx.TURBO.transparentStart();const N=D.getBounds();(N.min!==0||N.max!==1)&&(D=D.scale(0,1)),D.hasTransparentStart()||
934(D=D.transparentStart());const Z=o.intensity??[{zoom:0,value:.01},{zoom:4,value:.2},{zoom:16,value:1}],re=o.property??null,pe=o.weight??1;let ue=1;re?typeof pe=="number"?(ue=pe,typeof o.weight=="number"&&console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")):Array.isArray(pe)?ue=Jv(pe,re):console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"):typeof pe=="number"?ue=pe:Array.isArray(pe)&&console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");const ve=[{zoom:0,value:50*.025},{zoom:2,value:50*.05},{zoom:4,value:50*.1},{zoom:8,value:50*.25},{zoom:16,value:50}],me=o.radius??(b?ve:10);let le=1;typeof me=="number"?le=me:Array.isArray(me)&&"zoom"in me[0]?le=Gt(me):re&&Array.isArray(me)&&"propertyValue"in me[0]?le=Qv(me,re,b):!re&&Array.isArray(me)&&"propertyValue"in me[0]?(le=Gt(ve),console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")):le=Gt(ve);const He={heatmapLayerId:v,heatmapSourceId:d};if(o.data&&!u.getSource(d)){let Ne=o.data;typeof Ne=="string"&&od(Ne)&&(Ne=`https://api.maptiler.com/data/${Ne}/features.json?key=${Or.apiKey}`),u.addSource(d,{type:"geojson",data:Ne})}return u.addLayer({id:v,type:"heatmap",source:d,minzoom:w,maxzoom:M,paint:{"heatmap-weight":ue,"heatmap-intensity":typeof Z=="number"?Z:Gt(Z),"heatmap-color":ex(D),"heatmap-radius":le,"heatmap-opacity":typeof s=="number"?s:Gt(s)}},o.beforeId),He}const Du=Object.freeze(Object.defineProperty({__proto__:null,addHeatmap:sM,addPoint:oM,addPolygon:aM,addPolyline:iM,colorDrivenByProperty:Cm,colorPalettes:Am,computeRampedOutlineWidth:Kv,dashArrayMaker:sg,generateRandomLayerName:rh,generateRandomSourceName:th,getRandomColor:Td,heatmapIntensityFromColorRamp:ex,lerpZoomNumberValues:Em,opacityDrivenByProperty:Dm,paintColorOptionsToPaintSpec:zo,radiusDrivenByProperty:km,radiusDrivenByPropertyHeatmap:Qv,rampedOptionsToLayerPaintSpec:Gt,rampedPropertyValueWeight:Jv,takeScreenshot:eM},Symbol.toStringTag,{value:"Module"}));new Array;function rx(){return"3.11.2"}st.Map;st.Marker;st.Popup;st.Style;st.CanvasSource;st.GeoJSONSource;st.ImageSource;st.RasterTileSource;st.RasterDEMTileSource;st.VectorTileSource;st.VideoSource;st.NavigationControl;st.GeolocateControl;st.AttributionControl;st.LogoControl;st.ScaleControl;st.FullscreenControl;st.TerrainControl;st.BoxZoomHandler;st.ScrollZoomHandler;st.CooperativeGesturesHandler;st.KeyboardHandler;st.TwoFingersTouchPitchHandler;st.MapWheelEvent;st.MapTouchEvent;st.MapMouseEvent;st.config;st.getVersion;const{setRTLTextPlugin:zM,getRTLTextPluginStatus:LM,LngLat:RM,LngLatBounds:FM,MercatorCoordinate:BM,Evented:OM,AJAXError:NM,prewarm:jM,clearPrewarmedResources:VM,Hash:UM,Point:$M,EdgeInsets:GM,DragRotateHandler:qM,DragPanHandler:ZM,TwoFingersTouchZoomRotateHandler:WM,DoubleClickZoomHandler:HM,TwoFingersTouchZoomHandler:XM,TwoFingersTouchRotateHandler:YM,getWorkerCount:KM,setWorkerCount:JM,getMaxParallelImageRequests:QM,setMaxParallelImageRequests:eI,getWorkerUrl:tI,setWorkerUrl:rI,addSourceType:iI,importScriptInWorkers:nI,addProtocol:aI,removeProtocol:oI}=st,lM="@maptiler/leaflet-maptilersdk",cM="4.1.1",uM=Mr.Layer.extend({options:{updateInterval:32,padding:.1,interactive:!1,pane:"tilePane"},map:null,initialize:function(u){Mr.setOptions(this,u),this._throttledUpdate=Mr.Util.throttle(this._update,this.options.updateInterval,this)},onAdd:function(u){var o;this._container||this._initContainer();const d=this.getPaneName();(o=u.getPane(d))==null||o.appendChild(this._container),this._initMaptilerSDK(),this._offset=this._map.containerPointToLayerPoint([0,0]),u.options.zoomAnimation&&Mr.DomEvent.on(u._proxy,Mr.DomUtil.TRANSITION_END,this._transitionEnd,this),u.attributionControl.addAttribution('<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>')},onRemove:function(u){var o;this._map._proxy&&this._map.options.zoomAnimation&&Mr.DomEvent.off(this._map._proxy,Mr.DomUtil.TRANSITION_END,this._transitionEnd,this);const d=this.getPaneName();(o=u.getPane(d))==null||o.removeChild(this._container),this._maptilerMap.remove(),this._maptilerMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize}},getMaptilerSDKMap:function(){return this._maptilerMap},getCanvas:function(){return this._maptilerMap.getCanvas()},getSize:function(){return this._map.getSize().multiplyBy(1+this.options.padding*2)},getBounds:function(){const u=this.getSize().multiplyBy(.5),o=this._map.latLngToContainerPoint(this._map.getCenter());return Mr.latLngBounds(this._map.containerPointToLatLng(o.subtract(u)),this._map.containerPointToLatLng(o.add(u)))},getContainer:function(){return this._container},getPaneName:function(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},setStyle:function(u){this._maptilerMap.setStyle(u)},setLanguage:function(u){this._maptilerMap.setLanguage(u)},_roundPoint:u=>({x:Math.round(u.x),y:Math.round(u.y)}
934),_initContainer:function(){this._container=Mr.DomUtil.create("div","leaflet-gl-layer");const u=this.getSize(),o=this._map.getSize().multiplyBy(this.options.padding);this._container.style.width=`${u.x}px`,this._container.style.height=`${u.y}px`;const d=this._map.containerPointToLayerPoint([0,0]).subtract(o);Mr.DomUtil.setPosition(this._container,this._roundPoint(d))},_initMaptilerSDK:function(){const u=this._map.getCenter(),o=this.options.maxBounds?this.options.maxBounds:[[Number.NEGATIVE_INFINITY,-90],[Number.POSITIVE_INFINITY,90]];this._map.setMaxBounds(Mr.latLngBounds(Mr.latLng(o[0][1],o[0][0]),Mr.latLng(o[1][1],o[1][0])));const d={maxBounds:o,...this.options,projection:"mercator",container:this._container,center:[u.lng,u.lat],zoom:this._map.getZoom()-1,attributionControl:!1};this.options.geolocate&&(d.center=void 0,d.zoom=void 0),this._maptilerMap=new Vv(d),this._maptilerMap.telemetry.registerModule(lM,cM),this._maptilerMap.once("load",()=>{this.fire("ready")}),this._maptilerMap.once("load",async()=>{let w={logo:null};try{const M=Object.keys(this._maptilerMap.style.sourceCaches).map(s=>this._maptilerMap.getSource(s)).filter(s=>s&&"url"in s&&typeof s.url=="string"&&s?.url.includes("tiles.json")),b=new URL(M[0].url);b.searchParams.has("key")||b.searchParams.append("key",d.apiKey),w=await(await fetch(b.href)).json()}catch{}if(w.logo||d.maptilerLogo){const M=w.logo??"https://api.maptiler.com/resources/logo.svg",b=document.createElement("a");b.href="https://www.maptiler.com",b.style.setProperty("position","absolute"),b.style.setProperty("left","10px"),b.style.setProperty("bottom","2px"),b.style.setProperty("z-index","999");const s=document.createElement("img");s.src=M,s.alt="MapTiler logo",s.width=100,s.height=30,b.appendChild(s),this._map.getContainer().appendChild(b)}}),this._maptilerMap.transform.freezeElevation=!0,this.options.geolocate&&this._maptilerMap.on("load",()=>
934{this._map.setView(this._maptilerMap.getCenter(),this._maptilerMap.getZoom()+1)}),this._transformGL(),this._maptilerMap._actualCanvas=this._maptilerMap._canvas;const v=this._maptilerMap._actualCanvas;Mr.DomUtil.addClass(v,"leaflet-image-layer"),Mr.DomUtil.addClass(v,"leaflet-zoom-animated"),this.options.interactive&&Mr.DomUtil.addClass(v,"leaflet-interactive"),this.options.className&&Mr.DomUtil.addClass(v,this.options.className),this.addHeatmap=w=>Du.addHeatmap(this._maptilerMap,w),this.addPolygon=w=>Du.addPolygon(this._maptilerMap,w),this.addPoint=w=>Du.addPoint(this._maptilerMap,w),this.addPolyline=w=>Du.addPolyline(this._maptilerMap,w),this.takeScreenshot=w=>Du.takeScreenshot(this._maptilerMap,w)},_update:function(){if(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming)return;const u=this.getSize(),o=this._map.getSize().multiplyBy(this.options.padding),d=this._map.containerPointToLayerPoint([0,0]).subtract(o);Mr.DomUtil.setPosition(this._container,this._roundPoint(d)),this._transformGL(),this._maptilerMap.transform.width!==u.x||this._maptilerMap.transform.height!==u.y?(this._container.style.width=`${u.x}px`,this._container.style.height=`${u.y}px`,this._maptilerMap._resize!==null&&this._maptilerMap._resize!==void 0?this._maptilerMap._resize():this._maptilerMap.resize()):this._maptilerMap._update!==null&&this._maptilerMap._update!==void 0?this._maptilerMap._update():this._maptilerMap.update()},_transformGL:function(){this._maptilerMap.setCenter(this._map.getCenter()),this._maptilerMap.setZoom(this._map.getZoom()-1)},_pinchZoom:function(){this._maptilerMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(u){const o=this._map.getZoomScale(u.zoom),d=this._map.getSize().multiplyBy(this.options.padding*o),v=this.getSize()._divideBy(2),w=this._map.project(u.center,u.zoom)._subtract(v)._add(this._map._getMapPanePos().add(d))._round(),M=this._map.project(this._map.getBounds().getNorthWest(),u.zoom)._subtract(w);Mr.DomUtil.setTransform(this._maptilerMap.getCanvas(),M.subtract(this._offset),o)},_zoomStart:function(){this._zooming=!0},_zoomEnd:function(){const u=this._map.getZoomScale(this._map.getZoom());Mr.DomUtil.setTransform(this._maptilerMap.getCanvas(),new Mr.Point(0,0),u),this._zooming=!1,this._update()},_transitionEnd:function(){Mr.Util.requestAnimFrame(()=>{const u=this._map.getZoom(),o=this._map.getCenter(),d=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());Mr.DomUtil.setTransform(this._maptilerMap._actualCanvas,d,1),this._maptilerMap.once("moveend",Mr.Util.bind(()=>{this._zoomEnd()},this)),this._maptilerMap.jumpTo({center:o,zoom:u-1})},this)},_resize:function(u){this._transitionEnd(u)}});function sI(u){return new uM(u)}export{Bt as Language,Bu as MapStyle,uM as MaptilerLayer,sI as maptilerLayer};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.