@focus-daima/gis-workbench 0.0.0-stage → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js ADDED
@@ -0,0 +1,1516 @@
1
+ (()=>{var F_=Object.create;var $m=Object.defineProperty;var B_=Object.getOwnPropertyDescriptor;var O_=Object.getOwnPropertyNames;var N_=Object.getPrototypeOf,j_=Object.prototype.hasOwnProperty;var V_=(E,I)=>()=>{try{return I||E((I={exports:{}}).exports,I),I.exports}catch(O){throw I=0,O}};var U_=(E,I,O,$)=>{if(I&&typeof I=="object"||typeof I=="function")for(let z of O_(I))!j_.call(E,z)&&z!==O&&$m(E,z,{get:()=>I[z],enumerable:!($=B_(I,z))||$.enumerable});return E};var q_=(E,I,O)=>(O=E!=null?F_(N_(E)):{},U_(I||!E||!E.__esModule?$m(O,"default",{value:E,enumerable:!0}):O,E));var Hm=V_((ep,tp)=>{/**
2
+ * MapLibre GL JS
3
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.24.1/LICENSE.txt
4
+ */(function(E,I){typeof ep=="object"&&typeof tp<"u"?tp.exports=I():typeof define=="function"&&define.amd?define(I):(E=typeof globalThis<"u"?globalThis:E||self,E.maplibregl=I())})(ep,(function(){"use strict";var E={},I={};function O(z,u,se){if(I[z]=se,z==="index"){var Ce="var sharedModule = {}; ("+I.shared+")(sharedModule); ("+I.worker+")(sharedModule);",$e={};return I.shared($e),I.index(E,$e),typeof window<"u"&&E.setWorkerUrl(window.URL.createObjectURL(new Blob([Ce],{type:"text/javascript"}))),E}}O("shared",["exports"],(function(z){"use strict";function u(r,e,i,o){return new(i||(i=Promise))((function(n,l){function h(m){try{g(o.next(m))}catch(v){l(v)}}function p(m){try{g(o.throw(m))}catch(v){l(v)}}function g(m){var v;m.done?n(m.value):(v=m.value,v instanceof i?v:new i((function(_){_(v)}))).then(h,p)}g((o=o.apply(r,e||[])).next())}))}function se(r,e){this.x=r,this.y=e}function Ce(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $e,Ye;typeof SuppressedError=="function"&&SuppressedError,se.prototype={clone(){return new se(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){let e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){let e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){let r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){let e=Math.cos(r),i=Math.sin(r),o=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=o,this},_rotateAround(r,e){let i=Math.cos(r),o=Math.sin(r),n=e.y+o*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-o*(this.y-e.y),this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:se},se.convert=function(r){if(r instanceof se)return r;if(Array.isArray(r))return new se(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new se(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var Oe=(function(){if(Ye)return $e;function r(e,i,o,n){this.cx=3*e,this.bx=3*(o-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(n-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=o,this.p2y=n}return Ye=1,$e=r,r.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,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,n=0;n<8;n++){var l=this.sampleCurveX(o)-e;if(Math.abs(l)<i)return o;var h=this.sampleCurveDerivativeX(o);if(Math.abs(h)<1e-6)break;o-=l/h}var p=0,g=1;for(o=e,n=0;n<20&&(l=this.sampleCurveX(o),!(Math.abs(l-e)<i));n++)e>l?p=o:g=o,o=.5*(g-p)+p;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},$e})(),ut=Ce(Oe);let Ue,ke;function Lt(){return Ue!=null||(Ue=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ue}function Gt(){if(ke==null&&(ke=!1,Lt())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let o=0;o<25;o++){let n=4*o;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(o%5,Math.floor(o/5),1,1)}let i=e.getImageData(0,0,5,5).data;for(let o=0;o<100;o++)if(o%4!=3&&i[o]!==o){ke=!0;break}}}return ke||!1}var mt=1e-6,Ge=typeof Float32Array<"u"?Float32Array:Array;function Fi(){var r=new Ge(9);return Ge!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function je(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function xt(){var r=new Ge(3);return Ge!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Se(r){var e=r[0],i=r[1],o=r[2];return Math.sqrt(e*e+i*i+o*o)}function Xe(r,e,i){var o=new Ge(3);return o[0]=r,o[1]=e,o[2]=i,o}function K(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function ee(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function ne(r,e,i){var o=e[0],n=e[1],l=e[2],h=i[0],p=i[1],g=i[2];return r[0]=n*g-l*p,r[1]=l*h-o*g,r[2]=o*p-n*h,r}var ve,We=Se;function ot(r,e,i){var o=e[0],n=e[1],l=e[2],h=e[3];return r[0]=i[0]*o+i[4]*n+i[8]*l+i[12]*h,r[1]=i[1]*o+i[5]*n+i[9]*l+i[13]*h,r[2]=i[2]*o+i[6]*n+i[10]*l+i[14]*h,r[3]=i[3]*o+i[7]*n+i[11]*l+i[15]*h,r}function Ve(){var r=new Ge(4);return Ge!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Ee(r,e,i,o){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",l=Math.PI/360;e*=l,o*=l,i*=l;var h=Math.sin(e),p=Math.cos(e),g=Math.sin(i),m=Math.cos(i),v=Math.sin(o),_=Math.cos(o);switch(n){case"xyz":r[0]=h*m*_+p*g*v,r[1]=p*g*_-h*m*v,r[2]=p*m*v+h*g*_,r[3]=p*m*_-h*g*v;break;case"xzy":r[0]=h*m*_-p*g*v,r[1]=p*g*_-h*m*v,r[2]=p*m*v+h*g*_,r[3]=p*m*_+h*g*v;break;case"yxz":r[0]=h*m*_+p*g*v,r[1]=p*g*_-h*m*v,r[2]=p*m*v-h*g*_,r[3]=p*m*_+h*g*v;break;case"yzx":r[0]=h*m*_+p*g*v,r[1]=p*g*_+h*m*v,r[2]=p*m*v-h*g*_,r[3]=p*m*_-h*g*v;break;case"zxy":r[0]=h*m*_-p*g*v,r[1]=p*g*_+h*m*v,r[2]=p*m*v+h*g*_,r[3]=p*m*_-h*g*v;break;case"zyx":r[0]=h*m*_-p*g*v,r[1]=p*g*_+h*m*v,r[2]=p*m*v-h*g*_,r[3]=p*m*_+h*g*v;break;default:throw new Error("Unknown angle order "+n)}return r}function nt(){var r=new Ge(2);return Ge!=Float32Array&&(r[0]=0,r[1]=0),r}function gt(r,e){var i=new Ge(2);return i[0]=r,i[1]=e,i}xt(),ve=new Ge(4),Ge!=Float32Array&&(ve[0]=0,ve[1]=0,ve[2]=0,ve[3]=0),xt(),Xe(1,0,0),Xe(0,1,0),Ve(),Ve(),Fi(),nt();let He=8192;function St(r,e,i){return e*(He/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function Bt(r){return r instanceof Error?r:new Error(typeof r=="string"?r:String(r))}function dt(r,e){return(r%e+e)%e}function lr(r,e,i){return r*(1-i)+e*i}function ti(r){if(r<=0)return 0;if(r>=1)return 1;let e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}function Ar(r,e,i,o){let n=new ut(r,e,i,o);return l=>n.solve(l)}let hi=Ar(.25,.1,.25,1);function ht(r,e,i){return Math.min(i,Math.max(e,r))}function yi(r,e,i){let o=i-e,n=((r-e)%o+o)%o+e;return n===e?i:n}function Xt(r,...e){for(let i of e)for(let o in i)r[o]=i[o];return r}let cr=1;function di(r,e,i){let o={};for(let n in r)o[n]=e.call(this,r[n],n,r);return o}function vi(r,e,i){let o={};for(let n in r)e.call(this,r[n],n,r)&&(o[n]=r[n]);return o}function _t(r){return Array.isArray(r)?r.map(_t):typeof r=="object"&&r?di(r,_t):r}let vt={};function qt(r){vt[r]||(typeof console<"u"&&console.warn(r),vt[r]=!0)}function Pi(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function Nt(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let It=null;function Pt(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}let Qi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ur(r,e,i,o,n){return u(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let l=new VideoFrame(r,{timestamp:0});try{let h=l?.format;if(!h||!h.startsWith("BGR")&&!h.startsWith("RGB"))throw new Error(`Unrecognized format ${h}`);let p=h.startsWith("BGR"),g=new Uint8ClampedArray(o*n*4);if(yield l.copyTo(g,(function(m,v,_,T,x){let M=4*Math.max(-v,0),C=(Math.max(0,_)-_)*T*4+M,D=4*T,L=Math.max(0,v),N=Math.max(0,_);return{rect:{x:L,y:N,width:Math.min(m.width,v+T)-L,height:Math.min(m.height,_+x)-N},layout:[{offset:C,stride:D}]}})(r,e,i,o,n)),p)for(let m=0;m<g.length;m+=4){let v=g[m];g[m]=g[m+2],g[m+2]=v}return g}finally{l.close()}}))}let Ai,Sr;function Ii(r,e,i,o){return r.addEventListener(e,i,o),{unsubscribe:()=>{r.removeEventListener(e,i,o)}}}function Te(r){return r*Math.PI/180}function Je(r){return r/Math.PI*180}let Yt={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},jt={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Zi="AbortError";class hr extends Error{constructor(e=Zi){super(e instanceof Error?e.message:e),this.name=Zi,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function Ur(r){return r instanceof Error&&r.name===Zi}function Ga(r){if(r.aborted)throw new hr(r.reason)}let Q={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function we(r){return Q.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}let ae="global-dispatcher";class ge extends Error{constructor(e,i,o,n){super(`AJAXError: ${i} (${e}): ${o}`),this.status=e,this.statusText=i,this.url=o,this.body=n}}let qe=()=>{var r;return Nt(self)?(r=self.worker)===null||r===void 0?void 0:r.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},be=function(r,e){return u(this,void 0,void 0,(function*(){var i,o;if(r.url.includes("://")&&!/^https?:|^file:/.test(r.url)){let n=we(r.url);if(n){let l=yield n(r,e);return l.data||r.type!=="arrayBuffer"?l:Xt(l,{data:new ArrayBuffer(0)})}if(Nt(self)&&(!((i=self.worker)===null||i===void 0)&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:ae},e)}if(!(n=>{var l;return n.startsWith("file:")||((l=qe())===null||l===void 0?void 0:l.startsWith("file:"))&&!/^\w+:/.test(n)})(r.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return(function(n,l){return u(this,void 0,void 0,(function*(){let h=new Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,cache:n.cache,referrer:qe(),referrerPolicy:n.referrerPolicy,signal:l.signal}),p,g;n.type!=="json"||h.headers.has("Accept")||h.headers.set("Accept","application/json");try{p=yield fetch(h)}catch(v){throw Ur(v)?v:new ge(0,Bt(v).message,n.url,new Blob)}if(!p.ok){let v=yield p.blob();throw new ge(p.status,p.statusText,n.url,v)}g=n.type==="arrayBuffer"||n.type==="image"?p.arrayBuffer():n.type==="json"?p.json():p.text();let m=yield g;return Ga(l.signal),{data:m,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires"),etag:p.headers.get("ETag")}}))})(r,e);if(Nt(self)&&(!((o=self.worker)===null||o===void 0)&&o.actor))return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:ae},e)}return(function(n,l){return new Promise(((h,p)=>{var g;let m=new XMLHttpRequest;m.open(n.method||"GET",n.url,!0),n.type!=="arrayBuffer"&&n.type!=="image"||(m.responseType="arraybuffer");for(let v in n.headers)m.setRequestHeader(v,n.headers[v]);n.type==="json"&&(m.responseType="text",!((g=n.headers)===null||g===void 0)&&g.Accept||m.setRequestHeader("Accept","application/json")),m.withCredentials=n.credentials==="include",m.onerror=()=>{p(new Error(m.statusText))},m.onload=()=>{if(!l.signal.aborted)if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let v=m.response;if(n.type==="json")try{v=JSON.parse(m.response)}catch(_){return void p(_)}h({data:v,cacheControl:m.getResponseHeader("Cache-Control"),expires:m.getResponseHeader("Expires"),etag:m.getResponseHeader("ETag")})}else{let v=new Blob([m.response],{type:m.getResponseHeader("Content-Type")});p(new ge(m.status,m.statusText,n.url,v))}},l.signal.addEventListener("abort",(()=>{m.abort(),p(new hr(l.signal.reason))})),m.send(n.body)}))})(r,e)}))};function Re(r){if(!r||r.indexOf("://")<=0||r.startsWith("data:image/")||r.startsWith("blob:"))return!0;let e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function Ze(r,e,i){var o;!((o=i[r])===null||o===void 0)&&o.includes(e)||(i[r]||(i[r]=[]),i[r].push(e))}function st(r,e,i){if(i?.[r]){let o=i[r].indexOf(e);o!==-1&&i[r].splice(o,1)}}class it{constructor(e,i={}){Xt(this,i),this.type=e}}class Zt extends it{constructor(e,i={}){super("error",Xt({error:e},i))}}class Dt{on(e,i){return this._listeners||(this._listeners={}),Ze(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return st(e,i,this._listeners),st(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners||(this._oneTimeListeners={}),Ze(e,i,this._oneTimeListeners),this):new Promise((o=>this.once(e,o)))}fire(e,i){var o,n;typeof e=="string"&&(e=new it(e,i||{}));let l=e.type;if(this.listens(l)){e.target=this;let h=!((o=this._listeners)===null||o===void 0)&&o[l]?this._listeners[l].slice():[];for(let m of h)m.call(this,e);let p=!((n=this._oneTimeListeners)===null||n===void 0)&&n[l]?this._oneTimeListeners[l].slice():[];for(let m of p)st(l,m,this._oneTimeListeners),m.call(this,e);let g=this._eventedParent;g&&(Xt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),g.fire(e))}else e instanceof Zt&&console.error(e.error);return this}listens(e){var i,o,n,l,h;return((o=(i=this._listeners)===null||i===void 0?void 0:i[e])===null||o===void 0?void 0:o.length)>0||((l=(n=this._oneTimeListeners)===null||n===void 0?void 0:n[e])===null||l===void 0?void 0:l.length)>0||((h=this._eventedParent)===null||h===void 0?void 0:h.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var he={$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},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","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};let $i=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Jr(r,e){let i={};for(let o in r)o!=="ref"&&(i[o]=r[o]);return $i.forEach((o=>{o in e&&(i[o]=e[o])})),i}function lt(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!lt(r[i],e[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(let i in r)if(!lt(r[i],e[i]))return!1;return!0}return r===e}function Rt(r,e){r.push(e)}function Kt(r,e,i){Rt(i,{command:"addSource",args:[r,e[r]]})}function Bi(r,e,i){Rt(e,{command:"removeSource",args:[r]}),i[r]=!0}function sa(r,e,i,o){Bi(r,i,o),Kt(r,e,i)}function ho(r,e,i){let o;for(o in r[i])if(Object.prototype.hasOwnProperty.call(r[i],o)&&o!=="data"&&!lt(r[i][o],e[i][o]))return!1;for(o in e[i])if(Object.prototype.hasOwnProperty.call(e[i],o)&&o!=="data"&&!lt(r[i][o],e[i][o]))return!1;return!0}function Wi(r,e,i,o,n,l){r=r||{},e=e||{};for(let h in r)Object.prototype.hasOwnProperty.call(r,h)&&(lt(r[h],e[h])||i.push({command:l,args:[o,h,e[h],n]}));for(let h in e)Object.prototype.hasOwnProperty.call(e,h)&&!Object.prototype.hasOwnProperty.call(r,h)&&(lt(r[h],e[h])||i.push({command:l,args:[o,h,e[h],n]}))}function po(r){return r.id}function la(r,e){return r[e.id]=e,r}class ze{constructor(e,i,o,n){this.message=(e?`${e}: `:"")+o,n&&(this.identifier=n),i!=null&&i.__line__&&(this.line=i.__line__)}}function Qr(r,...e){for(let i of e)for(let o in i)r[o]=i[o];return r}class kr extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class xl{constructor(e,i=[]){this.parent=e,this.bindings={};for(let[o,n]of i)this.bindings[o]=n}concat(e){return new xl(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)}}let fo={kind:"null"},Be={kind:"number"},pt={kind:"string"},wt={kind:"boolean"},Oi={kind:"color"},Xn={kind:"projectionDefinition"},ca={kind:"object"},bt={kind:"value"},Yn={kind:"collator"},Jo={kind:"formatted"},mo={kind:"padding"},Qo={kind:"colorArray"},go={kind:"numberArray"},Za={kind:"resolvedImage"},en={kind:"variableAnchorOffsetCollection"};function dr(r,e){return{kind:"array",itemType:r,N:e}}function li(r){if(r.kind==="array"){let e=li(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}let Vc=[fo,Be,pt,wt,Oi,Xn,Jo,ca,dr(bt),mo,go,Qo,Za,en];function _o(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!_o(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(let i of Vc)if(!_o(i,e))return null}}return`Expected ${li(r)} but found ${li(e)} instead.`}function Kn(r,e){return e.some((i=>i.kind===r.kind))}function Ia(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function ua(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}let za=.96422,tn=.82521,wl=4/29,Aa=6/29,Uc=3*Aa*Aa,Jn=Aa*Aa*Aa,yh=Math.PI/180,yo=180/Math.PI;function Qn(r){return(r%=360)<0&&(r+=360),r}function ki([r,e,i,o]){let n,l,h=es((.2225045*(r=Tl(r))+.7168786*(e=Tl(e))+.0606169*(i=Tl(i)))/1);r===e&&e===i?n=l=h:(n=es((.4360747*r+.3850649*e+.1430804*i)/za),l=es((.0139322*r+.0971045*e+.7141733*i)/tn));let p=116*h-16;return[p<0?0:p,500*(n-h),200*(h-l),o]}function Tl(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function es(r){return r>Jn?Math.pow(r,1/3):r/Uc+wl}function vo([r,e,i,o]){let n=(r+16)/116,l=isNaN(e)?n:n+e/500,h=isNaN(i)?n:n-i/200;return n=1*Sl(n),l=za*Sl(l),h=tn*Sl(h),[ts(3.1338561*l-1.6168667*n-.4906146*h),ts(-.9787684*l+1.9161415*n+.033454*h),ts(.0719453*l-.2289914*n+1.4052427*h),o]}function ts(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Sl(r){return r>Aa?r*r*r:Uc*(r-wl)}let vh=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function bo(r,e){return vh(r,e)?r[e]:void 0}function is(r){return parseInt(r.padEnd(2,r),16)/255}function Pl(r,e){return xo(e?r/100:r,0,1)}function xo(r,e,i){return Math.min(Math.max(e,r),i)}function qc(r){return!r.some(Number.isNaN)}let bh={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 ka(r,e,i){return r+i*(e-r)}function wo(r,e,i){return r.map(((o,n)=>ka(o,e[n],i)))}class Ct{constructor(e,i,o,n=1,l=!0){this.r=e,this.g=i,this.b=o,this.a=n,l||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,i,o,n]))}static parse(e){if(e instanceof Ct)return e;if(typeof e!="string")return;let i=(function(o){if((o=o.toLowerCase().trim())==="transparent")return[0,0,0,0];let n=bo(bh,o);if(n){let[h,p,g]=n;return[h/255,p/255,g/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){let h=o.length<6?1:2,p=1;return[is(o.slice(p,p+=h)),is(o.slice(p,p+=h)),is(o.slice(p,p+=h)),is(o.slice(p,p+h)||"ff")]}if(o.startsWith("rgb")){let h=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){let[p,g,m,v,_,T,x,M,C,D,L,N]=h,F=[v||" ",x||" ",D].join("");if(F===" "||F===" /"||F===",,"||F===",,,"){let j=[m,T,C].join(""),U=j==="%%%"?100:j===""?255:0;if(U){let G=[xo(+g/U,0,1),xo(+_/U,0,1),xo(+M/U,0,1),L?Pl(+L,N):1];if(qc(G))return G}}return}}let l=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(l){let[h,p,g,m,v,_,T,x,M]=l,C=[g||" ",v||" ",T].join("");if(C===" "||C===" /"||C===",,"||C===",,,"){let D=[+p,xo(+m,0,100),xo(+_,0,100),x?Pl(+x,M):1];if(qc(D))return(function([L,N,F,j]){function U(G){let re=(G+L/30)%12,oe=N*Math.min(F,1-F);return F-oe*Math.max(-1,Math.min(re-3,9-re,1))}return L=Qn(L),N/=100,F/=100,[U(0),U(8),U(4),j]})(D)}}})(e);return i?new Ct(...i,!1):void 0}get rgb(){let{r:e,g:i,b:o,a:n}=this,l=n||1/0;return this.overwriteGetter("rgb",[e/l,i/l,o/l,n])}get hcl(){return this.overwriteGetter("hcl",(function(e){let[i,o,n,l]=ki(e),h=Math.sqrt(o*o+n*n);return[Math.round(1e4*h)?Qn(Math.atan2(n,o)*yo):NaN,h,i,l]})(this.rgb))}get lab(){return this.overwriteGetter("lab",ki(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){let[e,i,o,n]=this.rgb;return`rgba(${[e,i,o].map((l=>Math.round(255*l))).join(",")},${n})`}static interpolate(e,i,o,n="rgb"){switch(n){case"rgb":{let[l,h,p,g]=wo(e.rgb,i.rgb,o);return new Ct(l,h,p,g,!1)}case"hcl":{let[l,h,p,g]=e.hcl,[m,v,_,T]=i.hcl,x,M;if(isNaN(l)||isNaN(m))isNaN(l)?isNaN(m)?x=NaN:(x=m,p!==1&&p!==0||(M=v)):(x=l,_!==1&&_!==0||(M=h));else{let F=m-l;m>l&&F>180?F-=360:m<l&&l-m>180&&(F+=360),x=l+o*F}let[C,D,L,N]=(function([F,j,U,G]){return F=isNaN(F)?0:F*yh,vo([U,Math.cos(F)*j,Math.sin(F)*j,G])})([x,M??ka(h,v,o),ka(p,_,o),ka(g,T,o)]);return new Ct(C,D,L,N,!1)}case"lab":{let[l,h,p,g]=vo(wo(e.lab,i.lab,o));return new Ct(l,h,p,g,!1)}}}}Ct.black=new Ct(0,0,0,1),Ct.white=new Ct(1,1,1,1),Ct.transparent=new Ct(0,0,0,0),Ct.red=new Ct(1,0,0,1);class Ml{constructor(e,i,o){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let Gc=["bottom","center","top"];class $a{constructor(e,i,o,n,l,h){this.text=e,this.image=i,this.scale=o,this.fontStack=n,this.textColor=l,this.verticalAlign=h}}class Dr{constructor(e){this.sections=e}static fromString(e){return new Dr([new $a(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 Dr?e:Dr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class pr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof pr)return e;if(typeof e=="number")return new pr([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let i of e)if(typeof i!="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 pr(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new pr(wo(e.values,i.values,o))}}class Di{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Di)return e;if(typeof e=="number")return new Di([e]);if(Array.isArray(e)){for(let i of e)if(typeof i!="number")return;return new Di(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new Di(wo(e.values,i.values,o))}}class Hi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Hi)return e;if(typeof e=="string"){let o=Ct.parse(e);return o?new Hi([o]):void 0}if(!Array.isArray(e))return;let i=[];for(let o of e){if(typeof o!="string")return;let n=Ct.parse(o);if(!n)return;i.push(n)}return new Hi(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o,n="rgb"){let l=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let h=0;h<e.values.length;h++)l.push(Ct.interpolate(e.values[h],i.values[h],o,n));return new Hi(l)}}class pi extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}let xh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class fr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof fr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){let o=e[i],n=e[i+1];if(typeof o!="string"||!xh.has(o)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new fr(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){let n=e.values,l=i.values;if(n.length!==l.length)throw new pi(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);let h=[];for(let p=0;p<n.length;p+=2){if(n[p]!==l[p])throw new pi(`Cannot interpolate values containing mismatched anchors. from[${p}]: ${n[p]}, to[${p}]: ${l[p]}`);h.push(n[p]);let[g,m]=n[p+1],[v,_]=l[p+1];h.push([ka(g,v,o),ka(m,_,o)])}return new fr(h)}}class Lr{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Lr({name:e,available:!1}):null}}class bi{constructor(e,i,o){this.from=e,this.to=i,this.transition=o}static interpolate(e,i,o){return new bi(e,i,o)}static parse(e){return e instanceof bi?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new bi(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new bi(e.from,e.to,e.transition):typeof e=="string"?new bi(e,e,1):void 0}}function zt(r,e,i,o){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[r,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[r,e,i,o]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ha(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof bi||r instanceof Ct||r instanceof Ml||r instanceof Dr||r instanceof pr||r instanceof Di||r instanceof Hi||r instanceof fr||r instanceof Lr)return!0;if(Array.isArray(r)){for(let e of r)if(!ha(e))return!1;return!0}if(typeof r=="object"){for(let e in r)if(!ha(r[e]))return!1;return!0}return!1}function Jt(r){if(r===null)return fo;if(typeof r=="string")return pt;if(typeof r=="boolean")return wt;if(typeof r=="number")return Be;if(r instanceof Ct)return Oi;if(r instanceof bi)return Xn;if(r instanceof Ml)return Yn;if(r instanceof Dr)return Jo;if(r instanceof pr)return mo;if(r instanceof Di)return go;if(r instanceof Hi)return Qo;if(r instanceof fr)return en;if(r instanceof Lr)return Za;if(Array.isArray(r)){let e=r.length,i;for(let o of r){let n=Jt(o);if(i){if(i===n)continue;i=bt;break}i=n}return dr(i||bt,e)}return ca}function To(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof Ct||r instanceof bi||r instanceof Dr||r instanceof pr||r instanceof Di||r instanceof Hi||r instanceof fr||r instanceof Lr?r.toString():JSON.stringify(r)}class Da{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ha(e[1]))return i.error("invalid value");let o=e[1],n=Jt(o),l=i.expectedType;return n.kind!=="array"||n.N!==0||!l||l.kind!=="array"||typeof l.N=="number"&&l.N!==0||(n=l),new Da(n,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let So={string:pt,number:Be,boolean:wt,object:ca};class mr{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o,n=1,l=e[0];if(l==="array"){let p,g;if(e.length>2){let m=e[1];if(typeof m!="string"||!(m in So)||m==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=So[m],n++}else p=bt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);g=e[2],n++}o=dr(p,g)}else{if(!So[l])throw new Error(`Types doesn't contain name = ${l}`);o=So[l]}let h=[];for(;n<e.length;n++){let p=i.parse(e[n],n,bt);if(!p)return null;h.push(p)}return new mr(o,h)}evaluate(e){for(let i=0;i<this.args.length;i++){let o=this.args[i].evaluate(e);if(!_o(this.type,Jt(o)))return o;if(i===this.args.length-1)throw new pi(`Expected value to be of type ${li(this.type)}, but found ${li(Jt(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let rn={"to-boolean":wt,"to-color":Oi,"to-number":Be,"to-string":pt};class ga{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=e[0];if(!rn[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return i.error("Expected one argument.");let n=rn[o],l=[];for(let h=1;h<e.length;h++){let p=i.parse(e[h],h,bt);if(!p)return null;l.push(p)}return new ga(n,l)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,o;for(let n of this.args){if(i=n.evaluate(e),o=null,i instanceof Ct)return i;if(typeof i=="string"){let l=e.parseColor(i);if(l)return l}else if(Array.isArray(i)&&(o=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:zt(i[0],i[1],i[2],i[3]),!o))return new Ct(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new pi(o||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(let o of this.args){i=o.evaluate(e);let n=pr.parse(i);if(n)return n}throw new pi(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(let o of this.args){i=o.evaluate(e);let n=Di.parse(i);if(n)return n}throw new pi(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(let o of this.args){i=o.evaluate(e);let n=Hi.parse(i);if(n)return n}throw new pi(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(let o of this.args){i=o.evaluate(e);let n=fr.parse(i);if(n)return n}throw new pi(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(let o of this.args){if(i=o.evaluate(e),i===null)return 0;let n=Number(i);if(!isNaN(n))return n}throw new pi(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Dr.fromString(To(this.args[0].evaluate(e)));case"resolvedImage":return Lr.fromString(To(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return To(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let Cl=["Unknown","Point","LineString","Polygon"];class an{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"?Cl[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 i=this._parseColorCache.get(e);return i||(i=Ct.parse(e),this._parseColorCache.set(e,i)),i}}class rs{constructor(e,i,o=[],n,l=new xl,h=[]){this.registry=e,this.path=o,this.key=o.map((p=>`[${p}]`)).join(""),this.scope=l,this.errors=h,this.expectedType=n,this._isConstant=i}parse(e,i,o,n,l={}){return i?this.concat(i,o,n)._parse(e,l):this._parse(e,l)}_parse(e,i){function o(n,l,h){return h==="assert"?new mr(l,[n]):h==="coerce"?new ga(l,[n]):n}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", []].');let n=e[0];if(typeof n!="string")return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let l=this.registry[n];if(l){let h=l.parse(e,this);if(!h)return null;if(this.expectedType){let p=this.expectedType,g=h.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||g.kind!=="value"){if(p.kind==="projectionDefinition"&&["string","array"].includes(g.kind)||["color","formatted","resolvedImage"].includes(p.kind)&&["value","string"].includes(g.kind)||["padding","numberArray"].includes(p.kind)&&["value","number","array"].includes(g.kind)||p.kind==="colorArray"&&["value","string","array"].includes(g.kind)||p.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(g.kind))h=o(h,p,i.typeAnnotation||"coerce");else if(this.checkSubtype(p,g))return null}else h=o(h,p,i.typeAnnotation||"assert")}if(!(h instanceof Da)&&h.type.kind!=="resolvedImage"&&this._isConstant(h)){let p=new an;try{h=new Da(h.type,h.evaluate(p))}catch(g){return this.error(g.message),null}}return h}return this.error(`Unknown expression "${n}". 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,i,o){let n=typeof e=="number"?this.path.concat(e):this.path,l=o?this.scope.concat(o):this.scope;return new rs(this.registry,this._isConstant,n,i||null,l,this.errors)}error(e,...i){let o=`${this.key}${i.map((n=>`[${n}]`)).join("")}`;this.errors.push(new kr(o,e))}checkSubtype(e,i){let o=_o(e,i);return o&&this.error(o),o}}class Wa{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let o=[];for(let l=1;l<e.length-1;l+=2){let h=e[l];if(typeof h!="string")return i.error(`Expected string, but found ${typeof h} instead.`,l);if(/[^a-zA-Z0-9_]/.test(h))return i.error("Variable names must contain only alphanumeric characters or '_'.",l);let p=i.parse(e[l+1],l+1);if(!p)return null;o.push([h,p])}let n=i.parse(e[e.length-1],e.length-1,i.expectedType,o);return n?new Wa(o,n):null}outputDefined(){return this.result.outputDefined()}}class _a{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");let o=e[1];return i.scope.has(o)?new _a(o,i.scope.get(o)):i.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class as{constructor(e,i,o){this.type=e,this.index=i,this.input=o}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,Be),n=i.parse(e[2],2,dr(i.expectedType||bt));return o&&n?new as(n.type.itemType,o,n):null}evaluate(e){let i=this.index.evaluate(e),o=this.input.evaluate(e);if(i<0)throw new pi(`Array index out of bounds: ${i} < 0.`);if(i>=o.length)throw new pi(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i!==Math.floor(i))throw new pi(`Array index must be an integer, but found ${i} instead.`);return o[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class os{constructor(e,i){this.type=wt,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,bt),n=i.parse(e[2],2,bt);return o&&n?Kn(o.type,[wt,pt,Be,fo,bt])?new os(o,n):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${li(o.type)} instead`):null}evaluate(e){let i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Ia(i,["boolean","string","number","null"]))throw new pi(`Expected first argument to be of type boolean, string, number or null, but found ${li(Jt(i))} instead.`);if(!Ia(o,["string","array"]))throw new pi(`Expected second argument to be of type array or string, but found ${li(Jt(o))} instead.`);return o.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class on{constructor(e,i,o){this.type=Be,this.needle=e,this.haystack=i,this.fromIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,bt),n=i.parse(e[2],2,bt);if(!o||!n)return null;if(!Kn(o.type,[wt,pt,Be,fo,bt]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${li(o.type)} instead`);if(e.length===4){let l=i.parse(e[3],3,Be);return l?new on(o,n,l):null}return new on(o,n)}evaluate(e){let i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Ia(i,["boolean","string","number","null"]))throw new pi(`Expected first argument to be of type boolean, string, number or null, but found ${li(Jt(i))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Ia(o,["string"])){let l=o.indexOf(i,n);return l===-1?-1:[...o.slice(0,l)].length}if(Ia(o,["array"]))return o.indexOf(i,n);throw new pi(`Expected second argument to be of type array or string, but found ${li(Jt(o))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Po{constructor(e,i,o,n,l,h){this.inputType=e,this.type=i,this.input=o,this.cases=n,this.outputs=l,this.otherwise=h}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let o,n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);let l={},h=[];for(let m=2;m<e.length-1;m+=2){let v=e[m],_=e[m+1];Array.isArray(v)||(v=[v]);let T=i.concat(m);if(v.length===0)return T.error("Expected at least one branch label.");for(let M of v){if(typeof M!="number"&&typeof M!="string")return T.error("Branch labels must be numbers or strings.");if(typeof M=="number"&&Math.abs(M)>Number.MAX_SAFE_INTEGER)return T.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return T.error("Numeric branch labels must be integer values.");if(o){if(T.checkSubtype(o,Jt(M)))return null}else o=Jt(M);if(l[String(M)]!==void 0)return T.error("Branch labels must be unique.");l[String(M)]=h.length}let x=i.parse(_,m,n);if(!x)return null;n=n||x.type,h.push(x)}let p=i.parse(e[1],1,bt);if(!p)return null;let g=i.parse(e[e.length-1],e.length-1,n);return g?p.type.kind!=="value"&&i.concat(1).checkSubtype(o,p.type)?null:new Po(o,n,p,l,h,g):null}evaluate(e){let i=this.input.evaluate(e);return(Jt(i)===this.inputType&&this.outputs[this.cases[i]]||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 ii{constructor(e,i,o){this.type=e,this.branches=i,this.otherwise=o}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);let n=[];for(let h=1;h<e.length-1;h+=2){let p=i.parse(e[h],h,wt);if(!p)return null;let g=i.parse(e[h+1],h+1,o);if(!g)return null;n.push([p,g]),o=o||g.type}let l=i.parse(e[e.length-1],e.length-1,o);if(!l)return null;if(!o)throw new Error("Can't infer output type");return new ii(o,n,l)}evaluate(e){for(let[i,o]of this.branches)if(i.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[i,o]of this.branches)e(i),e(o);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class Mo{constructor(e,i,o,n){this.type=e,this.input=i,this.beginIndex=o,this.endIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,bt),n=i.parse(e[2],2,Be);if(!o||!n)return null;if(!Kn(o.type,[dr(bt),pt,bt]))return i.error(`Expected first argument to be of type array or string, but found ${li(o.type)} instead`);if(e.length===4){let l=i.parse(e[3],3,Be);return l?new Mo(o.type,o,n,l):null}return new Mo(o.type,o,n)}evaluate(e){let i=this.input.evaluate(e),o=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Ia(i,["string"]))return[...i].slice(o,n).join("");if(Ia(i,["array"]))return i.slice(o,n);throw new pi(`Expected first argument to be of type array or string, but found ${li(Jt(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function At(r,e){let i=r.length-1,o,n,l=0,h=i,p=0;for(;l<=h;)if(p=Math.floor((l+h)/2),o=r[p],n=r[p+1],o<=e){if(p===i||e<n)return p;l=p+1}else{if(!(o>e))throw new pi("Input is not a number.");h=p-1}return 0}class yt{constructor(e,i,o){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(let[n,l]of o)this.labels.push(n),this.outputs.push(l)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");let o=i.parse(e[1],1,Be);if(!o)return null;let n=[],l=null;i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);for(let h=1;h<e.length;h+=2){let p=h===1?-1/0:e[h],g=e[h+1],m=h,v=h+1;if(typeof p!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',m);if(n.length&&n[n.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',m);let _=i.parse(g,v,l);if(!_)return null;l=l||_.type,n.push([p,_])}return new yt(l,o,n)}evaluate(e){let i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);let n=this.input.evaluate(e);if(n<=i[0])return o[0].evaluate(e);let l=i.length;return n>=i[l-1]?o[l-1].evaluate(e):o[At(i,n)].evaluate(e)}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function El(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ft,da,Il=(function(){if(da)return Ft;function r(e,i,o,n){this.cx=3*e,this.bx=3*(o-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(n-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=o,this.p2y=n}return da=1,Ft=r,r.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,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,n=0;n<8;n++){var l=this.sampleCurveX(o)-e;if(Math.abs(l)<i)return o;var h=this.sampleCurveDerivativeX(o);if(Math.abs(h)<1e-6)break;o-=l/h}var p=0,g=1;for(o=e,n=0;n<20&&(l=this.sampleCurveX(o),!(Math.abs(l-e)<i));n++)e>l?p=o:g=o,o=.5*(g-p)+p;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Ft})(),ns=El(Il);class gr{constructor(e,i,o,n,l){this.type=e,this.operator=i,this.interpolation=o,this.input=n,this.labels=[],this.outputs=[];for(let[h,p]of l)this.labels.push(h),this.outputs.push(p)}static interpolationFactor(e,i,o,n){let l=0;if(e.name==="exponential")l=nn(i,e.base,o,n);else if(e.name==="linear")l=nn(i,1,o,n);else if(e.name==="cubic-bezier"){let h=e.controlPoints;l=new ns(h[0],h[1],h[2],h[3]).solve(nn(i,1,o,n))}return l}static parse(e,i){let[o,n,l,...h]=e;if(!Array.isArray(n)||n.length===0)return i.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let m=n[1];if(typeof m!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:m}}else{if(n[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(n[0])}`,1,0);{let m=n.slice(1);if(m.length!==4||m.some((v=>typeof v!="number"||v<0||v>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:m}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(l=i.parse(l,2,Be),!l)return null;let p=[],g=null;o!=="interpolate-hcl"&&o!=="interpolate-lab"||i.expectedType==Qo?i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType):g=Oi;for(let m=0;m<h.length;m+=2){let v=h[m],_=h[m+1],T=m+3,x=m+4;if(typeof v!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(p.length&&p[p.length-1][0]>=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',T);let M=i.parse(_,x,g);if(!M)return null;g=g||M.type,p.push([v,M])}return ua(g,Be)||ua(g,Xn)||ua(g,Oi)||ua(g,mo)||ua(g,go)||ua(g,Qo)||ua(g,en)||ua(g,dr(Be))?new gr(g,o,n,l,p):i.error(`Type ${li(g)} is not interpolatable.`)}evaluate(e){let i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);let n=this.input.evaluate(e);if(n<=i[0])return o[0].evaluate(e);let l=i.length;if(n>=i[l-1])return o[l-1].evaluate(e);let h=At(i,n),p=gr.interpolationFactor(this.interpolation,n,i[h],i[h+1]),g=o[h].evaluate(e),m=o[h+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return ka(g,m,p);case"color":return Ct.interpolate(g,m,p);case"padding":return pr.interpolate(g,m,p);case"colorArray":return Hi.interpolate(g,m,p);case"numberArray":return Di.interpolate(g,m,p);case"variableAnchorOffsetCollection":return fr.interpolate(g,m,p);case"array":return wo(g,m,p);case"projectionDefinition":return bi.interpolate(g,m,p)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ct.interpolate(g,m,p,"hcl");case"colorArray":return Hi.interpolate(g,m,p,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ct.interpolate(g,m,p,"lab");case"colorArray":return Hi.interpolate(g,m,p,"lab")}}}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function nn(r,e,i,o){let n=o-i,l=r-i;return n===0?0:e===1?l/n:(Math.pow(e,l)-1)/(Math.pow(e,n)-1)}let ea={color:Ct.interpolate,number:ka,padding:pr.interpolate,numberArray:Di.interpolate,colorArray:Hi.interpolate,variableAnchorOffsetCollection:fr.interpolate,array:wo};class ss{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=null,n=i.expectedType;n&&n.kind!=="value"&&(o=n);let l=[];for(let p of e.slice(1)){let g=i.parse(p,1+l.length,o,void 0,{typeAnnotation:"omit"});if(!g)return null;o=o||g.type,l.push(g)}if(!o)throw new Error("No output type");let h=n&&l.some((p=>_o(n,p.type)));return new ss(h?bt:o,l)}evaluate(e){let i,o=null,n=0;for(let l of this.args)if(n++,o=l.evaluate(e),o&&o instanceof Lr&&!o.available&&(i||(i=o.name),o=null,n===this.args.length&&(o=i)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function zl(r,e){return r==="=="||r==="!="?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 Al(r,e,i,o){return o.compare(e,i)===0}function Rr(r,e,i){let o=r!=="=="&&r!=="!=";return class Wm{constructor(l,h,p){this.type=wt,this.lhs=l,this.rhs=h,this.collator=p,this.hasUntypedArgument=l.type.kind==="value"||h.type.kind==="value"}static parse(l,h){if(l.length!==3&&l.length!==4)return h.error("Expected two or three arguments.");let p=l[0],g=h.parse(l[1],1,bt);if(!g)return null;if(!zl(p,g.type))return h.concat(1).error(`"${p}" comparisons are not supported for type '${li(g.type)}'.`);let m=h.parse(l[2],2,bt);if(!m)return null;if(!zl(p,m.type))return h.concat(2).error(`"${p}" comparisons are not supported for type '${li(m.type)}'.`);if(g.type.kind!==m.type.kind&&g.type.kind!=="value"&&m.type.kind!=="value")return h.error(`Cannot compare types '${li(g.type)}' and '${li(m.type)}'.`);o&&(g.type.kind==="value"&&m.type.kind!=="value"?g=new mr(m.type,[g]):g.type.kind!=="value"&&m.type.kind==="value"&&(m=new mr(g.type,[m])));let v=null;if(l.length===4){if(g.type.kind!=="string"&&m.type.kind!=="string"&&g.type.kind!=="value"&&m.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(v=h.parse(l[3],3,Yn),!v)return null}return new Wm(g,m,v)}evaluate(l){let h=this.lhs.evaluate(l),p=this.rhs.evaluate(l);if(o&&this.hasUntypedArgument){let g=Jt(h),m=Jt(p);if(g.kind!==m.kind||g.kind!=="string"&&g.kind!=="number")throw new pi(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${g.kind}, ${m.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){let g=Jt(h),m=Jt(p);if(g.kind!=="string"||m.kind!=="string")return e(l,h,p)}return this.collator?i(l,h,p,this.collator.evaluate(l)):e(l,h,p)}eachChild(l){l(this.lhs),l(this.rhs),this.collator&&l(this.collator)}outputDefined(){return!0}}}let er=Rr("==",(function(r,e,i){return e===i}),Al),ls=Rr("!=",(function(r,e,i){return e!==i}),(function(r,e,i,o){return!Al(0,e,i,o)})),Zc=Rr("<",(function(r,e,i){return e<i}),(function(r,e,i,o){return o.compare(e,i)<0})),cs=Rr(">",(function(r,e,i){return e>i}),(function(r,e,i,o){return o.compare(e,i)>0})),Ni=Rr("<=",(function(r,e,i){return e<=i}),(function(r,e,i,o){return o.compare(e,i)<=0})),$c=Rr(">=",(function(r,e,i){return e>=i}),(function(r,e,i,o){return o.compare(e,i)>=0}));class Co{constructor(e,i,o){this.type=Yn,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");let o=e[1];if(typeof o!="object"||Array.isArray(o))return i.error("Collator options argument must be an object.");let n=i.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,wt);if(!n)return null;let l=i.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,wt);if(!l)return null;let h=null;return o.locale&&(h=i.parse(o.locale,1,pt),!h)?null:new Co(n,l,h)}evaluate(e){return new Ml(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 us{constructor(e,i,o,n,l,h){this.type=pt,this.number=e,this.locale=i,this.currency=o,this.unit=n,this.minFractionDigits=l,this.maxFractionDigits=h}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");let o=i.parse(e[1],1,Be);if(!o)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return i.error("NumberFormat options argument must be an object.");let l=null;if(n.locale&&(l=i.parse(n.locale,1,pt),!l))return null;let h=null;if(n.currency&&(h=i.parse(n.currency,1,pt),!h))return null;let p=null;if(n.unit&&(p=i.parse(n.unit,1,pt),!p))return null;if(h&&p)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let g=null;if(n["min-fraction-digits"]&&(g=i.parse(n["min-fraction-digits"],1,Be),!g))return null;let m=null;return n["max-fraction-digits"]&&(m=i.parse(n["max-fraction-digits"],1,Be),!m)?null:new us(o,l,h,p,g,m)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class hs{constructor(e){this.type=Jo,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=e[1];if(!Array.isArray(o)&&typeof o=="object")return i.error("First argument must be an image or text section.");let n=[],l=!1;for(let h=1;h<=e.length-1;++h){let p=e[h];if(l&&typeof p=="object"&&!Array.isArray(p)){l=!1;let g=null;if(p["font-scale"]&&(g=i.parse(p["font-scale"],1,Be),!g))return null;let m=null;if(p["text-font"]&&(m=i.parse(p["text-font"],1,dr(pt)),!m))return null;let v=null;if(p["text-color"]&&(v=i.parse(p["text-color"],1,Oi),!v))return null;let _=null;if(p["vertical-align"]){if(typeof p["vertical-align"]=="string"&&!Gc.includes(p["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${p["vertical-align"]}' instead.`);if(_=i.parse(p["vertical-align"],1,pt),!_)return null}let T=n[n.length-1];T.scale=g,T.font=m,T.textColor=v,T.verticalAlign=_}else{let g=i.parse(e[h],1,bt);if(!g)return null;let m=g.type.kind;if(m!=="string"&&m!=="value"&&m!=="null"&&m!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");l=!0,n.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new hs(n)}evaluate(e){return new Dr(this.sections.map((i=>{let o=i.content.evaluate(e);return Jt(o)===Za?new $a("",o,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new $a(To(o),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class La{constructor(e){this.type=Za,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");let o=i.parse(e[1],1,pt);return o?new La(o):i.error("No image name provided.")}evaluate(e){let i=this.input.evaluate(e),o=Lr.fromString(i);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(i)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Eo{constructor(e){this.type=Be,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let o=i.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${li(o.type)} instead.`):new Eo(o):null}evaluate(e){let i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new pi(`Expected value to be of type string or array, but found ${li(Jt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let qr=8192;function wh(r,e){let i=(180+r[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*qr),Math.round(o*n*qr)]}function ds(r,e){let i=Math.pow(2,e.z);return[(n=(r[0]/qr+e.x)/i,360*n-180),(o=(r[1]/qr+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90)];var o,n}function Ra(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function Fa(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function ta(r,e,i){let o=r[0]-e[0],n=r[1]-e[1],l=r[0]-i[0],h=r[1]-i[1];return o*h-l*n==0&&o*l<=0&&n*h<=0}function sn(r,e,i,o){return(n=[o[0]-i[0],o[1]-i[1]])[0]*(l=[e[0]-r[0],e[1]-r[1]])[1]-n[1]*l[0]!=0&&!(!Hc(r,e,i,o)||!Hc(i,o,r,e));var n,l}function ps(r,e,i){for(let o of i)for(let n=0;n<o.length-1;++n)if(sn(r,e,o[n],o[n+1]))return!0;return!1}function Io(r,e,i=!1){let o=!1;for(let p of e)for(let g=0;g<p.length-1;g++){if(ta(r,p[g],p[g+1]))return i;(l=p[g])[1]>(n=r)[1]!=(h=p[g+1])[1]>n[1]&&n[0]<(h[0]-l[0])*(n[1]-l[1])/(h[1]-l[1])+l[0]&&(o=!o)}var n,l,h;return o}function kl(r,e){for(let i of e)if(Io(r,i))return!0;return!1}function Wc(r,e){for(let i of r)if(!Io(i,e))return!1;for(let i=0;i<r.length-1;++i)if(ps(r[i],r[i+1],e))return!1;return!0}function Th(r,e){for(let i of e)if(Wc(r,i))return!0;return!1}function Hc(r,e,i,o){let n=o[0]-i[0],l=o[1]-i[1],h=(r[0]-i[0])*l-n*(r[1]-i[1]),p=(e[0]-i[0])*l-n*(e[1]-i[1]);return h>0&&p<0||h<0&&p>0}function Dl(r,e,i){let o=[];for(let n=0;n<r.length;n++){let l=[];for(let h=0;h<r[n].length;h++){let p=wh(r[n][h],i);Ra(e,p),l.push(p)}o.push(l)}return o}function ln(r,e,i){let o=[];for(let n=0;n<r.length;n++){let l=Dl(r[n],e,i);o.push(l)}return o}function Xc(r,e,i,o){if(r[0]<i[0]||r[0]>i[2]){let n=.5*o,l=r[0]-i[0]>n?-o:i[0]-r[0]>n?o:0;l===0&&(l=r[0]-i[2]>n?-o:i[2]-r[0]>n?o:0),r[0]+=l}Ra(e,r)}function Ll(r,e,i,o){let n=Math.pow(2,o.z)*qr,l=[o.x*qr,o.y*qr],h=[];for(let p of r)for(let g of p){let m=[g.x+l[0],g.y+l[1]];Xc(m,e,i,n),h.push(m)}return h}function Rl(r,e,i,o){let n=Math.pow(2,o.z)*qr,l=[o.x*qr,o.y*qr],h=[];for(let g of r){let m=[];for(let v of g){let _=[v.x+l[0],v.y+l[1]];Ra(e,_),m.push(_)}h.push(m)}if(e[2]-e[0]<=n/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(let g of h)for(let m of g)Xc(m,e,i,n)}var p;return h}class Ha{constructor(e,i){this.type=wt,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ha(e[1])){let o=e[1];if(o.type==="FeatureCollection"){let n=[];for(let l of o.features){let{type:h,coordinates:p}=l.geometry;h==="Polygon"&&n.push(p),h==="MultiPolygon"&&n.push(...p)}if(n.length)return new Ha(o,{type:"MultiPolygon",coordinates:n})}else if(o.type==="Feature"){let n=o.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new Ha(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new Ha(o,o)}return i.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(i,o){let n=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(o.type==="Polygon"){let p=Dl(o.coordinates,l,h),g=Ll(i.geometry(),n,l,h);if(!Fa(n,l))return!1;for(let m of g)if(!Io(m,p))return!1}if(o.type==="MultiPolygon"){let p=ln(o.coordinates,l,h),g=Ll(i.geometry(),n,l,h);if(!Fa(n,l))return!1;for(let m of g)if(!kl(m,p))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){let n=[1/0,1/0,-1/0,-1/0],l=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(o.type==="Polygon"){let p=Dl(o.coordinates,l,h),g=Rl(i.geometry(),n,l,h);if(!Fa(n,l))return!1;for(let m of g)if(!Wc(m,p))return!1}if(o.type==="MultiPolygon"){let p=ln(o.coordinates,l,h),g=Rl(i.geometry(),n,l,h);if(!Fa(n,l))return!1;for(let m of g)if(!Th(m,p))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Fl=class{constructor(r=[],e=(i,o)=>i<o?-1:i>o?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;let r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){let{data:e,compare:i}=this,o=e[r];for(;r>0;){let n=r-1>>1,l=e[n];if(i(o,l)>=0)break;e[r]=l,r=n}e[r]=o}_down(r){let{data:e,compare:i}=this,o=this.length>>1,n=e[r];for(;r<o;){let l=1+(r<<1),h=l+1;if(h<this.length&&i(e[h],e[l])<0&&(l=h),i(e[l],n)>=0)break;e[r]=e[l],r=l}e[r]=n}};function Yc(r,e,i=0,o=r.length-1,n=Sh){for(;o>i;){if(o-i>600){let g=o-i+1,m=e-i+1,v=Math.log(g),_=.5*Math.exp(2*v/3),T=.5*Math.sqrt(v*_*(g-_)/g)*(m-g/2<0?-1:1);Yc(r,e,Math.max(i,Math.floor(e-m*_/g+T)),Math.min(o,Math.floor(e+(g-m)*_/g+T)),n)}let l=r[e],h=i,p=o;for(cn(r,i,e),n(r[o],l)>0&&cn(r,i,o);h<p;){for(cn(r,h,p),h++,p--;n(r[h],l)<0;)h++;for(;n(r[p],l)>0;)p--}n(r[i],l)===0?cn(r,i,p):(p++,cn(r,p,o)),p<=e&&(i=p+1),e<=p&&(o=p-1)}}function cn(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}function Sh(r,e){return r<e?-1:r>e?1:0}function fs(r,e){if(r.length<=1)return[r];let i=[],o,n;for(let l of r){let h=Kc(l);h!==0&&(l.area=Math.abs(h),n===void 0&&(n=h<0),n===h<0?(o&&i.push(o),o=[l]):o.push(l))}if(o&&i.push(o),e>1)for(let l=0;l<i.length;l++)i[l].length<=e||(Yc(i[l],e,1,i[l].length-1,Ph),i[l]=i[l].slice(0,e));return i}function Ph(r,e){return e.area-r.area}function Kc(r){let e=0;for(let i,o,n=0,l=r.length,h=l-1;n<l;h=n++)i=r[n],o=r[h],e+=(o.x-i.x)*(i.y+o.y);return e}let Bl=1/298.257223563,Ol=Bl*(2-Bl),Jc=Math.PI/180;class Nl{constructor(e){let i=6378.137*Jc*1e3,o=Math.cos(e*Jc),n=1/(1-Ol*(1-o*o)),l=Math.sqrt(n);this.kx=i*l*o,this.ky=i*l*n*(1-Ol)}distance(e,i){let o=this.wrap(e[0]-i[0])*this.kx,n=(e[1]-i[1])*this.ky;return Math.sqrt(o*o+n*n)}pointOnLine(e,i){let o,n,l,h,p=1/0;for(let g=0;g<e.length-1;g++){let m=e[g][0],v=e[g][1],_=this.wrap(e[g+1][0]-m)*this.kx,T=(e[g+1][1]-v)*this.ky,x=0;_===0&&T===0||(x=(this.wrap(i[0]-m)*this.kx*_+(i[1]-v)*this.ky*T)/(_*_+T*T),x>1?(m=e[g+1][0],v=e[g+1][1]):x>0&&(m+=_/this.kx*x,v+=T/this.ky*x)),_=this.wrap(i[0]-m)*this.kx,T=(i[1]-v)*this.ky;let M=_*_+T*T;M<p&&(p=M,o=m,n=v,l=g,h=x)}return{point:[o,n],index:l,t:Math.max(0,Math.min(1,h))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Qc(r,e){return e[0]-r[0]}function ms(r){return r[1]-r[0]+1}function Gr(r,e){return r[1]>=r[0]&&r[1]<e}function jl(r,e){if(r[0]>r[1])return[null,null];let i=ms(r);if(e){if(i===2)return[r,null];let n=Math.floor(i/2);return[[r[0],r[0]+n],[r[0]+n,r[1]]]}if(i===1)return[r,null];let o=Math.floor(i/2)-1;return[[r[0],r[0]+o],[r[0]+o+1,r[1]]]}function Vl(r,e){if(!Gr(e,r.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let o=e[0];o<=e[1];++o)Ra(i,r[o]);return i}function Ul(r){let e=[1/0,1/0,-1/0,-1/0];for(let i of r)for(let o of i)Ra(e,o);return e}function eu(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function un(r,e,i){if(!eu(r)||!eu(e))return NaN;let o=0,n=0;return r[2]<e[0]&&(o=e[0]-r[2]),r[0]>e[2]&&(o=r[0]-e[2]),r[1]>e[3]&&(n=r[1]-e[3]),r[3]<e[1]&&(n=e[1]-r[3]),i.distance([0,0],[o,n])}function Ba(r,e,i){let o=i.pointOnLine(e,r);return i.distance(r,o.point)}function ql(r,e,i,o,n){let l=Math.min(Ba(r,[i,o],n),Ba(e,[i,o],n)),h=Math.min(Ba(i,[r,e],n),Ba(o,[r,e],n));return Math.min(l,h)}function Mh(r,e,i,o,n){if(!Gr(e,r.length)||!Gr(o,i.length))return 1/0;let l=1/0;for(let h=e[0];h<e[1];++h){let p=r[h],g=r[h+1];for(let m=o[0];m<o[1];++m){let v=i[m],_=i[m+1];if(sn(p,g,v,_))return 0;l=Math.min(l,ql(p,g,v,_,n))}}return l}function tu(r,e,i,o,n){if(!Gr(e,r.length)||!Gr(o,i.length))return NaN;let l=1/0;for(let h=e[0];h<=e[1];++h)for(let p=o[0];p<=o[1];++p)if(l=Math.min(l,n.distance(r[h],i[p])),l===0)return l;return l}function iu(r,e,i){if(Io(r,e,!0))return 0;let o=1/0;for(let n of e){let l=n[0],h=n[n.length-1];if(l!==h&&(o=Math.min(o,Ba(r,[h,l],i)),o===0))return o;let p=i.pointOnLine(n,r);if(o=Math.min(o,i.distance(r,p.point)),o===0)return o}return o}function Ch(r,e,i,o){if(!Gr(e,r.length))return NaN;for(let l=e[0];l<=e[1];++l)if(Io(r[l],i,!0))return 0;let n=1/0;for(let l=e[0];l<e[1];++l){let h=r[l],p=r[l+1];for(let g of i)for(let m=0,v=g.length,_=v-1;m<v;_=m++){let T=g[_],x=g[m];if(sn(h,p,T,x))return 0;n=Math.min(n,ql(h,p,T,x,o))}}return n}function ru(r,e){for(let i of r)for(let o of i)if(Io(o,e,!0))return!0;return!1}function Eh(r,e,i,o=1/0){let n=Ul(r),l=Ul(e);if(o!==1/0&&un(n,l,i)>=o)return o;if(Fa(n,l)){if(ru(r,e))return 0}else if(ru(e,r))return 0;let h=1/0;for(let p of r)for(let g=0,m=p.length,v=m-1;g<m;v=g++){let _=p[v],T=p[g];for(let x of e)for(let M=0,C=x.length,D=C-1;M<C;D=M++){let L=x[D],N=x[M];if(sn(_,T,L,N))return 0;h=Math.min(h,ql(_,T,L,N,i))}}return h}function Gl(r,e,i,o,n,l){if(!l)return;let h=un(Vl(o,l),n,i);h<e&&r.push([h,l,[0,0]])}function gs(r,e,i,o,n,l,h){if(!l||!h)return;let p=un(Vl(o,l),Vl(n,h),i);p<e&&r.push([p,l,h])}function _s(r,e,i,o,n=1/0){let l=Math.min(o.distance(r[0],i[0][0]),n);if(l===0)return l;let h=new Fl([[0,[0,r.length-1],[0,0]]],Qc),p=Ul(i);for(;h.length>0;){let g=h.pop();if(g[0]>=l)continue;let m=g[1],v=e?50:100;if(ms(m)<=v){if(!Gr(m,r.length))return NaN;if(e){let _=Ch(r,m,i,o);if(isNaN(_)||_===0)return _;l=Math.min(l,_)}else for(let _=m[0];_<=m[1];++_){let T=iu(r[_],i,o);if(l=Math.min(l,T),l===0)return 0}}else{let _=jl(m,e);Gl(h,l,o,r,p,_[0]),Gl(h,l,o,r,p,_[1])}}return l}function ys(r,e,i,o,n,l=1/0){let h=Math.min(l,n.distance(r[0],i[0]));if(h===0)return h;let p=new Fl([[0,[0,r.length-1],[0,i.length-1]]],Qc);for(;p.length>0;){let g=p.pop();if(g[0]>=h)continue;let m=g[1],v=g[2],_=e?50:100,T=o?50:100;if(ms(m)<=_&&ms(v)<=T){if(!Gr(m,r.length)&&Gr(v,i.length))return NaN;let x;if(e&&o)x=Mh(r,m,i,v,n),h=Math.min(h,x);else if(e&&!o){let M=r.slice(m[0],m[1]+1);for(let C=v[0];C<=v[1];++C)if(x=Ba(i[C],M,n),h=Math.min(h,x),h===0)return h}else if(!e&&o){let M=i.slice(v[0],v[1]+1);for(let C=m[0];C<=m[1];++C)if(x=Ba(r[C],M,n),h=Math.min(h,x),h===0)return h}else x=tu(r,m,i,v,n),h=Math.min(h,x)}else{let x=jl(m,e),M=jl(v,o);gs(p,h,n,r,i,x[0],M[0]),gs(p,h,n,r,i,x[0],M[1]),gs(p,h,n,r,i,x[1],M[0]),gs(p,h,n,r,i,x[1],M[1])}}return h}function Zl(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class kt{constructor(e,i){this.type=Be,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ha(e[1])){let o=e[1];if(o.type==="FeatureCollection")return new kt(o,o.features.map((n=>Zl(n.geometry))).flat());if(o.type==="Feature")return new kt(o,Zl(o.geometry));if("type"in o&&"coordinates"in o)return new kt(o,Zl(o))}return i.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(i,o){let n=i.geometry(),l=n.flat().map((g=>ds([g.x,g.y],i.canonical)));if(n.length===0)return NaN;let h=new Nl(l[0][1]),p=1/0;for(let g of o){switch(g.type){case"Point":p=Math.min(p,ys(l,!1,[g.coordinates],!1,h,p));break;case"LineString":p=Math.min(p,ys(l,!1,g.coordinates,!0,h,p));break;case"Polygon":p=Math.min(p,_s(l,!1,g.coordinates,h,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){let n=i.geometry(),l=n.flat().map((g=>ds([g.x,g.y],i.canonical)));if(n.length===0)return NaN;let h=new Nl(l[0][1]),p=1/0;for(let g of o){switch(g.type){case"Point":p=Math.min(p,ys(l,!0,[g.coordinates],!1,h,p));break;case"LineString":p=Math.min(p,ys(l,!0,g.coordinates,!0,h,p));break;case"Polygon":p=Math.min(p,_s(l,!0,g.coordinates,h,p))}if(p===0)return p}return p})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,o){let n=i.geometry();if(n.length===0||n[0].length===0)return NaN;let l=fs(n,0).map((g=>g.map((m=>m.map((v=>ds([v.x,v.y],i.canonical))))))),h=new Nl(l[0][0][0][1]),p=1/0;for(let g of o)for(let m of l){switch(g.type){case"Point":p=Math.min(p,_s([g.coordinates],!1,m,h,p));break;case"LineString":p=Math.min(p,_s(g.coordinates,!0,m,h,p));break;case"Polygon":p=Math.min(p,Eh(m,g.coordinates,h,p))}if(p===0)return p}return p})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class hn{constructor(e){this.type=bt,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let o=e[1];return o==null?i.error("Global state property must be defined."):typeof o!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new hn(o)}evaluate(e){var i;let o=(i=e.globals)===null||i===void 0?void 0:i.globalState;return o&&Object.keys(o).length!==0?bo(o,this.key):null}eachChild(){}outputDefined(){return!1}}let zo={"==":er,"!=":ls,">":cs,"<":Zc,">=":$c,"<=":Ni,array:mr,at:as,boolean:mr,case:ii,coalesce:ss,collator:Co,format:hs,image:La,in:os,"index-of":on,interpolate:gr,"interpolate-hcl":gr,"interpolate-lab":gr,length:Eo,let:Wa,literal:Da,match:Po,number:mr,"number-format":us,object:mr,slice:Mo,step:yt,string:mr,"to-boolean":ga,"to-color":ga,"to-number":ga,"to-string":ga,var:_a,within:Ha,distance:kt,"global-state":hn};class Zr{constructor(e,i,o,n){this.name=e,this.type=i,this._evaluate=o,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){let o=e[0],n=Zr.definitions[o];if(!n)return i.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);let l=Array.isArray(n)?n[0]:n.type,h=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,p=h.filter((([m])=>!Array.isArray(m)||m.length===e.length-1)),g=null;for(let[m,v]of p){g=new rs(i.registry,vs,i.path,null,i.scope);let _=[],T=!1;for(let x=1;x<e.length;x++){let M=e[x],C=Array.isArray(m)?m[x-1]:m.type,D=g.parse(M,1+_.length,C);if(!D){T=!0;break}_.push(D)}if(!T)if(Array.isArray(m)&&m.length!==_.length)g.error(`Expected ${m.length} arguments, but found ${_.length} instead.`);else{for(let x=0;x<_.length;x++){let M=Array.isArray(m)?m[x]:m.type,C=_[x];g.concat(x+1).checkSubtype(M,C.type)}if(g.errors.length===0)return new Zr(o,l,v,_)}}if(p.length===1)i.errors.push(...g.errors);else{let m=(p.length?p:h).map((([_])=>{return T=_,Array.isArray(T)?`(${T.map(li).join(", ")})`:`(${li(T.type)}...)`;var T})).join(" | "),v=[];for(let _=1;_<e.length;_++){let T=i.parse(e[_],1+v.length);if(!T)return null;v.push(li(T.type))}i.error(`Expected arguments of type ${m}, but found (${v.join(", ")}) instead.`)}return null}static register(e,i){Zr.definitions=i;for(let o in i)e[o]=Zr}}function au(r,[e,i,o,n]){e=e.evaluate(r),i=i.evaluate(r),o=o.evaluate(r);let l=n?n.evaluate(r):1,h=zt(e,i,o,l);if(h)throw new pi(h);return new Ct(e/255,i/255,o/255,l,!1)}function ou(r,e){return r in e}function $l(r,e){let i=e[r];return i===void 0?null:i}function Xa(r){return{type:r}}function vs(r){if(r instanceof _a)return vs(r.boundExpression);if(r instanceof Zr&&r.name==="error"||r instanceof Co||r instanceof Ha||r instanceof kt||r instanceof hn)return!1;let e=r instanceof ga||r instanceof mr,i=!0;return r.eachChild((o=>{i=e?i&&vs(o):i&&o instanceof Da})),!!i&&bs(r)&&xs(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function bs(r){if(r instanceof Zr&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof Ha||r instanceof kt)return!1;let e=!0;return r.eachChild((i=>{e&&!bs(i)&&(e=!1)})),e}function dn(r){if(r instanceof Zr&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!dn(i)&&(e=!1)})),e}function xs(r,e){if(r instanceof Zr&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((o=>{i&&!xs(o,e)&&(i=!1)})),i}function nu(r){return{result:"success",value:r}}function Ao(r){return{result:"error",value:r}}function ko(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function su(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Wl(r){return!!r.expression&&r.expression.interpolated}function Tt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function ws(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&Jt(r)===ca}function Ih(r){return r}function lu(r,e){let i=r.stops&&typeof r.stops[0][0]=="object",o=i||!(i||r.property!==void 0),n=r.type||(Wl(e)?"exponential":"interval"),l=(function(v){switch(v.type){case"color":return Ct.parse;case"padding":return pr.parse;case"numberArray":return Di.parse;case"colorArray":return Hi.parse;default:return null}})(e);if(l&&((r=Qr({},r)).stops&&(r.stops=r.stops.map((v=>[v[0],l(v[1])]))),r.default=l(r.default?r.default:e.default)),r.colorSpace&&(h=r.colorSpace)!=="rgb"&&h!=="hcl"&&h!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var h;let p=(function(v){switch(v){case"exponential":return cu;case"interval":return Ah;case"categorical":return zh;case"identity":return kh;default:throw new Error(`Unknown function type "${v}"`)}})(n),g,m;if(n==="categorical"){g=Object.create(null);for(let v of r.stops)g[v[0]]=v[1];m=typeof r.stops[0][0]}if(i){let v={},_=[];for(let M=0;M<r.stops.length;M++){let C=r.stops[M],D=C[0].zoom;v[D]===void 0&&(v[D]={zoom:D,type:r.type,property:r.property,default:r.default,stops:[]},_.push(D)),v[D].stops.push([C[0].value,C[1]])}let T=[];for(let M of _)T.push([v[M].zoom,lu(v[M],e)]);let x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:gr.interpolationFactor.bind(void 0,x),zoomStops:T.map((M=>M[0])),evaluate:({zoom:M},C)=>cu({stops:T,base:r.base},e,M).evaluate(M,C)}}if(o){let v=n==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:gr.interpolationFactor.bind(void 0,v),zoomStops:r.stops.map((_=>_[0])),evaluate:({zoom:_})=>p(r,e,_,g,m)}}return{kind:"source",evaluate(v,_){let T=_&&_.properties?_.properties[r.property]:void 0;return T===void 0?pn(r.default,e.default):p(r,e,T,g,m)}}}function pn(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function zh(r,e,i,o,n){return pn(typeof i===n?o[i]:void 0,r.default,e.default)}function Ah(r,e,i){if(Tt(i)!=="number")return pn(r.default,e.default);let o=r.stops.length;if(o===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[o-1][0])return r.stops[o-1][1];let n=At(r.stops.map((l=>l[0])),i);return r.stops[n][1]}function cu(r,e,i){let o=r.base!==void 0?r.base:1;if(Tt(i)!=="number")return pn(r.default,e.default);let n=r.stops.length;if(n===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[n-1][0])return r.stops[n-1][1];let l=At(r.stops.map((v=>v[0])),i),h=(function(v,_,T,x){let M=x-T,C=v-T;return M===0?0:_===1?C/M:(Math.pow(_,C)-1)/(Math.pow(_,M)-1)})(i,o,r.stops[l][0],r.stops[l+1][0]),p=r.stops[l][1],g=r.stops[l+1][1],m=ea[e.type]||Ih;return typeof p.evaluate=="function"?{evaluate(...v){let _=p.evaluate.apply(void 0,v),T=g.evaluate.apply(void 0,v);if(_!==void 0&&T!==void 0)return m(_,T,h,r.colorSpace)}}:m(p,g,h,r.colorSpace)}function kh(r,e,i){switch(e.type){case"color":i=Ct.parse(i);break;case"formatted":i=Dr.fromString(i.toString());break;case"resolvedImage":i=Lr.fromString(i.toString());break;case"padding":i=pr.parse(i);break;case"colorArray":i=Hi.parse(i);break;case"numberArray":i=Di.parse(i);break;default:Tt(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return pn(i,r.default,e.default)}Zr.register(zo,{error:[{kind:"error"},[pt],(r,[e])=>{throw new pi(e.evaluate(r))}],typeof:[pt,[bt],(r,[e])=>li(Jt(e.evaluate(r)))],"to-rgba":[dr(Be,4),[Oi],(r,[e])=>{let[i,o,n,l]=e.evaluate(r).rgb;return[255*i,255*o,255*n,l]}],rgb:[Oi,[Be,Be,Be],au],rgba:[Oi,[Be,Be,Be,Be],au],has:{type:wt,overloads:[[[pt],(r,[e])=>ou(e.evaluate(r),r.properties())],[[pt,ca],(r,[e,i])=>ou(e.evaluate(r),i.evaluate(r))]]},get:{type:bt,overloads:[[[pt],(r,[e])=>$l(e.evaluate(r),r.properties())],[[pt,ca],(r,[e,i])=>$l(e.evaluate(r),i.evaluate(r))]]},"feature-state":[bt,[pt],(r,[e])=>$l(e.evaluate(r),r.featureState||{})],properties:[ca,[],r=>r.properties()],"geometry-type":[pt,[],r=>r.geometryType()],id:[bt,[],r=>r.id()],zoom:[Be,[],r=>r.globals.zoom],"heatmap-density":[Be,[],r=>r.globals.heatmapDensity||0],elevation:[Be,[],r=>r.globals.elevation||0],"line-progress":[Be,[],r=>r.globals.lineProgress||0],accumulated:[bt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Be,Xa(Be),(r,e)=>{let i=0;for(let o of e)i+=o.evaluate(r);return i}],"*":[Be,Xa(Be),(r,e)=>{let i=1;for(let o of e)i*=o.evaluate(r);return i}],"-":{type:Be,overloads:[[[Be,Be],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[Be],(r,[e])=>-e.evaluate(r)]]},"/":[Be,[Be,Be],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[Be,[Be,Be],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[Be,[],()=>Math.LN2],pi:[Be,[],()=>Math.PI],e:[Be,[],()=>Math.E],"^":[Be,[Be,Be],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[Be,[Be],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[Be,[Be],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[Be,[Be],(r,[e])=>Math.log(e.evaluate(r))],log2:[Be,[Be],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[Be,[Be],(r,[e])=>Math.sin(e.evaluate(r))],cos:[Be,[Be],(r,[e])=>Math.cos(e.evaluate(r))],tan:[Be,[Be],(r,[e])=>Math.tan(e.evaluate(r))],asin:[Be,[Be],(r,[e])=>Math.asin(e.evaluate(r))],acos:[Be,[Be],(r,[e])=>Math.acos(e.evaluate(r))],atan:[Be,[Be],(r,[e])=>Math.atan(e.evaluate(r))],min:[Be,Xa(Be),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[Be,Xa(Be),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[Be,[Be],(r,[e])=>Math.abs(e.evaluate(r))],round:[Be,[Be],(r,[e])=>{let i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Be,[Be],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[Be,[Be],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[wt,[pt,bt],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[wt,[bt],(r,[e])=>r.id()===e.value],"filter-type-==":[wt,[pt],(r,[e])=>r.geometryType()===e.value],"filter-<":[wt,[pt,bt],(r,[e,i])=>{let o=r.properties()[e.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[wt,[bt],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[wt,[pt,bt],(r,[e,i])=>{let o=r.properties()[e.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[wt,[bt],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[wt,[pt,bt],(r,[e,i])=>{let o=r.properties()[e.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[wt,[bt],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[wt,[pt,bt],(r,[e,i])=>{let o=r.properties()[e.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[wt,[bt],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[wt,[bt],(r,[e])=>e.value in r.properties()],"filter-has-id":[wt,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[wt,[dr(pt)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[wt,[dr(bt)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[wt,[pt,dr(bt)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[wt,[pt,dr(bt)],(r,[e,i])=>(function(o,n,l,h){for(;l<=h;){let p=l+h>>1;if(n[p]===o)return!0;n[p]>o?h=p-1:l=p+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:wt,overloads:[[[wt,wt],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[Xa(wt),(r,e)=>{for(let i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:wt,overloads:[[[wt,wt],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[Xa(wt),(r,e)=>{for(let i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[wt,[wt],(r,[e])=>!e.evaluate(r)],"is-supported-script":[wt,[pt],(r,[e])=>{let i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[pt,[pt],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[pt,[pt],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[pt,Xa(bt),(r,e)=>e.map((i=>To(i.evaluate(r)))).join("")],split:[dr(pt),[pt,pt],(r,[e,i])=>e.evaluate(r).split(i.evaluate(r))],join:[pt,[dr(pt),pt],(r,[e,i])=>e.evaluate(r).join(i.evaluate(r))],"resolved-locale":[pt,[Yn],(r,[e])=>e.evaluate(r).resolvedLocale()]});class Hl{constructor(e,i,o){this.expression=e,this._warningHistory={},this._evaluator=new an,this._defaultValue=i?(function(n){if(n.type==="color"&&ws(n.default))return new Ct(0,0,0,0);switch(n.type){case"color":return Ct.parse(n.default)||null;case"padding":return pr.parse(n.default)||null;case"numberArray":return Di.parse(n.default)||null;case"colorArray":return Hi.parse(n.default)||null;case"variableAnchorOffsetCollection":return fr.parse(n.default)||null;case"projectionDefinition":return bi.parse(n.default)||null;default:return n.default===void 0?null:n.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=o}evaluateWithoutErrorHandling(e,i,o,n,l,h){return this._globalState&&(e=Lo(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=o,this._evaluator.canonical=n,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=h,this.expression.evaluate(this._evaluator)}evaluate(e,i,o,n,l,h){this._globalState&&(e=Lo(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=o||null,this._evaluator.canonical=n,this._evaluator.availableImages=l||null,this._evaluator.formattedSection=h||null;try{let p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new pi(`Expected value to be one of ${Object.keys(this._enumValues).map((g=>JSON.stringify(g))).join(", ")}, but found ${JSON.stringify(p)} instead.`);return p}catch(p){return this._warningHistory[p.message]||(this._warningHistory[p.message]=!0,typeof console<"u"&&console.warn(p.message)),this._defaultValue}}}function Ts(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in zo}function fn(r,e,i){let o=new rs(zo,vs,[],e?(function(l){let h={color:Oi,string:pt,number:Be,enum:pt,boolean:wt,formatted:Jo,padding:mo,numberArray:go,colorArray:Qo,projectionDefinition:Xn,resolvedImage:Za,variableAnchorOffsetCollection:en};return l.type==="array"?dr(h[l.value]||bt,l.length):h[l.type]})(e):void 0),n=o.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?nu(new Hl(n,e,i)):Ao(o.errors)}class Ss{constructor(e,i,o){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!dn(i.expression),this.globalStateRefs=mn(i.expression),this._globalState=o}evaluateWithoutErrorHandling(e,i,o,n,l,h){return this._globalState&&(e=Lo(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,n,l,h)}evaluate(e,i,o,n,l,h){return this._globalState&&(e=Lo(e,this._globalState)),this._styleExpression.evaluate(e,i,o,n,l,h)}}class Xl{constructor(e,i,o,n,l){this.kind=e,this.zoomStops=o,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!dn(i.expression),this.globalStateRefs=mn(i.expression),this.interpolationType=n,this._globalState=l}evaluateWithoutErrorHandling(e,i,o,n,l,h){return this._globalState&&(e=Lo(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,n,l,h)}evaluate(e,i,o,n,l,h){return this._globalState&&(e=Lo(e,this._globalState)),this._styleExpression.evaluate(e,i,o,n,l,h)}interpolationFactor(e,i,o){return this.interpolationType?gr.interpolationFactor(this.interpolationType,e,i,o):0}}function uu(r,e,i){let o=fn(r,e,i);if(o.result==="error")return o;let n=o.value.expression,l=bs(n);if(!l&&!ko(e))return Ao([new kr("","data expressions not supported")]);let h=xs(n,["zoom"]);if(!h&&!su(e))return Ao([new kr("","zoom expressions not supported")]);let p=Ps(n);return p||h?p instanceof kr?Ao([p]):p instanceof gr&&!Wl(e)?Ao([new kr("",'"interpolate" expressions cannot be used with this property')]):nu(p?new Xl(l?"camera":"composite",o.value,p.labels,p instanceof gr?p.interpolation:void 0,i):new Ss(l?"constant":"source",o.value,i)):Ao([new kr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Do{constructor(e,i){this._parameters=e,this._specification=i,Qr(this,lu(this._parameters,this._specification))}static deserialize(e){return new Do(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ps(r){let e=null;if(r instanceof Wa)e=Ps(r.result);else if(r instanceof ss){for(let i of r.args)if(e=Ps(i),e)break}else(r instanceof yt||r instanceof gr)&&r.input instanceof Zr&&r.input.name==="zoom"&&(e=r);return e instanceof kr||r.eachChild((i=>{let o=Ps(i);o instanceof kr?e=o:!e&&o?e=new kr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new kr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function mn(r,e=new Set){return r instanceof hn&&e.add(r.key),r.eachChild((i=>{mn(i,e)})),e}function Lo(r,e){let{zoom:i,heatmapDensity:o,elevation:n,lineProgress:l,isSupportedScript:h,accumulated:p}=r??{};return{zoom:i,heatmapDensity:o,elevation:n,lineProgress:l,isSupportedScript:h,accumulated:p,globalState:e}}function Ms(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(let e of r.slice(1))if(!Ms(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let Dh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function gn(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Ms(r)||(r=Es(r));let i=fn(r,Dh,e);if(i.result==="error")throw new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));return{filter:(o,n,l)=>i.value.evaluate(o,n,{},l),needGeometry:Yl(r),getGlobalStateRefs:()=>mn(i.value.expression)}}function Cs(r,e){return r<e?-1:r>e?1:0}function Yl(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(Yl(r[e]))return!0;return!1}function Es(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?Kl(r[1],r[2],"=="):e==="!="?Is(Kl(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Kl(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map(Es))):e==="all"?["all"].concat(r.slice(1).map(Es)):e==="none"?["all"].concat(r.slice(1).map(Es).map(Is)):e==="in"?hu(r[1],r.slice(2)):e==="!in"?Is(hu(r[1],r.slice(2))):e==="has"?du(r[1]):e!=="!has"||Is(du(r[1]));var i}function Kl(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function hu(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(Cs)]]:["filter-in-small",r,["literal",e]]}}function du(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Is(r){return["!",r]}function zs(r){let e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let n="[";for(let l of r)n+=`${zs(l)},`;return`${n}]`}let i=Object.keys(r).sort(),o="{";for(let n=0;n<i.length;n++)o+=`${JSON.stringify(i[n])}:${zs(r[i[n]])},`;return`${o}}`}function pu(r){let e="";for(let i of $i)e+=`/${zs(r[i])}`;return e}function fu(r){let e=r.value;return e?[new ze(r.key,e,"constants have been deprecated as of v8")]:[]}function xi(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Oa(r){if(Array.isArray(r))return r.map(Oa);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let i in r)e[i]=Oa(r[i]);return e}return xi(r)}function Pr(r){let e=r.key,i=r.value,o=r.valueSpec||{},n=r.objectElementValidators||{},l=r.style,h=r.styleSpec,p=r.validateSpec,g=[],m=Tt(i);if(m!=="object")return[new ze(e,i,`object expected, ${m} found`)];for(let v in i){let _=v.split(".")[0],T=bo(o,_)||o["*"],x;if(bo(n,_))x=n[_];else if(bo(o,_)){if(i[v]===void 0)continue;x=p}else if(n["*"])x=n["*"];else{if(!o["*"]){g.push(new ze(e,i[v],`unknown property "${v}"`));continue}x=p}g=g.concat(x({key:(e&&`${e}.`)+v,value:i[v],valueSpec:T,style:l,styleSpec:h,object:i,objectKey:v,validateSpec:p},i))}for(let v in o)n[v]||o[v].required&&o[v].default===void 0&&i[v]===void 0&&g.push(new ze(e,i,`missing required property "${v}"`));return g}function As(r){let e=r.value,i=r.valueSpec,o=r.style,n=r.styleSpec,l=r.key,h=r.arrayElementValidator||r.validateSpec;if(Tt(e)!=="array")return[new ze(l,e,`array expected, ${Tt(e)} found`)];if(i.length&&e.length!==i.length)return[new ze(l,e,`array length ${i.length} expected, length ${e.length} found`)];let p={type:i.value,values:i.values};n.$version<7&&(p.function=i.function),Tt(i.value)==="object"&&(p=i.value);let g=[];for(let m=0;m<e.length;m++)g=g.concat(h({array:e,arrayIndex:m,value:e[m],valueSpec:p,validateSpec:r.validateSpec,style:o,styleSpec:n,key:`${l}[${m}]`}));return g}function ks(r){let e=r.key,i=r.value,o=r.valueSpec,n=Tt(i);return n==="number"&&i!=i&&(n="NaN"),n!=="number"?[new ze(e,i,`number expected, ${n} found`)]:"minimum"in o&&i<o.minimum?[new ze(e,i,`${i} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&i>o.maximum?[new ze(e,i,`${i} is greater than the maximum value ${o.maximum}`)]:[]}function mu(r){let e=r.valueSpec,i=xi(r.value.type),o,n,l,h={},p=i!=="categorical"&&r.value.property===void 0,g=!p,m=Tt(r.value.stops)==="array"&&Tt(r.value.stops[0])==="array"&&Tt(r.value.stops[0][0])==="object",v=Pr({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(x){if(i==="identity")return[new ze(x.key,x.value,'identity function may not have a "stops" property')];let M=[],C=x.value;return M=M.concat(As({key:x.key,value:C,valueSpec:x.valueSpec,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec,arrayElementValidator:_})),Tt(C)==="array"&&C.length===0&&M.push(new ze(x.key,C,"array must have at least one stop")),M},default:function(x){return x.validateSpec({key:x.key,value:x.value,valueSpec:e,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec})}}});return i==="identity"&&p&&v.push(new ze(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||v.push(new ze(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!Wl(r.valueSpec)&&v.push(new ze(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(g&&!ko(r.valueSpec)?v.push(new ze(r.key,r.value,"property functions not supported")):p&&!su(r.valueSpec)&&v.push(new ze(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!m||r.value.property!==void 0||v.push(new ze(r.key,r.value,'"property" property is required')),v;function _(x){let M=[],C=x.value,D=x.key;if(Tt(C)!=="array")return[new ze(D,C,`array expected, ${Tt(C)} found`)];if(C.length!==2)return[new ze(D,C,`array length 2 expected, length ${C.length} found`)];if(m){if(Tt(C[0])!=="object")return[new ze(D,C,`object expected, ${Tt(C[0])} found`)];if(C[0].zoom===void 0)return[new ze(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new ze(D,C,"object stop key must have value")];if(l&&l>xi(C[0].zoom))return[new ze(D,C[0].zoom,"stop zoom values must appear in ascending order")];xi(C[0].zoom)!==l&&(l=xi(C[0].zoom),n=void 0,h={}),M=M.concat(Pr({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec,objectElementValidators:{zoom:ks,value:T}}))}else M=M.concat(T({key:`${D}[0]`,value:C[0],validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec},C));return Ts(Oa(C[1]))?M.concat([new ze(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):M.concat(x.validateSpec({key:`${D}[1]`,value:C[1],valueSpec:e,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec}))}function T(x,M){let C=Tt(x.value),D=xi(x.value),L=x.value!==null?x.value:M;if(o){if(C!==o)return[new ze(x.key,L,`${C} stop domain type must match previous stop domain type ${o}`)]}else o=C;if(C!=="number"&&C!=="string"&&C!=="boolean")return[new ze(x.key,L,"stop domain value must be a number, string, or boolean")];if(C!=="number"&&i!=="categorical"){let N=`number expected, ${C} found`;return ko(e)&&i===void 0&&(N+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(x.key,L,N)]}return i!=="categorical"||C!=="number"||isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&n!==void 0&&D<n?[new ze(x.key,L,"stop domain values must appear in ascending order")]:(n=D,i==="categorical"&&D in h?[new ze(x.key,L,"stop domain values must be unique")]:(h[D]=!0,[])):[new ze(x.key,L,`integer expected, found ${D}`)]}}function Ro(r){let e=(r.expressionContext==="property"?uu:fn)(Oa(r.value),r.valueSpec);if(e.result==="error")return e.value.map((o=>new ze(`${r.key}${o.key}`,r.value,o.message)));let i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ze(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!dn(i))return[new ze(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!dn(i))return[new ze(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!xs(i,["zoom","feature-state"]))return[new ze(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!bs(i))return[new ze(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jl(r){let e=r.key,i=r.value,o=Tt(i);return o!=="string"?[new ze(e,i,`color expected, ${o} found`)]:Ct.parse(String(i))?[]:[new ze(e,i,`color expected, "${i}" found`)]}function Fo(r){let e=r.key,i=r.value,o=r.valueSpec,n=[];return Array.isArray(o.values)?o.values.indexOf(xi(i))===-1&&n.push(new ze(e,i,`expected one of [${o.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(o.values).indexOf(xi(i))===-1&&n.push(new ze(e,i,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(i)} found`)),n}function Ds(r){return Ms(Oa(r.value))?Ro(Qr({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ls(r)}function Ls(r){let e=r.value,i=r.key;if(Tt(e)!=="array")return[new ze(i,e,`array expected, ${Tt(e)} found`)];let o=r.styleSpec,n,l=[];if(e.length<1)return[new ze(i,e,"filter array must have at least 1 element")];switch(l=l.concat(Fo({key:`${i}[0]`,value:e[0],valueSpec:o.filter_operator,style:r.style,styleSpec:r.styleSpec})),xi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&xi(e[1])==="$type"&&l.push(new ze(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&l.push(new ze(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Tt(e[1]),n!=="string"&&l.push(new ze(`${i}[1]`,e[1],`string expected, ${n} found`)));for(let h=2;h<e.length;h++)n=Tt(e[h]),xi(e[1])==="$type"?l=l.concat(Fo({key:`${i}[${h}]`,value:e[h],valueSpec:o.geometry_type,style:r.style,styleSpec:r.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&l.push(new ze(`${i}[${h}]`,e[h],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let h=1;h<e.length;h++)l=l.concat(Ls({key:`${i}[${h}]`,value:e[h],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":n=Tt(e[1]),e.length!==2?l.push(new ze(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):n!=="string"&&l.push(new ze(`${i}[1]`,e[1],`string expected, ${n} found`))}return l}function Rs(r,e){let i=r.key,o=r.validateSpec,n=r.style,l=r.styleSpec,h=r.value,p=r.objectKey,g=l[`${e}_${r.layerType}`];if(!g)return[];let m=p.match(/^(.*)-transition$/);if(e==="paint"&&m&&g[m[1]]&&g[m[1]].transition)return o({key:i,value:h,valueSpec:l.transition,style:n,styleSpec:l});let v=r.valueSpec||g[p];if(!v)return[new ze(i,h,`unknown property "${p}"`)];let _;if(Tt(h)==="string"&&ko(v)&&!v.tokens&&(_=/^{([^}]+)}$/.exec(h)))return[new ze(i,h,`"${p}" does not support interpolation syntax
5
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(_[1])} }\`.`)];let T=[];return r.layerType==="symbol"&&p==="text-font"&&ws(Oa(h))&&xi(h.type)==="identity"&&T.push(new ze(i,h,'"text-font" does not support identity functions')),T.concat(o({key:r.key,value:h,valueSpec:v,style:n,styleSpec:l,expressionContext:"property",propertyType:e,propertyKey:p}))}function Fs(r){return Rs(r,"paint")}function Bs(r){return Rs(r,"layout")}function Os(r){var e,i;let o=[],n=r.value,l=r.key,h=r.style,p=r.styleSpec;if(Tt(n)!=="object")return[new ze(l,n,`object expected, ${Tt(n)} found`)];n.type||n.ref||o.push(new ze(l,n,'either "type" or "ref" is required'));let g=xi(n.type),m=xi(n.ref);if(n.id){let v=xi(n.id);for(let _=0;_<r.arrayIndex;_++){let T=h.layers[_];xi(T.id)===v&&o.push(new ze(l,n.id,`duplicate layer id "${n.id}", previously used at line ${T.id.__line__}`))}}if("ref"in n){let v;["type","source","source-layer","filter","layout"].forEach((_=>{_ in n&&o.push(new ze(l,n[_],`"${_}" is prohibited for ref layers`))})),h.layers.forEach((_=>{xi(_.id)===m&&(v=_)})),v?v.ref?o.push(new ze(l,n.ref,"ref cannot reference another ref layer")):g=xi(v.type):o.push(new ze(l,n.ref,`ref layer "${m}" not found`))}else if(g!=="background")if(n.source){let v=h.sources&&h.sources[n.source],_=v&&xi(v.type);v?_==="vector"&&g==="raster"?o.push(new ze(l,n.source,`layer "${n.id}" requires a raster source`)):_!=="raster-dem"&&g==="hillshade"||_!=="raster-dem"&&g==="color-relief"?o.push(new ze(l,n.source,`layer "${n.id}" requires a raster-dem source`)):_==="raster"&&g!=="raster"?o.push(new ze(l,n.source,`layer "${n.id}" requires a vector source`)):_!=="vector"||n["source-layer"]?_==="raster-dem"&&g!=="hillshade"&&g!=="color-relief"?o.push(new ze(l,n.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):g!=="line"||!n.paint||!n.paint["line-gradient"]||_==="geojson"&&v.lineMetrics||o.push(new ze(l,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new ze(l,n,`layer "${n.id}" must specify a "source-layer"`)):o.push(new ze(l,n.source,`source "${n.source}" not found`))}else o.push(new ze(l,n,'missing required property "source"'));return g==="raster"&&(!((e=n.paint)===null||e===void 0)&&e.resampling)&&(!((i=n.paint)===null||i===void 0)&&i["raster-resampling"])&&o.push(new ze(l,n.paint,`layer "${n.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),o=o.concat(Pr({key:l,value:n,valueSpec:p.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${l}.type`,value:n.type,valueSpec:p.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:n,objectKey:"type"}),filter:Ds,layout:v=>Pr({layer:n,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":_=>Bs(Qr({layerType:g},_))}}),paint:v=>Pr({layer:n,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":_=>Fs(Qr({layerType:g},_))}})}})),o}function ia(r){let e=r.value,i=r.key,o=Tt(e);return o!=="string"?[new ze(i,e,`string expected, ${o} found`)]:[]}let gu={promoteId:function({key:r,value:e}){if(Tt(e)==="string")return ia({key:r,value:e});{let i=[];for(let o in e)i.push(...ia({key:`${r}.${o}`,value:e[o]}));return i}}};function _u(r){let e=r.value,i=r.key,o=r.styleSpec,n=r.style,l=r.validateSpec;if(!e.type)return[new ze(i,e,'"type" is required')];let h=xi(e.type),p;switch(h){case"vector":case"raster":return p=Pr({key:i,value:e,valueSpec:o[`source_${h.replace("-","_")}`],style:r.style,styleSpec:o,objectElementValidators:gu,validateSpec:l}),p;case"raster-dem":return p=(function(g){var m;let v=(m=g.sourceName)!==null&&m!==void 0?m:"",_=g.value,T=g.styleSpec,x=T.source_raster_dem,M=g.style,C=[],D=Tt(_);if(_===void 0)return C;if(D!=="object")return C.push(new ze("source_raster_dem",_,`object expected, ${D} found`)),C;let L=xi(_.encoding)==="custom",N=["redFactor","greenFactor","blueFactor","baseShift"],F=g.value.encoding?`"${g.value.encoding}"`:"Default";for(let j in _)!L&&N.includes(j)?C.push(new ze(j,_[j],`In "${v}": "${j}" is only valid when "encoding" is set to "custom". ${F} encoding found`)):x[j]?C=C.concat(g.validateSpec({key:j,value:_[j],valueSpec:x[j],validateSpec:g.validateSpec,style:M,styleSpec:T})):C.push(new ze(j,_[j],`unknown property "${j}"`));return C})({sourceName:i,value:e,style:r.style,styleSpec:o,validateSpec:l}),p;case"geojson":if(p=Pr({key:i,value:e,valueSpec:o.source_geojson,style:n,styleSpec:o,validateSpec:l,objectElementValidators:gu}),e.cluster)for(let g in e.clusterProperties){let[m,v]=e.clusterProperties[g],_=typeof m=="string"?[m,["accumulated"],["get",g]]:m;p.push(...Ro({key:`${i}.${g}.map`,value:v,expressionContext:"cluster-map"})),p.push(...Ro({key:`${i}.${g}.reduce`,value:_,expressionContext:"cluster-reduce"}))}return p;case"video":return Pr({key:i,value:e,valueSpec:o.source_video,style:n,validateSpec:l,styleSpec:o});case"image":return Pr({key:i,value:e,valueSpec:o.source_image,style:n,validateSpec:l,styleSpec:o});case"canvas":return[new ze(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Fo({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function yu(r){let e=r.value,i=r.styleSpec,o=i.light,n=r.style,l=[],h=Tt(e);if(e===void 0)return l;if(h!=="object")return l=l.concat([new ze("light",e,`object expected, ${h} found`)]),l;for(let p in e){let g=p.match(/^(.*)-transition$/);l=l.concat(g&&o[g[1]]&&o[g[1]].transition?r.validateSpec({key:p,value:e[p],valueSpec:i.transition,validateSpec:r.validateSpec,style:n,styleSpec:i}):o[p]?r.validateSpec({key:p,value:e[p],valueSpec:o[p],validateSpec:r.validateSpec,style:n,styleSpec:i}):[new ze(p,e[p],`unknown property "${p}"`)])}return l}function vu(r){let e=r.value,i=r.styleSpec,o=i.sky,n=r.style,l=Tt(e);if(e===void 0)return[];if(l!=="object")return[new ze("sky",e,`object expected, ${l} found`)];let h=[];for(let p in e)h=h.concat(o[p]?r.validateSpec({key:p,value:e[p],valueSpec:o[p],style:n,styleSpec:i}):[new ze(p,e[p],`unknown property "${p}"`)]);return h}function bu(r){let e=r.value,i=r.styleSpec,o=i.terrain,n=r.style,l=[],h=Tt(e);if(e===void 0)return l;if(h!=="object")return l=l.concat([new ze("terrain",e,`object expected, ${h} found`)]),l;for(let p in e)l=l.concat(o[p]?r.validateSpec({key:p,value:e[p],valueSpec:o[p],validateSpec:r.validateSpec,style:n,styleSpec:i}):[new ze(p,e[p],`unknown property "${p}"`)]);return l}function xu(r){let e=[],i=r.value,o=r.key;if(Array.isArray(i)){let n=[],l=[];for(let h in i)i[h].id&&n.includes(i[h].id)&&e.push(new ze(o,i,`all the sprites' ids must be unique, but ${i[h].id} is duplicated`)),n.push(i[h].id),i[h].url&&l.includes(i[h].url)&&e.push(new ze(o,i,`all the sprites' URLs must be unique, but ${i[h].url} is duplicated`)),l.push(i[h].url),e=e.concat(Pr({key:`${o}[${h}]`,value:i[h],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return e}return ia({key:o,value:i})}function Ql(r){return!!r&&r.constructor===Object}function ec(r){return Ql(r.value)?[]:[new ze(r.key,r.value,`object expected, ${Tt(r.value)} found`)]}let _n={"*":()=>[],array:As,boolean:function(r){let e=r.value,i=r.key,o=Tt(e);return o!=="boolean"?[new ze(i,e,`boolean expected, ${o} found`)]:[]},number:ks,color:Jl,constants:fu,enum:Fo,filter:Ds,function:mu,layer:Os,object:Pr,source:_u,light:yu,sky:vu,terrain:bu,projection:function(r){let e=r.value,i=r.styleSpec,o=i.projection,n=r.style,l=Tt(e);if(e===void 0)return[];if(l!=="object")return[new ze("projection",e,`object expected, ${l} found`)];let h=[];for(let p in e)h=h.concat(o[p]?r.validateSpec({key:p,value:e[p],valueSpec:o[p],style:n,styleSpec:i}):[new ze(p,e[p],`unknown property "${p}"`)]);return h},projectionDefinition:function(r){let e=r.key,i=r.value;i=i instanceof String?i.valueOf():i;let o=Tt(i);return o!=="array"||(function(n){return Array.isArray(n)&&n.length===3&&typeof n[0]=="string"&&typeof n[1]=="string"&&typeof n[2]=="number"})(i)||(function(n){return!!["interpolate","step","literal"].includes(n[0])})(i)?["array","string"].includes(o)?[]:[new ze(e,i,`projection expected, invalid type "${o}" found`)]:[new ze(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:ia,formatted:function(r){return ia(r).length===0?[]:Ro(r)},resolvedImage:function(r){return ia(r).length===0?[]:Ro(r)},padding:function(r){let e=r.key,i=r.value;if(Tt(i)==="array"){if(i.length<1||i.length>4)return[new ze(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];let o={type:"number"},n=[];for(let l=0;l<i.length;l++)n=n.concat(r.validateSpec({key:`${e}[${l}]`,value:i[l],validateSpec:r.validateSpec,valueSpec:o}));return n}return ks({key:e,value:i,valueSpec:{}})},numberArray:function(r){let e=r.key,i=r.value;if(Tt(i)==="array"){let o={type:"number"};if(i.length<1)return[new ze(e,i,"array length at least 1 expected, length 0 found")];let n=[];for(let l=0;l<i.length;l++)n=n.concat(r.validateSpec({key:`${e}[${l}]`,value:i[l],validateSpec:r.validateSpec,valueSpec:o}));return n}return ks({key:e,value:i,valueSpec:{}})},colorArray:function(r){let e=r.key,i=r.value;if(Tt(i)==="array"){if(i.length<1)return[new ze(e,i,"array length at least 1 expected, length 0 found")];let o=[];for(let n=0;n<i.length;n++)o=o.concat(Jl({key:`${e}[${n}]`,value:i[n]}));return o}return Jl({key:e,value:i})},variableAnchorOffsetCollection:function(r){let e=r.key,i=r.value,o=Tt(i),n=r.styleSpec;if(o!=="array"||i.length<1||i.length%2!=0)return[new ze(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let l=[];for(let h=0;h<i.length;h+=2)l=l.concat(Fo({key:`${e}[${h}]`,value:i[h],valueSpec:n.layout_symbol["text-anchor"]})),l=l.concat(As({key:`${e}[${h+1}]`,value:i[h+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:n}));return l},sprite:xu,state:ec,fontFaces:function(r){let e=r.key,i=r.value,o=r.validateSpec,n=r.styleSpec,l=r.style;if(!Ql(i))return[new ze(e,i,`object expected, ${Tt(i)} found`)];let h=[];for(let p in i){let g=i[p],m=Tt(g);if(m==="string")h.push(...ia({key:`${e}.${p}`,value:g}));else if(m==="array"){let v={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[_,T]of g.entries())h.push(...Pr({key:`${e}.${p}[${_}]`,value:T,valueSpec:v,styleSpec:n,style:l,validateSpec:o}))}else h.push(new ze(`${e}.${p}`,g,`string or array expected, ${m} found`))}return h}};function Ns(r){let e=r.value,i=r.valueSpec,o=r.styleSpec;return r.validateSpec=Ns,i.expression&&ws(xi(e))?mu(r):i.expression&&Ts(Oa(e))?Ro(r):i.type&&_n[i.type]?_n[i.type](r):Pr(Qr({},r,{valueSpec:i.type?o[i.type]:i}))}function tc(r){let e=r.value,i=r.key,o=ia(r);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new ze(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new ze(i,e,'"glyphs" url must include a "{range}" token'))),o}function Fr(r,e=he){let i=[];return i=i.concat(Ns({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:Ns,objectElementValidators:{glyphs:tc,"*":()=>[]}})),r.constants&&(i=i.concat(fu({key:"constants",value:r.constants}))),yn(i)}function ra(r){return function(e){return r(Object.assign({},e,{validateSpec:Ns}))}}function yn(r){return[].concat(r).sort(((e,i)=>e.line-i.line))}function $r(r){return function(...e){return yn(r.apply(this,e))}}Fr.source=$r(ra(_u)),Fr.sprite=$r(ra(xu)),Fr.glyphs=$r(ra(tc)),Fr.light=$r(ra(yu)),Fr.sky=$r(ra(vu)),Fr.terrain=$r(ra(bu)),Fr.state=$r(ra(ec)),Fr.layer=$r(ra(Os)),Fr.filter=$r(ra(Ds)),Fr.paintProperty=$r(ra(Fs)),Fr.layoutProperty=$r(ra(Bs));let wu={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class vn{constructor(e,i){this._globalState=i,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);let i=fn(e,wu,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=mn(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let Lh=he,Bo=Fr,Rh=Bo.light,Fh=Bo.sky,Bh=Bo.paintProperty,Oh=Bo.layoutProperty;function Oo(r,e){let i=!1;if(e?.length)for(let o of e)r.fire(new Zt(new Error(o.message))),i=!0;return i}class ya{constructor(e,i,o){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let h=new Int32Array(this.arrayBuffer);e=h[0],this.d=(i=h[1])+2*(o=h[2]);for(let g=0;g<this.d*this.d;g++){let m=h[3+g],v=h[3+g+1];n.push(m===v?null:h.subarray(m,v))}let p=h[3+n.length+1];this.keys=h.subarray(h[3+n.length],p),this.bboxes=h.subarray(p),this.insert=this._insertReadonly}else{this.d=i+2*o;for(let h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=o,this.scale=i/e,this.uid=0;let l=o/i*e;this.min=-l,this.max=e+l}insert(e,i,o,n,l){this._forEachCell(i,o,n,l,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(l)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,o,n,l,h){this.cells[l].push(h)}query(e,i,o,n,l){let h=this.min,p=this.max;if(e<=h&&i<=h&&p<=o&&p<=n&&!l)return[...this.keys];{let g=[];return this._forEachCell(e,i,o,n,this._queryCell,g,{},l),g}}_queryCell(e,i,o,n,l,h,p,g){let m=this.cells[l];if(m!==null){let v=this.keys,_=this.bboxes;for(let T of m)if(p[T]===void 0){let x=4*T;(g?g(_[x+0],_[x+1],_[x+2],_[x+3]):e<=_[x+2]&&i<=_[x+3]&&o>=_[x+0]&&n>=_[x+1])?(p[T]=!0,h.push(v[T])):p[T]=!1}}}_forEachCell(e,i,o,n,l,h,p,g){let m=this._convertToCellCoord(e),v=this._convertToCellCoord(i),_=this._convertToCellCoord(o),T=this._convertToCellCoord(n);for(let x=m;x<=_;x++)for(let M=v;M<=T;M++){let C=this.d*M+x;if((!g||g(this._convertFromCellCoord(x),this._convertFromCellCoord(M),this._convertFromCellCoord(x+1),this._convertFromCellCoord(M+1)))&&l.call(this,e,i,o,n,C,h,p,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,i=3+this.cells.length+1+1,o=0;for(let h of this.cells)o+=h.length;let n=new Int32Array(i+o+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let l=i;for(let h=0;h<e.length;h++){let p=e[h];n[3+h]=l,n.set(p,l),l+=p.length}return n[3+e.length]=l,n.set(this.keys,l),l+=this.keys.length,n[3+e.length+1]=l,n.set(this.bboxes,l),l+=this.bboxes.length,n.buffer}static serialize(e,i){let o=e.toArrayBuffer();return i&&i.push(o),{buffer:o}}static deserialize(e){return new ya(e.buffer)}}let Mi={};function Ne(r,e,i={}){if(Mi[r])throw new Error(`${r} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),Mi[r]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}Ne("Object",Object),Ne("Set",Set),Ne("TransferableGridIndex",ya),Ne("Color",Ct),Ne("Error",Error),Ne("AJAXError",ge),Ne("ResolvedImage",Lr),Ne("StylePropertyFunction",Do),Ne("StyleExpression",Hl,{omit:["_evaluator"]}),Ne("ZoomDependentExpression",Xl),Ne("ZoomConstantExpression",Ss),Ne("CompoundExpression",Zr,{omit:["_evaluate"]});for(let r in zo)zo[r]._classRegistryKey||Ne(`Expression_${r}`,zo[r]);function ic(r){var e;return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||((e=r.constructor)===null||e===void 0?void 0:e.name)==="ArrayBuffer")}function rc(r){return r.$name||r.constructor._classRegistryKey}function Tu(r){return!(function(e){if(e===null||typeof e!="object")return!1;let i=rc(e);return i&&i!=="Object"})(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||ic(r)||Pt(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function va(r,e){if(Tu(r))return(ic(r)||Pt(r))&&e&&e.push(r),ArrayBuffer.isView(r)&&e&&e.push(r.buffer),r instanceof ImageData&&e&&e.push(r.data.buffer),r;if(Array.isArray(r)){let l=[];for(let h of r)l.push(va(h,e));return l}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);let i=rc(r);if(!i)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!Mi[i])throw new Error(`${i} is not registered.`);let{klass:o}=Mi[i],n=o.serialize?o.serialize(r,e):{};if(o.serialize){if(n===e?.[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let l in r){if(!r.hasOwnProperty(l)||Mi[i].omit.includes(l))continue;let h=r[l];n[l]=Mi[i].shallow.includes(l)?h:va(h,e)}r instanceof Error&&(n.message=r.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(n.$name=i),n}function No(r){if(Tu(r))return r;if(Array.isArray(r))return r.map(No);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);let e=rc(r)||"Object";if(!Mi[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:i}=Mi[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(r);let o=Object.create(i.prototype);for(let n of Object.keys(r)){if(n==="$name")continue;let l=r[n];o[n]=Mi[e].shallow.includes(n)?l:No(l)}return o}class bn{constructor(){this.first=!0}update(e,i){let o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}function Nh(r){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(r))}function xn(r){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(r))}function Su(r){return/\s/u.test(String.fromCodePoint(r))}function Ya(r){for(let e of r)if(xn(e.codePointAt(0)))return!0;return!1}function jh(r){for(let e of r)if(!wn(e.codePointAt(0)))return!1;return!0}function Pu(r){let e=r.map((i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}})).filter((i=>i));return new RegExp(e.join("|"),"u")}let Vh=Pu(["Arab","Dupl","Mong","Ougr","Syrc"]);function wn(r){return!Vh.test(String.fromCodePoint(r))}function Mu(r){return!(xn(r)||(e=r,/[\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}let Uh=Pu(["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 Tn(r){return Uh.test(String.fromCodePoint(r))}function qh(r,e){return!(!e&&Tn(r)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(r)))}function ac(r){for(let e of r)if(Tn(e.codePointAt(0)))return!0;return!1}let aa=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){if(aa.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(r,e){return u(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(r.pluginStatus!=="loading")return this.setState(r),r;let i=r.pluginURL,o=new Promise((l=>{this.loadScriptResolve=l}));e(i);let n=new Promise((l=>setTimeout((()=>l()),this.TIMEOUT)));if(yield Promise.race([o,n]),this.isParsed()){let l={pluginStatus:"loaded",pluginURL:i};return this.setState(l),l}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)}))}};class Wt{constructor(e,i){this.isSupportedScript=Cu,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new bn,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bn,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,i=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*i}}}function Cu(r){return(function(e,i){for(let o of e)if(!qh(o.codePointAt(0),i))return!1;return!0})(r,aa.getRTLTextPluginStatus()==="loaded")}let Sn="-transition";class Pn{constructor(e,i,o){this.property=e,this.value=i,this.expression=(function(n,l,h){if(ws(n))return new Do(n,l);if(Ts(n)){let p=uu(n,l,h);if(p.result==="error")throw new Error(p.value.map((g=>`${g.key}: ${g.message}`)).join(", "));return p.value}{let p=n;return l.type==="color"&&typeof n=="string"?p=Ct.parse(n):l.type!=="padding"||typeof n!="number"&&!Array.isArray(n)?l.type!=="numberArray"||typeof n!="number"&&!Array.isArray(n)?l.type!=="colorArray"||typeof n!="string"&&!Array.isArray(n)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(n)?p=fr.parse(n):l.type==="projectionDefinition"&&typeof n=="string"&&(p=bi.parse(n)):p=Hi.parse(n):p=Di.parse(n):p=pr.parse(n),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>p}}})(i===void 0?e.specification.default:i,e.specification,o)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,o){return this.property.possiblyEvaluate(this,e,i,o)}}class Mn{constructor(e,i){this.property=e,this.value=new Pn(e,void 0,i)}transitioned(e,i){return new Eu(this.property,this.value,i,Xt({},e.transition,this.transition),e.now)}untransitioned(){return new Eu(this.property,this.value,null,{},0)}}class oc{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return _t(this._values[e].value.value)}setValue(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Mn(this._values[e].property,this._globalState)),this._values[e].value=new Pn(this._values[e].property,i===null?void 0:_t(i),this._globalState)}getTransition(e){return _t(this._values[e].transition)}setTransition(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Mn(this._values[e].property,this._globalState)),this._values[e].transition=_t(i)||void 0}serialize(){let e={};for(let i of Object.keys(this._values)){let o=this.getValue(i);o!==void 0&&(e[i]=o);let n=this.getTransition(i);n!==void 0&&(e[`${i}${Sn}`]=n)}return e}transitioned(e,i){let o=new nc(this._properties);for(let n of Object.keys(this._values))o._values[n]=this._values[n].transitioned(e,i._values[n]);return o}untransitioned(){let e=new nc(this._properties);for(let i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class Eu{constructor(e,i,o,n,l){this.property=e,this.value=i,this.begin=l+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=o)}possiblyEvaluate(e,i,o){let n=e.now||0,l=this.value.possiblyEvaluate(e,i,o),h=this.prior;if(h){if(n>this.end)return this.prior=null,l;if(this.value.isDataDriven())return this.prior=null,l;if(n<this.begin)return h.possiblyEvaluate(e,i,o);{let p=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(h.possiblyEvaluate(e,i,o),l,ti(p))}}return l}}class nc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,o){let n=new js(this._properties);for(let l of Object.keys(this._values))n._values[l]=this._values[l].possiblyEvaluate(e,i,o);return n}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Gh{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return _t(this._values[e].value)}setValue(e,i){this._values[e]=new Pn(this._values[e].property,i===null?void 0:_t(i),this._globalState)}serialize(){let e={};for(let i of Object.keys(this._values)){let o=this.getValue(i);o!==void 0&&(e[i]=o)}return e}possiblyEvaluate(e,i,o){let n=new js(this._properties);for(let l of Object.keys(this._values))n._values[l]=this._values[l].possiblyEvaluate(e,i,o);return n}}class oa{constructor(e,i,o){this.property=e,this.value=i,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,o,n){return this.property.evaluate(this.value,this.parameters,e,i,o,n)}}class js{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ke{constructor(e){this.specification=e}possiblyEvaluate(e,i){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(i)}interpolate(e,i,o){let n=ea[this.specification.type];return n?n(e,i,o):e}}class rt{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,o,n){return new oa(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},o,n)}:e.expression,i)}interpolate(e,i,o){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new oa(this,{kind:"constant",value:void 0},e.parameters);let n=ea[this.specification.type];if(n){let l=n(e.value.value,i.value.value,o);return new oa(this,{kind:"constant",value:l},e.parameters)}return e}evaluate(e,i,o,n,l,h){return e.kind==="constant"?e.value:e.evaluate(i,o,n,l,h)}}class Cn extends rt{possiblyEvaluate(e,i,o,n){if(e.value===void 0)return new oa(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){let l=e.expression.evaluate(i,null,{},o,n),h=e.property.specification.type==="resolvedImage"&&typeof l!="string"?l.name:l,p=this._calculate(h,h,h,i);return new oa(this,{kind:"constant",value:p},i)}if(e.expression.kind==="camera"){let l=this._calculate(e.expression.evaluate({zoom:i.zoom-1}),e.expression.evaluate({zoom:i.zoom}),e.expression.evaluate({zoom:i.zoom+1}),i);return new oa(this,{kind:"constant",value:l},i)}return new oa(this,e.expression,i)}evaluate(e,i,o,n,l,h){if(e.kind==="source"){let p=e.evaluate(i,o,n,l,h);return this._calculate(p,p,p,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},o,n),e.evaluate({zoom:Math.floor(i.zoom)},o,n),e.evaluate({zoom:Math.floor(i.zoom)+1},o,n),i):e.value}_calculate(e,i,o,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class Iu{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,n){if(e.value!==void 0){if(e.expression.kind==="constant"){let l=e.expression.evaluate(i,null,{},o,n);return this._calculate(l,l,l,i)}return this._calculate(e.expression.evaluate(new Wt(Math.floor(i.zoom-1),i)),e.expression.evaluate(new Wt(Math.floor(i.zoom),i)),e.expression.evaluate(new Wt(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,o,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class En{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,n){return!!e.expression.evaluate(i,null,{},o,n)}interpolate(){return!1}}class tr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let i in e){let o=e[i];o.specification.overridable&&this.overridableProperties.push(i);let n=this.defaultPropertyValues[i]=new Pn(o,void 0,void 0),l=this.defaultTransitionablePropertyValues[i]=new Mn(o,void 0);this.defaultTransitioningPropertyValues[i]=l.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=n.possiblyEvaluate({})}}}Ne("DataDrivenProperty",rt),Ne("DataConstantProperty",Ke),Ne("CrossFadedDataDrivenProperty",Cn),Ne("CrossFadedProperty",Iu),Ne("ColorRampProperty",En);let sc=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Vs=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class Mr extends Dt{constructor(e,i,o){if(super(),this.id=e.id,this.type=e.type,this._globalState=o,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(n,l){return new vn(n,l)})(this.visibility,o),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=gn(e.filter,o)),i.layout&&(this._unevaluatedLayout=new Gh(i.layout,o)),i.paint)){this._transitionablePaint=new oc(i.paint,o);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new js(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=gn(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var i;if(e==="visibility")return this.visibility;if(!((i=this._transitionablePaint)===null||i===void 0)&&i.hasProperty(e))throw new Error(e+sc);if(!this._unevaluatedLayout)throw new Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let i of this._visibilityExpression.getGlobalStateRefs())e.add(i);if(this._unevaluatedLayout)for(let i in this._unevaluatedLayout._values){let o=this._unevaluatedLayout._values[i];for(let n of o.getGlobalStateRefs())e.add(n)}for(let i of this._featureFilter.getGlobalStateRefs())e.add(i);return e}getPaintAffectingGlobalStateRefs(){var e;let i=new globalThis.Map;if(this._transitionablePaint)for(let o in this._transitionablePaint._values){let n=this._transitionablePaint._values[o].value;for(let l of n.getGlobalStateRefs()){let h=(e=i.get(l))!==null&&e!==void 0?e:[];h.push({name:o,value:n.value}),i.set(l,h)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,o={}){var n;if(e==="visibility")return this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility();!((n=this._transitionablePaint)===null||n===void 0)&&n.hasProperty(e)?this.fire(new Zt(new Error(e+sc))):i!=null&&this._validate(Oh,`layers.${this.id}.layout.${e}`,e,i,o)||this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){var i,o;if(e.endsWith(Sn)){let n=e.slice(0,-11);if(n==="visibility"||!((i=this._unevaluatedLayout)===null||i===void 0)&&i.hasProperty(n))throw new Error(e+Vs);return this._transitionablePaint.getTransition(n)}if(e==="visibility"||!((o=this._unevaluatedLayout)===null||o===void 0)&&o.hasProperty(e))throw new Error(e+Vs);return this._transitionablePaint.getValue(e)}setPaintProperty(e,i,o={}){var n;if(e==="visibility"||!((n=this._unevaluatedLayout)===null||n===void 0)&&n.hasProperty(e))return this.fire(new Zt(new Error(e+Vs))),!1;if(i!=null&&this._validate(Bh,`layers.${this.id}.paint.${e}`,e,i,o))return!1;if(e.endsWith(Sn))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{let l=this._transitionablePaint._values[e],h=l.property.specification["property-type"]==="cross-faded-data-driven",p=l.value.isDataDriven(),g=l.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);let m=this._transitionablePaint._values[e].value;return m.isDataDriven()||p||h||this._handleOverridablePaintPropertyUpdate(e,g,m)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,o){return!1}isHidden(e=this.minzoom,i=!1){return!!(this.minzoom&&e<(i?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,i){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){var e,i;let o={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:(e=this._unevaluatedLayout)===null||e===void 0?void 0:e.serialize(),paint:(i=this._transitionablePaint)===null||i===void 0?void 0:i.serialize()};return this.visibility&&(o.layout||(o.layout={}),o.layout.visibility=this.visibility),vi(o,((n,l)=>!(n===void 0||l==="layout"&&!Object.keys(n).length||l==="paint"&&!Object.keys(n).length)))}_validate(e,i,o,n,l={}){return l?.validate!==!1&&Oo(this,e.call(Bo,{key:i,layerType:this.type,objectKey:o,value:n,styleSpec:he,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let i=this.paint.get(e);if(i instanceof oa&&ko(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let zu;var lc={get paint(){return zu=zu||new tr({"raster-opacity":new Ke(he.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ke(he.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ke(he.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ke(he.paint_raster["raster-brightness-max"]),"raster-saturation":new Ke(he.paint_raster["raster-saturation"]),"raster-contrast":new Ke(he.paint_raster["raster-contrast"]),resampling:new Ke(he.paint_raster.resampling),"raster-resampling":new Ke(he.paint_raster["raster-resampling"]),"raster-fade-duration":new Ke(he.paint_raster["raster-fade-duration"])})}};class Zh extends Mr{constructor(e,i){super(e,lc,i)}}let $h={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class jo{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ri{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function fi(r,e=1){let i=0,o=0;return{members:r.map((n=>{let l=$h[n.type].BYTES_PER_ELEMENT,h=i=Au(i,Math.max(e,l)),p=n.components||1;return o=Math.max(o,l),i+=l*p,{name:n.name,type:n.type,components:p,offset:h}})),size:Au(i,Math.max(o,e)),alignment:e}}function Au(r,e){return Math.ceil(r/e)*e}class In extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let n=2*e;return this.int16[n+0]=i,this.int16[n+1]=o,e}}In.prototype.bytesPerElement=4,Ne("StructArrayLayout2i4",In);class Us extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o){let n=this.length;return this.resize(n+1),this.emplace(n,e,i,o)}emplace(e,i,o,n){let l=3*e;return this.int16[l+0]=i,this.int16[l+1]=o,this.int16[l+2]=n,e}}Us.prototype.bytesPerElement=6,Ne("StructArrayLayout3i6",Us);class cc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n){let l=this.length;return this.resize(l+1),this.emplace(l,e,i,o,n)}emplace(e,i,o,n,l){let h=4*e;return this.int16[h+0]=i,this.int16[h+1]=o,this.int16[h+2]=n,this.int16[h+3]=l,e}}cc.prototype.bytesPerElement=8,Ne("StructArrayLayout4i8",cc);class uc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,n,l,h)}emplace(e,i,o,n,l,h,p){let g=6*e;return this.int16[g+0]=i,this.int16[g+1]=o,this.int16[g+2]=n,this.int16[g+3]=l,this.int16[g+4]=h,this.int16[g+5]=p,e}}uc.prototype.bytesPerElement=12,Ne("StructArrayLayout2i4i12",uc);class Na extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,n,l,h)}emplace(e,i,o,n,l,h,p){let g=4*e,m=8*e;return this.int16[g+0]=i,this.int16[g+1]=o,this.uint8[m+4]=n,this.uint8[m+5]=l,this.uint8[m+6]=h,this.uint8[m+7]=p,e}}Na.prototype.bytesPerElement=8,Ne("StructArrayLayout2i4ub8",Na);class zn extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let n=2*e;return this.float32[n+0]=i,this.float32[n+1]=o,e}}zn.prototype.bytesPerElement=8,Ne("StructArrayLayout2f8",zn);class hc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h,p,g,m,v){let _=this.length;return this.resize(_+1),this.emplace(_,e,i,o,n,l,h,p,g,m,v)}emplace(e,i,o,n,l,h,p,g,m,v,_){let T=10*e;return this.uint16[T+0]=i,this.uint16[T+1]=o,this.uint16[T+2]=n,this.uint16[T+3]=l,this.uint16[T+4]=h,this.uint16[T+5]=p,this.uint16[T+6]=g,this.uint16[T+7]=m,this.uint16[T+8]=v,this.uint16[T+9]=_,e}}hc.prototype.bytesPerElement=20,Ne("StructArrayLayout10ui20",hc);class dc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h,p,g){let m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,n,l,h,p,g)}emplace(e,i,o,n,l,h,p,g,m){let v=8*e;return this.uint16[v+0]=i,this.uint16[v+1]=o,this.uint16[v+2]=n,this.uint16[v+3]=l,this.uint16[v+4]=h,this.uint16[v+5]=p,this.uint16[v+6]=g,this.uint16[v+7]=m,e}}dc.prototype.bytesPerElement=16,Ne("StructArrayLayout8ui16",dc);class qs extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h,p,g,m,v,_,T){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,n,l,h,p,g,m,v,_,T)}emplace(e,i,o,n,l,h,p,g,m,v,_,T,x){let M=12*e;return this.int16[M+0]=i,this.int16[M+1]=o,this.int16[M+2]=n,this.int16[M+3]=l,this.uint16[M+4]=h,this.uint16[M+5]=p,this.uint16[M+6]=g,this.uint16[M+7]=m,this.int16[M+8]=v,this.int16[M+9]=_,this.int16[M+10]=T,this.int16[M+11]=x,e}}qs.prototype.bytesPerElement=24,Ne("StructArrayLayout4i4ui4i24",qs);class Gs extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){let n=this.length;return this.resize(n+1),this.emplace(n,e,i,o)}emplace(e,i,o,n){let l=3*e;return this.float32[l+0]=i,this.float32[l+1]=o,this.float32[l+2]=n,e}}Gs.prototype.bytesPerElement=12,Ne("StructArrayLayout3f12",Gs);class pc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}pc.prototype.bytesPerElement=4,Ne("StructArrayLayout1ul4",pc);class fc extends ri{_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,i,o,n,l,h,p,g,m){let v=this.length;return this.resize(v+1),this.emplace(v,e,i,o,n,l,h,p,g,m)}emplace(e,i,o,n,l,h,p,g,m,v){let _=10*e,T=5*e;return this.int16[_+0]=i,this.int16[_+1]=o,this.int16[_+2]=n,this.int16[_+3]=l,this.int16[_+4]=h,this.int16[_+5]=p,this.uint32[T+3]=g,this.uint16[_+8]=m,this.uint16[_+9]=v,e}}fc.prototype.bytesPerElement=20,Ne("StructArrayLayout6i1ul2ui20",fc);class ba extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,n,l,h)}emplace(e,i,o,n,l,h,p){let g=6*e;return this.int16[g+0]=i,this.int16[g+1]=o,this.int16[g+2]=n,this.int16[g+3]=l,this.int16[g+4]=h,this.int16[g+5]=p,e}}ba.prototype.bytesPerElement=12,Ne("StructArrayLayout2i2i2i12",ba);class Zs extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,n,l)}emplace(e,i,o,n,l,h){let p=4*e,g=8*e;return this.float32[p+0]=i,this.float32[p+1]=o,this.float32[p+2]=n,this.int16[g+6]=l,this.int16[g+7]=h,e}}Zs.prototype.bytesPerElement=16,Ne("StructArrayLayout2f1f2i16",Zs);class An extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,n,l,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,n,l,h)}emplace(e,i,o,n,l,h,p){let g=16*e,m=4*e,v=8*e;return this.uint8[g+0]=i,this.uint8[g+1]=o,this.float32[m+1]=n,this.float32[m+2]=l,this.int16[v+6]=h,this.int16[v+7]=p,e}}An.prototype.bytesPerElement=16,Ne("StructArrayLayout2ub2f2i16",An);class kn extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){let n=this.length;return this.resize(n+1),this.emplace(n,e,i,o)}emplace(e,i,o,n){let l=3*e;return this.uint16[l+0]=i,this.uint16[l+1]=o,this.uint16[l+2]=n,e}}kn.prototype.bytesPerElement=6,Ne("StructArrayLayout3ui6",kn);class Dn extends ri{_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,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L){let N=this.length;return this.resize(N+1),this.emplace(N,e,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L)}emplace(e,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L,N){let F=24*e,j=12*e,U=48*e;return this.int16[F+0]=i,this.int16[F+1]=o,this.uint16[F+2]=n,this.uint16[F+3]=l,this.uint32[j+2]=h,this.uint32[j+3]=p,this.uint32[j+4]=g,this.uint16[F+10]=m,this.uint16[F+11]=v,this.uint16[F+12]=_,this.float32[j+7]=T,this.float32[j+8]=x,this.uint8[U+36]=M,this.uint8[U+37]=C,this.uint8[U+38]=D,this.uint32[j+10]=L,this.int16[F+22]=N,e}}Dn.prototype.bytesPerElement=48,Ne("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Dn);class mc extends ri{_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,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L,N,F,j,U,G,re,oe,pe,ce,_e,ye){let fe=this.length;return this.resize(fe+1),this.emplace(fe,e,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L,N,F,j,U,G,re,oe,pe,ce,_e,ye)}emplace(e,i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L,N,F,j,U,G,re,oe,pe,ce,_e,ye,fe){let ue=32*e,Ie=16*e;return this.int16[ue+0]=i,this.int16[ue+1]=o,this.int16[ue+2]=n,this.int16[ue+3]=l,this.int16[ue+4]=h,this.int16[ue+5]=p,this.int16[ue+6]=g,this.int16[ue+7]=m,this.uint16[ue+8]=v,this.uint16[ue+9]=_,this.uint16[ue+10]=T,this.uint16[ue+11]=x,this.uint16[ue+12]=M,this.uint16[ue+13]=C,this.uint16[ue+14]=D,this.uint16[ue+15]=L,this.uint16[ue+16]=N,this.uint16[ue+17]=F,this.uint16[ue+18]=j,this.uint16[ue+19]=U,this.uint16[ue+20]=G,this.uint16[ue+21]=re,this.uint16[ue+22]=oe,this.uint32[Ie+12]=pe,this.float32[Ie+13]=ce,this.float32[Ie+14]=_e,this.uint16[ue+30]=ye,this.uint16[ue+31]=fe,e}}mc.prototype.bytesPerElement=64,Ne("StructArrayLayout8i15ui1ul2f2ui64",mc);class Ka extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Ka.prototype.bytesPerElement=4,Ne("StructArrayLayout1f4",Ka);class Ja extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){let n=this.length;return this.resize(n+1),this.emplace(n,e,i,o)}emplace(e,i,o,n){let l=3*e;return this.uint16[6*e+0]=i,this.float32[l+1]=o,this.float32[l+2]=n,e}}Ja.prototype.bytesPerElement=12,Ne("StructArrayLayout1ui2f12",Ja);class gc extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){let n=this.length;return this.resize(n+1),this.emplace(n,e,i,o)}emplace(e,i,o,n){let l=4*e;return this.uint32[2*e+0]=i,this.uint16[l+2]=o,this.uint16[l+3]=n,e}}gc.prototype.bytesPerElement=8,Ne("StructArrayLayout1ul2ui8",gc);class $s extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let n=2*e;return this.uint16[n+0]=i,this.uint16[n+1]=o,e}}$s.prototype.bytesPerElement=4,Ne("StructArrayLayout2ui4",$s);class Qa extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}Qa.prototype.bytesPerElement=2,Ne("StructArrayLayout1ui2",Qa);class _c extends ri{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,n){let l=this.length;return this.resize(l+1),this.emplace(l,e,i,o,n)}emplace(e,i,o,n,l){let h=4*e;return this.float32[h+0]=i,this.float32[h+1]=o,this.float32[h+2]=n,this.float32[h+3]=l,e}}_c.prototype.bytesPerElement=16,Ne("StructArrayLayout4f16",_c);class ku extends jo{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 se(this.anchorPointX,this.anchorPointY)}}ku.prototype.size=20;class yc extends fc{get(e){return new ku(this,e)}}Ne("CollisionBoxArray",yc);class Du extends jo{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]}}Du.prototype.size=48;class d extends Dn{get(e){return new Du(this,e)}}Ne("PlacedSymbolArray",d);class t extends jo{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}t.prototype.size=64;class a extends mc{get(e){return new t(this,e)}}Ne("SymbolInstanceArray",a);class s extends Ka{getoffsetX(e){return this.float32[1*e+0]}}Ne("GlyphOffsetArray",s);class c extends Us{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ne("SymbolLineVertexArray",c);class f extends jo{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]}}f.prototype.size=12;class y extends Ja{get(e){return new f(this,e)}}Ne("TextAnchorOffsetArray",y);class b extends jo{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]}}b.prototype.size=8;class w extends gc{get(e){return new b(this,e)}}Ne("FeatureIndexArray",w);class S extends In{}class P extends In{}class A extends In{}class k extends uc{}class R extends Na{}class V extends zn{}class q extends hc{}class H extends dc{}class Z extends qs{}class Y extends Gs{}class ie extends pc{}class X extends ba{}class W extends An{}class te extends kn{}class J extends $s{}let le=fi([{name:"a_pos",components:2,type:"Int16"}],4),{members:me}=le;class de{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,o,n){let l=this.segments[this.segments.length-1];return e>de.MAX_VERTEX_ARRAY_LENGTH&&qt(`Max vertices per segment is ${de.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${de.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!l||l.vertexLength+e>de.MAX_VERTEX_ARRAY_LENGTH||l.sortKey!==n?this.createNewSegment(i,o,n):l}createNewSegment(e,i,o){let n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return o!==void 0&&(n.sortKey=o),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,i,o){return this.prepareSegment(0,e,i,o)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,o,n){return new de([{vertexOffset:e,primitiveOffset:i,vertexLength:o,primitiveLength:n,vaos:{},sortKey:0}])}}function Pe(r,e){return 256*(r=ht(Math.floor(r),0,255))+ht(Math.floor(e),0,255)}de.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ne("SegmentVector",de);let Me=fi([{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"}]),Qe=fi([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var Le,xe,et,tt={exports:{}},Vt={exports:{}},mi={exports:{}},Qt=(function(){if(et)return tt.exports;et=1;var r=(Le||(Le=1,Vt.exports=function(i,o){var n,l,h,p,g,m,v,_;for(l=i.length-(n=3&i.length),h=o,g=3432918353,m=461845907,_=0;_<l;)v=255&i.charCodeAt(_)|(255&i.charCodeAt(++_))<<8|(255&i.charCodeAt(++_))<<16|(255&i.charCodeAt(++_))<<24,++_,h=27492+(65535&(p=5*(65535&(h=(h^=v=(65535&(v=(v=(65535&v)*g+(((v>>>16)*g&65535)<<16)&4294967295)<<15|v>>>17))*m+(((v>>>16)*m&65535)<<16)&4294967295)<<13|h>>>19))+((5*(h>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(v=0,n){case 3:v^=(255&i.charCodeAt(_+2))<<16;case 2:v^=(255&i.charCodeAt(_+1))<<8;case 1:h^=v=(65535&(v=(v=(65535&(v^=255&i.charCodeAt(_)))*g+(((v>>>16)*g&65535)<<16)&4294967295)<<15|v>>>17))*m+(((v>>>16)*m&65535)<<16)&4294967295}return h^=i.length,h=2246822507*(65535&(h^=h>>>16))+((2246822507*(h>>>16)&65535)<<16)&4294967295,h=3266489909*(65535&(h^=h>>>13))+((3266489909*(h>>>16)&65535)<<16)&4294967295,(h^=h>>>16)>>>0}),Vt.exports),e=(xe||(xe=1,mi.exports=function(i,o){for(var n,l=i.length,h=o^l,p=0;l>=4;)n=1540483477*(65535&(n=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(n>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),l-=4,++p;switch(l){case 3:h^=(255&i.charCodeAt(p+2))<<16;case 2:h^=(255&i.charCodeAt(p+1))<<8;case 1:h=1540483477*(65535&(h^=255&i.charCodeAt(p)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0}),mi.exports);return tt.exports=r,tt.exports.murmur3=r,tt.exports.murmur2=e,tt.exports})(),wi=Ce(Qt);class Ti{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,o,n){this.ids.push(Br(e)),this.positions.push(i,o,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let i=Br(e),o=0,n=this.ids.length-1;for(;o<n;){let h=o+n>>1;this.ids[h]>=i?n=h:o=h+1}let l=[];for(;this.ids[o]===i;)l.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return l}static serialize(e,i){let o=new Float64Array(e.ids),n=new Uint32Array(e.positions);return ci(o,n,0,o.length-1),i&&i.push(o.buffer,n.buffer),{ids:o,positions:n}}static deserialize(e){let i=new Ti;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function Br(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:wi(String(r))}function ci(r,e,i,o){for(;i<o;){let n=r[i+o>>1],l=i-1,h=o+1;for(;;){do l++;while(r[l]<n);do h--;while(r[h]>n);if(l>=h)break;Xi(r,l,h),Xi(e,3*l,3*h),Xi(e,3*l+1,3*h+1),Xi(e,3*l+2,3*h+2)}h-i<o-h?(ci(r,e,i,h),i=h+1):(ci(r,e,h+1,o),o=h)}}function Xi(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}Ne("FeaturePositionMap",Ti);class ai{constructor(e,i){this.gl=e.gl,this.location=i}}class Li extends ai{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Cr extends ai{constructor(e,i){super(e,i),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 ja extends ai{constructor(e,i){super(e,i),this.current=Ct.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))}}let Vo=new Float32Array(16);function eo(r){return[Pe(255*r.r,255*r.g),Pe(255*r.b,255*r.a)]}class Wr{constructor(e,i,o){this.value=e,this.uniformNames=i.map((n=>`u_${n}`)),this.type=o}setUniform(e,i,o){e.set(o.constantOr(this.value))}getBinding(e,i,o){return this.type==="color"?new ja(e,i):new Li(e,i)}}class Hr{constructor(e,i){this.uniformNames=i.map((o=>`u_${o}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,i){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(e,i,o,n){let l=null;n==="u_pattern_to"?l=this.patternTo:n==="u_pattern_from"?l=this.patternFrom:n==="u_dasharray_to"?l=this.dashTo:n==="u_dasharray_from"?l=this.dashFrom:n==="u_pixel_ratio_to"?l=this.pixelRatioTo:n==="u_pixel_ratio_from"&&(l=this.pixelRatioFrom),l!==null&&e.set(l)}getBinding(e,i,o){return o.startsWith("u_pattern")||o.startsWith("u_dasharray_")?new Cr(e,i):new Li(e,i)}}class _r{constructor(e,i,o,n){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=i.map((l=>({name:`a_${l}`,type:"Float32",components:o==="color"?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,i,o){let n=this.paintVertexArray.length,l=this.expression.evaluate(new Wt(0,o),i,{},o.canonical,[],o.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(n,e,l)}updatePaintArray(e,i,o,n,l){let h=this.expression.evaluate(new Wt(0,l),o,n);this._setPaintValue(e,i,h)}_setPaintValue(e,i,o){if(this.type==="color"){let n=eo(o);for(let l=e;l<i;l++)this.paintVertexArray.emplace(l,n[0],n[1])}else{for(let n=e;n<i;n++)this.paintVertexArray.emplace(n,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){var i,o;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.paintVertexBuffer)===null||o===void 0)&&o.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Or{constructor(e,i,o,n,l,h){this.expression=e,this.uniformNames=i.map((p=>`u_${p}_t`)),this.type=o,this.useIntegerZoom=n,this.zoom=l,this.maxValue=0,this.paintVertexAttributes=i.map((p=>({name:`a_${p}`,type:"Float32",components:o==="color"?4:2,offset:0}))),this.paintVertexArray=new h}populatePaintArray(e,i,o){let n=this.expression.evaluate(new Wt(this.zoom,o),i,{},o.canonical,[],o.formattedSection),l=this.expression.evaluate(new Wt(this.zoom+1,o),i,{},o.canonical,[],o.formattedSection),h=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(h,e,n,l)}updatePaintArray(e,i,o,n,l){let h=this.expression.evaluate(new Wt(this.zoom,l),o,n),p=this.expression.evaluate(new Wt(this.zoom+1,l),o,n);this._setPaintValue(e,i,h,p)}_setPaintValue(e,i,o,n){if(this.type==="color"){let l=eo(o),h=eo(n);for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,l[0],l[1],h[0],h[1])}else{for(let l=e;l<i;l++)this.paintVertexArray.emplace(l,o,n);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(n))}}upload(e){var i,o;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.paintVertexBuffer)===null||o===void 0)&&o.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,i){let o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,n=ht(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,i,o){return new Li(e,i)}}class Yi{constructor(e,i,o,n,l,h){this.expression=e,this.type=i,this.useIntegerZoom=o,this.zoom=n,this.layerId=h,this.zoomInPaintVertexArray=new l,this.zoomOutPaintVertexArray=new l}populatePaintArray(e,i,o){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,this.getPositionIds(i),o)}updatePaintArray(e,i,o,n,l){this._setPaintValues(e,i,this.getPositionIds(o),l)}_setPaintValues(e,i,o,n){let l=this.getPositions(n);if(!l||!o)return;let h=l[o.min],p=l[o.mid],g=l[o.max];if(h&&p&&g)for(let m=e;m<i;m++)this.emplace(this.zoomInPaintVertexArray,m,p,h),this.emplace(this.zoomOutPaintVertexArray,m,p,g)}upload(e){var i,o;if(!((i=this.zoomInPaintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.zoomOutPaintVertexArray)===null||o===void 0)&&o.arrayBuffer.byteLength)){let n=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,n,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,n,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class xa extends Yi{getPositions(e){return e.imagePositions}getPositionIds(e){var i;return(i=e.patterns)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return Me.members}emplace(e,i,o,n){e.emplace(i,o.tlbr[0],o.tlbr[1],o.tlbr[2],o.tlbr[3],n.tlbr[0],n.tlbr[1],n.tlbr[2],n.tlbr[3],o.pixelRatio,n.pixelRatio)}}class pa extends Yi{getPositions(e){return e.dashPositions}getPositionIds(e){var i;return(i=e.dashes)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return Qe.members}emplace(e,i,o,n){e.emplace(i,0,o.y,o.height,o.width,0,n.y,n.height,n.width)}}class to{constructor(e,i,o){this.binders={},this._buffers=[];let n=[];for(let l in e.paint._values){if(!o(l))continue;let h=e.paint.get(l);if(!(h instanceof oa&&ko(h.property.specification)))continue;let p=ir(l,e.type),g=h.value,m=h.property.specification.type,v=h.property.useIntegerZoom,_=h.property.specification["property-type"],T=_==="cross-faded"||_==="cross-faded-data-driven";if(g.kind==="constant")this.binders[l]=T?new Hr(g.value,p):new Wr(g.value,p,m),n.push(`/u_${l}`);else if(g.kind==="source"||T){let x=Er(l,m,"source");this.binders[l]=T?l==="line-dasharray"?new pa(g,m,v,i,x,e.id):new xa(g,m,v,i,x,e.id):new _r(g,p,m,x),n.push(`/a_${l}`)}else{let x=Er(l,m,"composite");this.binders[l]=new Or(g,p,m,v,i,x),n.push(`/z_${l}`)}}this.cacheKey=n.sort().join("")}getMaxValue(e){let i=this.binders[e];return i instanceof _r||i instanceof Or?i.maxValue:0}populatePaintArrays(e,i,o){for(let n in this.binders){let l=this.binders[n];(l instanceof _r||l instanceof Or||l instanceof Yi)&&l.populatePaintArray(e,i,o)}}setConstantPatternPositions(e,i){for(let o in this.binders){let n=this.binders[o];n instanceof Hr&&n.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(let o in this.binders){let n=this.binders[o];n instanceof Hr&&n.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,o,n,l){let h=!1;for(let p in e){let g=i.getPositions(p);for(let m of g){let v=o.feature(m.index);for(let _ in this.binders){let T=this.binders[_];if((T instanceof _r||T instanceof Or||T instanceof Yi)&&T.expression.isStateDependent===!0){let x=n.paint.get(_);T.expression=x.value,T.updatePaintArray(m.start,m.end,v,e[p],l),h=!0}}}}return h}defines(){let e=[];for(let i in this.binders){let o=this.binders[i];(o instanceof Wr||o instanceof Hr)&&e.push(...o.uniformNames.map((n=>`#define HAS_UNIFORM_${n}`)))}return e}getBinderAttributes(){let e=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof _r||o instanceof Or)for(let n of o.paintVertexAttributes)e.push(n.name);else if(o instanceof Yi){let n=o.getVertexAttributes();for(let l of n)e.push(l.name)}}return e}getBinderUniforms(){let e=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof Wr||o instanceof Hr||o instanceof Or)for(let n of o.uniformNames)e.push(n)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){let o=[];for(let n in this.binders){let l=this.binders[n];if(l instanceof Wr||l instanceof Hr||l instanceof Or){for(let h of l.uniformNames)if(i[h]){let p=l.getBinding(e,i[h],h);o.push({name:h,property:n,binding:p})}}}return o}setUniforms(e,i,o,n){for(let{name:l,property:h,binding:p}of i)this.binders[h].setUniform(p,n,o.get(h),l)}updatePaintBuffers(e){this._buffers=[];for(let i in this.binders){let o=this.binders[i];if(e&&o instanceof Yi){let n=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(o instanceof _r||o instanceof Or)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(let i in this.binders){let o=this.binders[i];(o instanceof _r||o instanceof Or||o instanceof Yi)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let i=this.binders[e];(i instanceof _r||i instanceof Or||i instanceof Yi)&&i.destroy()}}}class Si{constructor(e,i,o=()=>!0){this.programConfigurations={};for(let n of e)this.programConfigurations[n.id]=new to(n,i,o);this.needsUpload=!1,this._featureMap=new Ti,this._bufferOffset=0}populatePaintArrays(e,i,o,n){for(let l in this.programConfigurations)this.programConfigurations[l].populatePaintArrays(e,i,n);i.id!==void 0&&this._featureMap.add(i.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,o,n){for(let l of o)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,i,l,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function ir(r,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"]}[r]||[r.replace(`${e}-`,"").replace(/-/g,"_")]}function Er(r,e,i){let o={color:{source:zn,composite:_c},number:{source:Ka,composite:zn}},n=(function(l){return{"line-pattern":{source:q,composite:q},"fill-pattern":{source:q,composite:q},"fill-extrusion-pattern":{source:q,composite:q},"line-dasharray":{source:H,composite:H}}[l]})(r);return n?.[i]||o[e][i]}Ne("ConstantBinder",Wr),Ne("CrossFadedConstantBinder",Hr),Ne("SourceExpressionBinder",_r),Ne("CrossFadedPatternBinder",xa),Ne("CrossFadedDasharrayBinder",pa),Ne("CompositeExpressionBinder",Or),Ne("ProgramConfiguration",to,{omit:["_buffers"]}),Ne("ProgramConfigurationSet",Si);let oi=Math.pow(2,14)-1,io=-oi-1;function wa(r){let e=He/r.extent,i=r.loadGeometry();for(let o of i)for(let n of o){let l=Math.round(n.x*e),h=Math.round(n.y*e);n.x=ht(l,io,oi),n.y=ht(h,io,oi),(l<n.x||l>n.x+1||h<n.y||h>n.y+1)&&qt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Ta(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?wa(r):[]}}let Ws=-32768;function Wh(r,e,i,o,n){r.emplaceBack(Ws+8*e+o,Ws+8*i+n)}class vc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new P,this.indexArray=new te,this.segments=new de,this.programConfigurations=new Si(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){let n=this.layers[0],l=[],h=null,p=!1,g=n.type==="heatmap";if(n.type==="circle"){let v=n;h=v.layout.get("circle-sort-key"),p=!h.isConstant(),g||(g=v.paint.get("circle-pitch-alignment")==="map")}let m=g?i.subdivisionGranularity.circle:1;for(let{feature:v,id:_,index:T,sourceLayerIndex:x}of e){let M=this.layers[0]._featureFilter.needGeometry,C=Ta(v,M);if(!this.layers[0]._featureFilter.filter(new Wt(this.zoom),C,o))continue;let D=p?h.evaluate(C,{},o):void 0,L={id:_,properties:v.properties,type:v.type,sourceLayerIndex:x,index:T,geometry:M?C.geometry:wa(v),patterns:{},sortKey:D};l.push(L)}p&&l.sort(((v,_)=>v.sortKey-_.sortKey));for(let v of l){let{geometry:_,index:T,sourceLayerIndex:x}=v,M=e[T].feature;this.addFeature(v,_,T,o,m),i.featureIndex.insert(M,_,T,x,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,me),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,i,o,n,l=1){let h;switch(l){case 1:h=[0,7];break;case 3:h=[0,2,5,7];break;case 5:h=[0,1,3,4,6,7];break;case 7:h=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${l}; valid values are 1, 3, 5, 7.`)}let p=h.length;for(let g of i)for(let m of g){let v=m.x,_=m.y;if(v<0||v>=He||_<0||_>=He)continue;let T=this.segments.prepareSegment(p*p,this.layoutVertexArray,this.indexArray,e.sortKey),x=T.vertexLength;for(let M=0;M<p;M++)for(let C=0;C<p;C++)Wh(this.layoutVertexArray,v,_,h[C],h[M]);for(let M=0;M<p-1;M++)for(let C=0;C<p-1;C++){let D=x+M*p+C,L=x+(M+1)*p+C;this.indexArray.emplaceBack(D,L+1,D+1),this.indexArray.emplaceBack(D,L,L+1)}T.vertexLength+=p*p,T.primitiveLength+=(p-1)*(p-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:{},canonical:n})}}function Va(r,e){for(let i of r)if(Hs(e,i))return!0;for(let i of e)if(Hs(r,i))return!0;return Rn(r,e)}function Ln(r,e,i){return!!Hs(r,e)||Fn(e,r,i)}function bc(r,e){if(r.length===1)return Pp(e,r[0]);for(let i of e)for(let o of i)if(Hs(r,o))return!0;for(let i of r)if(Pp(e,i))return!0;for(let i of e)if(Rn(r,i))return!0;return!1}function Lu(r,e,i){if(r.length>1){if(Rn(r,e))return!0;for(let o of e)if(Fn(o,r,i))return!0}for(let o of r)if(Fn(o,e,i))return!0;return!1}function Rn(r,e){if(r.length===0||e.length===0)return!1;for(let i=0;i<r.length-1;i++){let o=r[i],n=r[i+1];for(let l=0;l<e.length-1;l++)if(Ru(o,n,e[l],e[l+1]))return!0}return!1}function Ru(r,e,i,o){return Pi(r,i,o)!==Pi(e,i,o)&&Pi(r,e,i)!==Pi(r,e,o)}function Fn(r,e,i){let o=i*i;if(e.length===1)return r.distSqr(e[0])<o;for(let n=1;n<e.length;n++)if(Sp(r,e[n-1],e[n])<o)return!0;return!1}function Sp(r,e,i){let o=e.distSqr(i);if(o===0)return r.distSqr(e);let n=((r.x-e.x)*(i.x-e.x)+(r.y-e.y)*(i.y-e.y))/o;return r.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function Pp(r,e){let i,o,n,l=!1;for(let h of r){i=h;for(let p=0,g=i.length-1;p<i.length;g=p++)o=i[p],n=i[g],o.y>e.y!=n.y>e.y&&e.x<(n.x-o.x)*(e.y-o.y)/(n.y-o.y)+o.x&&(l=!l)}return l}function Hs(r,e){let i=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){let l=r[o],h=r[n];l.y>e.y!=h.y>e.y&&e.x<(h.x-l.x)*(e.y-l.y)/(h.y-l.y)+l.x&&(i=!i)}return i}function Gg(r,e,i){let o=i[0],n=i[2];if(r.x<o.x&&e.x<o.x||r.x>n.x&&e.x>n.x||r.y<o.y&&e.y<o.y||r.y>n.y&&e.y>n.y)return!1;let l=Pi(r,e,i[0]);return l!==Pi(r,e,i[1])||l!==Pi(r,e,i[2])||l!==Pi(r,e,i[3])}function Xs(r,e,i){let o=e.paint.get(r).value;return o.kind==="constant"?o.value:i.programConfigurations.get(e.id).getMaxValue(r)}function Fu(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Bu(r,e,i,o,n){if(!e[0]&&!e[1])return r;let l=se.convert(e)._mult(n);i==="viewport"&&l._rotate(-o);let h=[];for(let p of r)h.push(p.sub(l));return h}function Zg(r){let e=[];for(let i=0;i<r.length;i++){let o=r[i],n=e.at(-1);(i===0||n&&!o.equals(n))&&e.push(o)}return e}function $g({queryGeometry:r,size:e},i){return Ln(r,i,e)}function Wg({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:n},l){return Ln(r,l,e*(i.projectTileCoordinates(l.x,l.y,o,n).signedDistanceFromCamera/i.cameraToCenterDistance))}function Hg({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:n},l){let h=i.projectTileCoordinates(l.x,l.y,o,n).signedDistanceFromCamera,p=e*(i.cameraToCenterDistance/h);return Ln(r,Hh(l,i,o,n),p)}function Xg({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:n},l){return Ln(r,Hh(l,i,o,n),e)}function Mp({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:n,pitchAlignment:l="map",pitchScale:h="map"},p){let g=l==="map"?h==="map"?$g:Wg:h==="map"?Hg:Xg,m={queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:n};for(let v of p)for(let _ of v)if(g(m,_))return!0;return!1}function Hh(r,e,i,o){let n=e.projectTileCoordinates(r.x,r.y,i,o).point;return new se((.5*n.x+.5)*e.width,(.5*-n.y+.5)*e.height)}let Cp,Ep;Ne("CircleBucket",vc,{omit:["layers"]});var Yg={get paint(){return Ep=Ep||new tr({"circle-radius":new rt(he.paint_circle["circle-radius"]),"circle-color":new rt(he.paint_circle["circle-color"]),"circle-blur":new rt(he.paint_circle["circle-blur"]),"circle-opacity":new rt(he.paint_circle["circle-opacity"]),"circle-translate":new Ke(he.paint_circle["circle-translate"]),"circle-translate-anchor":new Ke(he.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ke(he.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ke(he.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new rt(he.paint_circle["circle-stroke-width"]),"circle-stroke-color":new rt(he.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new rt(he.paint_circle["circle-stroke-opacity"])})},get layout(){return Cp=Cp||new tr({"circle-sort-key":new rt(he.layout_circle["circle-sort-key"])})}};class Kg extends Mr{constructor(e,i){super(e,Yg,i)}createBucket(e){return new vc(e)}queryRadius(e){let i=e;return Xs("circle-radius",this,i)+Xs("circle-stroke-width",this,i)+Fu(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:n,transform:l,pixelsToTileUnits:h,unwrappedTileID:p,getElevation:g}){let m=Bu(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-l.bearingInRadians,h),v=this.paint.get("circle-radius").evaluate(i,o)+this.paint.get("circle-stroke-width").evaluate(i,o),_=this.paint.get("circle-pitch-scale"),T=this.paint.get("circle-pitch-alignment"),x,M;return T==="map"?(x=m,M=v*h):(x=(function(C,D,L,N){return C.map((F=>Hh(F,D,L,N)))})(m,l,p,g),M=v),Mp({queryGeometry:x,size:M,transform:l,unwrappedTileID:p,getElevation:g,pitchAlignment:T,pitchScale:_},n)}}class Ip extends vc{}let zp;Ne("HeatmapBucket",Ip,{omit:["layers"]});var Jg={get paint(){return zp=zp||new tr({"heatmap-radius":new rt(he.paint_heatmap["heatmap-radius"]),"heatmap-weight":new rt(he.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ke(he.paint_heatmap["heatmap-intensity"]),"heatmap-color":new En(he.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ke(he.paint_heatmap["heatmap-opacity"])})}};function Xh(r,{width:e,height:i},o,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*i*o)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${e*i*o}`)}else n=new Uint8Array(e*i*o);return r.width=e,r.height=i,r.data=n,r}function Ap(r,{width:e,height:i},o){if(e===r.width&&i===r.height)return;let n=Xh({},{width:e,height:i},o);Yh(r,n,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,i)},o),r.width=e,r.height=i,r.data=n.data}function Yh(r,e,i,o,n,l){if(n.width===0||n.height===0)return e;if(n.width>r.width||n.height>r.height||i.x>r.width-n.width||i.y>r.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||o.x>e.width-n.width||o.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let h=r.data,p=e.data;if(h===p)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g<n.height;g++){let m=((i.y+g)*r.width+i.x)*l,v=((o.y+g)*e.width+o.x)*l;for(let _=0;_<n.width*l;_++)p[v+_]=h[m+_]}return e}class xc{constructor(e,i){Xh(this,e,1,i)}resize(e){Ap(this,e,1)}clone(){return new xc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,n,l){Yh(e,i,o,n,l,1)}}class Nr{constructor(e,i){Xh(this,e,4,i)}resize(e){Ap(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Nr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,n,l){Yh(e,i,o,n,l,4)}setPixel(e,i,o){let n=4*(e*this.width+i);this.data[n+0]=Math.round(255*o.r/o.a),this.data[n+1]=Math.round(255*o.g/o.a),this.data[n+2]=Math.round(255*o.b/o.a),this.data[n+3]=Math.round(255*o.a)}}function kp(r){let e=new Uint8Array(r.length);for(let i=0;i<r.length;i+=4){let o=r[i+3];e[i+0]=Math.round(r[i+0]*o/255),e[i+1]=Math.round(r[i+1]*o/255),e[i+2]=Math.round(r[i+2]*o/255),e[i+3]=o}return e}function Dp(r){let e={},i=r.resolution||256,o=r.clips?r.clips.length:1,n=r.image||new Nr({width:i,height:o});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);let l=(h,p,g)=>{e[r.evaluationKey]=g;let m=r.expression.evaluate(e);n.setPixel(h/4/i,p/4,m)};if(r.clips)for(let h=0,p=0;h<o;++h,p+=4*i)for(let g=0,m=0;g<i;g++,m+=4){let v=g/(i-1),{start:_,end:T}=r.clips[h];l(p,m,_*(1-v)+T*v)}else for(let h=0,p=0;h<i;h++,p+=4)l(0,p,h/(i-1));return n}Ne("AlphaImage",xc),Ne("RGBAImage",Nr);let Kh="big-fb";class Qg extends Mr{createBucket(e){return new Ip(e)}constructor(e,i){super(e,Jg,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Dp({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Kh)&&this.heatmapFbos.delete(Kh)}queryRadius(e){return Xs("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:n,transform:l,pixelsToTileUnits:h,unwrappedTileID:p,getElevation:g}){return Mp({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,o)*h,transform:l,unwrappedTileID:p,getElevation:g},n)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let Lp;var e0={get paint(){return Lp=Lp||new tr({"hillshade-illumination-direction":new Ke(he.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Ke(he.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Ke(he.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ke(he.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ke(he.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ke(he.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ke(he.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Ke(he.paint_hillshade["hillshade-method"]),resampling:new Ke(he.paint_hillshade.resampling)})}};class t0 extends Mr{constructor(e,i){super(e,e0,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,o=this.paint.get("hillshade-highlight-color").values,n=this.paint.get("hillshade-shadow-color").values,l=Math.max(e.length,i.length,o.length,n.length);e=e.concat(Array(l-e.length).fill(e.at(-1))),i=i.concat(Array(l-i.length).fill(i.at(-1))),o=o.concat(Array(l-o.length).fill(o.at(-1))),n=n.concat(Array(l-n.length).fill(n.at(-1)));let h=i.map(Te);return{directionRadians:e.map(Te),altitudeRadians:h,shadowColor:n,highlightColor:o}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let Rp;var i0={get paint(){return Rp=Rp||new tr({"color-relief-opacity":new Ke(he["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new En(he["paint_color-relief"]["color-relief-color"]),resampling:new Ke(he["paint_color-relief"].resampling)})}};function Fp(r){return"data"in r}class Jh{constructor(e,i,o,n){this.context=e,this.format=o,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,n)}update(e,i,o){var n;let{width:l,height:h}=e,p=(((n=this.size)===null||n===void 0?void 0:n[0])!==l||this.size[1]!==h)&&!o,{context:g}=this,{gl:m}=g;this.useMipmap=!!i?.useMipmap,m.bindTexture(m.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1);let v=this.format===m.RGBA&&i?.premultiply!==!1;if(p)this.size=[l,h],Fp(e)?(g.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,v,l,h,m)):(g.pixelStoreUnpackPremultiplyAlpha.set(v),this._uploadDomImage(e,m));else{let{x:_,y:T}=o||{x:0,y:0};Fp(e)?(g.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,v,_,T,l,h,m)):(g.pixelStoreUnpackPremultiplyAlpha.set(v),this._updateDomImage(e,_,T,m))}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D),g.pixelStoreUnpackFlipY.setDefault(),g.pixelStoreUnpack.setDefault(),g.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,i){i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,i.UNSIGNED_BYTE,e)}_uploadRawData(e,i,o,n,l){let{data:h}=e;i&&h&&(h=kp(h)),l.texImage2D(l.TEXTURE_2D,0,this.format,o,n,0,this.format,l.UNSIGNED_BYTE,h)}_updateDomImage(e,i,o,n){n.texSubImage2D(n.TEXTURE_2D,0,i,o,n.RGBA,n.UNSIGNED_BYTE,e)}_updateRawData(e,i,o,n,l,h,p){let{data:g}=e;i&&g&&(g=kp(g)),p.texSubImage2D(p.TEXTURE_2D,0,o,n,l,h,p.RGBA,p.UNSIGNED_BYTE,g)}bind(e,i,o){let{context:n}=this,{gl:l}=n;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),l.bindTexture(l.TEXTURE_2D,this.texture),o!==l.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=l.LINEAR),e!==this.filter&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,e),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,o||e),this.filter=e),i!==this.wrap&&(l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,i),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Bp{constructor(e,i,o,n=1,l=1,h=1,p=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void qt(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;let g=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=l,this.blueFactor=h,this.baseShift=p;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let m=0;m<g;m++)this.data[this._idx(-1,m)]=this.data[this._idx(0,m)],this.data[this._idx(g,m)]=this.data[this._idx(g-1,m)],this.data[this._idx(m,-1)]=this.data[this._idx(m,0)],this.data[this._idx(m,g)]=this.data[this._idx(m,g-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(g,-1)]=this.data[this._idx(g-1,0)],this.data[this._idx(-1,g)]=this.data[this._idx(0,g-1)],this.data[this._idx(g,g)]=this.data[this._idx(g-1,g-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let m=0;m<g;m++)for(let v=0;v<g;v++){let _=this.get(m,v);_>this.max&&(this.max=_),_<this.min&&(this.min=_)}}get(e,i){let o=new Uint8Array(this.data.buffer),n=4*this._idx(e,i);return this.unpack(o[n],o[n+1],o[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(e+1)}unpack(e,i,o){return e*this.redFactor+i*this.greenFactor+o*this.blueFactor-this.baseShift}pack(e){return Op(e,this.getUnpackVector())}getPixels(){return new Nr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=i*this.dim,l=i*this.dim+this.dim,h=o*this.dim,p=o*this.dim+this.dim;switch(i){case-1:n=l-1;break;case 1:l=n+1}switch(o){case-1:h=p-1;break;case 1:p=h+1}let g=-i*this.dim,m=-o*this.dim;for(let v=h;v<p;v++)for(let _=n;_<l;_++)this.data[this._idx(_,v)]=e.data[this._idx(_+g,v+m)]}}function Op(r,e){let i=e[0],o=e[1],n=e[2],l=e[3],h=Math.min(i,o,n),p=Math.round((r+l)/h);return{r:Math.floor(p*h/i)%256,g:Math.floor(p*h/o)%256,b:Math.floor(p*h/n)%256}}Ne("DEMData",Bp);class r0 extends Mr{constructor(e,i){super(e,i0,i)}_createColorRamp(e){let i={elevationStops:[],colorStops:[]},o=this._transitionablePaint._values["color-relief-color"].value.expression;if(o instanceof Ss&&o._styleExpression.expression instanceof gr){this.colorRampExpression=o;let h=o._styleExpression.expression;i.elevationStops=h.labels,i.colorStops=[];for(let p of i.elevationStops)i.colorStops.push(h.evaluate({globals:{elevation:p}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[Ct.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=e)return i;let n={elevationStops:[],colorStops:[]},l=(i.elevationStops.length-1)/(e-1);for(let h=0;h<i.elevationStops.length-.5;h+=l)n.elevationStops.push(i.elevationStops[Math.round(h)]),n.colorStops.push(i.colorStops[Math.round(h)]);return qt(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${i.elevationStops.length}`),n}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,i,o){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let n=this._createColorRamp(i),l=new Nr({width:n.colorStops.length,height:1}),h=new Nr({width:n.colorStops.length,height:1});for(let p=0;p<n.elevationStops.length;p++){let g=Op(n.elevationStops[p],o);h.setPixel(0,p,new Ct(g.r/255,g.g/255,g.b/255,1)),l.setPixel(0,p,n.colorStops[p])}return this.colorRampTextures={elevationTexture:new Jh(e,h,e.gl.RGBA),colorTexture:new Jh(e,l,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let a0=fi([{name:"a_pos",components:2,type:"Int16"}],4),{members:o0}=a0;function Ou(r,e,i){let o=i.patternDependencies,n=!1;for(let l of e){let h=l.paint.get(`${r}-pattern`);h.isConstant()||(n=!0);let p=h.constantOr(null);p&&(n=!0,o[p.to]=!0,o[p.from]=!0)}return n}function Qh(r,e,i,o,n){let{zoom:l}=o,h=n.patternDependencies;for(let p of e){let g=p.paint.get(`${r}-pattern`).value;if(g.kind!=="constant"){let m=g.evaluate({zoom:l-1},i,{},n.availableImages),v=g.evaluate({zoom:l},i,{},n.availableImages),_=g.evaluate({zoom:l+1},i,{},n.availableImages);m=m?.name?m.name:m,v=v?.name?v.name:v,_=_?.name?_.name:_,h[m]=!0,h[v]=!0,h[_]=!0,i.patterns[p.id]={min:m,mid:v,max:_}}}return i}function Np(r,e,i,o,n){let l;if(n===(function(h,p,g,m){let v=0;for(let _=p,T=g-m;_<g;_+=m)v+=(h[T]-h[_])*(h[_+1]+h[T+1]),T=_;return v})(r,e,i,o)>0)for(let h=e;h<i;h+=o)l=qp(h/o|0,r[h],r[h+1],l);else for(let h=i-o;h>=e;h-=o)l=qp(h/o|0,r[h],r[h+1],l);return l&&Ys(l,l.next)&&(Pc(l),l=l.next),l}function Bn(r,e){if(!r)return r;e||(e=r);let i,o=r;do if(i=!1,o.steiner||!Ys(o,o.next)&&Ci(o.prev,o,o.next)!==0)o=o.next;else{if(Pc(o),o=e=o.prev,o===o.next)break;i=!0}while(i||o!==e);return e}function wc(r,e,i,o,n,l,h){if(!r)return;!h&&l&&(function(g,m,v,_){let T=g;do T.z===0&&(T.z=ed(T.x,T.y,m,v,_)),T.prevZ=T.prev,T.nextZ=T.next,T=T.next;while(T!==g);T.prevZ.nextZ=null,T.prevZ=null,(function(x){let M,C=1;do{let D,L=x;x=null;let N=null;for(M=0;L;){M++;let F=L,j=0;for(let G=0;G<C&&(j++,F=F.nextZ,F);G++);let U=C;for(;j>0||U>0&&F;)j!==0&&(U===0||!F||L.z<=F.z)?(D=L,L=L.nextZ,j--):(D=F,F=F.nextZ,U--),N?N.nextZ=D:x=D,D.prevZ=N,N=D;L=F}N.nextZ=null,C*=2}while(M>1)})(T)})(r,o,n,l);let p=r;for(;r.prev!==r.next;){let g=r.prev,m=r.next;if(l?s0(r,o,n,l):n0(r))e.push(g.i,r.i,m.i),Pc(r),r=m.next,p=m.next;else if((r=m)===p){h?h===1?wc(r=l0(Bn(r),e),e,i,o,n,l,2):h===2&&c0(r,e,i,o,n,l):wc(Bn(r),e,i,o,n,l,1);break}}}function n0(r){let e=r.prev,i=r,o=r.next;if(Ci(e,i,o)>=0)return!1;let n=e.x,l=i.x,h=o.x,p=e.y,g=i.y,m=o.y,v=Math.min(n,l,h),_=Math.min(p,g,m),T=Math.max(n,l,h),x=Math.max(p,g,m),M=o.next;for(;M!==e;){if(M.x>=v&&M.x<=T&&M.y>=_&&M.y<=x&&Tc(n,p,l,g,h,m,M.x,M.y)&&Ci(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function s0(r,e,i,o){let n=r.prev,l=r,h=r.next;if(Ci(n,l,h)>=0)return!1;let p=n.x,g=l.x,m=h.x,v=n.y,_=l.y,T=h.y,x=Math.min(p,g,m),M=Math.min(v,_,T),C=Math.max(p,g,m),D=Math.max(v,_,T),L=ed(x,M,e,i,o),N=ed(C,D,e,i,o),F=r.prevZ,j=r.nextZ;for(;F&&F.z>=L&&j&&j.z<=N;){if(F.x>=x&&F.x<=C&&F.y>=M&&F.y<=D&&F!==n&&F!==h&&Tc(p,v,g,_,m,T,F.x,F.y)&&Ci(F.prev,F,F.next)>=0||(F=F.prevZ,j.x>=x&&j.x<=C&&j.y>=M&&j.y<=D&&j!==n&&j!==h&&Tc(p,v,g,_,m,T,j.x,j.y)&&Ci(j.prev,j,j.next)>=0))return!1;j=j.nextZ}for(;F&&F.z>=L;){if(F.x>=x&&F.x<=C&&F.y>=M&&F.y<=D&&F!==n&&F!==h&&Tc(p,v,g,_,m,T,F.x,F.y)&&Ci(F.prev,F,F.next)>=0)return!1;F=F.prevZ}for(;j&&j.z<=N;){if(j.x>=x&&j.x<=C&&j.y>=M&&j.y<=D&&j!==n&&j!==h&&Tc(p,v,g,_,m,T,j.x,j.y)&&Ci(j.prev,j,j.next)>=0)return!1;j=j.nextZ}return!0}function l0(r,e){let i=r;do{let o=i.prev,n=i.next.next;!Ys(o,n)&&Vp(o,i,i.next,n)&&Sc(o,n)&&Sc(n,o)&&(e.push(o.i,i.i,n.i),Pc(i),Pc(i.next),i=r=n),i=i.next}while(i!==r);return Bn(i)}function c0(r,e,i,o,n,l){let h=r;do{let p=h.next.next;for(;p!==h.prev;){if(h.i!==p.i&&f0(h,p)){let g=Up(h,p);return h=Bn(h,h.next),g=Bn(g,g.next),wc(h,e,i,o,n,l,0),void wc(g,e,i,o,n,l,0)}p=p.next}h=h.next}while(h!==r)}function u0(r,e){let i=r.x-e.x;return i===0&&(i=r.y-e.y,i===0)&&(i=(r.next.y-r.y)/(r.next.x-r.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function h0(r,e){let i=(function(n,l){let h=l,p=n.x,g=n.y,m,v=-1/0;if(Ys(n,h))return h;do{if(Ys(n,h.next))return h.next;if(g<=h.y&&g>=h.next.y&&h.next.y!==h.y){let C=h.x+(g-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(C<=p&&C>v&&(v=C,m=h.x<h.next.x?h:h.next,C===p))return m}h=h.next}while(h!==l);if(!m)return null;let _=m,T=m.x,x=m.y,M=1/0;h=m;do{if(p>=h.x&&h.x>=T&&p!==h.x&&jp(g<x?p:v,g,T,x,g<x?v:p,g,h.x,h.y)){let C=Math.abs(g-h.y)/(p-h.x);Sc(h,n)&&(C<M||C===M&&(h.x>m.x||h.x===m.x&&d0(m,h)))&&(m=h,M=C)}h=h.next}while(h!==_);return m})(r,e);if(!i)return e;let o=Up(i,r);return Bn(o,o.next),Bn(i,i.next)}function d0(r,e){return Ci(r.prev,r,e.prev)<0&&Ci(e.next,r,r.next)<0}function ed(r,e,i,o,n){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*n|0)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p0(r){let e=r,i=r;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==r);return i}function jp(r,e,i,o,n,l,h,p){return(n-h)*(e-p)>=(r-h)*(l-p)&&(r-h)*(o-p)>=(i-h)*(e-p)&&(i-h)*(l-p)>=(n-h)*(o-p)}function Tc(r,e,i,o,n,l,h,p){return!(r===h&&e===p)&&jp(r,e,i,o,n,l,h,p)}function f0(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!(function(i,o){let n=i;do{if(n.i!==i.i&&n.next.i!==i.i&&n.i!==o.i&&n.next.i!==o.i&&Vp(n,n.next,i,o))return!0;n=n.next}while(n!==i);return!1})(r,e)&&(Sc(r,e)&&Sc(e,r)&&(function(i,o){let n=i,l=!1,h=(i.x+o.x)/2,p=(i.y+o.y)/2;do n.y>p!=n.next.y>p&&n.next.y!==n.y&&h<(n.next.x-n.x)*(p-n.y)/(n.next.y-n.y)+n.x&&(l=!l),n=n.next;while(n!==i);return l})(r,e)&&(Ci(r.prev,r,e.prev)||Ci(r,e.prev,e))||Ys(r,e)&&Ci(r.prev,r,r.next)>0&&Ci(e.prev,e,e.next)>0)}function Ci(r,e,i){return(e.y-r.y)*(i.x-e.x)-(e.x-r.x)*(i.y-e.y)}function Ys(r,e){return r.x===e.x&&r.y===e.y}function Vp(r,e,i,o){let n=ju(Ci(r,e,i)),l=ju(Ci(r,e,o)),h=ju(Ci(i,o,r)),p=ju(Ci(i,o,e));return n!==l&&h!==p||!(n!==0||!Nu(r,i,e))||!(l!==0||!Nu(r,o,e))||!(h!==0||!Nu(i,r,o))||!(p!==0||!Nu(i,e,o))}function Nu(r,e,i){return e.x<=Math.max(r.x,i.x)&&e.x>=Math.min(r.x,i.x)&&e.y<=Math.max(r.y,i.y)&&e.y>=Math.min(r.y,i.y)}function ju(r){return r>0?1:r<0?-1:0}function Sc(r,e){return Ci(r.prev,r,r.next)<0?Ci(r,e,r.next)>=0&&Ci(r,r.prev,e)>=0:Ci(r,e,r.prev)<0||Ci(r,r.next,e)<0}function Up(r,e){let i=td(r.i,r.x,r.y),o=td(e.i,e.x,e.y),n=r.next,l=e.prev;return r.next=e,e.prev=r,i.next=n,n.prev=i,o.next=i,i.prev=o,l.next=o,o.prev=l,o}function qp(r,e,i,o){let n=td(r,e,i);return o?(n.next=o.next,n.prev=o,o.next.prev=n,o.next=n):(n.prev=n,n.next=n),n}function Pc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function td(r,e,i){return{i:r,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class Ks{constructor(e,i){if(i>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=i}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class Vu{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}Vu.noSubdivision=new Vu({fill:new Ks(0,0),line:new Ks(0,0),tile:new Ks(0,0),stencil:new Ks(0,0),circle:1}),Ne("SubdivisionGranularityExpression",Ks),Ne("SubdivisionGranularitySetting",Vu);let Js=-32768,Mc=32767;class m0{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=He/e,this._canonical=i}_getKey(e,i){return(e+=32768)<<16|i+32768}_vertexToIndex(e,i){if(e<-32768||i<-32768||e>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let o=0|Math.round(e),n=0|Math.round(i),l=this._getKey(o,n);if(this._vertexDictionary.has(l))return this._vertexDictionary.get(l);let h=this._vertexBuffer.length/2;return this._vertexDictionary.set(l,h),this._vertexBuffer.push(o,n),h}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(n,l){let h=[];for(let p=0;p<l.length;p+=3){let g=l[p],m=l[p+1],v=l[p+2],_=n[2*g],T=n[2*g+1];(n[2*m]-_)*(n[2*v+1]-T)-(n[2*m+1]-T)*(n[2*v]-_)>0?(h.push(g),h.push(v),h.push(m)):(h.push(g),h.push(m),h.push(v))}return h})(this._vertexBuffer,e);let i=[],o=e.length;for(let n=0;n<o;n+=3){let l=[e[n+0],e[n+1],e[n+2]],h=[this._vertexBuffer[2*e[n+0]+0],this._vertexBuffer[2*e[n+0]+1],this._vertexBuffer[2*e[n+1]+0],this._vertexBuffer[2*e[n+1]+1],this._vertexBuffer[2*e[n+2]+0],this._vertexBuffer[2*e[n+2]+1]],p=1/0,g=1/0,m=-1/0,v=-1/0;for(let C=0;C<3;C++){let D=h[2*C],L=h[2*C+1];p=Math.min(p,D),m=Math.max(m,D),g=Math.min(g,L),v=Math.max(v,L)}if(p===m||g===v)continue;let _=Math.floor(p/this._granularityCellSize),T=Math.ceil(m/this._granularityCellSize),x=Math.floor(g/this._granularityCellSize),M=Math.ceil(v/this._granularityCellSize);if(_!==T||x!==M)for(let C=x;C<M;C++){let D=this._scanlineGenerateVertexRingForCellRow(C,h,l);g0(this._vertexBuffer,D,i)}else i.push(...l)}return i}_scanlineGenerateVertexRingForCellRow(e,i,o){let n=e*this._granularityCellSize,l=n+this._granularityCellSize,h=[];for(let p=0;p<3;p++){let g=i[2*p],m=i[2*p+1],v=i[2*(p+1)%6],_=i[(2*(p+1)+1)%6],T=i[2*(p+2)%6],x=i[(2*(p+2)+1)%6],M=v-g,C=_-m,D=M===0,L=C===0,N=(n-m)/C,F=(l-m)/C,j=Math.min(N,F),U=Math.max(N,F);if(!L&&(j>=1||U<=0)||L&&(m<n||m>l)){_>=n&&_<=l&&h.push(o[(p+1)%3]);continue}!L&&j>0&&h.push(this._vertexToIndex(g+M*j,m+C*j));let G=g+M*Math.max(j,0),re=g+M*Math.min(U,1);D||this._generateIntraEdgeVertices(h,g,m,v,_,G,re),!L&&U<1&&h.push(this._vertexToIndex(g+M*U,m+C*U)),(L||_>=n&&_<=l)&&h.push(o[(p+1)%3]),!L&&(_<=n||_>=l)&&this._generateInterEdgeVertices(h,g,m,v,_,T,x,re,n,l)}return h}_generateIntraEdgeVertices(e,i,o,n,l,h,p){let g=n-i,m=l-o,v=m===0,_=v?Math.min(i,n):Math.min(h,p),T=v?Math.max(i,n):Math.max(h,p),x=Math.floor(_/this._granularityCellSize)+1,M=Math.ceil(T/this._granularityCellSize)-1;if(v?i<n:h<p)for(let C=x;C<=M;C++){let D=C*this._granularityCellSize;e.push(this._vertexToIndex(D,o+m*(D-i)/g))}else for(let C=M;C>=x;C--){let D=C*this._granularityCellSize;e.push(this._vertexToIndex(D,o+m*(D-i)/g))}}_generateInterEdgeVertices(e,i,o,n,l,h,p,g,m,v){let _=l-o,T=h-n,x=p-l,M=(m-l)/x,C=(v-l)/x,D=Math.min(M,C),L=Math.max(M,C),N=n+T*D,F=Math.floor(Math.min(N,g)/this._granularityCellSize)+1,j=Math.ceil(Math.max(N,g)/this._granularityCellSize)-1,U=g<N,G=x===0;if(G&&(p===m||p===v))return;if(G||D>=1||L<=0){let oe=o-p,pe=h+(i-h)*Math.min((m-p)/oe,(v-p)/oe);F=Math.floor(Math.min(pe,g)/this._granularityCellSize)+1,j=Math.ceil(Math.max(pe,g)/this._granularityCellSize)-1,U=g<pe}let re=_>0?v:m;if(U)for(let oe=F;oe<=j;oe++)e.push(this._vertexToIndex(oe*this._granularityCellSize,re));else for(let oe=j;oe>=F;oe--)e.push(this._vertexToIndex(oe*this._granularityCellSize,re))}_generateOutline(e){let i=[];for(let o of e){let n=On(o,this._granularity,!0),l=this._pointArrayToIndices(n),h=[];for(let p=1;p<l.length;p++)h.push(l[p-1]),h.push(l[p]);i.push(h)}return i}_handlePoles(e){let i=!1,o=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(o=!0)),(i||o)&&this._fillPoles(e,i,o)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){let o=e[i+1];o===Js&&(e[i+1]=-32767),o===Mc&&(e[i+1]=32766)}}_generatePoleQuad(e,i,o,n,l,h){n>l!=(h===Js)?(e.push(i),e.push(o),e.push(this._vertexToIndex(n,h)),e.push(o),e.push(this._vertexToIndex(l,h)),e.push(this._vertexToIndex(n,h))):(e.push(o),e.push(i),e.push(this._vertexToIndex(n,h)),e.push(this._vertexToIndex(l,h)),e.push(o),e.push(this._vertexToIndex(n,h)))}_fillPoles(e,i,o){let n=this._vertexBuffer,l=He,h=e.length;for(let p=2;p<h;p+=3){let g=e[p-2],m=e[p-1],v=e[p],_=n[2*g],T=n[2*g+1],x=n[2*m],M=n[2*m+1],C=n[2*v],D=n[2*v+1];i&&(T===0&&M===0&&this._generatePoleQuad(e,g,m,_,x,Js),M===0&&D===0&&this._generatePoleQuad(e,m,v,x,C,Js),D===0&&T===0&&this._generatePoleQuad(e,v,g,C,_,Js)),o&&(T===l&&M===l&&this._generatePoleQuad(e,g,m,_,x,Mc),M===l&&D===l&&this._generatePoleQuad(e,m,v,x,C,Mc),D===l&&T===l&&this._generatePoleQuad(e,v,g,C,_,Mc))}}_initializeVertices(e){for(let i=0;i<e.length;i+=2)this._vertexToIndex(e[i],e[i+1])}subdividePolygonInternal(e,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:o,holeIndices:n}=(function(p){let g=[],m=[];for(let v of p)if(v.length!==0){v!==p[0]&&g.push(m.length/2);for(let _ of v)m.push(_.x),m.push(_.y)}return{flattened:m,holeIndices:g}})(e),l;this._initializeVertices(o);try{let p=(function(m,v,_=2){let T=v&&v.length,x=T?v[0]*_:m.length,M=Np(m,0,x,_,!0),C=[];if(!M||M.next===M.prev)return C;let D,L,N;if(T&&(M=(function(F,j,U,G){let re=[];for(let oe=0,pe=j.length;oe<pe;oe++){let ce=Np(F,j[oe]*G,oe<pe-1?j[oe+1]*G:F.length,G,!1);ce===ce.next&&(ce.steiner=!0),re.push(p0(ce))}re.sort(u0);for(let oe=0;oe<re.length;oe++)U=h0(re[oe],U);return U})(m,v,M,_)),m.length>80*_){D=m[0],L=m[1];let F=D,j=L;for(let U=_;U<x;U+=_){let G=m[U],re=m[U+1];G<D&&(D=G),re<L&&(L=re),G>F&&(F=G),re>j&&(j=re)}N=Math.max(F-D,j-L),N=N!==0?32767/N:0}return wc(M,C,_,D,L,N,0),C})(o,n),g=this._convertIndices(o,p);l=this._subdivideTrianglesScanline(g)}catch(p){console.error(p)}let h=[];return i&&(h=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(l),{verticesFlattened:this._vertexBuffer,indicesTriangles:l,indicesLineList:h}}_convertIndices(e,i){let o=[];for(let n of i)o.push(this._vertexToIndex(e[2*n],e[2*n+1]));return o}_pointArrayToIndices(e){let i=[];for(let o of e)i.push(this._vertexToIndex(o.x,o.y));return i}}function Gp(r,e,i,o=!0){return new m0(i,e).subdividePolygonInternal(r,o)}function On(r,e,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];let o=r[0],n=r[r.length-1],l=i&&(o.x!==n.x||o.y!==n.y);if(e<2)return l?[...r,r[0]]:[...r];let h=Math.floor(He/e),p=[];p.push(new se(r[0].x,r[0].y));let g=r.length,m=l?g:g-1;for(let v=0;v<m;v++){let _=r[v],T=v<g-1?r[v+1]:r[0],x=_.x,M=_.y,C=T.x,D=T.y,L=x!==C,N=M!==D;if(!L&&!N)continue;let F=C-x,j=D-M,U=Math.abs(F),G=Math.abs(j),re=x,oe=M;for(;;){let ce=F>0?(Math.floor(re/h)+1)*h:(Math.ceil(re/h)-1)*h,_e=j>0?(Math.floor(oe/h)+1)*h:(Math.ceil(oe/h)-1)*h,ye=Math.abs(re-ce),fe=Math.abs(oe-_e),ue=Math.abs(re-C),Ie=Math.abs(oe-D),Fe=L?ye/U:Number.POSITIVE_INFINITY,De=N?fe/G:Number.POSITIVE_INFINITY;if((ue<=ye||!L)&&(Ie<=fe||!N))break;if(Fe<De&&L||!N){re=ce,oe+=j*Fe;let Ae=new se(re,Math.round(oe));p[p.length-1].x===Ae.x&&p[p.length-1].y===Ae.y||p.push(Ae)}else{re+=F*De,oe=_e;let Ae=new se(Math.round(re),oe);p[p.length-1].x===Ae.x&&p[p.length-1].y===Ae.y||p.push(Ae)}}let pe=new se(C,D);p[p.length-1].x===pe.x&&p[p.length-1].y===pe.y||p.push(pe)}return p}function g0(r,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let o=0,n=r[2*e[0]];for(let g=1;g<e.length;g++){let m=r[2*e[g]];m<n&&(n=m,o=g)}let l=e.length,h=o,p=(h+1)%l;for(;;){let g=h-1>=0?h-1:l-1,m=(p+1)%l,v=r[2*e[g]],_=r[2*e[m]],T=r[2*e[h]],x=r[2*e[h]+1],M=r[2*e[p]+1],C=!1;if(v<_)C=!0;else if(v>_)C=!1;else{let D=M-x,L=-(r[2*e[p]]-T),N=x<M?1:-1;((v-T)*D+(r[2*e[g]+1]-x)*L)*N>((_-T)*D+(r[2*e[m]+1]-x)*L)*N&&(C=!0)}if(C){let D=e[g],L=e[h],N=e[p];D!==L&&D!==N&&L!==N&&i.push(N,L,D),h--,h<0&&(h=l-1)}else{let D=e[m],L=e[h],N=e[p];D!==L&&D!==N&&L!==N&&i.push(N,L,D),p++,p>=l&&(p=0)}if(g===m)break}}function Zp(r,e,i,o,n,l,h,p,g){let m=n.length/2,v=h&&p&&g;if(m<de.MAX_VERTEX_ARRAY_LENGTH){let _=e.prepareSegment(m,i,o),T=_.vertexLength;for(let C=0;C<l.length;C+=3)o.emplaceBack(T+l[C],T+l[C+1],T+l[C+2]);let x,M;_.vertexLength+=m,_.primitiveLength+=l.length/3,v&&(M=h.prepareSegment(m,i,p),x=M.vertexLength,M.vertexLength+=m);for(let C=0;C<n.length;C+=2)r(n[C],n[C+1]);if(v)for(let C of g){for(let D=1;D<C.length;D+=2)p.emplaceBack(x+C[D-1],x+C[D]);M.primitiveLength+=C.length/2}}else(function(_,T,x,M,C,D){let L=[];for(let G=0;G<M.length/2;G++)L.push(-1);let N={count:0},F=0,j=_.getOrCreateLatestSegment(T,x),U=j.vertexLength;for(let G=2;G<C.length;G+=3){let re=C[G-2],oe=C[G-1],pe=C[G],ce=L[re]<F,_e=L[oe]<F,ye=L[pe]<F;j.vertexLength+((ce?1:0)+(_e?1:0)+(ye?1:0))>de.MAX_VERTEX_ARRAY_LENGTH&&(j=_.createNewSegment(T,x),F=N.count,ce=!0,_e=!0,ye=!0,U=0);let fe=Cc(L,M,D,N,re,ce,j),ue=Cc(L,M,D,N,oe,_e,j),Ie=Cc(L,M,D,N,pe,ye,j);x.emplaceBack(U+fe-F,U+ue-F,U+Ie-F),j.primitiveLength++}})(e,i,o,n,l,r),v&&(function(_,T,x,M,C,D){let L=[];for(let G=0;G<M.length/2;G++)L.push(-1);let N={count:0},F=0,j=_.getOrCreateLatestSegment(T,x),U=j.vertexLength;for(let G of C)for(let re=1;re<G.length;re+=2){let oe=G[re-1],pe=G[re],ce=L[oe]<F,_e=L[pe]<F;j.vertexLength+((ce?1:0)+(_e?1:0))>de.MAX_VERTEX_ARRAY_LENGTH&&(j=_.createNewSegment(T,x),F=N.count,ce=!0,_e=!0,U=0);let ye=Cc(L,M,D,N,oe,ce,j),fe=Cc(L,M,D,N,pe,_e,j);x.emplaceBack(U+ye-F,U+fe-F),j.primitiveLength++}})(h,i,p,n,g,r),e.forceNewSegmentOnNextPrepare(),h?.forceNewSegmentOnNextPrepare()}function Cc(r,e,i,o,n,l,h){if(l){let p=o.count;return i(e[2*n],e[2*n+1]),r[n]=o.count,o.count++,h.vertexLength++,p}return r[n]}class id{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new A,this.indexArray=new te,this.indexArray2=new J,this.programConfigurations=new Si(e.layers,e.zoom),this.segments=new de,this.segments2=new de,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=Ou("fill",this.layers,i);let n=this.layers[0].layout.get("fill-sort-key"),l=!n.isConstant(),h=[];for(let{feature:p,id:g,index:m,sourceLayerIndex:v}of e){let _=this.layers[0]._featureFilter.needGeometry,T=Ta(p,_);if(!this.layers[0]._featureFilter.filter(new Wt(this.zoom),T,o))continue;let x=l?n.evaluate(T,{},o,i.availableImages):void 0,M={id:g,properties:p.properties,type:p.type,sourceLayerIndex:v,index:m,geometry:_?T.geometry:wa(p),patterns:{},sortKey:x};h.push(M)}l&&h.sort(((p,g)=>p.sortKey-g.sortKey));for(let p of h){let{geometry:g,index:m,sourceLayerIndex:v}=p;if(this.hasDependencies){let _=Qh("fill",this.layers,p,{zoom:this.zoom},i);this.patternFeatures.push(_)}else this.addFeature(p,g,m,o,{},i.subdivisionGranularity);i.featureIndex.insert(e[m].feature,g,m,v,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}addFeatures(e,i,o){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,i,o,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,o0),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,i,o,n,l,h){for(let p of fs(i,500)){let g=Gp(p,n,h.fill.getGranularityForZoomLevel(n.z)),m=this.layoutVertexArray;Zp(((v,_)=>{m.emplaceBack(v,_)}),this.segments,this.layoutVertexArray,this.indexArray,g.verticesFlattened,g.indicesTriangles,this.segments2,this.indexArray2,g.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:l,canonical:n})}}let $p,Wp;Ne("FillBucket",id,{omit:["layers","patternFeatures"]});var _0={get paint(){return Wp=Wp||new tr({"fill-antialias":new Ke(he.paint_fill["fill-antialias"]),"fill-opacity":new rt(he.paint_fill["fill-opacity"]),"fill-color":new rt(he.paint_fill["fill-color"]),"fill-outline-color":new rt(he.paint_fill["fill-outline-color"]),"fill-translate":new Ke(he.paint_fill["fill-translate"]),"fill-translate-anchor":new Ke(he.paint_fill["fill-translate-anchor"]),"fill-pattern":new Cn(he.paint_fill["fill-pattern"])})},get layout(){return $p=$p||new tr({"fill-sort-key":new rt(he.layout_fill["fill-sort-key"])})}};class y0 extends Mr{constructor(e,i){super(e,_0,i)}recalculate(e,i){super.recalculate(e,i);let o=this.paint._values["fill-outline-color"];o.value.kind==="constant"&&o.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new id(e)}queryRadius(){return Fu(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:o,pixelsToTileUnits:n}){return bc(Bu(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-o.bearingInRadians,n),i)}isTileClipped(){return!0}}let v0=fi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),b0=fi([{name:"a_centroid",components:2,type:"Int16"}],4),{members:x0}=v0;class Ec{constructor(e,i,o,n,l){this.properties={},this.extent=o,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=l,e.readFields(w0,this,i)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,o=[],n,l=1,h=0,p=0,g=0;for(;e.pos<i;){if(h<=0){let m=e.readVarint();l=7&m,h=m>>3}if(h--,l===1||l===2)p+=e.readSVarint(),g+=e.readSVarint(),l===1&&(n&&o.push(n),n=[]),n&&n.push(new se(p,g));else{if(l!==7)throw new Error(`unknown command ${l}`);n&&n.push(n[0].clone())}}return n&&o.push(n),o}bbox(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,o=1,n=0,l=0,h=0,p=1/0,g=-1/0,m=1/0,v=-1/0;for(;e.pos<i;){if(n<=0){let _=e.readVarint();o=7&_,n=_>>3}if(n--,o===1||o===2)l+=e.readSVarint(),h+=e.readSVarint(),l<p&&(p=l),l>g&&(g=l),h<m&&(m=h),h>v&&(v=h);else if(o!==7)throw new Error(`unknown command ${o}`)}return[p,m,g,v]}toGeoJSON(e,i,o){let n=this.extent*Math.pow(2,o),l=this.extent*e,h=this.extent*i,p=this.loadGeometry();function g(T){return[360*(T.x+l)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(T.y+h)/n)*Math.PI))-90]}function m(T){return T.map(g)}let v;if(this.type===1){let T=[];for(let M of p)T.push(M[0]);let x=m(T);v=T.length===1?{type:"Point",coordinates:x[0]}:{type:"MultiPoint",coordinates:x}}else if(this.type===2){let T=p.map(m);v=T.length===1?{type:"LineString",coordinates:T[0]}:{type:"MultiLineString",coordinates:T}}else{if(this.type!==3)throw new Error("unknown feature type");{let T=Hp(p),x=[];for(let M of T)x.push(M.map(m));v=x.length===1?{type:"Polygon",coordinates:x[0]}:{type:"MultiPolygon",coordinates:x}}}let _={type:"Feature",geometry:v,properties:this.properties};return this.id!=null&&(_.id=this.id),_}}function w0(r,e,i){r===1?e.id=i.readVarint():r===2?(function(o,n){let l=o.readVarint()+o.pos;for(;o.pos<l;){let h=n._keys[o.readVarint()],p=n._values[o.readVarint()];n.properties[h]=p}})(i,e):r===3?e.type=i.readVarint():r===4&&(e._geometry=i.pos)}function Hp(r){let e=r.length;if(e<=1)return[r];let i=[],o,n;for(let l=0;l<e;l++){let h=T0(r[l]);h!==0&&(n===void 0&&(n=h<0),n===h<0?(o&&i.push(o),o=[r[l]]):o&&o.push(r[l]))}return o&&i.push(o),i}function T0(r){let e=0;for(let i,o,n=0,l=r.length,h=l-1;n<l;h=n++)i=r[n],o=r[h],e+=(o.x-i.x)*(i.y+o.y);return e}Ec.types=["Unknown","Point","LineString","Polygon"];class S0{constructor(e,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(P0,this,i),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];let i=this._pbf.readVarint()+this._pbf.pos;return new Ec(this._pbf,i,this.extent,this._keys,this._values)}}function P0(r,e,i){r===15?e.version=i.readVarint():r===1?e.name=i.readString():r===5?e.extent=i.readVarint():r===2?e._features.push(i.pos):r===3?e._keys.push(i.readString()):r===4&&e._values.push((function(o){let n=null,l=o.readVarint()+o.pos;for(;o.pos<l;){let h=o.readVarint()>>3;n=h===1?o.readString():h===2?o.readFloat():h===3?o.readDouble():h===4?o.readVarint64():h===5?o.readVarint():h===6?o.readSVarint():h===7?o.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n})(i))}class Xp{constructor(e,i){this.layers=e.readFields(M0,{},i)}}function M0(r,e,i){if(r===3){let o=new S0(i,i.readVarint()+i.pos);o.length&&(e[o.name]=o)}}let rd=Math.pow(2,13);function Ic(r,e,i,o,n,l,h,p){r.emplaceBack(e,i,2*Math.floor(o*rd)+h,n*rd*2,l*rd*2,Math.round(p))}class ad{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new k,this.centroidVertexArray=new S,this.indexArray=new te,this.programConfigurations=new Si(e.layers,e.zoom),this.segments=new de,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.features=[],this.hasDependencies=Ou("fill-extrusion",this.layers,i);for(let{feature:n,id:l,index:h,sourceLayerIndex:p}of e){let g=this.layers[0]._featureFilter.needGeometry,m=Ta(n,g);if(!this.layers[0]._featureFilter.filter(new Wt(this.zoom),m,o))continue;let v={id:l,sourceLayerIndex:p,index:h,geometry:g?m.geometry:wa(n),properties:n.properties,type:n.type,patterns:{}};this.hasDependencies?this.features.push(Qh("fill-extrusion",this.layers,v,{zoom:this.zoom},i)):this.addFeature(v,v.geometry,h,o,{},i.subdivisionGranularity),i.featureIndex.insert(n,v.geometry,h,p,this.index,!0)}}addFeatures(e,i,o){for(let n of this.features){let{geometry:l}=n;this.addFeature(n,l,n.index,i,o,e.subdivisionGranularity)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}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,x0),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,b0.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,i,o,n,l,h){for(let p of fs(i,500)){let g={x:0,y:0,sampleCount:0},m=this.layoutVertexArray.length;this.processPolygon(g,n,e,p,h);let v=this.layoutVertexArray.length-m,_=Math.floor(g.x/g.sampleCount),T=Math.floor(g.y/g.sampleCount);for(let x=0;x<v;x++)this.centroidVertexArray.emplaceBack(_,T)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:l,canonical:n})}processPolygon(e,i,o,n,l){if(n.length<1||Yp(n[0]))return;for(let _ of n)_.length!==0&&C0(e,_);let h={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},p=l.fill.getGranularityForZoomLevel(i.z),g=Ec.types[o.type]==="Polygon";for(let _ of n){if(_.length===0||Yp(_))continue;let T=On(_,p,g);this._generateSideFaces(T,h)}if(!g)return;let m=Gp(n,i,p,!1),v=this.layoutVertexArray;Zp(((_,T)=>{Ic(v,_,T,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,m.verticesFlattened,m.indicesTriangles)}_generateSideFaces(e,i){let o=0;for(let n=1;n<e.length;n++){let l=e[n],h=e[n-1];if(E0(l,h))continue;i.segment.vertexLength+4>de.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let p=l.sub(h)._perp()._unit(),g=h.dist(l);o+g>32768&&(o=0),Ic(this.layoutVertexArray,l.x,l.y,p.x,p.y,0,0,o),Ic(this.layoutVertexArray,l.x,l.y,p.x,p.y,0,1,o),o+=g,Ic(this.layoutVertexArray,h.x,h.y,p.x,p.y,0,0,o),Ic(this.layoutVertexArray,h.x,h.y,p.x,p.y,0,1,o);let m=i.segment.vertexLength;this.indexArray.emplaceBack(m,m+2,m+1),this.indexArray.emplaceBack(m+1,m+2,m+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function C0(r,e){for(let i=0;i<e.length;i++){let o=e[i];i===e.length-1&&e[0].x===o.x&&e[0].y===o.y||(r.x+=o.x,r.y+=o.y,r.sampleCount++)}}function E0(r,e){return r.x===e.x&&(r.x<0||r.x>He)||r.y===e.y&&(r.y<0||r.y>He)}function Yp(r){return r.every((e=>e.x<0))||r.every((e=>e.x>He))||r.every((e=>e.y<0))||r.every((e=>e.y>He))}let Kp;Ne("FillExtrusionBucket",ad,{omit:["layers","features"]});var I0={get paint(){return Kp=Kp||new tr({"fill-extrusion-opacity":new Ke(he["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new rt(he["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ke(he["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ke(he["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Cn(he["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new rt(he["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new rt(he["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ke(he["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class z0 extends Mr{constructor(e,i){super(e,I0,i)}createBucket(e){return new ad(e)}queryRadius(){return Fu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:n,transform:l,pixelsToTileUnits:h,pixelPosMatrix:p}){let g=Bu(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-l.bearingInRadians,h),m=this.paint.get("fill-extrusion-height").evaluate(i,o),v=this.paint.get("fill-extrusion-base").evaluate(i,o),_=(function(x,M){let C=[];for(let D of x){let L=[D.x,D.y,0,1];ot(L,L,M),C.push(new se(L[0]/L[3],L[1]/L[3]))}return C})(g,p),T=(function(x,M,C,D){let L=[],N=[],F=D[8]*M,j=D[9]*M,U=D[10]*M,G=D[11]*M,re=D[8]*C,oe=D[9]*C,pe=D[10]*C,ce=D[11]*C;for(let _e of x){let ye=[],fe=[];for(let ue of _e){let Ie=ue.x,Fe=ue.y,De=D[0]*Ie+D[4]*Fe+D[12],Ae=D[1]*Ie+D[5]*Fe+D[13],ct=D[2]*Ie+D[6]*Fe+D[14],Ot=D[3]*Ie+D[7]*Fe+D[15],Ut=ct+U,$t=Ot+G,or=De+re,gi=Ae+oe,Ri=ct+pe,Ui=Ot+ce,si=new se((De+F)/$t,(Ae+j)/$t);si.z=Ut/$t,ye.push(si);let Ji=new se(or/Ui,gi/Ui);Ji.z=Ri/Ui,fe.push(Ji)}L.push(ye),N.push(fe)}return[L,N]})(n,v,m,p);return(function(x,M,C){let D=1/0;bc(C,M)&&(D=Jp(C,M[0]));for(let L=0;L<M.length;L++){let N=M[L],F=x[L];for(let j=0;j<N.length-1;j++){let U=N[j],G=[U,N[j+1],F[j+1],F[j],U];Va(C,G)&&(D=Math.min(D,Jp(C,G)))}}return D!==1/0&&D})(T[0],T[1],_)}}function zc(r,e){return r.x*e.x+r.y*e.y}function Jp(r,e){if(r.length===1){let i=0,o=e[i++],n;for(;!n||o.equals(n);)if(n=e[i++],!n)return 1/0;for(;i<e.length;i++){let l=e[i],h=r[0],p=n.sub(o),g=l.sub(o),m=h.sub(o),v=zc(p,p),_=zc(p,g),T=zc(g,g),x=zc(m,p),M=zc(m,g),C=v*T-_*_,D=(T*x-_*M)/C,L=(v*M-_*x)/C,N=o.z*(1-D-L)+n.z*D+l.z*L;if(isFinite(N))return N}return 1/0}{let i=1/0;for(let o of e)i=Math.min(i,o.z);return i}}let Qp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Uu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[i,o]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");let n=o>>4;if(n!==1)throw new Error(`Got v${n} data when expected v1.`);let l=Qp[15&o];if(!l)throw new Error("Unrecognized array type.");let[h]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Uu(p,h,l,e)}constructor(e,i=64,o=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let l=Qp.indexOf(this.ArrayType),h=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-p%8)%8;if(l<0)throw new Error(`Unexpected typed array class: ${o}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+h+p+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+l]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){let o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=i,o}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return od(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,o,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:l,coords:h,nodeSize:p}=this,g=[0,l.length-1,0],m=[];for(;g.length;){let v=g.pop()||0,_=g.pop()||0,T=g.pop()||0;if(_-T<=p){for(let D=T;D<=_;D++){let L=h[2*D],N=h[2*D+1];L>=e&&L<=o&&N>=i&&N<=n&&m.push(l[D])}continue}let x=T+_>>1,M=h[2*x],C=h[2*x+1];M>=e&&M<=o&&C>=i&&C<=n&&m.push(l[x]),(v===0?e<=M:i<=C)&&(g.push(T),g.push(x-1),g.push(1-v)),(v===0?o>=M:n>=C)&&(g.push(x+1),g.push(_),g.push(1-v))}return m}within(e,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:l,nodeSize:h}=this,p=[0,n.length-1,0],g=[],m=o*o;for(;p.length;){let v=p.pop()||0,_=p.pop()||0,T=p.pop()||0;if(_-T<=h){for(let D=T;D<=_;D++)tf(l[2*D],l[2*D+1],e,i)<=m&&g.push(n[D]);continue}let x=T+_>>1,M=l[2*x],C=l[2*x+1];tf(M,C,e,i)<=m&&g.push(n[x]),(v===0?e-o<=M:i-o<=C)&&(p.push(T),p.push(x-1),p.push(1-v)),(v===0?e+o>=M:i+o>=C)&&(p.push(x+1),p.push(_),p.push(1-v))}return g}}function od(r,e,i,o,n,l){if(n-o<=i)return;let h=o+n>>1;ef(r,e,h,o,n,l),od(r,e,i,o,h-1,1-l),od(r,e,i,h+1,n,1-l)}function ef(r,e,i,o,n,l){for(;n>o;){if(n-o>600){let m=n-o+1,v=i-o+1,_=Math.log(m),T=.5*Math.exp(2*_/3),x=.5*Math.sqrt(_*T*(m-T)/m)*(v-m/2<0?-1:1);ef(r,e,i,Math.max(o,Math.floor(i-v*T/m+x)),Math.min(n,Math.floor(i+(m-v)*T/m+x)),l)}let h=e[2*i+l],p=o,g=n;for(Ac(r,e,o,i),e[2*n+l]>h&&Ac(r,e,o,n);p<g;){for(Ac(r,e,p,g),p++,g--;e[2*p+l]<h;)p++;for(;e[2*g+l]>h;)g--}e[2*o+l]===h?Ac(r,e,o,g):(g++,Ac(r,e,g,n)),g<=i&&(o=g+1),i<=g&&(n=g-1)}}function Ac(r,e,i,o){nd(r,i,o),nd(e,2*i,2*o),nd(e,2*i+1,2*o+1)}function nd(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}function tf(r,e,i,o){let n=r-i,l=e-o;return n*n+l*l}function sd(r,e,i,o){let n=o,l=e+(i-e>>1),h,p=i-e,g=r[e],m=r[e+1],v=r[i],_=r[i+1];for(let T=e+3;T<i;T+=3){let x=A0(r[T],r[T+1],g,m,v,_);if(x>n)h=T,n=x;else if(x===n){let M=Math.abs(T-l);M<p&&(h=T,p=M)}}n>o&&(h-e>3&&sd(r,e,h,o),r[h+2]=n,i-h>3&&sd(r,h,i,o))}function A0(r,e,i,o,n,l){let h=n-i,p=l-o;if(h!==0||p!==0){let g=((r-i)*h+(e-o)*p)/(h*h+p*p);g>1?(i=n,o=l):g>0&&(i+=h*g,o+=p*g)}return h=r-i,p=e-o,h*h+p*p}function Ki(r,e,i,o){let n={type:e,geom:i},l={id:r??null,type:n.type,geometry:n.geom,tags:o,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":kc(l,n.geom);break;case"LineString":kc(l,n.geom.points);break;case"Polygon":kc(l,n.geom[0].points);break;case"MultiLineString":for(let h of n.geom)kc(l,h.points);break;case"MultiPolygon":for(let h of n.geom)kc(l,h[0].points)}return l}function ld(r){r.points.length>64&&(r.points=new Float64Array(r.points))}function kc(r,e){for(let i=0;i<e.length;i+=3)r.minX=Math.min(r.minX,e[i]),r.minY=Math.min(r.minY,e[i+1]),r.maxX=Math.max(r.maxX,e[i]),r.maxY=Math.max(r.maxY,e[i+1])}function cd(r,e){let i=[];switch(r.type){case"FeatureCollection":for(let o=0;o<r.features.length;o++)qu(i,r.features[o],e,o);break;case"Feature":qu(i,r,e);break;default:qu(i,{geometry:r,properties:void 0},e)}return i}function qu(r,e,i,o){if(!e.geometry)return;if(e.geometry.type==="GeometryCollection")return void(function(p,g,m,v,_){for(let T of m.geometries)qu(p,{id:g.id,geometry:T,properties:g.properties},v,_)})(r,e,e.geometry,i,o);if(!e.geometry.coordinates?.length)return;let l=(function(p,g,m){return g.promoteId?p.properties?.[g.promoteId]:g.generateId?m||0:p.id})(e,i,o),h=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void(function(p,g,m,v){let _=[];_.push(Qs(m.coordinates[0]),el(m.coordinates[1]),0),p.push(Ki(g,"Point",_,v))})(r,l,e.geometry,e.properties);case"MultiPoint":return void(function(p,g,m,v){let _=[];for(let T of m.coordinates)_.push(Qs(T[0]),el(T[1]),0);p.push(Ki(g,"MultiPoint",_,v))})(r,l,e.geometry,e.properties);case"LineString":return void(function(p,g,m,v,_){let T={points:[]};ud(m.coordinates,T,v,!1),p.push(Ki(g,"LineString",T,_))})(r,l,e.geometry,h,e.properties);case"MultiLineString":return void(function(p,g,m,v,_,T){if(_.lineMetrics)for(let x of m.coordinates){let M={points:[]};ud(x,M,v,!1),p.push(Ki(g,"LineString",M,T))}else{let x=[];hd(m.coordinates,x,v,!1),p.push(Ki(g,"MultiLineString",x,T))}})(r,l,e.geometry,h,i,e.properties);case"Polygon":return void(function(p,g,m,v,_){let T=[];hd(m.coordinates,T,v,!0),p.push(Ki(g,"Polygon",T,_))})(r,l,e.geometry,h,e.properties);case"MultiPolygon":return void(function(p,g,m,v,_){let T=[];for(let x of m.coordinates){let M=[];hd(x,M,v,!0),T.push(M)}p.push(Ki(g,"MultiPolygon",T,_))})(r,l,e.geometry,h,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function ud(r,e,i,o){let n,l,h=0;for(let g=0;g<r.length;g++){let m=Qs(r[g][0]),v=el(r[g][1]);e.points.push(m,v,0),g>0&&(h+=o?(n*v-m*l)/2:Math.sqrt(Math.pow(m-n,2)+Math.pow(v-l,2))),n=m,l=v}let p=e.points.length-3;e.points[2]=1,i>0&&sd(e.points,0,p,i),e.points[p+2]=1,ld(e),e.size=Math.abs(h),e.start=0,e.end=e.size}function hd(r,e,i,o){for(let n=0;n<r.length;n++){let l={points:[]};ud(r[n],l,i,o),e.push(l)}}function Qs(r){return r/360+.5}function el(r){let e=Math.sin(r*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function Gu(r){let e={type:"Feature",geometry:k0(r),properties:r.tags};return r.id!=null&&(e.id=r.id),e}function k0(r){let{type:e,geometry:i}=r;switch(e){case"Point":return{type:e,coordinates:rf(i[0],i[1])};case"MultiPoint":return{type:e,coordinates:Zu(i)};case"LineString":return{type:e,coordinates:Zu(i.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map((o=>Zu(o.points)))};case"MultiPolygon":return{type:e,coordinates:i.map((o=>o.map((n=>Zu(n.points)))))}}}function Zu(r){let e=[];for(let i=0;i<r.length;i+=3)e.push(rf(r[i],r[i+1]));return e}function rf(r,e){return[af(r),of(e)]}function af(r){return 360*(r-.5)}function of(r){let e=(180-360*r)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var yr;function ro(r,e,i,o,n,l,h,p){if(o/=e,l>=(i/=e)&&h<o)return r;if(h<i||l>=o)return null;let g=[];for(let m of r){let v=n===yr.X?m.minX:m.minY,_=n===yr.X?m.maxX:m.maxY;if(v>=i&&_<o)g.push(m);else if(!(_<i||v>=o))switch(m.type){case"Point":case"MultiPoint":D0(m,g,i,o,n);continue;case"LineString":L0(m,g,i,o,n,p);continue;case"MultiLineString":R0(m,g,i,o,n);continue;case"Polygon":F0(m,g,i,o,n);continue;case"MultiPolygon":B0(m,g,i,o,n);continue}}return g.length?g:null}function D0(r,e,i,o,n){let l=[];(function(h,p,g,m,v){for(let _=0;_<h.length;_+=3){let T=h[_+v];T>=g&&T<=m&&tl(p,h[_],h[_+1],h[_+2])}})(r.geometry,l,i,o,n),l.length&&e.push(Ki(r.id,l.length===3?"Point":"MultiPoint",l,r.tags))}function L0(r,e,i,o,n,l){let h=[];if(nf(r.geometry,h,i,o,n,!1,l.lineMetrics),h.length)if(l.lineMetrics)for(let p of h)e.push(Ki(r.id,"LineString",p,r.tags));else e.push(h.length>1?Ki(r.id,"MultiLineString",h,r.tags):Ki(r.id,"LineString",h[0],r.tags))}function R0(r,e,i,o,n){let l=[];dd(r.geometry,l,i,o,n,!1),l.length&&e.push(l.length!==1?Ki(r.id,"MultiLineString",l,r.tags):Ki(r.id,"LineString",l[0],r.tags))}function F0(r,e,i,o,n){let l=[];dd(r.geometry,l,i,o,n,!0),l.length&&e.push(Ki(r.id,"Polygon",l,r.tags))}function B0(r,e,i,o,n){let l=[];for(let h of r.geometry){let p=[];dd(h,p,i,o,n,!0),p.length&&l.push(p)}l.length&&e.push(Ki(r.id,"MultiPolygon",l,r.tags))}function nf(r,e,i,o,n,l,h){let p=sf(r),g=n===yr.X?O0:N0,m,v,_=r.start;for(let D=0;D<r.points.length-3;D+=3){let L=r.points[D],N=r.points[D+1],F=r.points[D+2],j=r.points[D+3],U=r.points[D+4],G=n===yr.X?L:N,re=n===yr.X?j:U,oe=!1;h&&(m=Math.sqrt(Math.pow(L-j,2)+Math.pow(N-U,2))),G<i?re>i&&(v=g(p,L,N,j,U,i),h&&(p.start=_+m*v)):G>o?re<o&&(v=g(p,L,N,j,U,o),h&&(p.start=_+m*v)):tl(p.points,L,N,F),re<i&&G>=i&&(v=g(p,L,N,j,U,i),oe=!0),re>o&&G<=o&&(v=g(p,L,N,j,U,o),oe=!0),!l&&oe&&(h&&(p.end=_+m*v),e.push(p),p=sf(r)),h&&(_+=m)}let T=r.points.length-3,x=r.points[T],M=r.points[T+1],C=n===yr.X?x:M;C>=i&&C<=o&&tl(p.points,x,M,r.points[T+2]),T=p.points.length-3,l&&T>=3&&(p.points[T]!==p.points[0]||p.points[T+1]!==p.points[1])&&tl(p.points,p.points[0],p.points[1],p.points[2]),p.points.length&&(ld(p),e.push(p))}function sf(r){return{points:[],size:r.size,start:r.start,end:r.end}}function dd(r,e,i,o,n,l){for(let h of r)nf(h,e,i,o,n,l,!1)}function tl(r,e,i,o){r.push(e,i,o)}function O0(r,e,i,o,n,l){let h=(l-e)/(o-e);return tl(r.points,l,i+(n-i)*h,1),h}function N0(r,e,i,o,n,l){let h=(l-i)/(n-i);return tl(r.points,e+(o-e)*h,l,1),h}function pd(r,e){let i=e.buffer/e.extent,o=r,n=ro(r,1,-1-i,i,yr.X,-1,2,e),l=ro(r,1,1-i,2+i,yr.X,-1,2,e);return(n||l)&&(o=ro(r,1,-i,1+i,yr.X,-1,2,e)||[],n&&(o=lf(n,1).concat(o)),l&&(o=o.concat(lf(l,-1)))),o}function lf(r,e){let i=[];for(let o of r)switch(o.type){case"Point":case"MultiPoint":{let n=j0(o.geometry,e);i.push(Ki(o.id,o.type,n,o.tags));continue}case"LineString":{let n=fd(o.geometry,e);i.push(Ki(o.id,o.type,n,o.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let l of o.geometry)n.push(fd(l,e));i.push(Ki(o.id,o.type,n,o.tags));continue}case"MultiPolygon":{let n=[];for(let l of o.geometry){let h=[];for(let p of l)h.push(fd(p,e));n.push(h)}i.push(Ki(o.id,o.type,n,o.tags));continue}}return i}function j0(r,e){let i=[];for(let o=0;o<r.length;o+=3)i.push(r[o]+e,r[o+1],r[o+2]);return i}function fd(r,e){let i={points:[],size:r.size};r.start!==void 0&&(i.start=r.start,i.end=r.end);for(let o=0;o<r.points.length;o+=3)i.points.push(r.points[o]+e,r.points[o+1],r.points[o+2]);return ld(i),i}function V0(r,e,i){let o=!!e.newGeometry,n=e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0;if(o){let l=r[0],h=cd({type:"FeatureCollection",features:[{type:"Feature",id:l.id,geometry:e.newGeometry,properties:n?cf(l.tags,e):l.tags}]},i);return h=pd(h,i),h}if(n){let l=[];for(let h of r){let p={...h};p.tags=cf(p.tags,e),l.push(p)}return l}return r}function cf(r,e){if(e.removeAllProperties)return{};let i={...r||{}};if(e.removeProperties)for(let o of e.removeProperties)delete i[o];if(e.addOrUpdateProperties)for(let{key:o,value:n}of e.addOrUpdateProperties)i[o]=n;return i}(function(r){r[r.X=0]="X",r[r.Y=1]="Y"})(yr||(yr={}));let md={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r};class U0{constructor(e){this.options=Object.assign(Object.create(md),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){let i=[];for(let o of e){if(!o.geometry)continue;let[n,l]=o.geometry.coordinates,[h,p]=[Qs(n),el(l)];i.push({id:o.id,type:"Point",geometry:[h,p],tags:o.properties})}this.createIndex(i)}initialize(e){let i=[];for(let o of e)o.type==="Point"&&i.push(o);this.createIndex(i)}updateIndex(e,i,o){this.options=Object.assign(Object.create(md),o.clusterOptions),this.initialize(e)}createIndex(e){let{log:i,minZoom:o,maxZoom:n}=this.options;i&&console.time("total time");let l=`prepare ${e.length} points`;i&&console.time(l),this.points=e;let h=[];for(let g=0;g<e.length;g++){let m=e[g];if(!m?.geometry)continue;let[v,_]=m.geometry;v=Math.fround(v),_=Math.fround(_),h.push(v,_,1/0,g,-1,1),this.options.reduce&&h.push(0)}let p=this.trees[n+1]=this.createTree(h);i&&console.timeEnd(l);for(let g=n;g>=o;g--){let m=Date.now();p=this.trees[g]=this.createTree(this.cluster(p,g)),i&&console.log("z%d: %d clusters in %dms",g,p.numItems,Date.now()-m)}i&&console.timeEnd("total time")}getClusters(e,i){return this.getClustersInternal(e,i).map((o=>Gu(o)))}getClustersInternal(e,i){let o=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),l=e[2]===180?180:((e[2]+180)%360+360)%360-180,h=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,l=180;else if(o>l){let _=this.getClustersInternal([o,n,180,h],i),T=this.getClustersInternal([-180,n,l,h],i);return _.concat(T)}let p=this.trees[this.limitZoom(i)],g=p.range(Qs(o),el(h),Qs(l),el(n)),m=p.flatData,v=[];for(let _ of g){let T=this.stride*_;v.push(m[T+5]>1?q0(m,T,this.clusterProps):this.points[m[T+3]])}return v}getChildren(e){let i=this.getOriginId(e),o=this.getOriginZoom(e),n=new Error("No cluster with the specified id: "+e),l=this.trees[o];if(!l)throw n;let h=l.flatData;if(i*this.stride>=h.length)throw n;let p=this.options.radius/(this.options.extent*Math.pow(2,o-1)),g=l.within(h[i*this.stride],h[i*this.stride+1],p),m=[];for(let v of g){let _=v*this.stride;h[_+4]===e&&m.push(h[_+5]>1?G0(h,_,this.clusterProps):Gu(this.points[h[_+3]]))}if(m.length===0)throw n;return m}getLeaves(e,i,o){let n=[];return this.appendLeaves(n,e,i=i||10,o=o||0,0),n}getTile(e,i,o){let n=this.trees[this.limitZoom(e)];if(!n)return null;let l=Math.pow(2,e),{extent:h,radius:p}=this.options,g=p/h,m=(o-g)/l,v=(o+1+g)/l,_={transformed:!0,features:[],source:null,x:i,y:o,z:e};return this.addTileFeatures(n.range((i-g)/l,m,(i+1+g)/l,v),n.flatData,i,o,l,_),i===0&&this.addTileFeatures(n.range(1-g/l,m,1,v),n.flatData,l,o,l,_),i===l-1&&this.addTileFeatures(n.range(0,m,g/l,v),n.flatData,-1,o,l,_),_}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,i,o,n,l){let h=this.getChildren(i);for(let p of h){let g=p.properties;if(g?.cluster?l+g.point_count<=n?l+=g.point_count:l=this.appendLeaves(e,g.cluster_id,o,n,l):l<n?l++:e.push(p),e.length===o)break}return l}createTree(e){let i=new Uu(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let o=0;o<e.length;o+=this.stride)i.add(e[o],e[o+1]);return i.finish(),i.flatData=e,i.data=null,i}addTileFeatures(e,i,o,n,l,h){for(let p of e){let g=p*this.stride,m=i[g+5]>1,v,_,T;if(m)v=gd(i,g,this.clusterProps),_=i[g],T=i[g+1];else{let C=this.points[i[g+3]];v=C.tags,[_,T]=C.geometry}let x={type:1,geometry:[[Math.round(this.options.extent*(_*l-o)),Math.round(this.options.extent*(T*l-n))]],tags:v},M;M=m||this.options.generateId?i[g+3]:this.points[i[g+3]].id,M!==void 0&&(x.id=M),h.features.push(x)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,i){let{radius:o,extent:n,reduce:l,minPoints:h}=this.options,p=o/(n*Math.pow(2,i)),g=e.flatData,m=[],v=this.stride;for(let _=0;_<g.length;_+=v){if(g[_+2]<=i)continue;g[_+2]=i;let T=g[_],x=g[_+1],M=e.within(g[_],g[_+1],p),C=g[_+5],D=C;for(let L of M){let N=L*v;g[N+2]>i&&(D+=g[N+5])}if(D>C&&D>=h){let L,N=T*C,F=x*C,j=-1,U=(_/v<<5)+(i+1)+this.points.length;for(let G of M){let re=G*v;if(g[re+2]<=i)continue;g[re+2]=i;let oe=g[re+5];N+=g[re]*oe,F+=g[re+1]*oe,g[re+4]=U,l&&(L||(L=this.map(g,_,!0),j=this.clusterProps.length,this.clusterProps.push(L)),l(L,this.map(g,re)))}g[_+4]=U,m.push(N/D,F/D,1/0,U,-1,D),l&&m.push(j)}else{for(let L=0;L<v;L++)m.push(g[_+L]);if(D>1)for(let L of M){let N=L*v;if(!(g[N+2]<=i)){g[N+2]=i;for(let F=0;F<v;F++)m.push(g[N+F])}}}}return m}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,i,o){if(e[i+5]>1){let h=this.clusterProps[e[i+6]];return o?Object.assign({},h):h}let n=this.points[e[i+3]].tags,l=this.options.map(n);return o&&l===n?Object.assign({},l):l}}function q0(r,e,i){return{id:r[e+3],type:"Point",tags:gd(r,e,i),geometry:[r[e],r[e+1]]}}function G0(r,e,i){return{type:"Feature",id:r[e+3],properties:gd(r,e,i),geometry:{type:"Point",coordinates:[af(r[e]),of(r[e+1])]}}}function gd(r,e,i){let o=r[e+5],n=o>=1e4?`${Math.round(o/1e3)}k`:o>=1e3?Math.round(o/100)/10+"k":o,l=r[e+6],h=l===-1?{}:Object.assign({},i[l]);return Object.assign(h,{cluster:!0,cluster_id:r[e+3],point_count:o,point_count_abbreviated:n})}let _d="geojsonvt_clip_start",yd="geojsonvt_clip_end";function uf(r,e,i,o,n){let l=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),h={transformed:!1,features:[],source:null,x:i,y:o,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:r.length};for(let p of r)Z0(h,p,l,n);return h}function Z0(r,e,i,o){switch(r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void(function(n,l){let h=[];for(let g=0;g<l.geometry.length;g+=3)h.push(l.geometry[g],l.geometry[g+1]),n.numPoints++,n.numSimplified++;if(!h.length)return;let p={type:1,tags:l.tags||null,geometry:h};l.id!==null&&(p.id=l.id),n.features.push(p)})(r,e);case"LineString":return void(function(n,l,h,p){let g=[];if(vd(g,l.geometry,n,h,!1,!1),!g.length)return;let m=l.tags||null;if(p.lineMetrics){m={};for(let _ in l.tags)m[_]=l.tags[_];m[_d]=l.geometry.start/l.geometry.size,m[yd]=l.geometry.end/l.geometry.size}let v={type:2,tags:m,geometry:g};l.id!==null&&(v.id=l.id),n.features.push(v)})(r,e,i,o);case"MultiLineString":case"Polygon":return void(function(n,l,h){let p=[];for(let m=0;m<l.geometry.length;m++)vd(p,l.geometry[m],n,h,l.type==="Polygon",m===0);if(!p.length)return;let g={type:l.type==="Polygon"?3:2,tags:l.tags||null,geometry:p};l.id!==null&&(g.id=l.id),n.features.push(g)})(r,e,i);case"MultiPolygon":return void(function(n,l,h){let p=[];for(let m=0;m<l.geometry.length;m++){let v=l.geometry[m];for(let _=0;_<v.length;_++)vd(p,v[_],n,h,!0,_===0)}if(!p.length)return;let g={type:3,tags:l.tags||null,geometry:p};l.id!==null&&(g.id=l.id),n.features.push(g)})(r,e,i)}}function vd(r,e,i,o,n,l){let h=o*o;if(o>0&&e.size<(n?h:o))return void(i.numPoints+=e.points.length/3);let p=[];for(let g=0;g<e.points.length;g+=3)(o===0||e.points[g+2]>h)&&(i.numSimplified++,p.push(e.points[g],e.points[g+1])),i.numPoints++;n&&(function(g,m){let v=0;for(let _=0,T=g.length,x=T-2;_<T;x=_,_+=2)v+=(g[_]-g[x])*(g[_+1]+g[x+1]);if(v>0===m)for(let _=0,T=g.length;_<T/2;_+=2){let x=g[_],M=g[_+1];g[_]=g[T-2-_],g[_+1]=g[T-1-_],g[T-2-_]=x,g[T-1-_]=M}})(p,l),r.push(p)}function hf(r,e){if(r.transformed)return r;let i=1<<r.z,o=r.x,n=r.y;for(let l of r.features)l.type===1?$0(l,e,i,o,n):W0(l,e,i,o,n);return r.transformed=!0,r}function $0(r,e,i,o,n){let l=r,h=r.geometry,p=[];for(let g=0;g<h.length;g+=2)p.push(df(h[g],h[g+1],e,i,o,n));return l.geometry=p,l}function W0(r,e,i,o,n){let l=r,h=r.geometry,p=[];for(let g of h){let m=[];for(let v=0;v<g.length;v+=2)m.push(df(g[v],g[v+1],e,i,o,n));p.push(m)}return l.geometry=p,l}function df(r,e,i,o,n,l){return[Math.round(i*(r*o-n)),Math.round(i*(e*o-l))]}class H0{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.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)))}updateIndex(e,i,o){o.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(i),o.debug>1&&console.timeEnd("invalidating");let[n,l,h]=[0,0,0],p=uf(e,n,l,h,o);p.source=e;let g=$u(n,l,h);if(this.tiles[g]=p,this.tileCoords.push({z:n,x:l,y:h,id:g}),o.debug){let m=`z${n}`;this.stats[m]=(this.stats[m]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,i,o){return null}getTile(e,i,o){let{extent:n,debug:l}=this.options,h=1<<e,p=$u(e,i=i+h&h-1,o);if(this.tiles[p])return hf(this.tiles[p],n);l>1&&console.log("drilling down to z%d-%d-%d",e,i,o);let g,m=e,v=i,_=o;for(;!g&&m>0;)m--,v>>=1,_>>=1,g=this.tiles[$u(m,v,_)];return g?.source?(l>1&&(console.log("found parent tile z%d-%d-%d",m,v,_),console.time("drilling down")),this.splitTile(g.source,m,v,_,e,i,o),l>1&&console.timeEnd("drilling down"),this.tiles[p]?hf(this.tiles[p],n):null):null}splitTile(e,i,o,n,l,h,p){let g=[e,i,o,n],m=this.options,v=m.debug;for(;g.length;){n=g.pop(),o=g.pop(),i=g.pop(),e=g.pop();let _=1<<i,T=$u(i,o,n),x=this.tiles[T];if(!x&&(v>1&&console.time("creation"),x=this.tiles[T]=uf(e,i,o,n,m),this.tileCoords.push({z:i,x:o,y:n,id:T}),v)){v>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",i,o,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));let oe=`z${i}`;this.stats[oe]=(this.stats[oe]||0)+1,this.total++}if(x.source=e,l==null){if(i===m.indexMaxZoom||x.numPoints<=m.indexMaxPoints)continue}else{if(i===m.maxZoom||i===l)continue;if(l!=null){let oe=l-i;if(o!==h>>oe||n!==p>>oe)continue}}if(x.source=null,!e.length)continue;v>1&&console.time("clipping");let M=.5*m.buffer/m.extent,C=.5-M,D=.5+M,L=1+M,N=null,F=null,j=null,U=null,G=ro(e,_,o-M,o+D,yr.X,x.minX,x.maxX,m),re=ro(e,_,o+C,o+L,yr.X,x.minX,x.maxX,m);G&&(N=ro(G,_,n-M,n+D,yr.Y,x.minY,x.maxY,m),F=ro(G,_,n+C,n+L,yr.Y,x.minY,x.maxY,m)),re&&(j=ro(re,_,n-M,n+D,yr.Y,x.minY,x.maxY,m),U=ro(re,_,n+C,n+L,yr.Y,x.minY,x.maxY,m)),v>1&&console.timeEnd("clipping"),g.push(N||[],i+1,2*o,2*n),g.push(F||[],i+1,2*o,2*n+1),g.push(j||[],i+1,2*o+1,2*n),g.push(U||[],i+1,2*o+1,2*n+1)}}invalidateTiles(e){if(!e.length)return;let i=this.options,{debug:o}=i,n=1/0,l=-1/0,h=1/0,p=-1/0;for(let v of e)n=Math.min(n,v.minX),l=Math.max(l,v.maxX),h=Math.min(h,v.minY),p=Math.max(p,v.maxY);let g=i.buffer/i.extent,m=new Set;for(let v in this.tiles){let _=this.tiles[v],T=1<<_.z,x=(_.x-g)/T,M=(_.x+1+g)/T,C=(_.y-g)/T,D=(_.y+1+g)/T;if(l<x||n>=M||p<C||h>=D)continue;let L=!1;for(let N of e)if(N.maxX>=x&&N.minX<M&&N.maxY>=C&&N.minY<D){L=!0;break}if(L){if(o){o>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",_.z,_.x,_.y,_.numFeatures,_.numPoints,_.numSimplified);let N=`z${_.z}`;this.stats[N]=(this.stats[N]||0)-1,this.total--}delete this.tiles[v],m.add(v)}}m.size&&(this.tileCoords=this.tileCoords.filter((v=>!m.has(v.id))))}}function $u(r,e,i){return 32*((1<<r)*i+e)+r}let X0={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:md,debug:0},Y0=fi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:K0}=Y0,J0=fi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Q0}=J0,e1=Math.cos(Math.PI/180*37.5),pf=Math.pow(2,14)/.5;class bd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let i of this.layers)this.gradients[i.id]={};this.layoutVertexArray=new R,this.layoutVertexArray2=new V,this.indexArray=new te,this.programConfigurations=new Si(e.layers,e.zoom),this.segments=new de,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=Ou("line",this.layers,i)||this.hasLineDasharray(this.layers);let n=this.layers[0].layout.get("line-sort-key"),l=!n.isConstant(),h=[];for(let{feature:p,id:g,index:m,sourceLayerIndex:v}of e){let _=this.layers[0]._featureFilter.needGeometry,T=Ta(p,_);if(!this.layers[0]._featureFilter.filter(new Wt(this.zoom),T,o))continue;let x=l?n.evaluate(T,{},o):void 0,M={id:g,properties:p.properties,type:p.type,sourceLayerIndex:v,index:m,geometry:_?T.geometry:wa(p),patterns:{},dashes:{},sortKey:x};h.push(M)}l&&h.sort(((p,g)=>p.sortKey-g.sortKey));for(let p of h){let{geometry:g,index:m,sourceLayerIndex:v}=p;this.hasDependencies?(Ou("line",this.layers,i)?Qh("line",this.layers,p,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,p,this.zoom,i),this.patternFeatures.push(p)):this.addFeature(p,g,m,o,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[m].feature,g,m,v,this.index)}}update(e,i,o,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o,dashPositions:n})}addFeatures(e,i,o,n){for(let l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,i,o,n,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,Q0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,K0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,_d)&&Object.hasOwn(e.properties,yd))return{start:+e.properties[_d],end:+e.properties[yd]}}addFeature(e,i,o,n,l,h,p){let g=this.layers[0].layout,m=g.get("line-join").evaluate(e,{}),v=g.get("line-cap").evaluate(e,{}),_=g.get("line-miter-limit").evaluate(e,{}),T=g.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let x of i)this.addLine(x,e,m,v,_,T,n,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:l,dashPositions:h,canonical:n})}addLine(e,i,o,n,l,h,p,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=On(e,p?g.line.getGranularityForZoomLevel(p.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let F=0;F<e.length-1;F++)this.totalDistance+=e[F].dist(e[F+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let m=Ec.types[i.type]==="Polygon",v=e.length;for(;v>=2&&e[v-1].equals(e[v-2]);)v--;let _=0;for(;_<v-1&&e[_].equals(e[_+1]);)_++;if(v<(m?3:2))return;o==="bevel"&&(l=1.05);let T=this.overscaling<=16?122880/(512*this.overscaling):0,x=this.segments.prepareSegment(10*v,this.layoutVertexArray,this.indexArray),M,C,D,L,N;this.e1=this.e2=-1,m&&(M=e[v-2],N=e[_].sub(M)._unit()._perp());for(let F=_;F<v;F++){if(D=F===v-1?m?e[_+1]:void 0:e[F+1],D&&e[F].equals(D))continue;N&&(L=N),M&&(C=M),M=e[F],N=D?D.sub(M)._unit()._perp():L,L||(L=N);let j=L.add(N);j.x===0&&j.y===0||j._unit();let U=L.x*N.x+L.y*N.y,G=j.x*N.x+j.y*N.y,re=G!==0?1/G:1/0,oe=2*Math.sqrt(2-2*G),pe=G<e1&&C&&D,ce=L.x*N.y-L.y*N.x>0;if(pe&&F>_){let fe=M.dist(C);if(fe>2*T){let ue=M.sub(M.sub(C)._mult(T/fe)._round());this.updateDistance(C,ue),this.addCurrentVertex(ue,L,0,0,x),C=ue}}let _e=C&&D,ye=_e?o:m?"butt":n;if(_e&&ye==="round"&&(re<h?ye="miter":re<=2&&(ye="fakeround")),ye==="miter"&&re>l&&(ye="bevel"),ye==="bevel"&&(re>2&&(ye="flipbevel"),re<l&&(ye="miter")),C&&this.updateDistance(C,M),ye==="miter")j._mult(re),this.addCurrentVertex(M,j,0,0,x);else if(ye==="flipbevel"){if(re>100)j=N.mult(-1);else{let fe=re*L.add(N).mag()/L.sub(N).mag();j._perp()._mult(fe*(ce?-1:1))}this.addCurrentVertex(M,j,0,0,x),this.addCurrentVertex(M,j.mult(-1),0,0,x)}else if(ye==="bevel"||ye==="fakeround"){let fe=-Math.sqrt(re*re-1),ue=ce?fe:0,Ie=ce?0:fe;if(C&&this.addCurrentVertex(M,L,ue,Ie,x),ye==="fakeround"){let Fe=Math.round(180*oe/Math.PI/20);for(let De=1;De<Fe;De++){let Ae=De/Fe;if(Ae!==.5){let Ot=Ae-.5;Ae+=Ae*Ot*(Ae-1)*((1.0904+U*(U*(3.55645-1.43519*U)-3.2452))*Ot*Ot+(.848013+U*(.215638*U-1.06021)))}let ct=N.sub(L)._mult(Ae)._add(L)._unit()._mult(ce?-1:1);this.addHalfVertex(M,ct.x,ct.y,!1,ce,0,x)}}D&&this.addCurrentVertex(M,N,-ue,-Ie,x)}else if(ye==="butt")this.addCurrentVertex(M,j,0,0,x);else if(ye==="square"){let fe=C?1:-1;this.addCurrentVertex(M,j,fe,fe,x)}else ye==="round"&&(C&&(this.addCurrentVertex(M,L,0,0,x),this.addCurrentVertex(M,L,1,1,x,!0)),D&&(this.addCurrentVertex(M,N,-1,-1,x,!0),this.addCurrentVertex(M,N,0,0,x)));if(pe&&F<v-1){let fe=M.dist(D);if(fe>2*T){let ue=M.add(D.sub(M)._mult(T/fe)._round());this.updateDistance(M,ue),this.addCurrentVertex(ue,N,0,0,x),M=ue}}}}addCurrentVertex(e,i,o,n,l,h=!1){let p=i.y*n-i.x,g=-i.y-i.x*n;this.addHalfVertex(e,i.x+i.y*o,i.y-i.x*o,h,!1,o,l),this.addHalfVertex(e,p,g,h,!0,-n,l),this.distance>pf/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,o,n,l,h))}addHalfVertex({x:e,y:i},o,n,l,h,p,g){let m=.5*(this.lineClips?this.scaledDistance*(pf-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(l?1:0),(i<<1)+(h?1:0),Math.round(63*o)+128,Math.round(63*n)+128,1+(p===0?0:p<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let v=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,v,this.e2),g.primitiveLength++),h?this.e2=v:this.e1=v}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}hasLineDasharray(e){for(let i of e){let o=i.paint.get("line-dasharray");if(o&&!o.isConstant())return!0}return!1}addLineDashDependencies(e,i,o,n){for(let l of e){let h=l.paint.get("line-dasharray");if(!h||h.value.kind==="constant")continue;let p=l.layout.get("line-cap").evaluate(i,{})==="round",g={dasharray:h.value.evaluate({zoom:o-1},i,{}),round:p},m={dasharray:h.value.evaluate({zoom:o},i,{}),round:p},v={dasharray:h.value.evaluate({zoom:o+1},i,{}),round:p},_=`${g.dasharray.join(",")},${g.round}`,T=`${m.dasharray.join(",")},${m.round}`,x=`${v.dasharray.join(",")},${v.round}`;n.dashDependencies[_]=g,n.dashDependencies[T]=m,n.dashDependencies[x]=v,i.dashes[l.id]={min:_,mid:T,max:x}}}}let ff,mf;Ne("LineBucket",bd,{omit:["layers","patternFeatures"]});var gf={get paint(){return mf=mf||new tr({"line-opacity":new rt(he.paint_line["line-opacity"]),"line-color":new rt(he.paint_line["line-color"]),"line-translate":new Ke(he.paint_line["line-translate"]),"line-translate-anchor":new Ke(he.paint_line["line-translate-anchor"]),"line-width":new rt(he.paint_line["line-width"]),"line-gap-width":new rt(he.paint_line["line-gap-width"]),"line-offset":new rt(he.paint_line["line-offset"]),"line-blur":new rt(he.paint_line["line-blur"]),"line-dasharray":new Cn(he.paint_line["line-dasharray"]),"line-pattern":new Cn(he.paint_line["line-pattern"]),"line-gradient":new En(he.paint_line["line-gradient"])})},get layout(){return ff=ff||new tr({"line-cap":new rt(he.layout_line["line-cap"]),"line-join":new rt(he.layout_line["line-join"]),"line-miter-limit":new rt(he.layout_line["line-miter-limit"]),"line-round-limit":new rt(he.layout_line["line-round-limit"]),"line-sort-key":new rt(he.layout_line["line-sort-key"])})}};class t1 extends rt{possiblyEvaluate(e,i){return i=new Wt(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,o,n){return i=Xt({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,o,n)}}let Wu;class i1 extends Mr{constructor(e,i){super(e,gf,i),this.gradientVersion=0,Wu||(Wu=new t1(gf.paint.properties["line-width"].specification),Wu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let i=this.gradientExpression();this.stepInterpolant=!!(function(o){return o._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof yt,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,i){super.recalculate(e,i),this.paint._values["line-floorwidth"]=Wu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new bd(e)}queryRadius(e){let i=e,o=_f(Xs("line-width",this,i),Xs("line-gap-width",this,i)),n=Xs("line-offset",this,i);return o/2+Math.abs(n)+Fu(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:n,transform:l,pixelsToTileUnits:h}){let p=Bu(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-l.bearingInRadians,h),g=h/2*_f(this.paint.get("line-width").evaluate(i,o),this.paint.get("line-gap-width").evaluate(i,o)),m=this.paint.get("line-offset").evaluate(i,o);return m&&(n=(function(v,_){let T=[];for(let x of v){let M=Zg(x),C=[];for(let D=0;D<M.length;D++){let L=M[D],N=M[D-1],F=M[D+1],j=D===0?new se(0,0):L.sub(N)._unit()._perp(),U=D===M.length-1?new se(0,0):F.sub(L)._unit()._perp(),G=j._add(U)._unit(),re=G.x*U.x+G.y*U.y;re!==0&&G._mult(1/re),C.push(G._mult(_)._add(L))}T.push(C)}return T})(n,m*h)),(function(v,_,T){for(let x of _){if(v.length>=3){for(let M of x)if(Hs(v,M))return!0}if(Lu(v,x,T))return!0}return!1})(p,n,g)}isTileClipped(){return!0}}function _f(r,e){return e>0?e+2*r:r}let r1=fi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),a1=fi([{name:"a_projected_pos",components:3,type:"Float32"}],4);fi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let o1=fi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);fi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let yf=fi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),n1=fi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function s1(r,e,i){let o=e.layout.get("text-transform").evaluate(i,{});return o==="uppercase"?r=r.toLocaleUpperCase():o==="lowercase"&&(r=r.toLocaleLowerCase()),aa.applyArabicShaping&&(r=aa.applyArabicShaping(r)),r}function l1(r,e,i){for(let o of r.sections)o.text=s1(o.text,e,i);return r}fi([{name:"triangle",components:3,type:"Uint16"}]),fi([{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"}]),fi([{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"}]),fi([{type:"Float32",name:"offsetX"}]),fi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),fi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var ji=24;let Dc={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},c1={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},u1={40:!0};function vf(r,e,i,o,n,l){if("fontStack"in e){let h=i[e.fontStack],p=h?.[r];return p?p.metrics.advance*e.scale+n:0}{let h=o[e.imageName];return h?h.displaySize[0]*e.scale*ji/l+n:0}}function bf(r,e,i,o){let n=Math.pow(r-e,2);return o?r<e?n/2:2*n:n+Math.abs(i)*i}function h1(r,e,i){let o=0;return r===10&&(o-=1e4),i&&(o+=150),r!==40&&r!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function xf(r,e,i,o,n,l){let h=null,p=bf(e,i,n,l);for(let g of o){let m=bf(e-g.x,i,n,l)+g.badness;m<=p&&(h=g,p=m)}return{index:r,x:e,priorBreak:h,badness:p}}function wf(r){return r?wf(r.priorBreak).concat(r.index):[]}class il{constructor(e="",i=[],o=[]){this.text=e,this.sections=i,this.sectionIndex=o,this.imageSectionID=null}static fromFeature(e,i){let o=new il;for(let n of e.sections)n.image?o.addImageSection(n):o.addTextSection(n,i);return o}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 i="",o={premature:!0,value:void 0},n=e[Symbol.iterator](),l=n.next(),h=e[Symbol.iterator]();h.next();let p=h.next();for(;!l.done;)i+=!p.done&&Mu(p.value.codePointAt(0))&&!Dc[p.value]||!o.premature&&Mu(o.value.codePointAt(0))&&!Dc[o.value]||!Dc[l.value]?l.value:Dc[l.value],o={value:l.value,premature:!1},l=n.next(),p=h.next();return i})(this.text)}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.text.match(/^\s*/),i=e?e[0].length:0,o=this.text.match(/\S\s*$/),n=o?o[0].length-1:0;this.text=this.text.substring(i,this.text.length-n),this.sectionIndex=this.sectionIndex.slice(i,this.sectionIndex.length-n)}substring(e,i){let o=[...this.text].slice(e,i).join(""),n=this.sectionIndex.slice(e,i);return new il(o,this.sections,n)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,i)=>Math.max(e,this.sections[i].scale)),0)}getMaxImageSize(e){let i=0,o=0;for(let n=0;n<this.length();n++){let l=this.getSection(n);if("imageName"in l){let h=e[l.imageName];if(!h)continue;let p=h.displaySize;i=Math.max(i,p[0]),o=Math.max(o,p[1])}}return{maxImageWidth:i,maxImageHeight:o}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});let o=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>o)))}addImageSection(e){let i=e.image?e.image.name:"";if(i.length===0)return void qt("Can't add FormattedSection with an empty image.");let o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):qt("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,o,n,l){let h=[],p=this.determineAverageLineWidth(e,i,o,n,l),g=this.hasZeroWidthSpaces(),m=0,v=0,_=this.text[Symbol.iterator](),T=_.next(),x=this.text[Symbol.iterator]();x.next();let M=x.next(),C=this.text[Symbol.iterator]();C.next(),C.next();let D=C.next();for(;!T.done;){let L=this.getSection(v),N=T.value.codePointAt(0);if(Su(N)||(m+=vf(N,L,o,n,e,l)),!M.done){let F=Nh(N),j=M.value.codePointAt(0);(c1[N]||F||"imageName"in L||!D.done&&u1[j])&&h.push(xf(v+1,m,p,h,h1(N,j,F&&g),!1))}v++,T=_.next(),M=x.next(),D=C.next()}return wf(xf(this.length(),m,p,h,0,!0))}determineAverageLineWidth(e,i,o,n,l){let h=0,p=0;for(let g of this.text){let m=this.getSection(p);h+=vf(g.codePointAt(0),m,o,n,e,l),p++}return h/Math.max(1,Math.ceil(h/i))}}let xd=4294967296,Tf=1/xd,Sf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Hu{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,i,o=this.length){for(;this.pos<o;){let n=this.readVarint(),l=n>>3,h=this.pos;this.type=7&n,e(l,i,this),this.pos===h&&this.skip(n)}return i}readMessage(e,i){return this.readFields(e,i,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*xd;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*xd;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let i=this.buf,o,n;return n=i[this.pos++],o=127&n,n<128?o:(n=i[this.pos++],o|=(127&n)<<7,n<128?o:(n=i[this.pos++],o|=(127&n)<<14,n<128?o:(n=i[this.pos++],o|=(127&n)<<21,n<128?o:(n=i[this.pos],o|=(15&n)<<28,(function(l,h,p){let g=p.buf,m,v;if(v=g[p.pos++],m=(112&v)>>4,v<128||(v=g[p.pos++],m|=(127&v)<<3,v<128)||(v=g[p.pos++],m|=(127&v)<<10,v<128)||(v=g[p.pos++],m|=(127&v)<<17,v<128)||(v=g[p.pos++],m|=(127&v)<<24,v<128)||(v=g[p.pos++],m|=(1&v)<<31,v<128))return rl(l,m,h);throw new Error("Expected varint not more than 10 bytes")})(o,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,i=this.pos;return this.pos=e,e-i>=12&&Sf?Sf.decode(this.buf.subarray(i,e)):(function(o,n,l){let h="",p=n;for(;p<l;){let g=o[p],m,v,_,T=null,x=g>239?4:g>223?3:g>191?2:1;if(p+x>l)break;x===1?g<128&&(T=g):x===2?(m=o[p+1],(192&m)==128&&(T=(31&g)<<6|63&m,T<=127&&(T=null))):x===3?(m=o[p+1],v=o[p+2],(192&m)==128&&(192&v)==128&&(T=(15&g)<<12|(63&m)<<6|63&v,(T<=2047||T>=55296&&T<=57343)&&(T=null))):x===4&&(m=o[p+1],v=o[p+2],_=o[p+3],(192&m)==128&&(192&v)==128&&(192&_)==128&&(T=(15&g)<<18|(63&m)<<12|(63&v)<<6|63&_,(T<=65535||T>=1114112)&&(T=null))),T===null?(T=65533,x=1):T>65535&&(T-=65536,h+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),h+=String.fromCharCode(T),p+=x}return h})(this.buf,i,e)}readBytes(){let e=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,e);return this.pos=e,i}readPackedVarint(e=[],i){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(i));return e}readPackedSVarint(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){let i=7&e;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(e,i){this.writeVarint(e<<3|i)}realloc(e){let i=this.length||16;for(;i<this.pos+e;)i*=2;if(i!==this.length){let o=new Uint8Array(i);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=i}}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*Tf),!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*Tf),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(i,o){let n,l;if(i>=0?(n=i%4294967296|0,l=i/4294967296|0):(n=~(-i%4294967296),l=~(-i/4294967296),4294967295^n?n=n+1|0:(n=0,l=l+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");o.realloc(10),(function(h,p,g){g.buf[g.pos++]=127&h|128,h>>>=7,g.buf[g.pos++]=127&h|128,h>>>=7,g.buf[g.pos++]=127&h|128,h>>>=7,g.buf[g.pos++]=127&h|128,g.buf[g.pos]=127&(h>>>=7)})(n,0,o),(function(h,p){let g=(7&h)<<4;p.buf[p.pos++]|=g|((h>>>=3)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h)))))})(l,o)})(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++;let i=this.pos;this.pos=(function(n,l,h){for(let p,g,m=0;m<l.length;m++){if(p=l.charCodeAt(m),p>55295&&p<57344){if(!g){p>56319||m+1===l.length?(n[h++]=239,n[h++]=191,n[h++]=189):g=p;continue}if(p<56320){n[h++]=239,n[h++]=191,n[h++]=189,g=p;continue}p=g-55296<<10|p-56320|65536,g=null}else g&&(n[h++]=239,n[h++]=191,n[h++]=189,g=null);p<128?n[h++]=p:(p<2048?n[h++]=p>>6|192:(p<65536?n[h++]=p>>12|224:(n[h++]=p>>18|240,n[h++]=p>>12&63|128),n[h++]=p>>6&63|128),n[h++]=63&p|128)}return h})(this.buf,e,this.pos);let o=this.pos-i;o>=128&&Pf(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}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){let i=e.length;this.writeVarint(i),this.realloc(i);for(let o=0;o<i;o++)this.buf[this.pos++]=e[o]}writeRawMessage(e,i){this.pos++;let o=this.pos;e(i,this);let n=this.pos-o;n>=128&&Pf(o,n,this),this.pos=o-1,this.writeVarint(n),this.pos+=n}writeMessage(e,i,o){this.writeTag(e,2),this.writeRawMessage(i,o)}writePackedVarint(e,i){i.length&&this.writeMessage(e,d1,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,p1,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,g1,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,f1,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,m1,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,_1,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,y1,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,v1,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,b1,i)}writeBytesField(e,i){this.writeTag(e,2),this.writeBytes(i)}writeFixed32Field(e,i){this.writeTag(e,5),this.writeFixed32(i)}writeSFixed32Field(e,i){this.writeTag(e,5),this.writeSFixed32(i)}writeFixed64Field(e,i){this.writeTag(e,1),this.writeFixed64(i)}writeSFixed64Field(e,i){this.writeTag(e,1),this.writeSFixed64(i)}writeVarintField(e,i){this.writeTag(e,0),this.writeVarint(i)}writeSVarintField(e,i){this.writeTag(e,0),this.writeSVarint(i)}writeStringField(e,i){this.writeTag(e,2),this.writeString(i)}writeFloatField(e,i){this.writeTag(e,5),this.writeFloat(i)}writeDoubleField(e,i){this.writeTag(e,1),this.writeDouble(i)}writeBooleanField(e,i){this.writeVarintField(e,+i)}}function rl(r,e,i){return i?4294967296*e+(r>>>0):4294967296*(e>>>0)+(r>>>0)}function Pf(r,e,i){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(let n=i.pos-1;n>=r;n--)i.buf[n+o]=i.buf[n]}function d1(r,e){for(let i=0;i<r.length;i++)e.writeVarint(r[i])}function p1(r,e){for(let i=0;i<r.length;i++)e.writeSVarint(r[i])}function f1(r,e){for(let i=0;i<r.length;i++)e.writeFloat(r[i])}function m1(r,e){for(let i=0;i<r.length;i++)e.writeDouble(r[i])}function g1(r,e){for(let i=0;i<r.length;i++)e.writeBoolean(r[i])}function _1(r,e){for(let i=0;i<r.length;i++)e.writeFixed32(r[i])}function y1(r,e){for(let i=0;i<r.length;i++)e.writeSFixed32(r[i])}function v1(r,e){for(let i=0;i<r.length;i++)e.writeFixed64(r[i])}function b1(r,e){for(let i=0;i<r.length;i++)e.writeSFixed64(r[i])}function x1(r,e,i){r===1&&i.readMessage(w1,e)}function w1(r,e,i){if(r===3){let{id:o,bitmap:n,width:l,height:h,left:p,top:g,advance:m}=i.readMessage(T1,{});e.push({id:o,bitmap:new xc({width:l+6,height:h+6},n),metrics:{width:l,height:h,left:p,top:g,advance:m}})}}function T1(r,e,i){r===1?e.id=i.readVarint():r===2?e.bitmap=i.readBytes():r===3?e.width=i.readVarint():r===4?e.height=i.readVarint():r===5?e.left=i.readSVarint():r===6?e.top=i.readSVarint():r===7&&(e.advance=i.readVarint())}function Mf(r){let e=0,i=0;for(let h of r)e+=h.w*h.h,i=Math.max(i,h.w);r.sort(((h,p)=>p.h-h.h));let o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],n=0,l=0;for(let h of r)for(let p=o.length-1;p>=0;p--){let g=o[p];if(!(h.w>g.w||h.h>g.h)){if(h.x=g.x,h.y=g.y,l=Math.max(l,h.y+h.h),n=Math.max(n,h.x+h.w),h.w===g.w&&h.h===g.h){let m=o.pop();m&&p<o.length&&(o[p]=m)}else h.h===g.h?(g.x+=h.w,g.w-=h.w):h.w===g.w?(g.y+=h.h,g.h-=h.h):(o.push({x:g.x+h.w,y:g.y,w:g.w-h.w,h:h.h}),g.y+=h.h,g.h-=h.h);break}}return{w:n,h:l,fill:e/(n*l)||0}}class wd{constructor(e,{pixelRatio:i,version:o,stretchX:n,stretchY:l,content:h,textFitWidth:p,textFitHeight:g}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=n,this.stretchY=l,this.content=h,this.version=o,this.textFitWidth=p,this.textFitHeight=g}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 Cf{constructor(e,i){let o={},n={};this.haveRenderCallbacks=[];let l=[];this.addImages(e,o,l),this.addImages(i,n,l);let{w:h,h:p}=Mf(l),g=new Nr({width:h||1,height:p||1});for(let m in e){let v=e[m],_=o[m].paddedRect;Nr.copy(v.data,g,{x:0,y:0},{x:_.x+1,y:_.y+1},v.data)}for(let m in i){let v=i[m],_=n[m].paddedRect,T=_.x+1,x=_.y+1,M=v.data.width,C=v.data.height;Nr.copy(v.data,g,{x:0,y:0},{x:T,y:x},v.data),Nr.copy(v.data,g,{x:0,y:C-1},{x:T,y:x-1},{width:M,height:1}),Nr.copy(v.data,g,{x:0,y:0},{x:T,y:x+C},{width:M,height:1}),Nr.copy(v.data,g,{x:M-1,y:0},{x:T-1,y:x},{width:1,height:C}),Nr.copy(v.data,g,{x:0,y:0},{x:T+M,y:x},{width:1,height:C})}this.image=g,this.iconPositions=o,this.patternPositions=n}addImages(e,i,o){for(let n in e){let l=e[n],h={x:0,y:0,w:l.data.width+2,h:l.data.height+2};o.push(h),i[n]=new wd(h,l),l.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),i),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),i)}patchUpdatedImage(e,i,o){if(!e||!i||e.version===i.version)return;e.version=i.version;let[n,l]=e.tl;o.update(i.data,void 0,{x:n,y:l})}}var Uo;function Xu(r,e,i,o,n,l,h,p,g,m,v,_,T,x,M){let C=il.fromFeature(r,n),D;_===z.ax.vertical&&C.verticalizePunctuation();let L=C.determineLineBreaks(m,l,e,o,x),{processBidirectionalText:N,processStyledBidirectionalText:F}=aa;if(N&&C.sections.length===1){D=[],L=L.map((re=>C.toCodeUnitIndex(re)));let G=N(C.toString(),L);for(let re of G){let oe=[...re].map((()=>0));D.push(new il(re,C.sections,oe))}}else if(F){D=[],L=L.map((pe=>C.toCodeUnitIndex(pe)));let G=0,re=[];for(let pe of C.text)re.push(...Array(pe.length).fill(C.sectionIndex[G])),G++;let oe=F(C.text,re,L);for(let pe of oe){let ce=[],_e="";for(let ye of pe[0])ce.push(pe[1][_e.length]),_e+=ye;D.push(new il(pe[0],C.sections,ce))}}else D=(function(G,re){let oe=[],pe=0;for(let ce of re)oe.push(G.substring(pe,ce)),pe=ce;return pe<G.length()&&oe.push(G.substring(pe,G.length())),oe})(C,L);let j=[],U={positionedLines:j,text:C.toString(),top:v[1],bottom:v[1],left:v[0],right:v[0],writingMode:_,iconsInText:!1,verticalizable:!1};return(function(G,re,oe,pe,ce,_e,ye,fe,ue,Ie,Fe,De){let Ae=0,ct=0,Ot=0,Ut=0,$t=fe==="right"?1:fe==="left"?0:.5,or=ji/De,gi=0;for(let si of ce){si.trim();let Ji=si.getMaxScale(),br={positionedGlyphs:[],lineOffset:0};G.positionedLines[gi]=br;let xr=br.positionedGlyphs,jr=0;if(!si.length()){ct+=_e,++gi;continue}let nr=S1(pe,si,or),Vr=0;for(let qi of si.text){let ui=si.getSection(Vr),zi=qi.codePointAt(0),_i=P1(ue,Fe,zi),Gi={glyph:zi,imageName:null,x:Ae,y:ct+-17,vertical:_i,scale:1,fontStack:"",sectionIndex:si.getSectionIndex(Vr),metrics:null,rect:null},no;if("fontStack"in ui){if(no=M1(ui,zi,_i,nr,re,oe),!no)continue;Gi.fontStack=ui.fontStack}else{if(G.iconsInText=!0,ui.scale*=or,no=C1(ui,_i,Ji,nr,pe),!no)continue;jr=Math.max(jr,no.imageOffset),Gi.imageName=ui.imageName}let{rect:Ma,metrics:Oc,baselineOffset:Xo}=no;Gi.y+=Xo,Gi.scale=ui.scale,Gi.metrics=Oc,Gi.rect=Ma,xr.push(Gi),_i?(G.verticalizable=!0,Ae+=("imageName"in ui?Oc.advance:ji)*ui.scale+Ie):Ae+=Oc.advance*ui.scale+Ie,Vr++}xr.length!==0&&(Ot=Math.max(Ae-Ie,Ot),E1(xr,0,xr.length-1,$t)),Ae=0,br.lineOffset=Math.max(jr,(Ji-1)*ji);let fa=_e*Ji+jr;ct+=fa,Ut=Math.max(fa,Ut),++gi}let{horizontalAlign:Ri,verticalAlign:Ui}=Td(ye);(function(si,Ji,br,xr,jr,nr,Vr,fa,qi){let ui=(Ji-br)*jr,zi=0;zi=nr!==Vr?-fa*xr- -17:-xr*qi*Vr+.5*Vr;for(let _i of si)for(let Gi of _i.positionedGlyphs)Gi.x+=ui,Gi.y+=zi})(G.positionedLines,$t,Ri,Ui,Ot,Ut,_e,ct,ce.length),G.top+=-Ui*ct,G.bottom=G.top+ct,G.left+=-Ri*Ot,G.right=G.left+Ot})(U,e,i,o,D,h,p,g,_,m,T,M),!(function(G){for(let re of G)if(re.positionedGlyphs.length!==0)return!1;return!0})(j)&&U}function Td(r){let e=.5,i=.5;switch(r){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function S1(r,e,i){let o=e.getMaxScale()*ji,{maxImageWidth:n,maxImageHeight:l}=e.getMaxImageSize(r),h=Math.max(o,l*i);return{verticalLineContentWidth:Math.max(o,n*i),horizontalLineContentHeight:h}}function Ef(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function P1(r,e,i){return!(r===z.ax.horizontal||!e&&!xn(i)||e&&(Su(i)||(o=i,/\p{sc=Arab}/u.test(String.fromCodePoint(o)))));var o}function M1(r,e,i,o,n,l){let h=l[r.fontStack],p=(function(m,v,_,T){if(m?.rect)return m;let x=v[_.fontStack],M=x?.[T];return M?{rect:null,metrics:M.metrics}:null})(h?.[e],n,r,e);if(p===null)return null;let g;if(i)g=o.verticalLineContentWidth-r.scale*ji;else{let m=Ef(r.verticalAlign);g=(o.horizontalLineContentHeight-r.scale*ji)*m}return{rect:p.rect,metrics:p.metrics,baselineOffset:g}}function C1(r,e,i,o,n){let l=n[r.imageName];if(!l)return null;let h=l.paddedRect,p=l.displaySize,g={width:p[0],height:p[1],left:1,top:-3,advance:e?p[1]:p[0]},m;if(e)m=o.verticalLineContentWidth-p[1]*r.scale;else{let v=Ef(r.verticalAlign);m=(o.horizontalLineContentHeight-p[1]*r.scale)*v}return{rect:h,metrics:g,baselineOffset:m,imageOffset:(e?p[0]:p[1])*r.scale-ji*i}}function E1(r,e,i,o){if(o===0)return;let n=r[i],l=(r[i].x+n.metrics.advance*n.scale)*o;for(let h=e;h<=i;h++)r[h].x-=l}function I1(r,e,i){let{horizontalAlign:o,verticalAlign:n}=Td(i),l=e[0]-r.displaySize[0]*o,h=e[1]-r.displaySize[1]*n;return{image:r,top:h,bottom:h+r.displaySize[1],left:l,right:l+r.displaySize[0]}}function If(r){var e,i;let o=r.left,n=r.top,l=r.right-o,h=r.bottom-n,p=(e=r.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",g=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",m=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(g==="proportional"){if(p==="stretchOnly"&&l/h<m||p==="proportional"){let v=Math.ceil(h*m);o*=v/l,l=v}}else if(p==="proportional"&&g==="stretchOnly"&&m!==0&&l/h>m){let v=Math.ceil(l/m);n*=v/h,h=v}return{x1:o,y1:n,x2:o+l,y2:n+h}}function zf(r,e,i,o,n,l){let h=r.image,p;if(h.content){let D=h.content,L=h.pixelRatio||1;p=[D[0]/L,D[1]/L,h.displaySize[0]-D[2]/L,h.displaySize[1]-D[3]/L]}let g=e.left*l,m=e.right*l,v,_,T,x;i==="width"||i==="both"?(x=n[0]+g-o[3],_=n[0]+m+o[1]):(x=n[0]+(g+m-h.displaySize[0])/2,_=x+h.displaySize[0]);let M=e.top*l,C=e.bottom*l;return i==="height"||i==="both"?(v=n[1]+M-o[0],T=n[1]+C+o[2]):(v=n[1]+(M+C-h.displaySize[1])/2,T=v+h.displaySize[1]),{image:h,top:v,right:_,bottom:T,left:x,collisionPadding:p}}Ne("ImagePosition",wd),Ne("ImageAtlas",Cf),z.ax=void 0,(Uo=z.ax||(z.ax={}))[Uo.none=0]="none",Uo[Uo.horizontal=1]="horizontal",Uo[Uo.vertical=2]="vertical",Uo[Uo.horizontalOnly=3]="horizontalOnly";let ao=128,qo=32640;function Af(r,e){let{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Wt(r+1))};if(i.kind==="source")return{kind:"source"};{let{zoomStops:o,interpolationType:n}=i,l=0;for(;l<o.length&&o[l]<=r;)l++;l=Math.max(0,l-1);let h=l;for(;h<o.length&&o[h]<r+1;)h++;h=Math.min(o.length-1,h);let p=o[l],g=o[h];return i.kind==="composite"?{kind:"composite",minZoom:p,maxZoom:g,interpolationType:n}:{kind:"camera",minZoom:p,maxZoom:g,minSize:i.evaluate(new Wt(p)),maxSize:i.evaluate(new Wt(g)),interpolationType:n}}}function Sd(r,e,i){let o="never",n=r.get(e);return n?o=n:r.get(i)&&(o="always"),o}let z1=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Yu(r,e,i,o,n,l,h,p,g,m,v,_,T){let x=p?Math.min(qo,Math.round(p[0])):0,M=p?Math.min(qo,Math.round(p[1])):0;r.emplaceBack(e,i,Math.round(32*o),Math.round(32*n),l,h,(x<<1)+(g?1:0),M,16*m,16*v,256*_,256*T)}function Pd(r,e,i){r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i)}function A1(r){for(let e of r.sections)if(ac(e.text))return!0;return!1}class Md{constructor(e){this.layoutVertexArray=new Z,this.indexArray=new te,this.programConfigurations=e,this.segments=new de,this.dynamicLayoutVertexArray=new Y,this.opacityVertexArray=new ie,this.hasVisibleVertices=!1,this.placedSymbolArray=new d}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,o,n){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,r1.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,a1.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,z1,!0),this.opacityVertexBuffer.itemSize=1),(o||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ne("SymbolBuffers",Md);class Cd{constructor(e,i,o){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new o,this.segments=new de,this.collisionVertexArray=new W}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,o1.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ne("CollisionBuffers",Cd);class al{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((h=>h.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Af(this.zoom,i["text-size"]),this.iconSizeData=Af(this.zoom,i["icon-size"]);let o=this.layers[0].layout,n=o.get("symbol-sort-key"),l=o.get("symbol-z-order");this.canOverlap=Sd(o,"text-overlap","text-allow-overlap")!=="never"||Sd(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=l!=="viewport-y"&&!n.isConstant(),this.sortFeaturesByY=(l==="viewport-y"||l==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map((h=>z.ax[h]))),this.stateDependentLayerIds=this.layers.filter((h=>h.isStateDependent())).map((h=>h.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Md(new Si(this.layers,this.zoom,(e=>e.startsWith("text")))),this.icon=new Md(new Si(this.layers,this.zoom,(e=>e.startsWith("icon")))),this.glyphOffsetArray=new s,this.lineVertexArray=new c,this.symbolInstances=new a,this.textAnchorOffsets=new y}calculateGlyphDependencies(e,i,o,n,l){for(let h of e)if(i[h.codePointAt(0)]=!0,(o||n)&&l){let p=Dc[h];p&&(i[p.codePointAt(0)]=!0)}}populate(e,i,o){var n;let l=this.layers[0],h=l.layout,p=h.get("text-font"),g=h.get("text-field"),m=h.get("icon-image"),v=(g.value.kind!=="constant"||g.value.value instanceof Dr&&!g.value.value.isEmpty()||g.value.value.toString().length>0)&&(p.value.kind!=="constant"||p.value.value.length>0),_=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,T=h.get("symbol-sort-key");if(this.features=[],!v&&!_)return;let x=i.iconDependencies,M=i.glyphDependencies,C=i.availableImages,D=new Wt(this.zoom);for(let{feature:L,id:N,index:F,sourceLayerIndex:j}of e){let U=l._featureFilter.needGeometry,G=Ta(L,U);if(!l._featureFilter.filter(D,G,o))continue;let re,oe;if(U||(G.geometry=wa(L)),v){let ce=l.getValueAndResolveTokens("text-field",G,o,C),_e=Dr.factory(ce);this.hasRTLText||(this.hasRTLText=A1(_e)),(!this.hasRTLText||aa.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&aa.isParsed())&&(re=l1(_e,l,G))}if(_){let ce=l.getValueAndResolveTokens("icon-image",G,o,C);oe=ce instanceof Lr?ce:Lr.fromString(ce)}if(!re&&!oe)continue;let pe=this.sortFeaturesByKey?T.evaluate(G,{},o):void 0;if(this.features.push({id:N,text:re,icon:oe,index:F,sourceLayerIndex:j,geometry:G.geometry,properties:L.properties,type:Ec.types[L.type],sortKey:pe}),oe&&(x[oe.name]=!0),re){let ce=p.evaluate(G,{},o).join(","),_e=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=(n=this.writingModes)===null||n===void 0?void 0:n.includes(z.ax.vertical);for(let ye of re.sections)if(ye.image)x[ye.image.name]=!0;else{let fe=Ya(re.toString()),ue=ye.fontStack||ce;M[ue]||(M[ue]={}),this.calculateGlyphDependencies(ye.text,M[ue],_e,this.allowVerticalPlacement,fe)}}}h.get("symbol-placement")==="line"&&(this.features=(function(L){let N={},F={},j=[],U=0;function G(ce){j.push(L[ce]),U++}function re(ce,_e,ye){let fe=F[ce];return delete F[ce],F[_e]=fe,j[fe].geometry[0].pop(),j[fe].geometry[0]=j[fe].geometry[0].concat(ye[0]),fe}function oe(ce,_e,ye){let fe=N[_e];return delete N[_e],N[ce]=fe,j[fe].geometry[0].shift(),j[fe].geometry[0]=ye[0].concat(j[fe].geometry[0]),fe}function pe(ce,_e,ye){let fe=ye?_e[0][_e[0].length-1]:_e[0][0];return`${ce}:${fe.x}:${fe.y}`}for(let ce=0;ce<L.length;ce++){let _e=L[ce],ye=_e.geometry,fe=_e.text?_e.text.toString():null;if(!fe){G(ce);continue}let ue=pe(fe,ye),Ie=pe(fe,ye,!0);if(ue in F&&Ie in N&&F[ue]!==N[Ie]){let Fe=oe(ue,Ie,ye),De=re(ue,Ie,j[Fe].geometry);delete N[ue],delete F[Ie],F[pe(fe,j[De].geometry,!0)]=De,j[Fe].geometry=null}else ue in F?re(ue,Ie,ye):Ie in N?oe(ue,Ie,ye):(G(ce),N[ue]=U-1,F[Ie]=U-1)}return j.filter((ce=>ce.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((L,N)=>L.sortKey-N.sortKey))}update(e,i,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}))}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,i){let o=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(i[e.segment+1]),l=e.dist(i[e.segment]),h={};for(let p=e.segment+1;p<i.length;p++)h[p]={x:i[p].x,y:i[p].y,tileUnitDistanceFromAnchor:n},p<i.length-1&&(n+=i[p+1].dist(i[p]));for(let p=e.segment||0;p>=0;p--)h[p]={x:i[p].x,y:i[p].y,tileUnitDistanceFromAnchor:l},p>0&&(l+=i[p-1].dist(i[p]));for(let p=0;p<i.length;p++){let g=h[p];this.lineVertexArray.emplaceBack(g.x,g.y,g.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,i,o,n,l,h,p,g,m,v,_,T){let x=e.indexArray,M=e.layoutVertexArray,C=e.segments.prepareSegment(4*i.length,M,x,this.canOverlap?h.sortKey:void 0),D=this.glyphOffsetArray.length,L=C.vertexLength,N=this.allowVerticalPlacement&&p===z.ax.vertical?Math.PI/2:0,F=h.text&&h.text.sections;for(let j=0;j<i.length;j++){let{tl:U,tr:G,bl:re,br:oe,tex:pe,pixelOffsetTL:ce,pixelOffsetBR:_e,minFontScaleX:ye,minFontScaleY:fe,glyphOffset:ue,isSDF:Ie,sectionIndex:Fe}=i[j],De=C.vertexLength,Ae=ue[1];Yu(M,g.x,g.y,U.x,Ae+U.y,pe.x,pe.y,o,Ie,ce.x,ce.y,ye,fe),Yu(M,g.x,g.y,G.x,Ae+G.y,pe.x+pe.w,pe.y,o,Ie,_e.x,ce.y,ye,fe),Yu(M,g.x,g.y,re.x,Ae+re.y,pe.x,pe.y+pe.h,o,Ie,ce.x,_e.y,ye,fe),Yu(M,g.x,g.y,oe.x,Ae+oe.y,pe.x+pe.w,pe.y+pe.h,o,Ie,_e.x,_e.y,ye,fe),Pd(e.dynamicLayoutVertexArray,g,N),x.emplaceBack(De,De+2,De+1),x.emplaceBack(De+1,De+2,De+3),C.vertexLength+=4,C.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ue[0]),j!==i.length-1&&Fe===i[j+1].sectionIndex||e.programConfigurations.populatePaintArrays(M.length,h,h.index,{imagePositions:{},canonical:T,formattedSection:F?.[Fe]})}e.placedSymbolArray.emplaceBack(g.x,g.y,D,this.glyphOffsetArray.length-D,L,m,v,g.segment,o?o[0]:0,o?o[1]:0,n[0],n[1],p,0,!1,0,_)}_addCollisionDebugVertex(e,i,o,n,l,h){return i.emplaceBack(0,0),e.emplaceBack(o.x,o.y,n,l,Math.round(h.x),Math.round(h.y))}addCollisionDebugVertices(e,i,o,n,l,h,p){let g=l.segments.prepareSegment(4,l.layoutVertexArray,l.indexArray),m=g.vertexLength,v=l.layoutVertexArray,_=l.collisionVertexArray,T=p.anchorX,x=p.anchorY;this._addCollisionDebugVertex(v,_,h,T,x,new se(e,i)),this._addCollisionDebugVertex(v,_,h,T,x,new se(o,i)),this._addCollisionDebugVertex(v,_,h,T,x,new se(o,n)),this._addCollisionDebugVertex(v,_,h,T,x,new se(e,n)),g.vertexLength+=4;let M=l.indexArray;M.emplaceBack(m,m+1),M.emplaceBack(m+1,m+2),M.emplaceBack(m+2,m+3),M.emplaceBack(m+3,m),g.primitiveLength+=4}addDebugCollisionBoxes(e,i,o,n){for(let l=e;l<i;l++){let h=this.collisionBoxArray.get(l);this.addCollisionDebugVertices(h.x1,h.y1,h.x2,h.y2,n?this.textCollisionBox:this.iconCollisionBox,h.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Cd(X,yf.members,J),this.iconCollisionBox=new Cd(X,yf.members,J);for(let e=0;e<this.symbolInstances.length;e++){let i=this.symbolInstances.get(e);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(e,i,o,n,l,h,p,g,m){let v={};for(let _=i;_<o;_++){let T=e.get(_);v.textBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.textFeatureIndex=T.featureIndex;break}for(let _=n;_<l;_++){let T=e.get(_);v.verticalTextBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.verticalTextFeatureIndex=T.featureIndex;break}for(let _=h;_<p;_++){let T=e.get(_);v.iconBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.iconFeatureIndex=T.featureIndex;break}for(let _=g;_<m;_++){let T=e.get(_);v.verticalIconBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},v.verticalIconFeatureIndex=T.featureIndex;break}return v}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){let o=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.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,i){let o=e.placedSymbolArray.get(i),n=o.vertexStartIndex+4*o.numGlyphs;for(let l=o.vertexStartIndex;l<n;l+=4)e.indexArray.emplaceBack(l,l+2,l+1),e.indexArray.emplaceBack(l+1,l+2,l+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let i=Math.sin(e),o=Math.cos(e),n=[],l=[],h=[];for(let p=0;p<this.symbolInstances.length;++p){h.push(p);let g=this.symbolInstances.get(p);n.push(0|Math.round(i*g.anchorX+o*g.anchorY)),l.push(g.featureIndex)}return h.sort(((p,g)=>n[p]-n[g]||l[g]-l[p])),h}addToSortKeyRanges(e,i){let o=this.sortKeyRanges[this.sortKeyRanges.length-1];o?.sortKey===i?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let i of this.symbolInstanceIndexes){let o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex);let n=[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex];for(let l=0;l<n.length;l++){let h=n[l];h>=0&&n.indexOf(h)===l&&this.addIndicesForPlacedSymbol(this.text,h)}o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let kf,Df;Ne("SymbolBucket",al,{omit:["layers","collisionBoxArray","features","compareText"]}),al.MAX_GLYPHS=65535,al.addDynamicAttributes=Pd;var Ed={get paint(){return Df=Df||new tr({"icon-opacity":new rt(he.paint_symbol["icon-opacity"]),"icon-color":new rt(he.paint_symbol["icon-color"]),"icon-halo-color":new rt(he.paint_symbol["icon-halo-color"]),"icon-halo-width":new rt(he.paint_symbol["icon-halo-width"]),"icon-halo-blur":new rt(he.paint_symbol["icon-halo-blur"]),"icon-translate":new Ke(he.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ke(he.paint_symbol["icon-translate-anchor"]),"text-opacity":new rt(he.paint_symbol["text-opacity"]),"text-color":new rt(he.paint_symbol["text-color"],{runtimeType:Oi,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new rt(he.paint_symbol["text-halo-color"]),"text-halo-width":new rt(he.paint_symbol["text-halo-width"]),"text-halo-blur":new rt(he.paint_symbol["text-halo-blur"]),"text-translate":new Ke(he.paint_symbol["text-translate"]),"text-translate-anchor":new Ke(he.paint_symbol["text-translate-anchor"])})},get layout(){return kf=kf||new tr({"symbol-placement":new Ke(he.layout_symbol["symbol-placement"]),"symbol-spacing":new Ke(he.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ke(he.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new rt(he.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ke(he.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ke(he.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ke(he.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ke(he.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ke(he.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ke(he.layout_symbol["icon-rotation-alignment"]),"icon-size":new rt(he.layout_symbol["icon-size"]),"icon-text-fit":new Ke(he.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ke(he.layout_symbol["icon-text-fit-padding"]),"icon-image":new rt(he.layout_symbol["icon-image"]),"icon-rotate":new rt(he.layout_symbol["icon-rotate"]),"icon-padding":new rt(he.layout_symbol["icon-padding"]),"icon-keep-upright":new Ke(he.layout_symbol["icon-keep-upright"]),"icon-offset":new rt(he.layout_symbol["icon-offset"]),"icon-anchor":new rt(he.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ke(he.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ke(he.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ke(he.layout_symbol["text-rotation-alignment"]),"text-field":new rt(he.layout_symbol["text-field"]),"text-font":new rt(he.layout_symbol["text-font"]),"text-size":new rt(he.layout_symbol["text-size"]),"text-max-width":new rt(he.layout_symbol["text-max-width"]),"text-line-height":new Ke(he.layout_symbol["text-line-height"]),"text-letter-spacing":new rt(he.layout_symbol["text-letter-spacing"]),"text-justify":new rt(he.layout_symbol["text-justify"]),"text-radial-offset":new rt(he.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ke(he.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new rt(he.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new rt(he.layout_symbol["text-anchor"]),"text-max-angle":new Ke(he.layout_symbol["text-max-angle"]),"text-writing-mode":new Ke(he.layout_symbol["text-writing-mode"]),"text-rotate":new rt(he.layout_symbol["text-rotate"]),"text-padding":new Ke(he.layout_symbol["text-padding"]),"text-keep-upright":new Ke(he.layout_symbol["text-keep-upright"]),"text-transform":new rt(he.layout_symbol["text-transform"]),"text-offset":new rt(he.layout_symbol["text-offset"]),"text-allow-overlap":new Ke(he.layout_symbol["text-allow-overlap"]),"text-overlap":new Ke(he.layout_symbol["text-overlap"]),"text-ignore-placement":new Ke(he.layout_symbol["text-ignore-placement"]),"text-optional":new Ke(he.layout_symbol["text-optional"])})}};class Lf{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:fo,this.defaultValue=e}evaluate(e){if(e.formattedSection){let i=this.defaultValue.property.overrides;if(i?.hasOverride(e.formattedSection))return i.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}}Ne("FormatSectionOverride",Lf,{omit:["defaultValue"]});class Ku extends Mr{constructor(e,i){super(e,Ed,i)}recalculate(e,i){if(super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let o=this.layout.get("text-writing-mode");if(o){let n=[];for(let l of o)n.includes(l)||n.push(l);this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,o,n){let l=this.layout.get(e).evaluate(i,{},o,n),h=this._unevaluatedLayout._values[e];return h.isDataDriven()||Ts(h.value)||!l?l:(function(p,g){return g.replace(/{([^{}]+)}/g,((m,v)=>p&&v in p?String(p[v]):""))})(i.properties,l)}createBucket(e){return new al(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ed.paint.overridableProperties){if(!Ku.hasPaintOverride(this.layout,e))continue;let i=this.paint.get(e),o=new Lf(i),n=new Hl(o,i.property.specification),l=null;l=i.value.kind==="constant"||i.value.kind==="source"?new Ss("source",n):new Xl("composite",n,i.value.zoomStops),this.paint._values[e]=new oa(i.property,l,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,o){return!(!this.layout||i.isDataDriven()||o.isDataDriven())&&Ku.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){let o=e.get("text-field"),n=Ed.paint.properties[i],l=!1,h=p=>{var g;for(let m of p)if(!((g=n.overrides)===null||g===void 0)&&g.hasOverride(m))return void(l=!0)};if(o.value.kind==="constant"&&o.value.value instanceof Dr)h(o.value.value.sections);else if(o.value.kind==="source"||o.value.kind==="composite"){let p=m=>{l||(m instanceof Da&&Jt(m.value)===Jo?h(m.value.sections):m instanceof hs?h(m.sections):m.eachChild(p))},g=o.value;g._styleExpression&&p(g._styleExpression.expression)}return l}}let Rf;var k1={get paint(){return Rf=Rf||new tr({"background-color":new Ke(he.paint_background["background-color"]),"background-pattern":new Iu(he.paint_background["background-pattern"]),"background-opacity":new Ke(he.paint_background["background-opacity"])})}};class D1 extends Mr{constructor(e,i){super(e,k1,i)}}class L1 extends Mr{constructor(e,i){super(e,{},i),this.onAdd=o=>{this.implementation.onAdd&&this.implementation.onAdd(o,o.painter.context.gl)},this.onRemove=o=>{this.implementation.onRemove&&this.implementation.onRemove(o,o.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 R1{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)===null||e===void 0||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let F1={once:!0},Id=63710088e-1;class Go{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Go(yi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let i=Math.PI/180,o=this.lat*i,n=e.lat*i,l=Math.sin(o)*Math.sin(n)+Math.cos(o)*Math.cos(n)*Math.cos((e.lng-this.lng)*i);return Id*Math.acos(Math.min(l,1))}static convert(e){if(e instanceof Go)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Go(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Go(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>]")}}let Ff=2*Math.PI*Id;function Bf(r){return Ff*Math.cos(r*Math.PI/180)}function Of(r){return(180+r)/360}function Nf(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function jf(r,e){return r/Bf(e)}function Vf(r){return 360*r-180}function Ju(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function Uf(r,e){return r*Bf(Ju(e))}class Lc{constructor(e,i,o=0){this.x=+e,this.y=+i,this.z=+o}static fromLngLat(e,i=0){let o=Go.convert(e);return new Lc(Of(o.lng),Nf(o.lat),jf(i,o.lat))}toLngLat(){return new Go(Vf(this.x),Ju(this.y))}toAltitude(){return Uf(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Ff*(e=Ju(this.y),1/Math.cos(e*Math.PI/180));var e}}function qf(r,e,i){var o=2*Math.PI*6378137/256/Math.pow(2,i);return[r*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class zd{constructor(e,i,o){if(!(function(n,l,h){return!(n<0||n>25||h<0||h>=Math.pow(2,n)||l<0||l>=Math.pow(2,n))})(e,i,o))throw new Error(`x=${i}, y=${o}, 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=i,this.y=o,this.key=ol(0,e,e,i,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,o){let n=(h=this.y,p=this.z,g=qf(256*(l=this.x),256*(h=Math.pow(2,p)-h-1),p),m=qf(256*(l+1),256*(h+1),p),g[0]+","+g[1]+","+m[0]+","+m[1]);var l,h,p,g,m;let v=(function(_,T,x){let M="";for(let C=_;C>0;C--){let D=1<<C-1;M+=(T&D?1:0)+(x&D?2:0)}return M})(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(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,v).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){let i=this.z-e.z;return i>0&&e.x===this.x>>i&&e.y===this.y>>i}getTilePoint(e){let i=Math.pow(2,this.z);return new se((e.x*i-this.x)*He,(e.y*i-this.y)*He)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Gf{constructor(e,i){this.wrap=e,this.canonical=i,this.key=ol(e,i.z,i.z,i.x,i.y)}}class Xr{constructor(e,i,o,n,l){if(this.terrainRttPosMatrix32f=null,e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=i,this.canonical=new zd(o,+n,+l),this.key=ol(i,e,o,n,l)}clone(){return new Xr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?new Xr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xr(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let o=this.canonical.z-e;return e>this.canonical.z?ol(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):ol(this.wrap*+i,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let i=this.canonical.z-e.canonical.z;return!(i<0)&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Xr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,o=2*this.canonical.x,n=2*this.canonical.y;return[new Xr(i,this.wrap,i,o,n),new Xr(i,this.wrap,i,o+1,n),new Xr(i,this.wrap,i,o,n+1),new Xr(i,this.wrap,i,o+1,n+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 Xr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Xr(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 Gf(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Lc(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,o=8192){if(e>=0&&e<o&&i>=0&&i<o)return{tileID:this,x:e,y:i};let n=Math.floor(e/o),l=Math.floor(i/o),h=e-n*o,p=i-l*o,g=this.canonical.z,m=1<<g,v=this.canonical.y+l;if(v<0||v>=m)return null;let _=this.canonical.x+n,T=this.wrap;return _<0?(T-=Math.ceil(-_/m),_=(_%m+m)%m):_>=m&&(T+=Math.floor(_/m),_%=m),{tileID:new Xr(this.overscaledZ,T,g,_,v),x:h,y:p}}}function ol(r,e,i,o,n){(r*=2)<0&&(r=-1*r-1);let l=1<<i;return(l*l*r+l*n+o).toString(36)+i.toString(36)+e.toString(36)}Ne("CanonicalTileID",zd),Ne("OverscaledTileID",Xr,{omit:["terrainRttPosMatrix32f"]});class Nn{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){let i=new Nn;return i.extend(e(new se(this.minX,this.minY))),i.extend(e(new se(this.maxX,this.minY))),i.extend(e(new se(this.minX,this.maxY))),i.extend(e(new se(this.maxX,this.maxY))),i}static fromPoints(e){let i=new Nn;for(let o of e)i.extend(o);return i}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 Zf{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){let o=e[i];this._stringToNumber[o]=i,this._numberToString[i]=o}}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 $f{constructor(e,i,o,n,l){this.type="Feature",this._vectorTileFeature=e,this._x=o,this._y=n,this._z=i,this.properties=e.properties,this.id=l}projectPoint(e,i,o,n){return[360*(e.x+i)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/n)*Math.PI))-90]}projectLine(e,i,o,n){return e.map((l=>this.projectPoint(l,i,o,n)))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),o=e.extent*this._x,n=e.extent*this._y,l=e.loadGeometry();switch(e.type){case 1:{let h=[];for(let g of l)h.push(g[0]);let p=this.projectLine(h,o,n,i);this._geometry=h.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p};break}case 2:{let h=l.map((p=>this.projectLine(p,o,n,i)));this._geometry=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h};break}case 3:{let h=Hp(l),p=[];for(let g of h)p.push(g.map((m=>this.projectLine(m,o,n,i))));this._geometry=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&i!=="_x"&&i!=="_y"&&i!=="_z"&&(e[i]=this[i]);return e}}class nl{constructor(e,i,o){this._name=e,this.dataBuffer=i,typeof o=="number"?this._size=o:(this.nullabilityBuffer=o,this._size=o.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Qu extends nl{}class Ad extends Qu{getValueFromBuffer(e){return this.dataBuffer[e]}}class kd extends Qu{getValueFromBuffer(e){return this.dataBuffer[e]}}class Wf extends nl{constructor(e,i,o,n){super(e,i,n),this.delta=o}}class Dd extends Wf{constructor(e,i,o,n){super(e,Int32Array.of(i),o,n)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class Ld extends nl{constructor(e,i,o,n){super(e,n?Int32Array.of(i):Uint32Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}class B1{constructor(e,i,o,n,l=4096){this._name=e,this._geometryVector=i,this._idVector=o,this._propertyVectors=n,this._extent=l}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((i=>[i.name,i])))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],i=this.geometryVector.getGeometries();for(let o=0;o<this.numFeatures;o++){let n;if(this.idVector){let p=this.idVector.getValue(o);n=this.containsMaxSafeIntegerValues(this.idVector)&&p!==null?Number(p):p}let l={coordinates:i[o],type:this.geometryVector.geometryType(o)},h={};for(let p of this.propertyVectors){if(!p)continue;let g=p.name,m=p.getValue(o);m!==null&&(h[g]=m)}e.push({id:n,geometry:l,properties:h})}return e}containsMaxSafeIntegerValues(e){return e instanceof Ad||e instanceof Ld||e instanceof Dd||e instanceof kd}}class Hf{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Mt,Zo;(function(r){r.NONE="NONE",r.DELTA="DELTA",r.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",r.RLE="RLE",r.MORTON="MORTON",r.PDE="PDE"})(Mt||(Mt={})),(function(r){r.NONE="NONE",r.FAST_PFOR="FAST_PFOR",r.VARINT="VARINT",r.ALP="ALP"})(Zo||(Zo={}));let Rd=new Uint32Array(33);Rd[0]=0;for(let r=1;r<=32;r++)Rd[r]=r===32?4294967295:4294967295>>>32-r;let Fd=Rd,oo=256;function Bd(r,e){return r-r%e}function O1(r){let e=r>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}let Od=(function(){if(!Number.isFinite(65536))return 65536;let r=Bd(Math.floor(65536),oo);return r===0?oo:r})(),N1=3*Od/oo+Od|0;function Xf(){let r=new Uint8Array(N1);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:r,byteContainerI32:new Int32Array(r.buffer,r.byteOffset,r.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function j1(r,e,i,o,n){switch(n){case 1:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0;p[m++]=T>>>0&1,p[m++]=T>>>1&1,p[m++]=T>>>2&1,p[m++]=T>>>3&1,p[m++]=T>>>4&1,p[m++]=T>>>5&1,p[m++]=T>>>6&1,p[m++]=T>>>7&1,p[m++]=T>>>8&1,p[m++]=T>>>9&1,p[m++]=T>>>10&1,p[m++]=T>>>11&1,p[m++]=T>>>12&1,p[m++]=T>>>13&1,p[m++]=T>>>14&1,p[m++]=T>>>15&1,p[m++]=T>>>16&1,p[m++]=T>>>17&1,p[m++]=T>>>18&1,p[m++]=T>>>19&1,p[m++]=T>>>20&1,p[m++]=T>>>21&1,p[m++]=T>>>22&1,p[m++]=T>>>23&1,p[m++]=T>>>24&1,p[m++]=T>>>25&1,p[m++]=T>>>26&1,p[m++]=T>>>27&1,p[m++]=T>>>28&1,p[m++]=T>>>29&1,p[m++]=T>>>30&1,p[m++]=T>>>31&1}})(r,e,i,o);break;case 2:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0;p[m++]=T>>>0&3,p[m++]=T>>>2&3,p[m++]=T>>>4&3,p[m++]=T>>>6&3,p[m++]=T>>>8&3,p[m++]=T>>>10&3,p[m++]=T>>>12&3,p[m++]=T>>>14&3,p[m++]=T>>>16&3,p[m++]=T>>>18&3,p[m++]=T>>>20&3,p[m++]=T>>>22&3,p[m++]=T>>>24&3,p[m++]=T>>>26&3,p[m++]=T>>>28&3,p[m++]=T>>>30&3,p[m++]=x>>>0&3,p[m++]=x>>>2&3,p[m++]=x>>>4&3,p[m++]=x>>>6&3,p[m++]=x>>>8&3,p[m++]=x>>>10&3,p[m++]=x>>>12&3,p[m++]=x>>>14&3,p[m++]=x>>>16&3,p[m++]=x>>>18&3,p[m++]=x>>>20&3,p[m++]=x>>>22&3,p[m++]=x>>>24&3,p[m++]=x>>>26&3,p[m++]=x>>>28&3,p[m++]=x>>>30&3}})(r,e,i,o);break;case 3:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0;p[m++]=T>>>0&7,p[m++]=T>>>3&7,p[m++]=T>>>6&7,p[m++]=T>>>9&7,p[m++]=T>>>12&7,p[m++]=T>>>15&7,p[m++]=T>>>18&7,p[m++]=T>>>21&7,p[m++]=T>>>24&7,p[m++]=T>>>27&7,p[m++]=7&(T>>>30|(1&x)<<2),p[m++]=x>>>1&7,p[m++]=x>>>4&7,p[m++]=x>>>7&7,p[m++]=x>>>10&7,p[m++]=x>>>13&7,p[m++]=x>>>16&7,p[m++]=x>>>19&7,p[m++]=x>>>22&7,p[m++]=x>>>25&7,p[m++]=x>>>28&7,p[m++]=7&(x>>>31|(3&M)<<1),p[m++]=M>>>2&7,p[m++]=M>>>5&7,p[m++]=M>>>8&7,p[m++]=M>>>11&7,p[m++]=M>>>14&7,p[m++]=M>>>17&7,p[m++]=M>>>20&7,p[m++]=M>>>23&7,p[m++]=M>>>26&7,p[m++]=M>>>29&7}})(r,e,i,o);break;case 4:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0,C=l[v++]>>>0;p[m++]=T>>>0&15,p[m++]=T>>>4&15,p[m++]=T>>>8&15,p[m++]=T>>>12&15,p[m++]=T>>>16&15,p[m++]=T>>>20&15,p[m++]=T>>>24&15,p[m++]=T>>>28&15,p[m++]=x>>>0&15,p[m++]=x>>>4&15,p[m++]=x>>>8&15,p[m++]=x>>>12&15,p[m++]=x>>>16&15,p[m++]=x>>>20&15,p[m++]=x>>>24&15,p[m++]=x>>>28&15,p[m++]=M>>>0&15,p[m++]=M>>>4&15,p[m++]=M>>>8&15,p[m++]=M>>>12&15,p[m++]=M>>>16&15,p[m++]=M>>>20&15,p[m++]=M>>>24&15,p[m++]=M>>>28&15,p[m++]=C>>>0&15,p[m++]=C>>>4&15,p[m++]=C>>>8&15,p[m++]=C>>>12&15,p[m++]=C>>>16&15,p[m++]=C>>>20&15,p[m++]=C>>>24&15,p[m++]=C>>>28&15}})(r,e,i,o);break;case 5:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0,C=l[v++]>>>0,D=l[v++]>>>0;p[m++]=T>>>0&31,p[m++]=T>>>5&31,p[m++]=T>>>10&31,p[m++]=T>>>15&31,p[m++]=T>>>20&31,p[m++]=T>>>25&31,p[m++]=31&(T>>>30|(7&x)<<2),p[m++]=x>>>3&31,p[m++]=x>>>8&31,p[m++]=x>>>13&31,p[m++]=x>>>18&31,p[m++]=x>>>23&31,p[m++]=31&(x>>>28|(1&M)<<4),p[m++]=M>>>1&31,p[m++]=M>>>6&31,p[m++]=M>>>11&31,p[m++]=M>>>16&31,p[m++]=M>>>21&31,p[m++]=M>>>26&31,p[m++]=31&(M>>>31|(15&C)<<1),p[m++]=C>>>4&31,p[m++]=C>>>9&31,p[m++]=C>>>14&31,p[m++]=C>>>19&31,p[m++]=C>>>24&31,p[m++]=31&(C>>>29|(3&D)<<3),p[m++]=D>>>2&31,p[m++]=D>>>7&31,p[m++]=D>>>12&31,p[m++]=D>>>17&31,p[m++]=D>>>22&31,p[m++]=D>>>27&31}})(r,e,i,o);break;case 6:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0,C=l[v++]>>>0,D=l[v++]>>>0,L=l[v++]>>>0;p[m++]=T>>>0&63,p[m++]=T>>>6&63,p[m++]=T>>>12&63,p[m++]=T>>>18&63,p[m++]=T>>>24&63,p[m++]=63&(T>>>30|(15&x)<<2),p[m++]=x>>>4&63,p[m++]=x>>>10&63,p[m++]=x>>>16&63,p[m++]=x>>>22&63,p[m++]=63&(x>>>28|(3&M)<<4),p[m++]=M>>>2&63,p[m++]=M>>>8&63,p[m++]=M>>>14&63,p[m++]=M>>>20&63,p[m++]=M>>>26&63,p[m++]=C>>>0&63,p[m++]=C>>>6&63,p[m++]=C>>>12&63,p[m++]=C>>>18&63,p[m++]=C>>>24&63,p[m++]=63&(C>>>30|(15&D)<<2),p[m++]=D>>>4&63,p[m++]=D>>>10&63,p[m++]=D>>>16&63,p[m++]=D>>>22&63,p[m++]=63&(D>>>28|(3&L)<<4),p[m++]=L>>>2&63,p[m++]=L>>>8&63,p[m++]=L>>>14&63,p[m++]=L>>>20&63,p[m++]=L>>>26&63}})(r,e,i,o);break;case 7:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0,C=l[v++]>>>0,D=l[v++]>>>0,L=l[v++]>>>0,N=l[v++]>>>0;p[m++]=T>>>0&127,p[m++]=T>>>7&127,p[m++]=T>>>14&127,p[m++]=T>>>21&127,p[m++]=127&(T>>>28|(7&x)<<4),p[m++]=x>>>3&127,p[m++]=x>>>10&127,p[m++]=x>>>17&127,p[m++]=x>>>24&127,p[m++]=127&(x>>>31|(63&M)<<1),p[m++]=M>>>6&127,p[m++]=M>>>13&127,p[m++]=M>>>20&127,p[m++]=127&(M>>>27|(3&C)<<5),p[m++]=C>>>2&127,p[m++]=C>>>9&127,p[m++]=C>>>16&127,p[m++]=C>>>23&127,p[m++]=127&(C>>>30|(31&D)<<2),p[m++]=D>>>5&127,p[m++]=D>>>12&127,p[m++]=D>>>19&127,p[m++]=127&(D>>>26|(1&L)<<6),p[m++]=L>>>1&127,p[m++]=L>>>8&127,p[m++]=L>>>15&127,p[m++]=L>>>22&127,p[m++]=127&(L>>>29|(15&N)<<3),p[m++]=N>>>4&127,p[m++]=N>>>11&127,p[m++]=N>>>18&127,p[m++]=N>>>25&127}})(r,e,i,o);break;case 8:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<8;_++){let T=l[v++]>>>0,x=l[v++]>>>0,M=l[v++]>>>0,C=l[v++]>>>0,D=l[v++]>>>0,L=l[v++]>>>0,N=l[v++]>>>0,F=l[v++]>>>0;p[m++]=T>>>0&255,p[m++]=T>>>8&255,p[m++]=T>>>16&255,p[m++]=T>>>24&255,p[m++]=x>>>0&255,p[m++]=x>>>8&255,p[m++]=x>>>16&255,p[m++]=x>>>24&255,p[m++]=M>>>0&255,p[m++]=M>>>8&255,p[m++]=M>>>16&255,p[m++]=M>>>24&255,p[m++]=C>>>0&255,p[m++]=C>>>8&255,p[m++]=C>>>16&255,p[m++]=C>>>24&255,p[m++]=D>>>0&255,p[m++]=D>>>8&255,p[m++]=D>>>16&255,p[m++]=D>>>24&255,p[m++]=L>>>0&255,p[m++]=L>>>8&255,p[m++]=L>>>16&255,p[m++]=L>>>24&255,p[m++]=N>>>0&255,p[m++]=N>>>8&255,p[m++]=N>>>16&255,p[m++]=N>>>24&255,p[m++]=F>>>0&255,p[m++]=F>>>8&255,p[m++]=F>>>16&255,p[m++]=F>>>24&255}})(r,e,i,o);break;case 16:(function(l,h,p,g){let m=g,v=h;for(let _=0;_<128;_++){let T=l[v++]>>>0;p[m++]=65535&T,p[m++]=T>>>16&65535}})(r,e,i,o);break;default:(function(l,h,p,g,m){let v=Fd[m]>>>0,_=h,T=0,x=l[_]>>>0,M=g;for(let C=0;C<8;C++){for(let D=0;D<32;D++)if(T+m<=32)p[M+D]=x>>>T&v,T+=m,T===32&&(T=0,_++,D!==31&&(x=l[_]>>>0));else{let L=32-T,N=x>>>T;_++,x=l[_]>>>0;let F=m-L;p[M+D]=(N|(x&-1>>>32-F>>>0)<<L)&v,T=F}M+=32,T=0,C<7&&(x=l[_]>>>0)}})(r,e,i,o,n)}return e+(n<<3)|0}function V1(r,e,i,o){if(i+2>e)throw new Error(`FastPFOR decode: byteContainer underflow at block=${o} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);let n=r[i++],l=r[i++];if(n>32)throw new Error(`FastPFOR decode: invalid bitWidth=${n} at block=${o} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:l,bytePosIn:i}}function U1(r,e,i,o,n,l,h,p,g){let{maxBits:m,exceptionBitWidth:v,bytePosIn:_}=(function(D,L,N,F,j,U){if(N+1>L)throw new Error(`FastPFOR decode: exception header underflow at block=${U} (need 1 byte for maxBits, bytePos=${N}, byteSize=${L})`);let G=D[N++];if(G<F||G>32)throw new Error(`FastPFOR decode: invalid maxBits=${G} at block=${U} (bitWidth=${F}, expected ${F}..32)`);let re=G-F|0;if(re<1||re>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${re} at block=${U} (bitWidth=${F}, maxBits=${G})`);if(N+j>L)throw new Error(`FastPFOR decode: exception positions underflow at block=${U} (need=${j}, have=${L-N})`);return{maxBits:G,exceptionBitWidth:re,bytePosIn:N}})(n,l,h,i,o,g);if(h=_,v===1){let D=1<<i;for(let L=0;L<o;L=L+1|0)r[n[h++]+e|0]|=D;return h}let T=p.dataToBePacked[v];if(!T)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${v} (bitWidth=${i}, maxBits=${m}) at block ${g}`);let x=p.dataPointers,M=0|x[v],C=0|p.exceptionSizes[v];if(M+o>C)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${v} (ptr=${M}, need ${o}, size=${C}) at block ${g}`);for(let D=0;D<o;D=D+1|0){let L=n[h++],N=0|T[M++];r[L+e|0]|=N<<i}return x[v]=M,h}function q1(r,e,i,o,n,l){let h=0|i,p=0|r[h];if(p<=0||h+p>r.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${p} at pageStart=${h} (expected > 0 and pageStart+whereMeta < encoded.length=${r.length})`);let g=h+1|0,m=h+p|0,v=r[m]>>>0,_=v+3>>>2,T=m+1,x=T+_;if(x>=r.length)throw new Error(`FastPFOR decode: invalid byteSize=${v} (metaInts=${_}, pageStart=${h}, packedEnd=${m}, byteContainerStart=${T}) causes bitmapPos=${x} out of bounds (encoded.length=${r.length})`);let M=(function(L,N,F,j){j.byteContainer.length<F&&(j.byteContainer=new Uint8Array(2*F),j.byteContainerI32=void 0);let U=j.byteContainer,G=F>>>2;if(3&U.byteOffset)for(let oe=0;oe<G;oe=oe+1|0){let pe=0|L[N+oe|0],ce=oe<<2;U[ce]=255&pe,U[ce+1|0]=pe>>>8&255,U[ce+2|0]=pe>>>16&255,U[ce+3|0]=pe>>>24&255}else{let oe=j.byteContainerI32;(!oe||oe.buffer!==U.buffer||oe.byteOffset!==U.byteOffset||oe.length<G)&&(oe=j.byteContainerI32=new Int32Array(U.buffer,U.byteOffset,U.byteLength>>>2)),oe.set(L.subarray(N,N+G))}let re=3&F;if(re>0){let oe=0|L[N+G|0],pe=G<<2;for(let ce=0;ce<re;ce=ce+1|0)U[pe+ce|0]=oe>>>(ce<<3)&255}return U})(r,T,v,l),C=v,D=(function(L,N,F){let j=0|L[N++],U=F.dataToBePacked;for(let G=2;G<=32;G=G+1|0){if(!(j>>>G-1&1))continue;if(N>=L.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${G}, streamWordIndex=${N}, needWords=1, availableWords=${L.length-N}, encodedWords=${L.length})`);let re=L[N++]>>>0,oe=Bd(re+31,32),pe=re*G+31>>>5;if(N+pe>L.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${G}, size=${re}, streamWordIndex=${N}, needWords=${pe}, availableWords=${L.length-N}, encodedWords=${L.length})`);let ce=U[G];(!ce||ce.length<oe)&&(ce=U[G]=new Uint32Array(oe));let _e=0;for(;_e<re;_e=_e+32|0)G1(L,N,ce,_e,G),N=N+G|0;N=N-((_e-re|0)*G>>>5)|0,F.exceptionSizes[G]=re}return N})(r,x,l);return l.dataPointers.fill(0),(function(L,N,F,j,U,G,re,oe,pe,ce){let _e=0|F,ye=0;for(let fe=0;fe<re;fe=fe+1|0){let ue=V1(oe,pe,ye,fe);ye=ue.bytePosIn;let Ie=ue.bitWidth,Fe=ue.exceptionCount,De=G+fe*oo|0;switch(Ie){case 0:U.fill(0,De,De+oo);break;case 32:for(let Ae=0;Ae<oo;Ae=Ae+1|0)U[De+Ae|0]=0|L[_e+Ae|0];_e=_e+oo|0;break;default:_e=j1(L,_e,U,De,Ie)}Fe>0&&(ye=U1(U,De,Ie,Fe,oe,pe,ye,ce,fe))}if(_e!==j)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${N}, packedStart=${F}, consumedPackedEnd=${_e}, expectedPackedEnd=${j}, packedWords=${j-F}, encoded.length=${L.length})`)})(r,h,g,m,e,0|o,n/oo|0,M,C,l),D}function G1(r,e,i,o,n){switch(n){case 2:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0;_[x++]=M>>>0&3,_[x++]=M>>>2&3,_[x++]=M>>>4&3,_[x++]=M>>>6&3,_[x++]=M>>>8&3,_[x++]=M>>>10&3,_[x++]=M>>>12&3,_[x++]=M>>>14&3,_[x++]=M>>>16&3,_[x++]=M>>>18&3,_[x++]=M>>>20&3,_[x++]=M>>>22&3,_[x++]=M>>>24&3,_[x++]=M>>>26&3,_[x++]=M>>>28&3,_[x++]=M>>>30&3,_[x++]=C>>>0&3,_[x++]=C>>>2&3,_[x++]=C>>>4&3,_[x++]=C>>>6&3,_[x++]=C>>>8&3,_[x++]=C>>>10&3,_[x++]=C>>>12&3,_[x++]=C>>>14&3,_[x++]=C>>>16&3,_[x++]=C>>>18&3,_[x++]=C>>>20&3,_[x++]=C>>>22&3,_[x++]=C>>>24&3,_[x++]=C>>>26&3,_[x++]=C>>>28&3,_[x]=C>>>30&3})(r,e,i,o);case 3:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0;_[x++]=M>>>0&7,_[x++]=M>>>3&7,_[x++]=M>>>6&7,_[x++]=M>>>9&7,_[x++]=M>>>12&7,_[x++]=M>>>15&7,_[x++]=M>>>18&7,_[x++]=M>>>21&7,_[x++]=M>>>24&7,_[x++]=M>>>27&7,_[x++]=7&(M>>>30|(1&C)<<2),_[x++]=C>>>1&7,_[x++]=C>>>4&7,_[x++]=C>>>7&7,_[x++]=C>>>10&7,_[x++]=C>>>13&7,_[x++]=C>>>16&7,_[x++]=C>>>19&7,_[x++]=C>>>22&7,_[x++]=C>>>25&7,_[x++]=C>>>28&7,_[x++]=7&(C>>>31|(3&D)<<1),_[x++]=D>>>2&7,_[x++]=D>>>5&7,_[x++]=D>>>8&7,_[x++]=D>>>11&7,_[x++]=D>>>14&7,_[x++]=D>>>17&7,_[x++]=D>>>20&7,_[x++]=D>>>23&7,_[x++]=D>>>26&7,_[x]=D>>>29&7})(r,e,i,o);case 4:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0;_[x++]=M>>>0&15,_[x++]=M>>>4&15,_[x++]=M>>>8&15,_[x++]=M>>>12&15,_[x++]=M>>>16&15,_[x++]=M>>>20&15,_[x++]=M>>>24&15,_[x++]=M>>>28&15,_[x++]=C>>>0&15,_[x++]=C>>>4&15,_[x++]=C>>>8&15,_[x++]=C>>>12&15,_[x++]=C>>>16&15,_[x++]=C>>>20&15,_[x++]=C>>>24&15,_[x++]=C>>>28&15,_[x++]=D>>>0&15,_[x++]=D>>>4&15,_[x++]=D>>>8&15,_[x++]=D>>>12&15,_[x++]=D>>>16&15,_[x++]=D>>>20&15,_[x++]=D>>>24&15,_[x++]=D>>>28&15,_[x++]=L>>>0&15,_[x++]=L>>>4&15,_[x++]=L>>>8&15,_[x++]=L>>>12&15,_[x++]=L>>>16&15,_[x++]=L>>>20&15,_[x++]=L>>>24&15,_[x]=L>>>28&15})(r,e,i,o);case 5:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0;_[x++]=M>>>0&31,_[x++]=M>>>5&31,_[x++]=M>>>10&31,_[x++]=M>>>15&31,_[x++]=M>>>20&31,_[x++]=M>>>25&31,_[x++]=31&(M>>>30|(7&C)<<2),_[x++]=C>>>3&31,_[x++]=C>>>8&31,_[x++]=C>>>13&31,_[x++]=C>>>18&31,_[x++]=C>>>23&31,_[x++]=31&(C>>>28|(1&D)<<4),_[x++]=D>>>1&31,_[x++]=D>>>6&31,_[x++]=D>>>11&31,_[x++]=D>>>16&31,_[x++]=D>>>21&31,_[x++]=D>>>26&31,_[x++]=31&(D>>>31|(15&L)<<1),_[x++]=L>>>4&31,_[x++]=L>>>9&31,_[x++]=L>>>14&31,_[x++]=L>>>19&31,_[x++]=L>>>24&31,_[x++]=31&(L>>>29|(3&N)<<3),_[x++]=N>>>2&31,_[x++]=N>>>7&31,_[x++]=N>>>12&31,_[x++]=N>>>17&31,_[x++]=N>>>22&31,_[x]=N>>>27&31})(r,e,i,o);case 6:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0;_[x++]=M>>>0&63,_[x++]=M>>>6&63,_[x++]=M>>>12&63,_[x++]=M>>>18&63,_[x++]=M>>>24&63,_[x++]=63&(M>>>30|(15&C)<<2),_[x++]=C>>>4&63,_[x++]=C>>>10&63,_[x++]=C>>>16&63,_[x++]=C>>>22&63,_[x++]=63&(C>>>28|(3&D)<<4),_[x++]=D>>>2&63,_[x++]=D>>>8&63,_[x++]=D>>>14&63,_[x++]=D>>>20&63,_[x++]=D>>>26&63,_[x++]=L>>>0&63,_[x++]=L>>>6&63,_[x++]=L>>>12&63,_[x++]=L>>>18&63,_[x++]=L>>>24&63,_[x++]=63&(L>>>30|(15&N)<<2),_[x++]=N>>>4&63,_[x++]=N>>>10&63,_[x++]=N>>>16&63,_[x++]=N>>>22&63,_[x++]=63&(N>>>28|(3&F)<<4),_[x++]=F>>>2&63,_[x++]=F>>>8&63,_[x++]=F>>>14&63,_[x++]=F>>>20&63,_[x]=F>>>26&63})(r,e,i,o);case 7:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0;_[x++]=M>>>0&127,_[x++]=M>>>7&127,_[x++]=M>>>14&127,_[x++]=M>>>21&127,_[x++]=127&(M>>>28|(7&C)<<4),_[x++]=C>>>3&127,_[x++]=C>>>10&127,_[x++]=C>>>17&127,_[x++]=C>>>24&127,_[x++]=127&(C>>>31|(63&D)<<1),_[x++]=D>>>6&127,_[x++]=D>>>13&127,_[x++]=D>>>20&127,_[x++]=127&(D>>>27|(3&L)<<5),_[x++]=L>>>2&127,_[x++]=L>>>9&127,_[x++]=L>>>16&127,_[x++]=L>>>23&127,_[x++]=127&(L>>>30|(31&N)<<2),_[x++]=N>>>5&127,_[x++]=N>>>12&127,_[x++]=N>>>19&127,_[x++]=127&(N>>>26|(1&F)<<6),_[x++]=F>>>1&127,_[x++]=F>>>8&127,_[x++]=F>>>15&127,_[x++]=F>>>22&127,_[x++]=127&(F>>>29|(15&j)<<3),_[x++]=j>>>4&127,_[x++]=j>>>11&127,_[x++]=j>>>18&127,_[x]=j>>>25&127})(r,e,i,o);case 8:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0;_[x++]=M>>>0&255,_[x++]=M>>>8&255,_[x++]=M>>>16&255,_[x++]=M>>>24&255,_[x++]=C>>>0&255,_[x++]=C>>>8&255,_[x++]=C>>>16&255,_[x++]=C>>>24&255,_[x++]=D>>>0&255,_[x++]=D>>>8&255,_[x++]=D>>>16&255,_[x++]=D>>>24&255,_[x++]=L>>>0&255,_[x++]=L>>>8&255,_[x++]=L>>>16&255,_[x++]=L>>>24&255,_[x++]=N>>>0&255,_[x++]=N>>>8&255,_[x++]=N>>>16&255,_[x++]=N>>>24&255,_[x++]=F>>>0&255,_[x++]=F>>>8&255,_[x++]=F>>>16&255,_[x++]=F>>>24&255,_[x++]=j>>>0&255,_[x++]=j>>>8&255,_[x++]=j>>>16&255,_[x++]=j>>>24&255,_[x++]=U>>>0&255,_[x++]=U>>>8&255,_[x++]=U>>>16&255,_[x]=U>>>24&255})(r,e,i,o);case 9:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0,G=m[v+8]>>>0;_[x++]=M>>>0&511,_[x++]=M>>>9&511,_[x++]=M>>>18&511,_[x++]=511&(M>>>27|(15&C)<<5),_[x++]=C>>>4&511,_[x++]=C>>>13&511,_[x++]=C>>>22&511,_[x++]=511&(C>>>31|(255&D)<<1),_[x++]=D>>>8&511,_[x++]=D>>>17&511,_[x++]=511&(D>>>26|(7&L)<<6),_[x++]=L>>>3&511,_[x++]=L>>>12&511,_[x++]=L>>>21&511,_[x++]=511&(L>>>30|(127&N)<<2),_[x++]=N>>>7&511,_[x++]=N>>>16&511,_[x++]=511&(N>>>25|(3&F)<<7),_[x++]=F>>>2&511,_[x++]=F>>>11&511,_[x++]=F>>>20&511,_[x++]=511&(F>>>29|(63&j)<<3),_[x++]=j>>>6&511,_[x++]=j>>>15&511,_[x++]=511&(j>>>24|(1&U)<<8),_[x++]=U>>>1&511,_[x++]=U>>>10&511,_[x++]=U>>>19&511,_[x++]=511&(U>>>28|(31&G)<<4),_[x++]=G>>>5&511,_[x++]=G>>>14&511,_[x]=G>>>23&511})(r,e,i,o);case 10:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0,G=m[v+8]>>>0,re=m[v+9]>>>0;_[x++]=M>>>0&1023,_[x++]=M>>>10&1023,_[x++]=M>>>20&1023,_[x++]=1023&(M>>>30|(255&C)<<2),_[x++]=C>>>8&1023,_[x++]=C>>>18&1023,_[x++]=1023&(C>>>28|(63&D)<<4),_[x++]=D>>>6&1023,_[x++]=D>>>16&1023,_[x++]=1023&(D>>>26|(15&L)<<6),_[x++]=L>>>4&1023,_[x++]=L>>>14&1023,_[x++]=1023&(L>>>24|(3&N)<<8),_[x++]=N>>>2&1023,_[x++]=N>>>12&1023,_[x++]=N>>>22&1023,_[x++]=F>>>0&1023,_[x++]=F>>>10&1023,_[x++]=F>>>20&1023,_[x++]=1023&(F>>>30|(255&j)<<2),_[x++]=j>>>8&1023,_[x++]=j>>>18&1023,_[x++]=1023&(j>>>28|(63&U)<<4),_[x++]=U>>>6&1023,_[x++]=U>>>16&1023,_[x++]=1023&(U>>>26|(15&G)<<6),_[x++]=G>>>4&1023,_[x++]=G>>>14&1023,_[x++]=1023&(G>>>24|(3&re)<<8),_[x++]=re>>>2&1023,_[x++]=re>>>12&1023,_[x]=re>>>22&1023})(r,e,i,o);case 11:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0,G=m[v+8]>>>0,re=m[v+9]>>>0,oe=m[v+10]>>>0;_[x++]=M>>>0&2047,_[x++]=M>>>11&2047,_[x++]=2047&(M>>>22|(1&C)<<10),_[x++]=C>>>1&2047,_[x++]=C>>>12&2047,_[x++]=2047&(C>>>23|(3&D)<<9),_[x++]=D>>>2&2047,_[x++]=D>>>13&2047,_[x++]=2047&(D>>>24|(7&L)<<8),_[x++]=L>>>3&2047,_[x++]=L>>>14&2047,_[x++]=2047&(L>>>25|(15&N)<<7),_[x++]=N>>>4&2047,_[x++]=N>>>15&2047,_[x++]=2047&(N>>>26|(31&F)<<6),_[x++]=F>>>5&2047,_[x++]=F>>>16&2047,_[x++]=2047&(F>>>27|(63&j)<<5),_[x++]=j>>>6&2047,_[x++]=j>>>17&2047,_[x++]=2047&(j>>>28|(127&U)<<4),_[x++]=U>>>7&2047,_[x++]=U>>>18&2047,_[x++]=2047&(U>>>29|(255&G)<<3),_[x++]=G>>>8&2047,_[x++]=G>>>19&2047,_[x++]=2047&(G>>>30|(511&re)<<2),_[x++]=re>>>9&2047,_[x++]=re>>>20&2047,_[x++]=2047&(re>>>31|(1023&oe)<<1),_[x++]=oe>>>10&2047,_[x]=oe>>>21&2047})(r,e,i,o);case 12:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0,G=m[v+8]>>>0,re=m[v+9]>>>0,oe=m[v+10]>>>0,pe=m[v+11]>>>0;_[x++]=M>>>0&4095,_[x++]=M>>>12&4095,_[x++]=4095&(M>>>24|(15&C)<<8),_[x++]=C>>>4&4095,_[x++]=C>>>16&4095,_[x++]=4095&(C>>>28|(255&D)<<4),_[x++]=D>>>8&4095,_[x++]=D>>>20&4095,_[x++]=L>>>0&4095,_[x++]=L>>>12&4095,_[x++]=4095&(L>>>24|(15&N)<<8),_[x++]=N>>>4&4095,_[x++]=N>>>16&4095,_[x++]=4095&(N>>>28|(255&F)<<4),_[x++]=F>>>8&4095,_[x++]=F>>>20&4095,_[x++]=j>>>0&4095,_[x++]=j>>>12&4095,_[x++]=4095&(j>>>24|(15&U)<<8),_[x++]=U>>>4&4095,_[x++]=U>>>16&4095,_[x++]=4095&(U>>>28|(255&G)<<4),_[x++]=G>>>8&4095,_[x++]=G>>>20&4095,_[x++]=re>>>0&4095,_[x++]=re>>>12&4095,_[x++]=4095&(re>>>24|(15&oe)<<8),_[x++]=oe>>>4&4095,_[x++]=oe>>>16&4095,_[x++]=4095&(oe>>>28|(255&pe)<<4),_[x++]=pe>>>8&4095,_[x]=pe>>>20&4095})(r,e,i,o);case 16:return void(function(m,v,_,T){let x=T,M=m[v]>>>0,C=m[v+1]>>>0,D=m[v+2]>>>0,L=m[v+3]>>>0,N=m[v+4]>>>0,F=m[v+5]>>>0,j=m[v+6]>>>0,U=m[v+7]>>>0,G=m[v+8]>>>0,re=m[v+9]>>>0,oe=m[v+10]>>>0,pe=m[v+11]>>>0,ce=m[v+12]>>>0,_e=m[v+13]>>>0,ye=m[v+14]>>>0,fe=m[v+15]>>>0;_[x++]=M>>>0&65535,_[x++]=M>>>16&65535,_[x++]=C>>>0&65535,_[x++]=C>>>16&65535,_[x++]=D>>>0&65535,_[x++]=D>>>16&65535,_[x++]=L>>>0&65535,_[x++]=L>>>16&65535,_[x++]=N>>>0&65535,_[x++]=N>>>16&65535,_[x++]=F>>>0&65535,_[x++]=F>>>16&65535,_[x++]=j>>>0&65535,_[x++]=j>>>16&65535,_[x++]=U>>>0&65535,_[x++]=U>>>16&65535,_[x++]=G>>>0&65535,_[x++]=G>>>16&65535,_[x++]=re>>>0&65535,_[x++]=re>>>16&65535,_[x++]=oe>>>0&65535,_[x++]=oe>>>16&65535,_[x++]=pe>>>0&65535,_[x++]=pe>>>16&65535,_[x++]=ce>>>0&65535,_[x++]=ce>>>16&65535,_[x++]=_e>>>0&65535,_[x++]=_e>>>16&65535,_[x++]=ye>>>0&65535,_[x++]=ye>>>16&65535,_[x++]=fe>>>0&65535,_[x]=fe>>>16&65535})(r,e,i,o);case 32:for(let m=0;m<32;m=m+1|0)i[o+m|0]=0|r[e+m|0];return}let l=Fd[n]>>>0,h=e,p=0,g=r[h]>>>0;for(let m=0;m<32;m++)if(p+n<=32)i[o+m]=g>>>p&l,p+=n,p===32&&(p=0,h++,m!==31&&(g=r[h]>>>0));else{let v=32-p,_=g>>>p;h++,g=r[h]>>>0,i[o+m]=(_|(g&Fd[n-v]>>>0)<<v)&l,p=n-v}}function vr(r,e,i){let o=new Uint32Array(i),n=0,l=e.get();for(let h=0;h<o.length;h++){let p=r[l++],g=127&p;p<128||(p=r[l++],g|=(127&p)<<7,p<128||(p=r[l++],g|=(127&p)<<14,p<128||(p=r[l++],g|=(127&p)<<21,p<128||(p=r[l++],g|=(15&p)<<28)))),o[n++]=g}return e.set(l),o}function sl(r,e,i){let o=new BigUint64Array(i);for(let n=0;n<o.length;n++)o[n]=Z1(r,e);return o}function Z1(r,e){let i=0n,o=0,n=e.get();for(;n<r.length;){let l=r[n++];if(i|=BigInt(127&l)<<BigInt(o),!(128&l))break;if(o+=7,o>=64)throw new Error("Varint too long")}return e.set(n),i}function $1(r,e){let i,o;return o=r[e.get()],e.increment(),i=127&o,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<7,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<14,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<21,o<128?i:(o=r[e.get()],i|=(15&o)<<28,(function(n,l,h){let p,g;if(g=l[h.get()],h.increment(),p=(112&g)>>4,g<128||(g=l[h.get()],h.increment(),p|=(127&g)<<3,g<128)||(g=l[h.get()],h.increment(),p|=(127&g)<<10,g<128)||(g=l[h.get()],h.increment(),p|=(127&g)<<17,g<128)||(g=l[h.get()],h.increment(),p|=(127&g)<<24,g<128)||(g=l[h.get()],h.increment(),p|=(1&g)<<31,g<128))return 4294967296*p+(n>>>0);throw new Error("Expected varint not more than 10 bytes")})(i,r,e)))))}function Ht(r){return r>>>1^-(1&r)}function Ir(r){return r>>1n^-(1n&r)}function ll(r){return r%2==1?(r+1)/-2:r/2}function Nd(r,e,i){if(i===void 0){i=0;for(let l=0;l<e;l++)i+=r[l]}let o=new Uint32Array(i),n=0;for(let l=0;l<e;l++){let h=r[l];o.fill(r[l+e],n,n+h),n+=h}return o}function jd(r,e,i){if(i===void 0){i=0;for(let l=0;l<e;l++)i+=Number(r[l])}let o=new BigUint64Array(i),n=0;for(let l=0;l<e;l++){let h=Number(r[l]);o.fill(r[l+e],n,n+h),n+=h}return o}function Yf(r,e,i){let o=new Float64Array(i),n=0;for(let l=0;l<e;l++){let h=r[l];o.fill(r[l+e],n,n+h),n+=h}return o}function Kf(r){let e=new Int32Array(r.length);e[0]=Ht(r[0]);let i=r.length/4*4,o=1;if(i>=4)for(;o<i-4;o+=4){let n=r[o+1],l=r[o+2],h=r[o+3];e[o]=Ht(r[o])+e[o-1],e[o+1]=Ht(n)+e[o],e[o+2]=Ht(l)+e[o+1],e[o+3]=Ht(h)+e[o+2]}for(;o!==r.length;++o)e[o]=Ht(r[o])+e[o-1];return e}function Jf(r){let e=new BigInt64Array(r.length);e[0]=Ir(r[0]);let i=r.length/4*4,o=1;if(i>=4)for(;o<i-4;o+=4){let n=r[o+1],l=r[o+2],h=r[o+3];e[o]=Ir(r[o])+e[o-1],e[o+1]=Ir(n)+e[o],e[o+2]=Ir(l)+e[o+1],e[o+3]=Ir(h)+e[o+2]}for(;o!==e.length;++o)e[o]=Ir(r[o])+e[o-1];return e}function Vd(r){let e=r.length/4*4,i=1;if(e>=4)for(let o=r[0];i<e-4;i+=4)o=r[i]+=o,o=r[i+1]+=o,o=r[i+2]+=o,o=r[i+3]+=o;for(;i!==r.length;)r[i]+=r[i-1],++i}var rr,Sa,jn,Yr,ni,Vi,Qf,$o;function zr(r,e){let i=(function(o,n){let l=o[n.get()],h=Object.values(rr)[l>>4],p=null;switch(h){case rr.DATA:p={dictionaryType:Object.values(Sa)[15&l]};break;case rr.OFFSET:p={offsetType:Object.values(jn)[15&l]};break;case rr.LENGTH:p={lengthType:Object.values(Yr)[15&l]}}n.increment();let g=o[n.get()],m=Object.values(Mt)[g>>5],v=Object.values(Mt)[g>>2&7],_=Object.values(Zo)[3&g];n.increment();let T=vr(o,n,2),x=T[0];return{physicalStreamType:h,logicalStreamType:p,logicalLevelTechnique1:m,logicalLevelTechnique2:v,physicalLevelTechnique:_,numValues:x,byteLength:T[1],decompressedCount:x}})(r,e);return i.logicalLevelTechnique1===Mt.MORTON?(function(o,n,l){let h=vr(n,l,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:o.decompressedCount,numBits:h[0],coordinateShift:h[1]}})(i,r,e):Mt.RLE!==i.logicalLevelTechnique1&&Mt.RLE!==i.logicalLevelTechnique2||Zo.NONE===i.physicalLevelTechnique?i:(function(o,n,l){let h=vr(n,l,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:h[1],runs:h[0],numRleValues:h[1]}})(i,r,e)}(function(r){r.PRESENT="PRESENT",r.DATA="DATA",r.OFFSET="OFFSET",r.LENGTH="LENGTH"})(rr||(rr={})),(function(r){r.NONE="NONE",r.SINGLE="SINGLE",r.SHARED="SHARED",r.VERTEX="VERTEX",r.MORTON="MORTON",r.FSST="FSST"})(Sa||(Sa={})),(function(r){r.VERTEX="VERTEX",r.INDEX="INDEX",r.STRING="STRING",r.KEY="KEY"})(jn||(jn={})),(function(r){r.VAR_BINARY="VAR_BINARY",r.GEOMETRIES="GEOMETRIES",r.PARTS="PARTS",r.RINGS="RINGS",r.TRIANGLES="TRIANGLES",r.SYMBOL="SYMBOL",r.DICTIONARY="DICTIONARY"})(Yr||(Yr={})),(function(r){r[r.FLAT=0]="FLAT",r[r.CONST=1]="CONST",r[r.SEQUENCE=2]="SEQUENCE",r[r.DICTIONARY=3]="DICTIONARY",r[r.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ni||(ni={}));class Pa{constructor(e,i){this.values=e,this._size=i}get(e){let i=Math.floor(e/8);return(this.values[i]>>e%8&1)==1}set(e,i){let o=Math.floor(e/8);this.values[o]=this.values[o]|(i?1:0)<<e%8}getInt(e){let i=Math.floor(e/8);return this.values[i]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function cl(r,e,i){if(!e)return r;let o=e.size(),n=new r.constructor(o),l=0;for(let h=0;h<o;h++)n[h]=e.get(h)?r[l++]:i;return n}function Ud(r,e,i,o,n){return(function(l,h,p,g){let m;switch(h.logicalLevelTechnique1){case Mt.DELTA:if(h.logicalLevelTechnique2===Mt.RLE){let v=h;if(!g)return(function(_,T,x){let M=new Int32Array(x),C=0,D=0;for(let L=0;L<T;L++){let N=_[L],F=Ht(_[L+T]);for(let j=0;j<N;j++)D+=F,M[C++]=D}return M})(l,v.runs,v.numRleValues);m=Kf(l=Nd(l,v.runs,v.numRleValues))}else m=Kf(l);break;case Mt.RLE:m=(function(v,_,T){if(T===void 0){T=0;for(let C=0;C<_;C++)T+=v[C]}let x=new Int32Array(T),M=0;for(let C=0;C<_;C++){let D=v[C],L=v[C+_];L=Ht(L),x.fill(L,M,M+D),M+=D}return x})(l,h.runs,h.numRleValues);break;case Mt.MORTON:Vd(l),m=new Int32Array(l);break;case Mt.COMPONENTWISE_DELTA:m=(function(v){if(v.length<2)return new Int32Array(v);let _=new Int32Array(v.length);_[0]=Ht(v[0]),_[1]=Ht(v[1]);let T=v.length/4*4,x=2;if(T>=4)for(;x<T-4;x+=4){let M=v[x+1],C=v[x+2],D=v[x+3];_[x]=Ht(v[x])+_[x-2],_[x+1]=Ht(M)+_[x-1],_[x+2]=Ht(C)+_[x],_[x+3]=Ht(D)+_[x+1]}for(;x!==v.length;x+=2)_[x]=Ht(v[x])+_[x-2],_[x+1]=Ht(v[x+1])+_[x-1];return _})(l);break;case Mt.NONE:m=(function(v){let _=new Int32Array(v.length);for(let T=0;T<v.length;T++)_[T]=Ht(v[T]);return _})(l);break;default:throw new Error(`The specified Logical level technique is not supported: ${h.logicalLevelTechnique1}`)}return g?cl(m,g,0):m})(ul(r,e,i),i,0,n)}function Kr(r,e,i,o,n){return(function(l,h,p,g){let m;switch(h.logicalLevelTechnique1){case Mt.DELTA:m=(function(v){let _=new Uint32Array(v.length);_[0]=Ht(v[0])>>>0;for(let T=1;T<v.length;T++)_[T]=_[T-1]+Ht(v[T])>>>0;return _})(h.logicalLevelTechnique2===Mt.RLE?Nd(l,h.runs,h.numRleValues):l);break;case Mt.RLE:m=Nd(l,h.runs,h.numRleValues);break;case Mt.MORTON:Vd(l),m=l;break;case Mt.COMPONENTWISE_DELTA:m=(function(v){if(v.length<2)return new Uint32Array(v);let _=new Uint32Array(v.length);_[0]=Ht(v[0])>>>0,_[1]=Ht(v[1])>>>0;for(let T=2;T<v.length;T+=2)_[T]=_[T-2]+Ht(v[T])>>>0,_[T+1]=_[T-1]+Ht(v[T+1])>>>0;return _})(l);break;case Mt.NONE:m=l;break;default:throw new Error(`The specified Logical level technique is not supported: ${h.logicalLevelTechnique1}`)}return g?cl(m,g,0):m})(ul(r,e,i),i,0,n)}function Wo(r,e,i){return(function(o,n){if(n.logicalLevelTechnique1===Mt.DELTA&&n.logicalLevelTechnique2===Mt.NONE)return(function(l){let h=new Int32Array(l.length+1);h[0]=0,h[1]=Ht(l[0]);let p=h[1];for(let g=2;g!==h.length;++g)p+=Ht(l[g-1]),h[g]=h[g-1]+p;return new Uint32Array(h)})(o);if(n.logicalLevelTechnique1===Mt.RLE&&n.logicalLevelTechnique2===Mt.NONE)return(function(l,h,p){let g=new Uint32Array(p+1);g[0]=0;let m=1,v=g[0];for(let _=0;_<h;_++){let T=l[_],x=l[_+h];for(let M=m;M<m+T;M++)g[M]=x+v,v=g[M];m+=T}return g})(o,n.runs,n.numRleValues);if(n.logicalLevelTechnique1===Mt.NONE&&n.logicalLevelTechnique2===Mt.NONE){(function(h){let p=0;for(let g=0;g<h.length;g++)h[g]+=p,p=h[g]})(o);let l=new Uint32Array(n.numValues+1);return l[0]=0,l.set(o,1),l}if(n.logicalLevelTechnique1===Mt.DELTA&&n.logicalLevelTechnique2===Mt.RLE){let l=(function(h,p,g){let m=new Int32Array(g+1);m[0]=0;let v=1,_=m[0];for(let T=0;T<p;T++){let x=h[T],M=h[T+p];M=Ht(M);for(let C=v;C<v+x;C++)m[C]=M+_,_=m[C];v+=x}return m})(o,n.runs,n.numRleValues);return Vd(l),new Uint32Array(l)}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(ul(r,e,i),i)}function ul(r,e,i){let o=i.physicalLevelTechnique;switch(o){case Zo.FAST_PFOR:return(function(n,l,h,p){return(function(g,m,v,_,T){let x=_.get();if(3&v)throw new Error(`FastPFOR: invalid encodedByteLength=${v} at offset=${x} (encodedBytes.length=${g.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let M=v>>>2,C=(function(L,N){if(N<=L.encodedWords.length)return L.encodedWords;let F=new Uint32Array(Math.max(16,2*N));return L.encodedWords=F,F})(T,M);(function(L,N,F,j){if(N<0||F<0||N+F>L.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${N}, byteLength=${F}, bytes.length=${L.length})`);let U=Math.floor(F/4),G=F%4!=0,re=G?U+1:U;if(j.length<re)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${j.length} < ${re}`);if(U>0){let oe=L.byteOffset+N;if(3&oe)for(let pe=0;pe<U;pe++){let ce=N+4*pe;j[pe]=L[ce]<<24|L[ce+1]<<16|L[ce+2]<<8|L[ce+3]}else{let pe=new Uint32Array(L.buffer,oe,U);for(let ce=0;ce<U;ce++)j[ce]=0|O1(pe[ce])}}if(G){let oe=N+4*U,pe=F-4*U,ce=0;for(let _e=0;_e<pe;_e++)ce|=L[oe+_e]<<24-8*_e;j[U]=0|ce}})(g,x,v,C);let D=(function(L,N,F){let j=0,U=0,G=new Uint32Array(N),re=F??Xf();if(L.length>0){let oe=0|L[j];if(j=j+1|0,255&oe)throw new Error(`FastPFOR decode: invalid alignedLength=${oe} (expected multiple of 256)`);if(U+oe>G.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${U}, alignedLength=${oe}, out.length=${G.length})`);j=(function(pe,ce,_e,ye,fe,ue){let Ie=ye+Bd(fe,oo),Fe=ye,De=_e;for(;Fe!==Ie;){let Ae=Math.min(Od,Ie-Fe);De=q1(pe,ce,De,Fe,Ae,ue),Fe=Fe+Ae|0}return De})(L,G,j,U,oe,re),U=U+oe|0}return(function(oe,pe,ce,_e,ye,fe){if(fe===0)return pe;let ue=0,Ie=pe,Fe=pe+ce,De=ye,Ae=ye,ct=ye+fe,Ot=0,Ut=0;for(;Ie<Fe&&Ae<ct;){let $t=oe[Ie]>>>ue&255;if(ue+=8,Ie+=ue>>>5,ue&=31,Ot|=(127&$t)<<Ut,128&$t)_e[Ae++]=0|Ot,Ot=0,Ut=0;else if(Ut+=7,Ut>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${Ut}, partial=${Ot}, decoded=${Ae-De}/${fe}, inPos=${Ie}, inEnd=${Fe})`)}if(Ae!==ct)throw new Error(`FastPFOR VByte: truncated stream (decoded=${Ae-De}, expected=${fe}, consumedWords=${Ie-pe}/${ce}, vbyteStart=${pe}, vbyteEnd=${Fe})`)})(L,j,L.length-j|0,G,U,N-U|0),G})(C.subarray(0,M),m,T.decoderWorkspace);return _.add(v),D})(n,l,h,p,(function(g=16){if(g<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${g}`);let m=Math.max(16,0|g);return{encodedWords:new Uint32Array(m),decoderWorkspace:Xf()}})(h>>>2))})(r,i.numValues,i.byteLength,e);case Zo.VARINT:return vr(r,e,i.numValues);case Zo.NONE:{let n=e.get();e.add(i.byteLength);let l=r.subarray(n,e.get());return new Uint32Array(l)}default:throw new Error(`Specified physicalLevelTechnique ${o} is not supported (yet).`)}}function qd(r,e,i){let o=ul(r,e,i);return o.length===1?o[0]:(function(n){return n[1]})(o)}function em(r,e,i){return(function(o){if(o.length===2){let n=Ht(o[1]);return[n,n]}return[Ht(o[2]),Ht(o[3])]})(ul(r,e,i))}function tm(r,e,i){return(function(o){if(o.length===2){let n=Ir(o[1]);return[n,n]}return[Ir(o[2]),Ir(o[3])]})(sl(r,e,i.numValues))}function im(r,e,i,o){return(function(n,l,h){let p;switch(l.logicalLevelTechnique1){case Mt.DELTA:p=(function(g){let m=new BigUint64Array(g.length);m[0]=BigInt.asUintN(64,Ir(g[0]));for(let v=1;v<g.length;v++)m[v]=BigInt.asUintN(64,m[v-1]+Ir(g[v]));return m})(l.logicalLevelTechnique2===Mt.RLE?jd(n,l.runs,l.numRleValues):n);break;case Mt.RLE:p=jd(n,l.runs,l.numRleValues);break;case Mt.NONE:p=n;break;default:throw new Error(`The specified Logical level technique is not supported: ${l.logicalLevelTechnique1}`)}return h?cl(p,h,0n):p})(sl(r,e,i.numValues),i,o)}function rm(r,e,i){let o=sl(r,e,i.numValues);return o.length===1?o[0]:(function(n){return n[1]})(o)}function eh(r,e,i,o,n="int32"){let l=r.logicalLevelTechnique1;if(l===Mt.RLE)return r.runs===1?ni.CONST:ni.FLAT;if(l!==Mt.DELTA||r.logicalLevelTechnique2!==Mt.RLE)return r.numValues===1?ni.CONST:ni.FLAT;let h=e instanceof Pa?e.size():e;if(r.numRleValues!==h)return ni.FLAT;if(r.runs===1)return ni.SEQUENCE;if(r.runs!==2)return r.numValues===1?ni.CONST:ni.FLAT;let p=o.get();if(r.physicalLevelTechnique===Zo.VARINT)return(function(v,_,T){let x=new Hf(_.get());if(T==="int64"){let C=sl(v,x,4);return C[2]===2n&&C[3]===2n}let M=vr(v,x,4);return M[2]===2&&M[3]===2})(i,o,n)?ni.SEQUENCE:r.numValues===1?ni.CONST:ni.FLAT;let g=o.get(),m=new Int32Array(i.buffer,i.byteOffset+g,4);return o.set(p),m[2]===2&&m[3]===2?ni.SEQUENCE:r.numValues===1?ni.CONST:ni.FLAT}class am extends Qu{getValueFromBuffer(e){return this.dataBuffer[e]}}class om extends Wf{constructor(e,i,o,n){super(e,BigInt64Array.of(i),o,n)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}function Gd(r,e,i){return{x:nm(r,e)-i,y:nm(r>>1,e)-i}}function nm(r,e){let i=0;for(let o=0;o<e;o++)i|=(r&1<<2*o)>>o;return i}function hl(r,e,i,o,n,l,h){return r===$o.MORTON?(function(p,g,m,v,_,T){let x=new Array(_?v+1:v);for(let M=0;M<v;M++){let C=Gd(p[g[m+M]],T.numBits,T.coordinateShift);x[M]=new se(C.x,C.y)}return _&&(x[x.length-1]=x[0]),x})(e,i,o,n,l,h):(function(p,g,m,v,_){let T=new Array(_?v+1:v);for(let x=0;x<2*v;x+=2){let M=2*g[m+x/2];T[x/2]=new se(p[M],p[M+1])}return _&&(T[T.length-1]=T[0]),T})(e,i,o,n,l)}function dl(r,e,i,o){let n=new Array(o?i+1:i);for(let l=0;l<2*i;l+=2)n[l/2]=new se(r[e+l],r[e+l+1]);return o&&(n[n.length-1]=n[0]),n}(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON",r[r.MULTIPOINT=3]="MULTIPOINT",r[r.MULTILINESTRING=4]="MULTILINESTRING",r[r.MULTIPOLYGON=5]="MULTIPOLYGON"})(Vi||(Vi={})),(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON"})(Qf||(Qf={})),(function(r){r[r.MORTON=0]="MORTON",r[r.VEC_2=1]="VEC_2",r[r.VEC_3=2]="VEC_3"})($o||($o={}));class sm{constructor(e,i,o,n,l){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=o,this._vertexBuffer=n,this._mortonSettings=l}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let o=Gd(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[o.x,o.y]}let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return(function(e){let i=new Array(e.numGeometries),o=1,n=1,l=1,h=0,p=0,g=0,m=e.mortonSettings,v=e.topologyVector,_=v.geometryOffsets,T=v.partOffsets,x=v.ringOffsets,M=e.vertexOffsets,C=!M||M.length===0,D=e.containsPolygonGeometry(),L=e.vertexBuffer;for(let N=0;N<e.numGeometries;N++)switch(e.geometryType(N)){case Vi.POINT:{let F,j;if(C)F=L[p++],j=L[p++];else if(e.vertexBufferType===$o.MORTON){let U=Gd(L[M[g++]],m.numBits,m.coordinateShift);F=U.x,j=U.y}else{let U=2*M[g++];F=L[U],j=L[U+1]}i[h++]=[[new se(F,j)]],_&&l++,T&&o++,x&&n++}break;case Vi.MULTIPOINT:{let F=_[l]-_[l-1];l++;let j=new Array(F);if(C)for(let U=0;U<F;U++){let G=L[p++],re=L[p++];j[U]=new se(G,re)}else for(let U=0;U<F;U++){let G=2*M[g++];j[U]=new se(L[G],L[G+1])}i[h++]=j.map((U=>[U])),o+=F,n+=F}break;case Vi.LINESTRING:{let F,j;D?(F=x[n]-x[n-1],n++):F=T[o]-T[o-1],o++,C?(j=dl(L,p,F,!1),p+=2*F):(j=hl(e.vertexBufferType,L,M,g,F,!1,m),g+=F),i[h++]=[j],_&&l++}break;case Vi.POLYGON:{let F=T[o]-T[o-1];o++;let j=new Array(F-1),U,G=x[n]-x[n-1];if(n++,C){U=dl(L,p,G,!0),p+=2*G;for(let re=0;re<j.length;re++)G=x[n]-x[n-1],n++,j[re]=dl(L,p,G,!0),p+=2*G}else{U=hl(e.vertexBufferType,L,M,g,G,!0,m),g+=G;for(let re=0;re<j.length;re++)G=x[n]-x[n-1],n++,j[re]=hl(e.vertexBufferType,L,M,g,G,!0,m),g+=G}i[h++]=[U].concat(j),_&&l++}break;case Vi.MULTILINESTRING:{let F=_[l]-_[l-1];l++;let j=new Array(F);for(let U=0;U<F;U++){let G;if(D?(G=x[n]-x[n-1],n++):G=T[o]-T[o-1],o++,C)j[U]=dl(L,p,G,!1),p+=2*G;else{let re=hl(e.vertexBufferType,L,M,g,G,!1,m);j[U]=re,g+=G}}i[h++]=j}break;case Vi.MULTIPOLYGON:{let F=_[l]-_[l-1];l++;let j=new Array(F);for(let U=0;U<F;U++){let G=T[o]-T[o-1],re;o++;let oe=new Array(G-1),pe=x[n]-x[n-1];n++,C?(re=dl(L,p,pe,!0),p+=2*pe):(re=hl(e.vertexBufferType,L,M,g,pe,!0,m),g+=pe);for(let ce=0;ce<oe.length;ce++){let _e=x[n]-x[n-1];n++,C?(oe[ce]=dl(L,p,_e,!0),p+=2*_e):(oe[ce]=hl(e.vertexBufferType,L,M,g,_e,!0,m),g+=_e)}j[U]=[re].concat(oe)}i[h++]=j.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return i})(this)}get mortonSettings(){return this._mortonSettings}}class lm extends sm{constructor(e,i,o,n,l,h,p){super(o,n,l,h,p),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Vi.POLYGON||this._geometryType===Vi.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class cm extends sm{constructor(e,i,o,n,l,h){super(e,o,n,l,h),this._geometryTypes=i}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)===Vi.POLYGON||this.geometryType(e)===Vi.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class um{constructor(e,i,o,n){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=o,this._topologyVector=n}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");let e=new Array(this.numGeometries),i=this._topologyVector,o=i.partOffsets,n=i.ringOffsets,l=i.geometryOffsets,h=0,p=1,g=1,m=1;for(let v=0;v<this.numGeometries;v++)switch(this.geometryType(v)){case Vi.POLYGON:{let _=o[p]-o[p-1];p++;let T=[];for(let x=0;x<_;x++){let M=n[g]-n[g-1];g++;let C=[];for(let D=0;D<M;D++){let L=this._vertexBuffer[h++],N=this._vertexBuffer[h++];C.push(new se(L,N))}C.length>0&&C.push(C[0]),T.push(C)}e[v]=T,l&&m++}break;case Vi.MULTIPOLYGON:{let _=l[m]-l[m-1];m++;let T=[];for(let x=0;x<_;x++){let M=o[p]-o[p-1];p++;for(let C=0;C<M;C++){let D=n[g]-n[g-1];g++;let L=[];for(let N=0;N<D;N++){let F=this._vertexBuffer[h++],j=this._vertexBuffer[h++];L.push(new se(F,j))}L.length>0&&L.push(L[0]),T.push(L)}}e[v]=T}}return e}[Symbol.iterator](){return null}}function hm(r,e,i,o,n,l){return new W1(r,e,i,o,n,l)}class W1 extends um{constructor(e,i,o,n,l,h){super(o,n,l,h),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function dm(r,e,i,o,n){return new H1(r,e,i,o,n)}class H1 extends um{constructor(e,i,o,n,l){super(i,o,n,l),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function X1(r,e,i,o,n){let l=zr(r,i),h,p,g,m;if(eh(l,o,r,i)===ni.CONST){let N=qd(r,i,l),F,j,U,G;for(let re=0;re<e-1;re++){let oe=zr(r,i);switch(oe.physicalStreamType){case rr.LENGTH:switch(oe.logicalStreamType.lengthType){case Yr.GEOMETRIES:F=Wo(r,i,oe);break;case Yr.PARTS:j=Wo(r,i,oe);break;case Yr.RINGS:U=Wo(r,i,oe);break;case Yr.TRIANGLES:G=Wo(r,i,oe)}break;case rr.OFFSET:switch(oe.logicalStreamType.offsetType){case jn.VERTEX:h=Kr(r,i,oe);break;case jn.INDEX:m=Kr(r,i,oe)}break;case rr.DATA:Sa.VERTEX===oe.logicalStreamType.dictionaryType?p=Ud(r,i,oe):(g={numBits:oe.numBits,coordinateShift:oe.coordinateShift},p=Kr(r,i,oe))}}return m?F!==void 0||j!==void 0?hm(o,N,G,m,p,{geometryOffsets:F,partOffsets:j,ringOffsets:U}):hm(o,N,G,m,p):g===void 0?(function(re,oe,pe,ce,_e){return new lm(re,oe,$o.VEC_2,pe,ce,_e)})(o,N,{geometryOffsets:F,partOffsets:j,ringOffsets:U},h,p):(function(re,oe,pe,ce,_e,ye){return new lm(re,oe,$o.MORTON,pe,ce,_e,ye)})(o,N,{geometryOffsets:F,partOffsets:j,ringOffsets:U},h,p,g)}let v=Kr(r,i,l),_,T,x,M,C,D,L;for(let N=0;N<e-1;N++){let F=zr(r,i);switch(F.physicalStreamType){case rr.LENGTH:switch(F.logicalStreamType.lengthType){case Yr.GEOMETRIES:_=Kr(r,i,F);break;case Yr.PARTS:T=Kr(r,i,F);break;case Yr.RINGS:x=Kr(r,i,F);break;case Yr.TRIANGLES:M=Wo(r,i,F)}break;case rr.OFFSET:switch(F.logicalStreamType.offsetType){case jn.VERTEX:h=Kr(r,i,F);break;case jn.INDEX:m=Kr(r,i,F)}break;case rr.DATA:Sa.VERTEX===F.logicalStreamType.dictionaryType?p=Ud(r,i,F):(g={numBits:F.numBits,coordinateShift:F.coordinateShift},p=Kr(r,i,F))}}return _?(C=Zd(v,_,2),T&&x?(D=pm(v,C,T,!1),L=(function(N,F,j,U){let G=new Uint32Array(j[j.length-1]+1),re=0;G[0]=re;let oe=1,pe=1,ce=0;for(let _e=0;_e<N.length;_e++){let ye=N[_e],fe=F[_e+1]-F[_e];if(ye!==0&&ye!==3)for(let ue=0;ue<fe;ue++){let Ie=j[oe]-j[oe-1];oe++;for(let Fe=0;Fe<Ie;Fe++)re=G[pe++]=re+U[ce++]}else for(let ue=0;ue<fe;ue++)G[pe++]=++re,oe++}return G})(v,C,D,x)):T&&(D=(function(N,F,j){let U=new Uint32Array(F[F.length-1]+1),G=0;U[0]=G;let re=1,oe=0;for(let pe=0;pe<N.length;pe++){let ce=N[pe],_e=F[pe+1]-F[pe];if(ce===4||ce===1)for(let ye=0;ye<_e;ye++)G=U[re++]=G+j[oe++];else for(let ye=0;ye<_e;ye++)U[re++]=++G}return U})(v,C,T))):T&&x?(D=Zd(v,T,1),L=pm(v,D,x,!0)):T&&(D=Zd(v,T,0)),m&&!D?dm(v,M,m,p):m?dm(v,M,m,p,{geometryOffsets:C,partOffsets:D,ringOffsets:L}):g===void 0?(function(N,F,j,U){return new cm($o.VEC_2,N,F,j,U)})(v,{geometryOffsets:C,partOffsets:D,ringOffsets:L},h,p):(function(N,F,j,U,G){return new cm($o.MORTON,N,F,j,U,G)})(v,{geometryOffsets:C,partOffsets:D,ringOffsets:L},h,p,g)}function Zd(r,e,i){let o=new Uint32Array(r.length+1),n=0;o[0]=n;let l=0;for(let h=0;h<r.length;h++)n=o[h+1]=n+(r[h]>i?e[l++]:1);return o}function pm(r,e,i,o){let n=new Uint32Array(e[e.length-1]+1),l=0;n[0]=l;let h=1,p=0;for(let g=0;g<r.length;g++){let m=r[g],v=e[g+1]-e[g];if(m===5||m===2||o&&(m===4||m===1))for(let _=0;_<v;_++)l=n[h++]=l+i[p++];else for(let _=0;_<v;_++)n[h++]=++l}return n}class Y1 extends nl{constructor(e,i,o){super(e,i.getBuffer(),o),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class K1 extends Qu{getValueFromBuffer(e){return this.dataBuffer[e]}}class fm extends nl{constructor(e,i,o,n){super(e,n?BigInt64Array.of(i):BigUint64Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}function Rc(r,e,i,o,n){let l=(function(h,p,g,m){let v=new Uint8Array(p),_=0,T=m.get()+g;for(;_<p&&!(m.get()>=T);){let x=h[m.increment()];if(x<=127){let M=x+3,C=h[m.increment()],D=Math.min(_+M,p);v.fill(C,_,D),_=D}else{let M=256-x;for(let C=0;C<M&&_<p;C++)v[_++]=h[m.increment()]}}return m.set(T),v})(r,Math.ceil(e/8),i,o);return n?(function(h,p,g){if(!g)return h;let m=g.size(),v=new Pa(h,p),_=new Pa(new Uint8Array(Math.ceil(m/8)),m),T=0;for(let x=0;x<m;x++){let M=!!g.get(x)&&v.get(T++);_.set(x,M)}return _.getBuffer()})(l,e,n):l}let J1=new TextDecoder;function $d(r,e,i){return i-e>=12?J1.decode(r.subarray(e,i)):(function(o,n,l){let h="",p=n;for(;p<l;){let g=o[p],m,v,_,T=null,x=g>239?4:g>223?3:g>191?2:1;if(p+x>l)break;x===1?g<128&&(T=g):x===2?(m=o[p+1],(192&m)==128&&(T=(31&g)<<6|63&m,T<=127&&(T=null))):x===3?(m=o[p+1],v=o[p+2],(192&m)==128&&(192&v)==128&&(T=(15&g)<<12|(63&m)<<6|63&v,(T<=2047||T>=55296&&T<=57343)&&(T=null))):x===4&&(m=o[p+1],v=o[p+2],_=o[p+3],(192&m)==128&&(192&v)==128&&(192&_)==128&&(T=(15&g)<<18|(63&m)<<12|(63&v)<<6|63&_,(T<=65535||T>=1114112)&&(T=null))),T===null?(T=65533,x=1):T>65535&&(T-=65536,h+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),h+=String.fromCharCode(T),p+=x}return h})(r,e,i)}class Wd extends nl{constructor(e,i,o,n){super(e,o,n),this.offsetBuffer=i}}class mm extends Wd{constructor(e,i,o,n){super(e,i,o,n??i.length-1)}getValueFromBuffer(e){return $d(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class pl extends Wd{constructor(e,i,o,n,l){super(e,o,n,l??i.length),this.indexBuffer=i,this.indexBuffer=i}getValueFromBuffer(e){let i=this.indexBuffer[e];return $d(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class gm extends Wd{constructor(e,i,o,n,l,h,p){super(e,o,n,p),this.indexBuffer=i,this.symbolOffsetBuffer=l,this.symbolTableBuffer=h}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=(function(o,n,l){let h=[],p=new Array(n.length).fill(0);for(let g=1;g<n.length;g++)p[g]=p[g-1]+n[g-1];for(let g=0;g<l.length;g++)if(l[g]===255)h.push(l[++g]);else{let m=n[l[g]],v=p[l[g]];for(let _=0;_<m;_++)h.push(o[v+_])}return new Uint8Array(h)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let i=this.indexBuffer[e];return $d(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){let i=new Uint32Array(e.length-1),o=e[0];for(let n=1;n<e.length;n++){let l=e[n];i[n-1]=l-o,o=l}return i}}function Q1(r,e,i,o,n,l){return i.type==="scalarType"?(function(h,p,g,m,v,_){let T=null;if(h===0)return null;if(_.nullable){let M=zr(p,g),C=M.numValues,D=g.get(),L=Rc(p,C,M.byteLength,g);g.set(D+M.byteLength),T=new Pa(L,M.numValues)}let x=T??m;switch(v.physicalType){case 4:case 3:return(function(M,C,D,L,N){let F=zr(M,C),j=eh(F,N,M,C),U=L.physicalType===3;if(j===ni.FLAT){let re=Fc(N)?N:void 0,oe=U?Ud(M,C,F,0,re):Kr(M,C,F,0,re);return new Ad(D.name,oe,N)}if(j===ni.SEQUENCE){let re=em(M,C,F);return new Dd(D.name,re[0],re[1],F.numRleValues)}let G=U?(function(re,oe,pe){let ce=ul(re,oe,pe);return ce.length===1?Ht(ce[0]):(function(_e){return Ht(_e[1])})(ce)})(M,C,F):qd(M,C,F);return new Ld(D.name,G,N,U)})(p,g,_,v,x);case 9:return(function(M,C,D,L,N){let F=null,j=null,U=null,G=null,re=null,oe=N??null,pe=null,ce=null;for(let _e=0;_e<L;_e++){let ye=zr(C,D);switch(ye.physicalStreamType){case rr.PRESENT:{let fe=Rc(C,ye.numValues,ye.byteLength,D),ue=new Pa(fe,ye.numValues);oe=N??ue;break}case rr.OFFSET:j=Kr(C,D,ye,0,oe);break;case rr.LENGTH:{let fe=Wo(C,D,ye);Yr.DICTIONARY===ye.logicalStreamType.lengthType?F=fe:Yr.SYMBOL===ye.logicalStreamType.lengthType?G=fe:pe=fe;break}case rr.DATA:{let fe=C.subarray(D.get(),D.get()+ye.byteLength);D.add(ye.byteLength);let ue=ye.logicalStreamType.dictionaryType;Sa.FSST===ue?re=fe:Sa.SINGLE===ue||Sa.SHARED===ue?U=fe:Sa.NONE===ue&&(ce=fe);break}}}return(function(_e,ye,fe,ue,Ie,Fe,De){return ye?new gm(_e,fe,ue,Ie,Fe,ye,De):null})(M,re,j,F,U,G,oe)??(function(_e,ye,fe,ue,Ie){return ye?Ie?new pl(_e,fe,ue,ye,Ie):new pl(_e,fe,ue,ye):null})(M,U,j,F,oe)??(function(_e,ye,fe,ue,Ie){if(!ye||!fe)return null;if(ue)return Ie?new pl(_e,ue,ye,fe,Ie):new pl(_e,ue,ye,fe);if(Ie&&Ie.size()!==ye.length-1){let Fe=new Uint32Array(Ie.size()),De=0;for(let Ae=0;Ae<Ie.size();Ae++)Fe[Ae]=Ie.get(Ae)?De++:0;return new pl(_e,Fe,ye,fe,Ie)}return Ie?new mm(_e,ye,fe,Ie):new mm(_e,ye,fe)})(M,pe,ce,j,oe)})(_.name,p,g,_.nullable?h-1:h,T);case 0:return(function(M,C,D,L,N){let F=zr(M,C),j=F.numValues,U=C.get(),G=Fc(N)?N:void 0,re=Rc(M,j,F.byteLength,C,G);C.set(U+F.byteLength);let oe=new Pa(re,j);return new Y1(D.name,oe,N)})(p,g,_,0,x);case 6:case 5:return(function(M,C,D,L,N){let F=zr(M,C),j=eh(F,L,M,C,"int64"),U=N.physicalType===5;if(j===ni.FLAT){let re=Fc(L)?L:void 0,oe=U?(function(pe,ce,_e,ye){return(function(fe,ue,Ie){let Fe;switch(ue.logicalLevelTechnique1){case Mt.DELTA:if(ue.logicalLevelTechnique2===Mt.RLE){let De=ue;if(!Ie)return(function(Ae,ct,Ot){let Ut=new BigInt64Array(Ot),$t=0,or=0n;for(let gi=0;gi<ct;gi++){let Ri=Number(Ae[gi]),Ui=Ir(Ae[gi+ct]);for(let si=0;si<Ri;si++)or+=Ui,Ut[$t++]=or}return Ut})(fe,De.runs,De.numRleValues);Fe=Jf(fe=jd(fe,De.runs,De.numRleValues))}else Fe=Jf(fe);break;case Mt.RLE:Fe=(function(De,Ae,ct){if(ct===void 0){ct=0;for(let $t=0;$t<Ae;$t++)ct+=Number(De[$t])}let Ot=new BigInt64Array(ct),Ut=0;for(let $t=0;$t<Ae;$t++){let or=Number(De[$t]),gi=De[$t+Ae];gi=Ir(gi),Ot.fill(gi,Ut,Ut+or),Ut+=or}return Ot})(fe,ue.runs,ue.numRleValues);break;case Mt.NONE:Fe=(function(De){let Ae=new BigInt64Array(De.length);for(let ct=0;ct<De.length;ct++)Ae[ct]=Ir(De[ct]);return Ae})(fe);break;default:throw new Error(`The specified Logical level technique is not supported: ${ue.logicalLevelTechnique1}`)}return Ie?cl(Fe,Ie,0n):Fe})(sl(pe,ce,_e.numValues),_e,ye)})(M,C,F,re):im(M,C,F,re);return new am(D.name,oe,L)}if(j===ni.SEQUENCE){let re=tm(M,C,F);return new om(D.name,re[0],re[1],F.numRleValues)}let G=U?(function(re,oe,pe){let ce=sl(re,oe,pe.numValues);return ce.length===1?Ir(ce[0]):(function(_e){return Ir(_e[1])})(ce)})(M,C,F):rm(M,C,F);return new fm(D.name,G,L,U)})(p,g,_,x,v);case 7:return(function(M,C,D,L){let N=zr(M,C),F=Fc(L)?L:void 0,j=(function(U,G,re,oe){let pe=G.get(),ce=pe+re*Float32Array.BYTES_PER_ELEMENT,_e=new Uint8Array(U.subarray(pe,ce)).buffer,ye=new Float32Array(_e);return G.set(ce),oe?cl(ye,oe,0):ye})(M,C,N.numValues,F);return new K1(D.name,j,L)})(p,g,_,x);case 8:return(function(M,C,D,L){let N=zr(M,C),F=Fc(L)?L:void 0,j=(function(U,G,re,oe){let pe=G.get(),ce=pe+re*Float64Array.BYTES_PER_ELEMENT,_e=new Uint8Array(U.subarray(pe,ce)).buffer,ye=new Float64Array(_e);return G.set(ce),oe?cl(ye,oe,0):ye})(M,C,N.numValues,F);return new kd(D.name,j,L)})(p,g,_,x);default:throw new Error(`The specified data type for the field is currently not supported: ${v}`)}})(o,r,e,n,i.scalarType,i):o===0?null:(function(h,p,g,m){let v=null,_=null,T=null,x=null,M=!1;for(;!M;){let N=zr(h,p);switch(N.physicalStreamType){case rr.LENGTH:Yr.DICTIONARY===N.logicalStreamType.lengthType?v=Wo(h,p,N):T=Wo(h,p,N);break;case rr.DATA:Sa.SINGLE===N.logicalStreamType.dictionaryType||Sa.SHARED===N.logicalStreamType.dictionaryType?(_=h.subarray(p.get(),p.get()+N.byteLength),M=!0):x=h.subarray(p.get(),p.get()+N.byteLength),p.add(N.byteLength)}}let C=g.complexType.children,D=[],L=0;for(let N of C){let F=vr(h,p,1)[0];if(F===0)continue;let j=N.name?`${g.name}${N.name}`:g.name;if(F!==2||N.type!=="scalarField"||N.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");let U=zr(h,p),G=Rc(h,U.numValues,U.byteLength,p),re=zr(h,p),oe=Kr(h,p,re,0,re.decompressedCount!==m?new Pa(G,U.numValues):void 0);D[L++]=x?new gm(j,oe,v,_,T,x,new Pa(G,U.numValues)):new pl(j,oe,v,_,new Pa(G,U.numValues))}return D})(r,e,i,n)}function Fc(r){return r instanceof Pa}function _m(r){switch(r){case 0:case 1:case 2:case 3:{let e={};e.nullable=!!(1&r),e.columnScope=0;let i={type:"logicalType",logicalType:0};return i.longID=!!(2&r),e.scalarType=i,e.type="scalarType",e}case 4:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:0};return e.type="complexType",e.complexType=i,e}case 30:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:1};return e.type="complexType",e.complexType=i,e}default:return(function(e){let i;switch(e){case 10:case 11:i=0;break;case 12:case 13:i=1;break;case 14:case 15:i=2;break;case 16:case 17:i=3;break;case 18:case 19:i=4;break;case 20:case 21:i=5;break;case 22:case 23:i=6;break;case 24:case 25:i=7;break;case 26:case 27:i=8;break;case 28:case 29:i=9;break;default:return null}let o={};o.nullable=!!(1&e),o.columnScope=0;let n={type:"physicalType"};return n.physicalType=i,o.type="scalarType",o.scalarType=n,o})(r)}}function ym(r){return r>=10}function vm(r){return r===30}function e_(r){if(r.type==="scalarType"){let e=r.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}if(e.type==="logicalType")return!1}else if(r.type==="complexType"){let e=r.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",r),!1}function t_(r){return r.type==="complexType"&&r.complexType?.type==="physicalType"&&r.complexType.physicalType===0}let i_=new TextDecoder;function Hd(r,e){let i=vr(r,e,1)[0];if(i===0)return"";let o=e.get(),n=r.subarray(o,o+i);return e.add(i),i_.decode(n)}function bm(r,e){let i=vr(r,e,1)[0]>>>0;if(i<10||i>30)throw new Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let o=_m(i);if(ym(i)&&(o.name=Hd(r,e)),vm(i)){let n=vr(r,e,1)[0]>>>0;o.complexType.children=new Array(n);for(let l=0;l<n;l++)o.complexType.children[l]=bm(r,e)}return(function(n){return{name:n.name,nullable:n.nullable,scalarField:n.scalarType,complexField:n.complexType,type:n.type==="scalarType"?"scalarField":"complexField"}})(o)}function r_(r,e){let i=vr(r,e,1)[0]>>>0,o=_m(i);if(!o)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(ym(i)?o.name=Hd(r,e):i>=0&&i<=3?o.name="id":i===4&&(o.name="geometry"),vm(i)){let n=vr(r,e,1)[0]>>>0,l=o.complexType;l.children=new Array(n);for(let h=0;h<n;h++)l.children[h]=bm(r,e)}return o}function a_(r,e){let i={featureTables:[]},o={};o.name=Hd(r,e);let n=vr(r,e,1)[0]>>>0,l=vr(r,e,1)[0]>>>0;o.columns=new Array(l);for(let h=0;h<l;h++)o.columns[h]=r_(r,e);return i.featureTables.push(o),[i,n]}function o_(r,e,i,o,n,l,h=!1){let p=e.scalarType;if(!p||p.type!=="logicalType"||p.logicalType!==0)throw new Error(`ID column must be a logical ID scalar type: ${o}`);let g=p.longID?6:4,m=typeof l=="number"?void 0:l,v=eh(n,l,r,i,g===6?"int64":"int32");if(g===4)switch(v){case ni.FLAT:{let _=Kr(r,i,n,0,m);return new Ad(o,_,l)}case ni.SEQUENCE:{let _=em(r,i,n);return new Dd(o,_[0],_[1],n.numRleValues)}case ni.CONST:{let _=qd(r,i,n);return new Ld(o,_,l,!1)}}switch(v){case ni.FLAT:{if(h){let T=(function(x,M,C){let D=(function(L,N,F){let j=new Float64Array(F);for(let U=0;U<F;U++)j[U]=$1(L,N);return j})(x,M,C.numValues);return(function(L,N){switch(N.logicalLevelTechnique1){case Mt.DELTA:return N.logicalLevelTechnique2===Mt.RLE&&(L=Yf(L,N.runs,N.numRleValues)),(function(F){F[0]=ll(F[0]);let j=F.length/4*4,U=1;if(j>=4)for(;U<j-4;U+=4){let G=F[U+1],re=F[U+2],oe=F[U+3];F[U]=ll(F[U])+F[U-1],F[U+1]=ll(G)+F[U],F[U+2]=ll(re)+F[U+1],F[U+3]=ll(oe)+F[U+2]}for(;U!==F.length;++U)F[U]=ll(F[U])+F[U-1]})(L),L;case Mt.RLE:return(function(F,j){return Yf(F,j.runs,j.numRleValues)})(L,N);case Mt.NONE:return L;default:throw new Error(`The specified Logical level technique is not supported: ${N.logicalLevelTechnique1}`)}})(D,C)})(r,i,n);return new kd(o,T,l)}let _=im(r,i,n,m);return new am(o,_,l)}case ni.SEQUENCE:{let _=tm(r,i,n);return new om(o,_[0],_[1],n.numRleValues)}case ni.CONST:{let _=rm(r,i,n);return new fm(o,_,l,!1)}}throw new Error("Vector type not supported for id column.")}class n_{constructor(e,i){var o;switch(this._featureData=e,this.properties=this._featureData.properties||{},(o=this._featureData.geometry)===null||o===void 0?void 0:o.type){case Vi.POINT:case Vi.MULTIPOINT:this.type=1;break;case Vi.LINESTRING:case Vi.MULTILINESTRING:this.type=2;break;case Vi.POLYGON:case Vi.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=i,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let i of this._featureData.geometry.coordinates){let o=[];for(let n of i)o.push(new se(n.x,n.y));e.push(o)}return e}}class s_{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 n_(this.features[e],this.extent)}}class xm{constructor(e){this.layers={};let i=(function(o,n,l=!0){let h=new Hf(0),p=[];for(;h.get()<o.length;){let m=vr(o,h,1)[0]>>>0,v=h.get()+m;if(v>o.length)throw new Error(`Block overruns tile: ${v} > ${o.length}`);if(vr(o,h,1)[0]>>>0!=1){h.set(v);continue}let[_,T]=a_(o,h),x=_.featureTables[0],M=null,C=null,D=[],L=0;for(let F of x.columns){let j=F.name;if((g=F).type==="scalarType"&&g.scalarType?.type==="logicalType"&&g.scalarType.logicalType===0){let U=null;if(F.nullable){let re=zr(o,h),oe=h.get(),pe=Rc(o,re.numValues,re.byteLength,h);h.set(oe+re.byteLength),U=new Pa(pe,re.numValues)}let G=zr(o,h);L=U?U.size():G.decompressedCount,M=o_(o,F,h,j,G,U??L,l)}else if(t_(F)){let U=vr(o,h,1)[0];if(L===0){let G=h.get();L=zr(o,h).decompressedCount,h.set(G)}C=X1(o,U,h,L)}else{let U=e_(F)?vr(o,h,1)[0]:1;if(U===0)continue;let G=Q1(o,h,F,U,L);if(G)if(Array.isArray(G))for(let re of G)D.push(re);else D.push(G)}}let N=new B1(x.name,C,M,D,T);p.push(N),h.set(v)}var g;return p})(new Uint8Array(e));this.layers=i.reduce(((o,n)=>Object.assign(Object.assign({},o),{[n.name]:new s_(n)})),{})}}class l_{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=i,"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(){let e=[],i=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let o of i){let n=[];for(let l of o)n.push(new se(l[0],l[1]));e.push(n)}return e}}let Bc="_geojsonTileLayer";function c_(r,e,i=""){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);let o={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let h=0;h<r.length;h++)o.feature=r.feature(h),e.writeMessage(2,u_,o);let n=o.keys;for(let h of n)e.writeStringField(3,h);let l=o.values;for(let h of l)e.writeMessage(4,p_,h)}function u_(r,e){if(!r.feature)return;let i=r.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,h_,r),e.writeVarintField(3,i.type),e.writeMessage(4,d_,i)}function h_(r,e){for(let i in r.feature?.properties){let o=r.feature.properties[i],n=r.keycache[i];if(o==null)continue;n===void 0&&(r.keys.push(i),n=r.keys.length-1,r.keycache[i]=n),e.writeVarint(n),typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"&&(o=r.jsonPrefix+JSON.stringify(o));let l=typeof o+":"+o,h=r.valuecache[l];h===void 0&&(r.values.push(o),h=r.values.length-1,r.valuecache[l]=h),e.writeVarint(h)}}function Xd(r,e){return(e<<3)+(7&r)}function wm(r){return r<<1^r>>31}function d_(r,e){let i=r.loadGeometry(),o=r.type,n=0,l=0;for(let h of i){let p=1;o===1&&(p=h.length),e.writeVarint(Xd(1,p));let g=o===3?h.length-1:h.length;for(let m=0;m<g;m++){m===1&&o!==1&&e.writeVarint(Xd(2,g-1));let v=h[m].x-n,_=h[m].y-l;e.writeVarint(wm(v)),e.writeVarint(wm(_)),n+=v,l+=_}r.type===3&&e.writeVarint(Xd(7,1))}}function p_(r,e){let i=typeof r;i==="string"?e.writeStringField(1,r):i==="boolean"?e.writeBooleanField(7,r):i==="number"&&(r%1!=0?e.writeDoubleField(3,r):r<0?e.writeSVarintField(6,r):e.writeVarintField(5,r))}class Tm{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new ya(He,16,0),this.grid3D=new ya(He,16,0),this.featureIndexArray=new w,this.promoteId=i}insert(e,i,o,n,l,h){let p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,n,l);let g=h?this.grid3D:this.grid;for(let m of i){let v=[1/0,1/0,-1/0,-1/0];for(let _ of m)v[0]=Math.min(v[0],_.x),v[1]=Math.min(v[1],_.y),v[2]=Math.max(v[2],_.x),v[3]=Math.max(v[3],_.y);v[0]<He&&v[1]<He&&v[2]>=0&&v[3]>=0&&g.insert(p,v[0],v[1],v[2],v[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Xp(new Hu(this.rawTileData)).layers:new xm(this.rawTileData).layers,this.sourceLayerCoder=new Zf(this.vtLayers?Object.keys(this.vtLayers).sort():[Bc])),this.vtLayers}query(e,i,o,n){this.loadVTLayers();let l=e.params,h=He/e.tileSize/e.scale,p=gn(l.filter,l.globalState),g=e.queryGeometry,m=e.queryPadding*h,v=Nn.fromPoints(g),_=this.grid.query(v.minX-m,v.minY-m,v.maxX+m,v.maxY+m),T=Nn.fromPoints(e.cameraQueryGeometry).expandBy(m),x=this.grid3D.query(T.minX,T.minY,T.maxX,T.maxY,((D,L,N,F)=>(function(j,U,G,re,oe){for(let ce of j)if(U<=ce.x&&G<=ce.y&&re>=ce.x&&oe>=ce.y)return!0;let pe=[new se(U,G),new se(U,oe),new se(re,oe),new se(re,G)];if(j.length>2){for(let ce of pe)if(Hs(j,ce))return!0}for(let ce=0;ce<j.length-1;ce++)if(Gg(j[ce],j[ce+1],pe))return!0;return!1})(e.cameraQueryGeometry,D-m,L-m,N+m,F+m)));for(let D of x)_.push(D);_.sort(f_);let M={},C;for(let D of _){if(D===C)continue;C=D;let L=this.featureIndexArray.get(D),N=null;this.loadMatchingFeature(M,L.bucketIndex,L.sourceLayerIndex,L.featureIndex,p,l.layers,l.availableImages,i,o,n,((F,j,U)=>(N||(N=wa(F)),j.queryIntersectsFeature({queryGeometry:g,feature:F,featureState:U,geometry:N,zoom:this.z,transform:e.transform,pixelsToTileUnits:h,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return M}loadMatchingFeature(e,i,o,n,l,h,p,g,m,v,_){let T=this.bucketLayerIDs[i];if(h&&!T.some((D=>h.has(D))))return;let x=this.sourceLayerCoder.decode(o),M=this.vtLayers[x].feature(n);if(l.needGeometry){let D=Ta(M,!0);if(!l.filter(new Wt(this.tileID.overscaledZ),D,this.tileID.canonical))return}else if(!l.filter(new Wt(this.tileID.overscaledZ),M))return;let C=this.getId(M,x);for(let D of T){if(h&&!h.has(D))continue;let L=g[D];if(!L)continue;let N={};C&&v&&(N=v.getState(L.sourceLayer||Bc,C));let F=Xt({},m[D]);F.paint=Sm(F.paint,L.paint,M,N,p),F.layout=Sm(F.layout,L.layout,M,N,p);let j=!_||_(M,L,N);if(!j)continue;let U=new $f(M,this.z,this.x,this.y,C);U.layer=F;let G=e[D];G===void 0&&(G=e[D]=[]),G.push({featureIndex:n,feature:U,intersectionZ:j})}}lookupSymbolFeatures(e,i,o,n,l,h,p,g){let m={};this.loadVTLayers();let v=gn(l.filterSpec,l.globalState);for(let _ of e)this.loadMatchingFeature(m,o,n,_,v,h,p,g,i);return m}hasLayer(e){for(let i of this.bucketLayerIDs)for(let o of i)if(e===o)return!0;return!1}getId(e,i){var o;let n=e.id;return this.promoteId&&(n=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof n=="boolean"&&(n=Number(n)),n===void 0&&(!((o=e.properties)===null||o===void 0)&&o.cluster)&&this.promoteId&&(n=Number(e.properties.cluster_id))),n}}function Sm(r,e,i,o,n){return di(r,((l,h)=>{let p=e instanceof js?e.get(h):null;return p?.evaluate?p.evaluate(i,o,n):p}))}function f_(r,e){return e-r}function Pm(r,e,i,o,n){let l=[];for(let h of r){let p;for(let g=0;g<h.length-1;g++){let m=h[g],v=h[g+1];m.x<e&&v.x<e||(m.x<e?m=new se(e,m.y+(e-m.x)/(v.x-m.x)*(v.y-m.y))._round():v.x<e&&(v=new se(e,m.y+(e-m.x)/(v.x-m.x)*(v.y-m.y))._round()),m.y<i&&v.y<i||(m.y<i?m=new se(m.x+(i-m.y)/(v.y-m.y)*(v.x-m.x),i)._round():v.y<i&&(v=new se(m.x+(i-m.y)/(v.y-m.y)*(v.x-m.x),i)._round()),m.x>=o&&v.x>=o||(m.x>=o?m=new se(o,m.y+(o-m.x)/(v.x-m.x)*(v.y-m.y))._round():v.x>=o&&(v=new se(o,m.y+(o-m.x)/(v.x-m.x)*(v.y-m.y))._round()),m.y>=n&&v.y>=n||(m.y>=n?m=new se(m.x+(n-m.y)/(v.y-m.y)*(v.x-m.x),n)._round():v.y>=n&&(v=new se(m.x+(n-m.y)/(v.y-m.y)*(v.x-m.x),n)._round()),p&&m.equals(p[p.length-1])||(p=[m],l.push(p)),p.push(v)))))}}return l}function Mm(r,e,i,o,n){switch(e){case 1:return(function(l,h,p,g){let m=[];for(let v of l)for(let _ of v){let T=g===0?_.x:_.y;T>=h&&T<=p&&m.push([_])}return m})(r,i,o,n);case 2:return Cm(r,i,o,n,!1);case 3:return Cm(r,i,o,n,!0)}return[]}function m_(r,e,i,o,n){let l=o===0?g_:__,h=[],p=[];for(let v=0;v<r.length-1;v++){let _=r[v],T=r[v+1],x=o===0?_.x:_.y,M=o===0?T.x:T.y,C=!1;x<e?M>e&&h.push(l(_,T,e)):x>i?M<i&&h.push(l(_,T,i)):h.push(_),M<e&&x>=e&&(h.push(l(_,T,e)),C=!0),M>i&&x<=i&&(h.push(l(_,T,i)),C=!0),!n&&C&&(p.push(h),h=[])}let g=r.length-1,m=o===0?r[g].x:r[g].y;return m>=e&&m<=i&&h.push(r[g]),n&&h.length>0&&!h[0].equals(h[h.length-1])&&h.push(new se(h[0].x,h[0].y)),h.length>0&&p.push(h),p}function Cm(r,e,i,o,n){let l=[];for(let h of r){let p=m_(h,e,i,o,n);p.length>0&&l.push(...p)}return l}function g_(r,e,i){return new se(i,r.y+(i-r.x)/(e.x-r.x)*(e.y-r.y))}function __(r,e,i){return new se(r.x+(i-r.y)/(e.y-r.y)*(e.x-r.x),i)}Ne("FeatureIndex",Tm,{omit:["rawTileData","sourceLayerCoder"]});class Ho extends se{constructor(e,i,o,n){super(e,i),this.angle=o,n!==void 0&&(this.segment=n)}clone(){return new Ho(this.x,this.y,this.angle,this.segment)}}function Em(r,e,i,o,n){if(e.segment===void 0||i===0)return!0;let l=e,h=e.segment+1,p=0;for(;p>-i/2;){if(h--,h<0)return!1;p-=r[h].dist(l),l=r[h]}p+=r[h].dist(r[h+1]),h++;let g=[],m=0;for(;p<i/2;){let v=r[h],_=r[h+1];if(!_)return!1;let T=r[h-1].angleTo(v)-v.angleTo(_);for(T=Math.abs((T+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:p,angleDelta:T}),m+=T;p-g[0].distance>o;)m-=g.shift().angleDelta;if(m>n)return!1;h++,p+=v.dist(_)}return!0}function Im(r){let e=0;for(let i=0;i<r.length-1;i++)e+=r[i].dist(r[i+1]);return e}function zm(r,e,i){return r?.6*e*i:0}function Am(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}function y_(r,e,i,o,n,l){let h=zm(i,n,l),p=Am(i,o)*l,g=0,m=Im(r)/2;for(let v=0;v<r.length-1;v++){let _=r[v],T=r[v+1],x=_.dist(T);if(g+x>m){let M=(m-g)/x,C=ea.number(_.x,T.x,M),D=ea.number(_.y,T.y,M),L=new Ho(C,D,T.angleTo(_),v);return L._round(),!h||Em(r,L,p,h,e)?L:void 0}g+=x}}function v_(r,e,i,o,n,l,h,p,g){let m=zm(o,l,h),v=Am(o,n),_=v*h,T=r[0].x===0||r[0].x===g||r[0].y===0||r[0].y===g;return e-_<e/4&&(e=_+e/4),km(r,T?e/2*p%e:(v/2+2*l)*h*p%e,e,m,i,_,T,!1,g)}function km(r,e,i,o,n,l,h,p,g){let m=l/2,v=Im(r),_=0,T=e-i,x=[];for(let M=0;M<r.length-1;M++){let C=r[M],D=r[M+1],L=C.dist(D),N=D.angleTo(C);for(;T+i<_+L;){T+=i;let F=(T-_)/L,j=ea.number(C.x,D.x,F),U=ea.number(C.y,D.y,F);if(j>=0&&j<g&&U>=0&&U<g&&T-m>=0&&T+m<=v){let G=new Ho(j,U,N,M);G._round(),o&&!Em(r,G,l,o,n)||x.push(G)}}_+=L}return p||x.length||h||(x=km(r,_/2,i,o,n,l,h,!0,g)),x}function Dm(r,e,i,o){let n=[],l=r.image,h=l.pixelRatio,p=l.paddedRect.w-2,g=l.paddedRect.h-2,m={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom},v=l.stretchX||[[0,p]],_=l.stretchY||[[0,g]],T=(ue,Ie)=>ue+Ie[1]-Ie[0],x=v.reduce(T,0),M=_.reduce(T,0),C=p-x,D=g-M,L=0,N=x,F=0,j=M,U=0,G=C,re=0,oe=D;if(l.content&&o){let ue=l.content,Ie=ue[2]-ue[0],Fe=ue[3]-ue[1];(l.textFitWidth||l.textFitHeight)&&(m=If(r)),L=th(v,0,ue[0]),F=th(_,0,ue[1]),N=th(v,ue[0],ue[2]),j=th(_,ue[1],ue[3]),U=ue[0]-L,re=ue[1]-F,G=Ie-N,oe=Fe-j}let pe=m.x1,ce=m.y1,_e=m.x2-pe,ye=m.y2-ce,fe=(ue,Ie,Fe,De)=>{let Ae=ih(ue.stretch-L,N,_e,pe),ct=rh(ue.fixed-U,G,ue.stretch,x),Ot=ih(Ie.stretch-F,j,ye,ce),Ut=rh(Ie.fixed-re,oe,Ie.stretch,M),$t=ih(Fe.stretch-L,N,_e,pe),or=rh(Fe.fixed-U,G,Fe.stretch,x),gi=ih(De.stretch-F,j,ye,ce),Ri=rh(De.fixed-re,oe,De.stretch,M),Ui=new se(Ae,Ot),si=new se($t,Ot),Ji=new se($t,gi),br=new se(Ae,gi),xr=new se(ct/h,Ut/h),jr=new se(or/h,Ri/h),nr=e*Math.PI/180;if(nr){let qi=Math.sin(nr),ui=Math.cos(nr),zi=[ui,-qi,qi,ui];Ui._matMult(zi),si._matMult(zi),br._matMult(zi),Ji._matMult(zi)}let Vr=ue.stretch+ue.fixed,fa=Ie.stretch+Ie.fixed;return{tl:Ui,tr:si,bl:br,br:Ji,tex:{x:l.paddedRect.x+1+Vr,y:l.paddedRect.y+1+fa,w:Fe.stretch+Fe.fixed-Vr,h:De.stretch+De.fixed-fa},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:xr,pixelOffsetBR:jr,minFontScaleX:G/h/_e,minFontScaleY:oe/h/ye,isSDF:i}};if(o&&(l.stretchX||l.stretchY)){let ue=Lm(v,C,x),Ie=Lm(_,D,M);for(let Fe=0;Fe<ue.length-1;Fe++){let De=ue[Fe],Ae=ue[Fe+1];for(let ct=0;ct<Ie.length-1;ct++)n.push(fe(De,Ie[ct],Ae,Ie[ct+1]))}}else n.push(fe({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:p+1},{fixed:0,stretch:g+1}));return n}function th(r,e,i){let o=0;for(let n of r)o+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]));return o}function Lm(r,e,i){let o=[{fixed:-1,stretch:0}];for(let[n,l]of r){let h=o[o.length-1];o.push({fixed:n-h.stretch,stretch:h.stretch}),o.push({fixed:n-h.stretch,stretch:h.stretch+(l-n)})}return o.push({fixed:e+1,stretch:i}),o}function ih(r,e,i,o){return r/e*i+o}function rh(r,e,i,o){return r-e*i/o}Ne("Anchor",Ho);class ah{constructor(e,i,o,n,l,h,p,g,m,v){var _;if(this.boxStartIndex=e.length,m){let T=h.top,x=h.bottom,M=h.collisionPadding;M&&(T-=M[1],x+=M[3]);let C=x-T;C>0&&(C=Math.max(10,C),this.circleDiameter=C)}else{let T=!((_=h.image)===null||_===void 0)&&_.content&&(h.image.textFitWidth||h.image.textFitHeight)?If(h):{x1:h.left,y1:h.top,x2:h.right,y2:h.bottom};T.y1=T.y1*p-g[0],T.y2=T.y2*p+g[2],T.x1=T.x1*p-g[3],T.x2=T.x2*p+g[1];let x=h.collisionPadding;if(x&&(T.x1-=x[0]*p,T.y1-=x[1]*p,T.x2+=x[2]*p,T.y2+=x[3]*p),v){let M=new se(T.x1,T.y1),C=new se(T.x2,T.y1),D=new se(T.x1,T.y2),L=new se(T.x2,T.y2),N=v*Math.PI/180;M._rotate(N),C._rotate(N),D._rotate(N),L._rotate(N),T.x1=Math.min(M.x,C.x,D.x,L.x),T.x2=Math.max(M.x,C.x,D.x,L.x),T.y1=Math.min(M.y,C.y,D.y,L.y),T.y2=Math.max(M.y,C.y,D.y,L.y)}e.emplaceBack(i.x,i.y,T.x1,T.y1,T.x2,T.y2,o,n,l)}this.boxEndIndex=e.length}}class b_{constructor(e=[],i=(o,n)=>o<n?-1:o>n?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:i,compare:o}=this,n=i[e];for(;e>0;){let l=e-1>>1,h=i[l];if(o(n,h)>=0)break;i[e]=h,e=l}i[e]=n}_down(e){let{data:i,compare:o}=this,n=this.length>>1,l=i[e];for(;e<n;){let h=1+(e<<1),p=h+1;if(p<this.length&&o(i[p],i[h])<0&&(h=p),o(i[h],l)>=0)break;i[e]=i[h],e=h}i[e]=l}}function x_(r,e=1){let i=Nn.fromPoints(r[0]),o=Math.min(i.width(),i.height()),n=o/2,l=new b_([],w_),{minX:h,minY:p,maxX:g,maxY:m}=i;if(o===0)return new se(h,p);for(let T=h;T<g;T+=o)for(let x=p;x<m;x+=o)l.push(new fl(T+n,x+n,n,r));let v=(function(T){let x=0,M=0,C=0,D=T[0];for(let L=0,N=D.length,F=N-1;L<N;F=L++){let j=D[L],U=D[F],G=j.x*U.y-U.x*j.y;M+=(j.x+U.x)*G,C+=(j.y+U.y)*G,x+=3*G}return new fl(M/x,C/x,0,T)})(r),_=v;for(;l.length;){let T=l.pop();(T.d>_.d||!_.d)&&(_=T),T.max-_.d<=e||(n=T.h/2,l.push(new fl(T.p.x-n,T.p.y-n,n,r)),l.push(new fl(T.p.x+n,T.p.y-n,n,r)),l.push(new fl(T.p.x-n,T.p.y+n,n,r)),l.push(new fl(T.p.x+n,T.p.y+n,n,r)))}return v.d>0&&_.d-v.d<=e?v.p:_.p}function w_(r,e){return e.max-r.max}class fl{constructor(e,i,o,n){this.p=new se(e,i),this.h=o,this.d=(function(l,h){let p=!1,g=1/0;for(let m of h)for(let v=0,_=m.length,T=_-1;v<_;T=v++){let x=m[v],M=m[T];x.y>l.y!=M.y>l.y&&l.x<(M.x-x.x)*(l.y-x.y)/(M.y-x.y)+x.x&&(p=!p),g=Math.min(g,Sp(l,x,M))}return(p?1:-1)*Math.sqrt(g)})(this.p,n),this.max=this.d+this.h*Math.SQRT2}}var ar;z.aM=void 0,(ar=z.aM||(z.aM={}))[ar.center=1]="center",ar[ar.left=2]="left",ar[ar.right=3]="right",ar[ar.top=4]="top",ar[ar.bottom=5]="bottom",ar[ar["top-left"]=6]="top-left",ar[ar["top-right"]=7]="top-right",ar[ar["bottom-left"]=8]="bottom-left",ar[ar["bottom-right"]=9]="bottom-right";let Yd=Number.POSITIVE_INFINITY;function Rm(r,e){return e[1]!==Yd?(function(i,o,n){let l=0,h=0;switch(o=Math.abs(o),n=Math.abs(n),i){case"top-right":case"top-left":case"top":h=n-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-n}switch(i){case"top-right":case"bottom-right":case"right":l=-o;break;case"top-left":case"bottom-left":case"left":l=o}return[l,h]})(r,e[0],e[1]):(function(i,o){let n=0,l=0;o<0&&(o=0);let h=o/Math.SQRT2;switch(i){case"top-right":case"top-left":l=h-7;break;case"bottom-right":case"bottom-left":l=7-h;break;case"bottom":l=7-o;break;case"top":l=o-7}switch(i){case"top-right":case"bottom-right":n=-h;break;case"top-left":case"bottom-left":n=h;break;case"left":n=o;break;case"right":n=-o}return[n,l]})(r,e[0])}function Fm(r,e,i){var o;let n=r.layout,l=(o=n.get("text-variable-anchor-offset"))===null||o===void 0?void 0:o.evaluate(e,{},i);if(l){let p=l.values,g=[];for(let m=0;m<p.length;m+=2){let v=g[m]=p[m],_=p[m+1].map((T=>T*ji));v.startsWith("top")?_[1]-=7:v.startsWith("bottom")&&(_[1]+=7),g[m+1]=_}return new fr(g)}let h=n.get("text-variable-anchor");if(h){let p;p=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[n.get("text-radial-offset").evaluate(e,{},i)*ji,Yd]:n.get("text-offset").evaluate(e,{},i).map((m=>m*ji));let g=[];for(let m of h)g.push(m,Rm(m,p));return new fr(g)}return null}function Kd(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function T_(r,e,i,o,n,l,h,p,g,m,v,_){let T=l.textMaxSize.evaluate(e,{});T===void 0&&(T=h);let x=r.layers[0].layout,M=x.get("icon-offset").evaluate(e,{},v),C=Om(i.horizontal),D=h/24,L=r.tilePixelRatio*D,N=r.tilePixelRatio*T/24,F=r.tilePixelRatio*p,j=r.tilePixelRatio*x.get("symbol-spacing"),U=x.get("text-padding")*r.tilePixelRatio,G=(function(Fe,De,Ae,ct=1){let Ot=Fe.get("icon-padding").evaluate(De,{},Ae),Ut=Ot?.values;return[Ut[0]*ct,Ut[1]*ct,Ut[2]*ct,Ut[3]*ct]})(x,e,v,r.tilePixelRatio),re=x.get("text-max-angle")/180*Math.PI,oe=x.get("text-rotation-alignment")!=="viewport"&&x.get("symbol-placement")!=="point",pe=x.get("icon-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",ce=x.get("symbol-placement"),_e=j/2,ye=x.get("icon-text-fit"),fe;o&&ye!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(fe=zf(o,i.vertical,ye,x.get("icon-text-fit-padding"),M,D)),C&&(o=zf(o,C,ye,x.get("icon-text-fit-padding"),M,D)));let ue=v?_.line.getGranularityForZoomLevel(v.z):1,Ie=(Fe,De)=>{De.x<0||De.x>=He||De.y<0||De.y>=He||(function(Ae,ct,Ot,Ut,$t,or,gi,Ri,Ui,si,Ji,br,xr,jr,nr,Vr,fa,qi,ui,zi,_i,Gi,no,Ma,Oc){let Xo=Ae.addToLineVertexArray(ct,Ot),Vn,ml,gl,_l,Nm=0,jm=0,Vm=0,Um=0,Jd=-1,Qd=-1,so={},qm=wi("");if(Ae.allowVerticalPlacement&&Ut.vertical){let wr=Ri.layout.get("text-rotate").evaluate(_i,{},Ma)+90;gl=new ah(Ui,ct,si,Ji,br,Ut.vertical,xr,jr,nr,wr),gi&&(_l=new ah(Ui,ct,si,Ji,br,gi,fa,qi,nr,wr))}if($t){let wr=Ri.layout.get("icon-rotate").evaluate(_i,{}),na=Ri.layout.get("icon-text-fit")!=="none",Un=Dm($t,wr,no,na),Ea=gi?Dm(gi,wr,no,na):void 0;ml=new ah(Ui,ct,si,Ji,br,$t,fa,qi,!1,wr),Nm=4*Un.length;let qn=Ae.iconSizeData,Ua=null;qn.kind==="source"?(Ua=[ao*Ri.layout.get("icon-size").evaluate(_i,{})],Ua[0]>qo&&qt(`${Ae.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):qn.kind==="composite"&&(Ua=[ao*Gi.compositeIconSizes[0].evaluate(_i,{},Ma),ao*Gi.compositeIconSizes[1].evaluate(_i,{},Ma)],(Ua[0]>qo||Ua[1]>qo)&&qt(`${Ae.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ae.addSymbols(Ae.icon,Un,Ua,zi,ui,_i,z.ax.none,ct,Xo.lineStartIndex,Xo.lineLength,-1,Ma),Jd=Ae.icon.placedSymbolArray.length-1,Ea&&(jm=4*Ea.length,Ae.addSymbols(Ae.icon,Ea,Ua,zi,ui,_i,z.ax.vertical,ct,Xo.lineStartIndex,Xo.lineLength,-1,Ma),Qd=Ae.icon.placedSymbolArray.length-1)}let Gm=Object.keys(Ut.horizontal);for(let wr of Gm){let na=Ut.horizontal[wr];if(!Vn){qm=wi(na.text);let Ea=Ri.layout.get("text-rotate").evaluate(_i,{},Ma);Vn=new ah(Ui,ct,si,Ji,br,na,xr,jr,nr,Ea)}let Un=na.positionedLines.length===1;if(Vm+=Bm(Ae,ct,na,or,Ri,nr,_i,Vr,Xo,Ut.vertical?z.ax.horizontal:z.ax.horizontalOnly,Un?Gm:[wr],so,Jd,Gi,Ma),Un)break}Ut.vertical&&(Um+=Bm(Ae,ct,Ut.vertical,or,Ri,nr,_i,Vr,Xo,z.ax.vertical,["vertical"],so,Qd,Gi,Ma));let P_=Vn?Vn.boxStartIndex:Ae.collisionBoxArray.length,M_=Vn?Vn.boxEndIndex:Ae.collisionBoxArray.length,C_=gl?gl.boxStartIndex:Ae.collisionBoxArray.length,E_=gl?gl.boxEndIndex:Ae.collisionBoxArray.length,I_=ml?ml.boxStartIndex:Ae.collisionBoxArray.length,z_=ml?ml.boxEndIndex:Ae.collisionBoxArray.length,A_=_l?_l.boxStartIndex:Ae.collisionBoxArray.length,k_=_l?_l.boxEndIndex:Ae.collisionBoxArray.length,Ca=-1,oh=(wr,na)=>wr?.circleDiameter?Math.max(wr.circleDiameter,na):na;Ca=oh(Vn,Ca),Ca=oh(gl,Ca),Ca=oh(ml,Ca),Ca=oh(_l,Ca);let Zm=Ca>-1?1:0;Zm&&(Ca*=Oc/ji),Ae.glyphOffsetArray.length>=al.MAX_GLYPHS&&qt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),_i.sortKey!==void 0&&Ae.addToSortKeyRanges(Ae.symbolInstances.length,_i.sortKey);let D_=Fm(Ri,_i,Ma),[L_,R_]=(function(wr,na){let Un=wr.length,Ea=na?.values;if(Ea?.length>0)for(let qn=0;qn<Ea.length;qn+=2){let Ua=Ea[qn+1];wr.emplaceBack(z.aM[Ea[qn]],Ua[0],Ua[1])}return[Un,wr.length]})(Ae.textAnchorOffsets,D_);Ae.symbolInstances.emplaceBack(ct.x,ct.y,so.right>=0?so.right:-1,so.center>=0?so.center:-1,so.left>=0?so.left:-1,so.vertical||-1,Jd,Qd,qm,P_,M_,C_,E_,I_,z_,A_,k_,si,Vm,Um,Nm,jm,Zm,0,xr,Ca,L_,R_)})(r,De,Fe,i,o,n,fe,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,L,[U,U,U,U],oe,g,F,G,pe,M,e,l,m,v,h)};if(ce==="line")for(let Fe of Pm(e.geometry,0,0,He,He)){let De=On(Fe,ue),Ae=v_(De,j,re,i.vertical||C,o,24,N,r.overscaling,He);for(let ct of Ae)C&&S_(r,C.text,_e,ct)||Ie(De,ct)}else if(ce==="line-center"){for(let Fe of e.geometry)if(Fe.length>1){let De=On(Fe,ue),Ae=y_(De,re,i.vertical||C,o,24,N);Ae&&Ie(De,Ae)}}else if(e.type==="Polygon")for(let Fe of fs(e.geometry,0)){let De=x_(Fe,16);Ie(On(Fe[0],ue,!0),new Ho(De.x,De.y,0))}else if(e.type==="LineString")for(let Fe of e.geometry){let De=On(Fe,ue);Ie(De,new Ho(De[0].x,De[0].y,0))}else if(e.type==="Point")for(let Fe of e.geometry)for(let De of Fe)Ie([De],new Ho(De.x,De.y,0))}function Bm(r,e,i,o,n,l,h,p,g,m,v,_,T,x,M){let C=(function(N,F,j,U,G,re,oe,pe){let ce=U.layout.get("text-rotate").evaluate(re,{})*Math.PI/180,_e=[];for(let ye of F.positionedLines)for(let fe of ye.positionedGlyphs){if(!fe.rect)continue;let ue=fe.rect||{},Ie=4,Fe=!0,De=1,Ae=0,ct=(G||pe)&&fe.vertical,Ot=fe.metrics.advance*fe.scale/2;if(pe&&F.verticalizable&&(Ae=ye.lineOffset/2-(fe.imageName?-(ji-fe.metrics.width*fe.scale)/2:(fe.scale-1)*ji)),fe.imageName){let qi=oe[fe.imageName];Fe=qi.sdf,De=qi.pixelRatio,Ie=1/De}let Ut=G?[fe.x+Ot,fe.y]:[0,0],$t=G?[0,0]:[fe.x+Ot+j[0],fe.y+j[1]-Ae],or=[0,0];ct&&(or=$t,$t=[0,0]);let gi=fe.metrics.isDoubleResolution?2:1,Ri=(fe.metrics.left-Ie)*fe.scale-Ot+$t[0],Ui=(-fe.metrics.top-Ie)*fe.scale+$t[1],si=Ri+ue.w/gi*fe.scale/De,Ji=Ui+ue.h/gi*fe.scale/De,br=new se(Ri,Ui),xr=new se(si,Ui),jr=new se(Ri,Ji),nr=new se(si,Ji);if(ct){let qi=new se(-Ot,Ot- -17),ui=-Math.PI/2,zi=12-Ot,_i=new se(22-zi,-(fe.imageName?zi:0)),Gi=new se(...or);br._rotateAround(ui,qi)._add(_i)._add(Gi),xr._rotateAround(ui,qi)._add(_i)._add(Gi),jr._rotateAround(ui,qi)._add(_i)._add(Gi),nr._rotateAround(ui,qi)._add(_i)._add(Gi)}if(ce){let qi=Math.sin(ce),ui=Math.cos(ce),zi=[ui,-qi,qi,ui];br._matMult(zi),xr._matMult(zi),jr._matMult(zi),nr._matMult(zi)}let Vr=new se(0,0),fa=new se(0,0);_e.push({tl:br,tr:xr,bl:jr,br:nr,tex:ue,writingMode:F.writingMode,glyphOffset:Ut,sectionIndex:fe.sectionIndex,isSDF:Fe,pixelOffsetTL:Vr,pixelOffsetBR:fa,minFontScaleX:0,minFontScaleY:0})}return _e})(0,i,p,n,l,h,o,r.allowVerticalPlacement),D=r.textSizeData,L=null;D.kind==="source"?(L=[ao*n.layout.get("text-size").evaluate(h,{})],L[0]>qo&&qt(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):D.kind==="composite"&&(L=[ao*x.compositeTextSizes[0].evaluate(h,{},M),ao*x.compositeTextSizes[1].evaluate(h,{},M)],(L[0]>qo||L[1]>qo)&&qt(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),r.addSymbols(r.text,C,L,p,l,h,m,e,g.lineStartIndex,g.lineLength,T,M);for(let N of v)_[N]=r.text.placedSymbolArray.length-1;return 4*C.length}function Om(r){for(let e in r)return r[e];return null}function S_(r,e,i,o){let n=r.compareText;if(e in n){let l=n[e];for(let h=l.length-1;h>=0;h--)if(o.dist(l[h])<i)return!0}else n[e]=[];return n[e].push(o),!1}z.$=Ur,z.A=Ge,z.B=Sn,z.C=Oo,z.D=Ke,z.E=Dt,z.F=Bo,z.G=function([r,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:r*Math.cos(e)*Math.sin(i),y:r*Math.sin(e)*Math.sin(i),z:r*Math.cos(i)}},z.H=ea,z.I=wd,z.J=Wt,z.K=Fh,z.L=function(r){if(It==null){let e=r.navigator?r.navigator.userAgent:null;It=!!r.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return It},z.M=ae,z.N=class{constructor(r,e){this.target=r,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new R1((()=>this.process())),this.subscription=Ii(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=Nt(self)?r:window}registerMessageHandler(r,e){this.messageHandlers[r]=e}unregisterMessageHandler(r){delete this.messageHandlers[r]}sendAsync(r,e){return new Promise(((i,o)=>{let n=Math.round(1e18*Math.random()).toString(36).substring(0,10),l=e?Ii(e.signal,"abort",(()=>{l?.unsubscribe(),delete this.resolveRejects[n];let g={id:n,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(g)}),F1):null;this.resolveRejects[n]={resolve:g=>{l?.unsubscribe(),i(g)},reject:g=>{l?.unsubscribe(),o(g)}};let h=[],p=Object.assign(Object.assign({},r),{id:n,sourceMapId:this.mapId,origin:location.origin,data:va(r.data,h)});this.target.postMessage(p,{transfer:h})}))}receive(r){let e=r.data,i=e.id,o=["file://","resource://android","null"],n=[e.origin,location.origin],l=e.origin===location.origin,h=n.some((p=>o.includes(p)));if((l||h)&&(!e.targetMapId||this.mapId===e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];let p=this.abortControllers[i];return delete this.abortControllers[i],void(p&&p.abort())}if(Nt(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;let r=this.taskQueue.shift(),e=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(r,e)}processTask(r,e){return u(this,void 0,void 0,(function*(){if(e.type==="<response>"){let n=this.resolveRejects[r];return delete this.resolveRejects[r],n?void(e.error?n.reject(Bt(No(e.error))):n.resolve(No(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(r,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let i=No(e.data),o=new AbortController;this.abortControllers[r]=o;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,i,o);this.completeTask(r,null,n)}catch(n){this.completeTask(r,Bt(n))}}))}completeTask(r,e,i){let o=[];delete this.abortControllers[r];let n={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?va(e):null,data:va(i,o)};this.target.postMessage(n,{transfer:o})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},z.O=function(){var r=new Ge(16);return Ge!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},z.P=se,z.Q=function(r,e,i){var o,n,l,h,p,g,m,v,_,T,x,M,C=i[0],D=i[1],L=i[2];return e===r?(r[12]=e[0]*C+e[4]*D+e[8]*L+e[12],r[13]=e[1]*C+e[5]*D+e[9]*L+e[13],r[14]=e[2]*C+e[6]*D+e[10]*L+e[14],r[15]=e[3]*C+e[7]*D+e[11]*L+e[15]):(n=e[1],l=e[2],h=e[3],p=e[4],g=e[5],m=e[6],v=e[7],_=e[8],T=e[9],x=e[10],M=e[11],r[0]=o=e[0],r[1]=n,r[2]=l,r[3]=h,r[4]=p,r[5]=g,r[6]=m,r[7]=v,r[8]=_,r[9]=T,r[10]=x,r[11]=M,r[12]=o*C+p*D+_*L+e[12],r[13]=n*C+g*D+T*L+e[13],r[14]=l*C+m*D+x*L+e[14],r[15]=h*C+v*D+M*L+e[15]),r},z.R=Nr,z.S=function(r,e,i){var o=i[0],n=i[1],l=i[2];return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*o,r[3]=e[3]*o,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*l,r[9]=e[9]*l,r[10]=e[10]*l,r[11]=e[11]*l,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},z.T=Jh,z.U=function(r,e,i){var o=e[0],n=e[1],l=e[2],h=e[3],p=e[4],g=e[5],m=e[6],v=e[7],_=e[8],T=e[9],x=e[10],M=e[11],C=e[12],D=e[13],L=e[14],N=e[15],F=i[0],j=i[1],U=i[2],G=i[3];return r[0]=F*o+j*p+U*_+G*C,r[1]=F*n+j*g+U*T+G*D,r[2]=F*l+j*m+U*x+G*L,r[3]=F*h+j*v+U*M+G*N,r[4]=(F=i[4])*o+(j=i[5])*p+(U=i[6])*_+(G=i[7])*C,r[5]=F*n+j*g+U*T+G*D,r[6]=F*l+j*m+U*x+G*L,r[7]=F*h+j*v+U*M+G*N,r[8]=(F=i[8])*o+(j=i[9])*p+(U=i[10])*_+(G=i[11])*C,r[9]=F*n+j*g+U*T+G*D,r[10]=F*l+j*m+U*x+G*L,r[11]=F*h+j*v+U*M+G*N,r[12]=(F=i[12])*o+(j=i[13])*p+(U=i[14])*_+(G=i[15])*C,r[13]=F*n+j*g+U*T+G*D,r[14]=F*l+j*m+U*x+G*L,r[15]=F*h+j*v+U*M+G*N,r},z.V=function(r,e){let i={};for(let o of e)o in r&&(i[o]=r[o]);return i},z.W=Go,z.X=yi,z.Y=Nf,z.Z=Of,z._=u,z.a=hr,z.a$=function(r){var e=new Ge(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},z.a0=Lt,z.a1=Gt,z.a2=ur,z.a3=Xr,z.a4=Vf,z.a5=Ju,z.a6=He,z.a7=Lc,z.a8=Nn,z.a9=25,z.aA=function(r){var e=r[0],i=r[1];return Math.sqrt(e*e+i*i)},z.aB=function(r){return r[0]=0,r[1]=0,r},z.aC=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r},z.aD=Pd,z.aE=ot,z.aF=function(r,e,i,o){let n=e.y-r.y,l=e.x-r.x,h=o.y-i.y,p=o.x-i.x,g=h*l-p*n;if(g===0)return null;let m=(p*(r.y-i.y)-h*(r.x-i.x))/g;return new se(r.x+m*l,r.y+m*n)},z.aG=Pm,z.aH=Va,z.aI=function(r){let e=1/0,i=1/0,o=-1/0,n=-1/0;for(let l of r)e=Math.min(e,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y);return[e,i,o,n]},z.aJ=ji,z.aK=St,z.aL=function(r,e,i,o,n=!1){if(!i[0]&&!i[1])return[0,0];let l=n?o==="map"?-r.bearingInRadians:0:o==="viewport"?r.bearingInRadians:0;if(l){let h=Math.sin(l),p=Math.cos(l);i=[i[0]*p-i[1]*h,i[0]*h+i[1]*p]}return[n?i[0]:St(e,i[0],r.zoom),n?i[1]:St(e,i[1],r.zoom)]},z.aN=Sd,z.aO=Kd,z.aP=Td,z.aQ=r=>r.type==="symbol",z.aR=Uu,z.aS=fi,z.aT=Vu,z.aU=S,z.aV=de,z.aW=te,z.aX=Je,z.aY=Uf,z.aZ=ee,z.a_=K,z.aa=zd,z.ab=r=>{let e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(let o of r){let n=window.document.createElement("source");Re(o)||(e.crossOrigin="Anonymous"),n.src=o,e.appendChild(n)}}))},z.ac=ze,z.ad=function(){return cr++},z.ae=yc,z.af=al,z.ag=Bc,z.ah=gn,z.ai=Ta,z.aj=$f,z.ak=function(r){let e={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,o,n,l)=>{let h=n||l;return e[o]=!h||h.toLowerCase(),""})),e["max-age"]){let i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},z.al=ht,z.am=85.051129,z.an=Te,z.ao=function(r){return Math.pow(2,r)},z.ap=je,z.aq=jf,z.ar=function(r){return Math.log(r)/Math.LN2},z.as=function(r){var e=r[0],i=r[1];return e*e+i*i},z.at=function(r){if(!r.length)return new Set;let e=Math.max(...r.map((g=>g.canonical.z))),i=1/0,o=-1/0,n=1/0,l=-1/0,h=[];for(let g of r){let{x:m,y:v,z:_}=g.canonical,T=Math.pow(2,e-_),x=m*T,M=v*T;h.push({id:g,x,y:M}),x<i&&(i=x),x>o&&(o=x),M<n&&(n=M),M>l&&(l=M)}let p=new Set;for(let g of h)g.x!==i&&g.x!==o&&g.y!==n&&g.y!==l||p.add(g.id);return p},z.au=function(r,e){let i=Math.abs(2*r.wrap)-+(r.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||o-i||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x},z.av=class{constructor(r,e){this.max=r,this.onRemove=e,this.reset()}reset(){for(let r in this.data)for(let e of this.data[r])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(r,e,i){let o=r.wrapped().key;this.data[o]===void 0&&(this.data[o]=[]);let n={value:e,timeout:void 0};if(i!==void 0&&(n.timeout=setTimeout((()=>{this.remove(r,n)}),i)),this.data[o].push(n),this.order.push(o),this.order.length>this.max){let l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}has(r){return r.wrapped().key in this.data}getAndRemove(r){return this.has(r)?this._getAndRemoveByKey(r.wrapped().key):null}_getAndRemoveByKey(r){let e=this.data[r].shift();return e.timeout&&clearTimeout(e.timeout),this.data[r].length===0&&delete this.data[r],this.order.splice(this.order.indexOf(r),1),e.value}getByKey(r){let e=this.data[r];return e?e[0].value:null}get(r){return this.has(r)?this.data[r.wrapped().key][0].value:null}remove(r,e){if(!this.has(r))return this;let i=r.wrapped().key,o=e===void 0?0:this.data[i].indexOf(e),n=this.data[i][o];return this.data[i].splice(o,1),n.timeout&&clearTimeout(n.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(r){for(this.max=r;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(r){let e=[];for(let i in this.data)for(let o of this.data[i])r(o.value)||e.push(o);for(let i of e)this.remove(i.value.tileID,i)}},z.aw=function(r,e){let i=0,o=0;if(r.kind==="constant")o=r.layoutSize;else if(r.kind!=="source"){let{interpolationType:n,minZoom:l,maxZoom:h}=r,p=n?ht(gr.interpolationFactor(n,e,l,h),0,1):0;r.kind==="camera"?o=ea.number(r.minSize,r.maxSize,p):i=p}return{uSizeT:i,uSize:o}},z.ay=function(r,{uSize:e,uSizeT:i},{lowerSize:o,upperSize:n}){return r.kind==="source"?o/ao:r.kind==="composite"?ea.number(o/ao,n/ao,i):e},z.az=nt,z.b=Pt,z.b$=ja,z.b0=function(r,e,i){return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],r},z.b1=function(r,e){var i=e[0],o=e[1],n=e[2],l=i*i+o*o+n*n;return l>0&&(l=1/Math.sqrt(l)),r[0]=e[0]*l,r[1]=e[1]*l,r[2]=e[2]*l,r},z.b2=ne,z.b3=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]},z.b4=function(r,e,i){return r[0]=e[0]*i[0],r[1]=e[1]*i[1],r[2]=e[2]*i[2],r[3]=e[3]*i[3],r},z.b5=Se,z.b6=function(r,e,i){let o=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return o===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/o},z.b7=We,z.b8=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r},z.b9=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]},z.bA=Ee,z.bB=function(r,e,i){var o=i[0],n=i[1],l=i[2],h=i[3],p=e[0],g=e[1],m=e[2],v=n*m-l*g,_=l*p-o*m,T=o*g-n*p;return r[0]=p+h*(v+=v)+n*(T+=T)-l*(_+=_),r[1]=g+h*_+l*v-o*T,r[2]=m+h*T+o*_-n*v,r},z.bC=function(r,e,i){let o=(n=[r[0],r[1],r[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((v=n[8])*(h=n[4])-(p=n[5])*(m=n[7]))+n[1]*(-v*(l=n[3])+p*(g=n[6]))+n[2]*(m*l-h*g);var n,l,h,p,g,m,v;if(o===0)return null;let _=ne([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),T=ne([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),x=ne([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),M=ee([],_,-r[3]);return K(M,M,ee([],T,-e[3])),K(M,M,ee([],x,-i[3])),ee(M,M,1/o),M},z.bD=Id,z.bE=function(){return new Float64Array(4)},z.bF=function(r,e,i,o){var n=[],l=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],l[0]=n[0]*Math.cos(o)-n[1]*Math.sin(o),l[1]=n[0]*Math.sin(o)+n[1]*Math.cos(o),l[2]=n[2],r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},z.bG=function(r,e,i,o){var n=[],l=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],l[0]=n[0],l[1]=n[1]*Math.cos(o)-n[2]*Math.sin(o),l[2]=n[1]*Math.sin(o)+n[2]*Math.cos(o),r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},z.bH=function(r,e,i,o){var n=[],l=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],l[0]=n[2]*Math.sin(o)+n[0]*Math.cos(o),l[1]=n[1],l[2]=n[2]*Math.cos(o)-n[0]*Math.sin(o),r[0]=l[0]+i[0],r[1]=l[1]+i[1],r[2]=l[2]+i[2],r},z.bI=function(r,e,i){var o=Math.sin(i),n=Math.cos(i),l=e[0],h=e[1],p=e[2],g=e[3],m=e[8],v=e[9],_=e[10],T=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=l*n-m*o,r[1]=h*n-v*o,r[2]=p*n-_*o,r[3]=g*n-T*o,r[8]=l*o+m*n,r[9]=h*o+v*n,r[10]=p*o+_*n,r[11]=g*o+T*n,r},z.bJ=function(r,e){let i=dt(r,360),o=dt(e,360),n=o-i,l=o>i?n-360:n+360;return Math.abs(n)<Math.abs(l)?n:l},z.bK=function(r){return r[0]=0,r[1]=0,r[2]=0,r},z.bL=function(r,e,i,o){let n=Math.sqrt(r*r+e*e),l=Math.sqrt(i*i+o*o);r/=n,e/=n,i/=l,o/=l;let h=Math.acos(r*i+e*o);return-e*i+r*o>0?h:-h},z.bM=function(r,e){let i=dt(r,2*Math.PI),o=dt(e,2*Math.PI);return Math.min(Math.abs(i-o),Math.abs(i-o+2*Math.PI),Math.abs(i-o-2*Math.PI))},z.bN=function(){let r={},e=he.$version;for(let i in he.$root){let o=he.$root[i];if(o.required){let n=null;n=i==="version"?e:o.type==="array"?[]:{},n!=null&&(r[i]=n)}}return r},z.bO=qe,z.bP=bn,z.bQ=function r(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let o=0;o<e.length;o++)if(!r(e[o],i[o]))return!1;return!0}if(typeof e=="object"&&e!==null&&i!==null){if(typeof i!="object"||Object.keys(e).length!==Object.keys(i).length)return!1;for(let o in e)if(!r(e[o],i[o]))return!1;return!0}return e===i},z.bR=Ga,z.bS=function(r){r=r.slice();let e=Object.create(null);for(let i=0;i<r.length;i++)e[r[i].id]=r[i];for(let i=0;i<r.length;i++)"ref"in r[i]&&(r[i]=Jr(r[i],e[r[i].ref]));return r},z.bT=function(r,e){if(r.type==="custom")return new L1(r,e);switch(r.type){case"background":return new D1(r,e);case"circle":return new Kg(r,e);case"color-relief":return new r0(r,e);case"fill":return new y0(r,e);case"fill-extrusion":return new z0(r,e);case"heatmap":return new Qg(r,e);case"hillshade":return new t0(r,e);case"line":return new i1(r,e);case"raster":return new Zh(r,e);case"symbol":return new Ku(r,e)}},z.bU=r=>r.type==="raster",z.bV=_t,z.bW=function(r,e){if(!r)return[{command:"setStyle",args:[e]}];let i=[];try{if(!lt(r.version,e.version))return[{command:"setStyle",args:[e]}];lt(r.center,e.center)||i.push({command:"setCenter",args:[e.center]}),lt(r.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),lt(r.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),lt(r.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),lt(r.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),lt(r.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),lt(r.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),lt(r.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),lt(r.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),lt(r.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),lt(r.light,e.light)||i.push({command:"setLight",args:[e.light]}),lt(r.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),lt(r.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),lt(r.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});let o={},n=[];(function(h,p,g,m){let v;for(v in p=p||{},h=h||{})Object.prototype.hasOwnProperty.call(h,v)&&(Object.prototype.hasOwnProperty.call(p,v)||Bi(v,g,m));for(v in p)Object.prototype.hasOwnProperty.call(p,v)&&(Object.prototype.hasOwnProperty.call(h,v)?lt(h[v],p[v])||(h[v].type==="geojson"&&p[v].type==="geojson"&&ho(h,p,v)?Rt(g,{command:"setGeoJSONSourceData",args:[v,p[v].data]}):sa(v,p,g,m)):Kt(v,p,g))})(r.sources,e.sources,n,o);let l=[];r.layers&&r.layers.forEach((h=>{"source"in h&&o[h.source]?i.push({command:"removeLayer",args:[h.id]}):l.push(h)})),i=i.concat(n),(function(h,p,g){p=p||[];let m=(h=h||[]).map(po),v=p.map(po),_=h.reduce(la,{}),T=p.reduce(la,{}),x=m.slice(),M=Object.create(null),C,D,L,N,F;for(let j=0,U=0;j<m.length;j++)C=m[j],Object.prototype.hasOwnProperty.call(T,C)?U++:(Rt(g,{command:"removeLayer",args:[C]}),x.splice(x.indexOf(C,U),1));for(let j=0,U=0;j<v.length;j++)C=v[v.length-1-j],x[x.length-1-j]!==C&&(Object.prototype.hasOwnProperty.call(_,C)?(Rt(g,{command:"removeLayer",args:[C]}),x.splice(x.lastIndexOf(C,x.length-U),1)):U++,N=x[x.length-j],Rt(g,{command:"addLayer",args:[T[C],N]}),x.splice(x.length-j,0,C),M[C]=!0);for(let j=0;j<v.length;j++)if(C=v[j],D=_[C],L=T[C],!M[C]&&!lt(D,L))if(lt(D.source,L.source)&&lt(D["source-layer"],L["source-layer"])&&lt(D.type,L.type)){for(F in Wi(D.layout,L.layout,g,C,null,"setLayoutProperty"),Wi(D.paint,L.paint,g,C,null,"setPaintProperty"),lt(D.filter,L.filter)||Rt(g,{command:"setFilter",args:[C,L.filter]}),lt(D.minzoom,L.minzoom)&&lt(D.maxzoom,L.maxzoom)||Rt(g,{command:"setLayerZoomRange",args:[C,L.minzoom,L.maxzoom]}),D)Object.prototype.hasOwnProperty.call(D,F)&&F!=="layout"&&F!=="paint"&&F!=="filter"&&F!=="metadata"&&F!=="minzoom"&&F!=="maxzoom"&&(F.indexOf("paint.")===0?Wi(D[F],L[F],g,C,F.slice(6),"setPaintProperty"):lt(D[F],L[F])||Rt(g,{command:"setLayerProperty",args:[C,F,L[F]]}));for(F in L)Object.prototype.hasOwnProperty.call(L,F)&&!Object.prototype.hasOwnProperty.call(D,F)&&F!=="layout"&&F!=="paint"&&F!=="filter"&&F!=="metadata"&&F!=="minzoom"&&F!=="maxzoom"&&(F.indexOf("paint.")===0?Wi(D[F],L[F],g,C,F.slice(6),"setPaintProperty"):lt(D[F],L[F])||Rt(g,{command:"setLayerProperty",args:[C,F,L[F]]}))}else Rt(g,{command:"removeLayer",args:[C]}),N=x[x.lastIndexOf(C)+1],Rt(g,{command:"addLayer",args:[L,N]})})(l,e.layers,i)}catch(o){console.warn("Unable to compute style diff:",o),i=[{command:"setStyle",args:[e]}]}return i},z.bX=function(r){let e=[],i=r.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},z.bY=di,z.bZ=vi,z.b_=class extends ai{constructor(r,e){super(r,e),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},z.ba=Gf,z.bb=ol,z.bc=function(r,e,i,o,n){var l=1/Math.tan(e/2);if(r[0]=l/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,n!=null&&n!==1/0){var h=1/(o-n);r[10]=(n+o)*h,r[14]=2*n*o*h}else r[10]=-1,r[14]=-2*o;return r},z.bd=function(r){var e=new Ge(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},z.be=function(r,e,i){var o=Math.sin(i),n=Math.cos(i),l=e[0],h=e[1],p=e[2],g=e[3],m=e[4],v=e[5],_=e[6],T=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=l*n+m*o,r[1]=h*n+v*o,r[2]=p*n+_*o,r[3]=g*n+T*o,r[4]=m*n-l*o,r[5]=v*n-h*o,r[6]=_*n-p*o,r[7]=T*n-g*o,r},z.bf=function(r,e,i){var o=Math.sin(i),n=Math.cos(i),l=e[4],h=e[5],p=e[6],g=e[7],m=e[8],v=e[9],_=e[10],T=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=l*n+m*o,r[5]=h*n+v*o,r[6]=p*n+_*o,r[7]=g*n+T*o,r[8]=m*n-l*o,r[9]=v*n-h*o,r[10]=_*n-p*o,r[11]=T*n-g*o,r},z.bg=function(r,e){var i=e[0],o=e[1],n=e[2],l=e[3],h=e[4],p=e[5],g=e[6],m=e[7],v=e[8],_=e[9],T=e[10],x=e[11],M=e[12],C=e[13],D=e[14],L=e[15],N=i*p-o*h,F=i*g-n*h,j=i*m-l*h,U=o*g-n*p,G=o*m-l*p,re=n*m-l*g,oe=v*C-_*M,pe=v*D-T*M,ce=v*L-x*M,_e=_*D-T*C,ye=_*L-x*C,fe=T*L-x*D,ue=N*fe-F*ye+j*_e+U*ce-G*pe+re*oe;return ue?(r[0]=(p*fe-g*ye+m*_e)*(ue=1/ue),r[1]=(n*ye-o*fe-l*_e)*ue,r[2]=(C*re-D*G+L*U)*ue,r[3]=(T*G-_*re-x*U)*ue,r[4]=(g*ce-h*fe-m*pe)*ue,r[5]=(i*fe-n*ce+l*pe)*ue,r[6]=(D*j-M*re-L*F)*ue,r[7]=(v*re-T*j+x*F)*ue,r[8]=(h*ye-p*ce+m*oe)*ue,r[9]=(o*ce-i*ye-l*oe)*ue,r[10]=(M*G-C*j+L*N)*ue,r[11]=(_*j-v*G-x*N)*ue,r[12]=(p*pe-h*_e-g*oe)*ue,r[13]=(i*_e-o*pe+n*oe)*ue,r[14]=(C*F-M*U-D*N)*ue,r[15]=(v*U-_*F+T*N)*ue,r):null},z.bh=function(){let r=new Float32Array(16);return je(r),r},z.bi=function(){let r=new Float64Array(16);return je(r),r},z.bj=function(){return new Float64Array(16)},z.bk=function(r,e,i){let o=new Float64Array(4);return Ee(o,r,e-90,i),o},z.bl=function(r,e,i,o){var n,l,h,p,g,m=e[0],v=e[1],_=e[2],T=e[3],x=i[0],M=i[1],C=i[2],D=i[3];return(l=m*x+v*M+_*C+T*D)<0&&(l=-l,x=-x,M=-M,C=-C,D=-D),1-l>mt?(n=Math.acos(l),h=Math.sin(n),p=Math.sin((1-o)*n)/h,g=Math.sin(o*n)/h):(p=1-o,g=o),r[0]=p*m+g*x,r[1]=p*v+g*M,r[2]=p*_+g*C,r[3]=p*T+g*D,r},z.bm=function(r){let e=new Float64Array(9);var i,o,n,l,h,p,g,m,v,_,T,x,M,C,D,L,N,F;_=(n=(o=r)[0])*(g=n+n),T=(l=o[1])*g,M=(h=o[2])*g,C=h*(m=l+l),L=(p=o[3])*g,N=p*m,F=p*(v=h+h),(i=e)[0]=1-(x=l*m)-(D=h*v),i[3]=T-F,i[6]=M+N,i[1]=T+F,i[4]=1-_-D,i[7]=C-L,i[2]=M-N,i[5]=C+L,i[8]=1-_-x;let j=Je(-Math.asin(ht(e[2],-1,1))),U,G;return Math.hypot(e[5],e[8])<.001?(U=0,G=-Je(Math.atan2(e[3],e[4]))):(U=Je(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),G=Je(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:U,pitch:j+90,bearing:G}},z.bn=function(r,e){return r.roll==e.roll&&r.pitch==e.pitch&&r.bearing==e.bearing},z.bo=Ct,z.bp=Li,z.bq=Js,z.br=Mc,z.bs=Ks,z.bt=lr,z.bu=ti,z.bv=bi,z.bw=function(r,e,i,o,n){return lr(o,n,ht((r-e)/(i-e),0,1))},z.bx=function(r,e,i,o){return r[0]=e[0]+i[0]*o,r[1]=e[1]+i[1]*o,r[2]=e[2]+i[2]*o,r},z.by=dt,z.bz=function(){return new Float64Array(3)},z.c=Q,z.c$=fn,z.c0=class extends ai{constructor(r,e){super(r,e),this.current=Vo}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},z.c1=Cr,z.c2=class extends ai{constructor(r,e){super(r,e),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},z.c3=class extends ai{constructor(r,e){super(r,e),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},z.c4=Fi,z.c5=function(r,e){var i=Math.sin(e),o=Math.cos(e);return r[0]=o,r[1]=i,r[2]=0,r[3]=-i,r[4]=o,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},z.c6=function(r,e,i){var o=e[0],n=e[1],l=e[2];return r[0]=o*i[0]+n*i[3]+l*i[6],r[1]=o*i[1]+n*i[4]+l*i[7],r[2]=o*i[2]+n*i[5]+l*i[8],r},z.c7=function(r,e,i,o,n,l,h){var p=1/(e-i),g=1/(o-n),m=1/(l-h);return r[0]=-2*p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*m,r[11]=0,r[12]=(e+i)*p,r[13]=(n+o)*g,r[14]=(h+l)*m,r[15]=1,r},z.c8=class extends ai{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(4*r.length);for(let i=0;i<r.length;i++)e[4*i]=r[i].r,e[4*i+1]=r[i].g,e[4*i+2]=r[i].b,e[4*i+3]=r[i].a;this.gl.uniform4fv(this.location,e)}}},z.c9=class extends ai{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(r);this.gl.uniform1fv(this.location,e)}}},z.cA=function(r,e){return Yt[e]&&"touches"in r},z.cB=function(r){return Yt[r]||jt[r]},z.cC=function(r,e,i){var o=e[0],n=e[1];return r[0]=i[0]*o+i[4]*n+i[12],r[1]=i[1]*o+i[5]*n+i[13],r},z.cD=function(r,e){let{x:i,y:o}=Lc.fromLngLat(e);return!(r<0||r>25||o<0||o>=1||i<0||i>=1)},z.cE=function(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},z.cF=class extends Us{},z.cG=ge,z.cH=function(r,e){Q.REGISTERED_PROTOCOLS[r]=e},z.cI=function(r){delete Q.REGISTERED_PROTOCOLS[r]},z.cJ=function(r,e){let i={};for(let n=0;n<r.length;n++){let l=e&&e[r[n].id]||pu(r[n]);e&&(e[r[n].id]=l);let h=i[l];h||(h=i[l]=[]),h.push(r[n])}let o=[];for(let n in i)o.push(i[n]);return o},z.cK=Ne,z.cL=Zf,z.cM=Tm,z.cN=Cf,z.cO=function(r){var e,i;r.bucket.createArrays(),r.bucket.tilePixelRatio=He/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;let o=r.bucket.layers[0],n=o.layout,l=o._unevaluatedLayout._values,h={layoutIconSize:l["icon-size"].possiblyEvaluate(new Wt(r.bucket.zoom+1),r.canonical),layoutTextSize:l["text-size"].possiblyEvaluate(new Wt(r.bucket.zoom+1),r.canonical),textMaxSize:l["text-size"].possiblyEvaluate(new Wt(18))};if(r.bucket.textSizeData.kind==="composite"){let{minZoom:_,maxZoom:T}=r.bucket.textSizeData;h.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Wt(_),r.canonical),l["text-size"].possiblyEvaluate(new Wt(T),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){let{minZoom:_,maxZoom:T}=r.bucket.iconSizeData;h.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Wt(_),r.canonical),l["icon-size"].possiblyEvaluate(new Wt(T),r.canonical)]}let p=n.get("text-line-height")*ji,g=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",m=n.get("text-keep-upright"),v=n.get("text-size");for(let _ of r.bucket.features){let T=n.get("text-font").evaluate(_,{},r.canonical).join(","),x=v.evaluate(_,{},r.canonical),M=h.layoutTextSize.evaluate(_,{},r.canonical),C=h.layoutIconSize.evaluate(_,{},r.canonical),D={horizontal:{},vertical:void 0},L=_.text,N,F=[0,0];if(L){let G=L.toString(),re=n.get("text-letter-spacing").evaluate(_,{},r.canonical)*ji,oe=jh(G)?re:0,pe=n.get("text-anchor").evaluate(_,{},r.canonical),ce=Fm(o,_,r.canonical);if(!ce){let ue=n.get("text-radial-offset").evaluate(_,{},r.canonical);F=ue?Rm(pe,[ue*ji,Yd]):n.get("text-offset").evaluate(_,{},r.canonical).map((Ie=>Ie*ji))}let _e=g?"center":n.get("text-justify").evaluate(_,{},r.canonical),ye=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(_,{},r.canonical)*ji:1/0,fe=()=>{r.bucket.allowVerticalPlacement&&Ya(G)&&(D.vertical=Xu(L,r.glyphMap,r.glyphPositions,r.imagePositions,T,ye,p,pe,"left",oe,F,z.ax.vertical,!0,M,x))};if(!g&&ce){let ue=new Set;if(_e==="auto")for(let Fe=0;Fe<ce.values.length;Fe+=2)ue.add(Kd(ce.values[Fe]));else ue.add(_e);let Ie=!1;for(let Fe of ue)if(!D.horizontal[Fe])if(Ie)D.horizontal[Fe]=D.horizontal[0];else{let De=Xu(L,r.glyphMap,r.glyphPositions,r.imagePositions,T,ye,p,"center",Fe,oe,F,z.ax.horizontal,!1,M,x);De&&(D.horizontal[Fe]=De,Ie=De.positionedLines.length===1)}fe()}else{_e==="auto"&&(_e=Kd(pe));let ue=Xu(L,r.glyphMap,r.glyphPositions,r.imagePositions,T,ye,p,pe,_e,oe,F,z.ax.horizontal,!1,M,x);ue&&(D.horizontal[_e]=ue),fe(),Ya(G)&&g&&m&&(D.vertical=Xu(L,r.glyphMap,r.glyphPositions,r.imagePositions,T,ye,p,pe,_e,oe,F,z.ax.vertical,!1,M,x))}}let j=!1;if(!((e=_.icon)===null||e===void 0)&&e.name){let G=r.imageMap[_.icon.name];G&&(N=I1(r.imagePositions[_.icon.name],n.get("icon-offset").evaluate(_,{},r.canonical),n.get("icon-anchor").evaluate(_,{},r.canonical)),j=!!G.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=j:r.bucket.sdfIcons!==j&&qt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(G.pixelRatio!==r.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}let U=Om(D.horizontal)||D.vertical;(i=r.bucket).iconsInText||(i.iconsInText=!!U&&U.iconsInText),(U||N)&&T_(r.bucket,_,D,N,r.imageMap,h,M,C,F,j,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},z.cP=id,z.cQ=ad,z.cR=bd,z.cS=function(r,e=""){let i=new Hu;return(function(o,n,l=""){for(let h in o.layers)n.writeMessage(3,((p,g)=>c_(p,g,l)),o.layers[h])})(r,i,e),i.finish()},z.cT=function(r,e,i,o,n,l){let h=Mm(r,e,i,n,0);return h=Mm(h,e,o,l,1),h},z.cU=class{constructor(r){this.maxEntries=r,this.map=new Map}get(r){let e=this.map.get(r);return e!==void 0&&(this.map.delete(r),this.map.set(r,e)),e}set(r,e){if(this.map.has(r))this.map.delete(r);else if(this.map.size>=this.maxEntries){let i=this.map.keys().next().value;this.map.delete(i)}this.map.set(r,e)}clear(){this.map.clear()}},z.cV=Xp,z.cW=Hu,z.cX=xm,z.cY=function(r,e,i,o,n){return u(this,void 0,void 0,(function*(){if(Gt())try{return yield ur(r,e,i,o,n)}catch{}return(function(l,h,p,g,m){let v=l.width,_=l.height;Ai&&Sr||(Ai=new OffscreenCanvas(v,_),Sr=Ai.getContext("2d",{willReadFrequently:!0})),Ai.width=v,Ai.height=_,Sr.drawImage(l,0,0,v,_);let T=Sr.getImageData(h,p,g,m);return Sr.clearRect(0,0,v,_),T.data})(r,e,i,o,n)}))},z.cZ=Bp,z.c_=class{constructor(r,e){this.layers={[Bc]:this},this.name=Bc,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=r.length,this.features=r}feature(r){return new l_(this.features[r],this.extent)}},z.ca=class extends Zs{},z.cb=n1,z.cc=class extends kn{},z.cd=Kh,z.ce=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},z.cf=Dp,z.cg=function(r,e,i){var o=e[0],n=e[1],l=e[2],h=i[3]*o+i[7]*n+i[11]*l+i[15];return r[0]=(i[0]*o+i[4]*n+i[8]*l+i[12])/(h=h||1),r[1]=(i[1]*o+i[5]*n+i[9]*l+i[13])/h,r[2]=(i[2]*o+i[6]*n+i[10]*l+i[14])/h,r},z.ch=class extends cc{},z.ci=class extends Qa{},z.cj=function(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]},z.ck=function(r,e){var i=r[0],o=r[1],n=r[2],l=r[3],h=r[4],p=r[5],g=r[6],m=r[7],v=r[8],_=r[9],T=r[10],x=r[11],M=r[12],C=r[13],D=r[14],L=r[15],N=e[0],F=e[1],j=e[2],U=e[3],G=e[4],re=e[5],oe=e[6],pe=e[7],ce=e[8],_e=e[9],ye=e[10],fe=e[11],ue=e[12],Ie=e[13],Fe=e[14],De=e[15];return Math.abs(i-N)<=mt*Math.max(1,Math.abs(i),Math.abs(N))&&Math.abs(o-F)<=mt*Math.max(1,Math.abs(o),Math.abs(F))&&Math.abs(n-j)<=mt*Math.max(1,Math.abs(n),Math.abs(j))&&Math.abs(l-U)<=mt*Math.max(1,Math.abs(l),Math.abs(U))&&Math.abs(h-G)<=mt*Math.max(1,Math.abs(h),Math.abs(G))&&Math.abs(p-re)<=mt*Math.max(1,Math.abs(p),Math.abs(re))&&Math.abs(g-oe)<=mt*Math.max(1,Math.abs(g),Math.abs(oe))&&Math.abs(m-pe)<=mt*Math.max(1,Math.abs(m),Math.abs(pe))&&Math.abs(v-ce)<=mt*Math.max(1,Math.abs(v),Math.abs(ce))&&Math.abs(_-_e)<=mt*Math.max(1,Math.abs(_),Math.abs(_e))&&Math.abs(T-ye)<=mt*Math.max(1,Math.abs(T),Math.abs(ye))&&Math.abs(x-fe)<=mt*Math.max(1,Math.abs(x),Math.abs(fe))&&Math.abs(M-ue)<=mt*Math.max(1,Math.abs(M),Math.abs(ue))&&Math.abs(C-Ie)<=mt*Math.max(1,Math.abs(C),Math.abs(Ie))&&Math.abs(D-Fe)<=mt*Math.max(1,Math.abs(D),Math.abs(Fe))&&Math.abs(L-De)<=mt*Math.max(1,Math.abs(L),Math.abs(De))},z.cl=function(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},z.cm=r=>r.type==="circle",z.cn=r=>r.type==="heatmap",z.co=r=>r.type==="line",z.cp=r=>r.type==="fill",z.cq=r=>r.type==="fill-extrusion",z.cr=r=>r.type==="hillshade",z.cs=r=>r.type==="color-relief",z.ct=r=>r.type==="background",z.cu=r=>r.type==="custom",z.cv=Ar,z.cw=function(r,e,i){if(e<=0)return r;let o=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(r*o)/o:(i>0?Math.ceil(r*o-1e-9):Math.floor(r*o+1e-10))/o},z.cx=function(r,e,i){let o=gt(e.x-i.x,e.y-i.y),n=gt(r.x-i.x,r.y-i.y);var l,h;return Je(Math.atan2(o[0]*n[1]-o[1]*n[0],(l=o)[0]*(h=n)[0]+l[1]*h[1]))},z.cy=hi,z.cz=function(r,e){var i;if(!jt[e])return!1;let o=r?.target,n=((i=o?.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return r instanceof n.MouseEvent||r instanceof n.WheelEvent},z.d=Bt,z.d0=class{constructor(r,e){let i=(e=this.options=Object.assign({},X0,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let o=cd(r,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),o=pd(o,e),e.updateable&&(this.source=o),this.initializeIndex(o,e)}initializeIndex(r,e){this.tileIndex=e.cluster?new U0(e.clusterOptions):new H0(e),r.length&&this.tileIndex.initialize(r)}getTile(r,e,i){return e=+e,i=+i,(r=+r)<0||r>24?null:this.tileIndex.getTile(r,e,i)}updateData(r,e){let i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:o,source:n}=(function(l,h,p){let g=(function(v,_){return v?{removeAll:v.removeAll,remove:new Set(v.remove||[]),add:new Map(v.add?.map((T=>[_.promoteId?T.properties[_.promoteId]:T.id,T]))),update:new Map(v.update?.map((T=>[T.id,T])))}:{remove:new Set,add:new Map,update:new Map}})(h,p),m=[];if(g.removeAll&&(m=l,l=[]),g.remove.size||g.add.size){let v=[];for(let _ of l)(g.remove.has(_.id)||g.add.has(_.id))&&v.push(_);if(v.length){m.push(...v);let _=new Set(v.map((T=>T.id)));l=l.filter((T=>!_.has(T.id)))}if(g.add.size){let _=cd({type:"FeatureCollection",features:Array.from(g.add.values())},p);_=pd(_,p),m.push(..._),l.push(..._)}}if(g.update.size){let v=new Map,_=[];for(let T of l)g.update.has(T.id)?v.set(T.id,[...v.get(T.id)||[],T]):_.push(T);for(let[T,x]of g.update){let M=v.get(T);if(!M||M.length===0)continue;let C=V0(M,x,p);m.push(...M,...C),_.push(...C)}l=_}return{affected:m,source:l}})(this.source,r,i);e&&({affected:o,source:n}=this.filterUpdate(n,o,e)),o.length&&(this.source=n,this.tileIndex.updateIndex(n,o,i))}filterUpdate(r,e,i){let o=new Set;for(let n of r)n.id!=null&&(i(Gu(n))||(e.push(n),o.add(n.id)));return{affected:e,source:r=r.filter((n=>!o.has(n.id)))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map((r=>Gu(r)))}}updateClusterOptions(r,e){let i=this.options.cluster;this.options.cluster=r,this.options.clusterOptions=e,i!=r?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(r){return this.tileIndex.getClusterExpansionZoom(r)}getClusterChildren(r){return this.tileIndex.getChildren(r)}getClusterLeaves(r,e,i){return this.tileIndex.getLeaves(r,e,i)}},z.d1=aa,z.e=Xt,z.f=Re,z.g=we,z.h=r=>u(void 0,void 0,void 0,(function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(e)}catch(i){throw new Error(`Could not load image because of ${Bt(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),z.i=Nt,z.j=r=>new Promise(((e,i)=>{let o=new Image;o.onload=()=>{e(o),URL.revokeObjectURL(o.src),o.onload=null,window.requestAnimationFrame((()=>o.src=Qi))},o.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let n=new Blob([new Uint8Array(r)],{type:"image/png"});o.src=r.byteLength?URL.createObjectURL(n):Qi})),z.k=(r,e)=>be(Xt(r,{type:"json"}),e),z.l=Zt,z.m=be,z.n=it,z.o=(r,e)=>be(Xt(r,{type:"arrayBuffer"}),e),z.p=Mf,z.q=function(r){return new Hu(r).readFields(x1,[])},z.r=function(r){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(r))},z.s=Ii,z.t=xc,z.u=tr,z.v=Lh,z.w=qt,z.x=he,z.y=oc,z.z=Rh})),O("worker",["./shared"],(function(z){"use strict";class u{constructor(K,ee){this.keyCache={},K&&this.replace(K,ee)}replace(K,ee){this._layerConfigs={},this._layers={},this.update(K,[],ee)}update(K,ee,ne){for(let We of K){this._layerConfigs[We.id]=We;let ot=this._layers[We.id]=z.bT(We,ne);ot._featureFilter=z.ah(ot.filter,ne),this.keyCache[We.id]&&delete this.keyCache[We.id]}for(let We of ee)delete this.keyCache[We],delete this._layerConfigs[We],delete this._layers[We];this.familiesBySource={};let ve=z.cJ(Object.values(this._layerConfigs),this.keyCache);for(let We of ve){let ot=We.map((St=>this._layers[St.id])),Ve=ot[0];if(Ve.isHidden())continue;let Ee=Ve.source||"",nt=this.familiesBySource[Ee];nt||(nt=this.familiesBySource[Ee]={});let gt=Ve.sourceLayer||z.ag,He=nt[gt];He||(He=nt[gt]=[]),He.push(ot)}}}class se{constructor(K){let ee={},ne=[];for(let Ve in K){let Ee=K[Ve],nt=ee[Ve]={};for(let gt in Ee){let He=Ee[+gt];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;let St={x:0,y:0,w:He.bitmap.width+2,h:He.bitmap.height+2};ne.push(St),nt[gt]={rect:St,metrics:He.metrics}}}let{w:ve,h:We}=z.p(ne),ot=new z.t({width:ve||1,height:We||1});for(let Ve in K){let Ee=K[Ve];for(let nt in Ee){let gt=Ee[+nt];if(!gt||gt.bitmap.width===0||gt.bitmap.height===0)continue;let He=ee[Ve][nt].rect;z.t.copy(gt.bitmap,ot,{x:0,y:0},{x:He.x+1,y:He.y+1},gt.bitmap)}}this.image=ot,this.positions=ee}}z.cK("GlyphAtlas",se);class Ce{constructor(K){this.tileID=new z.a3(K.tileID.overscaledZ,K.tileID.wrap,K.tileID.canonical.z,K.tileID.canonical.x,K.tileID.canonical.y),this.uid=K.uid,this.zoom=K.zoom,this.pixelRatio=K.pixelRatio,this.tileSize=K.tileSize,this.source=K.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=K.showCollisionBoxes,this.collectResourceTiming=!!K.collectResourceTiming,this.returnDependencies=!!K.returnDependencies,this.promoteId=K.promoteId,this.inFlightDependencies=[]}parse(K,ee,ne,ve,We){return z._(this,void 0,void 0,(function*(){this.status="parsing",this.data=K,this.collisionBoxArray=new z.ae;let ot=new z.cL(Object.keys(K.layers).sort()),Ve=new z.cM(this.tileID,this.promoteId);Ve.bucketLayerIDs=[];let Ee={},nt={featureIndex:Ve,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:ne,subdivisionGranularity:We},gt=ee.familiesBySource[this.source];for(let _t in gt){let vt=K.layers[_t];if(!vt)continue;vt.version===1&&z.w(`Vector tile source "${this.source}" layer "${_t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let qt=ot.encode(_t),Pi=[];for(let Nt=0;Nt<vt.length;Nt++){let It=vt.feature(Nt),Pt=Ve.getId(It,_t);Pi.push({feature:It,id:Pt,index:Nt,sourceLayerIndex:qt})}for(let Nt of gt[_t]){let It=Nt[0];It.source!==this.source&&z.w(`layer.source = ${It.source} does not equal this.source = ${this.source}`),It.isHidden(this.zoom,!0)||($e(Nt,this.zoom,ne),(Ee[It.id]=It.createBucket({index:Ve.bucketLayerIDs.length,layers:Nt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qt,sourceID:this.source})).populate(Pi,nt,this.tileID.canonical),Ve.bucketLayerIDs.push(Nt.map((Pt=>Pt.id))))}}let He=z.bY(nt.glyphDependencies,(_t=>Object.keys(_t).map(Number)));for(let _t of this.inFlightDependencies)_t?.abort();this.inFlightDependencies=[];let St=Promise.resolve({});if(Object.keys(He).length){let _t=new AbortController;this.inFlightDependencies.push(_t),St=ve.sendAsync({type:"GG",data:{stacks:He,source:this.source,tileID:this.tileID,type:"glyphs"}},_t)}let Bt=Object.keys(nt.iconDependencies),dt=Promise.resolve({});if(Bt.length){let _t=new AbortController;this.inFlightDependencies.push(_t),dt=ve.sendAsync({type:"GI",data:{icons:Bt,source:this.source,tileID:this.tileID,type:"icons"}},_t)}let lr=Object.keys(nt.patternDependencies),ti=Promise.resolve({});if(lr.length){let _t=new AbortController;this.inFlightDependencies.push(_t),ti=ve.sendAsync({type:"GI",data:{icons:lr,source:this.source,tileID:this.tileID,type:"patterns"}},_t)}let Ar=nt.dashDependencies,hi=Promise.resolve({});if(Object.keys(Ar).length){let _t=new AbortController;this.inFlightDependencies.push(_t),hi=ve.sendAsync({type:"GDA",data:{dashes:Ar}},_t)}let[ht,yi,Xt,cr]=yield Promise.all([St,dt,ti,hi]),di=new se(ht),vi=new z.cN(yi,Xt);for(let _t in Ee){let vt=Ee[_t];vt instanceof z.af?($e(vt.layers,this.zoom,ne),z.cO({bucket:vt,glyphMap:ht,glyphPositions:di.positions,imageMap:yi,imagePositions:vi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:nt.subdivisionGranularity})):vt.hasDependencies&&(vt instanceof z.cP||vt instanceof z.cQ||vt instanceof z.cR)&&($e(vt.layers,this.zoom,ne),vt.addFeatures(nt,this.tileID.canonical,vi.patternPositions,cr))}return this.status="done",{buckets:Object.values(Ee).filter((_t=>!_t.isEmpty())),featureIndex:Ve,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:di.image,imageAtlas:vi,dashPositions:cr,glyphMap:this.returnDependencies?ht:null,iconMap:this.returnDependencies?yi:null,glyphPositions:this.returnDependencies?di.positions:null}}))}}function $e(Xe,K,ee){let ne=new z.J(K);for(let ve of Xe)ve.recalculate(ne,ee)}class Ye{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(K,ee){this.loading[K]=ee}finishLoading(K){delete this.loading[K]}abort(K){let ee=this.loading[K];ee?.abort&&(ee.abort.abort(),delete this.loading[K])}setParsing(K,ee){this.parsing[K]=ee}consumeParsing(K){let ee=this.parsing[K];if(ee)return delete this.parsing[K],ee}clearParsing(K){delete this.parsing[K]}markLoaded(K,ee){this.loaded[K]=ee}getLoaded(K){let ee=this.loaded[K];if(ee)return ee}removeLoaded(K){delete this.loaded[K]}clearLoaded(){this.loaded={}}}class Oe{constructor(K){this.start=`${K}#start`,this.end=`${K}#end`,this.measure=K,performance.mark(this.start)}finish(){performance.mark(this.end);let K=performance.getEntriesByName(this.measure);return K.length===0&&(performance.measure(this.measure,this.start,this.end),K=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),K}}class ut{constructor(K,ee,ne,ve,We){this.type=K,this.properties=ne||{},this.extent=We,this.pointsArray=ee,this.id=ve}loadGeometry(){return this.pointsArray.map((K=>K.map((ee=>new z.P(ee.x,ee.y)))))}}class Ue{constructor(K,ee,ne){this.version=2,this._myFeatures=K,this.name=ee,this.length=K.length,this.extent=ne}feature(K){return this._myFeatures[K]}}class ke{constructor(){this.layers={}}addLayer(K){this.layers[K.name]=K}}function Lt(Xe){let K=z.cS(Xe);return K.byteOffset===0&&K.byteLength===K.buffer.byteLength||(K=new Uint8Array(K)),{vectorTile:Xe,rawData:K.buffer}}function Gt(Xe,K,ee){let{extent:ne}=Xe,ve=Math.pow(2,ee.z-K.z),We=(ee.x-K.x*ve)*ne,ot=(ee.y-K.y*ve)*ne,Ve=[];for(let Ee=0;Ee<Xe.length;Ee++){let nt=Xe.feature(Ee),gt=nt.loadGeometry();for(let St of gt)for(let Bt of St)Bt.x=Bt.x*ve-We,Bt.y=Bt.y*ve-ot;let He=128;gt=z.cT(gt,nt.type,-He,-He,ne+He,ne+He),gt.length!==0&&Ve.push(new ut(nt.type,gt,nt.properties,nt.id,ne))}return new Ue(Ve,Xe.name,ne)}class mt{constructor(K,ee,ne){this.actor=K,this.layerIndex=ee,this.availableImages=ne,this.tileState=new Ye,this.overzoomedTileResultCache=new z.cU(1e3)}loadVectorTile(K,ee){try{return{vectorTile:K.encoding!=="mlt"?new z.cV(new z.cW(ee)):new z.cX(ee),rawData:ee}}catch(ne){let ve=new Uint8Array(ee),We=`Unable to parse the tile at ${K.request.url}, `;throw We+=ve[0]===31&&ve[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${z.d(ne).message}`,new Error(We)}}loadTile(K){return z._(this,void 0,void 0,(function*(){let{uid:ee,overzoomParameters:ne}=K;ne&&(K.request=ne.overzoomRequest);let ve=this._startRequestTiming(K),We=new Ce(K);this.tileState.startLoading(ee,We);let ot=new AbortController;We.abort=ot;try{let Ve=yield z.o(K.request,ot);if(K.etag&&K.etag===Ve.etag)return this.tileState.finishLoading(ee),this._getEtagUnmodifiedResult(Ve,ve);let Ee=this.loadVectorTile(K,Ve.data);if(this.tileState.finishLoading(ee),!Ee)return null;let{vectorTile:nt,rawData:gt}=Ee;ne&&({vectorTile:nt,rawData:gt}=this._getOverzoomTile(K,nt));let He=this._getExpiryData(Ve),St=this._finishRequestTiming(ve);We.vectorTile=nt,this.tileState.markLoaded(ee,We);let Bt={rawData:gt,cacheControl:He,resourceTiming:St};this.tileState.setParsing(ee,Bt);try{return yield this._parseWorkerTile(We,K,Bt)}finally{this.tileState.clearParsing(ee)}}catch(Ve){throw this.tileState.finishLoading(ee),We.status="done",this.tileState.markLoaded(ee,We),Ve}}))}_getEtagUnmodifiedResult(K,ee){let ne=this._getExpiryData(K),ve=this._finishRequestTiming(ee);return z.e({etagUnmodified:!0},ne,ve)}_parseWorkerTile(K,ee,ne){return z._(this,void 0,void 0,(function*(){let ve=yield K.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);if(ne){let{rawData:We,cacheControl:ot,resourceTiming:Ve}=ne;ve=z.e({rawTileData:We.slice(0),encoding:ee.encoding},ve,ot,Ve)}return ve}))}_getExpiryData({expires:K,cacheControl:ee,etag:ne}){let ve={};return K&&(ve.expires=K),ee&&(ve.cacheControl=ee),ne&&(ve.etag=ne),ve}_startRequestTiming(K){var ee;if(!((ee=K.request)===null||ee===void 0)&&ee.collectResourceTiming)return new Oe(K.request.url)}_finishRequestTiming(K){let ee=K?.finish();return ee?{resourceTiming:JSON.parse(JSON.stringify(ee))}:{}}_getOverzoomTile(K,ee){var ne;let{tileID:ve,source:We,overzoomParameters:ot}=K,{maxZoomTileID:Ve}=ot,Ee=`${Ve.key}_${ve.key}_${(ne=K.request)===null||ne===void 0?void 0:ne.url}`,nt=this.overzoomedTileResultCache.get(Ee);if(nt)return nt;let gt=new ke,He=this.layerIndex.familiesBySource[We];for(let Bt in He){let dt=ee.layers[Bt];if(!dt)continue;let lr=Gt(dt,Ve,ve.canonical);lr.length>0&&gt.addLayer(lr)}let St=Lt(gt);return this.overzoomedTileResultCache.set(Ee,St),St}reloadTile(K){return z._(this,void 0,void 0,(function*(){let ee=K.uid,ne=this.tileState.getLoaded(ee);if(!ne)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ne.showCollisionBoxes=K.showCollisionBoxes,ne.status==="parsing"){let ve=this.tileState.consumeParsing(ee);return yield this._parseWorkerTile(ne,K,ve)}if(ne.status==="done"&&ne.vectorTile)return yield this._parseWorkerTile(ne,K)}))}abortTile(K){return z._(this,void 0,void 0,(function*(){this.tileState.abort(K.uid)}))}removeTile(K){return z._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(K.uid)}))}}class Ge{constructor(){this.loaded={}}loadTile(K){return z._(this,void 0,void 0,(function*(){let{uid:ee,encoding:ne,rawImageData:ve,redFactor:We,greenFactor:ot,blueFactor:Ve,baseShift:Ee}=K,nt=ve.width+2,gt=ve.height+2,He=z.b(ve)?new z.R({width:nt,height:gt},yield z.cY(ve,-1,-1,nt,gt)):ve,St=new z.cZ(ee,He,ne,We,ot,Ve,Ee);return this.loaded||(this.loaded={}),this.loaded[ee]=St,St}))}removeTile(K){let ee=this.loaded,ne=K.uid;ee?.[ne]&&delete ee[ne]}}class Fi{constructor(K,ee,ne,ve=je){this.actor=K,this.layerIndex=ee,this.availableImages=ne,this.tileState=new Ye,this._createGeoJSONIndex=ve}loadVectorTile(K){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let{z:ee,x:ne,y:ve}=K.tileID.canonical,We=this._geoJSONIndex.getTile(ee,ne,ve);return We?Lt(new z.c_(We.features,{version:2,extent:z.a6})):null}loadTile(K){return z._(this,void 0,void 0,(function*(){let{uid:ee}=K,ne=new Ce(K);ne.abort=new AbortController;try{let ve=this.loadVectorTile(K);if(!ve)return null;let{vectorTile:We,rawData:ot}=ve;ne.vectorTile=We,this.tileState.markLoaded(ee,ne);let Ve={rawData:ot};this.tileState.setParsing(ee,Ve);try{return yield this._parseWorkerTile(ne,K,Ve)}finally{this.tileState.clearParsing(ee)}}catch(ve){throw ne.status="done",this.tileState.markLoaded(ee,ne),ve}}))}_reloadLoadedTile(K){return z._(this,void 0,void 0,(function*(){let ee=K.uid,ne=this.tileState.getLoaded(ee);if(!ne)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ne.showCollisionBoxes=K.showCollisionBoxes,ne.status==="parsing"){let ve=this.tileState.consumeParsing(ee);return yield this._parseWorkerTile(ne,K,ve)}if(ne.status==="done"&&ne.vectorTile)return yield this._parseWorkerTile(ne,K)}))}_parseWorkerTile(K,ee,ne){return z._(this,void 0,void 0,(function*(){let ve=yield K.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);if(ne){let{rawData:We}=ne;ve=z.e({rawTileData:We.slice(0),encoding:"mvt"},ve)}return ve}))}abortTile(K){return z._(this,void 0,void 0,(function*(){this.tileState.abort(K.uid)}))}removeTile(K){return z._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(K.uid)}))}loadData(K){return z._(this,void 0,void 0,(function*(){var ee;(ee=this._pendingRequest)===null||ee===void 0||ee.abort();let ne=this._startRequestTiming(K);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(K,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let ve={};return K.request&&(ve.data=K.data),this._finishRequestTiming(ne,K,ve),ve}catch(ve){if(delete this._pendingRequest,!z.$(ve))throw ve;return{abandoned:!0}}}))}_startRequestTiming(K){var ee;if(!((ee=K.request)===null||ee===void 0)&&ee.collectResourceTiming)return new Oe(K.request.url)}_finishRequestTiming(K,ee,ne){let ve=K?.finish();ve&&(ne.resourceTiming={[ee.source]:JSON.parse(JSON.stringify(ve))})}reloadTile(K){return this.tileState.getLoaded(K.uid)?this._reloadLoadedTile(K):this.loadTile(K)}loadAndProcessGeoJSON(K,ee){return z._(this,void 0,void 0,(function*(){var ne;if(K.request&&(K.data=(yield z.k(K.request,ee)).data),K.data)return K.data=this._filterGeoJSON(K.data,K.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(K.data,K));if(K.dataDiff)return(ne=this._geoJSONIndex)!==null&&ne!==void 0||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},K)),void this._geoJSONIndex.updateData(K.dataDiff,this._getFilterPredicate(K.filter));if(K.updateCluster&&this._geoJSONIndex.updateClusterOptions(K.geojsonVtOptions.cluster,xt(K)),this._geoJSONIndex==null)throw new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(K,ee){if(K.type!=="FeatureCollection")return K;let ne=this._getFilterPredicate(ee);return ne?{type:"FeatureCollection",features:K.features.filter((ve=>ne(ve)))}:K}_getFilterPredicate(K){if(typeof K!="boolean"&&!K?.length)return;let ee=z.c$(K,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ee.result==="error")throw new Error(ee.value.map((ne=>`${ne.key}: ${ne.message}`)).join(", "));return ne=>ee.value.evaluate({zoom:0},ne)}removeSource(K){return z._(this,void 0,void 0,(function*(){var ee;(ee=this._pendingRequest)===null||ee===void 0||ee.abort()}))}getClusterExpansionZoom(K){return this._geoJSONIndex.getClusterExpansionZoom(K.clusterId)}getClusterChildren(K){return this._geoJSONIndex.getClusterChildren(K.clusterId)}getClusterLeaves(K){return this._geoJSONIndex.getClusterLeaves(K.clusterId,K.limit,K.offset)}}function je(Xe,K){let ee=z.e(K.geojsonVtOptions||{},{updateable:!0,clusterOptions:xt(K)});return new z.d0(Xe,ee)}function xt({geojsonVtOptions:Xe,clusterProperties:K}){if(!K||!Xe.clusterOptions)return Xe.clusterOptions;let ee={},ne={},ve={accumulated:null,zoom:0},We={properties:null},ot=Object.keys(K);for(let Ve of ot){let[Ee,nt]=K[Ve],gt=z.c$(nt),He=z.c$(typeof Ee=="string"?[Ee,["accumulated"],["get",Ve]]:Ee);ee[Ve]=gt.value,ne[Ve]=He.value}return Xe.clusterOptions.map=Ve=>{We.properties=Ve;let Ee={};for(let nt of ot)Ee[nt]=ee[nt].evaluate(ve,We);return Ee},Xe.clusterOptions.reduce=(Ve,Ee)=>{We.properties=Ee;for(let nt of ot)ve.accumulated=Ve[nt],Ve[nt]=ne[nt].evaluate(ve,We)},Xe.clusterOptions}class Se{constructor(K){this.self=K,this.actor=new z.N(K),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(ee,ne)=>{if(this.externalWorkerSourceTypes[ee])throw new Error(`Worker source with name "${ee}" already registered.`);this.externalWorkerSourceTypes[ee]=ne},this.self.addProtocol=z.cH,this.self.removeProtocol=z.cI,this.self.registerRTLTextPlugin=ee=>{z.d1.setMethods(ee)},this.self.makeRequest=z.m,this.actor.registerMessageHandler("LDT",((ee,ne)=>this._getDEMWorkerSource(ee,ne.source).loadTile(ne))),this.actor.registerMessageHandler("RDT",((ee,ne)=>z._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(ee,ne.source).removeTile(ne)})))),this.actor.registerMessageHandler("GCEZ",((ee,ne)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ne.type,ne.source).getClusterExpansionZoom(ne)})))),this.actor.registerMessageHandler("GCC",((ee,ne)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ne.type,ne.source).getClusterChildren(ne)})))),this.actor.registerMessageHandler("GCL",((ee,ne)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ne.type,ne.source).getClusterLeaves(ne)})))),this.actor.registerMessageHandler("LD",((ee,ne)=>this._getWorkerSource(ee,ne.type,ne.source).loadData(ne))),this.actor.registerMessageHandler("LT",((ee,ne)=>this._getWorkerSource(ee,ne.type,ne.source).loadTile(ne))),this.actor.registerMessageHandler("RT",((ee,ne)=>this._getWorkerSource(ee,ne.type,ne.source).reloadTile(ne))),this.actor.registerMessageHandler("AT",((ee,ne)=>this._getWorkerSource(ee,ne.type,ne.source).abortTile(ne))),this.actor.registerMessageHandler("RMT",((ee,ne)=>this._getWorkerSource(ee,ne.type,ne.source).removeTile(ne))),this.actor.registerMessageHandler("RS",((ee,ne)=>z._(this,void 0,void 0,(function*(){var ve,We;if(!(!((We=(ve=this.workerSources[ee])===null||ve===void 0?void 0:ve[ne.type])===null||We===void 0)&&We[ne.source]))return;let ot=this.workerSources[ee][ne.type][ne.source];delete this.workerSources[ee][ne.type][ne.source],ot.removeSource!==void 0&&ot.removeSource(ne)})))),this.actor.registerMessageHandler("RM",(ee=>z._(this,void 0,void 0,(function*(){delete this.layerIndexes[ee],delete this.availableImages[ee],delete this.workerSources[ee],delete this.demWorkerSources[ee],this.globalStates.delete(ee)})))),this.actor.registerMessageHandler("SR",((ee,ne)=>z._(this,void 0,void 0,(function*(){this.referrer=ne})))),this.actor.registerMessageHandler("SRPS",((ee,ne)=>this._syncRTLPluginState(ee,ne))),this.actor.registerMessageHandler("IS",((ee,ne)=>z._(this,void 0,void 0,(function*(){this.self.importScripts(ne)})))),this.actor.registerMessageHandler("SI",((ee,ne)=>this._setImages(ee,ne))),this.actor.registerMessageHandler("UL",((ee,ne)=>z._(this,void 0,void 0,(function*(){this._getLayerIndex(ee).update(ne.layers,ne.removedIds,this._getGlobalState(ee))})))),this.actor.registerMessageHandler("UGS",((ee,ne)=>z._(this,void 0,void 0,(function*(){let ve=this._getGlobalState(ee);for(let We in ne)ve[We]=ne[We]})))),this.actor.registerMessageHandler("SL",((ee,ne)=>z._(this,void 0,void 0,(function*(){this._getLayerIndex(ee).replace(ne,this._getGlobalState(ee))}))))}_getGlobalState(K){let ee=this.globalStates.get(K);return ee||(ee={},this.globalStates.set(K,ee)),ee}_setImages(K,ee){return z._(this,void 0,void 0,(function*(){this.availableImages[K]=ee;for(let ne in this.workerSources[K]){let ve=this.workerSources[K][ne];for(let We in ve)ve[We].availableImages=ee}}))}_syncRTLPluginState(K,ee){return z._(this,void 0,void 0,(function*(){return yield z.d1.syncState(ee,this.self.importScripts)}))}_getAvailableImages(K){let ee=this.availableImages[K];return ee||(ee=[]),ee}_getLayerIndex(K){let ee=this.layerIndexes[K];return ee||(ee=this.layerIndexes[K]=new u),ee}_getWorkerSource(K,ee,ne){var ve,We;if((ve=this.workerSources)[K]||(ve[K]={}),(We=this.workerSources[K])[ee]||(We[ee]={}),!this.workerSources[K][ee][ne]){let ot={sendAsync:(Ve,Ee)=>(Ve.targetMapId=K,this.actor.sendAsync(Ve,Ee))};switch(ee){case"vector":this.workerSources[K][ee][ne]=new mt(ot,this._getLayerIndex(K),this._getAvailableImages(K));break;case"geojson":this.workerSources[K][ee][ne]=new Fi(ot,this._getLayerIndex(K),this._getAvailableImages(K));break;default:this.workerSources[K][ee][ne]=new this.externalWorkerSourceTypes[ee](ot,this._getLayerIndex(K),this._getAvailableImages(K))}}return this.workerSources[K][ee][ne]}_getDEMWorkerSource(K,ee){var ne,ve;return(ne=this.demWorkerSources)[K]||(ne[K]={}),(ve=this.demWorkerSources[K])[ee]||(ve[ee]=new Ge),this.demWorkerSources[K][ee]}}return z.i(self)&&(self.worker=new Se(self)),Se})),O("index",["exports","./shared"],(function(z,u){"use strict";var se="5.24.1";function Ce(){var d=new u.A(4);return u.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}let $e,Ye,Oe,ut={frame(d,t,a,s){let c=s||window,f=c.requestAnimationFrame((b=>{y(),t(b)})),{unsubscribe:y}=u.s(d.signal,"abort",(()=>{y(),c.cancelAnimationFrame(f),a(new u.a(d.signal.reason))}),!1)},frameAsync(d,t){return new Promise(((a,s)=>{this.frame(d,a,s,t)}))},getImageData(d,t=0){return this.getImageCanvasContext(d).getImageData(-t,-t,d.width+2*t,d.height+2*t)},getImageCanvasContext(d){let t=window.document.createElement("canvas"),a=t.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return t.width=d.width,t.height=d.height,a.drawImage(d,0,0,d.width,d.height),a},resolveURL:d=>($e||($e=document.createElement("a")),$e.href=d,$e.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return Oe!==void 0?Oe:!!matchMedia&&(Ye!=null||(Ye=matchMedia("(prefers-reduced-motion: reduce)")),Ye.matches)},set prefersReducedMotion(d){Oe=d}},Ue=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:performance.now()}setNow(d){this._frozenAt=d}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function ke(){return Ue.getCurrentTime()}var Lt;let Gt=new Set(["a","abbr","b","bdi","bdo","br","cite","code","del","div","em","i","img","ins","kbd","li","mark","ol","p","q","s","samp","small","span","strong","sub","sup","time","u","ul","var","wbr"]),mt=new Set(["alt","class","datetime","dir","height","href","hreflang","lang","referrerpolicy","rel","role","src","target","title","translate","type","width"]),Ge=new Set(["href","src"]),Fi=new Set(["http:","https:","mailto:"]),je;function xt(){return je!=null||(je={getAttribute:Element.prototype.getAttribute,getAttributeNames:Element.prototype.getAttributeNames,querySelectorAll:Element.prototype.querySelectorAll,remove:Element.prototype.remove,removeAttribute:Element.prototype.removeAttribute,localName:Object.getOwnPropertyDescriptor(Element.prototype,"localName").get,namespaceURI:Object.getOwnPropertyDescriptor(Element.prototype,"namespaceURI").get}),je}class Se{static create(t,a,s){let c=window.document.createElement(t);return a!==void 0&&(c.className=a),s&&s.appendChild(c),c}static createNS(t,a){return window.document.createElementNS(t,a)}static disableDrag(){Se.docStyle&&Se.selectProp&&(Se.userSelect=Se.docStyle[Se.selectProp],Se.docStyle[Se.selectProp]="none")}static enableDrag(){Se.docStyle&&Se.selectProp&&(Se.docStyle[Se.selectProp]=Se.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",Se.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Se.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",Se.suppressClickInternal,!0)}),0)}static getScale(t){let a=t.getBoundingClientRect();return{x:a.width/t.offsetWidth||1,y:a.height/t.offsetHeight||1,boundingClientRect:a}}static getPoint(t,a,s){let c=a.boundingClientRect;return new u.P((s.clientX-c.left)/a.x-t.clientLeft,(s.clientY-c.top)/a.y-t.clientTop)}static mousePos(t,a){let s=Se.getScale(t);return Se.getPoint(t,s,a)}static touchPos(t,a){let s=[],c=Se.getScale(t);for(let f of a)s.push(Se.getPoint(t,c,f));return s}static sanitize(t){let a=new DOMParser().parseFromString(t,"text/html").body,{querySelectorAll:s,remove:c}=xt();for(let y of Array.from(s.call(a,"*")))Se.isAllowedElement(y)?Se.removeDisallowedAttributes(y):c.call(y);let f=document.createDocumentFragment();return f.append(...a.childNodes),f}static isAllowedElement(t){let{namespaceURI:a,localName:s}=xt();return a.call(t)==="http://www.w3.org/1999/xhtml"&&Gt.has(s.call(t))}static removeDisallowedAttributes(t){let{getAttributeNames:a,getAttribute:s,removeAttribute:c}=xt();for(let f of a.call(t))Se.isAllowedAttribute(f,s.call(t,f))||c.call(t,f)}static isAllowedAttribute(t,a){if(!mt.has(t)&&!t.startsWith("aria-"))return!1;if(!Ge.has(t))return!0;try{return Fi.has(new URL(a,"https://maplibre.invalid/").protocol)}catch{return!1}}}var Xe;Se.docStyle=typeof window<"u"&&((Lt=window.document)===null||Lt===void 0?void 0:Lt.documentElement.style),Se.selectProp=!Se.docStyle||"userSelect"in Se.docStyle?"userSelect":"webkitUserSelect",(function(d){let t,a,s,c;d.resetRequestQueue=()=>{t=[],a=0,s=0,c={}},d.addThrottleControl=w=>{let S=s++;return c[S]=w,S},d.removeThrottleControl=w=>{delete c[w],y()},d.getImage=(w,S,P=!0)=>new Promise(((A,k)=>{w.headers||(w.headers={}),w.headers.accept="image/webp,*/*",u.e(w,{type:"image"}),t.push({abortController:S,requestParameters:w,supportImageRefresh:P,state:"queued",onError:R=>{k(R)},onSuccess:R=>{A(R)}}),y()}));let f=w=>u._(this,void 0,void 0,(function*(){w.state="running";let{requestParameters:S,supportImageRefresh:P,onError:A,onSuccess:k,abortController:R}=w,V=P===!1&&!u.i(self)&&!u.g(S.url)&&(!S.headers||Object.keys(S.headers).reduce(((Z,Y)=>Z&&Y==="accept"),!0));a++;let q=V?b(S,R):u.m(S,R);try{let Z=yield q;delete w.abortController,w.state="completed",Z.data instanceof HTMLImageElement||u.b(Z.data)?k(Z):Z.data&&k({data:yield(H=Z.data,typeof createImageBitmap=="function"?u.h(H):u.j(H)),cacheControl:Z.cacheControl,expires:Z.expires})}catch(Z){delete w.abortController,A(u.d(Z))}finally{a--,y()}var H})),y=()=>{let w=(()=>{for(let S of Object.keys(c))if(c[S]())return!0;return!1})()?u.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let S=a;S<w&&t.length>0;S++){let P=t.shift();P.abortController.signal.aborted?S--:f(P)}},b=(w,S)=>new Promise(((P,A)=>{let k=new Image,R=w.url,V=w.credentials;V&&V==="include"?k.crossOrigin="use-credentials":(V&&V==="same-origin"||!u.f(R))&&(k.crossOrigin="anonymous"),S.signal.addEventListener("abort",(()=>{k.src="",A(new u.a(S.signal.reason))})),k.fetchPriority="high",k.onload=()=>{k.onerror=k.onload=null,P({data:k})},k.onerror=()=>{k.onerror=k.onload=null,S.signal.aborted||A(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."))},k.src=R}))})(Xe||(Xe={})),Xe.resetRequestQueue();class K{constructor(t){this._transformRequestFn=t??null}transformRequest(t,a){return this._transformRequestFn&&this._transformRequestFn(t,a)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function ee(d){let t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){let a=[];for(let{id:s,url:c}of d){let f=`${s}${c}`;a.includes(f)||(a.push(f),t.push({id:s,url:c}))}}return t}function ne(d,t,a){try{let s=new URL(d);return s.pathname+=`${t}${a}`,s.toString()}catch{throw new Error(`Invalid sprite URL "${d}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function ve(d){let{userImage:t}=d;return!(!t?.render||!t.render()||(d.data.replace(new Uint8Array(t.data.buffer)),0))}class We extends u.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(let t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:a,promiseResolve:s}of this.requestors)s(this._getImagesForIds(a));this.requestors=[]}}getImage(t){let a=this.images[t];if(a&&!a.data&&a.spriteData){let s=a.spriteData;a.data=new u.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),a.spriteData=null}return a}addImage(t,a){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,a)&&(this.images[t]=a)}_validate(t,a){let s=!0,c=a.data||a.spriteData;return this._validateStretch(a.stretchX,c?.width)||(this.fire(new u.l(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(a.stretchY,c?.height)||(this.fire(new u.l(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(a.content,a)||(this.fire(new u.l(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,a){if(!t)return!0;let s=0;for(let c of t){if(c[0]<s||c[1]<c[0]||a<c[1])return!1;s=c[1]}return!0}_validateContent(t,a){if(!t)return!0;if(t.length!==4)return!1;let s=a.spriteData,c=s?.width||a.data.width,f=s?.height||a.data.height;return!(t[0]<0||c<t[0]||t[1]<0||f<t[1]||t[2]<0||c<t[2]||t[3]<0||f<t[3]||t[2]<t[0]||!(t[3]>=t[1]))}updateImage(t,a,s=!0){let c=this.getImage(t);if(s&&(c.data.width!==a.data.width||c.data.height!==a.data.height))throw new Error(`size mismatch between old image (${c.data.width}x${c.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=c.version+1,this.images[t]=a,this.updatedImages[t]=!0}removeImage(t){var a;let s=this.images[t];delete this.images[t],delete this.patterns[t],!((a=s.userImage)===null||a===void 0)&&a.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((a,s)=>{let c=!0;if(!this.isLoaded())for(let f of t)this.images[f]||(c=!1);this.isLoaded()||c?a(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:a})}))}_getImagesForIds(t){var a;let s={};for(let c of t){let f=this.getImage(c);f||(this.fire(new u.n("styleimagemissing",{id:c})),f=this.getImage(c)),f?s[c]={data:f.data.clone(),pixelRatio:f.pixelRatio,sdf:f.sdf,version:f.version,stretchX:f.stretchX,stretchY:f.stretchY,content:f.content,textFitWidth:f.textFitWidth,textFitHeight:f.textFitHeight,hasRenderCallback:!!(!((a=f.userImage)===null||a===void 0)&&a.render)}:u.w(`Image "${c}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return s}getPixelSize(){let{width:t,height:a}=this.atlasImage;return{width:t,height:a}}getPattern(t){let a=this.patterns[t],s=this.getImage(t);if(!s)return null;if(a&&a.position.version===s.version)return a.position;if(a)a.position.version=s.version;else{let c={w:s.data.width+2,h:s.data.height+2,x:0,y:0},f=new u.I(c,s);this.patterns[t]={bin:c,position:f}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let a=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.T(t,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let f in this.patterns)t.push(this.patterns[f].bin);let{w:a,h:s}=u.p(t),c=this.atlasImage;c.resize({width:a||1,height:s||1});for(let f in this.patterns){let{bin:y}=this.patterns[f],b=y.x+1,w=y.y+1,S=this.getImage(f).data,P=S.width,A=S.height;u.R.copy(S,c,{x:0,y:0},{x:b,y:w},{width:P,height:A}),u.R.copy(S,c,{x:0,y:A-1},{x:b,y:w-1},{width:P,height:1}),u.R.copy(S,c,{x:0,y:0},{x:b,y:w+A},{width:P,height:1}),u.R.copy(S,c,{x:P-1,y:0},{x:b-1,y:w},{width:1,height:A}),u.R.copy(S,c,{x:0,y:0},{x:b+P,y:w},{width:1,height:A})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let a of t){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;let s=this.getImage(a);s||u.w(`Image with ID: "${a}" was not found`),ve(s)&&this.updateImage(a,s)}}cloneImages(){let t={};for(let a in this.images){let s=this.images[a];t[a]=Object.assign(Object.assign({},s),{data:s.data?s.data.clone():null})}return t}}let ot=1e20,Ve=new Float64Array(256);for(let d=0;d<256;d++){let t=.5-Math.pow(d/255,.45454545454545453);Ve[d]=t*Math.abs(t)}function Ee(d,t,a,s,c,f,y,b,w){for(let S=t;S<t+s;S++)nt(d,a*f+S,f,c,y,b,w);for(let S=a;S<a+c;S++)nt(d,S*f+t,1,s,y,b,w)}function nt(d,t,a,s,c,f,y){f[0]=0,y[0]=-ot,y[1]=ot,c[0]=d[t];for(let b=1,w=0,S=0;b<s;b++){c[b]=d[t+b*a];let P=b*b;do{let A=f[w];S=(c[b]-c[A]+P-A*A)/(b-A)/2}while(S<=y[w]&&--w>-1);w++,f[w]=b,y[w]=S,y[w+1]=ot}for(let b=0,w=0;b<s;b++){for(;y[w+1]<b;)w++;let S=f[w],P=b-S;d[t+b*a]=c[S]+P*P}}Ve[255]=-ot;let gt=u.v.layout_symbol["text-font"].default.join(",");class He{constructor(t,a,s){this.requestManager=t,this.localIdeographFontFamily=a,this.entries={},this.lang=s}setURL(t){this.url=t}getGlyphs(t){return u._(this,void 0,void 0,(function*(){let a=[];for(let f in t)for(let y of t[f])a.push(this._getAndCacheGlyphsPromise(f,y));let s=yield Promise.all(a),c={};for(let{stack:f,id:y,glyph:b}of s)c[f]||(c[f]={}),c[f][y]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics};return c}))}_getAndCacheGlyphsPromise(t,a){return u._(this,void 0,void 0,(function*(){var s,c;(s=(c=this.entries)[t])!==null&&s!==void 0||(c[t]={glyphs:{},requests:{},ranges:{}});let f=this.entries[t],y=f.glyphs[a];return y!==void 0?{stack:t,id:a,glyph:y}:!this.url||this._charUsesLocalIdeographFontFamily(a)?(y=f.glyphs[a]=this._drawGlyph(f,t,a),{stack:t,id:a,glyph:y}):yield this._downloadAndCacheRangePromise(t,a)}))}_downloadAndCacheRangePromise(t,a){return u._(this,void 0,void 0,(function*(){var s;let c=this.entries[t],f=Math.floor(a/256);if(c.ranges[f])return{stack:t,id:a,glyph:null};(s=c.requests)[f]||(s[f]=He.loadGlyphRange(t,f,this.url,this.requestManager));try{let y=yield c.requests[f];for(let b in y)c.glyphs[+b]=y[+b];return c.ranges[f]=!0,{stack:t,id:a,glyph:y[a]||null}}catch(y){let b=c.glyphs[a]=this._drawGlyph(c,t,a);return this._warnOnMissingGlyphRange(b,f,a,u.d(y)),{stack:t,id:a,glyph:b}}}))}_warnOnMissingGlyphRange(t,a,s,c){let f=256*a,y=f+255,b=s.toString(16).padStart(4,"0").toUpperCase();u.w(`Unable to load glyph range ${a}, ${f}-${y}. Rendering codepoint U+${b} locally instead. ${c}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&u.r(t)}_drawGlyph(t,a,s){let c=a===gt&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(s),f=c?"ideographTinySDF":"tinySDF";t[f]||(t[f]=this._createTinySDF(c?this.localIdeographFontFamily:a));let y=t[f].draw(String.fromCodePoint(s)),b=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(s));return{id:s,bitmap:new u.t({width:y.width||60,height:y.height||60},y.data),metrics:{width:b?0:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:b?0:y.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){let a=t?t.split(","):[];a.push("sans-serif");let s=a.map((c=>/[-\w]+/.test(c)?c:`'${CSS.escape(c)}'`)).join(",");return new He.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:s,fontWeight:this._fontWeight(a[0]),fontStyle:this._fontStyle(a[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let a={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},s;for(let[c,f]of Object.entries(a))new RegExp(`\\b${c}\\b`,"i").test(t)&&(s=`${f}`);return s}destroy(){for(let t in this.entries){let a=this.entries[t];a.tinySDF=null,a.ideographTinySDF=null,a.glyphs={},a.requests={},a.ranges={}}this.entries={}}}He.loadGlyphRange=function(d,t,a,s){return u._(this,void 0,void 0,(function*(){let c=256*t,f=c+255,y=yield s.transformRequest(a.replace("{fontstack}",d).replace("{range}",`${c}-${f}`),"Glyphs"),b=yield u.o(y,new AbortController);if(!b?.data)throw new Error(`Could not load glyph range. range: ${t}, ${c}-${f}`);let w={};for(let S of u.q(b.data))w[S.id]=S;return w}))},He.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:a=8,cutoff:s=.25,fontFamily:c="sans-serif",fontWeight:f="normal",fontStyle:y="normal",lang:b=null}={}){this.buffer=t,this.radius=a,this.cutoff=s,this.lang=b;let w=this.size=d+4*t,S=this._createCanvas(w),P=this.ctx=S.getContext("2d",{willReadFrequently:!0});P.font=`${y} ${f} ${d}px ${c}`,P.textBaseline="alphabetic",P.textAlign="left",P.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(d){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(d,d);let t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){let{width:t,actualBoundingBoxAscent:a,actualBoundingBoxDescent:s,actualBoundingBoxLeft:c,actualBoundingBoxRight:f}=this.ctx.measureText(d),y=Math.ceil(a),b=Math.floor(c),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(f)-b)),S=Math.max(0,Math.min(this.size-this.buffer,y+Math.ceil(s))),P=w+2*this.buffer,A=S+2*this.buffer,k=Math.max(P*A,0),R=new Uint8ClampedArray(k),V={data:R,width:P,height:A,glyphWidth:w,glyphHeight:S,glyphTop:y,glyphLeft:b,glyphAdvance:t};if(w===0||S===0)return V;let{ctx:q,buffer:H,gridInner:Z,gridOuter:Y}=this;this.lang&&(q.lang=this.lang),q.clearRect(H,H,w,S),q.fillText(d,H-b,H+y);let ie=q.getImageData(H,H,w,S);Y.fill(ot,0,k),Z.fill(0,0,k);let X=3;for(let J=0;J<S;J++){let le=(J+H)*P+H;for(let me=0;me<w;me++,X+=4,le++){let de=ie.data[X];if(de===0)continue;let Pe=Ve[de];Y[le]=Math.max(0,Pe),Z[le]=Math.max(0,-Pe)}}Ee(Y,0,0,P,A,P,this.f,this.v,this.z),Ee(Z,H,H,w,S,P,this.f,this.v,this.z);let W=255/this.radius,te=255*(1-this.cutoff);for(let J=0;J<k;J++){let le=Math.sqrt(Y[J])-Math.sqrt(Z[J]);R[J]=Math.round(te-W*le)}return V}};class St{constructor(){this.specification=u.x.light.position}possiblyEvaluate(t,a){return u.G(t.expression.evaluate(a))}interpolate(t,a,s){return{x:u.H.number(t.x,a.x,s),y:u.H.number(t.y,a.y,s),z:u.H.number(t.z,a.z,s)}}}let Bt;class dt extends u.E{constructor(t){super(),Bt||(Bt=new u.u({anchor:new u.D(u.x.light.anchor),position:new St,color:new u.D(u.x.light.color),intensity:new u.D(u.x.light.intensity)})),this._transitionable=new u.y(Bt,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,a={}){if(!this._validate(u.z,t,a))for(let s in t){let c=t[s];s.endsWith(u.B)?this._transitionable.setTransition(s.slice(0,-u.B.length),c):this._transitionable.setValue(s,c)}}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,a,s){return s?.validate!==!1&&u.C(this,t.call(u.F,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:u.x}))}}let lr=new u.u({"sky-color":new u.D(u.x.sky["sky-color"]),"horizon-color":new u.D(u.x.sky["horizon-color"]),"fog-color":new u.D(u.x.sky["fog-color"]),"fog-ground-blend":new u.D(u.x.sky["fog-ground-blend"]),"horizon-fog-blend":new u.D(u.x.sky["horizon-fog-blend"]),"sky-horizon-blend":new u.D(u.x.sky["sky-horizon-blend"]),"atmosphere-blend":new u.D(u.x.sky["atmosphere-blend"])});class ti extends u.E{constructor(t){super(),this._transitionable=new u.y(lr,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new u.J(0))}setSky(t,a={}){if(!this._validate(u.K,t,a)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let s in t){let c=t[s];s.endsWith(u.B)?this._transitionable.setTransition(s.slice(0,-u.B.length),c):this._transitionable.setValue(s,c)}}}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,a,s={}){return s?.validate!==!1&&u.C(this,t.call(u.F,u.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:u.x})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Ar{constructor(t,a){this.width=t,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,a){var s;let c=t.join(",")+String(a);return(s=this.dashEntry)[c]||(s[c]=this.addDash(t,a)),this.dashEntry[c]}getDashRanges(t,a,s){let c=[],f=t.length%2==1?-t[t.length-1]*s:0,y=t[0]*s,b=!0;c.push({left:f,right:y,isDash:b,zeroLength:t[0]===0});let w=t[0];for(let S=1;S<t.length;S++){b=!b;let P=t[S];f=w*s,w+=P,y=w*s,c.push({left:f,right:y,isDash:b,zeroLength:P===0})}return c}addRoundDash(t,a,s){let c=a/2;for(let f=-s;f<=s;f++){let y=this.width*(this.nextRow+s+f),b=0,w=t[b];for(let S=0;S<this.width;S++){S/w.right>1&&(w=t[++b]);let P=Math.abs(S-w.left),A=Math.abs(S-w.right),k=Math.min(P,A),R,V=f/s*(c+1);if(w.isDash){let q=c-Math.abs(V);R=Math.sqrt(k*k+q*q)}else R=c-Math.sqrt(k*k+V*V);this.data[y+S]=Math.max(0,Math.min(255,R+128))}}}addRegularDash(t){for(let b=t.length-1;b>=0;--b){let w=t[b],S=t[b+1];w.zeroLength?t.splice(b,1):S&&S.isDash===w.isDash&&(S.left=w.left,t.splice(b,1))}let a=t[0],s=t[t.length-1];a.isDash===s.isDash&&(a.left=s.left-this.width,s.right=a.right+this.width);let c=this.width*this.nextRow,f=0,y=t[f];for(let b=0;b<this.width;b++){b/y.right>1&&(y=t[++f]);let w=Math.abs(b-y.left),S=Math.abs(b-y.right),P=Math.min(w,S);this.data[c+b]=Math.max(0,Math.min(255,(y.isDash?P:-P)+128))}}addDash(t,a){let s=a?7:0,c=2*s+1;if(this.nextRow+c>this.height)return u.w("LineAtlas out of space"),null;let f=0;for(let b of t)f+=b;if(f!==0){let b=this.width/f,w=this.getDashRanges(t,this.width,b);a?this.addRoundDash(w,b,s):this.addRegularDash(w)}let y={y:this.nextRow+s,height:2*s,width:f};return this.nextRow+=c,this.dirty=!0,y}bind(t){let a=t.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}let hi="maplibre_preloaded_worker_pool";class ht{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<ht.workerCount;)this.workers.push(new Worker(u.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){if(delete this.active[t],this.numActive()===0){for(let a of this.workers)a.terminate();this.workers=null}}isPreloaded(){return!!this.active[hi]}numActive(){return Object.keys(this.active).length}}let yi=Math.floor(ut.hardwareConcurrency/2),Xt,cr;function di(){return Xt||(Xt=new ht),Xt}ht.workerCount=u.L(globalThis)?Math.max(Math.min(yi,3),1):1;class vi{constructor(t,a){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a;let s=this.workerPool.acquire(a);for(let c=0;c<s.length;c++){let f=new u.N(s[c],a);f.name=`Worker ${c}`,this.actors.push(f)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,a){let s=[];for(let c of this.actors)s.push(c.sendAsync({type:t,data:a}));return Promise.all(s)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){for(let a of this.actors)a.remove();this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,a){for(let s of this.actors)s.registerMessageHandler(t,a)}unregisterMessageHandler(t){for(let a of this.actors)a.unregisterMessageHandler(t)}}function _t(){return cr||(cr=new vi(di(),u.M),cr.registerMessageHandler("GR",((d,t,a)=>u.m(t,a)))),cr}function vt(d,t){let a=u.O();return u.Q(a,a,[1,1,0]),u.S(a,a,[.5*d.width,.5*d.height,1]),d.calculatePosMatrix?u.U(a,a,d.calculatePosMatrix(t.toUnwrapped())):a}function qt(d,t,a,s,c,f,y){var b;let w=(function(k,R,V){if(k)for(let q of k){let H=R[q];if(H?.source===V&&H.type==="fill-extrusion")return!0}else for(let q in R){let H=R[q];if(H.source===V&&H.type==="fill-extrusion")return!0}return!1})((b=c?.layers)!==null&&b!==void 0?b:null,t,d.id),S=f.maxPitchScaleFactor(),P=d.tilesIn(s,S,w);P.sort(Pi);let A=[];for(let k of P)A.push({wrappedTileID:k.tileID.wrapped().key,queryResults:k.tile.queryRenderedFeatures(t,a,d.getState(),k.queryGeometry,k.cameraQueryGeometry,k.scale,c,f,S,vt(f,k.tileID),y?(R,V)=>y(k.tileID,R,V):void 0)});return(function(k,R){for(let V in k)for(let q of k[V])Nt(q,R);return k})((function(k){let R={},V={};for(let{queryResults:q,wrappedTileID:H}of k){V[H]||(V[H]={});let Z=V[H];for(let Y in q){let ie=q[Y];Z[Y]||(Z[Y]={});let X=Z[Y];R[Y]||(R[Y]=[]);for(let W of ie)X[W.featureIndex]||(X[W.featureIndex]=!0,R[Y].push(W))}}return R})(A),d)}function Pi(d,t){let a=d.tileID,s=t.tileID;return a.overscaledZ-s.overscaledZ||a.canonical.y-s.canonical.y||a.wrap-s.wrap||a.canonical.x-s.canonical.x}function Nt(d,t){let a=d.feature,s=t.getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=s}function It(d,t,a,s){return u._(this,void 0,void 0,(function*(){let c=d;if(d.url?c=(yield u.k(yield t.transformRequest(d.url,"Source"),a)).data:yield ut.frameAsync(a,s),!c)return null;let f=u.V(u.e(c,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in c&&c.vector_layers&&(f.vectorLayerIds=c.vector_layers.map((y=>y.id))),f}))}class Pt{constructor(t,a){t&&(a?this.setSouthWest(t).setNorthEast(a):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 u.W?new u.W(t.lng,t.lat):u.W.convert(t),this}setSouthWest(t){return this._sw=t instanceof u.W?new u.W(t.lng,t.lat):u.W.convert(t),this}extend(t){let a=this._sw,s=this._ne,c,f;if(t instanceof u.W)c=t,f=t;else{if(!(t instanceof Pt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Pt.convert(t)):this.extend(u.W.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(u.W.convert(t)):this;if(c=t._sw,f=t._ne,!c||!f)return this}return a||s?(a.lng=Math.min(c.lng,a.lng),a.lat=Math.min(c.lat,a.lat),s.lng=Math.max(f.lng,s.lng),s.lat=Math.max(f.lat,s.lat)):(this._sw=new u.W(c.lng,c.lat),this._ne=new u.W(f.lng,f.lat)),this}getCenter(){return new u.W((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new u.W(this.getWest(),this.getNorth())}getSouthEast(){return new u.W(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){let{lng:a,lat:s}=u.W.convert(t),c=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&c}intersects(t){if(!((t=Pt.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let a=Math.abs(this.getEast()-this.getWest()),s=Math.abs(t.getEast()-t.getWest());if(a>=360||s>=360)return!0;let c=u.X(this.getWest(),-180,180),f=u.X(this.getEast(),-180,180),y=u.X(t.getWest(),-180,180),b=u.X(t.getEast(),-180,180),w=c>f,S=y>b;return!(!w||!S)||(w?b>=c||y<=f:S?f>=y||c<=b:y<=f&&b>=c)}static convert(t){return t instanceof Pt?t:t&&new Pt(t)}static fromLngLat(t,a=0){let s=360*a/40075017,c=s/Math.cos(Math.PI/180*t.lat);return new Pt(new u.W(t.lng-c,t.lat-s),new u.W(t.lng+c,t.lat+s))}adjustAntiMeridian(){let t=new u.W(this._sw.lng,this._sw.lat),a=new u.W(this._ne.lng,this._ne.lat);return new Pt(t,t.lng>a.lng?new u.W(a.lng+360,a.lat):a)}}class Qi{constructor(t,a,s){this.bounds=Pt.convert(this.validateBounds(t)),this.minzoom=a||0,this.maxzoom=s||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){let a=Math.pow(2,t.z),s=Math.floor(u.Z(this.bounds.getWest())*a),c=Math.floor(u.Y(this.bounds.getNorth())*a),f=Math.ceil(u.Z(this.bounds.getEast())*a),y=Math.ceil(u.Y(this.bounds.getSouth())*a);return t.x>=s&&t.x<f&&t.y>=c&&t.y<y}}class ur extends u.E{constructor(t,a,s,c){if(super(),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.e(this,u.V(a,["url","scheme","tileSize","promoteId","encoding"])),this._options=u.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(c)}load(){return u._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new u.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let a=yield It(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(u.e(this,a),a.bounds&&(this.tileBounds=new Qi(a.bounds,this.minzoom,this.maxzoom)),this.fire(new u.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,u.$(a)||this.fire(new u.l(u.d(a)))}}))}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(!0)}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 u.e({},this._options)}loadTile(t){return u._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:yield this.map._requestManager.transformRequest(a,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};s.request.collectResourceTiming=this._collectResourceTiming;let c="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((f,y)=>{t.reloadPromise={resolve:f,reject:y}}))}else t.actor=this.dispatcher.getActor(),c="LT";t.abortController=new AbortController;try{let f=yield t.actor.sendAsync({type:c,data:s},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,f);let y={};return f?.etagUnmodified&&(y.unmodified=!0),y}catch(f){if(delete t.abortController,t.aborted)return;if(f&&f.status!==404)throw f;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){return u._(this,void 0,void 0,(function*(){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let a=t.tileID.scaledTo(this.maxzoom).canonical,s=a.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:a,overzoomRequest:yield this.map._requestManager.transformRequest(s,"Tile")}}))}_afterTileLoadWorkerResponse(t,a){if(a?.resourceTiming&&(t.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&t.setExpiryData(a),t.etag=a?.etag,t.loadVectorData(a,this.map.painter),t.reloadPromise){let s=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(s.resolve).catch(s.reject)}}abortTile(t){return u._(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 u._(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 Ai extends u.E{constructor(t,a,s,c){super(),this.id=t,this.dispatcher=s,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.e({type:"raster"},a),u.e(this,u.V(a,["url","scheme","tileSize"]))}load(){return u._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new u.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let a=yield It(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(u.e(this,a),a.bounds&&(this.tileBounds=new Qi(a.bounds,this.minzoom,this.maxzoom)),this.fire(new u.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,u.$(a)||this.fire(new u.l(u.d(a)))}}))}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 u.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return u._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let s=yield Xe.getImage(yield this.map._requestManager.transformRequest(a,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(s?.data){this.map._refreshExpiredTiles&&(s.cacheControl||s.expires)&&t.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});let c=this.map.painter.context,f=c.gl,y=s.data;t.texture=this.map.painter.getTileTexture(y.width),t.texture?t.texture.update(y,{useMipmap:!0}):(t.texture=new u.T(c,y,f.RGBA,{useMipmap:!0}),t.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(s){if(delete t.abortController,t.aborted)t.state="unloaded";else if(s)throw t.state="errored",s}}))}abortTile(t){return u._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class Sr extends Ai{constructor(t,a,s,c){super(t,a,s,c),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(t){return u._(this,void 0,void 0,(function*(){let a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=yield this.map._requestManager.transformRequest(a,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let c=yield Xe.getImage(s,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(c?.data){let f=c.data;this.map._refreshExpiredTiles&&(c.cacheControl||c.expires)&&t.setExpiryData({cacheControl:c.cacheControl,expires:c.expires});let y=u.b(f)&&u.a0()?f:yield this.readImageNow(f),b={type:this.type,uid:t.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&t.state!=="expired"&&t.state!=="reloading")return;t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor()),t.dem=yield t.actor.sendAsync({type:"LDT",data:b}),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}catch(c){if(delete t.abortController,t.aborted)t.state="unloaded";else if(c)throw t.state="errored",c}}))}readImageNow(t){return u._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&u.a1()){let a=t.width+2,s=t.height+2;try{return new u.R({width:a,height:s},yield u.a2(t,-1,-1,a,s))}catch{}}return ut.getImageData(t,1)}))}_getNeighboringTiles(t){let a=t.canonical,s=Math.pow(2,a.z),c=(a.x-1+s)%s,f=a.x===0?t.wrap-1:t.wrap,y=(a.x+1+s)%s,b=a.x+1===s?t.wrap+1:t.wrap,w={};return w[new u.a3(t.overscaledZ,f,a.z,c,a.y).key]={backfilled:!1},w[new u.a3(t.overscaledZ,b,a.z,y,a.y).key]={backfilled:!1},a.y>0&&(w[new u.a3(t.overscaledZ,f,a.z,c,a.y-1).key]={backfilled:!1},w[new u.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},w[new u.a3(t.overscaledZ,b,a.z,y,a.y-1).key]={backfilled:!1}),a.y+1<s&&(w[new u.a3(t.overscaledZ,f,a.z,c,a.y+1).key]={backfilled:!1},w[new u.a3(t.overscaledZ,t.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},w[new u.a3(t.overscaledZ,b,a.z,y,a.y+1).key]={backfilled:!1}),w}unloadTile(t){return u._(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 Ii(d,t){return t?d.properties[t]:d.id}function Te(d,t){let a={id:d.id};if(t.removeAllProperties&&(delete d.removeProperties,delete d.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let s of t.removeProperties){let c=d.addOrUpdateProperties.findIndex((f=>f.key===s));c>-1&&d.addOrUpdateProperties.splice(c,1)}return(d.removeAllProperties||t.removeAllProperties)&&(a.removeAllProperties=!0),(d.removeProperties||t.removeProperties)&&(a.removeProperties=[...d.removeProperties||[],...t.removeProperties||[]]),(d.addOrUpdateProperties||t.addOrUpdateProperties)&&(a.addOrUpdateProperties=[...d.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(d.newGeometry||t.newGeometry)&&(a.newGeometry=t.newGeometry||d.newGeometry),a}function Je(d){var t,a;if(!d)return{};let s={};return s.removeAll=d.removeAll,s.remove=new Set(d.remove||[]),s.add=new Map((t=d.add)===null||t===void 0?void 0:t.map((c=>[c.id,c]))),s.update=new Map((a=d.update)===null||a===void 0?void 0:a.map((c=>[c.id,c]))),s}function Yt(d){return d&&d.length!==0?typeof d[0]=="number"?[d]:d.flatMap((t=>Yt(t))):[]}function jt(d){return d.type==="GeometryCollection"?d.geometries.flatMap((t=>jt(t))):Yt(d.coordinates)}function Zi(d){let t=new Pt,a;switch(d.type){case"FeatureCollection":a=d.features.flatMap((s=>jt(s.geometry)));break;case"Feature":a=jt(d.geometry);break;default:a=jt(d)}if(a.length===0)return t;for(let s of a){let[c,f]=s;t.extend([c,f])}return t}class hr extends u.E{constructor(t,a,s,c){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:a.data},this.actor=s.getActor(),this.setEventedParent(c),this._data=typeof a.data=="string"?{url:a.data}:{geojson:a.data},this._options=u.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId,a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&u.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=u.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(a.buffer!==void 0?a.buffer:128),tolerance:this._pixelsToTileUnits(a.tolerance!==void 0?a.tolerance:.375),extent:u.a6,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1,promoteId:typeof a.promoteId=="string"?a.promoteId:void 0,cluster:a.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(a.clusterMaxZoom),minPoints:Math.max(2,a.clusterMinPoints||2),extent:u.a6,radius:this._pixelsToTileUnits(a.clusterRadius||50),log:!1,generateId:a.generateId||!1}},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(u.a6/this.tileSize)}_getClusterMaxZoom(t){let a=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||u.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${a}"`),a}load(){return u._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,a){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};let s=this._updateWorkerData();return a?s:this}updateData(t,a){this._pendingWorkerUpdate.diff=(function(c,f){if(!c)return f||{};if(!f)return c||{};let y=Je(c),b=Je(f);(function(S,P){P.removeAll&&(S.add.clear(),S.update.clear(),S.remove.clear(),P.remove.clear());for(let A of P.remove)S.add.delete(A),S.update.delete(A);for(let[A,k]of P.update){let R=S.update.get(A);R&&(P.update.set(A,Te(R,k)),S.update.delete(A))}})(y,b);let w={};if((y.removeAll||b.removeAll)&&(w.removeAll=!0),w.remove=new Set([...y.remove,...b.remove]),w.add=new Map([...y.add,...b.add]),w.update=new Map([...y.update,...b.update]),w.remove.size&&w.add.size)for(let S of w.add.keys())w.remove.delete(S);return(function(S){let P={};return S.removeAll&&(P.removeAll=S.removeAll),S.remove&&(P.remove=Array.from(S.remove)),S.add&&(P.add=Array.from(S.add.values())),S.update&&(P.update=Array.from(S.update.values())),P})(w)})(this._pendingWorkerUpdate.diff,t);let s=this._updateWorkerData();return a?s:this}getData(){return u._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}))}getBounds(){return u._(this,void 0,void 0,(function*(){return Zi(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!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,a,s){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:a,offset:s}})}_updateWorkerData(){return u._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void u.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:a,updateCluster:s}=this._pendingWorkerUpdate,c=this._getLoadGeoJSONParameters(t,a,s);t!==void 0?this._pendingWorkerUpdate.data=void 0:a?this._pendingWorkerUpdate.diff=void 0:s&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(c)}))}_getLoadGeoJSONParameters(t,a,s){return u._(this,void 0,void 0,(function*(){let c=u.e({type:this.type},this.workerOptions);return typeof t=="string"?(c.request=yield this.map._requestManager.transformRequest(ut.resolveURL(t),"Source"),c.request.collectResourceTiming=this._collectResourceTiming,c):t!==void 0?(c.data=t,c):a?(c.dataDiff=a,c):s?(c.updateCluster=!0,c):void 0}))}_dispatchWorkerUpdate(t){return u._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new u.n("dataloading",{dataType:"source"}));try{let a=yield t,s=yield this.actor.sendAsync({type:"LD",data:a});if(this._isUpdatingWorker=!1,this._removed||s.abandoned)return void this.fire(new u.n("dataabort",{dataType:"source"}));s.data&&(this._data={geojson:s.data});let c=this._applyDiffToSource(a.dataDiff),f=this._getShouldReloadTileOptions(c),y={dataType:"source"};this._applyResourceTiming(y,s),this.fire(new u.n("data",Object.assign(Object.assign({},y),{sourceDataType:"metadata"}))),this.fire(new u.n("data",Object.assign(Object.assign({},y),{sourceDataType:"content",shouldReloadTileOptions:f})))}catch(a){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new u.n("dataabort",{dataType:"source"}));this.fire(new u.l(u.d(a)))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,a){var s;if(!this._collectResourceTiming)return;let c=(s=a.resourceTiming)===null||s===void 0?void 0:s[this.id];if(!c)return;let f=c.slice(0);f?.length&&u.e(t,{resourceTiming:f})}_applyDiffToSource(t){if(!t)return;let a=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let c=(function(f,y){let b=new Map;if(f==null||f.type==null)return b;if(f.type==="Feature"){let w=Ii(f,y);return w==null?void 0:(b.set(w,f),b)}if(f.type==="FeatureCollection"){let w=new Set;for(let S of f.features){let P=Ii(S,y);if(P==null||w.has(P))return;w.add(P),b.set(P,S)}return b}})(this._data.geojson,a);if(!c)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:c}}if(!this._data.updateable)return;let s=(function(c,f,y){var b,w;let S=[];if(f.removeAll)c.clear();else if(f.remove)for(let P of f.remove){let A=c.get(P);A&&(S.push(A.geometry),c.delete(P))}if(f.add)for(let P of f.add){let A=Ii(P,y);if(A==null)continue;let k=c.get(A);k&&S.push(k.geometry),S.push(P.geometry),c.set(A,P)}if(f.update)for(let P of f.update){let A=c.get(P.id);if(!A)continue;let k=!!P.newGeometry,R=P.removeAllProperties||((b=P.removeProperties)===null||b===void 0?void 0:b.length)>0||((w=P.addOrUpdateProperties)===null||w===void 0?void 0:w.length)>0;if(!k&&!R)continue;S.push(A.geometry);let V=Object.assign({},A);if(c.set(P.id,V),k&&(S.push(P.newGeometry),V.geometry=P.newGeometry),R){if(V.properties=P.removeAllProperties?{}:Object.assign({},V.properties||{}),P.removeProperties)for(let q of P.removeProperties)delete V.properties[q];if(P.addOrUpdateProperties)for(let{key:q,value:H}of P.addOrUpdateProperties)V.properties[q]=H}}return S})(this._data.updateable,t,a);return t.removeAll||this._options.cluster?void 0:s}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((a=>Zi(a)))}}shouldReloadTile(t,{affectedBounds:a}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;let{buffer:s,extent:c}=this.workerOptions.geojsonVtOptions,f=(function({x:y,y:b,z:w},S=0){let P=u.a4((y-S)/Math.pow(2,w)),A=u.a5((b+1+S)/Math.pow(2,w)),k=u.a4((y+1+S)/Math.pow(2,w)),R=u.a5((b-S)/Math.pow(2,w));return new Pt([P,A],[k,R])})(t.tileID.canonical,s/c);for(let y of a)if(f.intersects(y))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return u._(this,void 0,void 0,(function*(){let a=t.actor?"RT":"LT";t.actor=this.actor;let s={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;let c=yield this.actor.sendAsync({type:a,data:s},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(c,this.map.painter,a==="RT")}))}abortTile(t){return u._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return u.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 Ur extends u.E{constructor(t,a,s,c){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=s,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=a}load(t){return u._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new u.n("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let a=yield Xe.getImage(yield this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a?.data&&(this.image=a.data,t&&(this.coordinates=t),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,u.$(a)||this.fire(new u.l(u.d(a)))}}))}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 u.n("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;let a=t.map(u.a7.fromLngLat);var s;return this.tileID=(function(c){let f=u.a8.fromPoints(c),y=f.width(),b=f.height(),w=Math.max(y,b),S=Math.max(0,Math.floor(-Math.log(w)/Math.LN2)),P=Math.pow(2,S);return new u.aa(S,Math.floor((f.minX+f.maxX)/2*P),Math.floor((f.minY+f.maxY)/2*P))})(a),this.terrainTileRanges=this._getOverlappingTileRanges(a),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=a.map((c=>this.tileID.getTilePoint(c)._round())),this.flippedWindingOrder=((s=this.tileCoords)[1].x-s[0].x)*(s[2].y-s[0].y)-(s[1].y-s[0].y)*(s[2].x-s[0].x)<0,this.fire(new u.n("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,a=t.gl;this.texture||(this.texture=new u.T(t,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let s=!1;for(let c in this.tiles){let f=this.tiles[c];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,s=!0)}s&&this.fire(new u.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return u._(this,void 0,void 0,(function*(){var a;!((a=this.tileID)===null||a===void 0)&&a.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){let{minX:a,minY:s,maxX:c,maxY:f}=u.a8.fromPoints(t),y={};for(let b=0;b<=u.a9;b++){let w=Math.pow(2,b),S=Math.floor(a*w),P=Math.floor(s*w),A=Math.floor(c*w),k=Math.floor(f*w),R=(S%w+w)%w,V=A%w,q=Math.floor(S/w),H=Math.floor(A/w);y[b]={minWrap:q,maxWrap:H,minTileXWrapped:R,maxTileXWrapped:V,minTileY:P,maxTileY:k}}return y}}class Ga extends Ur{constructor(t,a,s,c){super(t,a,s,c),this._onPlayingHandler=()=>{var f;(f=this.map)===null||f===void 0||f.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=a}load(){return u._(this,void 0,void 0,(function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let a of t.urls)this.urls.push((yield this.map._requestManager.transformRequest(a,"Source")).url);try{let a=yield u.ab(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new u.l(u.d(a)))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let a=this.video.seekable;t<a.start(0)||t>a.end(0)?this.fire(new u.l(new u.ac(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,a=t.gl;this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new u.T(t,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let s=!1;for(let c in this.tiles){let f=this.tiles[c];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,s=!0)}s&&this.fire(new u.n("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 Q extends Ur{constructor(t,a,s,c){super(t,a,s,c),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some((f=>!Array.isArray(f)||f.length!==2||f.some((y=>typeof y!="number"))))||this.fire(new u.l(new u.ac(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.l(new u.ac(`sources.${t}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new u.l(new u.ac(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new u.l(new u.ac(`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 u.l(new u.ac(`sources.${t}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return u._(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 u.l(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;let a=this.map.painter.context,s=a.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new u.T(a,this.canvas,s.RGBA,{premultiply:!0}),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));let c=!1;for(let f in this.tiles){let y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,c=!0)}c&&this.fire(new u.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let we={},ae=d=>{switch(d){case"geojson":return hr;case"image":return Ur;case"raster":return Ai;case"raster-dem":return Sr;case"vector":return ur;case"video":return Ga;case"canvas":return Q}return we[d]},ge="RTLPluginLoaded";class qe extends u.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=_t()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((a=>{throw this.status="error",a}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return u._(this,arguments,void 0,(function*(a,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ut.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!s)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return u._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new u.n(ge))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let be=null;function Re(){return be||(be=new qe),be}var Ze,st;(function(d){d[d.Base=0]="Base",d[d.Parent=1]="Parent"})(Ze||(Ze={})),(function(d){d[d.Departing=0]="Departing",d[d.Incoming=1]="Incoming"})(st||(st={}));class it{constructor(t,a){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=u.ad(),this.uses=0,this.tileSize=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:a,fadingParentID:s,fadeEndTime:c}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=a,this.fadingParentID=s,this.fadeEndTime=c}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=ke(),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,a,s){if(t?.etagUnmodified!==!0)if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,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(c,f){let y={};if(!f)return y;for(let b of c){let w=b.layerIds.map((S=>f.getLayer(S))).filter(Boolean);if(w.length!==0){b.layers=w,b.stateDependentLayerIds&&(b.stateDependentLayers=b.stateDependentLayerIds.map((S=>w.filter((P=>P.id===S))[0])));for(let S of w)y[S.id]=b}}return y})(t.buckets,a?.style),this.hasSymbolBuckets=!1;for(let c in this.buckets){let f=this.buckets[c];if(f instanceof u.af){if(this.hasSymbolBuckets=!0,!s)break;f.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let c in this.buckets){let f=this.buckets[c];if(f instanceof u.af&&f.hasRTLText){this.hasRTLText=!0,Re().lazyLoad();break}}this.queryPadding=0;for(let c in this.buckets){let f=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(c).queryRadius(f))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new u.ae;else this.state="loaded"}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let s in this.buckets){let c=this.buckets[s];c.uploadPending()&&c.upload(t)}let a=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u.T(t,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u.T(t,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,a,s,c,f,y,b,w,S,P,A){var k;return!((k=this.latestFeatureIndex)===null||k===void 0)&&k.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:f,scale:y,tileSize:this.tileSize,pixelPosMatrix:P,transform:w,params:b,queryPadding:this.queryPadding*S,getElevation:A},t,a,s):{}}querySourceFeatures(t,a){let s=this.latestFeatureIndex;if(!s?.rawTileData)return;let c=s.loadVTLayers(),f=a?.sourceLayer?a.sourceLayer:"",y=c[u.ag]||c[f];if(!y)return;let b=u.ah(a?.filter,a?.globalState),{z:w,x:S,y:P}=this.tileID.canonical,A={z:w,x:S,y:P};for(let k=0;k<y.length;k++){let R=y.feature(k);if(b.needGeometry){let H=u.ai(R,!0);if(!b.filter(new u.J(this.tileID.overscaledZ),H,this.tileID.canonical))continue}else if(!b.filter(new u.J(this.tileID.overscaledZ),R))continue;let V=s.getId(R,f),q=new u.aj(R,w,S,P,V);q.tile=A,t.push(q)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let a=this.expirationTime;if(t.cacheControl){let s=u.ak(t.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let s=Date.now(),c=!1;if(this.expirationTime>s)c=!1;else if(a)if(this.expirationTime<a)c=!0;else{let f=this.expirationTime-a;f?this.expirationTime=s+Math.max(f,3e4):c=!0}else c=!0;c?(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,a){var s,c,f;if(!(!((s=this.latestFeatureIndex)===null||s===void 0)&&s.rawTileData)||Object.keys(t).length===0)return;let y=this.latestFeatureIndex.loadVTLayers();for(let b in this.buckets){if(!a.style.hasLayer(b))continue;let w=this.buckets[b],S=w.layers[0].sourceLayer||u.ag,P=y[S],A=t[S];if(!P||!A||Object.keys(A).length===0)continue;w.update(A,P,((c=this.imageAtlas)===null||c===void 0?void 0:c.patternPositions)||{},this.dashPositions||{});let k=(f=a?.style)===null||f===void 0?void 0:f.getLayer(b);k&&(this.queryPadding=Math.max(this.queryPadding,k.queryRadius(w)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ke()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=ke()+t}setDependencies(t,a){let s={};for(let c of a)s[c]=!0;this.dependencies[t]=s}hasDependency(t,a){for(let s of t){let c=this.dependencies[s];if(c){for(let f of a)if(c[f])return!0}}return!1}}class Zt{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,a,s){var c,f,y,b,w;let S=String(a);if((b=this.stateChanges)[t]||(b[t]={}),(w=this.stateChanges[t])[S]||(w[S]={}),u.e(this.stateChanges[t][S],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(let P in this.state[t])P!==S&&(this.deletedStates[t][P]=null)}else if(((c=this.deletedStates[t])===null||c===void 0?void 0:c[S])===null){this.deletedStates[t][S]={};for(let P in this.state[t][S])s[P]||(this.deletedStates[t][S][P]=null)}else for(let P in s)((y=(f=this.deletedStates[t])===null||f===void 0?void 0:f[S])===null||y===void 0?void 0:y[P])===null&&delete this.deletedStates[t][S][P]}removeFeatureState(t,a,s){var c,f,y;if(this.deletedStates[t]===null)return;let b=String(a);if((f=this.deletedStates)[t]||(f[t]={}),s&&a!==void 0)this.deletedStates[t][b]!==null&&((y=this.deletedStates[t])[b]||(y[b]={}),this.deletedStates[t][b][s]=null);else if(a!==void 0)if(!((c=this.stateChanges[t])===null||c===void 0)&&c[b])for(s in this.deletedStates[t][b]={},this.stateChanges[t][b])this.deletedStates[t][b][s]=null;else this.deletedStates[t][b]=null;else this.deletedStates[t]=null}getState(t,a){let s=String(a),c=u.e({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let f=this.deletedStates[t][a];if(f===null)return{};for(let y in f)delete c[y]}return c}initializeTileState(t,a){t.setFeatureState(this.state,a)}coalesceChanges(t,a){var s,c,f;let y={};for(let b in this.stateChanges){(s=this.state)[b]||(s[b]={});let w={};for(let S in this.stateChanges[b])(c=this.state[b])[S]||(c[S]={}),u.e(this.state[b][S],this.stateChanges[b][S]),w[S]=this.state[b][S];y[b]=w}for(let b in this.deletedStates){(f=this.state)[b]||(f[b]={});let w={};if(this.deletedStates[b]===null)for(let S in this.state[b])w[S]={},this.state[b][S]={};else for(let S in this.deletedStates[b]){if(this.deletedStates[b][S]===null)this.state[b][S]={};else for(let P of Object.keys(this.deletedStates[b][S]))delete this.state[b][S][P];w[S]=this.state[b][S]}y[b]||(y[b]={}),u.e(y[b],w)}this.stateChanges={},this.deletedStates={},Object.keys(y).length!==0&&(this.revision++,t.setFeatureState(y,a))}}let Dt=89.25;function he(d,t){let a=u.al(t.lat,-u.am,u.am);return new u.P(u.Z(t.lng)*d,u.Y(a)*d)}function $i(d,t){return new u.a7(t.x/d,t.y/d).toLngLat()}function Jr(d){return d.cameraToCenterDistance*Math.min(.85*Math.tan(u.an(90-d.pitch)),Math.tan(u.an(Dt-d.pitch)))}function lt(d,t){let a=d.canonical,s=t/u.ao(a.z),c=a.x+Math.pow(2,a.z)*d.wrap,f=u.ap(new Float64Array(16));return u.Q(f,f,[c*s,a.y*s,0]),u.S(f,f,[s/u.a6,s/u.a6,1]),f}function Rt(d,t,a,s,c){let f=u.a7.fromLngLat(d,t),y=c*u.aq(1,d.lat),{x:b,y:w,z:S}=Kt(a,s);return new u.a7(f.x+y*-b,f.y+y*-w,f.z+y*-S)}function Kt(d,t){let a=u.an(d),s=u.an(t),c=Math.cos(-a),f=Math.sin(a);return{x:f*Math.sin(s),y:-f*Math.cos(s),z:c}}function Bi(d,t,a){let s=t.intersectsFrustum(d);if(!a||s===0)return s;let c=t.intersectsPlane(a);return c===0?0:s===2&&c===2?2:1}function sa(d,t,a){let s=0,c=(a-t)/10;for(let f=0;f<10;f++)s+=c*Math.pow(Math.cos(t+(f+.5)/10*(a-t)),d);return s}function ho(d,t){return function(a,s,c,f,y){let b=2*((d-1)/u.ar(Math.cos(u.an(Dt-y))/Math.cos(u.an(Dt)))-1),w=Math.acos(c/f),S=2*sa(b-1,0,u.an(y/2)),P=Math.min(u.an(Dt),w+u.an(y/2)),A=sa(b-1,Math.min(P,w-u.an(y/2)),P),k=Math.atan(s/c),R=Math.hypot(s,c),V=a;return V+=u.ar(f/R/Math.max(.5,Math.cos(u.an(y/2)))),V+=b*u.ar(Math.cos(k))/2,V-=u.ar(Math.max(1,A/S/t))/2,V}}let Wi=ho(9.314,3);function po(d,t){let a=(t.roundZoom?Math.round:Math.floor)(d.zoom+u.ar(d.tileSize/t.tileSize));return Math.max(0,a)}function la(d,t){let a=d.getCameraFrustum(),s=d.getClippingPlane(),c=d.screenPointToMercatorCoordinate(d.getCameraPoint()),f=u.a7.fromLngLat(d.center,d.elevation);c.z=f.z+Math.cos(d.pitchInRadians)*d.cameraToCenterDistance/d.worldSize;let y=d.getCoveringTilesDetailsProvider(),b=y.allowVariableZoom(d,t),w=po(d,t),S=t.minzoom||0,P=t.maxzoom!==void 0?t.maxzoom:d.maxZoom,A=Math.min(Math.max(0,w),P),k=Math.pow(2,A),R=[k*c.x,k*c.y,0],V=[k*f.x,k*f.y,0],q=Math.hypot(f.x-c.x,f.y-c.y),H=Math.abs(f.z-c.z),Z=Math.hypot(q,H),Y=W=>({zoom:0,x:0,y:0,wrap:W,fullyVisible:!1}),ie=[],X=[];if(d.renderWorldCopies&&y.allowWorldCopies())for(let W=1;W<=3;W++)ie.push(Y(-W)),ie.push(Y(W));for(ie.push(Y(0));ie.length>0;){let W=ie.pop(),te=W.x,J=W.y,le=W.fullyVisible,me={x:te,y:J,z:W.zoom},de=y.getTileBoundingVolume(me,W.wrap,d.elevation,t);if(!le){let Le=Bi(a,de,s);if(Le===0)continue;le=Le===2}let Pe=y.distanceToTile2d(c.x,c.y,me,de),Me=w;b&&(Me=(t.calculateTileZoom||Wi)(d.zoom+u.ar(d.tileSize/t.tileSize),Pe,H,Z,d.fov)),Me=(t.roundZoom?Math.round:Math.floor)(Me),Me=Math.max(0,Me);let Qe=Math.min(Me,P);if(W.wrap=y.getWrap(f,me,W.wrap),W.zoom>=Qe){if(W.zoom<S)continue;let Le=A-W.zoom,xe=R[0]-.5-(te<<Le),et=R[1]-.5-(J<<Le),tt=t.reparseOverscaled?Math.max(W.zoom,Me):W.zoom;X.push({tileID:new u.a3(W.zoom===P?tt:W.zoom,W.wrap,W.zoom,te,J),distanceSq:u.as([V[0]-.5-te,V[1]-.5-J]),tileDistanceToCamera:Math.sqrt(xe*xe+et*et)})}else for(let Le=0;Le<4;Le++)ie.push({zoom:W.zoom+1,x:(te<<1)+Le%2,y:(J<<1)+(Le>>1),wrap:W.wrap,fullyVisible:le})}return X.sort(((W,te)=>W.distanceSq-te.distanceSq)).map((W=>W.tileID))}let ze=u.a8.fromPoints([new u.P(0,0),new u.P(u.a6,u.a6)]);function Qr(d){return d==="raster"||d==="image"||d==="video"}function kr(d,t,a,s,c,f,y){if(!t.hasData())return!1;let{tileID:b,fadingRole:w,fadingDirection:S,fadingParentID:P}=t;if(w===Ze.Base&&S===st.Incoming&&P)return a[P.key]=P,!0;let A=Math.max(b.overscaledZ-c,f);for(let k=b.overscaledZ-1;k>=A;k--){let R=b.scaledTo(k),V=d.getLoadedTile(R);if(V)return t.setCrossFadeLogic({fadingRole:Ze.Base,fadingDirection:st.Incoming,fadingParentID:V.tileID,fadeEndTime:s+y}),V.setCrossFadeLogic({fadingRole:Ze.Parent,fadingDirection:st.Departing,fadeEndTime:s+y}),a[R.key]=R,!0}return!1}function xl(d,t,a,s,c,f){if(!t.hasData())return!1;let y=t.tileID.children(c),b=fo(d,t,y,a,s,c,f);if(b)return!0;for(let w of y)fo(d,t,w.children(c),a,s,c,f)&&(b=!0);return b}function fo(d,t,a,s,c,f,y){if(a[0].overscaledZ>=f)return!1;let b=!1;for(let w of a){let S=d.getLoadedTile(w);if(!S)continue;let{fadingRole:P,fadingDirection:A,fadingParentID:k}=S;P===Ze.Base&&A===st.Departing&&k||(S.setCrossFadeLogic({fadingRole:Ze.Base,fadingDirection:st.Departing,fadingParentID:t.tileID,fadeEndTime:c+y}),t.setCrossFadeLogic({fadingRole:Ze.Parent,fadingDirection:st.Incoming,fadeEndTime:c+y})),s[w.key]=w,b=!0}return b}function Be(d,t,a,s){let c=d.tileID;return!!d.selfFading||!d.hasData()&&!!t.has(c)&&(d.setSelfFadeLogic(a+s),!0)}function pt(d,t){var a;d.needsHillshadePrepare=!0,d.needsTerrainPrepare=!0;let s=t.tileID.canonical.x-d.tileID.canonical.x,c=t.tileID.canonical.y-d.tileID.canonical.y,f=Math.pow(2,d.tileID.canonical.z),y=t.tileID.key;s===0&&c===0||Math.abs(c)>1||(Math.abs(s)>1&&(Math.abs(s+f)===1?s+=f:Math.abs(s-f)===1&&(s-=f)),t.dem&&d.dem&&(d.dem.backfillBorder(t.dem,s,c),!((a=d.neighboringTiles)===null||a===void 0)&&a[y]&&(d.neighboringTiles[y].backfilled=!0)))}class wt{constructor(){this._tiles={}}handleWrapJump(t){let a={};for(let s in this._tiles){let c=this._tiles[s];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+t),a[c.tileID.key]=c}this._tiles=a}setFeatureState(t,a){for(let s in this._tiles)this._tiles[s].setFeatureState(t,a)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((a=>a.tileID)).sort(u.au).map((a=>a.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,a){this._tiles[t]=a}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let a=this.getTileById(t.key);return a?.hasData()?a:null}isIdRenderable(t,a=!1){var s;return(s=this.getTileById(t))===null||s===void 0?void 0:s.isRenderable(a)}getRenderableIds(t=0,a){let s=[];for(let c of this.getAllIds())this.isIdRenderable(c,a)&&s.push(this.getTileById(c));return a?s.sort(((c,f)=>{let y=c.tileID,b=f.tileID,w=new u.P(y.canonical.x,y.canonical.y)._rotate(-t),S=new u.P(b.canonical.x,b.canonical.y)._rotate(-t);return y.overscaledZ-b.overscaledZ||S.y-w.y||S.x-w.x})).map((c=>c.tileID.key)):s.map((c=>c.tileID)).sort(u.au).map((c=>c.key))}}class Oi extends u.E{constructor(t,a,s){super(),this.id=t,this.dispatcher=s,this.on("data",(c=>{this._dataHandler(c)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((c,f,y,b)=>{let w=new(ae(f.type))(c,f,y,b);if(w.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${w.id}`);return w})(t,a,s,this),this._inViewTiles=new wt,this._outOfViewCache=new u.av(0,(c=>this._unloadTile(c))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new Zt,this._didEmitContent=!1,this._updated=!1}onAdd(t){var a;this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,!((a=this._source)===null||a===void 0)&&a.onAdd&&this._source.onAdd(t)}onRemove(t){var a;for(let s of this._inViewTiles.getAllTiles())s.unloadVectorData();this.clearTiles(),!((a=this._source)===null||a===void 0)&&a.onRemove&&this._source.onRemove(t),this._inViewTiles=new wt}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let 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;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,a,s){return u._(this,void 0,void 0,(function*(){try{let c=yield this._source.loadTile(t);this._tileLoaded(t,a,s,c)}catch(c){t.state="errored",c.status!==404?this._source.fire(new u.l(u.d(c),{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 u.n("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(let a of this._inViewTiles.getAllTiles())a.upload(t),a.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var a;return this._inViewTiles.getRenderableIds((a=this.transform)===null||a===void 0?void 0:a.bearingInRadians,t)}hasRenderableParent(t){let a=t.overscaledZ-1;if(a>=this._source.minzoom){let s=this.getLoadedTile(t.scaledTo(a));if(s)return this._inViewTiles.isIdRenderable(s.tileID.key)}return!1}reload(t,a=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let s of this._inViewTiles.getAllIds()){let c=this._inViewTiles.getTileById(s);a&&!this._source.shouldReloadTile(c,a)||(t?this._reloadTile(s,"expired"):c.state!=="errored"&&this._reloadTile(s,"reloading"))}}}_reloadTile(t,a){return u._(this,void 0,void 0,(function*(){let s=this._inViewTiles.getTileById(t);s&&(s.state!=="loading"&&(s.state=a),yield this._loadTile(s,t,a))}))}_tileLoaded(t,a,s,c){t.timeAdded=ke(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(a,t),c?.unmodified||(this.getSource().type==="raster-dem"&&t.dem&&(function(f,y){var b,w,S;let P=y.getRenderableIds();for(let A of P){if(!(!((b=f.neighboringTiles)===null||b===void 0)&&b[A]))continue;let k=y.getTileById(A);f.neighboringTiles[A].backfilled||pt(f,k),!((S=(w=k.neighboringTiles)===null||w===void 0?void 0:w[f.tileID.key])===null||S===void 0)&&S.backfilled||pt(k,f)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new u.n("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,a){let s=this._getLoadedDescendents(a),c=new Set;for(let f of a){let y=s[f.key];if(!y?.length){c.add(f);continue}let b=f.overscaledZ+Oi.maxOverzooming,w=y.filter((A=>A.tileID.overscaledZ<=b));if(!w.length){c.add(f);continue}let S=Math.min(...w.map((A=>A.tileID.overscaledZ))),P=w.filter((A=>A.tileID.overscaledZ===S)).map((A=>A.tileID));for(let A of P)t[A.key]=A;this._areDescendentsComplete(P,S,f.overscaledZ)||c.add(f)}return c}_getLoadedDescendents(t){var a;let s={};for(let c of this._inViewTiles.getAllTiles().filter((f=>f.hasData())))for(let f of t)c.tileID.isChildOf(f)&&(s[a=f.key]||(s[a]=[]),s[f.key].push(c));return s}_areDescendentsComplete(t,a,s){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===a:Math.pow(4,a-s)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let a=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(a*s*(this._maxTileCacheZoomLevels===null?u.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),f=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._outOfViewCache.setMaxSize(f)}handleWrapJump(t){let a=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,a&&(this._inViewTiles.handleWrapJump(a),this._resetTileReloadTimers())}update(t,a){if(!this._sourceLoaded||this._paused)return;let s;this.transform=t,this.terrain=a,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((w=>new u.a3(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y))):(s=la(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:a,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(s=s.filter((w=>this._source.hasTile(w))))):s=[],this.usedForTerrain&&(s=this._addTerrainIdealTiles(s));let c=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,c&&this.fire(new u.n("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let f=po(t,this._source),y=this._updateRetainedTiles(s,f),b=Qr(this._source.type);b&&this._rasterFadeDuration>0&&!a&&(function(w,S,P,A,k,R,V){let q=ke(),H=u.at(S);for(let Z of S){let Y=w.getTileById(Z.key);Y.fadingDirection!==st.Departing&&Y.fadeOpacity!==0||Y.resetFadeLogic(),kr(w,Y,P,q,A,k,V)||xl(w,Y,P,q,R,V)||Be(Y,H,q,V)||Y.resetFadeLogic()}})(this._inViewTiles,s,y,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),b?this._cleanUpRasterTiles(y):this._cleanUpVectorTiles(y)}_cleanUpRasterTiles(t){for(let a of this._inViewTiles.getAllIds())t[a]||this._removeTile(a)}_cleanUpVectorTiles(t){for(let a of this._inViewTiles.getAllIds()){let s=this._inViewTiles.getTileById(a);t[a]?s.clearSymbolFadeHold():s.hasSymbolBuckets?s.holdingForSymbolFade()?s.symbolFadeFinished()&&this._removeTile(a):s.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(a)}}_addTerrainIdealTiles(t){let a=[];for(let s of t)if(s.canonical.z>this._source.minzoom){let c=s.scaledTo(s.canonical.z-1);a.push(c);let f=s.scaledTo(Math.max(this._source.minzoom,Math.min(s.canonical.z,5)));a.push(f)}return t.concat(a)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,a){var s;let c=new Set;for(let S of t)this._addTile(S).hasData()||c.add(S);let f=t.reduce(((S,P)=>(S[P.key]=P,S)),{}),y=this._retainLoadedChildren(f,c),b={},w=Math.max(a-Oi.maxUnderzooming,this._source.minzoom);for(let S of y){let P=this._inViewTiles.getTileById(S.key),A=P?.wasRequested();for(let k=S.overscaledZ-1;k>=w;--k){let R=S.scaledTo(k);if(b[R.key])break;if(b[R.key]=!0,P=this.getTile(R),!P&&A&&(P=this._addTile(R)),P){let V=P.hasData();if((V||!(!((s=this.map)===null||s===void 0)&&s.cancelPendingTileRequestsWhileZooming)||A)&&(f[R.key]=R),A=P.wasRequested(),V)break}}}return f}_addTile(t){let a=this._inViewTiles.getTileById(t.key);if(a)return a;a=this._outOfViewCache.getAndRemove(t),a&&(a.resetFadeLogic(),this._setTileReloadTimer(t.key,a),a.tileID=t,this._state.initializeTileState(a,this.map?this.map.painter:null));let s=a;return a||(a=new it(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(a,t.key,a.state)),a.uses++,this._inViewTiles.setTile(t.key,a),s||this._source.fire(new u.n("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(t,a){this._clearTileReloadTimer(t);let s=a.getExpiryTimeout();s&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),s))}_clearTileReloadTimer(t){let a=this._timers[t];a&&(clearTimeout(a),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let a=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,a)}}refreshTiles(t){for(let a of this._inViewTiles.getAllIds()){let s=this._inViewTiles.getTileById(a);(this._inViewTiles.isIdRenderable(a)||s.state=="errored")&&t.some((c=>c.equals(s.tileID.canonical)))&&this._reloadTile(a,"expired")}}_removeTile(t){let a=this._inViewTiles.getTileById(t);a&&(a.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._outOfViewCache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_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(let t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,a,s){let c=[],f=this.transform;if(!f)return c;let y=f.getCoveringTilesDetailsProvider().allowWorldCopies(),b=s?f.getCameraQueryGeometry(t):t,w=R=>f.screenPointToMercatorCoordinate(R,this.terrain),S=this.transformBbox(t,w,!y),P=this.transformBbox(b,w,!y),A=this.getIds(),k=u.a8.fromPoints(P);for(let R of A){let V=this._inViewTiles.getTileById(R);if(V.holdingForSymbolFade())continue;let q=y?[V.tileID]:[V.tileID.unwrapTo(-1),V.tileID.unwrapTo(0)],H=Math.pow(2,f.zoom-V.tileID.overscaledZ),Z=a*V.queryPadding*u.a6/V.tileSize/H;for(let Y of q){let ie=k.map((X=>Y.getTilePoint(new u.a7(X.x,X.y))));if(ie.expandBy(Z),ie.intersects(ze)){let X=S.map((te=>Y.getTilePoint(te))),W=P.map((te=>Y.getTilePoint(te)));c.push({tile:V,tileID:y?Y:Y.unwrapTo(0),queryGeometry:X,cameraQueryGeometry:W,scale:H})}}}return c}transformBbox(t,a,s){let c=t.map(a);if(s){let f=u.a8.fromPoints(t);f.shrinkBy(.001*Math.min(f.width(),f.height()));let y=f.map(a);u.a8.fromPoints(c).covers(y)||(c=c.map((b=>b.x>.5?new u.a7(b.x-1,b.y,b.z):b)))}return c}getVisibleCoordinates(t){let a=this.getRenderableIds(t).map((s=>this._inViewTiles.getTileById(s).tileID));return this.transform&&this.transform.populateCache(a),a}hasTransition(){return!!this._source.hasTransition()||Qr(this._source.type)&&(function(t,a){if(a<=0)return!1;let s=ke();for(let c of t.getAllTiles())if(c.fadeEndTime>=s)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,a,s){t||(t=u.ag),this._state.updateState(t,a,s)}removeFeatureState(t,a,s){t||(t=u.ag),this._state.removeFeatureState(t,a,s)}getFeatureState(t,a){return t||(t=u.ag),this._state.getState(t,a)}setDependencies(t,a,s){let c=this._inViewTiles.getTileById(t);c&&c.setDependencies(a,s)}reloadTilesForDependencies(t,a){for(let s of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(s).hasDependency(t,a)&&this._reloadTile(s,"reloading");this._outOfViewCache.filter((s=>!s.hasDependency(t,a)))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}Oi.maxUnderzooming=10,Oi.maxOverzooming=3;class Xn{constructor(t,a){this.reset(t,a)}reset(t,a){this.points=t||[],this._distances=[0];for(let s=1;s<this.points.length;s++)this._distances[s]=this._distances[s-1]+this.points[s].dist(this.points[s-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=u.al(t,0,1);let a=1,s=this._distances[a],c=t*this.paddedLength+this.padding;for(;s<c&&a<this._distances.length;)s=this._distances[++a];let f=a-1,y=this._distances[f],b=s-y,w=b>0?(c-y)/b:0;return this.points[f].mult(1-w).add(this.points[a].mult(w))}}function ca(d,t){let a=!0;return d==="always"||d!=="never"&&t!=="never"||(a=!1),a}class bt{constructor(t,a,s){let c=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(a/s);for(let y=0;y<this.xCellCount*this.yCellCount;y++)c.push([]),f.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=a,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,a,s,c,f){this._forEachCell(a,s,c,f,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(a),this.bboxes.push(s),this.bboxes.push(c),this.bboxes.push(f)}insertCircle(t,a,s,c){this._forEachCell(a-c,s-c,a+c,s+c,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(a),this.circles.push(s),this.circles.push(c)}_insertBoxCell(t,a,s,c,f,y){this.boxCells[f].push(y)}_insertCircleCell(t,a,s,c,f,y){this.circleCells[f].push(y)}_query(t,a,s,c,f,y,b){if(s<0||t>this.width||c<0||a>this.height)return[];let w=[];if(t<=0&&a<=0&&this.width<=s&&this.height<=c){if(f)return[{key:null,x1:t,y1:a,x2:s,y2:c}];for(let S=0;S<this.boxKeys.length;S++)w.push({key:this.boxKeys[S],x1:this.bboxes[4*S],y1:this.bboxes[4*S+1],x2:this.bboxes[4*S+2],y2:this.bboxes[4*S+3]});for(let S=0;S<this.circleKeys.length;S++){let P=this.circles[3*S],A=this.circles[3*S+1],k=this.circles[3*S+2];w.push({key:this.circleKeys[S],x1:P-k,y1:A-k,x2:P+k,y2:A+k})}}else this._forEachCell(t,a,s,c,this._queryCell,w,{hitTest:f,overlapMode:y,seenUids:{box:{},circle:{}}},b);return w}query(t,a,s,c){return this._query(t,a,s,c,!1,null)}hitTest(t,a,s,c,f,y){return this._query(t,a,s,c,!0,f,y).length>0}hitTestCircle(t,a,s,c,f){let y=t-s,b=t+s,w=a-s,S=a+s;if(b<0||y>this.width||S<0||w>this.height)return!1;let P=[];return this._forEachCell(y,w,b,S,this._queryCellCircle,P,{hitTest:!0,overlapMode:c,circle:{x:t,y:a,radius:s},seenUids:{box:{},circle:{}}},f),P.length>0}_queryCell(t,a,s,c,f,y,b,w){let{seenUids:S,hitTest:P,overlapMode:A}=b,k=this.boxCells[f],R=1e-6;if(k!==null){let q=this.bboxes;for(let H of k)if(!S.box[H]){S.box[H]=!0;let Z=4*H,Y=this.boxKeys[H];if(t<=q[Z+2]+R&&a<=q[Z+3]+R&&s>=q[Z+0]-R&&c>=q[Z+1]-R&&(!w||w(Y))&&(!P||!ca(A,Y.overlapMode))&&(y.push({key:Y,x1:q[Z],y1:q[Z+1],x2:q[Z+2],y2:q[Z+3]}),P))return!0}}let V=this.circleCells[f];if(V!==null){let q=this.circles;for(let H of V)if(!S.circle[H]){S.circle[H]=!0;let Z=3*H,Y=this.circleKeys[H];if(this._circleAndRectCollide(q[Z],q[Z+1],q[Z+2],t,a,s,c)&&(!w||w(Y))&&(!P||!ca(A,Y.overlapMode))){let ie=q[Z],X=q[Z+1],W=q[Z+2];if(y.push({key:Y,x1:ie-W,y1:X-W,x2:ie+W,y2:X+W}),P)return!0}}}return!1}_queryCellCircle(t,a,s,c,f,y,b,w){let{circle:S,seenUids:P,overlapMode:A}=b,k=this.boxCells[f];if(k!==null){let V=this.bboxes;for(let q of k)if(!P.box[q]){P.box[q]=!0;let H=4*q,Z=this.boxKeys[q];if(this._circleAndRectCollide(S.x,S.y,S.radius,V[H+0],V[H+1],V[H+2],V[H+3])&&(!w||w(Z))&&!ca(A,Z.overlapMode))return y.push(!0),!0}}let R=this.circleCells[f];if(R!==null){let V=this.circles;for(let q of R)if(!P.circle[q]){P.circle[q]=!0;let H=3*q,Z=this.circleKeys[q];if(this._circlesCollide(V[H],V[H+1],V[H+2],S.x,S.y,S.radius)&&(!w||w(Z))&&!ca(A,Z.overlapMode))return y.push(!0),!0}}}_forEachCell(t,a,s,c,f,y,b,w){let S=this._convertToXCellCoord(t),P=this._convertToYCellCoord(a),A=this._convertToXCellCoord(s),k=this._convertToYCellCoord(c);for(let R=S;R<=A;R++)for(let V=P;V<=k;V++)if(f.call(this,t,a,s,c,this.xCellCount*V+R,y,b,w))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,a,s,c,f,y){let b=c-t,w=f-a,S=s+y;return S*S>b*b+w*w}_circleAndRectCollide(t,a,s,c,f,y,b){let w=(y-c)/2,S=Math.abs(t-(c+w));if(S>w+s)return!1;let P=(b-f)/2,A=Math.abs(a-(f+P));if(A>P+s)return!1;if(S<=w||A<=P)return!0;let k=S-w,R=A-P;return k*k+R*R<=s*s}}function Yn(d,t){let a=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),s=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),c=t[0]*a,f=t[4]*a,y=t[8]*s,b=t[1]*a,w=t[5]*a,S=t[9]*s,P=t[2]*a,A=t[6]*a,k=t[10]*s;d[0]=c,d[1]=f,d[2]=y,d[4]=b,d[5]=w,d[6]=S,d[8]=P,d[9]=A,d[10]=k;let R=t[12],V=t[13],q=t[14];return d[12]=-c*R-b*V-P*q,d[13]=-f*R-w*V-A*q,d[14]=-y*R-S*V-k*q,d[3]=0,d[7]=0,d[11]=0,d[15]=1,d}let Jo=u.O();function mo(d,t,a){let s=u.O();if(!d){let{vecSouth:A,vecEast:k}=go(t),R=Ce();R[0]=k[0],R[1]=k[1],R[2]=A[0],R[3]=A[1],c=R,(P=(y=(f=R)[0])*(S=f[3])-(w=f[2])*(b=f[1]))&&(c[0]=S*(P=1/P),c[1]=-b*P,c[2]=-w*P,c[3]=y*P),s[0]=R[0],s[1]=R[1],s[4]=R[2],s[5]=R[3]}var c,f,y,b,w,S,P;return u.S(s,s,[1/a,1/a,1]),s}function Qo(d,t,a,s){if(d){let c=u.O();if(!t){let{vecSouth:f,vecEast:y}=go(a);c[0]=y[0],c[1]=y[1],c[4]=f[0],c[5]=f[1]}return u.S(c,c,[s,s,1]),c}return a.pixelsToClipSpaceMatrix}function go(d){let t=Math.cos(d.rollInRadians),a=Math.sin(d.rollInRadians),s=Math.cos(d.pitchInRadians),c=Math.cos(d.bearingInRadians),f=Math.sin(d.bearingInRadians),y=u.az();y[0]=-c*s*a-f*t,y[1]=-f*s*a+c*t;let b=u.aA(y);b<1e-9?u.aB(y):u.aC(y,y,1/b);let w=u.az();w[0]=c*s*t-f*a,w[1]=f*s*t+c*a;let S=u.aA(w);return S<1e-9?u.aB(w):u.aC(w,w,1/S),{vecEast:w,vecSouth:y}}function Za(d,t,a,s){let c;s?(c=[d,t,s(d,t),1],u.aE(c,c,a)):(c=[d,t,0,1],Qn(c,c,a));let f=c[3];return{point:new u.P(c[0]/f,c[1]/f),signedDistanceFromCamera:f,isOccluded:!1}}function en(d,t){return .5+d/t*.5}function dr(d,t){return d.x>=-t[0]&&d.x<=t[0]&&d.y>=-t[1]&&d.y<=t[1]}function li(d,t,a,s,c,f,y,b,w,S,P,A,k){let R=a?d.textSizeData:d.iconSizeData,V=u.aw(R,t.transform.zoom),q=[256/t.width*2+1,256/t.height*2+1],H=a?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;H.clear();let Z=d.lineVertexArray,Y=a?d.text.placedSymbolArray:d.icon.placedSymbolArray,ie=t.transform.width/t.transform.height,X=!1;for(let W=0;W<Y.length;W++){let te=Y.get(W);if(te.hidden||te.writingMode===u.ax.vertical&&!X){yo(te.numGlyphs,H);continue}X=!1;let J=new u.P(te.anchorX,te.anchorY),le={getElevation:k,pitchedLabelPlaneMatrix:s,lineVertexArray:Z,pitchWithMap:f,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:J,unwrappedTileID:w,width:S,height:P,translation:A},me=wl(te.anchorX,te.anchorY,le);if(!dr(me.point,q)){yo(te.numGlyphs,H);continue}let de=en(t.transform.cameraToCenterDistance,me.signedDistanceFromCamera),Pe=u.ay(R,V,te),Me=f?Pe*t.transform.getPitchedTextCorrection(te.anchorX,te.anchorY,w)/de:Pe*de,Qe=Kn({projectionContext:le,pitchedLabelPlaneMatrixInverse:c,symbol:te,fontSize:Me,flip:!1,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:H,aspectRatio:ie,rotateToLine:b});X=Qe.useVertical,(Qe.notEnoughRoom||X||Qe.needsFlipping&&Kn({projectionContext:le,pitchedLabelPlaneMatrixInverse:c,symbol:te,fontSize:Me,flip:!0,keepUpright:y,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:H,aspectRatio:ie,rotateToLine:b}).notEnoughRoom)&&yo(te.numGlyphs,H)}a?d.text.dynamicLayoutVertexBuffer.updateData(H):d.icon.dynamicLayoutVertexBuffer.updateData(H)}function Vc(d,t,a,s,c,f,y,b){let w=f.glyphStartIndex+f.numGlyphs,S=f.lineStartIndex,P=f.lineStartIndex+f.lineLength,A=t.getoffsetX(f.glyphStartIndex),k=t.getoffsetX(w-1),R=Jn(d*A,a,s,c,f.segment,S,P,b,y);if(!R)return null;let V=Jn(d*k,a,s,c,f.segment,S,P,b,y);return V?b.projectionCache.anyProjectionOccluded?null:{first:R,last:V}:null}function _o(d,t,a,s){return d===u.ax.horizontal&&Math.abs(a.y-t.y)>Math.abs(a.x-t.x)*s?{useVertical:!0}:(d===u.ax.vertical?t.y<a.y:t.x>a.x)?{needsFlipping:!0}:null}function Kn(d){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:a,symbol:s,fontSize:c,flip:f,keepUpright:y,glyphOffsetArray:b,dynamicLayoutVertexArray:w,aspectRatio:S,rotateToLine:P}=d,A=c/24,k=s.lineOffsetX*A,R=s.lineOffsetY*A,V;if(s.numGlyphs>1){let q=s.glyphStartIndex+s.numGlyphs,H=s.lineStartIndex,Z=s.lineStartIndex+s.lineLength,Y=Vc(A,b,k,R,f,s,P,t);if(!Y)return{notEnoughRoom:!0};let ie=tn(Y.first.point.x,Y.first.point.y,t,a),X=tn(Y.last.point.x,Y.last.point.y,t,a);if(y&&!f){let W=_o(s.writingMode,ie,X,S);if(W)return W}V=[Y.first];for(let W=s.glyphStartIndex+1;W<q-1;W++){let te=Jn(A*b.getoffsetX(W),k,R,f,s.segment,H,Z,t,P);if(!te)return{notEnoughRoom:!0};V.push(te)}V.push(Y.last)}else{if(y&&!f){let H=za(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,Z=s.lineStartIndex+s.segment+1,Y=new u.P(t.lineVertexArray.getx(Z),t.lineVertexArray.gety(Z)),ie=za(Y.x,Y.y,t),X=ie.signedDistanceFromCamera>0?ie.point:Ia(t.tileAnchorPoint,Y,H,1,t),W=tn(H.x,H.y,t,a),te=tn(X.x,X.y,t,a),J=_o(s.writingMode,W,te,S);if(J)return J}let q=Jn(A*b.getoffsetX(s.glyphStartIndex),k,R,f,s.segment,s.lineStartIndex,s.lineStartIndex+s.lineLength,t,P);if(!q||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};V=[q]}for(let q of V)u.aD(w,q.point,q.angle);return{}}function Ia(d,t,a,s,c){let f=d.add(d.sub(t)._unit()),y=za(f.x,f.y,c).point,b=a.sub(y);return a.add(b._mult(s/b.mag()))}function ua(d,t,a){let s=t.projectionCache;if(s.projections[d])return s.projections[d];let c=new u.P(t.lineVertexArray.getx(d),t.lineVertexArray.gety(d)),f=za(c.x,c.y,t);if(f.signedDistanceFromCamera>0)return s.projections[d]=f.point,s.anyProjectionOccluded||(s.anyProjectionOccluded=f.isOccluded),f.point;let y=d-a.direction;return Ia(a.distanceFromAnchor===0?t.tileAnchorPoint:new u.P(t.lineVertexArray.getx(y),t.lineVertexArray.gety(y)),c,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,t)}function za(d,t,a){let s=d+a.translation[0],c=t+a.translation[1],f;return a.pitchWithMap?(f=Za(s,c,a.pitchedLabelPlaneMatrix,a.getElevation),f.isOccluded=!1):(f=a.transform.projectTileCoordinates(s,c,a.unwrappedTileID,a.getElevation),f.point.x=(.5*f.point.x+.5)*a.width,f.point.y=(.5*-f.point.y+.5)*a.height),f}function tn(d,t,a,s){if(a.pitchWithMap){let c=[d,t,0,1];return u.aE(c,c,s),a.transform.projectTileCoordinates(c[0]/c[3],c[1]/c[3],a.unwrappedTileID,a.getElevation).point}return{x:d/a.width*2-1,y:1-t/a.height*2}}function wl(d,t,a){return a.transform.projectTileCoordinates(d,t,a.unwrappedTileID,a.getElevation)}function Aa(d,t,a){return d._unit()._perp()._mult(t*a)}function Uc(d,t,a,s,c,f,y,b,w){if(b.projectionCache.offsets[d])return b.projectionCache.offsets[d];let S=a.add(t);if(d+w.direction<s||d+w.direction>=c)return b.projectionCache.offsets[d]=S,S;let P=ua(d+w.direction,b,w),A=Aa(P.sub(a),y,w.direction),k=a.add(A),R=P.add(A);return b.projectionCache.offsets[d]=u.aF(f,S,k,R)||S,b.projectionCache.offsets[d]}function Jn(d,t,a,s,c,f,y,b,w){let S=s?d-t:d+t,P=S>0?1:-1,A=0;s&&(P*=-1,A=Math.PI),P<0&&(A+=Math.PI);let k,R=P>0?f+c:f+c+1;b.projectionCache.cachedAnchorPoint?k=b.projectionCache.cachedAnchorPoint:(k=za(b.tileAnchorPoint.x,b.tileAnchorPoint.y,b).point,b.projectionCache.cachedAnchorPoint=k);let V,q,H=k,Z=k,Y=0,ie=0,X=Math.abs(S),W=[],te;for(;Y+ie<=X;){if(R+=P,R<f||R>=y)return null;Y+=ie,Z=H,q=V;let me={absOffsetX:X,direction:P,distanceFromAnchor:Y,previousVertex:Z};if(H=ua(R,b,me),a===0)W.push(Z),te=H.sub(Z);else{let de,Pe=H.sub(Z);de=Pe.mag()===0?Aa(ua(R+P,b,me).sub(H),a,P):Aa(Pe,a,P),q||(q=Z.add(de)),V=Uc(R,de,H,f,y,q,a,b,me),W.push(q),te=V.sub(q)}ie=te.mag()}let J=te._mult((X-Y)/ie)._add(q||Z),le=A+Math.atan2(H.y-Z.y,H.x-Z.x);return W.push(J),{point:J,angle:w?le:0,path:W}}let yh=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function yo(d,t){for(let a=0;a<d;a++){let s=t.length;t.resize(s+4),t.float32.set(yh,3*s)}}function Qn(d,t,a){let s=t[0],c=t[1];return d[0]=a[0]*s+a[4]*c+a[12],d[1]=a[1]*s+a[5]*c+a[13],d[3]=a[3]*s+a[7]*c+a[15],d}let ki=100;class Tl{constructor(t,a=new bt(t.width+200,t.height+200,25),s=new bt(t.width+200,t.height+200,25)){this.transform=t,this.grid=a,this.ignoredGrid=s,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+ki,this.screenBottomBoundary=t.height+ki,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,a,s,c,f,y,b,w,S,P,A,k){let R=this.projectAndGetPerspectiveRatio(t.anchorPointX+w[0],t.anchorPointY+w[1],f,P,k),V=s*R.perspectiveRatio,q;if(y||b)q=this._projectCollisionBox(t,V,c,f,y,b,w,R,P,A,k);else{let te=R.x+(A?A.x*V:0),J=R.y+(A?A.y*V:0);q={allPointsOccluded:!1,box:[te+t.x1*V,J+t.y1*V,te+t.x2*V,J+t.y2*V]}}let[H,Z,Y,ie]=q.box,X=y?q.allPointsOccluded:R.isOccluded,W=X;return W||(W=R.perspectiveRatio<this.perspectiveRatioCutoff),W||(W=!this.isInsideGrid(H,Z,Y,ie)),W||a!=="always"&&this.grid.hitTest(H,Z,Y,ie,a,S)?{box:[H,Z,Y,ie],placeable:!1,offscreen:!1,occluded:X}:{box:[H,Z,Y,ie],placeable:!0,offscreen:this.isOffscreen(H,Z,Y,ie),occluded:X}}placeCollisionCircles(t,a,s,c,f,y,b,w,S,P,A,k,R,V){let q=[],H=new u.P(a.anchorX,a.anchorY),Z=this.getPerspectiveRatio(H.x,H.y,y,V),Y=(S?f*this.transform.getPitchedTextCorrection(a.anchorX,a.anchorY,y)/Z:f*Z)/u.aJ,ie={getElevation:V,pitchedLabelPlaneMatrix:b,lineVertexArray:s,pitchWithMap:S,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:H,unwrappedTileID:y,width:this.transform.width,height:this.transform.height,translation:R},X=Vc(Y,c,a.lineOffsetX*Y,a.lineOffsetY*Y,!1,a,!1,ie),W=!1,te=!1,J=!0;if(X){let le=.5*A*Z+k,me=new u.P(-100,-100),de=new u.P(this.screenRightBoundary,this.screenBottomBoundary),Pe=new Xn,Me=X.first,Qe=X.last,Le=[];for(let tt=Me.path.length-1;tt>=1;tt--)Le.push(Me.path[tt]);for(let tt=1;tt<Qe.path.length;tt++)Le.push(Qe.path[tt]);let xe=2.5*le;if(S){let tt=this.projectPathToScreenSpace(Le,ie);Le=tt.some((Vt=>Vt.signedDistanceFromCamera<=0))?[]:tt.map((Vt=>Vt.point))}let et=[];if(Le.length>0){let tt=Le[0].clone(),Vt=Le[0].clone();for(let mi=1;mi<Le.length;mi++)tt.x=Math.min(tt.x,Le[mi].x),tt.y=Math.min(tt.y,Le[mi].y),Vt.x=Math.max(Vt.x,Le[mi].x),Vt.y=Math.max(Vt.y,Le[mi].y);et=tt.x>=me.x&&Vt.x<=de.x&&tt.y>=me.y&&Vt.y<=de.y?[Le]:Vt.x<me.x||tt.x>de.x||Vt.y<me.y||tt.y>de.y?[]:u.aG([Le],me.x,me.y,de.x,de.y)}for(let tt of et){Pe.reset(tt,.25*le);let Vt=0;Vt=Pe.length<=.5*le?1:Math.ceil(Pe.paddedLength/xe)+1;for(let mi=0;mi<Vt;mi++){let Qt=mi/Math.max(Vt-1,1),wi=Pe.lerp(Qt),Ti=wi.x+ki,Br=wi.y+ki;q.push(Ti,Br,le,0);let ci=Ti-le,Xi=Br-le,ai=Ti+le,Li=Br+le;if(J&&(J=this.isOffscreen(ci,Xi,ai,Li)),te||(te=this.isInsideGrid(ci,Xi,ai,Li)),t!=="always"&&this.grid.hitTestCircle(Ti,Br,le,t,P)&&(W=!0,!w))return{circles:[],offscreen:!1,collisionDetected:W}}}}return{circles:!w&&W||!te||Z<this.perspectiveRatioCutoff?[]:q,offscreen:J,collisionDetected:W}}projectPathToScreenSpace(t,a){let s=(function(c,f){let y=Jo;return(function(b,w){let S=1/(w[0]*w[5]-w[1]*w[4]);b[0]=w[5]*S,b[1]=-w[1]*S,b[2]=0,b[3]=0,b[4]=-w[4]*S,b[5]=w[0]*S,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=1/w[10],b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1/w[15]})(y,f.pitchedLabelPlaneMatrix),c.map((b=>{let w=Za(b.x,b.y,y,f.getElevation),S=f.transform.projectTileCoordinates(w.point.x,w.point.y,f.unwrappedTileID,f.getElevation);return S.point.x=(.5*S.point.x+.5)*f.width,S.point.y=(.5*-S.point.y+.5)*f.height,S}))})(t,a);return(function(c){let f=0,y=0,b=0,w=0;for(let S=0;S<c.length;S++)c[S].isOccluded?(b=S+1,w=0):(w++,w>y&&(y=w,f=b));return c.slice(f,f+y)})(s)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let a=[],s=new u.a8;for(let A of t){let k=new u.P(A.x+ki,A.y+ki);s.extend(k),a.push(k)}let{minX:c,minY:f,maxX:y,maxY:b}=s,w=this.grid.query(c,f,y,b).concat(this.ignoredGrid.query(c,f,y,b)),S={},P={};for(let A of w){let k=A.key;if(S[k.bucketInstanceId]===void 0&&(S[k.bucketInstanceId]={}),S[k.bucketInstanceId][k.featureIndex])continue;let R=[new u.P(A.x1,A.y1),new u.P(A.x2,A.y1),new u.P(A.x2,A.y2),new u.P(A.x1,A.y2)];u.aH(a,R)&&(S[k.bucketInstanceId][k.featureIndex]=!0,P[k.bucketInstanceId]===void 0&&(P[k.bucketInstanceId]=[]),P[k.bucketInstanceId].push(k.featureIndex))}return P}insertCollisionBox(t,a,s,c,f,y){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:c,featureIndex:f,collisionGroupID:y,overlapMode:a},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,a,s,c,f,y){let b=s?this.ignoredGrid:this.grid,w={bucketInstanceId:c,featureIndex:f,collisionGroupID:y,overlapMode:a};for(let S=0;S<t.length;S+=4)b.insertCircle(w,t[S],t[S+1],t[S+2])}projectAndGetPerspectiveRatio(t,a,s,c,f){if(f){let y;c?(y=[t,a,c(t,a),1],u.aE(y,y,f)):(y=[t,a,0,1],Qn(y,y,f));let b=y[3];return{x:(y[0]/b+1)/2*this.transform.width+ki,y:(-y[1]/b+1)/2*this.transform.height+ki,perspectiveRatio:.5+this.transform.cameraToCenterDistance/b*.5,isOccluded:!1,signedDistanceFromCamera:b}}{let y=this.transform.projectTileCoordinates(t,a,s,c);return{x:(y.point.x+1)/2*this.transform.width+ki,y:(1-y.point.y)/2*this.transform.height+ki,perspectiveRatio:.5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5,isOccluded:y.isOccluded,signedDistanceFromCamera:y.signedDistanceFromCamera}}}getPerspectiveRatio(t,a,s,c){let f=this.transform.projectTileCoordinates(t,a,s,c);return .5+this.transform.cameraToCenterDistance/f.signedDistanceFromCamera*.5}isOffscreen(t,a,s,c){return s<ki||t>=this.screenRightBoundary||c<ki||a>this.screenBottomBoundary}isInsideGrid(t,a,s,c){return s>=0&&t<this.gridRightBoundary&&c>=0&&a<this.gridBottomBoundary}getViewportMatrix(){let t=u.ap([]);return u.Q(t,t,[-100,-100,0]),t}_projectCollisionBox(t,a,s,c,f,y,b,w,S,P,A){let k=1,R=0,V=0,q=1,H=t.anchorPointX+b[0],Z=t.anchorPointY+b[1];if(y&&!f){let Le=this.projectAndGetPerspectiveRatio(H+1,Z,c,S,A),xe=Le.x-w.x,et=Math.atan((Le.y-w.y)/xe)+(xe<0?Math.PI:0),tt=Math.sin(et),Vt=Math.cos(et);k=Vt,R=tt,V=-tt,q=Vt}else if(!y&&f){let Le=go(this.transform);k=Le.vecEast[0],R=Le.vecEast[1],V=Le.vecSouth[0],q=Le.vecSouth[1]}let Y=w.x,ie=w.y,X=a;f&&(Y=H,ie=Z,X=Math.pow(2,-(this.transform.zoom-s.overscaledZ)),X*=this.transform.getPitchedTextCorrection(H,Z,c),P||(X*=u.al(.5+w.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),P&&(Y+=k*P.x*X+V*P.y*X,ie+=R*P.x*X+q*P.y*X);let W=t.x1*X,te=t.x2*X,J=(W+te)/2,le=t.y1*X,me=t.y2*X,de=(le+me)/2,Pe=[{offsetX:W,offsetY:le},{offsetX:J,offsetY:le},{offsetX:te,offsetY:le},{offsetX:te,offsetY:de},{offsetX:te,offsetY:me},{offsetX:J,offsetY:me},{offsetX:W,offsetY:me},{offsetX:W,offsetY:de}],Me=[];for(let{offsetX:Le,offsetY:xe}of Pe)Me.push(new u.P(Y+k*Le+V*xe,ie+R*Le+q*xe));let Qe=!1;if(f){let Le=Me.map((xe=>this.projectAndGetPerspectiveRatio(xe.x,xe.y,c,S,A)));Qe=Le.some((xe=>!xe.isOccluded)),Me=Le.map((xe=>new u.P(xe.x,xe.y)))}else Qe=!0;return{box:u.aI(Me),allPointsOccluded:!Qe}}}class es{constructor(t,a,s,c){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?a:-a))):c&&s?1:0,this.placed=s}isHidden(){return this.opacity===0&&!this.placed}}class vo{constructor(t,a,s,c,f){this.text=new es(t?t.text:null,a,s,f),this.icon=new es(t?t.icon:null,a,c,f)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ts{constructor(t,a,s){this.text=t,this.icon=a,this.skipFade=s}}class Sl{constructor(t,a,s,c,f){this.bucketInstanceId=t,this.featureIndex=a,this.sourceLayerIndex=s,this.bucketIndex=c,this.tileID=f}}class vh{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let a=++this.maxGroupID;this.collisionGroups[t]={ID:a,predicate:s=>s.collisionGroupID===a}}return this.collisionGroups[t]}}function bo(d,t,a,s,c){let{horizontalAlign:f,verticalAlign:y}=u.aP(d);return new u.P(-(f-.5)*t+s[0]*c,-(y-.5)*a+s[1]*c)}class is{constructor(t,a,s,c,f){this.transform=t.clone(),this.terrain=a,this.collisionIndex=new Tl(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new vh(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=f,f&&(f.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let a=this.terrain;return a?(s,c)=>a.getElevation(t,s,c):null}getBucketParts(t,a,s,c){let f=s.getBucket(a),y=s.latestFeatureIndex;if(!f||!y||a.id!==f.layerIds[0])return;let b=s.collisionBoxArray,w=f.layers[0].layout,S=f.layers[0].paint,P=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),A=s.tileSize/u.a6,k=s.tileID.toUnwrapped(),R=w.get("text-rotation-alignment")==="map",V=u.aK(s,1,this.transform.zoom),q=u.aL(this.collisionIndex.transform,s,S.get("text-translate"),S.get("text-translate-anchor")),H=u.aL(this.collisionIndex.transform,s,S.get("icon-translate"),S.get("icon-translate-anchor")),Z=mo(R,this.transform,V);this.retainedQueryData[f.bucketInstanceId]=new Sl(f.bucketInstanceId,y,f.sourceLayerIndex,f.index,s.tileID);let Y={bucket:f,layout:w,translationText:q,translationIcon:H,unwrappedTileID:k,pitchedLabelPlaneMatrix:Z,scale:P,textPixelRatio:A,holdingForFade:s.holdingForSymbolFade(),collisionBoxArray:b,partiallyEvaluatedTextSize:u.aw(f.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(c)for(let ie of f.sortKeyRanges){let{sortKey:X,symbolInstanceStart:W,symbolInstanceEnd:te}=ie;t.push({sortKey:X,symbolInstanceStart:W,symbolInstanceEnd:te,parameters:Y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:Y})}attemptAnchorPlacement(t,a,s,c,f,y,b,w,S,P,A,k,R,V,q,H,Z,Y,ie,X){var W,te,J;let le=u.aM[t.textAnchor],me=[t.textOffset0,t.textOffset1],de=bo(le,s,c,me,f),Pe=this.collisionIndex.placeCollisionBox(a,k,w,S,P,b,y,H,A.predicate,ie,de,X);if((!Y||this.collisionIndex.placeCollisionBox(Y,k,w,S,P,b,y,Z,A.predicate,ie,de,X).placeable)&&Pe.placeable){let Me;if(!((W=this.prevPlacement)===null||W===void 0)&&W.variableOffsets[R.crossTileID]&&(!((J=(te=this.prevPlacement)===null||te===void 0?void 0:te.placements[R.crossTileID])===null||J===void 0)&&J.text)&&(Me=this.prevPlacement.variableOffsets[R.crossTileID].anchor),R.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[R.crossTileID]={textOffset:me,width:s,height:c,anchor:le,textBoxScale:f,prevAnchor:Me},this.markUsedJustification(V,le,R,q),V.allowVerticalPlacement&&(this.markUsedOrientation(V,q,R),this.placedOrientations[R.crossTileID]=q),{shift:de,placedGlyphBoxes:Pe}}}placeLayerBucketPart(t,a,s){let{bucket:c,layout:f,translationText:y,translationIcon:b,unwrappedTileID:w,pitchedLabelPlaneMatrix:S,textPixelRatio:P,holdingForFade:A,collisionBoxArray:k,partiallyEvaluatedTextSize:R,collisionGroup:V}=t.parameters,q=f.get("text-optional"),H=f.get("icon-optional"),Z=u.aN(f,"text-overlap","text-allow-overlap"),Y=Z==="always",ie=u.aN(f,"icon-overlap","icon-allow-overlap"),X=ie==="always",W=f.get("text-rotation-alignment")==="map",te=f.get("text-pitch-alignment")==="map",J=f.get("icon-text-fit")!=="none",le=f.get("symbol-z-order")==="viewport-y",me=Y&&(X||!c.hasIconData()||H),de=X&&(Y||!c.hasTextData()||q);!c.collisionArrays&&k&&c.deserializeCollisionBoxes(k);let Pe=this.retainedQueryData[c.bucketInstanceId].tileID,Me=this._getTerrainElevationFunc(Pe),Qe=this.transform.getFastPathSimpleProjectionMatrix(Pe),Le=(xe,et,tt)=>{var Vt,mi;if(a[xe.crossTileID])return;if(A)return void(this.placements[xe.crossTileID]=new ts(!1,!1,!1));let Qt=!1,wi=!1,Ti=!0,Br=null,ci={box:null,placeable:!1,offscreen:null,occluded:!1},Xi={placeable:!1},ai=null,Li=null,Cr=null,ja=0,Vo=0,eo=0;et.textFeatureIndex?ja=et.textFeatureIndex:xe.useRuntimeCollisionCircles&&(ja=xe.featureIndex),et.verticalTextFeatureIndex&&(Vo=et.verticalTextFeatureIndex);let Wr=et.textBox;if(Wr){let Yi=Si=>{let ir=u.ax.horizontal;if(c.allowVerticalPlacement&&!Si&&this.prevPlacement){let Er=this.prevPlacement.placedOrientations[xe.crossTileID];Er&&(this.placedOrientations[xe.crossTileID]=Er,ir=Er,this.markUsedOrientation(c,ir,xe))}return ir},xa=(Si,ir)=>{if(c.allowVerticalPlacement&&xe.numVerticalGlyphVertices>0&&et.verticalTextBox){for(let Er of c.writingModes)if(Er===u.ax.vertical?(ci=ir(),Xi=ci):ci=Si(),ci?.placeable)break}else ci=Si()},pa=xe.textAnchorOffsetStartIndex,to=xe.textAnchorOffsetEndIndex;if(to===pa){let Si=(ir,Er)=>{let oi=this.collisionIndex.placeCollisionBox(ir,Z,P,Pe,w,te,W,y,V.predicate,Me,void 0,Qe);return oi?.placeable&&(this.markUsedOrientation(c,Er,xe),this.placedOrientations[xe.crossTileID]=Er),oi};xa((()=>Si(Wr,u.ax.horizontal)),(()=>{let ir=et.verticalTextBox;return c.allowVerticalPlacement&&xe.numVerticalGlyphVertices>0&&ir?Si(ir,u.ax.vertical):{box:null,offscreen:null}})),Yi(ci?.placeable)}else{let Si=u.aM[(mi=(Vt=this.prevPlacement)===null||Vt===void 0?void 0:Vt.variableOffsets[xe.crossTileID])===null||mi===void 0?void 0:mi.anchor],ir=(oi,io,wa)=>{let Ta=oi.x2-oi.x1,Ws=oi.y2-oi.y1,Wh=xe.textBoxScale,vc=J&&ie==="never"?io:null,Va=null,Ln=Z==="never"?1:2,bc="never";Si&&Ln++;for(let Lu=0;Lu<Ln;Lu++){for(let Rn=pa;Rn<to;Rn++){let Ru=c.textAnchorOffsets.get(Rn);if(Si&&Ru.textAnchor!==Si)continue;let Fn=this.attemptAnchorPlacement(Ru,oi,Ta,Ws,Wh,W,te,P,Pe,w,V,bc,xe,c,wa,y,b,vc,Me);if(Fn&&(Va=Fn.placedGlyphBoxes,Va?.placeable))return Qt=!0,Br=Fn.shift,Va}Si?Si=null:bc=Z}return s&&!Va&&(Va={box:this.collisionIndex.placeCollisionBox(Wr,"always",P,Pe,w,te,W,y,V.predicate,Me,void 0,Qe).box,offscreen:!1,placeable:!1,occluded:!1}),Va};xa((()=>ir(Wr,et.iconBox,u.ax.horizontal)),(()=>{let oi=et.verticalTextBox;return c.allowVerticalPlacement&&!ci?.placeable&&xe.numVerticalGlyphVertices>0&&oi?ir(oi,et.verticalIconBox,u.ax.vertical):{box:null,occluded:!0,offscreen:null}})),ci&&(Qt=ci.placeable,Ti=ci.offscreen);let Er=Yi(ci?.placeable);if(!Qt&&this.prevPlacement){let oi=this.prevPlacement.variableOffsets[xe.crossTileID];oi&&(this.variableOffsets[xe.crossTileID]=oi,this.markUsedJustification(c,oi.anchor,xe,Er))}}}if(ai=ci,Qt=ai?.placeable,Ti=ai?.offscreen,xe.useRuntimeCollisionCircles&&xe.centerJustifiedTextSymbolIndex>=0){let Yi=c.text.placedSymbolArray.get(xe.centerJustifiedTextSymbolIndex),xa=u.ay(c.textSizeData,R,Yi),pa=f.get("text-padding");Li=this.collisionIndex.placeCollisionCircles(Z,Yi,c.lineVertexArray,c.glyphOffsetArray,xa,w,S,s,te,V.predicate,xe.collisionCircleDiameter,pa,y,Me),Li.circles.length&&Li.collisionDetected&&!s&&u.w("Collisions detected, but collision boxes are not shown"),Qt=Y||Li.circles.length>0&&!Li.collisionDetected,Ti&&(Ti=Li.offscreen)}if(et.iconFeatureIndex&&(eo=et.iconFeatureIndex),et.iconBox){let Yi=xa=>this.collisionIndex.placeCollisionBox(xa,ie,P,Pe,w,te,W,b,V.predicate,Me,J&&Br?Br:void 0,Qe);Xi&&Xi.placeable&&et.verticalIconBox?(Cr=Yi(et.verticalIconBox),wi=Cr.placeable):(Cr=Yi(et.iconBox),wi=Cr.placeable),Ti&&(Ti=Cr.offscreen)}let Hr=q||xe.numHorizontalGlyphVertices===0&&xe.numVerticalGlyphVertices===0,_r=H||xe.numIconVertices===0;Hr||_r?_r?Hr||wi&&(wi=Qt):Qt=wi&&Qt:wi=Qt=wi&&Qt;let Or=wi&&Cr.placeable;if(Qt&&ai.placeable&&this.collisionIndex.insertCollisionBox(ai.box,Z,f.get("text-ignore-placement"),c.bucketInstanceId,Xi&&Xi.placeable&&Vo?Vo:ja,V.ID),Or&&this.collisionIndex.insertCollisionBox(Cr.box,ie,f.get("icon-ignore-placement"),c.bucketInstanceId,eo,V.ID),Li&&Qt&&this.collisionIndex.insertCollisionCircles(Li.circles,Z,f.get("text-ignore-placement"),c.bucketInstanceId,ja,V.ID),s&&this.storeCollisionData(c.bucketInstanceId,tt,et,ai,Cr,Li),xe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(c.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[xe.crossTileID]=new ts((Qt||me)&&!ai?.occluded,(wi||de)&&!Cr?.occluded,Ti||c.justReloaded),a[xe.crossTileID]=!0};if(le){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let xe=c.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let et=xe.length-1;et>=0;--et){let tt=xe[et];Le(c.symbolInstances.get(tt),c.collisionArrays[tt],tt)}}else for(let xe=t.symbolInstanceStart;xe<t.symbolInstanceEnd;xe++)Le(c.symbolInstances.get(xe),c.collisionArrays[xe],xe);c.justReloaded=!1}storeCollisionData(t,a,s,c,f,y){if(s.textBox||s.iconBox){let b,w;this.collisionBoxArrays.has(t)?b=this.collisionBoxArrays.get(t):(b=new Map,this.collisionBoxArrays.set(t,b)),b.has(a)?w=b.get(a):(w={text:null,icon:null},b.set(a,w)),s.textBox&&(w.text=c.box),s.iconBox&&(w.icon=f.box)}if(y){let b=this.collisionCircleArrays[t];b===void 0&&(b=this.collisionCircleArrays[t]=[]);for(let w=0;w<y.circles.length;w+=4)b.push(y.circles[w+0]-ki),b.push(y.circles[w+1]-ki),b.push(y.circles[w+2]),b.push(y.collisionDetected?1:0)}}markUsedJustification(t,a,s,c){let f;f=c===u.ax.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[u.aO(a)];let y=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(let b of y)b>=0&&(t.text.placedSymbolArray.get(b).crossTileID=f>=0&&b!==f?0:s.crossTileID)}markUsedOrientation(t,a,s){let c=a===u.ax.horizontal||a===u.ax.horizontalOnly?a:0,f=a===u.ax.vertical?a:0,y=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(let b of y)t.text.placedSymbolArray.get(b).placedOrientation=c;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=f)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let a=this.prevPlacement,s=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;let c=a?a.symbolFadeChange(t):1,f=a?a.opacities:{},y=a?a.variableOffsets:{},b=a?a.placedOrientations:{};for(let w in this.placements){let S=this.placements[w],P=f[w];P?(this.opacities[w]=new vo(P,c,S.text,S.icon),s||(s=S.text!==P.text.placed),s||(s=S.icon!==P.icon.placed)):(this.opacities[w]=new vo(null,c,S.text,S.icon,S.skipFade),s||(s=S.text||S.icon))}for(let w in f){let S=f[w];if(!this.opacities[w]){let P=new vo(S,c,!1,!1);P.isHidden()||(this.opacities[w]=P,s||(s=S.text.placed),s||(s=S.icon.placed))}}for(let w in y)this.variableOffsets[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.variableOffsets[w]=y[w]);for(let w in b)this.placedOrientations[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.placedOrientations[w]=b[w]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:t)}updateLayerOpacities(t,a){let s={};for(let c of a){let f=c.getBucket(t);f&&c.latestFeatureIndex&&t.id===f.layerIds[0]&&this.updateBucketOpacities(f,c.tileID,s,c.collisionBoxArray)}}updateBucketOpacities(t,a,s,c){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();let f=t.layers[0],y=f.layout,b=new vo(null,0,!1,!1,!0),w=y.get("text-allow-overlap"),S=y.get("icon-allow-overlap"),P=f._unevaluatedLayout.hasValue("text-variable-anchor")||f._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=y.get("text-rotation-alignment")==="map",k=y.get("text-pitch-alignment")==="map",R=y.get("icon-text-fit")!=="none",V=new vo(null,0,w&&(S||!t.hasIconData()||y.get("icon-optional")),S&&(w||!t.hasTextData()||y.get("text-optional")),!0);!t.collisionArrays&&c&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(c);let q=(Z,Y,ie)=>{for(let X=0;X<Y/4;X++)Z.opacityVertexArray.emplaceBack(ie);Z.hasVisibleVertices||(Z.hasVisibleVertices=ie!==$a)},H=this.collisionBoxArrays.get(t.bucketInstanceId);for(let Z=0;Z<t.symbolInstances.length;Z++){let Y=t.symbolInstances.get(Z),{numHorizontalGlyphVertices:ie,numVerticalGlyphVertices:X,crossTileID:W}=Y,te=this.opacities[W];s[W]?te=b:te||(te=V,this.opacities[W]=te),s[W]=!0;let J=Y.numIconVertices>0,le=this.placedOrientations[Y.crossTileID],me=le===u.ax.vertical,de=le===u.ax.horizontal||le===u.ax.horizontalOnly;if(ie>0||X>0){let Me=Gc(te.text);q(t.text,ie,me?$a:Me),q(t.text,X,de?$a:Me);let Qe=te.text.isHidden(),Le=[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex];for(let tt of Le)tt>=0&&(t.text.placedSymbolArray.get(tt).hidden=Qe||me?1:0);Y.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Qe||de?1:0);let xe=this.variableOffsets[Y.crossTileID];xe&&this.markUsedJustification(t,xe.anchor,Y,le);let et=this.placedOrientations[Y.crossTileID];et&&(this.markUsedJustification(t,"left",Y,et),this.markUsedOrientation(t,et,Y))}if(J){let Me=Gc(te.icon),Qe=!(R&&Y.verticalPlacedIconSymbolIndex&&me);Y.placedIconSymbolIndex>=0&&(q(t.icon,Y.numIconVertices,Qe?Me:$a),t.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=te.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(q(t.icon,Y.numVerticalIconVertices,Qe?$a:Me),t.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=te.icon.isHidden())}let Pe=H?.has(Z)?H.get(Z):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let Me=t.collisionArrays[Z];if(Me){let Qe=new u.P(0,0);if(Me.textBox||Me.verticalTextBox){let Le=!0;if(P){let xe=this.variableOffsets[W];xe?(Qe=bo(xe.anchor,xe.width,xe.height,xe.textOffset,xe.textBoxScale),A&&Qe._rotate(k?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Le=!1}if(Me.textBox||Me.verticalTextBox){let xe;Me.textBox&&(xe=me),Me.verticalTextBox&&(xe=de),Pl(t.textCollisionBox.collisionVertexArray,te.text.placed,!Le||xe,Pe.text,Qe.x,Qe.y)}}if(Me.iconBox||Me.verticalIconBox){let Le=!!(!de&&Me.verticalIconBox),xe;Me.iconBox&&(xe=Le),Me.verticalIconBox&&(xe=!Le),Pl(t.iconCollisionBox.collisionVertexArray,te.icon.placed,xe,Pe.icon,R?Qe.x:0,R?Qe.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,a){let s=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*s>t}setStale(){this.stale=!0}}function Pl(d,t,a,s,c,f){s&&s.length!==0||(s=[0,0,0,0]);let y=s[0]-ki,b=s[1]-ki,w=s[2]-ki,S=s[3]-ki;d.emplaceBack(t?1:0,a?1:0,c||0,f||0,y,b),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,w,b),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,w,S),d.emplaceBack(t?1:0,a?1:0,c||0,f||0,y,S)}let xo=Math.pow(2,25),qc=Math.pow(2,24),bh=Math.pow(2,17),ka=Math.pow(2,16),wo=Math.pow(2,9),Ct=Math.pow(2,8),Ml=Math.pow(2,1);function Gc(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;let t=d.placed?1:0,a=Math.floor(127*d.opacity);return a*xo+t*qc+a*bh+t*ka+a*wo+t*Ct+a*Ml+t}let $a=0;class Dr{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,a,s,c,f){let y=this._bucketParts;for(;this._currentTileIndex<t.length;)if(a.getBucketParts(y,c,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,f())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort(((b,w)=>b.sortKey-w.sortKey)));this._currentPartIndex<y.length;)if(a.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,s),this._currentPartIndex++,f())return!0;return!1}}class pr{constructor(t,a,s,c,f,y,b,w){this.placement=new is(t,a,y,b,w),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=c,this._showCollisionBoxes=f,this._done=!1}isDone(){return this._done}continuePlacement(t,a,s){let c=ke(),f=()=>!this._forceFullPlacement&&ke()-c>2;for(;this._currentPlacementIndex>=0;){let y=a[t[this._currentPlacementIndex]],b=this.placement.collisionIndex.transform.zoom;if(u.aQ(y)&&y.layout&&(!y.minzoom||y.minzoom<=b)&&(!y.maxzoom||y.maxzoom>b)){if(this._inProgressLayer||(this._inProgressLayer=new Dr(y)),this._inProgressLayer.continuePlacement(s[y.source],this.placement,this._showCollisionBoxes,y,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let Di=512/u.a6/2;class Hi{constructor(t,a,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};let c=new Map;for(let f=0;f<a.length;f++){let y=a.get(f),b=y.key,w=c.get(b);w?w.push(y):c.set(b,[y])}for(let[f,y]of c){let b={positions:y.map((w=>({x:Math.floor(w.anchorX*Di),y:Math.floor(w.anchorY*Di)}))),crossTileIDs:y.map((w=>w.crossTileID))};if(b.positions.length>128){let w=new u.aR(b.positions.length,16,Uint16Array);for(let{x:S,y:P}of b.positions)w.add(S,P);w.finish(),delete b.positions,b.index=w}this._symbolsByKey[f]=b}}getScaledCoordinates(t,a){let{x:s,y:c,z:f}=this.tileID.canonical,{x:y,y:b,z:w}=a.canonical,S=Di/Math.pow(2,w-f),P=(b*u.a6+t.anchorY)*S,A=c*u.a6*Di;return{x:Math.floor((y*u.a6+t.anchorX)*S-s*u.a6*Di),y:Math.floor(P-A)}}findMatches(t,a,s){let c=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let f=0;f<t.length;f++){let y=t.get(f);if(y.crossTileID)continue;let b=this._symbolsByKey[y.key];if(!b)continue;let w=this.getScaledCoordinates(y,a);if(b.index){let S=b.index.range(w.x-c,w.y-c,w.x+c,w.y+c).sort();for(let P of S){let A=b.crossTileIDs[P];if(!s[A]){s[A]=!0,y.crossTileID=A;break}}}else if(b.positions)for(let S=0;S<b.positions.length;S++){let P=b.positions[S],A=b.crossTileIDs[S];if(Math.abs(P.x-w.x)<=c&&Math.abs(P.y-w.y)<=c&&!s[A]){s[A]=!0,y.crossTileID=A;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class pi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class xh{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let a=Math.round((t-this.lng)/360);if(a!==0)for(let s in this.indexes){let c=this.indexes[s],f={};for(let y in c){let b=c[y];b.tileID=b.tileID.unwrapTo(b.tileID.wrap+a),f[b.tileID.key]=b}this.indexes[s]=f}this.lng=t}addBucket(t,a,s){var c,f,y;if(!((c=this.indexes[t.overscaledZ])===null||c===void 0)&&c[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let w=0;w<a.symbolInstances.length;w++)a.symbolInstances.get(w).crossTileID=0;(f=this.usedCrossTileIDs)[y=t.overscaledZ]||(f[y]={});let b=this.usedCrossTileIDs[t.overscaledZ];for(let w in this.indexes){let S=this.indexes[w];if(Number(w)>t.overscaledZ)for(let P in S){let A=S[P];A.tileID.isChildOf(t)&&A.findMatches(a.symbolInstances,t,b)}else{let P=S[t.scaledTo(Number(w)).key];P&&P.findMatches(a.symbolInstances,t,b)}}for(let w=0;w<a.symbolInstances.length;w++){let S=a.symbolInstances.get(w);S.crossTileID||(S.crossTileID=s.generate(),b[S.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Hi(t,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(t,a){for(let s of a.getCrossTileIDsLists())for(let c of s)delete this.usedCrossTileIDs[t][c]}removeStaleBuckets(t){let a=!1;for(let s in this.indexes){let c=this.indexes[s];for(let f in c)t[c[f].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,c[f]),delete c[f],a=!0)}return a}}class fr{constructor(){this.layerIndexes={},this.crossTileIDs=new pi,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,a,s){let c=this.layerIndexes[t.id];c===void 0&&(c=this.layerIndexes[t.id]=new xh);let f=!1,y={};c.handleWrapJump(s);for(let b of a){let w=b.getBucket(t);t.id===w?.layerIds[0]&&(w.bucketInstanceId||(this.maxBucketInstanceId+=1,w.bucketInstanceId=this.maxBucketInstanceId),c.addBucket(b.tileID,w,this.crossTileIDs)&&(f=!0),y[w.bucketInstanceId]=!0)}return c.removeStaleBuckets(y)&&(f=!0),f}pruneUnusedLayers(t){let a={};for(let s of t)a[s]=!0;for(let s in this.layerIndexes)a[s]||delete this.layerIndexes[s]}}var Lr="void main() {fragColor=vec4(1.0);}";let bi={prelude:zt(`#ifdef GL_ES
6
+ precision mediump float;
7
+ #else
8
+ #if !defined(lowp)
9
+ #define lowp
10
+ #endif
11
+ #if !defined(mediump)
12
+ #define mediump
13
+ #endif
14
+ #if !defined(highp)
15
+ #define highp
16
+ #endif
17
+ #endif
18
+ out highp vec4 fragColor;`,`#ifdef GL_ES
19
+ precision highp float;
20
+ #else
21
+ #if !defined(lowp)
22
+ #define lowp
23
+ #endif
24
+ #if !defined(mediump)
25
+ #define mediump
26
+ #endif
27
+ #if !defined(highp)
28
+ #define highp
29
+ #endif
30
+ #endif
31
+ vec2 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
32
+ );}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);return (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
33
+ );}
34
+ #ifdef TERRAIN3D
35
+ uniform 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;
36
+ #endif
37
+ const 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) {
38
+ #ifdef TERRAIN3D
39
+ highp 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));
40
+ #else
41
+ return 1.0;
42
+ #endif
43
+ }float calculate_visibility(vec4 pos) {
44
+ #ifdef TERRAIN3D
45
+ vec3 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;
46
+ #else
47
+ return 1.0;
48
+ #endif
49
+ }float ele(vec2 pos) {
50
+ #ifdef TERRAIN3D
51
+ vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
52
+ #else
53
+ return 0.0;
54
+ #endif
55
+ }float get_elevation(vec2 pos) {
56
+ #ifdef TERRAIN3D
57
+ #ifdef GLOBE
58
+ if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
59
+ #endif
60
+ vec2 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;
61
+ #else
62
+ return 0.0;
63
+ #endif
64
+ }const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:zt("","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:zt("",`#define GLOBE_RADIUS 6371008.8
65
+ uniform 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
66
+ );}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);
67
+ if (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
68
+ );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:zt(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
69
+ #ifdef OVERDRAW_INSPECTOR
70
+ fragColor=vec4(1.0);
71
+ #endif
72
+ }`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:zt(`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;uniform 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;
73
+ #ifdef OVERDRAW_INSPECTOR
74
+ fragColor=vec4(1.0);
75
+ #endif
76
+ }`,"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:zt(`in vec3 v_data;in float v_visibility;
77
+ #pragma mapbox: define highp vec4 color
78
+ #pragma mapbox: define mediump float radius
79
+ #pragma mapbox: define lowp float blur
80
+ #pragma mapbox: define lowp float opacity
81
+ #pragma mapbox: define highp vec4 stroke_color
82
+ #pragma mapbox: define mediump float stroke_width
83
+ #pragma mapbox: define lowp float stroke_opacity
84
+ void main() {
85
+ #pragma mapbox: initialize highp vec4 color
86
+ #pragma mapbox: initialize mediump float radius
87
+ #pragma mapbox: initialize lowp float blur
88
+ #pragma mapbox: initialize lowp float opacity
89
+ #pragma mapbox: initialize highp vec4 stroke_color
90
+ #pragma mapbox: initialize mediump float stroke_width
91
+ #pragma mapbox: initialize lowp float stroke_opacity
92
+ vec2 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;}
93
+ #ifdef OVERDRAW_INSPECTOR
94
+ fragColor=vec4(1.0);
95
+ #endif
96
+ }`,`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;
97
+ #pragma mapbox: define highp vec4 color
98
+ #pragma mapbox: define mediump float radius
99
+ #pragma mapbox: define lowp float blur
100
+ #pragma mapbox: define lowp float opacity
101
+ #pragma mapbox: define highp vec4 stroke_color
102
+ #pragma mapbox: define mediump float stroke_width
103
+ #pragma mapbox: define lowp float stroke_opacity
104
+ void main(void) {
105
+ #pragma mapbox: initialize highp vec4 color
106
+ #pragma mapbox: initialize mediump float radius
107
+ #pragma mapbox: initialize lowp float blur
108
+ #pragma mapbox: initialize lowp float opacity
109
+ #pragma mapbox: initialize highp vec4 stroke_color
110
+ #pragma mapbox: initialize mediump float stroke_width
111
+ #pragma mapbox: initialize lowp float stroke_opacity
112
+ vec2 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) {
113
+ #ifdef GLOBE
114
+ vec3 center_vector=projectToSphere(circle_center);
115
+ #endif
116
+ float 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 {
117
+ #ifdef GLOBE
118
+ vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
119
+ #else
120
+ vec4 projected_center=projectTileWithElevation(circle_center,ele);
121
+ #endif
122
+ corner_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);}
123
+ #ifdef GLOBE
124
+ vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
125
+ #else
126
+ gl_Position=projectTileWithElevation(corner_position,ele);
127
+ #endif
128
+ } 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:zt(Lr,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:zt(`uniform highp float u_intensity;in vec2 v_extrude;
129
+ #pragma mapbox: define highp float weight
130
+ #define GAUSS_COEF 0.3989422804014327
131
+ void main() {
132
+ #pragma mapbox: initialize highp float weight
133
+ float 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);
134
+ #ifdef OVERDRAW_INSPECTOR
135
+ fragColor=vec4(1.0);
136
+ #endif
137
+ }`,`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;
138
+ #pragma mapbox: define highp float weight
139
+ #pragma mapbox: define mediump float radius
140
+ const highp float ZERO=1.0/255.0/16.0;
141
+ #define GAUSS_COEF 0.3989422804014327
142
+ void main(void) {
143
+ #pragma mapbox: initialize highp float weight
144
+ #pragma mapbox: initialize mediump float radius
145
+ vec2 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);
146
+ #ifdef GLOBE
147
+ vec2 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);
148
+ #else
149
+ gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
150
+ #endif
151
+ }`),heatmapTexture:zt(`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;
152
+ #ifdef OVERDRAW_INSPECTOR
153
+ fragColor=vec4(0.0);
154
+ #endif
155
+ }`,"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:zt("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:zt("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:zt(`#ifdef GL_ES
156
+ precision highp float;
157
+ #endif
158
+ uniform 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
159
+ {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));
160
+ #ifdef OVERDRAW_INSPECTOR
161
+ fragColor=vec4(1.0);
162
+ #endif
163
+ }`,"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:zt("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:zt(Lr,`in vec2 a_pos;void main() {
164
+ #ifdef GLOBE
165
+ gl_Position=projectTileFor3D(a_pos,0.0);
166
+ #else
167
+ gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
168
+ #endif
169
+ }`),fill:zt(`#pragma mapbox: define highp vec4 color
170
+ #pragma mapbox: define lowp float opacity
171
+ void main() {
172
+ #pragma mapbox: initialize highp vec4 color
173
+ #pragma mapbox: initialize lowp float opacity
174
+ fragColor=color*opacity;
175
+ #ifdef OVERDRAW_INSPECTOR
176
+ fragColor=vec4(1.0);
177
+ #endif
178
+ }`,`uniform vec2 u_fill_translate;in vec2 a_pos;
179
+ #pragma mapbox: define highp vec4 color
180
+ #pragma mapbox: define lowp float opacity
181
+ void main() {
182
+ #pragma mapbox: initialize highp vec4 color
183
+ #pragma mapbox: initialize lowp float opacity
184
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:zt(`in vec2 v_pos;
185
+ #ifdef GLOBE
186
+ in float v_depth;
187
+ #endif
188
+ #pragma mapbox: define highp vec4 outline_color
189
+ #pragma mapbox: define lowp float opacity
190
+ void main() {
191
+ #pragma mapbox: initialize highp vec4 outline_color
192
+ #pragma mapbox: initialize lowp float opacity
193
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
194
+ #ifdef GLOBE
195
+ if (v_depth > 1.0) {discard;}
196
+ #endif
197
+ #ifdef OVERDRAW_INSPECTOR
198
+ fragColor=vec4(1.0);
199
+ #endif
200
+ }`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
201
+ #ifdef GLOBE
202
+ out float v_depth;
203
+ #endif
204
+ #pragma mapbox: define highp vec4 outline_color
205
+ #pragma mapbox: define lowp float opacity
206
+ void main() {
207
+ #pragma mapbox: initialize highp vec4 outline_color
208
+ #pragma mapbox: initialize lowp float opacity
209
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
210
+ #ifdef GLOBE
211
+ v_depth=gl_Position.z/gl_Position.w;
212
+ #endif
213
+ }`),fillOutlinePattern:zt(`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;
214
+ #ifdef GLOBE
215
+ in float v_depth;
216
+ #endif
217
+ #pragma mapbox: define lowp float opacity
218
+ #pragma mapbox: define lowp vec4 pattern_from
219
+ #pragma mapbox: define lowp vec4 pattern_to
220
+ void main() {
221
+ #pragma mapbox: initialize lowp float opacity
222
+ #pragma mapbox: initialize mediump vec4 pattern_from
223
+ #pragma mapbox: initialize mediump vec4 pattern_to
224
+ vec2 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;
225
+ #ifdef GLOBE
226
+ if (v_depth > 1.0) {discard;}
227
+ #endif
228
+ #ifdef OVERDRAW_INSPECTOR
229
+ fragColor=vec4(1.0);
230
+ #endif
231
+ }`,`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;
232
+ #ifdef GLOBE
233
+ out float v_depth;
234
+ #endif
235
+ #pragma mapbox: define lowp float opacity
236
+ #pragma mapbox: define lowp vec4 pattern_from
237
+ #pragma mapbox: define lowp vec4 pattern_to
238
+ #pragma mapbox: define lowp float pixel_ratio_from
239
+ #pragma mapbox: define lowp float pixel_ratio_to
240
+ void main() {
241
+ #pragma mapbox: initialize lowp float opacity
242
+ #pragma mapbox: initialize mediump vec4 pattern_from
243
+ #pragma mapbox: initialize mediump vec4 pattern_to
244
+ #pragma mapbox: initialize lowp float pixel_ratio_from
245
+ #pragma mapbox: initialize lowp float pixel_ratio_to
246
+ vec2 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;
247
+ #ifdef GLOBE
248
+ v_depth=gl_Position.z/gl_Position.w;
249
+ #endif
250
+ }`),fillPattern:zt(`#ifdef GL_ES
251
+ precision highp float;
252
+ #endif
253
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
254
+ #pragma mapbox: define lowp float opacity
255
+ #pragma mapbox: define lowp vec4 pattern_from
256
+ #pragma mapbox: define lowp vec4 pattern_to
257
+ void main() {
258
+ #pragma mapbox: initialize lowp float opacity
259
+ #pragma mapbox: initialize mediump vec4 pattern_from
260
+ #pragma mapbox: initialize mediump vec4 pattern_to
261
+ vec2 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;
262
+ #ifdef OVERDRAW_INSPECTOR
263
+ fragColor=vec4(1.0);
264
+ #endif
265
+ }`,`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;
266
+ #pragma mapbox: define lowp float opacity
267
+ #pragma mapbox: define lowp vec4 pattern_from
268
+ #pragma mapbox: define lowp vec4 pattern_to
269
+ #pragma mapbox: define lowp float pixel_ratio_from
270
+ #pragma mapbox: define lowp float pixel_ratio_to
271
+ void main() {
272
+ #pragma mapbox: initialize lowp float opacity
273
+ #pragma mapbox: initialize mediump vec4 pattern_from
274
+ #pragma mapbox: initialize mediump vec4 pattern_to
275
+ #pragma mapbox: initialize lowp float pixel_ratio_from
276
+ #pragma mapbox: initialize lowp float pixel_ratio_to
277
+ vec2 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;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:zt(`in vec4 v_color;void main() {fragColor=v_color;
278
+ #ifdef OVERDRAW_INSPECTOR
279
+ fragColor=vec4(1.0);
280
+ #endif
281
+ }`,`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;
282
+ #ifdef TERRAIN3D
283
+ in vec2 a_centroid;
284
+ #endif
285
+ out vec4 v_color;
286
+ #pragma mapbox: define highp float base
287
+ #pragma mapbox: define highp float height
288
+ #pragma mapbox: define highp vec4 color
289
+ void main() {
290
+ #pragma mapbox: initialize highp float base
291
+ #pragma mapbox: initialize highp float height
292
+ #pragma mapbox: initialize highp vec4 color
293
+ vec3 normal=a_normal_ed.xyz;
294
+ #ifdef TERRAIN3D
295
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
296
+ #else
297
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
298
+ #endif
299
+ base=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;
300
+ #ifdef GLOBE
301
+ vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
302
+ #else
303
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
304
+ #endif
305
+ float 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);
306
+ #ifdef GLOBE
307
+ mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
308
+ #endif
309
+ directional=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:zt(`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;
310
+ #pragma mapbox: define lowp float base
311
+ #pragma mapbox: define lowp float height
312
+ #pragma mapbox: define lowp vec4 pattern_from
313
+ #pragma mapbox: define lowp vec4 pattern_to
314
+ #pragma mapbox: define lowp float pixel_ratio_from
315
+ #pragma mapbox: define lowp float pixel_ratio_to
316
+ void main() {
317
+ #pragma mapbox: initialize lowp float base
318
+ #pragma mapbox: initialize lowp float height
319
+ #pragma mapbox: initialize mediump vec4 pattern_from
320
+ #pragma mapbox: initialize mediump vec4 pattern_to
321
+ #pragma mapbox: initialize lowp float pixel_ratio_from
322
+ #pragma mapbox: initialize lowp float pixel_ratio_to
323
+ vec2 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;
324
+ #ifdef OVERDRAW_INSPECTOR
325
+ fragColor=vec4(1.0);
326
+ #endif
327
+ }`,`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;
328
+ #ifdef TERRAIN3D
329
+ in vec2 a_centroid;
330
+ #endif
331
+ #ifdef GLOBE
332
+ out vec3 v_sphere_pos;
333
+ #endif
334
+ out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
335
+ #pragma mapbox: define lowp float base
336
+ #pragma mapbox: define lowp float height
337
+ #pragma mapbox: define lowp vec4 pattern_from
338
+ #pragma mapbox: define lowp vec4 pattern_to
339
+ #pragma mapbox: define lowp float pixel_ratio_from
340
+ #pragma mapbox: define lowp float pixel_ratio_to
341
+ void main() {
342
+ #pragma mapbox: initialize lowp float base
343
+ #pragma mapbox: initialize lowp float height
344
+ #pragma mapbox: initialize mediump vec4 pattern_from
345
+ #pragma mapbox: initialize mediump vec4 pattern_to
346
+ #pragma mapbox: initialize lowp float pixel_ratio_from
347
+ #pragma mapbox: initialize lowp float pixel_ratio_to
348
+ vec2 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;
349
+ #ifdef TERRAIN3D
350
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
351
+ #else
352
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
353
+ #endif
354
+ base=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;
355
+ #ifdef GLOBE
356
+ vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
357
+ #else
358
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
359
+ #endif
360
+ vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
361
+ ? a_pos
362
+ : 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:zt(`#ifdef GL_ES
363
+ precision highp float;
364
+ #endif
365
+ uniform 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/pow(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);
366
+ #ifdef OVERDRAW_INSPECTOR
367
+ fragColor=vec4(1.0);
368
+ #endif
369
+ }`,"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:zt(`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];
370
+ #define PI 3.141592653589793
371
+ #define STANDARD 0
372
+ #define COMBINED 1
373
+ #define IGOR 2
374
+ #define MULTIDIRECTIONAL 3
375
+ #define BASIC 4
376
+ float 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
377
+ {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
378
+ {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);}
379
+ #ifdef OVERDRAW_INSPECTOR
380
+ fragColor=vec4(1.0);
381
+ #endif
382
+ }`,"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:zt(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
383
+ #ifdef GLOBE
384
+ in float v_depth;
385
+ #endif
386
+ #pragma mapbox: define highp vec4 color
387
+ #pragma mapbox: define lowp float blur
388
+ #pragma mapbox: define lowp float opacity
389
+ void main() {
390
+ #pragma mapbox: initialize highp vec4 color
391
+ #pragma mapbox: initialize lowp float blur
392
+ #pragma mapbox: initialize lowp float opacity
393
+ 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);fragColor=color*(alpha*opacity);
394
+ #ifdef GLOBE
395
+ if (v_depth > 1.0) {discard;}
396
+ #endif
397
+ #ifdef OVERDRAW_INSPECTOR
398
+ fragColor=vec4(1.0);
399
+ #endif
400
+ }`,`
401
+ #define scale 0.015873016
402
+ in 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;
403
+ #ifdef GLOBE
404
+ out float v_depth;
405
+ #endif
406
+ #pragma mapbox: define highp vec4 color
407
+ #pragma mapbox: define lowp float blur
408
+ #pragma mapbox: define lowp float opacity
409
+ #pragma mapbox: define mediump float gapwidth
410
+ #pragma mapbox: define lowp float offset
411
+ #pragma mapbox: define mediump float width
412
+ void main() {
413
+ #pragma mapbox: initialize highp vec4 color
414
+ #pragma mapbox: initialize lowp float blur
415
+ #pragma mapbox: initialize lowp float opacity
416
+ #pragma mapbox: initialize mediump float gapwidth
417
+ #pragma mapbox: initialize lowp float offset
418
+ #pragma mapbox: initialize mediump float width
419
+ float 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);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;
420
+ #ifdef GLOBE
421
+ v_depth=gl_Position.z/gl_Position.w;
422
+ #endif
423
+ #ifdef TERRAIN3D
424
+ v_gamma_scale=1.0;
425
+ #else
426
+ float 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;
427
+ #endif
428
+ v_width2=vec2(outset,inset);}`),lineGradient:zt(`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;
429
+ #ifdef GLOBE
430
+ in float v_depth;
431
+ #endif
432
+ #pragma mapbox: define lowp float blur
433
+ #pragma mapbox: define lowp float opacity
434
+ void main() {
435
+ #pragma mapbox: initialize lowp float blur
436
+ #pragma mapbox: initialize lowp float opacity
437
+ 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);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
438
+ #ifdef GLOBE
439
+ if (v_depth > 1.0) {discard;}
440
+ #endif
441
+ #ifdef OVERDRAW_INSPECTOR
442
+ fragColor=vec4(1.0);
443
+ #endif
444
+ }`,`
445
+ #define scale 0.015873016
446
+ in 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;
447
+ #ifdef GLOBE
448
+ out float v_depth;
449
+ #endif
450
+ #pragma mapbox: define lowp float blur
451
+ #pragma mapbox: define lowp float opacity
452
+ #pragma mapbox: define mediump float gapwidth
453
+ #pragma mapbox: define lowp float offset
454
+ #pragma mapbox: define mediump float width
455
+ void main() {
456
+ #pragma mapbox: initialize lowp float blur
457
+ #pragma mapbox: initialize lowp float opacity
458
+ #pragma mapbox: initialize mediump float gapwidth
459
+ #pragma mapbox: initialize lowp float offset
460
+ #pragma mapbox: initialize mediump float width
461
+ float 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;
462
+ #ifdef GLOBE
463
+ v_depth=gl_Position.z/gl_Position.w;
464
+ #endif
465
+ #ifdef TERRAIN3D
466
+ v_gamma_scale=1.0;
467
+ #else
468
+ float 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;
469
+ #endif
470
+ v_width2=vec2(outset,inset);}`),linePattern:zt(`#ifdef GL_ES
471
+ precision highp float;
472
+ #endif
473
+ uniform 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;
474
+ #ifdef GLOBE
475
+ in float v_depth;
476
+ #endif
477
+ #pragma mapbox: define lowp vec4 pattern_from
478
+ #pragma mapbox: define lowp vec4 pattern_to
479
+ #pragma mapbox: define lowp float pixel_ratio_from
480
+ #pragma mapbox: define lowp float pixel_ratio_to
481
+ #pragma mapbox: define lowp float blur
482
+ #pragma mapbox: define lowp float opacity
483
+ void main() {
484
+ #pragma mapbox: initialize mediump vec4 pattern_from
485
+ #pragma mapbox: initialize mediump vec4 pattern_to
486
+ #pragma mapbox: initialize lowp float pixel_ratio_from
487
+ #pragma mapbox: initialize lowp float pixel_ratio_to
488
+ #pragma mapbox: initialize lowp float blur
489
+ #pragma mapbox: initialize lowp float opacity
490
+ vec2 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;
491
+ #ifdef GLOBE
492
+ if (v_depth > 1.0) {discard;}
493
+ #endif
494
+ #ifdef OVERDRAW_INSPECTOR
495
+ fragColor=vec4(1.0);
496
+ #endif
497
+ }`,`
498
+ #define scale 0.015873016
499
+ #define LINE_DISTANCE_SCALE 2.0
500
+ in 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;
501
+ #ifdef GLOBE
502
+ out float v_depth;
503
+ #endif
504
+ #pragma mapbox: define lowp float blur
505
+ #pragma mapbox: define lowp float opacity
506
+ #pragma mapbox: define lowp float offset
507
+ #pragma mapbox: define mediump float gapwidth
508
+ #pragma mapbox: define mediump float width
509
+ #pragma mapbox: define lowp float floorwidth
510
+ #pragma mapbox: define lowp vec4 pattern_from
511
+ #pragma mapbox: define lowp vec4 pattern_to
512
+ #pragma mapbox: define lowp float pixel_ratio_from
513
+ #pragma mapbox: define lowp float pixel_ratio_to
514
+ void main() {
515
+ #pragma mapbox: initialize lowp float blur
516
+ #pragma mapbox: initialize lowp float opacity
517
+ #pragma mapbox: initialize lowp float offset
518
+ #pragma mapbox: initialize mediump float gapwidth
519
+ #pragma mapbox: initialize mediump float width
520
+ #pragma mapbox: initialize lowp float floorwidth
521
+ #pragma mapbox: initialize mediump vec4 pattern_from
522
+ #pragma mapbox: initialize mediump vec4 pattern_to
523
+ #pragma mapbox: initialize lowp float pixel_ratio_from
524
+ #pragma mapbox: initialize lowp float pixel_ratio_to
525
+ float 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;
526
+ #ifdef GLOBE
527
+ v_depth=gl_Position.z/gl_Position.w;
528
+ #endif
529
+ #ifdef TERRAIN3D
530
+ v_gamma_scale=1.0;
531
+ #else
532
+ float 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;
533
+ #endif
534
+ v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:zt(`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;
535
+ #ifdef GLOBE
536
+ in float v_depth;
537
+ #endif
538
+ #pragma mapbox: define highp vec4 color
539
+ #pragma mapbox: define lowp float blur
540
+ #pragma mapbox: define lowp float opacity
541
+ #pragma mapbox: define mediump float width
542
+ #pragma mapbox: define lowp float floorwidth
543
+ #pragma mapbox: define mediump vec4 dasharray_from
544
+ #pragma mapbox: define mediump vec4 dasharray_to
545
+ void main() {
546
+ #pragma mapbox: initialize highp vec4 color
547
+ #pragma mapbox: initialize lowp float blur
548
+ #pragma mapbox: initialize lowp float opacity
549
+ #pragma mapbox: initialize mediump float width
550
+ #pragma mapbox: initialize lowp float floorwidth
551
+ #pragma mapbox: initialize mediump vec4 dasharray_from
552
+ #pragma mapbox: initialize mediump vec4 dasharray_to
553
+ 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 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);float 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);
554
+ #ifdef GLOBE
555
+ if (v_depth > 1.0) {discard;}
556
+ #endif
557
+ #ifdef OVERDRAW_INSPECTOR
558
+ fragColor=vec4(1.0);
559
+ #endif
560
+ }`,`
561
+ #define scale 0.015873016
562
+ #define LINE_DISTANCE_SCALE 2.0
563
+ in 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;
564
+ #ifdef GLOBE
565
+ out float v_depth;
566
+ #endif
567
+ #pragma mapbox: define highp vec4 color
568
+ #pragma mapbox: define lowp float blur
569
+ #pragma mapbox: define lowp float opacity
570
+ #pragma mapbox: define mediump float gapwidth
571
+ #pragma mapbox: define lowp float offset
572
+ #pragma mapbox: define mediump float width
573
+ #pragma mapbox: define lowp float floorwidth
574
+ #pragma mapbox: define mediump vec4 dasharray_from
575
+ #pragma mapbox: define mediump vec4 dasharray_to
576
+ void main() {
577
+ #pragma mapbox: initialize highp vec4 color
578
+ #pragma mapbox: initialize lowp float blur
579
+ #pragma mapbox: initialize lowp float opacity
580
+ #pragma mapbox: initialize mediump float gapwidth
581
+ #pragma mapbox: initialize lowp float offset
582
+ #pragma mapbox: initialize mediump float width
583
+ #pragma mapbox: initialize lowp float floorwidth
584
+ #pragma mapbox: initialize mediump vec4 dasharray_from
585
+ #pragma mapbox: initialize mediump vec4 dasharray_to
586
+ float 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;
587
+ #ifdef GLOBE
588
+ v_depth=gl_Position.z/gl_Position.w;
589
+ #endif
590
+ #ifdef TERRAIN3D
591
+ v_gamma_scale=1.0;
592
+ #else
593
+ float 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;
594
+ #endif
595
+ float 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:zt(`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;
596
+ #ifdef GLOBE
597
+ in float v_depth;
598
+ #endif
599
+ #pragma mapbox: define lowp float blur
600
+ #pragma mapbox: define lowp float opacity
601
+ #pragma mapbox: define mediump float width
602
+ #pragma mapbox: define lowp float floorwidth
603
+ #pragma mapbox: define mediump vec4 dasharray_from
604
+ #pragma mapbox: define mediump vec4 dasharray_to
605
+ void main() {
606
+ #pragma mapbox: initialize lowp float blur
607
+ #pragma mapbox: initialize lowp float opacity
608
+ #pragma mapbox: initialize mediump float width
609
+ #pragma mapbox: initialize lowp float floorwidth
610
+ #pragma mapbox: initialize mediump vec4 dasharray_from
611
+ #pragma mapbox: initialize mediump vec4 dasharray_to
612
+ 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);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);float 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);
613
+ #ifdef GLOBE
614
+ if (v_depth > 1.0) {discard;}
615
+ #endif
616
+ #ifdef OVERDRAW_INSPECTOR
617
+ fragColor=vec4(1.0);
618
+ #endif
619
+ }`,`
620
+ #define scale 0.015873016
621
+ #define LINE_DISTANCE_SCALE 2.0
622
+ in 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;
623
+ #ifdef GLOBE
624
+ out float v_depth;
625
+ #endif
626
+ #pragma mapbox: define lowp float blur
627
+ #pragma mapbox: define lowp float opacity
628
+ #pragma mapbox: define mediump float gapwidth
629
+ #pragma mapbox: define lowp float offset
630
+ #pragma mapbox: define mediump float width
631
+ #pragma mapbox: define lowp float floorwidth
632
+ #pragma mapbox: define mediump vec4 dasharray_from
633
+ #pragma mapbox: define mediump vec4 dasharray_to
634
+ void main() {
635
+ #pragma mapbox: initialize lowp float blur
636
+ #pragma mapbox: initialize lowp float opacity
637
+ #pragma mapbox: initialize mediump float gapwidth
638
+ #pragma mapbox: initialize lowp float offset
639
+ #pragma mapbox: initialize mediump float width
640
+ #pragma mapbox: initialize lowp float floorwidth
641
+ #pragma mapbox: initialize mediump vec4 dasharray_from
642
+ #pragma mapbox: initialize mediump vec4 dasharray_to
643
+ float 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;
644
+ #ifdef GLOBE
645
+ v_depth=gl_Position.z/gl_Position.w;
646
+ #endif
647
+ #ifdef TERRAIN3D
648
+ v_gamma_scale=1.0;
649
+ #else
650
+ float 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;
651
+ #endif
652
+ float 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:zt(`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);
653
+ #ifdef OVERDRAW_INSPECTOR
654
+ fragColor=vec4(1.0);
655
+ #endif
656
+ }`,`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;
657
+ #ifdef GLOBE
658
+ if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
659
+ #endif
660
+ v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:zt(`uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;
661
+ #ifdef OVERDRAW_INSPECTOR
662
+ fragColor=vec4(1.0);
663
+ #endif
664
+ }`,`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_total_opacity;
665
+ #pragma mapbox: define lowp float opacity
666
+ void main() {
667
+ #pragma mapbox: initialize lowp float opacity
668
+ vec2 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);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_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
669
+ camera_to_anchor_distance/u_camera_to_center_distance :
670
+ u_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;
671
+ #ifdef GLOBE
672
+ if(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);}
673
+ #endif
674
+ vec4 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;}`),symbolSDF:zt(`#define SDF_PX 8.0
675
+ uniform bool u_is_halo;uniform bool u_is_plain;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;
676
+ #pragma mapbox: define highp vec4 fill_color
677
+ #pragma mapbox: define highp vec4 halo_color
678
+ #pragma mapbox: define lowp float halo_width
679
+ #pragma mapbox: define lowp float halo_blur
680
+ void main() {
681
+ #pragma mapbox: initialize highp vec4 fill_color
682
+ #pragma mapbox: initialize highp vec4 halo_color
683
+ #pragma mapbox: initialize lowp float halo_width
684
+ #pragma mapbox: initialize lowp float halo_blur
685
+ float 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 total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;}
686
+ #ifdef OVERDRAW_INSPECTOR
687
+ fragColor=vec4(1.0);
688
+ #endif
689
+ }`,`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;
690
+ #pragma mapbox: define highp vec4 fill_color
691
+ #pragma mapbox: define highp vec4 halo_color
692
+ #pragma mapbox: define lowp float opacity
693
+ #pragma mapbox: define lowp float halo_width
694
+ #pragma mapbox: define lowp float halo_blur
695
+ void main() {
696
+ #pragma mapbox: initialize highp vec4 fill_color
697
+ #pragma mapbox: initialize highp vec4 halo_color
698
+ #pragma mapbox: initialize lowp float opacity
699
+ #pragma mapbox: initialize lowp float halo_width
700
+ #pragma mapbox: initialize lowp float halo_blur
701
+ vec2 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/16.0;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);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
702
+ camera_to_anchor_distance/u_camera_to_center_distance :
703
+ u_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;
704
+ #ifdef GLOBE
705
+ if(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);}
706
+ #endif
707
+ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,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;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:zt(`#define SDF_PX 8.0
708
+ #define SDF 1.0
709
+ #define ICON 0.0
710
+ uniform bool u_is_halo;uniform bool u_is_text;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;
711
+ #pragma mapbox: define highp vec4 fill_color
712
+ #pragma mapbox: define highp vec4 halo_color
713
+ #pragma mapbox: define lowp float halo_width
714
+ #pragma mapbox: define lowp float halo_blur
715
+ void main() {
716
+ #pragma mapbox: initialize highp vec4 fill_color
717
+ #pragma mapbox: initialize highp vec4 halo_color
718
+ #pragma mapbox: initialize lowp float halo_width
719
+ #pragma mapbox: initialize lowp float halo_blur
720
+ float total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
721
+ #ifdef OVERDRAW_INSPECTOR
722
+ fragColor=vec4(1.0);
723
+ #endif
724
+ return;}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;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;}
725
+ #ifdef OVERDRAW_INSPECTOR
726
+ fragColor=vec4(1.0);
727
+ #endif
728
+ }`,`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;
729
+ #pragma mapbox: define highp vec4 fill_color
730
+ #pragma mapbox: define highp vec4 halo_color
731
+ #pragma mapbox: define lowp float opacity
732
+ #pragma mapbox: define lowp float halo_width
733
+ #pragma mapbox: define lowp float halo_blur
734
+ void main() {
735
+ #pragma mapbox: initialize highp vec4 fill_color
736
+ #pragma mapbox: initialize highp vec4 halo_color
737
+ #pragma mapbox: initialize lowp float opacity
738
+ #pragma mapbox: initialize lowp float halo_width
739
+ #pragma mapbox: initialize lowp float halo_blur
740
+ vec2 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);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
741
+ camera_to_anchor_distance/u_camera_to_center_distance :
742
+ u_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;
743
+ #ifdef GLOBE
744
+ if(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);}
745
+ #endif
746
+ vec4 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;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_opacity,is_sdf);}`),terrain:zt("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 && u_fog_ground_blend_opacity > 0.0 && 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);float 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,ele-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:zt("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:zt("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:zt("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:zt(`#ifdef GL_ES
747
+ precision highp float;
748
+ #endif
749
+ in 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
750
+ );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:zt("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);}")};function zt(d,t){let a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/in ([\w]+) ([\w]+)/g),c=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=f?f.concat(c):c,b={};return{fragmentSource:d=d.replace(a,((w,S,P,A,k)=>(b[k]=!0,S==="define"?`
751
+ #ifndef HAS_UNIFORM_u_${k}
752
+ in ${P} ${A} ${k};
753
+ #else
754
+ uniform ${P} ${A} u_${k};
755
+ #endif
756
+ `:`
757
+ #ifdef HAS_UNIFORM_u_${k}
758
+ ${P} ${A} ${k} = u_${k};
759
+ #endif
760
+ `))),vertexSource:t=t.replace(a,((w,S,P,A,k)=>{let R=A==="float"?"vec2":"vec4",V=k.match(/color/)?"color":R;return b[k]?S==="define"?`
761
+ #ifndef HAS_UNIFORM_u_${k}
762
+ uniform lowp float u_${k}_t;
763
+ in ${P} ${R} a_${k};
764
+ out ${P} ${A} ${k};
765
+ #else
766
+ uniform ${P} ${A} u_${k};
767
+ #endif
768
+ `:V==="vec4"?`
769
+ #ifndef HAS_UNIFORM_u_${k}
770
+ ${k} = a_${k};
771
+ #else
772
+ ${P} ${A} ${k} = u_${k};
773
+ #endif
774
+ `:`
775
+ #ifndef HAS_UNIFORM_u_${k}
776
+ ${k} = unpack_mix_${V}(a_${k}, u_${k}_t);
777
+ #else
778
+ ${P} ${A} ${k} = u_${k};
779
+ #endif
780
+ `:S==="define"?`
781
+ #ifndef HAS_UNIFORM_u_${k}
782
+ uniform lowp float u_${k}_t;
783
+ in ${P} ${R} a_${k};
784
+ #else
785
+ uniform ${P} ${A} u_${k};
786
+ #endif
787
+ `:V==="vec4"?`
788
+ #ifndef HAS_UNIFORM_u_${k}
789
+ ${P} ${A} ${k} = a_${k};
790
+ #else
791
+ ${P} ${A} ${k} = u_${k};
792
+ #endif
793
+ `:`
794
+ #ifndef HAS_UNIFORM_u_${k}
795
+ ${P} ${A} ${k} = unpack_mix_${V}(a_${k}, u_${k}_t);
796
+ #else
797
+ ${P} ${A} ${k} = u_${k};
798
+ #endif
799
+ `})),staticAttributes:s,staticUniforms:y}}class ha{constructor(t,a,s){this.vertexBuffer=t,this.indexBuffer=a,this.segments=s}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Jt=u.aS([{name:"a_pos",type:"Int16",components:2}]);let To="#define PROJECTION_MERCATOR",Da="mercator";class So{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Da}get shaderDefine(){return To}get shaderPreludeCode(){return bi.projectionMercator}get vertexShaderPreludeCode(){return bi.projectionMercator.vertexSource}get subdivisionGranularity(){return u.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,a,s,c,f){if(this._cachedMesh)return this._cachedMesh;let y=new u.aU;y.emplaceBack(0,0),y.emplaceBack(u.a6,0),y.emplaceBack(0,u.a6),y.emplaceBack(u.a6,u.a6);let b=t.createVertexBuffer(y,Jt.members),w=u.aV.simpleSegment(0,0,4,2),S=new u.aW;S.emplaceBack(1,0,2),S.emplaceBack(1,2,3);let P=t.createIndexBuffer(S);return this._cachedMesh=new ha(b,P,w),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class mr{constructor(t=0,a=0,s=0,c=0){if(isNaN(t)||t<0||isNaN(a)||a<0||isNaN(s)||s<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=a,this.left=s,this.right=c}interpolate(t,a,s){return a.top!=null&&t.top!=null&&(this.top=u.H.number(t.top,a.top,s)),a.bottom!=null&&t.bottom!=null&&(this.bottom=u.H.number(t.bottom,a.bottom,s)),a.left!=null&&t.left!=null&&(this.left=u.H.number(t.left,a.left,s)),a.right!=null&&t.right!=null&&(this.right=u.H.number(t.right,a.right,s)),this}getCenter(t,a){let s=u.al((this.left+t-this.right)/2,0,t),c=u.al((this.top+a-this.bottom)/2,0,a);return new u.P(s,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new mr(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function rn(d,t){if(!d.renderWorldCopies||d.lngRange)return;let a=t.lng-d.center.lng;t.lng+=a>180?-360:a<-180?360:0}function ga(d){return Math.max(0,Math.floor(d))}class Cl{constructor(t,a){var s;this.applyConstrain=(c,f)=>this._constrainOverride!==null?this._constrainOverride(c,f):this._callbacks.defaultConstrain(c,f),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=a?.renderWorldCopies===void 0||!!a?.renderWorldCopies,this._minZoom=a?.minZoom||0,this._maxZoom=a?.maxZoom||22,this._minPitch=a?.minPitch==null?0:a?.minPitch,this._maxPitch=a?.maxPitch==null?60:a?.maxPitch,this._constrainOverride=(s=a?.constrainOverride)!==null&&s!==void 0?s:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new u.W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=ga(this._zoom),this._scale=u.ao(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new mr,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,a,s){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=ga(this._zoom),this._scale=u.ao(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 mr(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=!s&&t.autoCalculateNearFarZ,a&&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 u.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){let a=u.X(t,-180,180)*Math.PI/180;var s,c,f,y,b,w,S,P,A;this._bearingInRadians!==a&&(this._unmodified=!1,this._bearingInRadians=a,this._calcMatrices(),this._rotationMatrix=Ce(),s=this._rotationMatrix,f=-this._bearingInRadians,y=(c=this._rotationMatrix)[0],b=c[1],w=c[2],S=c[3],P=Math.sin(f),A=Math.cos(f),s[0]=y*A+w*P,s[1]=b*A+S*P,s[2]=y*-P+w*A,s[3]=b*-P+S*A)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let a=u.al(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==a&&(this._unmodified=!1,this._pitchInRadians=a,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let a=t/180*Math.PI;this._rollInRadians!==a&&(this._unmodified=!1,this._rollInRadians=a,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return u.aX(this._fovInRadians)}setFov(t){t=u.al(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=u.an(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let a=this.applyConstrain(this._center,t).zoom;this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this._tileZoom=Math.max(0,Math.floor(a)),this._scale=u.ao(a),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,a){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=a,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,a,s){this._unmodified=!1,this._edgeInsets.interpolate(t,a,s),this.constrainInternal(),this._calcMatrices()}resize(t,a,s=!0){this._width=t,this._height=a,s&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var t,a;return((t=this._latRange)===null||t===void 0?void 0:t.length)!==2||((a=this._lngRange)===null||a===void 0?void 0:a.length)!==2?null:new Pt([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-u.am,u.am])}getCameraQueryGeometry(t,a){if(a.length===1)return[a[0],t];{let{minX:s,minY:c,maxX:f,maxY:y}=u.a8.fromPoints(a).extend(t);return[new u.P(s,c),new u.P(f,c),new u.P(f,y),new u.P(s,y),new u.P(s,c)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:a,zoom:s}=this.applyConstrain(this.center,this.zoom);this.setCenter(a),this.setZoom(s),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=u.ap(new Float64Array(16));u.S(t,t,[this._width/2,-this._height/2,1]),u.Q(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=u.ap(new Float64Array(16)),u.S(t,t,[1,-1,1]),u.Q(t,t,[-1,-1,0]),u.S(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,a,s,c){let f=s!==void 0?s:this.bearing,y=c=c!==void 0?c:this.pitch,{distanceToCenter:b,clampedElevation:w}=this._distanceToCenterFromAltElevationPitch(a,this.elevation,y),{x:S,y:P}=Kt(y,f),A=u.a7.fromLngLat(t,a),k,R,V=u.aY(1,A.y),q=0;do{if(q+=1,q>10)break;R=b/V,k=new u.a7(A.x+S*R,A.y+P*R),V=1/k.meterInMercatorCoordinateUnits()}while(Math.abs(b-R*V)>1e-12);return{center:k.toLngLat(),elevation:w,zoom:u.ar(this.height/2/Math.tan(this.fovInRadians/2)/R/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let a=1/this.worldSize,s=u.aq(1,this.center.lat)*this.worldSize,c=u.a7.fromLngLat(this.center,this.elevation),f=c.x/a,y=c.y/a,b=c.z/a,w=this.pitch,S=this.bearing,{x:P,y:A,z:k}=Kt(w,S),R=this.cameraToCenterDistance,V=f+R*-P,q=y+R*-A,H=b+R*k,{distanceToCenter:Z,clampedElevation:Y}=this._distanceToCenterFromAltElevationPitch(H/s,t,w),ie=Z*s,X=new u.a7((V+P*ie)*a,(q+A*ie)*a,0).toLngLat(),W=u.aq(1,X.lat),te=u.ar(this.height/2/Math.tan(this.fovInRadians/2)/Z/W/this.tileSize);this._elevation=Y,this._center=X,this.setZoom(te)}_distanceToCenterFromAltElevationPitch(t,a,s){let c=-Math.cos(u.an(s)),f=t-a,y,b=a;return c*f>=0||Math.abs(c)<.1?(y=1e4,b=t+y*c):y=-f/c,{distanceToCenter:y,clampedElevation:b}}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let t=u.aq(1,this.center.lat)*this.worldSize;return Rt(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let a=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/a,t.canonical.y/a,1/a/u.a6,1/a/u.a6]}}class an{constructor(t,a){this.min=t,this.max=a,this.center=u.aZ([],u.a_([],this.min,this.max),.5)}quadrant(t){let a=[t%2==0,t<2],s=u.a$(this.min),c=u.a$(this.max);for(let f=0;f<a.length;f++)s[f]=a[f]?this.min[f]:this.center[f],c[f]=a[f]?this.center[f]:this.max[f];return c[2]=this.max[2],new an(s,c)}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 a=!0;for(let s of t.planes){let c=this.intersectsPlane(s);if(c===0)return 0;c===1&&(a=!1)}return a?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 a=t[3],s=t[3];for(let c=0;c<3;c++)t[c]>0?(a+=t[c]*this.min[c],s+=t[c]*this.max[c]):(s+=t[c]*this.min[c],a+=t[c]*this.max[c]);return a>=0?2:s<0?0:1}}class rs{distanceToTile2d(t,a,s,c){let f=c,y=f.distanceX([t,a]),b=f.distanceY([t,a]);return Math.hypot(y,b)}getWrap(t,a,s){return s}getTileBoundingVolume(t,a,s,c){var f,y;let b=0,w=0;if(c?.terrain){let P=new u.a3(t.z,a,t.z,t.x,t.y),A=c.terrain.getMinMaxElevation(P);b=(f=A.minElevation)!==null&&f!==void 0?f:Math.min(0,s),w=(y=A.maxElevation)!==null&&y!==void 0?y:Math.max(0,s)}let S=1<<t.z;return new an([a+t.x/S,t.y/S,b],[a+(t.x+1)/S,(t.y+1)/S,w])}allowVariableZoom(t,a){let s=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,c=u.al(78.5-s/2,0,60);return!!a.terrain||t.pitch>c}allowWorldCopies(){return!0}prepareNextFrame(){}}class Wa{constructor(t,a,s){this.points=t,this.planes=a,this.aabb=s}static fromInvProjectionMatrix(t,a=1,s=0,c,f){let y=f?[[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]],b=Math.pow(2,s),w=[[-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((k=>(function(R,V,q,H){let Z=u.aE([],R,V),Y=1/Z[3]/q*H;return u.b4(Z,Z,[Y,Y,1/Z[3],Y])})(k,t,a,b)));c&&(function(k,R,V,q){let H=q?4:0,Z=q?0:4,Y=0,ie=[],X=[];for(let J=0;J<4;J++){let le=u.b0([],k[J+Z],k[J+H]),me=u.b5(le);u.aZ(le,le,1/me),ie.push(me),X.push(le)}for(let J=0;J<4;J++){let le=u.b6(k[J+H],X[J],V);Y=le!==null&&le>=0?Math.max(Y,le):Math.max(Y,ie[J])}let W=(function(J,le){let me=u.b0([],J[le[0]],J[le[1]]),de=u.b0([],J[le[2]],J[le[1]]),Pe=[0,0,0,0];return u.b1(Pe,u.b2([],me,de)),Pe[3]=-u.b3(Pe,J[le[0]]),Pe})(k,R),te=(function(J,le){let me=u.b7(J),de=u.b8([],J,1/me),Pe=u.b0([],le,u.aZ([],de,u.b3(le,de))),Me=u.b7(Pe);if(Me>0){let Qe=Math.sqrt(1-de[3]*de[3]),Le=u.aZ([],de,-de[3]),xe=u.a_([],Le,u.aZ([],Pe,Qe/Me));return u.b9(le,xe)}return null})(V,W);if(te!==null){let J=te/u.b3(X[0],W);Y=Math.min(Y,J)}for(let J=0;J<4;J++){let le=Math.min(Y,ie[J]);k[J+Z]=[k[J+H][0]+X[J][0]*le,k[J+H][1]+X[J][1]*le,k[J+H][2]+X[J][2]*le,1]}})(w,y[0],c,f);let S=y.map((k=>{let R=u.b0([],w[k[0]],w[k[1]]),V=u.b0([],w[k[2]],w[k[1]]),q=u.b1([],u.b2([],R,V)),H=-u.b3(q,w[k[1]]);return q.concat(H)})),P=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],A=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let k of w)for(let R=0;R<3;R++)P[R]=Math.min(P[R],k[R]),A[R]=Math.max(A[R],k[R]);return new Wa(w,S,new an(P,A))}}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,a,s){this._helper.interpolatePadding(t,a,s)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,s=!0){this._helper.resize(t,a,s)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}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,a){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(a,s)=>{s=u.al(+s,this.minZoom,this.maxZoom);let c={center:new u.W(a.lng,a.lat),zoom:s},f=this._helper._lngRange;if(!this._helper._renderWorldCopies&&f===null){let X=179.9999999999;f=[-X,X]}let y=this.tileSize*u.ao(c.zoom),b=0,w=y,S=0,P=y,A=0,k=0,{x:R,y:V}=this.size;if(this._helper._latRange){let X=this._helper._latRange;b=u.Y(X[1])*y,w=u.Y(X[0])*y,w-b<V&&(A=V/(w-b))}f&&(S=u.X(u.Z(f[0])*y,0,y),P=u.X(u.Z(f[1])*y,0,y),P<S&&(P+=y),P-S<R&&(k=R/(P-S)));let{x:q,y:H}=he(y,a),Z,Y,ie=Math.max(k||0,A||0);if(ie){let X=new u.P(k?(P+S)/2:q,A?(w+b)/2:H);return c.center=$i(y,X).wrap(),c.zoom+=u.ar(ie),c}if(this._helper._latRange){let X=V/2;H-X<b&&(Y=b+X),H+X>w&&(Y=w-X)}if(f){let X=(S+P)/2,W=q;this._helper._renderWorldCopies&&(W=u.X(q,X-y/2,X+y/2));let te=R/2;W-te<S&&(Z=S+te),W+te>P&&(Z=P-te)}if(Z!==void 0||Y!==void 0){let X=new u.P(Z??q,Y??H);c.center=$i(y,X).wrap()}return c},this.applyConstrain=(a,s)=>this._helper.applyConstrain(a,s),this._helper=new Cl({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,s)=>this.defaultConstrain(a,s)},t),this._coveringTilesDetailsProvider=new rs}clone(){let t=new _a;return t.apply(this,!1),t}apply(t,a,s){this._helper.apply(t,a,s)}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){let a=[new u.ba(0,t)];if(this._helper._renderWorldCopies){let s=this.screenPointToMercatorCoordinate(new u.P(0,0)),c=this.screenPointToMercatorCoordinate(new u.P(this._helper._width,0)),f=this.screenPointToMercatorCoordinate(new u.P(this._helper._width,this._helper._height)),y=this.screenPointToMercatorCoordinate(new u.P(0,this._helper._height)),b=Math.floor(Math.min(s.x,c.x,f.x,y.x)),w=Math.floor(Math.max(s.x,c.x,f.x,y.x)),S=1;for(let P=b-S;P<=w+S;P++)P!==0&&a.push(new u.ba(P,t))}return a}getCameraFrustum(){return Wa.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let a=this.screenPointToLocation(this.centerPoint,t),s=t?t.getElevationForLngLatZoom(a,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(s)}setLocationAtPoint(t,a){let s=u.aq(this.elevation,this.center.lat),c=this.screenPointToMercatorCoordinateAtZ(a,s),f=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,s),y=u.a7.fromLngLat(t),b=new u.a7(y.x-(c.x-f.x),y.y-(c.y-f.y));this.setCenter(b?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,a){return a?this.coordinatePoint(u.a7.fromLngLat(t),a.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(u.a7.fromLngLat(t))}screenPointToLocation(t,a){var s;return(s=this.screenPointToMercatorCoordinate(t,a))===null||s===void 0?void 0:s.toLngLat()}screenPointToMercatorCoordinate(t,a){if(a){let s=a.pointCoordinate(t);if(s!=null)return s}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,a){let s=a||0,c=[t.x,t.y,0,1],f=[t.x,t.y,1,1];u.aE(c,c,this._pixelMatrixInverse),u.aE(f,f,this._pixelMatrixInverse);let y=c[3],b=f[3],w=c[1]/y,S=f[1]/b,P=c[2]/y,A=f[2]/b,k=P===A?0:(s-P)/(A-P);return new u.a7(u.H.number(c[0]/y,f[0]/b,k)/this.worldSize,u.H.number(w,S,k)/this.worldSize,s)}coordinatePoint(t,a=0,s=this._pixelMatrix){let c=[t.x*this.worldSize,t.y*this.worldSize,a,1];return u.aE(c,c,s),new u.P(c[0]/c[3],c[1]/c[3])}getBounds(){let t=Math.max(0,this._helper._height/2-Jr(this));return new Pt().extend(this.screenPointToLocation(new u.P(0,t))).extend(this.screenPointToLocation(new u.P(this._helper._width,t))).extend(this.screenPointToLocation(new u.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new u.P(0,this._helper._height)))}isPointOnMapSurface(t,a){return a?a.pointCoordinate(t)!=null:t.y>this.height/2-Jr(this)}calculatePosMatrix(t,a=!1,s){var c;let f=(c=t.key)!==null&&c!==void 0?c:u.bb(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),y=a?this._alignedPosMatrixCache:this._posMatrixCache;if(y.has(f)){let S=y.get(f);return s?S.f32:S.f64}let b=lt(t,this.worldSize);u.U(b,a?this._alignedProjMatrix:this._viewProjMatrix,b);let w={f64:b,f32:new Float32Array(b)};return y.set(f,w),s?w.f32:w.f64}calculateFogMatrix(t){let a=t.key,s=this._fogMatrixCacheF32;if(s.has(a))return s.get(a);let c=lt(t,this.worldSize);return u.U(c,this._fogMatrix,c),s.set(a,new Float32Array(c)),s.get(a)}calculateCenterFromCameraLngLatAlt(t,a,s,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,s,c)}_calculateNearFarZIfNeeded(t,a,s){if(!this._helper.autoCalculateNearFarZ)return;let c=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),f=t-c*this._helper._pixelPerMeter/Math.cos(a),y=c<0?f:t,b=Math.PI/2+this.pitchInRadians,w=u.an(this.fov)*(Math.abs(Math.cos(u.an(this.roll)))*this.height+Math.abs(Math.sin(u.an(this.roll)))*this.width)/this.height*(.5+s.y/this.height),S=Math.sin(w)*y/Math.sin(u.al(Math.PI-b-w,.01,Math.PI-.01)),P=Jr(this),A=Math.atan(P/this._helper.cameraToCenterDistance),k=u.an(.75),R=A>k?2*A*(.5+s.y/(2*P)):k,V=Math.sin(R)*y/Math.sin(u.al(Math.PI-b-R,.01,Math.PI-.01)),q=Math.min(S,V);this._helper._farZ=1.01*(Math.cos(Math.PI/2-a)*q+y),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let t=this.centerOffset,a=he(this.worldSize,this.center),s=a.x,c=a.y;this._helper._pixelPerMeter=u.aq(1,this.center.lat)*this.worldSize;let f=u.an(Math.min(this.pitch,Dt)),y=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(f)),b;var w,S;this._calculateNearFarZIfNeeded(y,f,t),b=new Float64Array(16),u.bc(b,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),(w=this._invProjMatrix)[0]=1/(S=b)[0],w[1]=0,w[2]=0,w[3]=0,w[4]=0,w[5]=1/S[5],w[6]=0,w[7]=0,w[8]=0,w[9]=0,w[10]=0,w[11]=1/S[14],w[12]=0,w[13]=0,w[14]=-1,w[15]=S[10]/S[14],b[8]=2*-t.x/this._helper._width,b[9]=2*t.y/this._helper._height,this._projectionMatrix=u.bd(b),u.S(b,b,[1,-1,1]),u.Q(b,b,[0,0,-this._helper.cameraToCenterDistance]),u.be(b,b,-this.rollInRadians),u.bf(b,b,this.pitchInRadians),u.be(b,b,-this.bearingInRadians),u.Q(b,b,[-s,-c,0]),this._mercatorMatrix=u.S([],b,[this.worldSize,this.worldSize,this.worldSize]),u.S(b,b,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=u.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,b),u.Q(b,b,[0,0,-this.elevation]),this._viewProjMatrix=b,this._invViewProjMatrix=u.bg([],b);let P=[0,0,-1,1];u.aE(P,P,this._invViewProjMatrix),this._cameraPosition=[P[0]/P[3],P[1]/P[3],P[2]/P[3]],this._fogMatrix=new Float64Array(16),u.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,y,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,u.S(this._fogMatrix,this._fogMatrix,[1,-1,1]),u.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),u.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),u.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),u.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),u.Q(this._fogMatrix,this._fogMatrix,[-s,-c,0]),u.S(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),u.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=u.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,b);let A=this._helper._width%2/2,k=this._helper._height%2/2,R=Math.cos(this.bearingInRadians),V=Math.sin(-this.bearingInRadians),q=s-Math.round(s)+R*A+V*k,H=c-Math.round(c)+R*k+V*A,Z=new Float64Array(b);if(u.Q(Z,Z,[q>.5?q-1:q,H>.5?H-1:H,0]),this._alignedProjMatrix=Z,b=u.bg(new Float64Array(16),this._pixelMatrix),!b)throw new Error("failed to invert matrix");this._pixelMatrixInverse=b,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new u.P(0,0)),a=[t.x*this.worldSize,t.y*this.worldSize,0,1];return u.aE(a,a,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=u.aq(1,this.center.lat)*this.worldSize;return Rt(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,a){let s=u.a7.fromLngLat(t),c=[s.x*this.worldSize,s.y*this.worldSize,a,1];return u.aE(c,c,this._viewProjMatrix),c[2]/c[3]}getProjectionData(t){let{overscaledTileID:a,aligned:s,applyTerrainMatrix:c}=t,f=this._helper.getMercatorTileCoordinates(a),y=a?this.calculatePosMatrix(a,s,!0):null,b;return b=a?.terrainRttPosMatrix32f&&c?a.terrainRttPosMatrix32f:y||u.bh(),{mainMatrix:b,tileMercatorCoords:f,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:b}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,a,s){return 1}transformLightDirection(t){return u.a$(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,a,s,c){let f=this.calculatePosMatrix(s),y;c?(y=[t,a,c(t,a),1],u.aE(y,y,f)):(y=[t,a,0,1],Qn(y,y,f));let b=y[3];return{point:new u.P(y[0]/b,y[1]/b),signedDistanceFromCamera:b,isOccluded:!1}}populateCache(t){for(let a of t)this.calculatePosMatrix(a)}getMatrixForModel(t,a){let s=u.a7.fromLngLat(t,a),c=s.meterInMercatorCoordinateUnits(),f=u.bi();return u.Q(f,f,[s.x,s.y,s.z]),u.be(f,f,Math.PI),u.bf(f,f,Math.PI/2),u.S(f,f,[-c,c,c]),f}getProjectionDataForCustomLayer(t=!0){let a=new u.a3(0,0,0,0,0),s=this.getProjectionData({overscaledTileID:a,applyGlobeMatrix:t}),c=lt(a,this.worldSize);u.U(c,this._viewProjMatrix,c),s.tileMercatorCoords=[0,0,1,1];let f=[u.a6,u.a6,this.worldSize/this._helper.pixelsPerMeter],y=u.bj();return u.S(y,c,f),s.fallbackMatrix=y,s.mainMatrix=y,s}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function as(){u.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function os(d){if(d.useSlerp)if(d.k<1){let t=u.bk(d.startEulerAngles.roll,d.startEulerAngles.pitch,d.startEulerAngles.bearing),a=u.bk(d.endEulerAngles.roll,d.endEulerAngles.pitch,d.endEulerAngles.bearing),s=new Float64Array(4);u.bl(s,t,a,d.k);let c=u.bm(s);d.tr.setRoll(c.roll),d.tr.setPitch(c.pitch),d.tr.setBearing(c.bearing)}else d.tr.setRoll(d.endEulerAngles.roll),d.tr.setPitch(d.endEulerAngles.pitch),d.tr.setBearing(d.endEulerAngles.bearing);else d.tr.setRoll(u.H.number(d.startEulerAngles.roll,d.endEulerAngles.roll,d.k)),d.tr.setPitch(u.H.number(d.startEulerAngles.pitch,d.endEulerAngles.pitch,d.k)),d.tr.setBearing(u.H.number(d.startEulerAngles.bearing,d.endEulerAngles.bearing,d.k))}function on(d,t,a,s,c){let f=c.padding,y=he(c.worldSize,a.getNorthWest()),b=he(c.worldSize,a.getNorthEast()),w=he(c.worldSize,a.getSouthEast()),S=he(c.worldSize,a.getSouthWest()),P=u.an(-s),A=y.rotate(P),k=b.rotate(P),R=w.rotate(P),V=S.rotate(P),q=new u.P(Math.max(A.x,k.x,V.x,R.x),Math.max(A.y,k.y,V.y,R.y)),H=new u.P(Math.min(A.x,k.x,V.x,R.x),Math.min(A.y,k.y,V.y,R.y)),Z=q.sub(H),Y=(c.width-(f.left+f.right+t.left+t.right))/Z.x,ie=(c.height-(f.top+f.bottom+t.top+t.bottom))/Z.y;if(ie<0||Y<0)return void as();let X=Math.min(u.ar(c.scale*Math.min(Y,ie)),d.maxZoom),W=u.P.convert(d.offset),te=new u.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(u.an(s)),J=W.add(te).mult(c.scale/u.ao(X));return{center:$i(c.worldSize,y.add(w).div(2).sub(J)),zoom:X,bearing:s}}class Po{get useGlobeControls(){return!1}handlePanInertia(t,a){let s=t.mag(),c=Math.abs(Jr(a));return{easingOffset:t.mult(Math.min(.75*c/s,1)),easingCenter:a.center}}handleMapControlsRollPitchBearingZoom(t,a){t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta),t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta)}handleMapControlsPan(t,a,s){t.around.distSqr(a.centerPoint)<.01||a.setLocationAtPoint(s,t.around)}cameraForBoxAndBearing(t,a,s,c,f){return on(t,a,s,c,f)}handleJumpToCenterZoom(t,a){t.zoom!==(a.zoom!==void 0?+a.zoom:t.zoom)&&t.setZoom(+a.zoom),a.center!==void 0&&t.setCenter(u.W.convert(a.center))}handleEaseTo(t,a){let s=t.zoom,c=t.padding,f={roll:t.roll,pitch:t.pitch,bearing:t.bearing},y={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},b=a.zoom!==void 0,w=!t.isPaddingEqual(a.padding),S=!1,P=b?+a.zoom:t.zoom,A=t.centerPoint.add(a.offsetAsPoint),k=t.screenPointToLocation(A),{center:R,zoom:V}=t.applyConstrain(u.W.convert(a.center||k),P??s);rn(t,R);let q=he(t.worldSize,k),H=he(t.worldSize,R).sub(q),Z=u.ao(V-s);return S=V!==s,{easeFunc:Y=>{if(S&&t.setZoom(u.H.number(s,V,Y)),u.bn(f,y)||os({startEulerAngles:f,endEulerAngles:y,tr:t,k:Y,useSlerp:f.roll!=y.roll}),w&&(t.interpolatePadding(c,a.padding,Y),A=t.centerPoint.add(a.offsetAsPoint)),a.around)t.setLocationAtPoint(a.around,a.aroundPoint);else{let ie=u.ao(t.zoom-s),X=V>s?Math.min(2,Z):Math.max(.5,Z),W=Math.pow(X,1-Y),te=$i(t.worldSize,q.add(H.mult(Y*W)).mult(ie));t.setLocationAtPoint(t.renderWorldCopies?te.wrap():te,A)}},isZooming:S,elevationCenter:R}}handleFlyTo(t,a){let s=a.zoom!==void 0,c=t.zoom,f=t.applyConstrain(u.W.convert(a.center||a.locationAtOffset),s?+a.zoom:c),y=f.center,b=f.zoom;rn(t,y);let w=he(t.worldSize,a.locationAtOffset),S=he(t.worldSize,y).sub(w),P=S.mag(),A=u.ao(b-c),k;if(a.minZoom!==void 0){let R=Math.min(+a.minZoom,c,b),V=t.applyConstrain(y,R).zoom;k=u.ao(V-c)}return{easeFunc:(R,V,q,H)=>{t.setZoom(R===1?b:c+u.ar(V));let Z=R===1?y:$i(t.worldSize,w.add(S.mult(q)).mult(V));t.setLocationAtPoint(t.renderWorldCopies?Z.wrap():Z,H)},scaleOfZoom:A,targetCenter:y,scaleOfMinZoom:k,pixelPathLength:P}}}class ii{constructor(t,a,s){this.blendFunction=t,this.blendColor=a,this.mask=s}}ii.Replace=[1,0],ii.disabled=new ii(ii.Replace,u.bo.transparent,[!1,!1,!1,!1]),ii.unblended=new ii(ii.Replace,u.bo.transparent,[!0,!0,!0,!0]),ii.alphaBlended=new ii([1,771],u.bo.transparent,[!0,!0,!0,!0]);let Mo=2305;class At{constructor(t,a,s){this.enable=t,this.mode=a,this.frontFace=s}}At.disabled=new At(!1,1029,Mo),At.backCCW=new At(!0,1029,Mo),At.frontCCW=new At(!0,1028,Mo);class yt{constructor(t,a,s){this.func=t,this.mask=a,this.range=s}}yt.ReadOnly=!1,yt.ReadWrite=!0,yt.disabled=new yt(519,yt.ReadOnly,[0,1]);let El=7680;class Ft{constructor(t,a,s,c,f,y){this.test=t,this.ref=a,this.mask=s,this.fail=c,this.depthFail=f,this.pass=y}}function da(d){return typeof WebGL2RenderingContext<"u"&&d instanceof WebGL2RenderingContext}Ft.disabled=new Ft({func:519,mask:0},0,0,El,El,El);class Il{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;let a=t.context,s=a.gl;this._texFormat=s.RGBA,this._texType=s.UNSIGNED_BYTE;let c=new u.aU;c.emplaceBack(-1,-1),c.emplaceBack(2,-1),c.emplaceBack(-1,2);let f=new u.aW;f.emplaceBack(0,1,2),this._fullscreenTriangle=new ha(a.createVertexBuffer(c,Jt.members),a.createIndexBuffer(f),u.aV.simpleSegment(0,0,c.length,f.length)),this._resultBuffer=new Uint8Array(4),a.activeTexture.set(s.TEXTURE1);let y=s.createTexture();s.bindTexture(s.TEXTURE_2D,y),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texImage2D(s.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=a.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(y),da(s)&&(this._pbo=s.createBuffer(),s.bindBuffer(s.PIXEL_PACK_BUFFER,this._pbo),s.bufferData(s.PIXEL_PACK_BUFFER,4,s.STREAM_READ),s.bindBuffer(s.PIXEL_PACK_BUFFER,null))}destroy(){let 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,a){let s=this._updateCount;return this._readbackQueue?s>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():s>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,a),this._updateCount++,this._measuredError}_bindFramebuffer(){let t=this._cachedRenderContext.context,a=t.gl;t.activeTexture.set(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,a){let s=this._cachedRenderContext.context,c=s.gl;if(this._bindFramebuffer(),s.viewport.set([0,0,this._texWidth,this._texHeight]),s.clear({color:u.bo.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(s,c.TRIANGLES,yt.disabled,Ft.disabled,ii.unblended,At.disabled,((f,y)=>({u_input:f,u_output_expected:y}))(t,a),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&da(c)){c.bindBuffer(c.PIXEL_PACK_BUFFER,this._pbo),c.readBuffer(c.COLOR_ATTACHMENT0),c.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null);let f=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:f}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&da(t)){let a=t.clientWaitSync(this._readbackQueue.sync,0,0);if(a===t.WAIT_FAILED)return u.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(a===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=Il._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let a=0;return a+=t[0]/256,a+=t[1]/65536,a+=t[2]/16777216,t[3]<127&&(a=-a),a/128}}let ns=u.a6/128;function gr(d,t){let a=d.granularity!==void 0?Math.max(d.granularity,1):1,s=a+(d.generateBorders?2:0),c=a+(d.extendToNorthPole||d.generateBorders?1:0)+(d.extendToSouthPole||d.generateBorders?1:0),f=s+1,y=c+1,b=d.generateBorders?-1:0,w=d.generateBorders||d.extendToNorthPole?-1:0,S=a+(d.generateBorders?1:0),P=a+(d.generateBorders||d.extendToSouthPole?1:0),A=f*y,k=s*c*6,R=f*y>65536;if(R&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let V=R||t==="32bit",q=new Int16Array(2*A),H=0;for(let ie=w;ie<=P;ie++)for(let X=b;X<=S;X++){let W=X/a*u.a6;X===-1&&(W=-ns),X===a+1&&(W=u.a6+ns);let te=ie/a*u.a6;ie===-1&&(te=d.extendToNorthPole?u.bq:-ns),ie===a+1&&(te=d.extendToSouthPole?u.br:u.a6+ns),q[H++]=W,q[H++]=te}let Z=V?new Uint32Array(k):new Uint16Array(k),Y=0;for(let ie=0;ie<c;ie++)for(let X=0;X<s;X++){let W=X+1+ie*f,te=X+(ie+1)*f,J=X+1+(ie+1)*f;Z[Y++]=X+ie*f,Z[Y++]=te,Z[Y++]=W,Z[Y++]=W,Z[Y++]=te,Z[Y++]=J}return{vertices:q.buffer.slice(0),indices:Z.buffer.slice(0),uses32bitIndices:V}}let nn=new u.aT({fill:new u.bs(128,2),line:new u.bs(512,0),tile:new u.bs(128,32),stencil:new u.bs(128,1),circle:3});class ea{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 bi.projectionGlobe}get vertexShaderPreludeCode(){return bi.projectionMercator.vertexSource}get subdivisionGranularity(){return nn}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new Il(t));let a=u.Y(this._errorQueryLatitudeDegrees),s=2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI,c=this._errorMeasurement.updateErrorLoop(a,s),f=ke();c!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=c,this._errorMeasurementLastChangeTime=f);let y=Math.min(Math.max((f-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=u.bt(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,u.bu(y))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,a,s,c,f){let y=(f==="stencil"?nn.stencil:nn.tile).getGranularityForZoomLevel(a.z);return this._getMesh(t,{granularity:y,generateBorders:s,extendToNorthPole:a.y===0&&c,extendToSouthPole:a.y===(1<<a.z)-1&&c})}_getMesh(t,a){let s=this._getMeshKey(a);if(s in this._tileMeshCache)return this._tileMeshCache[s];let c=(function(f,y){let b=gr(y,"16bit"),w=u.aU.deserialize({arrayBuffer:b.vertices,length:b.vertices.byteLength/2/2}),S=u.aW.deserialize({arrayBuffer:b.indices,length:b.indices.byteLength/2/3});return new ha(f.createVertexBuffer(w,Jt.members),f.createIndexBuffer(S),u.aV.simpleSegment(0,0,w.length,S.length))})(t,a);return this._tileMeshCache[s]=c,c}recalculate(t){}hasTransition(){var t;let a=ke(),s=!1;return s||(s=(a-this._errorMeasurementLastChangeTime)/1e3<.7),s||(s=(t=this._errorMeasurement)===null||t===void 0?void 0:t.awaitingQuery),s}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let ss=new u.u({type:new u.D(u.x.projection.type)});class zl extends u.E{constructor(t){super(),this._transitionable=new u.y(ss,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new u.J(0)),this._mercatorProjection=new So,this._verticalPerspectiveProjection=new ea}get transitionState(){let 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 u.bv){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,a,s,c,f){return this.currentProjection.getMeshFromTileID(t,a,s,c,f)}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 Al(d){let t=ls(d.worldSize,d.center.lat);return 2*Math.PI*t}function Rr(d,t,a,s,c){let f=1/(1<<c),y=t/u.a6*f+s*f,b=u.by((d/u.a6*f+a*f)*Math.PI*2+Math.PI,2*Math.PI),w=2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI,S=Math.cos(w),P=new Float64Array(3);return P[0]=Math.sin(b)*S,P[1]=Math.sin(w),P[2]=Math.cos(b)*S,P}function er(d){return(function(t,a){let s=Math.cos(a),c=new Float64Array(3);return c[0]=Math.sin(t)*s,c[1]=Math.sin(a),c[2]=Math.cos(t)*s,c})(d.lng*Math.PI/180,d.lat*Math.PI/180)}function ls(d,t){return d/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Zc(d){let t=Math.asin(d[1])/Math.PI*180,a=Math.sqrt(d[0]*d[0]+d[2]*d[2]);if(a>1e-6){let s=d[0]/a,c=Math.acos(d[2]/a),f=(s>0?c:-c)/Math.PI*180;return new u.W(u.X(f,-180,180),t)}return new u.W(0,t)}function cs(d){return Math.cos(d*Math.PI/180)}function Ni(d,t){let a=cs(d),s=cs(t);return u.ar(s/a)}function $c(d,t){let a=d.rotate(t.bearingInRadians),s=t.zoom+Ni(t.center.lat,0),c=u.bt(1/cs(t.center.lat),1/cs(Math.min(Math.abs(t.center.lat),60)),u.bw(s,7,3,0,1)),f=360/Al({worldSize:t.worldSize,center:{lat:t.center.lat}});return new u.W(t.center.lng-a.x*f*c,u.al(t.center.lat+a.y*f,-u.am,u.am))}function Co(d){let t=.5*d,a=Math.sin(t),s=Math.cos(t);return Math.log(a+s)-Math.log(s-a)}function us(d,t,a,s){let c=d.lat+a*s;if(Math.abs(a)>1){let f=(Math.sign(d.lat+a)!==Math.sign(d.lat)?-Math.abs(d.lat):Math.abs(d.lat))*Math.PI/180,y=Math.abs(d.lat+a)*Math.PI/180,b=Co(f+s*(y-f)),w=Co(f),S=Co(y);return new u.W(d.lng+t*((b-w)/(S-w)),c)}return new u.W(d.lng+t*s,c)}class hs{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,a,s,c){let f=`${t.z}_${t.x}_${t.y}_${c?.terrain?"t":""}`,y=this._cache.get(f);if(y)return y;let b=this._cachePrevious.get(f);if(b)return this._cache.set(f,b),b;let w=this._boundingVolumeFactory(t,a,s,c);return this._cache.set(f,w),this._hadAnyChanges=!0,w}}class La{constructor(t,a,s,c){this.min=s,this.max=c,this.points=t,this.planes=a}static fromAabb(t,a){let s=[];for(let c=0;c<8;c++)s.push([1&~c?t[0]:a[0],(c>>1&1)==1?a[1]:t[1],(c>>2&1)==1?a[2]:t[2]]);return new La(s,[[-1,0,0,a[0]],[1,0,0,-t[0]],[0,-1,0,a[1]],[0,1,0,-t[1]],[0,0,-1,a[2]],[0,0,1,-t[2]]],t,a)}static fromCenterSizeAngles(t,a,s){let c=u.bA([],s[0],s[1],s[2]),f=u.bB([],[a[0],0,0],c),y=u.bB([],[0,a[1],0],c),b=u.bB([],[0,0,a[2]],c),w=[...t],S=[...t];for(let A=0;A<8;A++)for(let k=0;k<3;k++){let R=t[k]+f[k]*(1&~A?-1:1)+y[k]*((A>>1&1)==1?1:-1)+b[k]*((A>>2&1)==1?1:-1);w[k]=Math.min(w[k],R),S[k]=Math.max(S[k],R)}let P=[];for(let A=0;A<8;A++){let k=[...t];u.a_(k,k,u.aZ([],f,1&~A?-1:1)),u.a_(k,k,u.aZ([],y,(A>>1&1)==1?1:-1)),u.a_(k,k,u.aZ([],b,(A>>2&1)==1?1:-1)),P.push(k)}return new La(P,[[...f,-u.b3(f,P[0])],[...y,-u.b3(y,P[0])],[...b,-u.b3(b,P[0])],[-f[0],-f[1],-f[2],-u.b3(f,P[7])],[-y[0],-y[1],-y[2],-u.b3(y,P[7])],[-b[0],-b[1],-b[2],-u.b3(b,P[7])]],w,S)}intersectsFrustum(t){let a=!0,s=this.points.length,c=this.planes.length,f=t.planes.length,y=t.points.length;for(let b=0;b<f;b++){let w=t.planes[b],S=0;for(let P=0;P<s;P++){let A=this.points[P];w[0]*A[0]+w[1]*A[1]+w[2]*A[2]+w[3]>=0&&S++}if(S===0)return 0;S<s&&(a=!1)}if(a)return 2;for(let b=0;b<c;b++){let w=this.planes[b],S=0;for(let P=0;P<y;P++){let A=t.points[P];w[0]*A[0]+w[1]*A[1]+w[2]*A[2]+w[3]>=0&&S++}if(S===0)return 0}return 1}intersectsPlane(t){let a=this.points.length,s=0;for(let c=0;c<a;c++){let f=this.points[c];t[0]*f[0]+t[1]*f[1]+t[2]*f[2]+t[3]>=0&&s++}return s===a?2:s===0?0:1}}function Eo(d,t,a){let s=d-t;return s<0?-s:Math.max(0,s-a)}function qr(d,t,a,s,c){let f=d-a,y;return y=f<0?Math.min(-f,1+f-c):f>c?Math.min(Math.max(f-c,0),1-f):0,Math.max(y,Eo(t,s,c))}class wh{constructor(){this._boundingVolumeCache=new hs(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,a,s,c){let f=1<<s.z,y=1/f,b=s.x/f,w=s.y/f,S=2;return S=Math.min(S,qr(t,a,b,w,y)),S=Math.min(S,qr(t,a,b+.5,-w-y,y)),S=Math.min(S,qr(t,a,b+.5,2-w-y,y)),S}getWrap(t,a,s){let c=1<<a.z,f=1/c,y=a.x/c,b=Eo(t.x,y,f),w=Eo(t.x,y-1,f),S=Eo(t.x,y+1,f),P=Math.min(b,w,S);return P===S?1:P===w?-1:0}allowVariableZoom(t,a){return po(t,a)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,a,s,c){return this._boundingVolumeCache.getTileBoundingVolume(t,a,s,c)}_computeTileBoundingVolume(t,a,s,c){var f,y;let b=0,w=0;if(c?.terrain){let S=new u.a3(t.z,a,t.z,t.x,t.y),P=c.terrain.getMinMaxElevation(S);b=(f=P.minElevation)!==null&&f!==void 0?f:Math.min(0,s),w=(y=P.maxElevation)!==null&&y!==void 0?y:Math.max(0,s)}if(b/=u.bD,w/=u.bD,b+=1,w+=1,t.z<=0)return La.fromAabb([-w,-w,-w],[w,w,w]);if(t.z===1)return La.fromAabb([t.x===0?-w:0,t.y===0?0:-w,-w],[t.x===0?0:w,t.y===0?w:0,w]);{let S=[Rr(0,0,t.x,t.y,t.z),Rr(u.a6,0,t.x,t.y,t.z),Rr(u.a6,u.a6,t.x,t.y,t.z),Rr(0,u.a6,t.x,t.y,t.z)],P=[];for(let Pe of S)P.push(u.aZ([],Pe,w));if(w!==b)for(let Pe of S)P.push(u.aZ([],Pe,b));t.y===0&&P.push([0,1,0]),t.y===(1<<t.z)-1&&P.push([0,-1,0]);let A=[1,1,1],k=[-1,-1,-1];for(let Pe of P)for(let Me=0;Me<3;Me++)A[Me]=Math.min(A[Me],Pe[Me]),k[Me]=Math.max(k[Me],Pe[Me]);let R=Rr(u.a6/2,u.a6/2,t.x,t.y,t.z),V=u.b2([],[0,1,0],R);u.b1(V,V);let q=u.b2([],R,V);u.b1(q,q);let H=u.b2([],S[2],S[1]);u.b1(H,H);let Z=u.b2([],S[0],S[3]);u.b1(Z,Z),P.push(u.aZ([],R,w)),t.y>=(1<<t.z)/2&&P.push(u.aZ([],Rr(u.a6/2,0,t.x,t.y,t.z),w)),t.y<(1<<t.z)/2&&P.push(u.aZ([],Rr(u.a6/2,u.a6,t.x,t.y,t.z),w));let Y=ds(R,P),ie=ds(q,P),X=[-R[0],-R[1],-R[2],Y.max],W=[R[0],R[1],R[2],-Y.min],te=[-q[0],-q[1],-q[2],ie.max],J=[q[0],q[1],q[2],-ie.min],le=[...H,0],me=[...Z,0],de=[];return t.y===0?de.push(u.bC(me,le,X),u.bC(me,le,W)):de.push(u.bC(te,le,X),u.bC(te,le,W),u.bC(te,me,X),u.bC(te,me,W)),t.y===(1<<t.z)-1?de.push(u.bC(me,le,X),u.bC(me,le,W)):de.push(u.bC(J,le,X),u.bC(J,le,W),u.bC(J,me,X),u.bC(J,me,W)),new La(de,[X,W,te,J,le,me],A,k)}}}function ds(d,t){let a=1/0,s=-1/0;for(let c of t){let f=u.b3(d,c);a=Math.min(a,f),s=Math.max(s,f)}return{min:a,max:s}}class Ra{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,a,s){this._helper.interpolatePadding(t,a,s)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a){this._helper.resize(t,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}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=u.bE(),this._projectionMatrix=u.bi(),this._globeViewProjMatrix32f=u.bh(),this._globeViewProjMatrixNoCorrection=u.bi(),this._globeViewProjMatrixNoCorrectionInverted=u.bi(),this._globeProjMatrixInverted=u.bi(),this._cameraPosition=u.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(a,s)=>{let c=u.al(a.lat,-u.am,u.am),f=u.al(+s,this.minZoom+Ni(0,c),this.maxZoom);return{center:new u.W(a.lng,c),zoom:f}},this.applyConstrain=(a,s)=>this._helper.applyConstrain(a,s),this._helper=new Cl({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,s)=>this.defaultConstrain(a,s)},t),this._coveringTilesDetailsProvider=new wh}clone(){let t=new Ra;return t.apply(this,!1),t}apply(t,a,s){this._globeLatitudeErrorCorrectionRadians=s||0,this._helper.apply(t,a)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=u.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){let{overscaledTileID:a,applyGlobeMatrix:s}=t,c=this._helper.getMercatorTileCoordinates(a);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:c,clippingPlane:this._cachedClippingPlane,projectionTransition:s?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){let a=this.pitchInRadians,s=this.cameraToCenterDistance/t,c=Math.sin(a)*s,f=Math.cos(a)*s+1,y=1/Math.sqrt(c*c+f*f)*1,b=-c,w=f,S=Math.sqrt(b*b+w*w);b/=S,w/=S;let P=[0,b,w];u.bF(P,P,[0,0,0],-this.bearingInRadians),u.bG(P,P,[0,0,0],-1*this.center.lat*Math.PI/180),u.bH(P,P,[0,0,0],this.center.lng*Math.PI/180);let A=1/u.b5(P);return u.aZ(P,P,A),[...P,-y*A]}isLocationOccluded(t){return!this.isSurfacePointVisible(er(t))}transformLightDirection(t){let a=this._helper._center.lng*Math.PI/180,s=this._helper._center.lat*Math.PI/180,c=Math.cos(s),f=[Math.sin(a)*c,Math.sin(s),Math.cos(a)*c],y=[f[2],0,-f[0]],b=[0,0,0];u.b2(b,y,f),u.b1(y,y),u.b1(b,b);let w=[0,0,0];return u.b1(w,[y[0]*t[0]+b[0]*t[1]+f[0]*t[2],y[1]*t[0]+b[1]*t[1]+f[1]*t[2],y[2]*t[0]+b[2]*t[1]+f[2]*t[2]]),w}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,a,s){let c=(function(b,w,S){let P=1/(1<<S.z);return new u.a7(b/u.a6*P+S.x*P,w/u.a6*P+S.y*P)})(t,a,s.canonical),f=(y=c.y,[u.by(c.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-y*Math.PI*2))-.5*Math.PI]);var y;return this.getCircleRadiusCorrection()/Math.cos(f[1])}projectTileCoordinates(t,a,s,c){let f=s.canonical,y=Rr(t,a,f.x,f.y,f.z),b=1+(c?c(t,a):0)/u.bD,w=[y[0]*b,y[1]*b,y[2]*b,1];u.aE(w,w,this._globeViewProjMatrixNoCorrection);let S=this._cachedClippingPlane,P=S[0]*y[0]+S[1]*y[1]+S[2]*y[2]+S[3]<0;return{point:new u.P(w[0]/w[3],w[1]/w[3]),signedDistanceFromCamera:w[3],isOccluded:P}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=ls(this.worldSize,this.center.lat),a=u.bj(),s=u.bj();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),u.bc(a,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let c=this.centerOffset;a[8]=2*-c.x/this._helper._width,a[9]=2*c.y/this._helper._height,this._projectionMatrix=u.bd(a),this._globeProjMatrixInverted=u.bj(),u.bg(this._globeProjMatrixInverted,a),u.Q(a,a,[0,0,-this.cameraToCenterDistance]),u.be(a,a,this.rollInRadians),u.bf(a,a,-this.pitchInRadians),u.be(a,a,this.bearingInRadians),u.Q(a,a,[0,0,-t]);let f=u.bz();f[0]=t,f[1]=t,f[2]=t,u.bf(s,a,this.center.lat*Math.PI/180),u.bI(s,s,-this.center.lng*Math.PI/180),u.S(s,s,f),this._globeViewProjMatrixNoCorrection=s,u.bf(a,a,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),u.bI(a,a,-this.center.lng*Math.PI/180),u.S(a,a,f),this._globeViewProjMatrix32f=new Float32Array(a),this._globeViewProjMatrixNoCorrectionInverted=u.bj(),u.bg(this._globeViewProjMatrixNoCorrectionInverted,s);let y=u.bz();this._cameraPosition=u.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/t,u.bF(this._cameraPosition,this._cameraPosition,y,-this.rollInRadians),u.bG(this._cameraPosition,this._cameraPosition,y,this.pitchInRadians),u.bF(this._cameraPosition,this._cameraPosition,y,-this.bearingInRadians),u.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),u.bG(this._cameraPosition,this._cameraPosition,y,-this.center.lat*Math.PI/180),u.bH(this._cameraPosition,this._cameraPosition,y,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let b=u.bd(this._globeViewProjMatrixNoCorrectionInverted);u.S(b,b,[1,1,-1]),this._cachedFrustum=Wa.fromInvProjectionMatrix(b,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){u.w("calculateFogMatrix is not supported on globe projection.");let a=u.bj();return u.ap(a),a}getVisibleUnwrappedCoordinates(t){return[new u.ba(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&u.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,a){if(!this._globeViewProjMatrixNoCorrection)return 1;let s=er(t);u.aZ(s,s,1+a/u.bD);let c=u.bE();return u.aE(c,[s[0],s[1],s[2],1],this._globeViewProjMatrixNoCorrection),c[2]/c[3]}populateCache(t){}getBounds(){let t=.5*this.width,a=.5*this.height,s=[new u.P(0,0),new u.P(t,0),new u.P(this.width,0),new u.P(this.width,a),new u.P(this.width,this.height),new u.P(t,this.height),new u.P(0,this.height),new u.P(0,a)],c=[];for(let A of s)c.push(this.unprojectScreenPoint(A));let f=0,y=0,b=0,w=0,S=this.center;for(let A of c){let k=u.bJ(S.lng,A.lng),R=u.bJ(S.lat,A.lat);k<y&&(y=k),k>f&&(f=k),R<w&&(w=R),R>b&&(b=R)}let P=[S.lng+y,S.lat+w,S.lng+f,S.lat+b];return this.isSurfacePointOnScreen([0,1,0])&&(P[3]=90,P[0]=-180,P[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(P[1]=-90,P[0]=-180,P[2]=180),new Pt(P)}calculateCenterFromCameraLngLatAlt(t,a,s,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,s,c)}setLocationAtPoint(t,a){let s=er(this.unprojectScreenPoint(a)),c=er(t),f=u.bz();u.bK(f);let y=u.bz();u.bH(y,s,f,-this.center.lng*Math.PI/180),u.bG(y,y,f,this.center.lat*Math.PI/180);let b=c[0]*c[0]+c[2]*c[2],w=y[0]*y[0];if(b<w)return;let S=Math.sqrt(b-w),P=-S,A=u.bL(c[0],c[2],y[0],S),k=u.bL(c[0],c[2],y[0],P),R=u.bz();u.bH(R,c,f,-A);let V=u.bL(R[1],R[2],y[1],y[2]),q=u.bz();u.bH(q,c,f,-k);let H=u.bL(q[1],q[2],y[1],y[2]),Z=.5*Math.PI,Y=V>=-Z&&V<=Z,ie=H>=-Z&&H<=Z,X,W;if(Y&&ie){let me=this.center.lng*Math.PI/180,de=this.center.lat*Math.PI/180;u.bM(A,me)+u.bM(V,de)<u.bM(k,me)+u.bM(H,de)?(X=A,W=V):(X=k,W=H)}else if(Y)X=A,W=V;else{if(!ie)return;X=k,W=H}let te=X/Math.PI*180,J=W/Math.PI*180,le=this.center.lat;this.setCenter(new u.W(te,u.al(J,-90,90))),this.setZoom(this.zoom+Ni(le,this.center.lat))}locationToScreenPoint(t,a){let s=er(t);if(a){let c=a.getElevationForLngLatZoom(t,this._helper._tileZoom);u.aZ(s,s,1+c/u.bD)}return this._projectSurfacePointToScreen(s)}_projectSurfacePointToScreen(t){let a=u.bE();return u.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],new u.P((.5*a[0]+.5)*this.width,(.5*-a[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,a){if(a){let s=a.pointCoordinate(t);if(s)return s}return u.a7.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,a){var s;return(s=this.screenPointToMercatorCoordinate(t,a))===null||s===void 0?void 0:s.toLngLat()}isPointOnMapSurface(t,a){let s=this._cameraPosition,c=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(s,c)}getRayDirectionFromPixel(t){let a=u.bE();a[0]=t.x/this.width*2-1,a[1]=-1*(t.y/this.height*2-1),a[2]=1,a[3]=1,u.aE(a,a,this._globeViewProjMatrixNoCorrectionInverted),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3];let s=u.bz();s[0]=a[0]-this._cameraPosition[0],s[1]=a[1]-this._cameraPosition[1],s[2]=a[2]-this._cameraPosition[2];let c=u.bz();return u.b1(c,s),c}isSurfacePointVisible(t){let a=this._cachedClippingPlane;return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let a=u.bE();return u.aE(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3],a[0]>-1&&a[0]<1&&a[1]>-1&&a[1]<1&&a[2]>-1&&a[2]<1}rayPlanetIntersection(t,a){let s=u.b3(t,a),c=u.bz(),f=u.bz();u.aZ(f,a,s),u.b0(c,t,f);let y=1-u.b3(c,c);if(y<0)return null;let b=u.b3(t,t)-1,w=-s+(s<0?1:-1)*Math.sqrt(y),S=b/w,P=w;return{tMin:Math.min(S,P),tMax:Math.max(S,P)}}unprojectScreenPoint(t){let a=this._cameraPosition,s=this.getRayDirectionFromPixel(t),c=this.rayPlanetIntersection(a,s);if(c){let P=u.bz();u.a_(P,a,[s[0]*c.tMin,s[1]*c.tMin,s[2]*c.tMin]);let A=u.bz();return u.b1(A,P),Zc(A)}let f=this._cachedClippingPlane,y=f[0]*s[0]+f[1]*s[1]+f[2]*s[2],b=-u.b9(f,a)/y,w=u.bz();if(b>0)u.a_(w,a,[s[0]*b,s[1]*b,s[2]*b]);else{let P=u.bz();u.a_(P,a,[2*s[0],2*s[1],2*s[2]]);let A=u.b9(this._cachedClippingPlane,P);u.b0(w,P,[this._cachedClippingPlane[0]*A,this._cachedClippingPlane[1]*A,this._cachedClippingPlane[2]*A])}let S=(function(P){let A=u.bz();return A[0]=P[0]*-P[3],A[1]=P[1]*-P[3],A[2]=P[2]*-P[3],{center:A,radius:Math.sqrt(1-P[3]*P[3])}})(f);return Zc((function(P,A,k){let R=u.bz();u.b0(R,k,P);let V=u.bz();return u.bx(V,P,R,A/u.b7(R)),V})(S.center,S.radius,w))}getMatrixForModel(t,a){let s=u.W.convert(t),c=1/u.bD,f=u.bi();return u.bI(f,f,s.lng/180*Math.PI),u.bf(f,f,-s.lat/180*Math.PI),u.Q(f,f,[0,0,1+a/u.bD]),u.bf(f,f,.5*Math.PI),u.S(f,f,[c,c,c]),f}getProjectionDataForCustomLayer(t=!0){let a=this.getProjectionData({overscaledTileID:new u.a3(0,0,0,0,0),applyGlobeMatrix:t});return a.tileMercatorCoords=[0,0,1,1],a}getFastPathSimpleProjectionMatrix(t){}}class Fa{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,a,s){this._helper.interpolatePadding(t,a,s)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,s=!0){this._helper.resize(t,a,s)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}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,a){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=a,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=(a,s)=>this.currentTransform.defaultConstrain(a,s),this.applyConstrain=(a,s)=>this._helper.applyConstrain(a,s),this._helper=new Cl({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(a,s)=>this.defaultConstrain(a,s)},t),this._globeness=1,this._mercatorTransform=new _a,this._verticalPerspectiveTransform=new Ra}clone(){let t=new Fa;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,a){this._helper.apply(t,a),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){let a=this._mercatorTransform.getProjectionData(t),s=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?s.mainMatrix:a.mainMatrix,clippingPlane:s.clippingPlane,tileMercatorCoords:s.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:a.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return u.bt(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return u.bt(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,a,s){let c=this._mercatorTransform.getPitchedTextCorrection(t,a,s),f=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,a,s);return u.bt(c,f,this._globeness)}projectTileCoordinates(t,a,s,c){return this.currentTransform.projectTileCoordinates(t,a,s,c)}_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,a){return this.currentTransform.lngLatToCameraDepth(t,a)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,a,s,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,s,c)}setLocationAtPoint(t,a){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,a),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,a),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,a){return this.currentTransform.locationToScreenPoint(t,a)}screenPointToMercatorCoordinate(t,a){return this.currentTransform.screenPointToMercatorCoordinate(t,a)}screenPointToLocation(t,a){return this.currentTransform.screenPointToLocation(t,a)}isPointOnMapSurface(t,a){return this.currentTransform.isPointOnMapSurface(t,a)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,a){return this.currentTransform.getMatrixForModel(t,a)}getProjectionDataForCustomLayer(t=!0){let a=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return a;let s=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return s.fallbackMatrix=a.mainMatrix,s}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class ta{get useGlobeControls(){return!0}handlePanInertia(t,a){let s=$c(t,a);return Math.abs(s.lng-a.center.lng)>180&&(s.lng=a.center.lng+179.5*Math.sign(s.lng-a.center.lng)),{easingCenter:s,easingOffset:new u.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,a){let s=t.around,c=a.screenPointToLocation(s);t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta);let f=a.zoom;t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta);let y=a.zoom-f;if(y===0)return;let b=u.bJ(a.center.lng,c.lng),w=b/(Math.abs(b/180)+1),S=u.bJ(a.center.lat,c.lat),P=a.getRayDirectionFromPixel(s),A=a.cameraPosition,k=-1*u.b3(A,P),R=u.bz();u.a_(R,A,[P[0]*k,P[1]*k,P[2]*k]);let V=u.b5(R)-1,q=Math.exp(.5*-Math.max(V-.3,0)),H=ls(a.worldSize,a.center.lat)/Math.min(a.width,a.height),Z=u.bw(H,.9,.5,1,.25),Y=(1-u.ao(-y))*Math.min(q,Z),ie=a.center.lat,X=a.zoom,W=new u.W(a.center.lng+w*Y,u.al(a.center.lat+S*Y,-u.am,u.am));a.setLocationAtPoint(c,s);let te=a.center,J=u.bw(Math.abs(b),45,85,0,1),le=u.bw(H,.75,.35,0,1),me=Math.pow(Math.max(J,le),.25),de=u.bJ(te.lng,W.lng),Pe=u.bJ(te.lat,W.lat);a.setCenter(new u.W(te.lng+de*me,te.lat+Pe*me).wrap()),a.setZoom(X+Ni(ie,a.center.lat))}handleMapControlsPan(t,a,s){if(!t.panDelta)return;let c=a.center.lat,f=a.zoom;a.setCenter($c(t.panDelta,a).wrap()),a.setZoom(f+Ni(c,a.center.lat))}cameraForBoxAndBearing(t,a,s,c,f){let y=on(t,a,s,c,f),b=a.left/f.width*2-1,w=(f.width-a.right)/f.width*2-1,S=a.top/f.height*-2+1,P=(f.height-a.bottom)/f.height*-2+1,A=u.bJ(s.getWest(),s.getEast())<0,k=A?s.getEast():s.getWest(),R=A?s.getWest():s.getEast(),V=Math.max(s.getNorth(),s.getSouth()),q=Math.min(s.getNorth(),s.getSouth()),H=k+.5*u.bJ(k,R),Z=V+.5*u.bJ(V,q),Y=f.clone();Y.setCenter(y.center),Y.setBearing(y.bearing),Y.setPitch(0),Y.setRoll(0),Y.setZoom(y.zoom);let ie=Y.modelViewProjectionMatrix,X=[er(s.getNorthWest()),er(s.getNorthEast()),er(s.getSouthWest()),er(s.getSouthEast()),er(new u.W(R,Z)),er(new u.W(k,Z)),er(new u.W(H,V)),er(new u.W(H,q))],W=er(y.center),te=Number.POSITIVE_INFINITY;for(let J of X)b<0&&(te=ta.getLesserNonNegativeNonNull(te,ta.solveVectorScale(J,W,ie,"x",b))),w>0&&(te=ta.getLesserNonNegativeNonNull(te,ta.solveVectorScale(J,W,ie,"x",w))),S>0&&(te=ta.getLesserNonNegativeNonNull(te,ta.solveVectorScale(J,W,ie,"y",S))),P<0&&(te=ta.getLesserNonNegativeNonNull(te,ta.solveVectorScale(J,W,ie,"y",P)));if(Number.isFinite(te)&&te!==0)return y.zoom=Math.min(Y.zoom+u.ar(te),t.maxZoom),y;as()}handleJumpToCenterZoom(t,a){let s=t.center.lat,c=t.applyConstrain(a.center?u.W.convert(a.center):t.center,t.zoom).center;t.setCenter(c.wrap());let f=a.zoom!==void 0?+a.zoom:t.zoom+Ni(s,c.lat);t.zoom!==f&&t.setZoom(f)}handleEaseTo(t,a){let s=t.zoom,c=t.center,f=t.padding,y={roll:t.roll,pitch:t.pitch,bearing:t.bearing},b={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},w=a.zoom!==void 0,S=!t.isPaddingEqual(a.padding),P=!1,A=a.center?u.W.convert(a.center):c,k=t.applyConstrain(A,s).center;rn(t,k);let R=t.clone();R.setCenter(k),R.setZoom(w?+a.zoom:s+Ni(c.lat,A.lat)),R.setBearing(a.bearing);let V=new u.P(u.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),u.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));R.setLocationAtPoint(k,V);let q=(a.offset&&a.offsetAsPoint.mag())>0?R.center:k,H=w?+a.zoom:s+Ni(c.lat,q.lat),Z=s+Ni(c.lat,0),Y=H+Ni(q.lat,0),ie=u.bJ(c.lng,q.lng),X=u.bJ(c.lat,q.lat),W=u.ao(Y-Z);return P=H!==s,{easeFunc:te=>{if(u.bn(y,b)||os({startEulerAngles:y,endEulerAngles:b,tr:t,k:te,useSlerp:y.roll!=b.roll}),S&&t.interpolatePadding(f,a.padding,te),a.around)u.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(a.around,a.aroundPoint);else{let J=Y>Z?Math.min(2,W):Math.max(.5,W),le=Math.pow(J,1-te),me=us(c,ie,X,te*le);t.setCenter(me.wrap())}if(P){let J=u.H.number(Z,Y,te)+Ni(0,t.center.lat);t.setZoom(J)}},isZooming:P,elevationCenter:q}}handleFlyTo(t,a){let s=a.zoom!==void 0,c=t.center,f=t.zoom,y=t.padding,b=!t.isPaddingEqual(a.padding),w=t.applyConstrain(u.W.convert(a.center||a.locationAtOffset),f).center,S=s?+a.zoom:t.zoom+Ni(t.center.lat,w.lat),P=t.clone();P.setCenter(w),P.setZoom(S),P.setBearing(a.bearing);let A=new u.P(u.al(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),u.al(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));P.setLocationAtPoint(w,A);let k=P.center;rn(t,k);let R=(function(X,W,te){let J=er(W),le=er(te),me=u.b3(J,le),de=Math.acos(me),Pe=Al(X);return de/(2*Math.PI)*Pe})(t,c,k),V=f+Ni(c.lat,0),q=S+Ni(k.lat,0),H=u.ao(q-V),Z;if(typeof a.minZoom=="number"){let X=+a.minZoom+Ni(k.lat,0),W=Math.min(X,V,q)+Ni(0,k.lat),te=t.applyConstrain(k,W).zoom+Ni(k.lat,0);Z=u.ao(te-V)}let Y=u.bJ(c.lng,k.lng),ie=u.bJ(c.lat,k.lat);return{easeFunc:(X,W,te,J)=>{let le=us(c,Y,ie,te);b&&t.interpolatePadding(y,a.padding,X);let me=X===1?k:le;t.setCenter(me.wrap());let de=V+u.ar(W);t.setZoom(X===1?S:de+Ni(0,me.lat))},scaleOfZoom:H,targetCenter:k,scaleOfMinZoom:Z,pixelPathLength:R}}static solveVectorScale(t,a,s,c,f){let y=c==="x"?[s[0],s[4],s[8],s[12]]:[s[1],s[5],s[9],s[13]],b=[s[3],s[7],s[11],s[15]],w=t[0]*y[0]+t[1]*y[1]+t[2]*y[2],S=t[0]*b[0]+t[1]*b[1]+t[2]*b[2],P=a[0]*y[0]+a[1]*y[1]+a[2]*y[2],A=a[0]*b[0]+a[1]*b[1]+a[2]*b[2];return P+f*S===w+f*A||b[3]*(w-P)+y[3]*(A-S)+w*A==P*S?null:(P+y[3]-f*A-f*b[3])/(P-w-f*A+f*S)}static getLesserNonNegativeNonNull(t,a){return a!==null&&a>=0&&a<t?a:t}}class sn{constructor(t){this._globe=t,this._mercatorCameraHelper=new Po,this._verticalPerspectiveCameraHelper=new ta}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,a){return this.currentHelper.handlePanInertia(t,a)}handleMapControlsRollPitchBearingZoom(t,a){this.currentHelper.handleMapControlsRollPitchBearingZoom(t,a)}handleMapControlsPan(t,a,s){this.currentHelper.handleMapControlsPan(t,a,s)}cameraForBoxAndBearing(t,a,s,c,f){return this.currentHelper.cameraForBoxAndBearing(t,a,s,c,f)}handleJumpToCenterZoom(t,a){this.currentHelper.handleJumpToCenterZoom(t,a)}handleEaseTo(t,a){return this.currentHelper.handleEaseTo(t,a)}handleFlyTo(t,a){return this.currentHelper.handleFlyTo(t,a)}}let ps=(d,t)=>u.C(d,t?.filter((a=>a.identifier!=="source.canvas"))),Io=u.bN();class kl extends u.E{constructor(t,a={}){var s,c;super(),this._rtlPluginLoaded=()=>{for(let y in this.tileManagers){let b=this.tileManagers[y].getSource().type;b!=="vector"&&b!=="geojson"||this.tileManagers[y].reload()}},this.map=t,this.dispatcher=new vi(di(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((y,b)=>this.getGlyphs(y,b))),this.dispatcher.registerMessageHandler("GI",((y,b)=>this.getImages(y,b))),this.dispatcher.registerMessageHandler("GDA",((y,b)=>this.getDashes(y,b))),this.imageManager=new We,this.imageManager.setEventedParent(this);let f=((s=t._container)===null||s===void 0?void 0:s.lang)||typeof document<"u"&&((c=document.documentElement)===null||c===void 0?void 0:c.lang)||void 0;this.glyphManager=new He(t._requestManager,a.localIdeographFontFamily,f),this.lineAtlas=new Ar(256,512),this.crossTileSymbolIndex=new fr,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",u.bO()),Re().on(ge,this._rtlPluginLoaded),this.on("data",(y=>{if(y.dataType!=="source"||y.sourceDataType!=="metadata")return;let b=this.tileManagers[y.sourceId];if(!b)return;let w=b.getSource();if(w?.vectorLayerIds)for(let S in this._layers){let P=this._layers[S];P.source===w.id&&this._validateLayer(P)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new u.bP,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,a){var s,c,f;this._checkLoaded();let y=a===null?(f=(c=(s=this.stylesheet.state)===null||s===void 0?void 0:s[t])===null||c===void 0?void 0:c.default)!==null&&f!==void 0?f:null:a;if(u.bQ(y,this._globalState[t]))return this;this._globalState[t]=y,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let a=[];for(let s in t)!u.bQ(this._globalState[s],t[s].default)&&(a.push(s),this._globalState[s]=t[s].default);this._applyGlobalStateChanges(a)}_applyGlobalStateChanges(t){if(t.length===0)return;let a=new Set,s={};for(let c of t){s[c]=this._globalState[c];for(let f in this._layers){let y=this._layers[f],b=y.getLayoutAffectingGlobalStateRefs(),w=y.getPaintAffectingGlobalStateRefs(),S=y.getVisibilityAffectingGlobalStateRefs();if(b.has(c)&&a.add(y.source),w.has(c))for(let{name:P,value:A}of w.get(c))this._updatePaintProperty(y,P,A);S?.has(c)&&(y.recalculateVisibility(),this._updateLayer(y))}}this.dispatcher.broadcast("UGS",s);for(let c in this.tileManagers)a.has(c)&&(this._reloadSource(c),this._changed=!0)}loadURL(t){return u._(this,arguments,void 0,(function*(a,s={},c){this.fire(new u.n("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate,this._loadStyleRequest=new AbortController;let f=this._loadStyleRequest;try{let y=yield this.map._requestManager.transformRequest(a,"Style");u.bR(f.signal);let b=yield u.k(y,f);this._loadStyleRequest===f&&(this._loadStyleRequest=null),this._load(b.data,s,c)}catch(y){this._loadStyleRequest===f&&(this._loadStyleRequest=null),y&&!f.signal.aborted&&this.fire(new u.l(u.d(y)))}}))}loadJSON(t,a={},s){this.fire(new u.n("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,ut.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(t,a,s)})).catch((()=>{}))}loadEmpty(){this.fire(new u.n("dataloading",{dataType:"style"})),this._load(Io,{validate:!1})}_load(t,a,s){var c,f;let y=a.transformStyle?a.transformStyle(s,t):t;if(!a.validate||!ps(this,u.F(y))){y=Object.assign({},y),this._loaded=!0,this.stylesheet=y;for(let b in y.sources)this.addSource(b,y.sources[b],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new dt(this.stylesheet.light),this._setProjectionInternal(((c=this.stylesheet.projection)===null||c===void 0?void 0:c.type)||"mercator"),this.sky=new ti(this.stylesheet.sky),this.map.setTerrain((f=this.stylesheet.terrain)!==null&&f!==void 0?f:null),this.fire(new u.n("data",{dataType:"style"})),this.fire(new u.n("style.load"))}}_createLayers(){var t,a,s;let c=u.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",c),this._order=c.map((f=>f.id)),this._layers={},this._serializedLayers=null;for(let f of c){let y=u.bT(f,this._globalState);if(y.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=y,u.bU(y)&&this.tileManagers[y.source]){let b=(s=(a=f.paint)===null||a===void 0?void 0:a["raster-fade-duration"])!==null&&s!==void 0?s:y.paint.get("raster-fade-duration");this.tileManagers[y.source].setRasterFadeDuration(b)}}}_loadSprite(t,a=!1,s=void 0){this.imageManager.setLoaded(!1);let c=new AbortController,f;this._spriteRequest=c,(function(y,b,w,S){return u._(this,void 0,void 0,(function*(){let P=ee(y),A=w>1?"@2x":"",k={},R={};for(let{id:V,url:q}of P){let H=yield b.transformRequest(ne(q,A,".json"),"SpriteJSON");k[V]=u.k(H,S);let Z=yield b.transformRequest(ne(q,A,".png"),"SpriteImage");R[V]=Xe.getImage(Z,S)}return yield Promise.all([...Object.values(k),...Object.values(R)]),(function(V,q){return u._(this,void 0,void 0,(function*(){let H={};for(let Z in V){H[Z]={};let Y=ut.getImageCanvasContext((yield q[Z]).data),ie=(yield V[Z]).data;for(let X in ie){let{width:W,height:te,x:J,y:le,sdf:me,pixelRatio:de,stretchX:Pe,stretchY:Me,content:Qe,textFitWidth:Le,textFitHeight:xe}=ie[X];H[Z][X]={data:null,pixelRatio:de,sdf:me,stretchX:Pe,stretchY:Me,content:Qe,textFitWidth:Le,textFitHeight:xe,spriteData:{width:W,height:te,x:J,y:le,context:Y}}}}return H}))})(k,R)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((y=>{if(this._spriteRequest=null,y)for(let b in y){this._spritesImagesIds[b]=[];let w=this._spritesImagesIds[b]?this._spritesImagesIds[b].filter((S=>!(S in y))):[];for(let S of w)this.imageManager.removeImage(S),this._changedImages[S]=!0;for(let S in y[b]){let P=b==="default"?S:`${b}:${S}`;this._spritesImagesIds[b].push(P),P in this.imageManager.images?this.imageManager.updateImage(P,y[b][S],!1):this.imageManager.addImage(P,y[b][S]),a&&(this._changedImages[P]=!0)}}})).catch((y=>{this._spriteRequest=null,f=y,c.signal.aborted||this.fire(new u.l(f))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.n("data",{dataType:"style"})),s&&s(f)}))}_unloadSprite(){for(let 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 u.n("data",{dataType:"style"}))}_validateLayer(t){let a=this.tileManagers[t.source];if(!a)return;let s=t.sourceLayer;if(!s)return;let c=a.getSource();(c.type==="geojson"||c.vectorLayerIds&&!c.vectorLayerIds.includes(s))&&this.fire(new u.l(new Error(`Source layer "${s}" does not exist on source "${c.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,a=!1){let s=this._serializedAllLayers();if(!t||t.length===0)return Object.values(a?u.bV(s):s);let c=[];for(let f of t)if(s[f]){let y=a?u.bV(s[f]):s[f];c.push(y)}return c}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let a=Object.keys(this._layers);for(let s of a){let c=this._layers[s];c.type!=="custom"&&(t[s]=c.serialize())}return t}hasTransitions(){var t,a,s;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((a=this.sky)===null||a===void 0)&&a.hasTransition()||!((s=this.projection)===null||s===void 0)&&s.hasTransition())return!0;for(let c in this.tileManagers)if(this.tileManagers[c].hasTransition())return!0;for(let c in this._layers)if(this._layers[c].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let a=this._changed;if(a){let c=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(c.length||f.length)&&this._updateWorkerLayers(c,f);for(let y in this._updatedSources){let b=this._updatedSources[y];if(b==="reload")this._reloadSource(y);else{if(b!=="clear")throw new Error(`Invalid action ${b}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let y in this._updatedPaintProps)this._layers[y].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let s={};for(let c in this.tileManagers){let f=this.tileManagers[c];s[c]=f.used,f.used=!1}for(let c of this._order){let f=this._layers[c];f.recalculate(t,this._availableImages),!f.isHidden(t.zoom)&&f.source&&(this.tileManagers[f.source].used=!0)}for(let c in s){let f=this.tileManagers[c];!!s[c]!=!!f.used&&f.fire(new u.n("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,a&&this.fire(new u.n("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let a in this.tileManagers)this.tileManagers[a].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,a={}){var s;this._checkLoaded();let c=this.serialize();if(t=a.transformStyle?a.transformStyle(c,t):t,((s=a.validate)===null||s===void 0||s)&&ps(this,u.F(t)))return!1;(t=u.bV(t)).layers=u.bS(t.layers);let f=u.bW(c,t),y=this._getOperationsToPerform(f);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(let b of y.operations)b();return this.stylesheet=t,this._serializedLayers=null,this.fire(new u.n("style.load",{style:this})),!0}_getOperationsToPerform(t){let a=[],s=[];for(let c of t)switch(c.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":a.push((()=>this.addLayer.apply(this,c.args)));break;case"removeLayer":a.push((()=>this.removeLayer.apply(this,c.args)));break;case"setPaintProperty":a.push((()=>this.setPaintProperty.apply(this,c.args)));break;case"setLayoutProperty":a.push((()=>this.setLayoutProperty.apply(this,c.args)));break;case"setFilter":a.push((()=>this.setFilter.apply(this,c.args)));break;case"addSource":a.push((()=>this.addSource.apply(this,c.args)));break;case"removeSource":a.push((()=>this.removeSource.apply(this,c.args)));break;case"setLayerZoomRange":a.push((()=>this.setLayerZoomRange.apply(this,c.args)));break;case"setLight":a.push((()=>this.setLight.apply(this,c.args)));break;case"setGeoJSONSourceData":a.push((()=>this.setGeoJSONSourceData.apply(this,c.args)));break;case"setGlyphs":a.push((()=>this.setGlyphs.apply(this,c.args)));break;case"setSprite":a.push((()=>this.setSprite.apply(this,c.args)));break;case"setTerrain":a.push((()=>this.map.setTerrain.apply(this,c.args)));break;case"setSky":a.push((()=>this.setSky.apply(this,c.args)));break;case"setProjection":this.setProjection.apply(this,c.args);break;case"setGlobalState":a.push((()=>this.setGlobalState.apply(this,c.args)));break;case"setTransition":a.push((()=>{}));break;default:s.push(c.command)}return{operations:a,unimplemented:s}}addImage(t,a){if(this.getImage(t))return this.fire(new u.l(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,a),this._afterImageUpdated(t)}updateImage(t,a){this.imageManager.updateImage(t,a)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new u.l(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 u.n("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,a,s={}){var c;if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(a.type)&&this._validate(u.F.source,`sources.${t}`,a,null,s))return;!((c=this.map)===null||c===void 0)&&c._collectResourceTiming&&(a.collectResourceTiming=!0);let f=this.tileManagers[t]=new Oi(t,a,this.dispatcher);f.style=this,f.setEventedParent(this,(()=>({isSourceLoaded:f.loaded(),source:f.serialize(),sourceId:t}))),f.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=${t}`);for(let s in this._layers)if(this._layers[s].source===t)return this.fire(new u.l(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));let a=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],a.fire(new u.n("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,a){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let s=this.tileManagers[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(a),this._changed=!0}getSource(t){var a;return(a=this.tileManagers[t])===null||a===void 0?void 0:a.getSource()}addLayer(t,a,s={}){this._checkLoaded();let c=t.id;if(this.getLayer(c))return void this.fire(new u.l(new Error(`Layer "${c}" already exists on this map.`)));let f;if(t.type==="custom"){if(ps(this,u.bX(t)))return;f=u.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=u.bV(t),t=u.e(t,{source:c})),this._validate(u.F.layer,`layers.${c}`,t,{arrayIndex:-1},s))return;f=u.bT(t,this._globalState),this._validateLayer(f),f.setEventedParent(this,{layer:{id:c}})}let y=a?this._order.indexOf(a):this._order.length;if(a&&y===-1)this.fire(new u.l(new Error(`Cannot add layer "${c}" before non-existing layer "${a}".`)));else{if(this._order.splice(y,0,c),this._layerOrderChanged=!0,this._layers[c]=f,this._removedLayers[c]&&f.source&&f.type!=="custom"){let b=this._removedLayers[c];delete this._removedLayers[c],b.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",this.tileManagers[f.source].pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map)}}moveLayer(t,a){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new u.l(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===a)return;let s=this._order.indexOf(t);this._order.splice(s,1);let c=a?this._order.indexOf(a):this._order.length;a&&c===-1?this.fire(new u.l(new Error(`Cannot move layer "${t}" before non-existing layer "${a}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let a=this._layers[t];if(!a)return void this.fire(new u.l(new Error(`Cannot remove non-existing layer "${t}".`)));a.setEventedParent(null);let s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=a,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],a.onRemove&&a.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,a,s){this._checkLoaded();let c=this.getLayer(t);c?c.minzoom===a&&c.maxzoom===s||(a!=null&&(c.minzoom=a),s!=null&&(c.maxzoom=s),this._updateLayer(c)):this.fire(new u.l(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,a,s={}){this._checkLoaded();let c=this.getLayer(t);if(c){if(!u.bQ(c.filter,a))return a==null?(c.setFilter(void 0),void this._updateLayer(c)):void(this._validate(u.F.filter,`layers.${c.id}.filter`,a,null,s)||(c.setFilter(u.bV(a)),this._updateLayer(c)))}else this.fire(new u.l(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return u.bV(this.getLayer(t).filter)}setLayoutProperty(t,a,s,c={}){this._checkLoaded();let f=this.getLayer(t);f?u.bQ(f.getLayoutProperty(a),s)||(f.setLayoutProperty(a,s,c),this._updateLayer(f)):this.fire(new u.l(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,a){let s=this.getLayer(t);if(s)return s.getLayoutProperty(a);this.fire(new u.l(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,a,s,c={}){this._checkLoaded();let f=this.getLayer(t);f?u.bQ(f.getPaintProperty(a),s)||this._updatePaintProperty(f,a,s,c):this.fire(new u.l(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,a,s,c={}){t.setPaintProperty(a,s,c)&&this._updateLayer(t),u.bU(t)&&a==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(s),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,a){return this.getLayer(t).getPaintProperty(a)}setFeatureState(t,a){this._checkLoaded();let s=t.source,c=t.sourceLayer,f=this.tileManagers[s];if(f===void 0)return void this.fire(new u.l(new Error(`The source '${s}' does not exist in the map's style.`)));let y=f.getSource().type;y==="geojson"&&c?this.fire(new u.l(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||c?(t.id===void 0&&this.fire(new u.l(new Error("The feature id parameter must be provided."))),f.setFeatureState(c,t.id,a)):this.fire(new u.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,a){this._checkLoaded();let s=t.source,c=this.tileManagers[s];if(c===void 0)return void this.fire(new u.l(new Error(`The source '${s}' does not exist in the map's style.`)));let f=c.getSource().type,y=f==="vector"?t.sourceLayer:void 0;f!=="vector"||y?a&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new u.l(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(y,t.id,a):this.fire(new u.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let a=t.source,s=t.sourceLayer,c=this.tileManagers[a];if(c!==void 0)return c.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new u.l(new Error("The feature id parameter must be provided."))),c.getFeatureState(s,t.id)):void this.fire(new u.l(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new u.l(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){var t;return u.e({duration:300,delay:0},(t=this.stylesheet)===null||t===void 0?void 0:t.transition)}serialize(){if(!this._loaded)return;let t=u.bY(this.tileManagers,(f=>f.serialize())),a=this._serializeByIds(this._order,!0),s=this.map.getTerrain()||void 0,c=this.stylesheet;return u.bZ({version:c.version,name:c.name,metadata:c.metadata,light:c.light,sky:c.sky,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,projection:c.projection,sources:t,layers:a,terrain:s},(f=>f!==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){let a=y=>this._layers[y].type==="fill-extrusion",s={},c=[];for(let y=this._order.length-1;y>=0;y--){let b=this._order[y];if(a(b)){s[b]=y;for(let w of t){let S=w[b];if(S)for(let P of S)c.push(P)}}}c.sort(((y,b)=>b.intersectionZ-y.intersectionZ));let f=[];for(let y=this._order.length-1;y>=0;y--){let b=this._order[y];if(a(b))for(let w=c.length-1;w>=0;w--){let S=c[w].feature;if(s[S.layer.id]<y)break;f.push(S),c.pop()}else for(let w of t){let S=w[b];if(S)for(let P of S)f.push(P.feature)}}return f}queryRenderedFeatures(t,a,s){a?.filter&&this._validate(u.F.filter,"queryRenderedFeatures.filter",a.filter,null,a);let c={};if(a?.layers){if(!(Array.isArray(a.layers)||a.layers instanceof Set))return this.fire(new u.l(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(let S of a.layers){let P=this._layers[S];if(!P)return this.fire(new u.l(new Error(`The layer '${S}' does not exist in the map's style and cannot be queried for features.`))),[];c[P.source]=!0}}let f=[];a.availableImages=this._availableImages;let y=this._serializedAllLayers(),b=a.layers instanceof Set?a.layers:Array.isArray(a.layers)?new Set(a.layers):null,w=Object.assign(Object.assign({},a),{layers:b,globalState:this._globalState});for(let S in this.tileManagers)a.layers&&!c[S]||f.push(qt(this.tileManagers[S],this._layers,y,t,w,s,this.map.terrain?(P,A,k)=>this.map.terrain.getElevation(P,A,k):void 0));return this.placement&&f.push((function(S,P,A,k,R,V,q){let H={},Z=V.queryRenderedSymbols(k),Y=[];for(let ie of Object.keys(Z).map(Number))Y.push(q[ie]);Y.sort(Pi);for(let ie of Y){let X=ie.featureIndex.lookupSymbolFeatures(Z[ie.bucketInstanceId],P,ie.bucketIndex,ie.sourceLayerIndex,{filterSpec:R.filter,globalState:R.globalState},R.layers,R.availableImages,S);for(let W in X){H[W]||(H[W]=[]);let te=X[W];te.sort(((J,le)=>{let me=ie.featureSortOrder;if(me){let de=me.indexOf(J.featureIndex);return me.indexOf(le.featureIndex)-de}return le.featureIndex-J.featureIndex}));for(let J of te)H[W].push(J)}}return(function(ie,X,W){for(let te in ie)for(let J of ie[te])Nt(J,W[X[te].source]);return ie})(H,S,A)})(this._layers,y,this.tileManagers,t,w,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(t,a){a?.filter&&this._validate(u.F.filter,"querySourceFeatures.filter",a.filter,null,a);let s=this.tileManagers[t];return s?(function(c,f){let y=c.getRenderableIds().map((S=>c.getTileByID(S))),b=[],w={};for(let S of y){let P=S.tileID.canonical.key;w[P]||(w[P]=!0,S.querySourceFeatures(b,f))}return b})(s,a?Object.assign(Object.assign({},a),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,a={}){this._checkLoaded();let s=this.light.getLight(),c=!1;for(let y in t)if(!u.bQ(t[y],s[y])){c=!0;break}if(!c)return;let f={now:ke(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,a),this.light.updateTransitions(f)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){this._checkLoaded();let a=t??{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===a.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(a.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,a={}){this._checkLoaded();let s=this.getSky(),c=!1;if(!t&&!s)return;if(t&&!s)c=!0;else if(!t&&s)c=!0;else for(let y in t)if(!u.bQ(t[y],s[y])){c=!0;break}if(!c)return;let f={now:ke(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,a),this.sky.updateTransitions(f)}_setProjectionInternal(t){let a=(function(s,c){let f={constrainOverride:c};if(Array.isArray(s)){let y=new zl({type:s});return{projection:y,transform:new Fa(f),cameraHelper:new sn(y)}}switch(s){case"mercator":return{projection:new So,transform:new _a(f),cameraHelper:new Po};case"globe":{let y=new zl({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:y,transform:new Fa(f),cameraHelper:new sn(y)}}case"vertical-perspective":return{projection:new ea,transform:new Ra(f),cameraHelper:new ta};default:return u.w(`Unknown projection name: ${s}. Falling back to mercator projection.`),{projection:new So,transform:new _a(f),cameraHelper:new Po}}})(t,this.map.transformConstrain);this.projection=a.projection,this.map.migrateProjection(a.transform,a.cameraHelper);for(let s in this.tileManagers)this.tileManagers[s].reload()}_validate(t,a,s,c,f={}){return f?.validate!==!1&&ps(this,t.call(u.F,u.e({key:a,style:this.serialize(),value:s,styleSpec:u.x},c)))}_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),Re().off(ge,this._rtlPluginLoaded);for(let a in this._layers)this._layers[a].setEventedParent(null);for(let a in this.tileManagers){let s=this.tileManagers[a];s.setEventedParent(null),s.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(let a in this.tileManagers)this.tileManagers[a].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,a,s,c,f=!1){let y=!1,b=!1,w={};for(let S of this._order){let P=this._layers[S];if(P.type!=="symbol")continue;if(!w[P.source]){let k=this.tileManagers[P.source];w[P.source]=k.getRenderableIds(!0).map((R=>k.getTileByID(R))).sort(((R,V)=>V.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(V.tileID)?-1:1)))}let A=this.crossTileSymbolIndex.addLayer(P,w[P.source],t.center.lng);y||(y=A)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f||(f=this._layerOrderChanged||s===0),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(ke(),t.zoom))&&(this.pauseablePlacement=new pr(t,this.map.terrain,this._order,f,a,s,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,w),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(ke()),b=!0),y&&this.pauseablePlacement.placement.setStale()),b||y)for(let S of this._order){let P=this._layers[S];P.type==="symbol"&&this.placement.updateLayerOpacities(P,w[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(ke())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,a){return u._(this,void 0,void 0,(function*(){let s=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();let c=this.tileManagers[a.source];return c&&c.setDependencies(a.tileID.key,a.type,a.icons),s}))}getGlyphs(t,a){return u._(this,void 0,void 0,(function*(){let s=yield this.glyphManager.getGlyphs(a.stacks),c=this.tileManagers[a.source];return c&&c.setDependencies(a.tileID.key,a.type,[""]),s}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,a={}){this._checkLoaded(),t&&this._validate(u.F.glyphs,"glyphs",t,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,a){return u._(this,void 0,void 0,(function*(){let s={};for(let[c,f]of Object.entries(a.dashes))s[c]=this.lineAtlas.getDash(f.dasharray,f.round);return s}))}addSprite(t,a,s={},c){this._checkLoaded();let f=[{id:t,url:a}],y=[...ee(this.stylesheet.sprite),...f];this._validate(u.F.sprite,"sprite",y,null,s)||(this.stylesheet.sprite=y,this._loadSprite(f,!0,c))}removeSprite(t){this._checkLoaded();let a=ee(this.stylesheet.sprite);if(a.find((s=>s.id===t))){if(this._spritesImagesIds[t])for(let s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;a.splice(a.findIndex((s=>s.id===t)),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.n("data",{dataType:"style"}))}else this.fire(new u.l(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return ee(this.stylesheet.sprite)}setSprite(t,a={},s){this._checkLoaded(),t&&this._validate(u.F.sprite,"sprite",t,null,a)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(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(let t in this.tileManagers){let a=this.tileManagers[t];a.setEventedParent(null),a.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let t in this._layers){let a=this._layers[t];a.setEventedParent(null),a.onRemove&&a.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 Wc=u.aS([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Th{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,a,s,c,f,y,b,w,S){this.context=t;let P=this.boundPaintVertexBuffers.length!==c.length;for(let A=0;!P&&A<c.length;A++)this.boundPaintVertexBuffers[A]!==c[A]&&(P=!0);!this.vao||this.boundProgram!==a||this.boundLayoutVertexBuffer!==s||P||this.boundIndexBuffer!==f||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==b||this.boundDynamicVertexBuffer2!==w||this.boundDynamicVertexBuffer3!==S?this.freshBind(a,s,c,f,y,b,w,S):(t.bindVertexArray.set(this.vao),b&&b.bind(),f?.dynamicDraw&&f.bind(),w&&w.bind(),S&&S.bind())}freshBind(t,a,s,c,f,y,b,w){let S=t.numAttributes,P=this.context,A=P.gl;this.vao&&this.destroy(),this.vao=P.createVertexArray(),P.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=c,this.boundVertexOffset=f,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=b,this.boundDynamicVertexBuffer3=w,a.enableAttributes(A,t);for(let k of s)k.enableAttributes(A,t);y&&y.enableAttributes(A,t),b&&b.enableAttributes(A,t),w&&w.enableAttributes(A,t),a.bind(),a.setVertexAttribPointers(A,t,f);for(let k of s)k.bind(),k.setVertexAttribPointers(A,t,f);y&&(y.bind(),y.setVertexAttribPointers(A,t,f)),c&&c.bind(),b&&(b.bind(),b.setVertexAttribPointers(A,t,f)),w&&(w.bind(),w.setVertexAttribPointers(A,t,f)),P.currentNumAttributes=S}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Hc=(d,t,a,s,c)=>({u_texture:0,u_ele_delta:d,u_fog_matrix:t,u_fog_color:a?a.properties.get("fog-color"):u.bo.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:c?0:a?a.calculateFogBlendOpacity(s):0,u_horizon_color:a?a.properties.get("horizon-color"):u.bo.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1,u_is_globe_mode:c?1:0}),Dl={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 ln(d){let t=[];for(let a of d){if(a===null)continue;let s=a.split(" ");t.push(s.pop())}return t}class Xc{constructor(t,a,s,c,f,y,b,w,S=[]){let P=t.gl;this.program=P.createProgram();let A=ln(a.staticAttributes),k=s?s.getBinderAttributes():[],R=A.concat(k),V=bi.prelude.staticUniforms?ln(bi.prelude.staticUniforms):[],q=b.staticUniforms?ln(b.staticUniforms):[],H=a.staticUniforms?ln(a.staticUniforms):[],Z=s?s.getBinderUniforms():[],Y=V.concat(q).concat(H).concat(Z),ie=[];for(let de of Y)ie.includes(de)||ie.push(de);let X=s?s.defines():[];da(P)&&X.unshift("#version 300 es"),f&&X.push("#define OVERDRAW_INSPECTOR;"),y&&X.push("#define TERRAIN3D;"),w&&X.push(w),S&&X.push(...S);let W=X.concat(bi.prelude.fragmentSource,b.fragmentSource,a.fragmentSource).join(`
800
+ `),te=X.concat(bi.prelude.vertexSource,b.vertexSource,a.vertexSource).join(`
801
+ `);da(P)||(W=(function(de){return de.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(W),te=(function(de){return de.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(te));let J=P.createShader(P.FRAGMENT_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(J,W),P.compileShader(J),!P.getShaderParameter(J,P.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${P.getShaderInfoLog(J)}`);P.attachShader(this.program,J);let le=P.createShader(P.VERTEX_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(le,te),P.compileShader(le),!P.getShaderParameter(le,P.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${P.getShaderInfoLog(le)}`);P.attachShader(this.program,le),this.attributes={};let me={};this.numAttributes=R.length;for(let de=0;de<this.numAttributes;de++)R[de]&&(P.bindAttribLocation(this.program,de,R[de]),this.attributes[R[de]]=de);if(P.linkProgram(this.program),!P.getProgramParameter(this.program,P.LINK_STATUS))throw new Error(`Program failed to link: ${P.getProgramInfoLog(this.program)}`);P.deleteShader(le),P.deleteShader(J);for(let de of ie)if(de&&!me[de]){let Pe=P.getUniformLocation(this.program,de);Pe&&(me[de]=Pe)}this.fixedUniforms=c(t,me),this.terrainUniforms=((de,Pe)=>({u_depth:new u.b_(de,Pe.u_depth),u_terrain:new u.b_(de,Pe.u_terrain),u_terrain_dim:new u.bp(de,Pe.u_terrain_dim),u_terrain_matrix:new u.c0(de,Pe.u_terrain_matrix),u_terrain_unpack:new u.c1(de,Pe.u_terrain_unpack),u_terrain_exaggeration:new u.bp(de,Pe.u_terrain_exaggeration)}))(t,me),this.projectionUniforms=((de,Pe)=>({u_projection_matrix:new u.c0(de,Pe.u_projection_matrix),u_projection_tile_mercator_coords:new u.c1(de,Pe.u_projection_tile_mercator_coords),u_projection_clipping_plane:new u.c1(de,Pe.u_projection_clipping_plane),u_projection_transition:new u.bp(de,Pe.u_projection_transition),u_projection_fallback_matrix:new u.c0(de,Pe.u_projection_fallback_matrix)}))(t,me),this.binderUniforms=s?s.getUniforms(t,me):[]}draw(t,a,s,c,f,y,b,w,S,P,A,k,R,V,q,H,Z,Y,ie){var X;let W=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(f),t.setCullFace(y),w){t.activeTexture.set(W.TEXTURE2),W.bindTexture(W.TEXTURE_2D,w.depthTexture),t.activeTexture.set(W.TEXTURE3),W.bindTexture(W.TEXTURE_2D,w.texture);for(let J in this.terrainUniforms)this.terrainUniforms[J].set(w[J])}if(S)for(let J in S)this.projectionUniforms[Dl[J]].set(S[J]);if(b)for(let J in this.fixedUniforms)this.fixedUniforms[J].set(b[J]);H&&H.setUniforms(t,this.binderUniforms,V,{zoom:q});let te=0;switch(a){case W.LINES:te=2;break;case W.TRIANGLES:te=3;break;case W.LINE_STRIP:te=1}for(let J of R.get())J.vaos||(J.vaos={}),(X=J.vaos)[P]||(X[P]=new Th),J.vaos[P].bind(t,this,A,H?H.getPaintVertexBuffers():[],k,J.vertexOffset,Z,Y,ie),W.drawElements(a,J.primitiveLength*te,W.UNSIGNED_SHORT,J.primitiveOffset*te*2)}}function Ll(d,t,a){let s=1/u.aK(a,1,t.transform.tileZoom),c=Math.pow(2,a.tileID.overscaledZ),f=a.tileSize*Math.pow(2,t.transform.tileZoom)/c,y=f*(a.tileID.canonical.x+a.tileID.wrap*c),b=f*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[s,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[y>>16,b>>16],u_pixel_coord_lower:[65535&y,65535&b]}}let Rl=(d,t,a,s)=>{let c=d.style.light,f=c.properties.get("position"),y=[f.x,f.y,f.z],b=u.c4();c.properties.get("anchor")==="viewport"&&u.c5(b,d.transform.bearingInRadians),u.c6(y,y,b);let w=d.transform.transformLightDirection(y),S=c.properties.get("color");return{u_lightpos:y,u_lightpos_globe:w,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_vertical_gradient:+t,u_opacity:a,u_fill_translate:s}},Ha=(d,t,a,s,c,f,y)=>u.e(Rl(d,t,a,s),Ll(f,d,y),{u_height_factor:-Math.pow(2,c.overscaledZ)/y.tileSize/8}),Fl=(d,t,a,s)=>u.e(Ll(t,d,a),{u_fill_translate:s}),Yc=(d,t)=>({u_world:d,u_fill_translate:t}),cn=(d,t,a,s,c)=>u.e(Fl(d,t,a,c),{u_world:s}),Sh=(d,t,a,s,c)=>{let f=d.transform,y,b,w=0;if(a.paint.get("circle-pitch-alignment")==="map"){let S=u.aK(t,1,f.zoom);y=!0,b=[S,S],w=S/(u.a6*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*c}else y=!1,b=f.pixelsToGLUnits;return{u_camera_to_center_distance:f.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+y,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:b,u_globe_extrude_scale:w,u_translate:s}},fs=d=>({u_pixel_extrude_scale:[1/d.width,1/d.height]}),Ph=d=>({u_viewport_size:[d.width,d.height]}),Kc=(d,t=1)=>({u_color:d,u_overlay:0,u_overlay_scale:t}),Bl=(d,t,a,s)=>{let c=u.aK(d,1,t)/(u.a6*Math.pow(2,d.tileID.overscaledZ))*2*Math.PI*s;return{u_extrude_scale:u.aK(d,1,t),u_intensity:a,u_globe_extrude_scale:c}},Ol=(d,t,a,s)=>{let c=u.O();u.c7(c,0,d.width,d.height,0,0,1);let f=d.context.gl;return{u_matrix:c,u_world:[f.drawingBufferWidth,f.drawingBufferHeight],u_image:a,u_color_ramp:s,u_opacity:t.paint.get("heatmap-opacity")}},Jc=(d,t,a)=>{let s=a.paint.get("hillshade-accent-color"),c;switch(a.paint.get("hillshade-method")){case"basic":c=4;break;case"combined":c=1;break;case"igor":c=2;break;case"multidirectional":c=3;break;default:c=0}let f=a.getIlluminationProperties();for(let y=0;y<f.directionRadians.length;y++)a.paint.get("hillshade-illumination-anchor")==="viewport"&&(f.directionRadians[y]+=d.transform.bearingInRadians);return{u_image:0,u_latrange:Qc(0,t.tileID),u_exaggeration:a.paint.get("hillshade-exaggeration"),u_altitudes:f.altitudeRadians,u_azimuths:f.directionRadians,u_accent:s,u_method:c,u_highlights:f.highlightColor,u_shadows:f.shadowColor}},Nl=(d,t)=>{let a=t.stride,s=u.O();return u.c7(s,0,u.a6,-u.a6,0,0,1),u.Q(s,s,[0,-u.a6,0]),{u_matrix:s,u_image:1,u_dimension:[a,a],u_zoom:d.overscaledZ,u_unpack:t.getUnpackVector()}};function Qc(d,t){let a=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new u.a7(0,s/a).toLngLat().lat,new u.a7(0,(s+1)/a).toLngLat().lat]}let ms=(d,t,a=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:a,u_opacity:d.paint.get("color-relief-opacity")}),Gr=(d,t,a,s)=>{let c=d.transform;return{u_translation:Ba(d,t,a),u_ratio:s/u.aK(t,1,c.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},jl=(d,t,a,s,c)=>u.e(Gr(d,t,a,s),{u_image:0,u_image_height:c}),Vl=(d,t,a,s,c)=>{let f=d.transform,y=un(t,f);return{u_translation:Ba(d,t,a),u_texsize:t.imageAtlasTexture.size,u_ratio:s/u.aK(t,1,f.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[y,c.fromScale,c.toScale],u_fade:c.t,u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]]}},Ul=(d,t,a,s,c)=>{let f=un(t,d.transform);return u.e(Gr(d,t,a,s),{u_tileratio:f,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image:0,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})},eu=(d,t,a,s,c,f)=>{let y=un(t,d.transform);return u.e(Gr(d,t,a,s),{u_image:0,u_image_height:f,u_tileratio:y,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image_dash:1,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})};function un(d,t){return 1/u.aK(d,1,t.tileZoom)}function Ba(d,t,a){return u.aL(d.transform,t,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}let ql=(d,t,a,s,c)=>{return{u_tl_parent:d,u_scale_parent:t,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*s.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:s.paint.get("raster-brightness-min"),u_brightness_high:s.paint.get("raster-brightness-max"),u_saturation_factor:(y=s.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(f=s.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:Mh(s.paint.get("raster-hue-rotate")),u_coords_top:[c[0].x,c[0].y,c[1].x,c[1].y],u_coords_bottom:[c[3].x,c[3].y,c[2].x,c[2].y]};var f,y};function Mh(d){d*=Math.PI/180;let t=Math.sin(d),a=Math.cos(d);return[(2*a+1)/3,(-Math.sqrt(3)*t-a+1)/3,(Math.sqrt(3)*t-a+1)/3]}let tu=(d,t,a,s,c,f,y,b,w,S,P,A,k)=>{let R=y.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:R.cameraToCenterDistance,u_pitch:R.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:R.width/R.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_label_plane_matrix:b,u_coord_matrix:w,u_is_text:+P,u_pitch_with_map:+s,u_is_along_line:c,u_is_variable_anchor:f,u_texsize:A,u_texture:0,u_translation:S,u_pitched_scale:k}},iu=(d,t,a,s,c,f,y,b,w,S,P,A,k,R)=>{let V=y.transform;return u.e(tu(d,t,a,s,c,f,y,b,w,S,P,A,R),{u_gamma_scale:s?Math.cos(V.pitch*Math.PI/180)*V.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:k?1:0,u_is_plain:1})},Ch=(d,t,a,s,c,f,y,b,w,S,P,A,k)=>u.e(iu(d,t,a,s,c,f,y,b,w,S,!0,P,!0,k),{u_texsize_icon:A,u_texture_icon:1}),ru=(d,t)=>({u_opacity:d,u_color:t}),Eh=(d,t,a,s,c)=>u.e((function(f,y,b,w){let S=b.imageManager.getPattern(f.from.toString()),P=b.imageManager.getPattern(f.to.toString()),{width:A,height:k}=b.imageManager.getPixelSize(),R=Math.pow(2,w.tileID.overscaledZ),V=w.tileSize*Math.pow(2,b.transform.tileZoom)/R,q=V*(w.tileID.canonical.x+w.tileID.wrap*R),H=V*w.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:P.tl,u_pattern_br_b:P.br,u_texsize:[A,k],u_mix:y.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:P.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/u.aK(w,1,b.transform.tileZoom),u_pixel_coord_upper:[q>>16,H>>16],u_pixel_coord_lower:[65535&q,65535&H]}})(a,c,t,s),{u_opacity:d}),Gl=(d,t)=>{},gs={fillExtrusion:(d,t)=>({u_lightpos:new u.c2(d,t.u_lightpos),u_lightpos_globe:new u.c2(d,t.u_lightpos_globe),u_lightintensity:new u.bp(d,t.u_lightintensity),u_lightcolor:new u.c2(d,t.u_lightcolor),u_vertical_gradient:new u.bp(d,t.u_vertical_gradient),u_opacity:new u.bp(d,t.u_opacity),u_fill_translate:new u.c3(d,t.u_fill_translate)}),fillExtrusionPattern:(d,t)=>({u_lightpos:new u.c2(d,t.u_lightpos),u_lightpos_globe:new u.c2(d,t.u_lightpos_globe),u_lightintensity:new u.bp(d,t.u_lightintensity),u_lightcolor:new u.c2(d,t.u_lightcolor),u_vertical_gradient:new u.bp(d,t.u_vertical_gradient),u_height_factor:new u.bp(d,t.u_height_factor),u_opacity:new u.bp(d,t.u_opacity),u_fill_translate:new u.c3(d,t.u_fill_translate),u_image:new u.b_(d,t.u_image),u_texsize:new u.c3(d,t.u_texsize),u_pixel_coord_upper:new u.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(d,t.u_pixel_coord_lower),u_scale:new u.c2(d,t.u_scale),u_fade:new u.bp(d,t.u_fade)}),fill:(d,t)=>({u_fill_translate:new u.c3(d,t.u_fill_translate)}),fillPattern:(d,t)=>({u_image:new u.b_(d,t.u_image),u_texsize:new u.c3(d,t.u_texsize),u_pixel_coord_upper:new u.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(d,t.u_pixel_coord_lower),u_scale:new u.c2(d,t.u_scale),u_fade:new u.bp(d,t.u_fade),u_fill_translate:new u.c3(d,t.u_fill_translate)}),fillOutline:(d,t)=>({u_world:new u.c3(d,t.u_world),u_fill_translate:new u.c3(d,t.u_fill_translate)}),fillOutlinePattern:(d,t)=>({u_world:new u.c3(d,t.u_world),u_image:new u.b_(d,t.u_image),u_texsize:new u.c3(d,t.u_texsize),u_pixel_coord_upper:new u.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(d,t.u_pixel_coord_lower),u_scale:new u.c2(d,t.u_scale),u_fade:new u.bp(d,t.u_fade),u_fill_translate:new u.c3(d,t.u_fill_translate)}),circle:(d,t)=>({u_camera_to_center_distance:new u.bp(d,t.u_camera_to_center_distance),u_scale_with_map:new u.b_(d,t.u_scale_with_map),u_pitch_with_map:new u.b_(d,t.u_pitch_with_map),u_extrude_scale:new u.c3(d,t.u_extrude_scale),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_globe_extrude_scale:new u.bp(d,t.u_globe_extrude_scale),u_translate:new u.c3(d,t.u_translate)}),collisionBox:(d,t)=>({u_pixel_extrude_scale:new u.c3(d,t.u_pixel_extrude_scale)}),collisionCircle:(d,t)=>({u_viewport_size:new u.c3(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new u.b$(d,t.u_color),u_overlay:new u.b_(d,t.u_overlay),u_overlay_scale:new u.bp(d,t.u_overlay_scale)}),depth:Gl,clippingMask:Gl,heatmap:(d,t)=>({u_extrude_scale:new u.bp(d,t.u_extrude_scale),u_intensity:new u.bp(d,t.u_intensity),u_globe_extrude_scale:new u.bp(d,t.u_globe_extrude_scale)}),heatmapTexture:(d,t)=>({u_matrix:new u.c0(d,t.u_matrix),u_world:new u.c3(d,t.u_world),u_image:new u.b_(d,t.u_image),u_color_ramp:new u.b_(d,t.u_color_ramp),u_opacity:new u.bp(d,t.u_opacity)}),hillshade:(d,t)=>({u_image:new u.b_(d,t.u_image),u_latrange:new u.c3(d,t.u_latrange),u_exaggeration:new u.bp(d,t.u_exaggeration),u_altitudes:new u.c9(d,t.u_altitudes),u_azimuths:new u.c9(d,t.u_azimuths),u_accent:new u.b$(d,t.u_accent),u_method:new u.b_(d,t.u_method),u_shadows:new u.c8(d,t.u_shadows),u_highlights:new u.c8(d,t.u_highlights)}),hillshadePrepare:(d,t)=>({u_matrix:new u.c0(d,t.u_matrix),u_image:new u.b_(d,t.u_image),u_dimension:new u.c3(d,t.u_dimension),u_zoom:new u.bp(d,t.u_zoom),u_unpack:new u.c1(d,t.u_unpack)}),colorRelief:(d,t)=>({u_image:new u.b_(d,t.u_image),u_unpack:new u.c1(d,t.u_unpack),u_dimension:new u.c3(d,t.u_dimension),u_elevation_stops:new u.b_(d,t.u_elevation_stops),u_color_stops:new u.b_(d,t.u_color_stops),u_color_ramp_size:new u.b_(d,t.u_color_ramp_size),u_opacity:new u.bp(d,t.u_opacity)}),line:(d,t)=>({u_translation:new u.c3(d,t.u_translation),u_ratio:new u.bp(d,t.u_ratio),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_translation:new u.c3(d,t.u_translation),u_ratio:new u.bp(d,t.u_ratio),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(d,t.u_units_to_pixels),u_image:new u.b_(d,t.u_image),u_image_height:new u.bp(d,t.u_image_height)}),linePattern:(d,t)=>({u_translation:new u.c3(d,t.u_translation),u_texsize:new u.c3(d,t.u_texsize),u_ratio:new u.bp(d,t.u_ratio),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_image:new u.b_(d,t.u_image),u_units_to_pixels:new u.c3(d,t.u_units_to_pixels),u_scale:new u.c2(d,t.u_scale),u_fade:new u.bp(d,t.u_fade)}),lineSDF:(d,t)=>({u_translation:new u.c3(d,t.u_translation),u_ratio:new u.bp(d,t.u_ratio),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(d,t.u_units_to_pixels),u_image:new u.b_(d,t.u_image),u_mix:new u.bp(d,t.u_mix),u_tileratio:new u.bp(d,t.u_tileratio),u_crossfade_from:new u.bp(d,t.u_crossfade_from),u_crossfade_to:new u.bp(d,t.u_crossfade_to),u_lineatlas_width:new u.bp(d,t.u_lineatlas_width),u_lineatlas_height:new u.bp(d,t.u_lineatlas_height)}),lineGradientSDF:(d,t)=>({u_translation:new u.c3(d,t.u_translation),u_ratio:new u.bp(d,t.u_ratio),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(d,t.u_units_to_pixels),u_image:new u.b_(d,t.u_image),u_image_height:new u.bp(d,t.u_image_height),u_tileratio:new u.bp(d,t.u_tileratio),u_crossfade_from:new u.bp(d,t.u_crossfade_from),u_crossfade_to:new u.bp(d,t.u_crossfade_to),u_image_dash:new u.b_(d,t.u_image_dash),u_mix:new u.bp(d,t.u_mix),u_lineatlas_width:new u.bp(d,t.u_lineatlas_width),u_lineatlas_height:new u.bp(d,t.u_lineatlas_height)}),raster:(d,t)=>({u_tl_parent:new u.c3(d,t.u_tl_parent),u_scale_parent:new u.bp(d,t.u_scale_parent),u_buffer_scale:new u.bp(d,t.u_buffer_scale),u_fade_t:new u.bp(d,t.u_fade_t),u_opacity:new u.bp(d,t.u_opacity),u_image0:new u.b_(d,t.u_image0),u_image1:new u.b_(d,t.u_image1),u_brightness_low:new u.bp(d,t.u_brightness_low),u_brightness_high:new u.bp(d,t.u_brightness_high),u_saturation_factor:new u.bp(d,t.u_saturation_factor),u_contrast_factor:new u.bp(d,t.u_contrast_factor),u_spin_weights:new u.c2(d,t.u_spin_weights),u_coords_top:new u.c1(d,t.u_coords_top),u_coords_bottom:new u.c1(d,t.u_coords_bottom)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new u.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(d,t.u_is_size_feature_constant),u_size_t:new u.bp(d,t.u_size_t),u_size:new u.bp(d,t.u_size),u_camera_to_center_distance:new u.bp(d,t.u_camera_to_center_distance),u_pitch:new u.bp(d,t.u_pitch),u_rotate_symbol:new u.b_(d,t.u_rotate_symbol),u_aspect_ratio:new u.bp(d,t.u_aspect_ratio),u_fade_change:new u.bp(d,t.u_fade_change),u_label_plane_matrix:new u.c0(d,t.u_label_plane_matrix),u_coord_matrix:new u.c0(d,t.u_coord_matrix),u_is_text:new u.b_(d,t.u_is_text),u_pitch_with_map:new u.b_(d,t.u_pitch_with_map),u_is_along_line:new u.b_(d,t.u_is_along_line),u_is_variable_anchor:new u.b_(d,t.u_is_variable_anchor),u_texsize:new u.c3(d,t.u_texsize),u_texture:new u.b_(d,t.u_texture),u_translation:new u.c3(d,t.u_translation),u_pitched_scale:new u.bp(d,t.u_pitched_scale)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new u.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(d,t.u_is_size_feature_constant),u_size_t:new u.bp(d,t.u_size_t),u_size:new u.bp(d,t.u_size),u_camera_to_center_distance:new u.bp(d,t.u_camera_to_center_distance),u_pitch:new u.bp(d,t.u_pitch),u_rotate_symbol:new u.b_(d,t.u_rotate_symbol),u_aspect_ratio:new u.bp(d,t.u_aspect_ratio),u_fade_change:new u.bp(d,t.u_fade_change),u_label_plane_matrix:new u.c0(d,t.u_label_plane_matrix),u_coord_matrix:new u.c0(d,t.u_coord_matrix),u_is_text:new u.b_(d,t.u_is_text),u_pitch_with_map:new u.b_(d,t.u_pitch_with_map),u_is_along_line:new u.b_(d,t.u_is_along_line),u_is_variable_anchor:new u.b_(d,t.u_is_variable_anchor),u_texsize:new u.c3(d,t.u_texsize),u_texture:new u.b_(d,t.u_texture),u_gamma_scale:new u.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_is_halo:new u.b_(d,t.u_is_halo),u_is_plain:new u.b_(d,t.u_is_plain),u_translation:new u.c3(d,t.u_translation),u_pitched_scale:new u.bp(d,t.u_pitched_scale)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new u.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(d,t.u_is_size_feature_constant),u_size_t:new u.bp(d,t.u_size_t),u_size:new u.bp(d,t.u_size),u_camera_to_center_distance:new u.bp(d,t.u_camera_to_center_distance),u_pitch:new u.bp(d,t.u_pitch),u_rotate_symbol:new u.b_(d,t.u_rotate_symbol),u_aspect_ratio:new u.bp(d,t.u_aspect_ratio),u_fade_change:new u.bp(d,t.u_fade_change),u_label_plane_matrix:new u.c0(d,t.u_label_plane_matrix),u_coord_matrix:new u.c0(d,t.u_coord_matrix),u_is_text:new u.b_(d,t.u_is_text),u_pitch_with_map:new u.b_(d,t.u_pitch_with_map),u_is_along_line:new u.b_(d,t.u_is_along_line),u_is_variable_anchor:new u.b_(d,t.u_is_variable_anchor),u_texsize:new u.c3(d,t.u_texsize),u_texsize_icon:new u.c3(d,t.u_texsize_icon),u_texture:new u.b_(d,t.u_texture),u_texture_icon:new u.b_(d,t.u_texture_icon),u_gamma_scale:new u.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new u.bp(d,t.u_device_pixel_ratio),u_is_halo:new u.b_(d,t.u_is_halo),u_translation:new u.c3(d,t.u_translation),u_pitched_scale:new u.bp(d,t.u_pitched_scale)}),background:(d,t)=>({u_opacity:new u.bp(d,t.u_opacity),u_color:new u.b$(d,t.u_color)}),backgroundPattern:(d,t)=>({u_opacity:new u.bp(d,t.u_opacity),u_image:new u.b_(d,t.u_image),u_pattern_tl_a:new u.c3(d,t.u_pattern_tl_a),u_pattern_br_a:new u.c3(d,t.u_pattern_br_a),u_pattern_tl_b:new u.c3(d,t.u_pattern_tl_b),u_pattern_br_b:new u.c3(d,t.u_pattern_br_b),u_texsize:new u.c3(d,t.u_texsize),u_mix:new u.bp(d,t.u_mix),u_pattern_size_a:new u.c3(d,t.u_pattern_size_a),u_pattern_size_b:new u.c3(d,t.u_pattern_size_b),u_scale_a:new u.bp(d,t.u_scale_a),u_scale_b:new u.bp(d,t.u_scale_b),u_pixel_coord_upper:new u.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new u.bp(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_texture:new u.b_(d,t.u_texture),u_ele_delta:new u.bp(d,t.u_ele_delta),u_fog_matrix:new u.c0(d,t.u_fog_matrix),u_fog_color:new u.b$(d,t.u_fog_color),u_fog_ground_blend:new u.bp(d,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new u.bp(d,t.u_fog_ground_blend_opacity),u_horizon_color:new u.b$(d,t.u_horizon_color),u_horizon_fog_blend:new u.bp(d,t.u_horizon_fog_blend),u_is_globe_mode:new u.bp(d,t.u_is_globe_mode)}),terrainDepth:(d,t)=>({u_ele_delta:new u.bp(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_texture:new u.b_(d,t.u_texture),u_terrain_coords_id:new u.bp(d,t.u_terrain_coords_id),u_ele_delta:new u.bp(d,t.u_ele_delta)}),projectionErrorMeasurement:(d,t)=>({u_input:new u.bp(d,t.u_input),u_output_expected:new u.bp(d,t.u_output_expected)}),atmosphere:(d,t)=>({u_sun_pos:new u.c2(d,t.u_sun_pos),u_atmosphere_blend:new u.bp(d,t.u_atmosphere_blend),u_globe_position:new u.c2(d,t.u_globe_position),u_globe_radius:new u.bp(d,t.u_globe_radius),u_inv_proj_matrix:new u.c0(d,t.u_inv_proj_matrix)}),sky:(d,t)=>({u_sky_color:new u.b$(d,t.u_sky_color),u_horizon_color:new u.b$(d,t.u_horizon_color),u_horizon:new u.c3(d,t.u_horizon),u_horizon_normal:new u.c3(d,t.u_horizon_normal),u_sky_horizon_blend:new u.bp(d,t.u_sky_horizon_blend),u_sky_blend:new u.bp(d,t.u_sky_blend)})};class _s{constructor(t,a,s){this.context=t;let c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let ys={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Zl{constructor(t,a,s,c){this.length=a.length,this.attributes=s,this.itemSize=a.bytesPerElement,this.dynamicDraw=c,this.context=t;let f=t.gl;this.buffer=f.createBuffer(),t.bindVertexBuffer.set(this.buffer),f.bufferData(f.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||a.freeBufferAfterUpload()}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}`);let a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,a){for(let s of this.attributes){let c=a.attributes[s.name];c!==void 0&&t.enableVertexAttribArray(c)}}setVertexAttribPointers(t,a,s){for(let c of this.attributes){let f=a.attributes[c.name];f!==void 0&&t.vertexAttribPointer(f,c.components,t[ys[c.type]],!1,this.itemSize,c.offset+this.itemSize*(s||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class kt{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 hn extends kt{getDefault(){return u.bo.transparent}set(t){let a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class zo extends kt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Zr extends kt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class au extends kt{getDefault(){return[!0,!0,!0,!0]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ou extends kt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class $l extends kt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Xa extends kt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let a=this.current;(t.func!==a.func||t.ref!==a.ref||t.mask!==a.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class vs extends kt{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class bs extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST),this.current=t,this.dirty=!1}}class dn extends kt{getDefault(){return[0,1]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class xs extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),this.current=t,this.dirty=!1}}class nu extends kt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Ao extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.BLEND):a.disable(a.BLEND),this.current=t,this.dirty=!1}}class ko extends kt{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class su extends kt{getDefault(){return u.bo.transparent}set(t){let a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Wl extends kt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Tt extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;t?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE),this.current=t,this.dirty=!1}}class ws extends kt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Ih extends kt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class lu extends kt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class pn extends kt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class zh extends kt{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ah extends kt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class cu extends kt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindRenderbuffer(a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class kh extends kt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindTexture(a.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Hl extends kt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ts extends kt{getDefault(){return null}set(t){let a=this.gl;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class fn extends kt{getDefault(){return null}set(t){var a;if(t===this.current&&!this.dirty)return;let s=this.gl;da(s)?s.bindVertexArray(t):(a=s.getExtension("OES_vertex_array_object"))===null||a===void 0||a.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Ss extends kt{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Xl extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class uu extends kt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let a=this.gl;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Do extends kt{constructor(t,a){super(t),this.context=t,this.parent=a}getDefault(){return null}}class Ps extends Do{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class mn extends Do{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Lo extends Do{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}let Ms="Framebuffer is not complete";class Dh{constructor(t,a,s,c,f){this.context=t,this.width=a,this.height=s;let y=t.gl,b=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new Ps(t,b),c)this.depthAttachment=f?new Lo(t,b):new mn(t,b);else if(f)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error(Ms)}destroy(){let t=this.context.gl,a=this.colorAttachment.get();if(a&&t.deleteTexture(a),this.depthAttachment){let s=this.depthAttachment.get();s&&t.deleteRenderbuffer(s)}t.deleteFramebuffer(this.framebuffer)}}class gn{constructor(t){var a,s;if(this.gl=t,this.clearColor=new hn(this),this.clearDepth=new zo(this),this.clearStencil=new Zr(this),this.colorMask=new au(this),this.depthMask=new ou(this),this.stencilMask=new $l(this),this.stencilFunc=new Xa(this),this.stencilOp=new vs(this),this.stencilTest=new bs(this),this.depthRange=new dn(this),this.depthTest=new xs(this),this.depthFunc=new nu(this),this.blend=new Ao(this),this.blendFunc=new ko(this),this.blendColor=new su(this),this.blendEquation=new Wl(this),this.cullFace=new Tt(this),this.cullFaceSide=new ws(this),this.frontFace=new Ih(this),this.program=new lu(this),this.activeTexture=new pn(this),this.viewport=new zh(this),this.bindFramebuffer=new Ah(this),this.bindRenderbuffer=new cu(this),this.bindTexture=new kh(this),this.bindVertexBuffer=new Hl(this),this.bindElementBuffer=new Ts(this),this.bindVertexArray=new fn(this),this.pixelStoreUnpack=new Ss(this),this.pixelStoreUnpackPremultiplyAlpha=new Xl(this),this.pixelStoreUnpackFlipY=new uu(this),this.extTextureFilterAnisotropic=t.getExtension("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),da(t)){this.HALF_FLOAT=t.HALF_FLOAT;let c=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(a=t.RGBA16F)!==null&&a!==void 0?a:c?.RGBA16F_EXT,this.RGB16F=(s=t.RGB16F)!==null&&s!==void 0?s:c?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let c=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=c?.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,a){return new _s(this,t,a)}createVertexBuffer(t,a,s){return new Zl(this,t,a,s)}createRenderbuffer(t,a,s){let c=this.gl,f=c.createRenderbuffer();return this.bindRenderbuffer.set(f),c.renderbufferStorage(c.RENDERBUFFER,t,a,s),this.bindRenderbuffer.set(null),f}createFramebuffer(t,a,s,c){return new Dh(this,t,a,s,c)}clear({color:t,depth:a,stencil:s}){let c=this.gl,f=0;t&&(f|=c.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),a!==void 0&&(f|=c.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(a),this.depthMask.set(!0)),s!==void 0&&(f|=c.STENCIL_BUFFER_BIT,this.clearStencil.set(s),this.stencilMask.set(255)),c.clear(f)}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){u.bQ(t.blendFunction,ii.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 da(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var a;da(this.gl)?this.gl.deleteVertexArray(t):(a=this.gl.getExtension("OES_vertex_array_object"))===null||a===void 0||a.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Cs;function Yl(d,t,a,s,c){var f,y;let b=d.context,w=d.transform,S=b.gl,P=d.useProgram("collisionBox"),A=[],k=0,R=0;for(let ie of s){let X=t.getTile(ie).getBucket(a);if(!X)continue;let W=c?X.textCollisionBox:X.iconCollisionBox,te=X.collisionCircleArray;te.length>0&&(A.push({circleArray:te,circleOffset:R,coord:ie}),k+=te.length/4,R=k),W&&P.draw(b,S.LINES,yt.disabled,Ft.disabled,d.colorModeForRenderPass(),At.disabled,fs(d.transform),(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(ie),w.getProjectionData({overscaledTileID:ie,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),a.id,W.layoutVertexBuffer,W.indexBuffer,W.segments,null,d.transform.zoom,null,null,W.collisionVertexBuffer)}if(!c||!A.length)return;let V=d.useProgram("collisionCircle"),q=new u.ca;q.resize(4*k),q._trim();let H=0;for(let ie of A)for(let X=0;X<ie.circleArray.length/4;X++){let W=4*X,te=ie.circleArray[W+0],J=ie.circleArray[W+1],le=ie.circleArray[W+2],me=ie.circleArray[W+3];q.emplace(H++,te,J,le,me,0),q.emplace(H++,te,J,le,me,1),q.emplace(H++,te,J,le,me,2),q.emplace(H++,te,J,le,me,3)}(!Cs||Cs.length<2*k)&&(Cs=(function(ie){let X=2*ie,W=new u.cc;W.resize(X),W._trim();for(let te=0;te<X;te++){let J=6*te;W.uint16[J+0]=4*te+0,W.uint16[J+1]=4*te+1,W.uint16[J+2]=4*te+2,W.uint16[J+3]=4*te+2,W.uint16[J+4]=4*te+3,W.uint16[J+5]=4*te+0}return W})(k));let Z=b.createIndexBuffer(Cs,!0),Y=b.createVertexBuffer(q,u.cb.members,!0);for(let ie of A){let X=Ph(d.transform);V.draw(b,S.TRIANGLES,yt.disabled,Ft.disabled,d.colorModeForRenderPass(),At.disabled,X,(y=d.style.map.terrain)===null||y===void 0?void 0:y.getTerrainData(ie.coord),null,a.id,Y,Z,u.aV.simpleSegment(0,2*ie.circleOffset,ie.circleArray.length,ie.circleArray.length/2),null,d.transform.zoom,null,null,null)}Y.destroy(),Z.destroy()}let Es=u.ap(new Float32Array(16));function Kl(d,t,a,s,c,f){let{horizontalAlign:y,verticalAlign:b}=u.aP(d);return new u.P((-(y-.5)*t/c+s[0])*f,(-(b-.5)*a/c+s[1])*f)}function hu(d,t,a,s,c,f){let y=t.tileAnchorPoint.add(new u.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let b=s.mult(f);a||(b=b.rotate(-c));let w=y.add(b);return Za(w.x,w.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(a){let b=za(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(d),w=Math.atan(b.y/b.x)+(b.x<0?Math.PI:0);return d.add(s.rotate(w))}return d.add(s)}function du(d,t,a,s,c,f,y,b,w,S,P,A){let k=d.text.placedSymbolArray,R=d.text.dynamicLayoutVertexArray,V=d.icon.dynamicLayoutVertexArray,q={};R.clear();for(let H=0;H<k.length;H++){let Z=k.get(H),Y=Z.hidden||!Z.crossTileID||d.allowVerticalPlacement&&!Z.placedOrientation?null:s[Z.crossTileID];if(Y){let ie=new u.P(Z.anchorX,Z.anchorY),X={getElevation:A,width:c.width,height:c.height,pitchedLabelPlaneMatrix:f,pitchWithMap:a,transform:c,tileAnchorPoint:ie,translation:S,unwrappedTileID:P},W=a?wl(ie.x,ie.y,X):za(ie.x,ie.y,X),te=en(c.cameraToCenterDistance,W.signedDistanceFromCamera),J=u.ay(d.textSizeData,b,Z)*te/u.aJ;a&&(J*=d.tilePixelRatio/y);let{width:le,height:me,anchor:de,textOffset:Pe,textBoxScale:Me}=Y,Qe=Kl(de,le,me,Pe,Me,J),Le=c.getPitchedTextCorrection(ie.x+S[0],ie.y+S[1],P),xe=hu(W.point,X,t,Qe,-c.bearingInRadians,Le),et=d.allowVerticalPlacement&&Z.placedOrientation===u.ax.vertical?Math.PI/2:0;for(let tt=0;tt<Z.numGlyphs;tt++)u.aD(R,xe,et);w&&Z.associatedIconIndex>=0&&(q[Z.associatedIconIndex]={shiftedAnchor:xe,angle:et})}else yo(Z.numGlyphs,R)}if(w){V.clear();let H=d.icon.placedSymbolArray;for(let Z=0;Z<H.length;Z++){let Y=H.get(Z);if(Y.hidden)yo(Y.numGlyphs,V);else{let ie=q[Z];if(ie)for(let X=0;X<Y.numGlyphs;X++)u.aD(V,ie.shiftedAnchor,ie.angle);else yo(Y.numGlyphs,V)}}d.icon.dynamicLayoutVertexBuffer.updateData(V)}d.text.dynamicLayoutVertexBuffer.updateData(R)}function Is(d,t,a){return a.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function zs(d,t,a,s,c,f,y,b,w,S,P,A,k){var R,V;let q=d.context,H=q.gl,Z=d.transform,Y=b==="map",ie=w==="map",X=b!=="viewport"&&a.layout.get("symbol-placement")!=="point",W=Y&&!ie&&!X,te=!a.layout.get("symbol-sort-key").isConstant(),J=!1,le=d.getDepthModeForSublayer(0,yt.ReadOnly),me=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),de=[],Pe=Z.getCircleRadiusCorrection();for(let Le of s){let xe=t.getTile(Le),et=xe.getBucket(a);if(!et)continue;let tt=c?et.text:et.icon;if(!tt?.segments.get().length||!tt.hasVisibleVertices)continue;let Vt=tt.programConfigurations.get(a.id),mi=c||et.sdfIcons,Qt=c?et.textSizeData:et.iconSizeData,wi=ie||Z.pitch!==0,Ti=d.useProgram(Is(mi,c,et),Vt),Br=u.aw(Qt,Z.zoom),ci=(R=d.style.map.terrain)===null||R===void 0?void 0:R.getTerrainData(Le),Xi,ai,Li,Cr,ja=[0,0],Vo=null;if(c)ai=xe.glyphAtlasTexture,Li=H.LINEAR,Xi=xe.glyphAtlasTexture.size,et.iconsInText&&(ja=xe.imageAtlasTexture.size,Vo=xe.imageAtlasTexture,Cr=wi||d.options.rotating||d.options.zooming||Qt.kind==="composite"||Qt.kind==="camera"?H.LINEAR:H.NEAREST);else{let oi=a.layout.get("icon-size").constantOr(0)!==1||et.iconsNeedLinear;ai=xe.imageAtlasTexture,Li=mi||d.options.rotating||d.options.zooming||oi||wi?H.LINEAR:H.NEAREST,Xi=xe.imageAtlasTexture.size}let eo=u.aK(xe,1,d.transform.zoom),Wr=mo(Y,d.transform,eo),Hr=Qo(ie,Y,d.transform,eo),_r=u.aL(Z,xe,f,y),Or=Z.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!k,applyTerrainMatrix:!0}),Yi=me&&et.hasTextData(),xa=a.layout.get("icon-text-fit")!=="none"&&Yi&&et.hasIconData();if(X){let oi=u.O();Yn(oi,Wr);let io=d.style.map.terrain?(Ta,Ws)=>d.style.map.terrain.getElevation(Le,Ta,Ws):null,wa=a.layout.get("text-rotation-alignment")==="map";li(et,d,c,Wr,oi,ie,S,wa,Le.toUnwrapped(),Z.width,Z.height,_r,io)}let pa=c&&me||xa,to=X||pa?Es:ie?Wr:d.transform.clipSpaceToPixelsMatrix,Si=mi&&a.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ir;ir=mi?et.iconsInText?Ch(Qt.kind,Br,W,ie,X,pa,d,to,Hr,_r,Xi,ja,Pe):iu(Qt.kind,Br,W,ie,X,pa,d,to,Hr,_r,c,Xi,Si,Pe):tu(Qt.kind,Br,W,ie,X,pa,d,to,Hr,_r,c,Xi,Pe);let Er={program:Ti,buffers:tt,uniformValues:ir,projectionData:Or,atlasTexture:ai,atlasTextureIcon:Vo,atlasInterpolation:Li,atlasInterpolationIcon:Cr,isSDF:mi,hasHalo:Si};if(te&&et.canOverlap){J=!0;let oi=tt.segments.get();for(let io of oi)de.push({segments:new u.aV([io]),sortKey:io.sortKey,state:Er,terrainData:ci})}else de.push({segments:tt.segments,sortKey:0,state:Er,terrainData:ci})}J&&de.sort(((Le,xe)=>Le.sortKey-xe.sortKey));let Me=(V=a.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(null))!==null&&V!==void 0?V:1/0,Qe=a.layout.get("text-letter-spacing").constantOr(0)*u.aJ<0||Me>1;for(let Le of de){let xe=Le.state;q.activeTexture.set(H.TEXTURE0),xe.atlasTexture.bind(xe.atlasInterpolation,H.CLAMP_TO_EDGE),xe.atlasTextureIcon&&(q.activeTexture.set(H.TEXTURE1),xe.atlasTextureIcon&&xe.atlasTextureIcon.bind(xe.atlasInterpolationIcon,H.CLAMP_TO_EDGE));let et=xe.isSDF&&xe.hasHalo;if(et){let tt=xe.uniformValues;tt.u_is_halo=1,Qe&&(tt.u_is_plain=0,pu(xe.buffers,Le.segments,a,d,xe.program,le,P,A,tt,xe.projectionData,Le.terrainData),tt.u_is_halo=0,tt.u_is_plain=1)}pu(xe.buffers,Le.segments,a,d,xe.program,le,P,A,xe.uniformValues,xe.projectionData,Le.terrainData),et&&!Qe&&(xe.uniformValues.u_is_halo=0)}}function pu(d,t,a,s,c,f,y,b,w,S,P){let A=s.context;c.draw(A,A.gl.TRIANGLES,f,y,b,At.backCCW,w,P,S,a.id,d.layoutVertexBuffer,d.indexBuffer,t,a.paint,s.transform.zoom,d.programConfigurations.get(a.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function fu(d,t,a,s,c){let f=d.context,y=f.gl,b=Ft.disabled,w=new ii([y.ONE,y.ONE],u.bo.transparent,[!0,!0,!0,!0]),S=t.getBucket(a);if(!S)return;let P=s.key,A=a.heatmapFbos.get(P);A||(A=Oa(f,t.tileSize,t.tileSize),a.heatmapFbos.set(P,A)),f.bindFramebuffer.set(A.framebuffer),f.viewport.set([0,0,t.tileSize,t.tileSize]),f.clear({color:u.bo.transparent});let k=S.programConfigurations.get(a.id),R=d.useProgram("heatmap",k,!c),V=d.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),q=d.style.map.terrain.getTerrainData(s);R.draw(f,y.TRIANGLES,yt.disabled,b,w,At.disabled,Bl(t,d.transform.zoom,a.paint.get("heatmap-intensity"),1),q,V,a.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,a.paint,d.transform.zoom,k)}function xi(d,t,a,s,c){let f=d.context,y=f.gl,b=d.transform;f.setColorMode(d.colorModeForRenderPass());let w=Pr(f,t),S=a.key,P=t.heatmapFbos.get(S);if(!P)return;f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,P.colorAttachment.get()),f.activeTexture.set(y.TEXTURE1),w.bind(y.LINEAR,y.CLAMP_TO_EDGE);let A=b.getProjectionData({overscaledTileID:a,applyTerrainMatrix:c,applyGlobeMatrix:!s});d.useProgram("heatmapTexture").draw(f,y.TRIANGLES,yt.disabled,Ft.disabled,d.colorModeForRenderPass(),At.disabled,Ol(d,t,0,1),null,A,t.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,t.paint,b.zoom),P.destroy(),t.heatmapFbos.delete(S)}function Oa(d,t,a){var s,c;let f=d.gl,y=f.createTexture();f.bindTexture(f.TEXTURE_2D,y),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR);let b=(s=d.HALF_FLOAT)!==null&&s!==void 0?s:f.UNSIGNED_BYTE,w=(c=d.RGBA16F)!==null&&c!==void 0?c:f.RGBA;f.texImage2D(f.TEXTURE_2D,0,w,t,a,0,f.RGBA,b,null);let S=d.createFramebuffer(t,a,!1,!1);return S.colorAttachment.set(y),S}function Pr(d,t){return t.colorRampTexture||(t.colorRampTexture=new u.T(d,t.colorRamp,d.gl.RGBA)),t.colorRampTexture}function As(d,t,a,s,c,f,y,b){let w=256;if(c.stepInterpolant){let S=t.getSource().maxzoom,P=y.canonical.z===S?Math.ceil(1<<d.transform.maxZoom-y.canonical.z):1;w=u.al(u.ce(f.maxLineLength/u.a6*1024*P),256,a.maxTextureSize)}return b.gradient=u.cf({expression:c.gradientExpression(),evaluationKey:"lineProgress",resolution:w,image:b.gradient||void 0,clips:f.lineClipsArray}),b.texture?b.texture.update(b.gradient):b.texture=new u.T(a,b.gradient,s.RGBA),b.version=c.gradientVersion,b.texture}function ks(d,t,a,s,c){d.activeTexture.set(t.TEXTURE0),a.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),s.updatePaintBuffers(c)}function mu(d,t,a,s,c,f){(c||d.lineAtlas.dirty)&&(t.activeTexture.set(a.TEXTURE0),d.lineAtlas.bind(t)),s.updatePaintBuffers(f)}function Ro(d,t,a,s,c,f,y){let b=f.gradients[c.id],w=b.texture;c.gradientVersion!==b.version&&(w=As(d,t,a,s,c,f,y,b)),a.activeTexture.set(s.TEXTURE0),w.bind(c.stepInterpolant?s.NEAREST:s.LINEAR,s.CLAMP_TO_EDGE)}function Jl(d,t,a,s,c,f,y,b,w){let S=f.gradients[c.id],P=S.texture;c.gradientVersion!==S.version&&(P=As(d,t,a,s,c,f,y,S)),a.activeTexture.set(s.TEXTURE0),P.bind(c.stepInterpolant?s.NEAREST:s.LINEAR,s.CLAMP_TO_EDGE),a.activeTexture.set(s.TEXTURE1),d.lineAtlas.bind(a),b.updatePaintBuffers(w)}function Fo(d,t,a,s,c){if(!a||!s?.imageAtlas)return;let f=s.imageAtlas.patternPositions,y=f[a.to.toString()],b=f[a.from.toString()];if(!y&&b&&(y=b),!b&&y&&(b=y),!y||!b){let w=c.getPaintProperty(t);y=f[w],b=f[w]}y&&b&&d.setConstantPatternPositions(y,b)}function Ds(d,t,a,s,c,f,y,b){var w;let S=d.context.gl,P="fill-pattern",A=a.paint.get(P),k=A?.constantOr(1),R=a.getCrossfadeParameters(),V,q,H,Z,Y,ie=d.transform,X=a.paint.get("fill-translate"),W=a.paint.get("fill-translate-anchor");y?(q=k&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",V=S.LINES):(q=k?"fillPattern":"fill",V=S.TRIANGLES);let te=A.constantOr(null);for(let J of s){let le=t.getTile(J);if(k&&!le.patternsLoaded())continue;let me=le.getBucket(a);if(!me)continue;let de=me.programConfigurations.get(a.id),Pe=d.useProgram(q,de),Me=(w=d.style.map.terrain)===null||w===void 0?void 0:w.getTerrainData(J);k&&(d.context.activeTexture.set(S.TEXTURE0),le.imageAtlasTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),de.updatePaintBuffers(R)),Fo(de,P,te,le,a);let Qe=ie.getProjectionData({overscaledTileID:J,applyGlobeMatrix:!b,applyTerrainMatrix:!0}),Le=u.aL(ie,le,X,W);if(y){Z=me.indexBuffer2,Y=me.segments2;let et=[S.drawingBufferWidth,S.drawingBufferHeight];H=q==="fillOutlinePattern"&&k?cn(d,R,le,et,Le):Yc(et,Le)}else Z=me.indexBuffer,Y=me.segments,H=k?Fl(d,R,le,Le):{u_fill_translate:Le};let xe=d.stencilModeForClipping(J);Pe.draw(d.context,V,c,xe,f,At.backCCW,H,Me,Qe,a.id,me.layoutVertexBuffer,Z,Y,a.paint,d.transform.zoom,de)}}function Ls(d,t,a,s,c,f,y,b){var w;let S=d.context,P=S.gl,A="fill-extrusion-pattern",k=a.paint.get(A),R=k.constantOr(1),V=a.getCrossfadeParameters(),q=a.paint.get("fill-extrusion-opacity"),H=k.constantOr(null),Z=d.transform;for(let Y of s){let ie=t.getTile(Y),X=ie.getBucket(a);if(!X)continue;let W=(w=d.style.map.terrain)===null||w===void 0?void 0:w.getTerrainData(Y),te=X.programConfigurations.get(a.id),J=d.useProgram(R?"fillExtrusionPattern":"fillExtrusion",te);R&&(d.context.activeTexture.set(P.TEXTURE0),ie.imageAtlasTexture.bind(P.LINEAR,P.CLAMP_TO_EDGE),te.updatePaintBuffers(V));let le=Z.getProjectionData({overscaledTileID:Y,applyGlobeMatrix:!b,applyTerrainMatrix:!0});Fo(te,A,H,ie,a);let me=u.aL(Z,ie,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),de=a.paint.get("fill-extrusion-vertical-gradient"),Pe=R?Ha(d,de,q,me,Y,V,ie):Rl(d,de,q,me);J.draw(S,S.gl.TRIANGLES,c,f,y,At.backCCW,Pe,W,le,a.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,a.paint,d.transform.zoom,te,d.style.map.terrain&&X.centroidVertexBuffer)}}function Rs(d,t,a,s,c,f,y,b,w){var S;let P=d.style.projection,A=d.context,k=d.transform,R=A.gl,V=[`#define NUM_ILLUMINATION_SOURCES ${a.paint.get("hillshade-highlight-color").values.length}`],q=d.useProgram("hillshade",null,!1,V),H=!d.options.moving;for(let Z of s){let Y=t.getTile(Z),ie=Y.fbo;if(!ie)continue;let X=P.getMeshFromTileID(A,Z.canonical,b,!0,"raster"),W=(S=d.style.map.terrain)===null||S===void 0?void 0:S.getTerrainData(Z);A.activeTexture.set(R.TEXTURE0),R.bindTexture(R.TEXTURE_2D,ie.colorAttachment.get());let te=k.getProjectionData({overscaledTileID:Z,aligned:H,applyGlobeMatrix:!w,applyTerrainMatrix:!0});q.draw(A,R.TRIANGLES,f,c[Z.overscaledZ],y,At.backCCW,Jc(d,Y,a),W,te,a.id,X.vertexBuffer,X.indexBuffer,X.segments)}}let Fs=0;function Bs(d,t,a,s,c,f,y,b,w){var S;let P=d.style.projection,A=d.context,k=d.transform,R=A.gl,V=d.useProgram("colorRelief"),q=!d.options.moving,H=a.paint.get("resampling")==="nearest"?R.NEAREST:R.LINEAR,Z=!0,Y=0;for(let ie of s){let X=t.getTile(ie),W=X.dem;if(Z){Fs||(Fs=R.getParameter(R.MAX_TEXTURE_SIZE));let Pe=Fs,{elevationTexture:Me,colorTexture:Qe}=a.getColorRampTextures(A,Pe,W.getUnpackVector());A.activeTexture.set(R.TEXTURE1),Me.bind(R.NEAREST,R.CLAMP_TO_EDGE),A.activeTexture.set(R.TEXTURE4),Qe.bind(R.LINEAR,R.CLAMP_TO_EDGE),Z=!1,Y=Me.size[0]}if(!W?.data)continue;let te=W.stride,J=W.getPixels();if(A.activeTexture.set(R.TEXTURE0),A.pixelStoreUnpackPremultiplyAlpha.set(!1),X.demTexture||(X.demTexture=d.getTileTexture(te)),X.demTexture){let Pe=X.demTexture;Pe.update(J,{premultiply:!1}),Pe.bind(H,R.CLAMP_TO_EDGE)}else X.demTexture=new u.T(A,J,R.RGBA,{premultiply:!1}),X.demTexture.bind(H,R.CLAMP_TO_EDGE);let le=P.getMeshFromTileID(A,ie.canonical,b,!0,"raster"),me=(S=d.style.map.terrain)===null||S===void 0?void 0:S.getTerrainData(ie),de=k.getProjectionData({overscaledTileID:ie,aligned:q,applyGlobeMatrix:!w,applyTerrainMatrix:!0});V.draw(A,R.TRIANGLES,f,c[ie.overscaledZ],y,At.backCCW,ms(a,X.dem,Y),me,de,a.id,le.vertexBuffer,le.indexBuffer,le.segments)}}let Os=[new u.P(0,0),new u.P(u.a6,0),new u.P(u.a6,u.a6),new u.P(0,u.a6)];function ia(d,t,a,s,c,f,y,b,w=!1,S=!1){var P;let A=s[s.length-1].overscaledZ,k=d.context,R=k.gl,V=d.useProgram("raster"),q=d.transform,H=d.style.projection,Z=d.colorModeForRenderPass(),Y=!d.options.moving,ie=a.paint.get("raster-opacity"),X=a.paint.get("resampling")==="nearest"||a.paint.get("raster-resampling")==="nearest"?R.NEAREST:R.LINEAR,W=a.paint.get("raster-fade-duration"),te=!!d.style.map.terrain;for(let J of s){let le=d.getDepthModeForSublayer(J.overscaledZ-A,ie===1?yt.ReadWrite:yt.ReadOnly,R.LESS),me=t.getTile(J);k.activeTexture.set(R.TEXTURE0),me.texture.bind(X,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST),k.activeTexture.set(R.TEXTURE1);let{parentTile:de,parentScaleBy:Pe,parentTopLeft:Me,fadeValues:Qe}=gu(me,t,W,te);me.fadeOpacity=Qe.tileOpacity,de?(de.fadeOpacity=Qe.parentTileOpacity,de.texture.bind(X,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST)):me.texture.bind(X,R.CLAMP_TO_EDGE,R.LINEAR_MIPMAP_NEAREST),me.texture.useMipmap&&k.extTextureFilterAnisotropic&&d.transform.pitch>d.options.anisotropicFilterPitch&&R.texParameterf(R.TEXTURE_2D,k.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,k.extTextureFilterAnisotropicMax);let Le=(P=d.style.map.terrain)===null||P===void 0?void 0:P.getTerrainData(J),xe=q.getProjectionData({overscaledTileID:J,aligned:Y,applyGlobeMatrix:!S,applyTerrainMatrix:!0}),et=ql(Me,Pe,Qe.fadeMix,a,b),tt=H.getMeshFromTileID(k,J.canonical,f,y,"raster");V.draw(k,R.TRIANGLES,le,c?c[J.overscaledZ]:Ft.disabled,Z,w?At.frontCCW:At.backCCW,et,Le,xe,a.id,tt.vertexBuffer,tt.indexBuffer,tt.segments)}}function gu(d,t,a,s){let c={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(a===0||s)return c;if(d.fadingParentID){let f=t.getLoadedTile(d.fadingParentID);if(!f)return c;let y=Math.pow(2,f.tileID.overscaledZ-d.tileID.overscaledZ),b=[d.tileID.canonical.x*y%1,d.tileID.canonical.y*y%1],w=(function(S,P,A){let k=ke(),R=(k-P.timeAdded)/A,V=S.fadingDirection===st.Incoming,q=u.al((k-S.timeAdded)/A,0,1),H=u.al(1-R,0,1),Z=V?q:H;return{tileOpacity:Z,parentTileOpacity:V?H:q,fadeMix:{opacity:1,mix:1-Z}}})(d,f,a);return{parentTile:f,parentScaleBy:y,parentTopLeft:b,fadeValues:w}}if(d.selfFading){let f=(function(y,b){let w=(ke()-y.timeAdded)/b,S=u.al(w,0,1);return{tileOpacity:S,fadeMix:{opacity:S,mix:0}}})(d,a);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:f}}return c}let _u=new u.bo(1,0,0,1),yu=new u.bo(0,1,0,1),vu=new u.bo(0,0,1,1),bu=new u.bo(1,0,1,1),xu=new u.bo(0,1,1,1);function Ql(d,t,a,s){_n(d,0,t+a/2,d.transform.width,a,s)}function ec(d,t,a,s){_n(d,t-a/2,0,a,d.transform.height,s)}function _n(d,t,a,s,c,f){let y=d.context,b=y.gl;b.enable(b.SCISSOR_TEST),b.scissor(t*d.pixelRatio,a*d.pixelRatio,s*d.pixelRatio,c*d.pixelRatio),y.clear({color:f}),b.disable(b.SCISSOR_TEST)}function Ns(d,t,a){var s;let c=d.context,f=c.gl,y=d.useProgram("debug"),b=yt.disabled,w=Ft.disabled,S=d.colorModeForRenderPass(),P="$debug",A=(s=d.style.map.terrain)===null||s===void 0?void 0:s.getTerrainData(a);c.activeTexture.set(f.TEXTURE0);let k=t.getTileByID(a.key).latestRawTileData,R=Math.floor((k?.byteLength||0)/1024),V=t.getTile(a).tileSize,q=512/Math.min(V,512)*(a.overscaledZ/d.transform.zoom)*.5,H=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(H+=` => ${a.overscaledZ}`),(function(Y,ie){Y.initDebugOverlayCanvas();let X=Y.debugOverlayCanvas,W=Y.context.gl,te=Y.debugOverlayCanvas.getContext("2d");te.clearRect(0,0,X.width,X.height),te.shadowColor="white",te.shadowBlur=2,te.lineWidth=1.5,te.strokeStyle="white",te.textBaseline="top",te.font="bold 36px Open Sans, sans-serif",te.fillText(ie,5,5),te.strokeText(ie,5,5),Y.debugOverlayTexture.update(X),Y.debugOverlayTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE)})(d,`${H} ${R}kB`);let Z=d.transform.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!0,applyTerrainMatrix:!0});y.draw(c,f.TRIANGLES,b,w,ii.alphaBlended,At.disabled,Kc(u.bo.transparent,q),null,Z,P,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),y.draw(c,f.LINE_STRIP,b,w,S,At.disabled,Kc(u.bo.red),A,Z,P,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function tc(d,t,a,s){let{isRenderingGlobe:c}=s,f=d.context,y=f.gl,b=d.transform,w=d.colorModeForRenderPass(),S=d.getDepthModeFor3D(),P=d.useProgram("terrain");f.bindFramebuffer.set(null),f.viewport.set([0,0,d.width,d.height]);for(let A of a){let k=t.getTerrainMesh(A.tileID),R=d.renderToTexture.getTexture(A),V=t.getTerrainData(A.tileID);f.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,R.texture);let q=t.getMeshFrameDelta(b.zoom),H=b.calculateFogMatrix(A.tileID.toUnwrapped()),Z=Hc(q,H,d.style.sky,b.pitch,c),Y=b.getProjectionData({overscaledTileID:A.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});P.draw(f,y.TRIANGLES,S,Ft.disabled,w,At.backCCW,Z,V,Y,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}function Fr(d,t){if(!t.mesh){let a=new u.aU;a.emplaceBack(-1,-1),a.emplaceBack(1,-1),a.emplaceBack(1,1),a.emplaceBack(-1,1);let s=new u.aW;s.emplaceBack(0,1,2),s.emplaceBack(0,2,3),t.mesh=new ha(d.createVertexBuffer(a,Jt.members),d.createIndexBuffer(s),u.aV.simpleSegment(0,0,a.length,s.length))}return t.mesh}let ra={symbol:function(d,t,a,s,c,f){if(d.renderPass!=="translucent")return;let{isRenderingToTexture:y}=f,b=Ft.disabled,w=d.colorModeForRenderPass();(a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(S,P,A,k,R,V,q,H,Z){var Y;let ie=P.transform,X=P.style.map.terrain,W=R==="map",te=V==="map";for(let J of S){let le=k.getTile(J),me=le.getBucket(A);if(!(!((Y=me?.text)===null||Y===void 0)&&Y.segments.get().length))continue;let de=u.aw(me.textSizeData,ie.zoom),Pe=u.aK(le,1,P.transform.zoom),Me=mo(W,P.transform,Pe),Qe=A.layout.get("icon-text-fit")!=="none"&&me.hasIconData();if(de){let Le=Math.pow(2,ie.zoom-le.tileID.overscaledZ),xe=X?(et,tt)=>X.getElevation(J,et,tt):null;du(me,W,te,Z,ie,Me,Le,de,Qe,u.aL(ie,le,q,H),J.toUnwrapped(),xe)}}})(s,d,a,t,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),c),a.paint.get("icon-opacity").constantOr(1)!==0&&zs(d,t,a,s,!1,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),a.layout.get("icon-rotation-alignment"),a.layout.get("icon-pitch-alignment"),a.layout.get("icon-keep-upright"),b,w,y),a.paint.get("text-opacity").constantOr(1)!==0&&zs(d,t,a,s,!0,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.layout.get("text-keep-upright"),b,w,y),t.map.showCollisionBoxes&&(Yl(d,t,a,s,!0),Yl(d,t,a,s,!1))},circle:function(d,t,a,s,c){var f;if(d.renderPass!=="translucent")return;let{isRenderingToTexture:y}=c,b=a.paint.get("circle-opacity"),w=a.paint.get("circle-stroke-width"),S=a.paint.get("circle-stroke-opacity"),P=!a.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(w.constantOr(1)===0||S.constantOr(1)===0))return;let A=d.context,k=A.gl,R=d.transform,V=d.getDepthModeForSublayer(0,yt.ReadOnly),q=Ft.disabled,H=d.colorModeForRenderPass(),Z=[],Y=R.getCircleRadiusCorrection();for(let ie of s){let X=t.getTile(ie),W=X.getBucket(a);if(!W)continue;let te=a.paint.get("circle-translate"),J=a.paint.get("circle-translate-anchor"),le=u.aL(R,X,te,J),me=W.programConfigurations.get(a.id),de=d.useProgram("circle",me),Pe=W.layoutVertexBuffer,Me=W.indexBuffer,Qe=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(ie),Le={programConfiguration:me,program:de,layoutVertexBuffer:Pe,indexBuffer:Me,uniformValues:Sh(d,X,a,le,Y),terrainData:Qe,projectionData:R.getProjectionData({overscaledTileID:ie,applyGlobeMatrix:!y,applyTerrainMatrix:!0})};if(P){let xe=W.segments.get();for(let et of xe)Z.push({segments:new u.aV([et]),sortKey:et.sortKey,state:Le})}else Z.push({segments:W.segments,sortKey:0,state:Le})}P&&Z.sort(((ie,X)=>ie.sortKey-X.sortKey));for(let ie of Z){let{programConfiguration:X,program:W,layoutVertexBuffer:te,indexBuffer:J,uniformValues:le,terrainData:me,projectionData:de}=ie.state;W.draw(A,k.TRIANGLES,V,q,H,At.backCCW,le,me,de,a.id,te,J,ie.segments,a.paint,d.transform.zoom,X)}},heatmap:function(d,t,a,s,c){if(a.paint.get("heatmap-opacity")===0)return;let f=d.context,{isRenderingToTexture:y,isRenderingGlobe:b}=c;if(d.style.map.terrain){for(let w of s){let S=t.getTile(w);t.hasRenderableParent(w)||(d.renderPass==="offscreen"?fu(d,S,a,w,b):d.renderPass==="translucent"&&xi(d,a,w,y,b))}f.viewport.set([0,0,d.width,d.height])}else d.renderPass==="offscreen"?(function(w,S,P,A){let k=w.context,R=k.gl,V=w.transform,q=Ft.disabled,H=new ii([R.ONE,R.ONE],u.bo.transparent,[!0,!0,!0,!0]);(function(Z,Y,ie){let X=Z.gl;Z.activeTexture.set(X.TEXTURE1),Z.viewport.set([0,0,Y.width/4,Y.height/4]);let W=ie.heatmapFbos.get(u.cd);W?(X.bindTexture(X.TEXTURE_2D,W.colorAttachment.get()),Z.bindFramebuffer.set(W.framebuffer)):(W=Oa(Z,Y.width/4,Y.height/4),ie.heatmapFbos.set(u.cd,W))})(k,w,P),k.clear({color:u.bo.transparent});for(let Z of A){if(S.hasRenderableParent(Z))continue;let Y=S.getTile(Z),ie=Y.getBucket(P);if(!ie)continue;let X=ie.programConfigurations.get(P.id),W=w.useProgram("heatmap",X),te=V.getProjectionData({overscaledTileID:Z,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),J=V.getCircleRadiusCorrection();W.draw(k,R.TRIANGLES,yt.disabled,q,H,At.backCCW,Bl(Y,V.zoom,P.paint.get("heatmap-intensity"),J),null,te,P.id,ie.layoutVertexBuffer,ie.indexBuffer,ie.segments,P.paint,V.zoom,X)}k.viewport.set([0,0,w.width,w.height])})(d,t,a,s):d.renderPass==="translucent"&&(function(w,S){let P=w.context,A=P.gl;P.setColorMode(w.colorModeForRenderPass());let k=S.heatmapFbos.get(u.cd);k&&(P.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,k.colorAttachment.get()),P.activeTexture.set(A.TEXTURE1),Pr(P,S).bind(A.LINEAR,A.CLAMP_TO_EDGE),w.useProgram("heatmapTexture").draw(P,A.TRIANGLES,yt.disabled,Ft.disabled,w.colorModeForRenderPass(),At.disabled,Ol(w,S,0,1),null,null,S.id,w.viewportBuffer,w.quadTriangleIndexBuffer,w.viewportSegments,S.paint,w.transform.zoom))})(d,a)},line:function(d,t,a,s,c){var f;if(d.renderPass!=="translucent")return;let{isRenderingToTexture:y}=c,b=a.paint.get("line-opacity"),w=a.paint.get("line-width");if(b.constantOr(1)===0||w.constantOr(1)===0)return;let S=d.getDepthModeForSublayer(0,yt.ReadOnly),P=d.colorModeForRenderPass(),A=a.paint.get("line-dasharray"),k=A.constantOr(1),R=a.paint.get("line-pattern"),V=R.constantOr(1),q=a.paint.get("line-gradient"),H=a.getCrossfadeParameters(),Z;Z=V?"linePattern":k&&q?"lineGradientSDF":k?"lineSDF":q?"lineGradient":"line";let Y=d.context,ie=Y.gl,X=d.transform,W=!0;for(let te of s){let J=t.getTile(te);if(V&&!J.patternsLoaded())continue;let le=J.getBucket(a);if(!le)continue;let me=le.programConfigurations.get(a.id),de=d.context.program.get(),Pe=d.useProgram(Z,me),Me=W||Pe.program!==de,Qe=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(te),Le=R.constantOr(null),xe=A?.constantOr(null);if(Le&&J.imageAtlas){let Qt=J.imageAtlas,wi=Qt.patternPositions[Le.to.toString()],Ti=Qt.patternPositions[Le.from.toString()];wi&&Ti&&me.setConstantPatternPositions(wi,Ti)}else if(xe){let Qt=a.layout.get("line-cap").constantOr(null)==="round",wi=d.lineAtlas.getDash(xe.to,Qt),Ti=d.lineAtlas.getDash(xe.from,Qt);me.setConstantDashPositions(wi,Ti)}let et=X.getProjectionData({overscaledTileID:te,applyGlobeMatrix:!y,applyTerrainMatrix:!0}),tt=X.getPixelScale(),Vt;V?(Vt=Vl(d,J,a,tt,H),ks(Y,ie,J,me,H)):k&&q?(Vt=eu(d,J,a,tt,H,le.lineClipsArray.length),Jl(d,t,Y,ie,a,le,te,me,H)):k?(Vt=Ul(d,J,a,tt,H),mu(d,Y,ie,me,Me,H)):q?(Vt=jl(d,J,a,tt,le.lineClipsArray.length),Ro(d,t,Y,ie,a,le,te)):Vt=Gr(d,J,a,tt);let mi=d.stencilModeForClipping(te);Pe.draw(Y,ie.TRIANGLES,S,mi,P,At.disabled,Vt,Qe,et,a.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,a.paint,d.transform.zoom,me,le.layoutVertexBuffer2),W=!1}},fill:function(d,t,a,s,c){let f=a.paint.get("fill-color"),y=a.paint.get("fill-opacity");if(y.constantOr(1)===0)return;let{isRenderingToTexture:b}=c,w=d.colorModeForRenderPass(),S=a.paint.get("fill-pattern"),P=d.opaquePassEnabledForLayer()&&!S.constantOr(1)&&f.constantOr(u.bo.transparent).a===1&&y.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===P){let A=d.getDepthModeForSublayer(1,d.renderPass==="opaque"?yt.ReadWrite:yt.ReadOnly);Ds(d,t,a,s,A,w,!1,b)}if(d.renderPass==="translucent"&&a.paint.get("fill-antialias")){let A=d.getDepthModeForSublayer(a.getPaintProperty("fill-outline-color")?2:0,yt.ReadOnly);Ds(d,t,a,s,A,w,!0,b)}},fillExtrusion:function(d,t,a,s,c){let f=a.paint.get("fill-extrusion-opacity");if(f===0)return;let{isRenderingToTexture:y}=c;if(d.renderPass==="translucent"){let b=new yt(d.context.gl.LEQUAL,yt.ReadWrite,d.depthRangeFor3D);if(f!==1||a.paint.get("fill-extrusion-pattern").constantOr(1))Ls(d,t,a,s,b,Ft.disabled,ii.disabled,y),Ls(d,t,a,s,b,d.stencilModeFor3D(),d.colorModeForRenderPass(),y);else{let w=d.colorModeForRenderPass();Ls(d,t,a,s,b,Ft.disabled,w,y)}}},hillshade:function(d,t,a,s,c){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;let{isRenderingToTexture:f}=c,y=d.context,b=d.style.projection.useSubdivision,w=d.getDepthModeForSublayer(0,yt.ReadOnly),S=d.colorModeForRenderPass();if(d.renderPass==="offscreen")(function(P,A,k,R,V,q,H){let Z=P.context,Y=Z.gl,ie=R.paint.get("resampling")==="nearest"?Y.NEAREST:Y.LINEAR;for(let X of k){let W=A.getTile(X),te=W.dem;if(!te?.data||!W.needsHillshadePrepare)continue;let J=te.dim,le=te.stride,me=te.getPixels();if(Z.activeTexture.set(Y.TEXTURE1),Z.pixelStoreUnpackPremultiplyAlpha.set(!1),W.demTexture||(W.demTexture=P.getTileTexture(le)),W.demTexture){let Pe=W.demTexture;Pe.update(me,{premultiply:!1}),Pe.bind(Y.NEAREST,Y.CLAMP_TO_EDGE)}else W.demTexture=new u.T(Z,me,Y.RGBA,{premultiply:!1}),W.demTexture.bind(Y.NEAREST,Y.CLAMP_TO_EDGE);Z.activeTexture.set(Y.TEXTURE0);let de=W.fbo;if(!de){let Pe=new u.T(Z,{width:J,height:J,data:null},Y.RGBA);Pe.bind(ie,Y.CLAMP_TO_EDGE),de=W.fbo=Z.createFramebuffer(J,J,!0,!1),de.colorAttachment.set(Pe.texture)}Z.bindFramebuffer.set(de.framebuffer),Z.viewport.set([0,0,J,J]),P.useProgram("hillshadePrepare").draw(Z,Y.TRIANGLES,V,q,H,At.disabled,Nl(W.tileID,te),null,null,R.id,P.rasterBoundsBuffer,P.quadTriangleIndexBuffer,P.rasterBoundsSegments),W.needsHillshadePrepare=!1}})(d,t,s,a,w,Ft.disabled,S),y.viewport.set([0,0,d.width,d.height]);else if(d.renderPass==="translucent")if(b){let[P,A,k]=d.stencilConfigForOverlapTwoPass(s);Rs(d,t,a,k,P,w,S,!1,f),Rs(d,t,a,k,A,w,S,!0,f)}else{let[P,A]=d.getStencilConfigForOverlapAndUpdateStencilID(s);Rs(d,t,a,A,P,w,S,!1,f)}},colorRelief:function(d,t,a,s,c){if(d.renderPass!=="translucent"||!s.length)return;let{isRenderingToTexture:f}=c,y=d.style.projection.useSubdivision,b=d.getDepthModeForSublayer(0,yt.ReadOnly),w=d.colorModeForRenderPass();if(y){let[S,P,A]=d.stencilConfigForOverlapTwoPass(s);Bs(d,t,a,A,S,b,w,!1,f),Bs(d,t,a,A,P,b,w,!0,f)}else{let[S,P]=d.getStencilConfigForOverlapAndUpdateStencilID(s);Bs(d,t,a,P,S,b,w,!1,f)}},raster:function(d,t,a,s,c){if(d.renderPass!=="translucent"||a.paint.get("raster-opacity")===0||!s.length)return;let{isRenderingToTexture:f}=c,y=t.getSource(),b=d.style.projection.useSubdivision;if(y instanceof Ur)ia(d,t,a,s,null,!1,!1,y.tileCoords,y.flippedWindingOrder,f);else if(b){let[w,S,P]=d.stencilConfigForOverlapTwoPass(s);ia(d,t,a,P,w,!1,!0,Os,!1,f),ia(d,t,a,P,S,!0,!0,Os,!1,f)}else{let[w,S]=d.getStencilConfigForOverlapAndUpdateStencilID(s);ia(d,t,a,S,w,!1,!0,Os,!1,f)}},background:function(d,t,a,s,c){var f;let y=a.paint.get("background-color"),b=a.paint.get("background-opacity");if(b===0)return;let{isRenderingToTexture:w}=c,S=d.context,P=S.gl,A=d.style.projection,k=d.transform,R=k.tileSize,V=a.paint.get("background-pattern");if(d.isPatternMissing(V))return;let q=!V&&y.a===1&&b===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==q)return;let H=Ft.disabled,Z=d.getDepthModeForSublayer(0,q==="opaque"?yt.ReadWrite:yt.ReadOnly),Y=d.colorModeForRenderPass(),ie=d.useProgram(V?"backgroundPattern":"background"),X=s||la(k,{tileSize:R,terrain:d.style.map.terrain});V&&(S.activeTexture.set(P.TEXTURE0),d.imageManager.bind(d.context));let W=a.getCrossfadeParameters();for(let te of X){let J=k.getProjectionData({overscaledTileID:te,applyGlobeMatrix:!w,applyTerrainMatrix:!0}),le=V?Eh(b,d,V,{tileID:te,tileSize:R},W):ru(b,y),me=(f=d.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(te),de=A.getMeshFromTileID(S,te.canonical,!1,!0,"raster");ie.draw(S,P.TRIANGLES,Z,H,Y,At.backCCW,le,me,J,a.id,de.vertexBuffer,de.indexBuffer,de.segments)}},sky:function(d,t){let a=d.context,s=a.gl,c=((P,A,k)=>{let R=Math.cos(A.rollInRadians),V=Math.sin(A.rollInRadians),q=Jr(A),H=A.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:P.properties.get("sky-color"),u_horizon_color:P.properties.get("horizon-color"),u_horizon:[(A.width/2-q*V)*k,(A.height/2+q*R)*k],u_horizon_normal:[-V,R],u_sky_horizon_blend:P.properties.get("sky-horizon-blend")*A.height/2*k,u_sky_blend:H}})(t,d.style.map.transform,d.pixelRatio),f=new yt(s.LEQUAL,yt.ReadWrite,[0,1]),y=Ft.disabled,b=d.colorModeForRenderPass(),w=d.useProgram("sky"),S=Fr(a,t);w.draw(a,s.TRIANGLES,f,y,b,At.disabled,c,null,void 0,"sky",S.vertexBuffer,S.indexBuffer,S.segments)},atmosphere:function(d,t,a){let s=d.context,c=s.gl,f=d.useProgram("atmosphere"),y=new yt(c.LEQUAL,yt.ReadOnly,[0,1]),b=d.transform,w=(function(H,Z){let Y=H.properties.get("position"),ie=[-Y.x,-Y.y,-Y.z],X=u.ap(new Float64Array(16));return H.properties.get("anchor")==="map"&&(u.be(X,X,Z.rollInRadians),u.bf(X,X,-Z.pitchInRadians),u.be(X,X,Z.bearingInRadians),u.bf(X,X,Z.center.lat*Math.PI/180),u.bI(X,X,-Z.center.lng*Math.PI/180)),u.cg(ie,ie,X),ie})(a,d.transform),S=b.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),P=t.properties.get("atmosphere-blend")*S.projectionTransition;if(P===0)return;let A=ls(b.worldSize,b.center.lat),k=b.inverseProjectionMatrix,R=new Float64Array(4);R[3]=1,u.aE(R,R,b.modelViewProjectionMatrix),R[0]/=R[3],R[1]/=R[3],R[2]/=R[3],R[3]=1,u.aE(R,R,k),R[0]/=R[3],R[1]/=R[3],R[2]/=R[3],R[3]=1;let V=((H,Z,Y,ie,X)=>({u_sun_pos:H,u_atmosphere_blend:Z,u_globe_position:Y,u_globe_radius:ie,u_inv_proj_matrix:X}))(w,P,[R[0],R[1],R[2]],A,k),q=Fr(s,t);f.draw(s,c.TRIANGLES,y,Ft.disabled,ii.alphaBlended,At.disabled,V,null,null,"atmosphere",q.vertexBuffer,q.indexBuffer,q.segments)},custom:function(d,t,a,s){let{isRenderingGlobe:c}=s,f=d.context,y=a.implementation,b=d.style.projection,w=d.transform,S=w.getProjectionDataForCustomLayer(c),P={farZ:w.farZ,nearZ:w.nearZ,fov:w.fov*Math.PI/180,modelViewProjectionMatrix:w.modelViewProjectionMatrix,projectionMatrix:w.projectionMatrix,shaderData:{variantName:b.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
802
+ uniform mat4 u_projection_matrix;
803
+ ${b.shaderPreludeCode.vertexSource}`,define:b.shaderDefine},defaultProjectionData:S},A=y.renderingMode?y.renderingMode:"2d";if(d.renderPass==="offscreen"){let k=y.prerender;k&&(d.setCustomLayerDefaults(),f.setColorMode(d.colorModeForRenderPass()),k.call(y,f.gl,P),f.setDirty(),d.setBaseState())}else if(d.renderPass==="translucent"){d.setCustomLayerDefaults(),f.setColorMode(d.colorModeForRenderPass()),f.setStencilMode(Ft.disabled);let k=A==="3d"?d.getDepthModeFor3D():d.getDepthModeForSublayer(0,yt.ReadOnly);f.setDepthMode(k),y.render(f.gl,P),f.setDirty(),d.setBaseState(),f.bindFramebuffer.set(null)}},debug:function(d,t,a){for(let s of a)Ns(d,t,s)},debugPadding:function(d){let t=d.transform.padding;Ql(d,d.transform.height-(t.top||0),3,_u),Ql(d,t.bottom||0,3,yu),ec(d,t.left||0,3,vu),ec(d,d.transform.width-(t.right||0),3,bu);let a=d.transform.centerPoint;(function(s,c,f,y){_n(s,c-1,f-10,2,20,y),_n(s,c-10,f-1,20,2,y)})(d,a.x,d.transform.height-a.y,xu)},terrainDepth:function(d,t){let a=d.context,s=a.gl,c=d.transform,f=ii.unblended,y=new yt(s.LEQUAL,yt.ReadWrite,[0,1]),b=t.tileManager.getRenderableTiles(),w=d.useProgram("terrainDepth");a.bindFramebuffer.set(t.getFramebuffer("depth").framebuffer),a.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),a.clear({color:u.bo.transparent,depth:1});for(let S of b){let P=t.getTerrainMesh(S.tileID),A=t.getTerrainData(S.tileID),k=c.getProjectionData({overscaledTileID:S.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),R={u_ele_delta:t.getMeshFrameDelta(c.zoom)};w.draw(a,s.TRIANGLES,y,Ft.disabled,f,At.backCCW,R,A,k,"terrain",P.vertexBuffer,P.indexBuffer,P.segments)}a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height])},terrainCoords:function(d,t){let a=d.context,s=a.gl,c=d.transform,f=ii.unblended,y=new yt(s.LEQUAL,yt.ReadWrite,[0,1]),b=t.getCoordsTexture(),w=t.tileManager.getRenderableTiles(),S=d.useProgram("terrainCoords");a.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),a.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),a.clear({color:u.bo.transparent,depth:1}),t.coordsIndex=[];for(let P of w){let A=t.getTerrainMesh(P.tileID),k=t.getTerrainData(P.tileID);a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,b.texture);let R={u_terrain_coords_id:(255-t.coordsIndex.length)/255,u_texture:0,u_ele_delta:t.getMeshFrameDelta(c.zoom)},V=c.getProjectionData({overscaledTileID:P.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});S.draw(a,s.TRIANGLES,y,Ft.disabled,f,At.backCCW,R,k,V,"terrain",A.vertexBuffer,A.indexBuffer,A.segments),t.coordsIndex.push(P.tileID.key)}a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height])}};class yn{constructor(t,a){this.drawFunctions=ra,this.context=new gn(t),this.transform=a,this._tileTextures={},this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:u.ap(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Oi.maxOverzooming+Oi.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fr}resize(t,a,s){if(this.width=Math.floor(t*s),this.height=Math.floor(a*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let c of this.style._order)this.style._layers[c].resize()}setup(){let t=this.context,a=new u.aU;a.emplaceBack(0,0),a.emplaceBack(u.a6,0),a.emplaceBack(0,u.a6),a.emplaceBack(u.a6,u.a6),this.tileExtentBuffer=t.createVertexBuffer(a,Jt.members),this.tileExtentSegments=u.aV.simpleSegment(0,0,4,2);let s=new u.aU;s.emplaceBack(0,0),s.emplaceBack(u.a6,0),s.emplaceBack(0,u.a6),s.emplaceBack(u.a6,u.a6),this.debugBuffer=t.createVertexBuffer(s,Jt.members),this.debugSegments=u.aV.simpleSegment(0,0,4,5);let c=new u.ch;c.emplaceBack(0,0,0,0),c.emplaceBack(u.a6,0,u.a6,0),c.emplaceBack(0,u.a6,0,u.a6),c.emplaceBack(u.a6,u.a6,u.a6,u.a6),this.rasterBoundsBuffer=t.createVertexBuffer(c,Wc.members),this.rasterBoundsSegments=u.aV.simpleSegment(0,0,4,2);let f=new u.aU;f.emplaceBack(0,0),f.emplaceBack(u.a6,0),f.emplaceBack(0,u.a6),f.emplaceBack(u.a6,u.a6),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(f,Jt.members),this.rasterBoundsSegmentsPosOnly=u.aV.simpleSegment(0,0,4,5);let y=new u.aU;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(y,Jt.members),this.viewportSegments=u.aV.simpleSegment(0,0,4,2);let b=new u.ci;b.emplaceBack(0),b.emplaceBack(1),b.emplaceBack(3),b.emplaceBack(2),b.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(b);let w=new u.aW;w.emplaceBack(1,0,2),w.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(w);let S=this.context.gl;this.stencilClearMode=new Ft({func:S.ALWAYS,mask:0},0,255,S.ZERO,S.ZERO,S.ZERO),this.tileExtentMesh=new ha(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,a=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let s=u.O();u.c7(s,0,this.width,this.height,0,0,1),u.S(s,s,[a.drawingBufferWidth,a.drawingBufferHeight,0]);let c={mainMatrix:s,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s};this.useProgram("clippingMask",null,!0).draw(t,a.TRIANGLES,yt.disabled,this.stencilClearMode,ii.disabled,At.disabled,null,null,c,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,a,s){if(this.currentStencilSource===t.source||!t.isTileClipped()||!a?.length)return;this.currentStencilSource=t.source,this.nextStencilID+a.length>256&&this.clearStencil();let c=this.context;c.setColorMode(ii.disabled),c.setDepthMode(yt.disabled);let f={};for(let y of a)f[y.key]=this.nextStencilID++;this._renderTileMasks(f,a,s,!0),this._renderTileMasks(f,a,s,!1),this._tileClippingMaskIDs=f}_renderTileMasks(t,a,s,c){var f;let y=this.context,b=y.gl,w=this.style.projection,S=this.transform,P=this.useProgram("clippingMask");for(let A of a){let k=t[A.key],R=(f=this.style.map.terrain)===null||f===void 0?void 0:f.getTerrainData(A),V=w.getMeshFromTileID(this.context,A.canonical,c,!0,"stencil"),q=S.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!s,applyTerrainMatrix:!0});P.draw(y,b.TRIANGLES,yt.disabled,new Ft({func:b.ALWAYS,mask:0},k,255,b.KEEP,b.KEEP,b.REPLACE),ii.disabled,s?At.disabled:At.backCCW,null,R,q,"$clipping",V.vertexBuffer,V.indexBuffer,V.segments)}}_renderTilesDepthBuffer(){var t;let a=this.context,s=a.gl,c=this.style.projection,f=this.transform,y=this.useProgram("depth"),b=this.getDepthModeFor3D(),w=la(f,{tileSize:f.tileSize});for(let S of w){let P=(t=this.style.map.terrain)===null||t===void 0?void 0:t.getTerrainData(S),A=c.getMeshFromTileID(this.context,S.canonical,!0,!0,"raster"),k=f.getProjectionData({overscaledTileID:S,applyGlobeMatrix:!0,applyTerrainMatrix:!0});y.draw(a,s.TRIANGLES,b,Ft.disabled,ii.disabled,At.backCCW,null,P,k,"$clipping",A.vertexBuffer,A.indexBuffer,A.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,a=this.context.gl;return new Ft({func:a.NOTEQUAL,mask:255},t,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(t){let a=this.context.gl;return new Ft({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,a.KEEP,a.KEEP,a.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let a=this.context.gl,s=t.sort(((y,b)=>b.overscaledZ-y.overscaledZ)),c=s[s.length-1].overscaledZ,f=s[0].overscaledZ-c+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();let y={};for(let b=0;b<f;b++)y[b+c]=new Ft({func:a.GEQUAL,mask:255},b+this.nextStencilID,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID+=f,[y,s]}return[{[c]:Ft.disabled},s]}stencilConfigForOverlapTwoPass(t){let a=this.context.gl,s=t.sort(((y,b)=>b.overscaledZ-y.overscaledZ)),c=s[s.length-1].overscaledZ,f=s[0].overscaledZ-c+1;if(this.clearStencil(),f>1){let y={},b={};for(let w=0;w<f;w++)y[w+c]=new Ft({func:a.GREATER,mask:255},f+1+w,255,a.KEEP,a.KEEP,a.REPLACE),b[w+c]=new Ft({func:a.GREATER,mask:255},1+w,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID=2*f+1,[y,b,s]}return this.nextStencilID=3,[{[c]:new Ft({func:a.GREATER,mask:255},2,255,a.KEEP,a.KEEP,a.REPLACE)},{[c]:new Ft({func:a.GREATER,mask:255},1,255,a.KEEP,a.KEEP,a.REPLACE)},s]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new ii([t.CONSTANT_COLOR,t.ONE],new u.bo(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?ii.unblended:ii.alphaBlended}getDepthModeForSublayer(t,a,s){if(!this.opaquePassEnabledForLayer())return yt.disabled;let c=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new yt(s||this.context.gl.LEQUAL,a,[c,c])}getDepthModeFor3D(){return new yt(this.context.gl.LEQUAL,yt.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,a){var s,c,f;this.style=t,this.options=a,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(ke()),this.imageManager.beginFrame();let y=this.style._order,b=this.style.tileManagers,w={},S={},P={},A={isRenderingToTexture:!1,isRenderingGlobe:((s=t.projection)===null||s===void 0?void 0:s.transitionState)>0};for(let R in b){let V=b[R];V.used&&V.prepare(this.context),w[R]=V.getVisibleCoordinates(!1),S[R]=w[R].slice().reverse(),P[R]=V.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let R=0;R<y.length;R++)if(this.style._layers[y[R]].is3D()){this.opaquePassCutoff=R;break}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let R of y){let V=this.style._layers[R];if(!V.hasOffscreenPass()||V.isHidden(this.transform.zoom))continue;let q=S[V.source];(V.type==="custom"||q.length)&&this.renderLayer(this,b[V.source],V,q,A)}if((c=this.style.projection)===null||c===void 0||c.updateGPUdependent({context:this.context,useProgram:R=>this.useProgram(R)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?u.bo.black:u.bo.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=y.length-1;this.currentLayer>=0;this.currentLayer--){let R=this.style._layers[y[this.currentLayer]],V=b[R.source],q=w[R.source];this._renderTileClippingMasks(R,q,!1),this.renderLayer(this,V,R,q,A)}this.renderPass="translucent";let k=!1;for(this.currentLayer=0;this.currentLayer<y.length;this.currentLayer++){let R=this.style._layers[y[this.currentLayer]],V=b[R.source];if(!((f=this.renderToTexture)===null||f===void 0)&&f.renderLayer(R,A))continue;this.opaquePassEnabledForLayer()||k||(k=!0,A.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let q=(R.type==="symbol"?P:S)[R.source];this._renderTileClippingMasks(R,w[R.source],!!this.renderToTexture),this.renderLayer(this,V,R,q,A)}if(A.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let R=(function(V,q){let H=null,Z=Object.values(V._layers).flatMap((W=>W.source&&!W.isHidden(q)?[V.tileManagers[W.source]]:[])),Y=Z.filter((W=>W.getSource().type==="vector")),ie=Z.filter((W=>W.getSource().type!=="vector")),X=W=>{(!H||H.getSource().maxzoom<W.getSource().maxzoom)&&(H=W)};for(let W of Y)X(W);if(!H)for(let W of ie)X(W);return H})(this.style,this.transform.zoom);R&&this.drawFunctions.debug(this,R,R.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(t){var a,s;if(!(!((s=(a=this.style)===null||a===void 0?void 0:a.map)===null||s===void 0)&&s.terrain))return;let c=this.terrainFacilitator.matrix,f=this.transform.modelViewProjectionMatrix,y=this.terrainFacilitator.depthDirty;y||(y=t?!u.cj(c,f):!u.ck(c,f)),y||(y=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),y&&(u.cl(c,f),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){var t,a;!((a=(t=this.style)===null||t===void 0?void 0:t.map)===null||a===void 0)&&a.terrain&&this.terrainFacilitator.coordsDirty&&(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(t,a,s,c,f){if(s.isHidden(this.transform.zoom)||s.type!=="background"&&s.type!=="custom"&&!(c||[]).length)return;this.id=s.id;let y=this.drawFunctions;u.aQ(s)?y.symbol(t,a,s,c,this.style.placement.variableOffsets,f):u.cm(s)?y.circle(t,a,s,c,f):u.cn(s)?y.heatmap(t,a,s,c,f):u.co(s)?y.line(t,a,s,c,f):u.cp(s)?y.fill(t,a,s,c,f):u.cq(s)?y.fillExtrusion(t,a,s,c,f):u.cr(s)?y.hillshade(t,a,s,c,f):u.cs(s)?y.colorRelief(t,a,s,c,f):u.bU(s)?y.raster(t,a,s,c,f):u.ct(s)?y.background(t,a,s,c,f):u.cu(s)&&y.custom(t,a,s,f)}saveTileTexture(t){let a=this._tileTextures[t.size[0]];a?a.length<yn.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?a.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let a=this._tileTextures[t];return a&&a.length>0?a.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let a=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!a||!s}useProgram(t,a,s=!1,c=[]){var f;this.cache||(this.cache={});let y=!!this.style.map.terrain,b=this.style.projection,w=s?bi.projectionMercator:b.shaderPreludeCode,S=s?To:b.shaderDefine,P=t+(a?a.cacheKey:"")+`/${s?Da:b.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(y?"/terrain":"")+(c?`/${c.join("/")}`:"");return(f=this.cache)[P]||(f[P]=new Xc(this.context,bi[t],a,gs[t],this._showOverdrawInspector,y,w,S,c)),this.cache[P]}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(){let 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 u.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,a;if(this._tileTextures){for(let s in this._tileTextures){let c=this._tileTextures[s];if(c)for(let f of c)f.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&&((a=this.tileExtentMesh.indexBuffer)===null||a===void 0||a.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let s in this.cache){let c=this.cache[s];c?.program&&this.context.gl.deleteProgram(c.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:a}=this.context.gl;return this.width!==t||this.height!==a}}function $r(d,t){let a,s=!1,c=null,f=()=>{c=null,s&&(d(...a),c=setTimeout(f,t),s=!1)};return(...y)=>(s=!0,a=y,c||f(),c)}yn.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class wu{constructor(t){this._getCurrentHash=()=>{let a=window.location.hash.replace("#","");if(this._hashName){let s,c=a.split("&").map((f=>f.split("=")));for(let f of c)f[0]===this._hashName&&(s=f);return(s&&s[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{let a=this._getCurrentHash();if(!this._isValidHash(a))return!1;let s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:s,pitch:+(a[4]||0)}),!0},this._updateHashUnthrottled=()=>{let a=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{let a=this._getCurrentHash();if(a.length===0)return;let s=a.join("/"),c=s;c.split("&").length>0&&(c=c.split("&")[0]),this._hashName&&(c=`${this._hashName}=${s}`);let f=window.location.hash.replace(c,"");f.startsWith("#&")?f=f.slice(0,1)+f.slice(2):f==="#"&&(f="");let y=window.location.href.replace(/(#.+)?$/,f);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=$r(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){let a=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,c=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,c),y=Math.round(a.lng*f)/f,b=Math.round(a.lat*f)/f,w=this._map.getBearing(),S=this._map.getPitch(),P="";if(P+=t?`/${y}/${b}/${s}`:`${s}/${b}/${y}`,(w||S)&&(P+="/"+Math.round(10*w)/10),S&&(P+=`/${Math.round(S)}`),this._hashName){let A=this._hashName,k=!1,R=window.location.hash.slice(1).split("&").map((V=>{let q=V.split("=")[0];return q===A?(k=!0,`${q}=${P}`):V})).filter((V=>V));return k||R.push(`${A}=${P}`),`#${R.join("&")}`}return`#${P}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new u.W(+t[2],+t[1])}catch{return!1}let a=+t[0],s=+(t[3]||0),c=+(t[4]||0);return a>=this._map.getMinZoom()&&a<=this._map.getMaxZoom()&&s>=-180&&s<=180&&c>=this._map.getMinPitch()&&c<=this._map.getMaxPitch()}}let vn={linearity:.3,easing:u.cv(0,0,.3,1)},Lh=u.e({deceleration:2500,maxSpeed:1400},vn),Bo=u.e({deceleration:20,maxSpeed:1400},vn),Rh=u.e({deceleration:1e3,maxSpeed:360},vn),Fh=u.e({deceleration:1e3,maxSpeed:90},vn),Bh=u.e({deceleration:1e3,maxSpeed:360},vn);class Oh{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:ke(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,a=ke();for(;t.length>0&&a-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let a={zoom:0,bearing:0,pitch:0,roll:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:f}of this._inertiaBuffer)a.zoom+=f.zoomDelta||0,a.bearing+=f.bearingDelta||0,a.pitch+=f.pitchDelta||0,a.roll+=f.rollDelta||0,f.panDelta&&a.pan._add(f.panDelta),f.around&&(a.around=f.around),f.pinchAround&&(a.pinchAround=f.pinchAround);let s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(a.pan.mag()){let f=ya(a.pan.mag(),s,u.e({},Lh,t||{})),y=a.pan.mult(f.amount/a.pan.mag()),b=this._map.cameraHelper.handlePanInertia(y,this._map.transform);c.center=b.easingCenter,c.offset=b.easingOffset,Oo(c,f)}if(a.zoom){let f=ya(a.zoom,s,Bo);c.zoom=u.cw(this._map.transform.zoom+f.amount,this._map.getZoomSnap(),f.amount),Oo(c,f)}if(a.bearing){let f=ya(a.bearing,s,Rh);c.bearing=this._map.transform.bearing+u.al(f.amount,-179,179),Oo(c,f)}if(a.pitch){let f=ya(a.pitch,s,Fh);c.pitch=this._map.transform.pitch+f.amount,Oo(c,f)}if(a.roll){let f=ya(a.roll,s,Bh);c.roll=this._map.transform.roll+u.al(f.amount,-179,179),Oo(c,f)}if(c.zoom||c.bearing){let f=a.pinchAround===void 0?a.around:a.pinchAround;c.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),u.e(c,{noMoveStart:!0})}}function Oo(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function ya(d,t,a){let{maxSpeed:s,linearity:c,deceleration:f}=a,y=u.al(d*c/(t/1e3),-s,s),b=Math.abs(y)/(f*c);return{easing:a.easing,duration:1e3*b,amount:y*(b/2)}}class Mi extends u.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,s,c={}){s=s instanceof MouseEvent?s:new MouseEvent(t,s);let f=Se.mousePos(a.getCanvas(),s),y=a.unproject(f);super(t,u.e({point:f,lngLat:y,originalEvent:s},c)),this._defaultPrevented=!1,this.target=a}}class Ne extends u.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,s){let c=t==="touchend"?s.changedTouches:s.touches,f=Se.touchPos(a.getCanvasContainer(),c),y=f.map((w=>a.unproject(w))),b=f.reduce(((w,S,P,A)=>w.add(S.div(A.length))),new u.P(0,0));super(t,{points:f,point:b,lngLats:y,lngLat:a.unproject(b),originalEvent:s}),this._defaultPrevented=!1}}class ic extends u.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class rc{constructor(t,a){this._map=t,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new ic(t.type,this._map,t))}mousedown(t,a){return this._mousedownPos=a,this._firePreventable(new Mi(t.type,this._map,t))}mouseup(t){this._map.fire(new Mi(t.type,this._map,t))}click(t,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new Mi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Mi(t.type,this._map,t))}mouseover(t){this._map.fire(new Mi(t.type,this._map,t))}mouseout(t){this._map.fire(new Mi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Ne(t.type,this._map,t))}touchmove(t){this._map.fire(new Ne(t.type,this._map,t))}touchend(t){this._map.fire(new Ne(t.type,this._map,t))}touchcancel(t){this._map.fire(new Ne(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Tu{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Mi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Mi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Mi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class va{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(u.P.convert(t),this._map.terrain)}}class No{constructor(t,a){this._map=t,this._tr=new va(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=a.clickTolerance||1,a.boxZoom&&typeof a.boxZoom=="object"&&(this._boxZoomEnd=a.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,a){this.isEnabled()&&t.shiftKey&&t.button===0&&(Se.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(t,a){if(!this._active)return;let s=a;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;let c=this._startPos;this._lastPos=s,this._box||(this._box=Se.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let f=Math.min(c.x,s.x),y=Math.max(c.x,s.x),b=Math.min(c.y,s.y),w=Math.max(c.y,s.y);this._box.style.transform=`translate(${f}px,${b}px)`,this._box.style.width=y-f+"px",this._box.style.height=w-b+"px"}mouseupWindow(t,a){if(!this._active||t.button!==0)return;let s=this._startPos,c=a;if(this.reset(),Se.suppressClick(),s.x!==c.x||s.y!==c.y)return this._map.fire(new u.n("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,s,c,t):{cameraAnimation:f=>f.fitScreenCoordinates(s,c,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&&(this._box.remove(),this._box=null),Se.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,a){return this._map.fire(new u.n(t,{originalEvent:a}))}}function bn(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);let a={};for(let s=0;s<d.length;s++)a[d[s].identifier]=t[s];return a}class Nh{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,a,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=(function(c){let f=new u.P(0,0);for(let y of c)f._add(y);return f.div(c.length)})(a),this.touches=bn(s,a)))}touchmove(t,a,s){if(this.aborted||!this.centroid)return;let c=bn(s,a);for(let f in this.touches){let y=c[f];(!y||y.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(t,a,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){let c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class xn{constructor(t){this.singleTap=new Nh(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,a,s){this.singleTap.touchstart(t,a,s)}touchmove(t,a,s){this.singleTap.touchmove(t,a,s)}touchend(t,a,s){let c=this.singleTap.touchend(t,a,s);if(c){let f=t.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(c)<30;if(f&&y||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class Su{constructor(t){this._tr=new va(t),this._zoomIn=new xn({numTouches:1,numTaps:2}),this._zoomOut=new xn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,a,s){this._zoomIn.touchstart(t,a,s),this._zoomOut.touchstart(t,a,s)}touchmove(t,a,s){this._zoomIn.touchmove(t,a,s),this._zoomOut.touchmove(t,a,s)}touchend(t,a,s){let c=this._zoomIn.touchend(t,a,s),f=this._zoomOut.touchend(t,a,s),y=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:b=>b.easeTo({duration:300,zoom:u.cw(y.zoom+1,b.getZoomSnap()),around:y.unproject(c)},{originalEvent:t})}):f?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:b=>b.easeTo({duration:300,zoom:u.cw(y.zoom-1,b.getZoomSnap()),around:y.unproject(f)},{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 Ya{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){let a=this._moveFunction(...t);if(a.bearingDelta||a.pitchDelta||a.rollDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(t,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(a)?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,a){if(!this.isEnabled())return;let s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let c=Array.isArray(a)?a[0]:a;return!this._moved&&c.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=c,this._move(s,c))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&Se.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}}let jh=0,Pu=2,Vh={[jh]:1,[Pu]:2};class wn{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(a,s){let c=Vh[s];return a.buttons===void 0||(a.buttons&c)!==c})(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}}class Mu{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 Uh{constructor(t=new wn({checkCorrectEvent:()=>!0}),a=new Mu){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=a}_executeRelevantHandler(t,a,s){return t instanceof MouseEvent?a(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?s(t):void 0}startMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.startMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.startMove(a)}))}endMove(t){this._executeRelevantHandler(t,(a=>{this.mouseMoveStateManager.endMove(a)}),(a=>{this.oneFingerTouchMoveStateManager.endMove(a)}))}isValidStartEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidStartEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidStartEvent(a)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidMoveEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(a)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidEndEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidEndEvent(a)))}}let Tn=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=t=>{t.preventDefault()}};class qh{constructor(t,a){this._clickTolerance=t.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,a,s){return this._calculateTransform(t,a,s)}touchmove(t,a,s){if(this._active){if(!this._shouldBePrevented(s.length))return t.preventDefault(),this._calculateTransform(t,a,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,a,s){this._calculateTransform(t,a,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,a,s){s.length>0&&(this._active=!0);let c=bn(s,a),f=new u.P(0,0),y=new u.P(0,0),b=0;for(let S in c){let P=c[S],A=this._touches[S];A&&(f._add(P),y._add(P.sub(A)),b++,c[S]=P)}if(this._touches=c,this._shouldBePrevented(b)||!y.mag())return;let w=y.div(b);return this._sum._add(w),this._sum.mag()<this._clickTolerance?void 0:{around:f.div(b),panDelta:w}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ac{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,a,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([a[0],a[1]]))}touchmove(t,a,s){if(!this._firstTwoTouches)return;t.preventDefault();let[c,f]=this._firstTwoTouches,y=aa(s,a,c),b=aa(s,a,f);if(!y||!b)return;let w=this._aroundCenter?null:y.add(b).div(2);return this._move([y,b],w,t)}touchend(t,a,s){if(!this._firstTwoTouches)return;let[c,f]=this._firstTwoTouches,y=aa(s,a,c),b=aa(s,a,f);y&&b||(this._active&&Se.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 aa(d,t,a){for(let s=0;s<d.length;s++)if(d[s].identifier===a)return t[s]}function Wt(d,t){return Math.log(d/t)/Math.LN2}class Cu extends ac{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,a){let s=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Wt(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:Wt(this._distance,s)*this._zoomRate,pinchAround:a}}}function Sn(d,t){return 180*d.angleWith(t)/Math.PI}class Pn extends ac{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,a,s){let c=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Sn(this._vector,c),pinchAround:a}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let a=25/(Math.PI*this._minDiameter)*360,s=Sn(t,this._startVector);return Math.abs(s)<a}}function Mn(d){return Math.abs(d.y)>Math.abs(d.x)}class oc extends ac{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,a,s){super.touchstart(t,a,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,Mn(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,a,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let c=t[0].sub(this._lastPoints[0]),f=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,f,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+f.y)/2*-.5}):void 0}gestureBeginsVertically(t,a,s){if(this._valid!==void 0)return this._valid;let c=t.mag()>=2,f=a.mag()>=2;if(!c&&!f)return;if(!c||!f)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;let y=t.y>0==a.y>0;return Mn(t)&&Mn(a)&&y}}let Eu={panStep:100,bearingStep:15,pitchStep:10};class nc{constructor(t){this._tr=new va(t);let a=Eu;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let a=0,s=0,c=0,f=0,y=0;switch(t.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),f=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),f=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),y=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,c=0),{cameraAnimation:b=>{let w=this._tr;b.easeTo({duration:300,easeId:"keyboardHandler",easing:Gh,zoom:a?u.cw(w.zoom+a*(t.shiftKey?2:1),b.getZoomSnap()):w.zoom,bearing:w.bearing+s*this._bearingStep,pitch:w.pitch+c*this._pitchStep,offset:[-f*this._panStep,-y*this._panStep],center:w.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 Gh(d){return d*(2-d)}let oa=4.000244140625,js=1/450;class Ke{constructor(t,a){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new va(t),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=js}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 a=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,s=ke(),c=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,a!==0&&a%oa==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),t.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=t,this._delta-=a,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let a=Se.mousePos(this._map.getCanvas(),t),s=this._tr;this._aroundPoint=this._aroundCenter?s.transform.locationToScreenPoint(u.W.convert(s.center)):a,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let b=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=b),typeof this._targetZoom=="number"&&(this._targetZoom+=b)}if(this._delta!==0){let b=this._type==="wheel"&&Math.abs(this._delta)>oa?this._wheelZoomRate:this._defaultZoomRate,w=2/(1+Math.exp(-Math.abs(this._delta*b)));this._delta<0&&w!==0&&(w=1/w);let S=typeof this._targetZoom!="number"?t.scale:u.ao(this._targetZoom),P=t.applyConstrain(t.getCameraLngLat(),u.ar(S*w)).zoom,A=this._map.getZoomSnap();if(this._type==="wheel"&&A>0){let k=u.cw(t.zoom,A);this._targetZoom=u.cw(P,A,P-k)}else this._targetZoom=P;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let a=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,s=this._startZoom,c=this._easing,f,y=!1;if(this._type==="wheel"&&s&&c){let b=ke()-this._lastWheelEventTime,w=Math.min((b+5)/200,1),S=c(w);f=u.H.number(s,a,S),w<1?this._needsRerender=!0:y=!0}else f=a,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=f,{noInertia:!0,needsRenderFrame:!y,zoomDelta:f-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let a=u.cy;if(this._prevEase){let s=this._prevEase,c=(ke()-s.start)/s.duration,f=s.easing(c+.01)-s.easing(c),y=.27/Math.sqrt(f*f+1e-4)*.01,b=Math.sqrt(.0729-y*y);a=u.cv(y,b,.25,1)}return this._prevEase={start:ke(),duration:t,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class rt{constructor(t,a){this._clickZoom=t,this._tapZoom=a}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 Cn{constructor(t){this._tr=new va(t),this.reset()}reset(){this._active=!1}dblclick(t,a){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:u.cw(this._tr.zoom+(t.shiftKey?-1:1),s.getZoomSnap()),around:this._tr.unproject(a)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Iu{constructor(){this._tap=new xn({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,a,s){if(!this._swipePoint)if(this._tapTime){let c=a[0],f=t.timeStamp-this._tapTime<500,y=this._tapPoint.dist(c)<30;f&&y?s.length>0&&(this._swipePoint=c,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,a,s)}touchmove(t,a,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;let c=a[0],f=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:f/128*this._zoomRate}}}else this._tap.touchmove(t,a,s)}touchend(t,a,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{let c=this._tap.touchend(t,a,s);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class En{constructor(t,a,s){this._el=t,this._mousePan=a,this._touchPan=s}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 tr{constructor(t,a,s,c){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=a,this._mousePitch=s,this._mouseRoll=c}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 sc{constructor(t,a,s,c){this._el=t,this._touchZoom=a,this._touchRotate=s,this._tapDragZoom=c,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()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Vs{constructor(t,a){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=Se.create("div","maplibregl-cooperative-gesture-screen",t);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),c=document.createElement("div");c.className="maplibregl-desktop-message",c.textContent=a,this._container.appendChild(c);let f=document.createElement("div");f.className="maplibregl-mobile-message",f.textContent=s,this._container.appendChild(f),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),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,a){this._enabled&&(this._map.fire(new u.n("cooperativegestureprevented",{gestureType:t,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let Mr=d=>d.zoom||d.drag||d.roll||d.pitch||d.rotate;class zu extends u.n{}function lc(d){var t;return((t=d.panDelta)===null||t===void 0?void 0:t.mag())||d.zoomDelta||d.bearingDelta||d.pitchDelta||d.rollDelta}class Zh{get _ownerDocument(){var t;return((t=this._el)===null||t===void 0?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,a;return((a=(t=this._el)===null||t===void 0?void 0:t.ownerDocument)===null||a===void 0?void 0:a.defaultView)||window}constructor(t,a){this.handleWindowEvent=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,f)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let y=c.type==="renderFrame"?void 0:c,b={needsRenderFrame:!1},w={},S={};for(let{handlerName:k,handler:R,allowed:V}of this._handlers){if(!R.isEnabled())continue;let q;if(this._blockedByActive(S,V,k))R.reset();else if(R[f||c.type]){if(u.cz(c,f||c.type)){let H=Se.mousePos(this._map.getCanvas(),c);q=R[f||c.type](c,H)}else if(u.cA(c,f||c.type)){let H=this._getMapTouches(c.touches),Z=Se.touchPos(this._map.getCanvas(),H);q=R[f||c.type](c,Z,H)}else u.cB(f||c.type)||(q=R[f||c.type](c));this.mergeHandlerResult(b,w,q,k,y),q?.needsRenderFrame&&this._triggerRenderFrame()}(q||R.isActive())&&(S[k]=R)}let P={};for(let k in this._previousActiveHandlers)S[k]||(P[k]=y);this._previousActiveHandlers=S,(Object.keys(P).length||lc(b))&&(this._changes.push([b,w,P]),this._triggerRenderFrame()),(Object.keys(S).length||lc(b))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:A}=b;A&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],A(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Oh(t),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);let s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[c,f,y]of this._listeners)c.addEventListener(f,c===this._ownerDocument?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(let[t,a,s]of this._listeners)t.removeEventListener(a,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){let a=this._map,s=a.getCanvasContainer();this._add("mapEvent",new rc(a,t));let c=a.boxZoom=new No(a,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();let f=a.cooperativeGestures=new Vs(a,t.cooperativeGestures);this._add("cooperativeGestures",f),t.cooperativeGestures&&f.enable();let y=new Su(a),b=new Cn(a);a.doubleClickZoom=new rt(b,y),this._add("tapZoom",y),this._add("clickZoom",b),t.interactive&&t.doubleClickZoom&&a.doubleClickZoom.enable();let w=new Iu;this._add("tapDragZoom",w);let S=a.touchPitch=new oc(a);this._add("touchPitch",S),t.interactive&&t.touchPitch&&a.touchPitch.enable(t.touchPitch);let P=()=>a.project(a.getCenter()),A=(function({enable:X,clickTolerance:W,aroundCenter:te=!0,minPixelCenterThreshold:J=100,rotateDegreesPerPixelMoved:le=.8},me){let de=new wn({checkCorrectEvent:Pe=>Pe.button===0&&Pe.ctrlKey||Pe.button===2&&!Pe.ctrlKey});return new Ya({clickTolerance:W,move:(Pe,Me)=>{let Qe=me();if(te&&Math.abs(Qe.y-Pe.y)>J)return{bearingDelta:u.cx(new u.P(Pe.x,Me.y),Me,Qe)};let Le=(Me.x-Pe.x)*le;return te&&Me.y<Qe.y&&(Le=-Le),{bearingDelta:Le}},moveStateManager:de,enable:X,assignEvents:Tn})})(t,P),k=(function({enable:X,clickTolerance:W,pitchDegreesPerPixelMoved:te=-.5}){let J=new wn({checkCorrectEvent:le=>le.button===0&&le.ctrlKey||le.button===2});return new Ya({clickTolerance:W,move:(le,me)=>({pitchDelta:(me.y-le.y)*te}),moveStateManager:J,enable:X,assignEvents:Tn})})(t),R=(function({enable:X,clickTolerance:W,rollDegreesPerPixelMoved:te=.3},J){let le=new wn({checkCorrectEvent:me=>me.button===2&&me.ctrlKey});return new Ya({clickTolerance:W,move:(me,de)=>{let Pe=J(),Me=(de.x-me.x)*te;return de.y<Pe.y&&(Me=-Me),{rollDelta:Me}},moveStateManager:le,enable:X,assignEvents:Tn})})(t,P);a.dragRotate=new tr(t,A,k,R),this._add("mouseRotate",A,["mousePitch"]),this._add("mousePitch",k,["mouseRotate","mouseRoll"]),this._add("mouseRoll",R,["mousePitch"]),t.interactive&&t.dragRotate&&a.dragRotate.enable();let V=(function({enable:X,clickTolerance:W}){let te=new wn({checkCorrectEvent:J=>J.button===0&&!J.ctrlKey});return new Ya({clickTolerance:W,move:(J,le)=>({around:le,panDelta:le.sub(J)}),activateOnStart:!0,moveStateManager:te,enable:X,assignEvents:Tn})})(t),q=new qh(t,a);a.dragPan=new En(s,V,q),this._add("mousePan",V),this._add("touchPan",q,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&a.dragPan.enable(t.dragPan);let H=new Pn,Z=new Cu;a.touchZoomRotate=new sc(s,Z,H,w),this._add("touchRotate",H,["touchPan","touchZoom"]),this._add("touchZoom",Z,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&a.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new Tu(a));let Y=a.scrollZoom=new Ke(a,(()=>this._triggerRenderFrame()));this._add("scrollZoom",Y,["mousePan"]),t.interactive&&t.scrollZoom&&a.scrollZoom.enable(t.scrollZoom);let ie=a.keyboard=new nc(a);this._add("keyboard",ie),t.interactive&&t.keyboard&&a.keyboard.enable()}_add(t,a,s){this._handlers.push({handlerName:t,handler:a,allowed:s}),this._handlersById[t]=a}stop(t){if(!this._updatingCamera){for(let{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{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!!Mr(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,a,s){for(let c in t)if(c!==s&&!a?.includes(c))return!0;return!1}_getMapTouches(t){let a=[];for(let s of t)this._el.contains(s.target)&&a.push(s);return a}mergeHandlerResult(t,a,s,c,f){if(!s)return;u.e(t,s);let y={handlerName:c,originalEvent:s.originalEvent||f};s.zoomDelta!==void 0&&(a.zoom=y),s.panDelta!==void 0&&(a.drag=y),s.rollDelta!==void 0&&(a.roll=y),s.pitchDelta!==void 0&&(a.pitch=y),s.bearingDelta!==void 0&&(a.rotate=y)}_applyChanges(){let t={},a={},s={};for(let[c,f,y]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new u.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.rollDelta&&(t.rollDelta=(t.rollDelta||0)+c.rollDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),u.e(a,f),u.e(s,y);this._updateMapTransform(t,a,s),this._changes=[]}_updateMapTransform(t,a,s){let c=this._map,f=c._getTransformForUpdate(),y=c.terrain;if(!(lc(t)||y&&this._terrainMovement))return void this._fireEvents(a,s,!0);c._stop(!0);let{panDelta:b,zoomDelta:w,bearingDelta:S,pitchDelta:P,rollDelta:A,around:k,pinchAround:R}=t;R!==void 0&&(k=R),k||(k=c.transform.centerPoint),y&&!f.isPointOnMapSurface(k)&&(k=f.centerPoint);let V={panDelta:b,zoomDelta:w,rollDelta:A,pitchDelta:P,bearingDelta:S,around:k};this._map.cameraHelper.useGlobeControls&&!f.isPointOnMapSurface(k)&&(k=f.centerPoint);let q=k.distSqr(f.centerPoint)<.01?f.center:f.screenPointToLocation(b?k.sub(b):k);this._handleMapControls({terrain:y,tr:f,deltasForHelper:V,preZoomAroundLoc:q,combinedEventsInProgress:a,panDelta:b}),c._applyUpdatedTransform(f),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(a,s,!0)}_handleMapControls({terrain:t,tr:a,deltasForHelper:s,preZoomAroundLoc:c,combinedEventsInProgress:f,panDelta:y}){let b=this._map.cameraHelper;if(b.handleMapControlsRollPitchBearingZoom(s,a),t)return b.useGlobeControls?(this._terrainMovement||!f.drag&&!f.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void b.handleMapControlsPan(s,a,c)):this._terrainMovement||!f.drag&&!f.zoom?void(f.drag&&this._terrainMovement&&y?a.setCenter(a.screenPointToLocation(a.centerPoint.sub(y))):b.handleMapControlsPan(s,a,c)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void b.handleMapControlsPan(s,a,c));b.handleMapControlsPan(s,a,c)}_fireEvents(t,a,s){let c=Mr(this._eventsInProgress),f=Mr(t),y={};for(let A in t){let{originalEvent:k}=t[A];this._eventsInProgress[A]||(y[`${A}start`]=k),this._eventsInProgress[A]=t[A]}!c&&f&&this._fireEvent("movestart",f.originalEvent);for(let A in y)this._fireEvent(A,y[A]);f&&this._fireEvent("move",f.originalEvent);for(let A in t){let{originalEvent:k}=t[A];this._fireEvent(A,k)}let b={},w;for(let A in this._eventsInProgress){let{handlerName:k,originalEvent:R}=this._eventsInProgress[A];this._handlersById[k].isActive()||(delete this._eventsInProgress[A],w=a[k]||R,b[`${A}end`]=w)}for(let A in b)this._fireEvent(A,b[A]);let S=Mr(this._eventsInProgress),P=(c||f)&&!S;if(P&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let A=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&A.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(A)}if(s&&P){this._updatingCamera=!0;let A=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),k=R=>R!==0&&-this._bearingSnap<R&&R<this._bearingSnap;!A||!A.essential&&ut.prefersReducedMotion?(this._map.fire(new u.n("moveend",{originalEvent:w})),k(this._map.getBearing())&&this._map.resetNorth()):(k(A.bearing||this._map.getBearing())&&(A.bearing=0),A.freezeElevation=!0,this._map.easeTo(A,{originalEvent:w})),this._updatingCamera=!1}}_fireEvent(t,a){this._map.fire(new u.n(t,a?{originalEvent:a}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new zu("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class $h extends u.E{constructor(t,a,s){super(),this._renderFrameCallback=()=>{let c=Math.min((ke()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(c)),c<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=s.bearingSnap,this._zoomSnap=s.zoomSnap,this.cameraHelper=a,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,a){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=a}getCenter(){return new u.W(this.transform.center.lng,this.transform.center.lat)}setCenter(t,a){return this.jumpTo({center:t},a)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,a){return this.jumpTo({elevation:t},a),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,a,s){return t=u.P.convert(t).mult(-1),this.panTo(this.transform.center,u.e({offset:t},a),s)}panTo(t,a,s){return this.easeTo(u.e({center:t},a),s)}getZoom(){return this.transform.zoom}setZoom(t,a){return this.jumpTo({zoom:t},a),this}zoomTo(t,a,s){return this.easeTo(u.e({zoom:t},a),s)}zoomIn(t,a){return this.zoomTo(u.cw(this.getZoom()+1,this._zoomSnap),t,a),this}zoomOut(t,a){return this.zoomTo(u.cw(this.getZoom()-1,this._zoomSnap),t,a),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,a){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new u.n("movestart",a)).fire(new u.n("move",a)).fire(new u.n("moveend",a))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,a){return this.jumpTo({bearing:t},a),this}getPadding(){return this.transform.padding}setPadding(t,a){return this.jumpTo({padding:t},a),this}rotateTo(t,a,s){return this.easeTo(u.e({bearing:t},a),s)}resetNorth(t,a){return this.rotateTo(0,u.e({duration:1e3},t),a),this}resetNorthPitch(t,a){return this.easeTo(u.e({bearing:0,pitch:0,roll:0,duration:1e3},t),a),this}snapToNorth(t,a){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,a):this}getPitch(){return this.transform.pitch}setPitch(t,a){return this.jumpTo({pitch:t},a),this}getRoll(){return this.transform.roll}setRoll(t,a){return this.jumpTo({roll:t},a),this}cameraForBounds(t,a){t=Pt.convert(t).adjustAntiMeridian();let s=a?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),s,a)}_cameraForBoxAndBearing(t,a,s,c){let f={top:0,bottom:0,right:0,left:0};if(typeof(c=u.e({padding:f,offset:[0,0],maxZoom:this.transform.maxZoom},c)).padding=="number"){let P=c.padding;c.padding={top:P,bottom:P,right:P,left:P}}let y=u.e(f,c.padding);c.padding=y;let b=this.transform,w=new Pt(t,a),S=this.cameraHelper.cameraForBoxAndBearing(c,y,w,s,b);return S&&this._zoomSnap&&(S.zoom=u.cw(S.zoom,this._zoomSnap,-1)),S}fitBounds(t,a,s){return this._fitInternal(this.cameraForBounds(t,a),a,s)}fitScreenCoordinates(t,a,s,c,f){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(u.P.convert(t)),this.transform.screenPointToLocation(u.P.convert(a)),s,c),c,f)}_fitInternal(t,a,s){return t?(delete(a=u.e(t,a)).padding,a.linear?this.easeTo(a,s):this.flyTo(a,s)):this}jumpTo(t,a){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=u.cw(t.zoom,this._zoomSnap));let s=this._getTransformForUpdate(),c=!1,f=!1,y=!1,b=s.zoom;this.terrain&&s.setElevation(this.terrain.getElevationForLngLatZoom(t.center?u.W.convert(t.center):s.center,t.zoom||s.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(s,t);let w=s.zoom!==b;return"elevation"in t&&s.elevation!==+t.elevation&&s.setElevation(+t.elevation),"bearing"in t&&s.bearing!==+t.bearing&&(c=!0,s.setBearing(+t.bearing)),"pitch"in t&&s.pitch!==+t.pitch&&(f=!0,s.setPitch(+t.pitch)),"roll"in t&&s.roll!==+t.roll&&(y=!0,s.setRoll(+t.roll)),t.padding==null||s.isPaddingEqual(t.padding)||s.setPadding(t.padding),this._applyUpdatedTransform(s),this.fire(new u.n("movestart",a)).fire(new u.n("move",a)),w&&this.fire(new u.n("zoomstart",a)).fire(new u.n("zoom",a)).fire(new u.n("zoomend",a)),c&&this.fire(new u.n("rotatestart",a)).fire(new u.n("rotate",a)).fire(new u.n("rotateend",a)),f&&this.fire(new u.n("pitchstart",a)).fire(new u.n("pitch",a)).fire(new u.n("pitchend",a)),y&&this.fire(new u.n("rollstart",a)).fire(new u.n("roll",a)).fire(new u.n("rollend",a)),this.fire(new u.n("moveend",a))}calculateCameraOptionsFromTo(t,a,s,c=0){let f=u.a7.fromLngLat(t,a),y=u.a7.fromLngLat(s,c),b=y.x-f.x,w=y.y-f.y,S=y.z-f.z,P=Math.hypot(b,w,S);if(P===0)throw new Error("Can't calculate camera options with same From and To");let A=Math.hypot(b,w),k=u.ar(this.transform.cameraToCenterDistance/P/this.transform.tileSize),R=180*Math.atan2(b,-w)/Math.PI,V=180*Math.acos(A/P)/Math.PI;return V=S<0?90-V:90+V,{center:y.toLngLat(),elevation:c,zoom:k,pitch:V,bearing:R}}calculateCameraOptionsFromCameraLngLatAltRotation(t,a,s,c,f){let y=this.transform.calculateCenterFromCameraLngLatAlt(t,a,s,c);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:s,pitch:c,roll:f}}easeTo(t,a){this._stop(!1,t.easeId),"zoom"in(t=u.e({offset:[0,0],duration:500,easing:u.cy},t))&&this._zoomSnap&&(t.zoom=u.cw(t.zoom,this._zoomSnap)),(t.animate===!1||!t.essential&&ut.prefersReducedMotion)&&(t.duration=0);let s=this._getTransformForUpdate(),c=this.getBearing(),f=s.pitch,y=s.roll,b="bearing"in t?this._normalizeBearing(t.bearing,c):c,w="pitch"in t?+t.pitch:f,S="roll"in t?this._normalizeBearing(t.roll,y):y,P="padding"in t?t.padding:s.padding,A=u.P.convert(t.offset),k,R;t.around&&(k=u.W.convert(t.around),R=s.locationToScreenPoint(k));let V={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},q=this.cameraHelper.handleEaseTo(s,{bearing:b,pitch:w,roll:S,padding:P,around:k,aroundPoint:R,offsetAsPoint:A,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||(this._rotating=c!==b),this._pitching||(this._pitching=w!==f),this._rolling||(this._rolling=S!==y),this._padding=!s.isPaddingEqual(P),this._zooming||(this._zooming=q.isZooming),this._easeId=t.easeId,this._prepareEase(a,t.noMoveStart,V),this.terrain&&this._prepareElevation(q.elevationCenter),this._ease((H=>{q.easeFunc(H),this.terrain&&!t.freezeElevation&&this._updateElevation(H),this._applyUpdatedTransform(s),this._fireMoveEvents(a)}),(H=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a,H)}),t),this}_prepareEase(t,a,s={}){this._moving=!0,a||s.moving||this.fire(new u.n("movestart",t)),this._zooming&&!s.zooming&&this.fire(new u.n("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new u.n("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new u.n("pitchstart",t)),this._rolling&&!s.rolling&&this.fire(new u.n("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));let a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&a!==this._elevationTarget){let s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(a-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=a}this.transform.setElevation(u.H.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{};let a=t.getCameraLngLat(),s=t.getCameraAltitude(),c=this.terrain?this.terrain.getElevationForLngLatZoom(a,t.zoom):0;if(s<c){let f=this.calculateCameraOptionsFromTo(a,c,t.center,t.elevation);return{pitch:f.pitch,zoom:f.zoom}}return{}}_applyUpdatedTransform(t){let a=[];if(a.push((c=>this._elevateCameraIfInsideTerrain(c))),this.transformCameraUpdate&&a.push((c=>this.transformCameraUpdate(c))),!a.length)return;let s=t.clone();for(let c of a){let f=s.clone(),{center:y,zoom:b,roll:w,pitch:S,bearing:P,elevation:A}=c(f);y&&f.setCenter(y),A!==void 0&&f.setElevation(A),b!==void 0&&f.setZoom(b),w!==void 0&&f.setRoll(w),S!==void 0&&f.setPitch(S),P!==void 0&&f.setBearing(P),s.apply(f,!1)}this.transform.apply(s,!1)}_fireMoveEvents(t){this.fire(new u.n("move",t)),this._zooming&&this.fire(new u.n("zoom",t)),this._rotating&&this.fire(new u.n("rotate",t)),this._pitching&&this.fire(new u.n("pitch",t)),this._rolling&&this.fire(new u.n("roll",t))}_afterEase(t,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;let s=this._zooming,c=this._rotating,f=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,s&&this.fire(new u.n("zoomend",t)),c&&this.fire(new u.n("rotateend",t)),f&&this.fire(new u.n("pitchend",t)),y&&this.fire(new u.n("rollend",t)),this.fire(new u.n("moveend",t))}flyTo(t,a){if(!t.essential&&ut.prefersReducedMotion){let Me=u.V(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(Me,a)}this.stop(),"zoom"in(t=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.cy},t))&&this._zoomSnap&&(t.zoom=u.cw(t.zoom,this._zoomSnap));let s=this._getTransformForUpdate(),c=s.bearing,f=s.pitch,y=s.roll,b=s.padding,w="bearing"in t?this._normalizeBearing(t.bearing,c):c,S="pitch"in t?+t.pitch:f,P="roll"in t?this._normalizeBearing(t.roll,y):y,A="padding"in t?t.padding:s.padding,k=u.P.convert(t.offset),R=s.centerPoint.add(k),V=s.screenPointToLocation(R),q=this.cameraHelper.handleFlyTo(s,{bearing:w,pitch:S,roll:P,padding:A,locationAtOffset:V,offsetAsPoint:k,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),H=t.curve,Z=Math.max(s.width,s.height),Y=Z/q.scaleOfZoom,ie=q.pixelPathLength;typeof q.scaleOfMinZoom=="number"&&(H=Math.sqrt(Z/q.scaleOfMinZoom/ie*2));let X=H*H;function W(Me){let Qe=(Y*Y-Z*Z+(Me?-1:1)*X*X*ie*ie)/(2*(Me?Y:Z)*X*ie);return Math.log(Math.sqrt(Qe*Qe+1)-Qe)}function te(Me){return(Math.exp(Me)-Math.exp(-Me))/2}function J(Me){return(Math.exp(Me)+Math.exp(-Me))/2}let le=W(!1),me=function(Me){return J(le)/J(le+H*Me)},de=function(Me){return Z*((J(le)*(te(Qe=le+H*Me)/J(Qe))-te(le))/X)/ie;var Qe},Pe=(W(!0)-le)/H;if(Math.abs(ie)<2e-6||!isFinite(Pe)){if(Math.abs(Z-Y)<1e-6)return this.easeTo(t,a);let Me=Y<Z?-1:1;Pe=Math.abs(Math.log(Y/Z))/H,de=()=>0,me=Qe=>Math.exp(Me*H*Qe)}return t.duration="duration"in t?+t.duration:1e3*Pe/("screenSpeed"in t?+t.screenSpeed/H:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=c!==w,this._pitching=S!==f,this._rolling=P!==y,this._padding=!s.isPaddingEqual(A),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(q.targetCenter),this._ease((Me=>{let Qe=Me*Pe,Le=1/me(Qe),xe=de(Qe);this._rotating&&s.setBearing(u.H.number(c,w,Me)),this._pitching&&s.setPitch(u.H.number(f,S,Me)),this._rolling&&s.setRoll(u.H.number(y,P,Me)),this._padding&&(s.interpolatePadding(b,A,Me),R=s.centerPoint.add(k)),q.easeFunc(Me,Le,xe,R),this.terrain&&!t.freezeElevation&&this._updateElevation(Me),this._applyUpdatedTransform(s),this._fireMoveEvents(a)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,a){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let c=this._onEaseEnd;delete this._onEaseEnd,c.call(this,a)}return t||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(t,a,s){s.animate===!1||s.duration===0?(t(1),a()):(this._easeStart=ke(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,a){t=u.X(t,-180,180);let s=Math.abs(t-a);return Math.abs(t-360-a)<s&&(t-=360),Math.abs(t+360-a)<s&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(u.W.convert(t),this.transform):null}}let jo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ri{constructor(t=jo){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=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.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=Se.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Se.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Se.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(){this._container.remove(),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,a){let s=this._map._getUIString(`AttributionControl.${a}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((c=>typeof c!="string"?"":c))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}let a=this._map.style.tileManagers;for(let c in a){let f=a[c];if(f.used||f.usedForTerrain){let y=f.getSource();y.attribution&&!t.includes(y.attribution)&&t.push(y.attribution)}}t=t.filter((c=>String(c).trim())),t.sort(((c,f)=>c.length-f.length)),t=t.filter(((c,f)=>{for(let y=f+1;y<t.length;y++)if(t[y].includes(c))return!1;return!0}));let s=t.join(" | ");if(s!==this._attribHTML){if(this._attribHTML=s,t.length){let c=document.createDocumentFragment(),f=!0;for(let y of t){let b=Se.sanitize(y);b.hasChildNodes()&&(f||c.append(" | "),c.append(b),f=!1)}this._innerContainer.replaceChildren(c),this._container.classList.remove("maplibregl-attrib-empty")}else this._container.classList.add("maplibregl-attrib-empty");this._updateCompact(),this._editLink=null}}}class fi{constructor(t={}){this._updateCompact=()=>{let a=this._container.children;if(a.length){let s=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){var a;this._map=t,this._compact=(a=this.options)===null||a===void 0?void 0:a.compact,this._container=Se.create("div","maplibregl-ctrl");let s=Se.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Au{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let a=++this._id;return this._queue.push({callback:t,id:a,cancelled:!1}),a}remove(t){let a=this._currentlyRunning,s=a?this._queue.concat(a):this._queue;for(let c of s)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let a=this._currentlyRunning=this._queue;this._queue=[];for(let s of a)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var In=u.aS([{name:"a_pos3d",type:"Int16",components:3}]);class Us extends u.E{constructor(t){super(),this._lastTilesetChange=ke(),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,a){this.tileManager.update(t,a),this._renderableTilesKeys=[];let s={};for(let c of la(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a,calculateTileZoom:this.tileManager._source.calculateTileZoom}))s[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.terrainRttPosMatrix32f=new Float64Array(16),u.c7(c.terrainRttPosMatrix32f,0,u.a6,u.a6,0,0,1),this._tiles[c.key]=new it(c,this.tileSize),this._lastTilesetChange=ke());for(let c in this._tiles)s[c]||delete this._tiles[c]}freeRtt(t){for(let a in this._tiles){let s=this._tiles[a];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,a){return a?this._getTerrainCoordsForTileRanges(t,a):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let a={};for(let s of this._renderableTilesKeys){let c=this._tiles[s].tileID,f=t.clone(),y=u.bj();if(c.canonical.equals(t.canonical))u.c7(y,0,u.a6,u.a6,0,0,1);else if(c.canonical.isChildOf(t.canonical)){let b=c.canonical.z-t.canonical.z,w=c.canonical.x-(c.canonical.x>>b<<b),S=c.canonical.y-(c.canonical.y>>b<<b),P=u.a6>>b;u.c7(y,0,P,P,0,0,1),u.Q(y,y,[-w*P,-S*P,0])}else{if(!t.canonical.isChildOf(c.canonical))continue;{let b=t.canonical.z-c.canonical.z,w=t.canonical.x-(t.canonical.x>>b<<b),S=t.canonical.y-(t.canonical.y>>b<<b),P=u.a6>>b;u.c7(y,0,u.a6,u.a6,0,0,1),u.Q(y,y,[w*P,S*P,0]),u.S(y,y,[1/2**b,1/2**b,0])}}f.terrainRttPosMatrix32f=new Float32Array(y),a[s]=f}return a}_getTerrainCoordsForTileRanges(t,a){let s={};for(let c of this._renderableTilesKeys){let f=this._tiles[c].tileID;if(!this._isWithinTileRanges(f,a))continue;let y=t.clone(),b=u.bj();if(f.canonical.z===t.canonical.z){let w=t.canonical.x-f.canonical.x+t.wrap*(1<<t.canonical.z),S=t.canonical.y-f.canonical.y;u.c7(b,0,u.a6,u.a6,0,0,1),u.Q(b,b,[w*u.a6,S*u.a6,0])}else if(f.canonical.z>t.canonical.z){let w=f.canonical.z-t.canonical.z,S=f.canonical.x-(f.canonical.x>>w<<w)+t.wrap*(1<<f.canonical.z),P=f.canonical.y-(f.canonical.y>>w<<w),A=t.canonical.x-(f.canonical.x>>w),k=t.canonical.y-(f.canonical.y>>w),R=u.a6>>w;u.c7(b,0,R,R,0,0,1),u.Q(b,b,[-S*R+A*u.a6,-P*R+k*u.a6,0])}else{let w=t.canonical.z-f.canonical.z,S=t.canonical.x-(t.canonical.x>>w<<w)+t.wrap*(1<<t.canonical.z),P=t.canonical.y-(t.canonical.y>>w<<w),A=(t.canonical.x>>w)-f.canonical.x,k=(t.canonical.y>>w)-f.canonical.y,R=u.a6<<w;u.c7(b,0,R,R,0,0,1),u.Q(b,b,[S*u.a6+A*R,P*u.a6+k*R,0])}y.terrainRttPosMatrix32f=new Float32Array(b),s[c]=y}return s}getSourceTile(t,a){var s,c;let f=this.tileManager._source,y=t.overscaledZ-this.deltaZoom;if(y>f.maxzoom&&(y=f.maxzoom),y<f.minzoom)return;(s=this._sourceTileCache)[c=t.key]||(s[c]=t.scaledTo(y).key);let b=this.findTileInCaches(this._sourceTileCache[t.key]);if(!b?.dem&&a)for(;y>=f.minzoom&&!b?.dem;)b=this.findTileInCaches(t.scaledTo(y--).key);return b}findTileInCaches(t){let a=this.tileManager.getTileByID(t);return a||(a=this.tileManager._outOfViewCache.getByKey(t),a)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,a){let s=a[t.canonical.z];return!!s&&(t.wrap>s.minWrap||t.wrap<s.maxWrap||t.canonical.x>=s.minTileXWrapped&&t.canonical.x<=s.maxTileXWrapped&&t.canonical.y>=s.minTileY&&t.canonical.y<=s.maxTileY)}}class cc{constructor(t,a,s){this._meshCache={},this.painter=t,this.tileManager=new Us(a),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(let t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,a,s,c=u.a6){var f;let y=t.normalizeCoordinates(a,s,c);if(!y)return 0;let b=this.getTerrainData(y.tileID),w=(f=b.tile)===null||f===void 0?void 0:f.dem;if(!w)return 0;let S=u.cC([],[y.x/c*u.a6,y.y/c*u.a6],b.u_terrain_matrix),P=[S[0]*w.dim,S[1]*w.dim],A=Math.floor(P[0]),k=Math.floor(P[1]),R=P[0]-A,V=P[1]-k;return w.get(A,k)*(1-R)*(1-V)+w.get(A+1,k)*R*(1-V)+w.get(A,k+1)*(1-R)*V+w.get(A+1,k+1)*R*V}getElevationForLngLatZoom(t,a){if(!u.cD(a,t.wrap()))return 0;let{tileID:s,mercatorX:c,mercatorY:f}=this._getOverscaledTileIDFromLngLatZoom(t,a);return this.getElevation(s,c%u.a6,f%u.a6,u.a6)}getElevationForLngLat(t,a){let s=la(a,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),c=0;for(let f of s)f.canonical.z>c&&(c=Math.min(f.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,c)}getElevation(t,a,s,c=u.a6){return this.getDEMElevation(t,a,s,c)*this.exaggeration}getTerrainData(t){var a,s;if(!this._emptyDemTexture){let y=this.painter.context,b=new u.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new u.T(y,b,y.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new u.T(y,new u.R({width:1,height:1}),y.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(y.gl.NEAREST,y.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=u.ap([])}let c=this.tileManager.getSourceTile(t,!0);if(c?.dem&&(!c.demTexture||c.needsTerrainPrepare)){let y=this.painter.context;c.demTexture=this.painter.getTileTexture(c.dem.stride),c.demTexture?c.demTexture.update(c.dem.getPixels(),{premultiply:!1}):c.demTexture=new u.T(y,c.dem.getPixels(),y.gl.RGBA,{premultiply:!1}),c.demTexture.bind(y.gl.NEAREST,y.gl.CLAMP_TO_EDGE),c.needsTerrainPrepare=!1}let f=c&&c.toString()+c.tileID.key+t.key;if(f&&!this._demMatrixCache[f]){let y=this.tileManager.getSource().maxzoom,b=t.canonical.z-c.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=y?b=t.canonical.z-y:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let w=t.canonical.x-(t.canonical.x>>b<<b),S=t.canonical.y-(t.canonical.y>>b<<b),P=u.cE(new Float64Array(16),[1/(u.a6<<b),1/(u.a6<<b),0]);u.Q(P,P,[w*u.a6,S*u.a6,0]),this._demMatrixCache[f]={matrix:P,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:((a=c?.dem)===null||a===void 0?void 0:a.dim)||1,u_terrain_matrix:f?this._demMatrixCache[f].matrix:this._emptyDemMatrix,u_terrain_unpack:((s=c?.dem)===null||s===void 0?void 0:s.getUnpackVector())||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(c?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:c}}getFramebuffer(t){let a=this.painter,s=a.width/devicePixelRatio,c=a.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===c||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new u.T(a.context,{width:s,height:c,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new u.T(a.context,{width:s,height:c,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=a.context.createFramebuffer(s,c,!0,!1),this._fbo.depthAttachment.set(a.context.createRenderbuffer(a.context.gl.DEPTH_COMPONENT16,s,c))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let a=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let f=0,y=0;f<this._coordsTextureSize;f++)for(let b=0;b<this._coordsTextureSize;b++,y+=4)a[y+0]=255&b,a[y+1]=255&f,a[y+2]=b>>8<<4|f>>8,a[y+3]=0;let s=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),c=new u.T(t,s,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();let a=new Uint8Array(4),s=this.painter.context,c=s.gl,f=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),b=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(f,b-y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,a),s.bindFramebuffer.set(null);let w=a[0]+(a[2]>>4<<8),S=a[1]+((15&a[2])<<8),P=this.coordsIndex[255-a[3]],A=P&&this.tileManager.getTileByID(P);if(!A)return null;let k=this._coordsTextureSize,R=(1<<A.tileID.canonical.z)*k;return new u.a7((A.tileID.canonical.x*k+w)/R+A.tileID.wrap,(A.tileID.canonical.y*k+S)/R,this.getElevation(A.tileID,w,S,k))}depthAtPoint(t){let a=new Uint8Array(4),s=this.painter.context,c=s.gl;return s.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,a),s.bindFramebuffer.set(null),(a[0]/16777216+a[1]/65536+a[2]/256+a[3])/256}getTerrainMesh(t){var a;let s=((a=this.painter.style.projection)===null||a===void 0?void 0:a.transitionState)>0,c=s&&t.canonical.y===0,f=s&&t.canonical.y===(1<<t.canonical.z)-1,y=`m_${c?"n":""}_${f?"s":""}`;if(this._meshCache[y])return this._meshCache[y];let b=this.painter.context,w=new u.cF,S=new u.aW,P=this.meshSize,A=u.a6/P,k=P*P;for(let J=0;J<=P;J++)for(let le=0;le<=P;le++)w.emplaceBack(le*A,J*A,0);for(let J=0;J<k;J+=P+1)for(let le=0;le<P;le++)S.emplaceBack(le+J,P+le+J+1,P+le+J+2),S.emplaceBack(le+J,P+le+J+2,le+J+1);let R=w.length,V=R+(P+1),q=(P+1)*P,H=c?u.bq:0,Z=c?0:1,Y=f?u.br:u.a6,ie=f?0:1;for(let J=0;J<=P;J++)w.emplaceBack(J*A,H,Z);for(let J=0;J<=P;J++)w.emplaceBack(J*A,Y,ie);for(let J=0;J<P;J++)S.emplaceBack(q+J,V+J,V+J+1),S.emplaceBack(q+J,V+J+1,q+J+1),S.emplaceBack(0+J,R+J+1,R+J),S.emplaceBack(0+J,0+J+1,R+J+1);let X=w.length,W=X+2*(P+1);for(let J of[0,1])for(let le=0;le<=P;le++)for(let me of[0,1])w.emplaceBack(J*u.a6,le*A,me);for(let J=0;J<2*P;J+=2)S.emplaceBack(X+J,X+J+1,X+J+3),S.emplaceBack(X+J,X+J+3,X+J+2),S.emplaceBack(W+J,W+J+3,W+J+1),S.emplaceBack(W+J,W+J+2,W+J+3);let te=new ha(b.createVertexBuffer(w,In.members),b.createIndexBuffer(S),u.aV.simpleSegment(0,0,w.length,S.length));return this._meshCache[y]=te,te}getMeshFrameDelta(t){return 2*Math.PI*u.bD/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,a){var s;if(!u.cD(a,t.wrap()))return 0;let{tileID:c}=this._getOverscaledTileIDFromLngLatZoom(t,a);return(s=this.getMinMaxElevation(c).minElevation)!==null&&s!==void 0?s:0}getMinMaxElevation(t){let a=this.getTerrainData(t).tile,s={minElevation:null,maxElevation:null};return a?.dem&&(s.minElevation=a.dem.min*this.exaggeration,s.maxElevation=a.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(t,a){let s=u.a7.fromLngLat(t.wrap()),c=(1<<a)*u.a6,f=s.x*c,y=s.y*c,b=Math.floor(f/u.a6),w=Math.floor(y/u.a6);return{tileID:new u.a3(a,0,a,b,w),mercatorX:f,mercatorY:y}}}class uc{constructor(t,a,s){this._context=t,this._size=a,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let a=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new u.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.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),a.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),a.colorAttachment.set(s.texture),{id:t,fbo:a,texture:s,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((a=>t.id!==a)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}let Na={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class zn{constructor(t,a){this.painter=t,this.terrain=a,this.pool=new uc(t.context,30,a.tileManager.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,a){var s,c,f;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((y=>!t._layers[y].isHidden(a))),this._coordsAscending={};for(let y in t.tileManagers){this._coordsAscending[y]={};let b=t.tileManagers[y].getVisibleCoordinates(),w=t.tileManagers[y].getSource(),S=w instanceof Ur?w.terrainTileRanges:null;for(let P of b){let A=this.terrain.tileManager.getTerrainCoords(P,S);for(let k in A)(f=this._coordsAscending[y])[k]||(f[k]=[]),this._coordsAscending[y][k].push(A[k])}}this._rttFingerprints={};for(let y of t._order){let b=t._layers[y],w=b.source;if(Na[b.type]&&!this._rttFingerprints[w]){this._rttFingerprints[w]={};let S=(c=(s=t.tileManagers[w])===null||s===void 0?void 0:s.getState().revision)!==null&&c!==void 0?c:0;for(let P in this._coordsAscending[w])this._rttFingerprints[w][P]=`${this._coordsAscending[w][P].map((A=>A.key)).sort().join()}#${S}`}}for(let y of this._renderableTiles)for(let b in this._rttFingerprints){let w=this._rttFingerprints[b][y.tileID.key];w&&w!==y.rttFingerprint[b]&&(y.rtt=[])}}renderLayer(t,a){if(t.isHidden(this.painter.transform.zoom))return!1;let s=Object.assign(Object.assign({},a),{isRenderingToTexture:!0}),c=t.type,f=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Na[c]&&(this._prevType&&Na[this._prevType]||this._stacks.push([]),this._prevType=c,this._stacks[this._stacks.length-1].push(t.id),!y))return!0;if(Na[this._prevType]||Na[c]&&y){this._prevType=c;let b=this._stacks.length-1,w=this._stacks[b]||[];for(let S of this._renderableTiles){if(this.pool.isFull()&&(tc(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(S),S.rtt[b]){let A=this.pool.getObjectForId(S.rtt[b].id);if(A.stamp===S.rtt[b].stamp){this.pool.useObject(A);continue}}let P=this.pool.getOrCreateFreeObject();this.pool.useObject(P),this.pool.stampObject(P),S.rtt[b]={id:P.id,stamp:P.stamp},f.context.bindFramebuffer.set(P.fbo.framebuffer),f.context.clear({color:u.bo.transparent,stencil:0}),f.currentStencilSource=void 0;for(let A of w){let k=f.style._layers[A],R=k.source?this._coordsAscending[k.source][S.tileID.key]:[S.tileID];f.context.viewport.set([0,0,P.fbo.width,P.fbo.height]),f._renderTileClippingMasks(k,R,!0),f.renderLayer(f,f.style.tileManagers[k.source],k,R,s),k.source&&(S.rttFingerprint[k.source]=this._rttFingerprints[k.source][S.tileID.key])}}return tc(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects(),Na[c]}return!1}}let hc={"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":"Drag to rotate map, click to reset 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 \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},dc=se,qs={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:jo,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,maxTileCacheSize:null,maxTileCacheZoomLevels:u.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,anisotropicFilterPitch:20},Gs=class extends $h{get _ownerWindow(){var d,t;return((t=(d=this._container)===null||d===void 0?void 0:d.ownerDocument)===null||t===void 0?void 0:t.defaultView)||window}constructor(d){var t,a,s;let c=Object.assign(Object.assign(Object.assign({},qs),d),{canvasContextAttributes:Object.assign(Object.assign({},qs.canvasContextAttributes),d.canvasContextAttributes)});if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");let f=new _a,y=new Po;c.minZoom!==void 0&&f.setMinZoom(c.minZoom),c.maxZoom!==void 0&&f.setMaxZoom(c.maxZoom),c.minPitch!==void 0&&f.setMinPitch(c.minPitch),c.maxPitch!==void 0&&f.setMaxPitch(c.maxPitch),c.renderWorldCopies!==void 0&&f.setRenderWorldCopies(c.renderWorldCopies),c.transformConstrain!==null&&f.setConstrainOverride(c.transformConstrain),super(f,y,{bearingSnap:c.bearingSnap,zoomSnap:c.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Au,this._controls=[],this._mapId=u.ad(),this._lostContextStyle={style:null,images:null},this._contextLost=w=>{if(w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let S of Object.values(this.style._layers))if(S.type==="custom"&&console.warn(`Custom layer with id '${S.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),S._listeners)for(let[P]of Object.entries(S._listeners))console.warn(`Custom layer with id '${S.id}' had event listeners for event '${P}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new u.n("webglcontextlost",{originalEvent:w}))}else this.fire(new u.n("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new u.n("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},c.canvasContextAttributes),this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._zoomSnap=c.zoomSnap,this._centerClampedToGround=c.centerClampedToGround,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},hc),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this._zoomLevelsToOverscale=c.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=c.transformCameraUpdate,this.transformConstrain=c.transformConstrain,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(c.anisotropicFilterPitch),c.reduceMotion!==void 0&&(ut.prefersReducedMotion=c.reduceMotion),this._imageQueueHandle=Xe.addThrottleControl((()=>this.isMoving())),this._requestManager=new K(c.transformRequest),this._container=this._resolveContainer(c.container),c.maxBounds&&this.setMaxBounds(c.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.depthDirty=!0,this._update(!0)})),this.once("idle",(()=>this._idleTriggered=!0)),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Zh(this,c),this._hash=c.hash?new wu(typeof c.hash=="string"&&c.hash||void 0).addTo(this):void 0,!((t=this._hash)===null||t===void 0)&&t._onHashChange()||(this.jumpTo({center:c.center,elevation:c.elevation,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,roll:c.roll}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,u.e({},c.fitBoundsOptions,{duration:0}))));let b=typeof c.style=="string"||((s=(a=c.style)===null||a===void 0?void 0:a.projection)===null||s===void 0?void 0:s.type)!=="globe";this.resize(null,b),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new ri(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new fi,c.logoPosition),this.on("style.load",(()=>{if(b||this._resizeTransform(),this.transform.unmodified){let w=u.V(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}})),this.on("data",(w=>{this._update(w.dataType==="style"),this.fire(new u.n(`${w.dataType}data`,w))})),this.on("dataloading",(w=>{this.fire(new u.n(`${w.dataType}dataloading`,w))})),this.on("dataabort",(w=>{this.fire(new u.n("sourcedataabort",w))}))}_getMapId(){return this._mapId}setGlobalStateProperty(d,t){return this.style.setGlobalStateProperty(d,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d?.onAdd)return this.fire(new u.l(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let a=d.onAdd(this);this._controls.push(d);let s=this._controlPositions[t];return t.includes("bottom")?s.insertBefore(a,s.firstChild):s.appendChild(a),this}removeControl(d){if(!d?.onRemove)return this.fire(new u.l(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.includes(d)}coveringTiles(d){return la(this.transform,d)}calculateCameraOptionsFromTo(d,t,a,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLat(a,this.transform)),super.calculateCameraOptionsFromTo(d,t,a,s)}resize(d,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let a=!this._moving;return a&&(this.stop(),this.fire(new u.n("movestart",d)).fire(new u.n("move",d))),this.fire(new u.n("resize",d)),a&&this.fire(new u.n("moveend",d)),this}_resizeInternal(d=!0){let[t,a]=this._containerDimensions(),s=this._getClampedPixelRatio(t,a);if(this._resizeCanvas(t,a,s),this.painter.resize(t,a,s),this.painter.overLimit()){let c=this.painter.context.gl;this._maxCanvasSize=[c.drawingBufferWidth,c.drawingBufferHeight];let f=this._getClampedPixelRatio(t,a);this._resizeCanvas(t,a,f),this.painter.resize(t,a,f)}this._resizeTransform(d)}_resizeTransform(d=!0){var t;let[a,s]=this._containerDimensions();this.transform.resize(a,s,d),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,s,d)}_getClampedPixelRatio(d,t){let{0:a,1:s}=this._maxCanvasSize,c=this.getPixelRatio(),f=d*c,y=t*c;return Math.min(f>a?a/f:1,y>s?s/y:1)*c}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Pt.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom){let t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMinZoom(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new u.n("zoomstart")).fire(new u.n("zoom")).fire(new u.n("zoomend")).fire(new u.n("movestart")).fire(new u.n("move")).fire(new u.n("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d??22)>=this.transform.minZoom){let t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMaxZoom(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new u.n("zoomstart")).fire(new u.n("zoom")).fire(new u.n("zoomend")).fire(new u.n("movestart")).fire(new u.n("move")).fire(new u.n("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch){let t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMinPitch(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new u.n("pitchstart")).fire(new u.n("pitch")).fire(new u.n("pitchend")).fire(new u.n("movestart")).fire(new u.n("move")).fire(new u.n("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(d>=this.transform.minPitch){let t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMaxPitch(d),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new u.n("pitchstart")).fire(new u.n("pitch")).fire(new u.n("pitchend")).fire(new u.n("movestart")).fire(new u.n("move")).fire(new u.n("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(d){if((d=d??20)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(d<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=d,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.setRenderWorldCopies(d),this._update()}setTransformConstrain(d){return this.transform.setConstrainOverride(d),this._update()}project(d){return this.transform.locationToScreenPoint(u.W.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.screenPointToLocation(u.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,a){if(d==="mouseenter"||d==="mouseover"){let s=!1;return{layers:t,listener:a,delegates:{mousemove:f=>{let y=t.filter((w=>this.getLayer(w))),b=y.length!==0?this.queryRenderedFeatures(f.point,{layers:y}):[];b.length?s||(s=!0,a.call(this,new Mi(d,this,f.originalEvent,{features:b}))):s=!1},mouseout:()=>{s=!1}}}}if(d==="mouseleave"||d==="mouseout"){let s=!1;return{layers:t,listener:a,delegates:{mousemove:y=>{let b=t.filter((w=>this.getLayer(w)));(b.length!==0?this.queryRenderedFeatures(y.point,{layers:b}):[]).length?s=!0:s&&(s=!1,a.call(this,new Mi(d,this,y.originalEvent)))},mouseout:y=>{s&&(s=!1,a.call(this,new Mi(d,this,y.originalEvent)))}}}}{let s=c=>{let f=t.filter((b=>this.getLayer(b))),y=f.length!==0?this.queryRenderedFeatures(c.point,{layers:f}):[];y.length&&(c.features=y,a.call(this,c),delete c.features)};return{layers:t,listener:a,delegates:{[d]:s}}}}_saveDelegatedListener(d,t){var a;this._delegatedListeners||(this._delegatedListeners={}),(a=this._delegatedListeners)[d]||(a[d]=[]),this._delegatedListeners[d].push(t)}_removeDelegatedListener(d,t,a){var s;if(!(!((s=this._delegatedListeners)===null||s===void 0)&&s[d]))return;let c=this._delegatedListeners[d];for(let f=0;f<c.length;f++){let y=c[f];if(y.listener===a&&y.layers.length===t.length&&y.layers.every((b=>t.includes(b)))){for(let b in y.delegates)this.off(b,y.delegates[b]);return void c.splice(f,1)}}}on(d,t,a){if(a===void 0)return super.on(d,t);let s=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,s,a);this._saveDelegatedListener(d,c);for(let f in c.delegates)this.on(f,c.delegates[f]);return{unsubscribe:()=>{this._removeDelegatedListener(d,s,a)}}}once(d,t,a){if(a===void 0)return super.once(d,t);let s=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,s,a);for(let f in c.delegates){let y=c.delegates[f];c.delegates[f]=(...b)=>{this._removeDelegatedListener(d,s,a),y(...b)}}this._saveDelegatedListener(d,c);for(let f in c.delegates)this.once(f,c.delegates[f]);return this}off(d,t,a){return a===void 0?super.off(d,t):(this._removeDelegatedListener(d,typeof t=="string"?[t]:t,a),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let a,s=d instanceof u.P||Array.isArray(d),c=s?d:[[0,0],[this.transform.width,this.transform.height]];if(t||(t=(s?{}:d)||{}),c instanceof u.P||typeof c[0]=="number")a=[u.P.convert(c)];else{let f=u.P.convert(c[0]),y=u.P.convert(c[1]);a=[f,new u.P(y.x,f.y),y,new u.P(f.x,y.y),f]}return this.style.queryRenderedFeatures(a,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=u.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){let t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){var a,s,c;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(d,t)));let f=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new kl(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,f):this.style.loadJSON(d,t,f),this):(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),(c=(s=this.style)===null||s===void 0?void 0:s.projection)===null||c===void 0||c.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new kl(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){return u._(this,void 0,void 0,(function*(){var a;if((a=this._diffStyleRequest)===null||a===void 0||a.abort(),typeof d=="string"){let s=d;this._diffStyleRequest=new AbortController;let c=this._diffStyleRequest;try{let f=yield this._requestManager.transformRequest(s,"Style");if(c.signal.aborted)return void(this._diffStyleRequest=null);let y=yield u.k(f,c);this._diffStyleRequest=null,this._updateDiff(y.data,t)}catch(f){this._diffStyleRequest=null,u.$(f)||this.fire(new u.l(u.d(f)))}}else typeof d=="object"&&(this._diffStyleRequest=null,this._updateDiff(d,t))}))}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(a){u.w(`Unable to perform style diff: ${u.d(a).message}. Rebuilding the style from scratch.`),this._updateStyle(d,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(){if(this.style)return this.style.loaded();u.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){var t;let a=(t=this.style)===null||t===void 0?void 0:t.tileManagers[d];if(a!==void 0)return a.loaded();this.fire(new u.l(new Error(`There is no tile manager with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){let t=this.style.tileManagers[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&t.reload();for(let a in this.style._layers){let s=this.style._layers[a];s.type==="hillshade"&&s.source===d.source&&u.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."),s.type==="color-relief"&&s.source===d.source&&u.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 cc(this.painter,t,d),this.painter.renderToTexture=new zn(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=a=>{var s;a.dataType==="style"?this.terrain.tileManager.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==d.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))),((s=a.source)===null||s===void 0?void 0:s.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(a.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),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 u.n("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){var d;let t=(d=this.style)===null||d===void 0?void 0:d.tileManagers;for(let a of Object.values(t))if(!a.areTilesLoaded())return!1;return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}setSourceTileLodParams(d,t,a){if(a){let s=this.getSource(a);if(!s)throw new Error(`There is no source with ID "${a}", cannot set LOD parameters`);s.calculateTileZoom=ho(Math.max(1,d),Math.max(1,t))}else for(let s in this.style.tileManagers)this.style.tileManagers[s].getSource().calculateTileZoom=ho(Math.max(1,d),Math.max(1,t));return this._update(!0),this}refreshTiles(d,t){let a=this.style.tileManagers[d];if(!a)throw new Error(`There is no tile manager with ID "${d}", cannot refresh tile`);t===void 0?a.reload(!0):a.refreshTiles(t.map((s=>new u.aa(s.z,s.x,s.y))))}addImage(d,t,a={}){let{pixelRatio:s=1,sdf:c=!1,stretchX:f,stretchY:y,content:b,textFitWidth:w,textFitHeight:S}=a;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||u.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new u.l(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`")));{let{width:P,height:A,data:k}=t,R=t;return this.style.addImage(d,{data:new u.R({width:P,height:A},new Uint8Array(k)),pixelRatio:s,stretchX:f,stretchY:y,content:b,textFitWidth:w,textFitHeight:S,sdf:c,version:0,userImage:R}),R.onAdd&&R.onAdd(this,d),this}}{let{width:P,height:A,data:k}=ut.getImageData(t);this.style.addImage(d,{data:new u.R({width:P,height:A},k),pixelRatio:s,stretchX:f,stretchY:y,content:b,textFitWidth:w,textFitHeight:S,sdf:c,version:0})}}updateImage(d,t){let a=this.style.getImage(d);if(!a)return this.fire(new u.l(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let s=t instanceof HTMLImageElement||u.b(t)?ut.getImageData(t):t,{width:c,height:f,data:y}=s;if(c===void 0||f===void 0)return this.fire(new u.l(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(c!==a.data.width||f!==a.data.height)return this.fire(new u.l(new Error("The width and height of the updated image must be that same as the previous version of the image")));let b=!(t instanceof HTMLImageElement||u.b(t));return a.data.replace(y,b),this.style.updateImage(d,a),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new u.l(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return u._(this,void 0,void 0,(function*(){return Xe.getImage(yield this._requestManager.transformRequest(d,"Image"),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,a){return this.style.setLayerZoomRange(d,t,a),this._update(!0)}setFilter(d,t,a={}){return this.style.setFilter(d,t,a),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,a,s={}){return this.style.setPaintProperty(d,t,a,s),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,a,s={}){return this.style.setLayoutProperty(d,t,a,s),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,a,(s=>{s||this._update(!0)})),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,(a=>{a||this._update(!0)})),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(d,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupResizeObserver(){var d;let t=!1,a=$r((c=>{this._trackResize&&!this._removed&&(this.resize(c),this.redraw())}),50),s=(d=this._ownerWindow.ResizeObserver)!==null&&d!==void 0?d:ResizeObserver;this._resizeObserver=new s((c=>{t?a(c):t=!0})),this._resizeObserver.observe(this._container)}_resolveContainer(d){if(typeof d=="string"){let t=document.getElementById(d);if(!t)throw new Error(`Container '${d}' not found.`);return t}if(d instanceof HTMLElement||d&&typeof d=="object"&&d.nodeType===1)return d;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let d=this._container;d.classList.add("maplibregl-map");let t=this._canvasContainer=Se.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=Se.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","region");let a=this._containerDimensions(),s=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],s);let c=this._controlContainer=Se.create("div","maplibregl-control-container",d),f=this._controlPositions={};for(let y of["top-left","top-right","bottom-left","bottom-right"])f[y]=Se.create("div",`maplibregl-ctrl-${y} `,c);this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,t,a){this._canvas.width=Math.floor(a*d),this._canvas.height=Math.floor(a*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let d=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{t={requestedAttributes:d},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});let a=null;if(a=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,d):this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d),!a){let s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new yn(a,this.transform)}migrateProjection(d,t){super.migrateProjection(d,t),this.painter.transform=d,this.fire(new u.n("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){var t;return!((t=this.style)===null||t===void 0)&&t._loaded?(this._styleDirty||(this._styleDirty=d),this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){var t,a,s,c,f,y;let b=this._idleTriggered?this._fadeDuration:0,w=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let S=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let k=this.transform.zoom,R=ke();this.style.zoomHistory.update(k,R);let V=new u.J(k,{now:R,fadeDuration:b,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),q=V.crossFadingFactor();q===1&&q===this._crossFadingFactor||(S=!0,this._crossFadingFactor=q),this.style.update(V)}let P=((a=this.style.projection)===null||a===void 0?void 0:a.transitionState)>0!==w;(s=this.style.projection)===null||s===void 0||s.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((c=this.style.projection)===null||c===void 0?void 0:c.transitionState,(f=this.style.projection)===null||f===void 0?void 0:f.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||P)&&(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=(y=this.style)===null||y===void 0?void 0:y._updatePlacement(this.transform,this.showCollisionBoxes,b,this._crossSourceCollisions,P),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:b,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new u.n("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new u.n("load"))),this.style&&(this.style.hasTransitions()||S)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let A=this._sourcesDirty||this._styleDirty||this._placementDirty;return A||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.n("idle")),!this._loaded||this._fullyLoaded||A||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d,t;this._hash&&this._hash.remove();for(let s of this._controls)s.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),(d=this._diffStyleRequest)===null||d===void 0||d.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Xe.removeThrottleControl(this._imageQueueHandle),(t=this._resizeObserver)===null||t===void 0||t.disconnect();let a=this.painter.context.gl.getExtension("WEBGL_lose_context");a?.loseContext&&a.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new u.n("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ut.frame(this._frameRequest,(d=>{this._frameRequest=null;try{this._render(d)}catch(t){if(!u.$(t)&&!(function(a){return a.message===Ms})(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return dc}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(d){return this._lazyInitEmptyStyle(),this.style.setProjection(d),this._update(!0)}},pc={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class fc{constructor(t,a,s=!1){this.mousedown=f=>{this.startMove(f,Se.mousePos(this.element,f)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=f=>{this.move(f,Se.mousePos(this.element,f))},this.mouseup=f=>{this._rotatePitchHandler.dragEnd(f),this.offTemp()},this.touchstart=f=>{f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Se.touchPos(this.element,f.targetTouches)[0],this.startMove(f,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend))},this.touchmove=f=>{f.targetTouches.length!==1?this.reset():(this._lastPos=Se.touchPos(this.element,f.targetTouches)[0],this.move(f,this._lastPos))},this.touchend=f=>{f.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=a;let c=new Uh;this._rotatePitchHandler=new Ya({clickTolerance:3,move:(f,y)=>{let b=a.getBoundingClientRect(),w=new u.P((b.bottom-b.top)/2,(b.right-b.left)/2);return{bearingDelta:u.cx(new u.P(f.x,y.y),y,w),pitchDelta:s?-.5*(y.y-f.y):void 0}},moveStateManager:c,enable:!0,assignEvents:()=>{}}),this.map=t,a.addEventListener("mousedown",this.mousedown),a.addEventListener("touchstart",this.touchstart,{passive:!1}),a.addEventListener("touchcancel",this.reset)}startMove(t,a){this._rotatePitchHandler.dragStart(t,a),Se.disableDrag()}move(t,a){let s=this.map,{bearingDelta:c,pitchDelta:f}=this._rotatePitchHandler.dragMove(t,a)||{};c&&s.setBearing(s.getBearing()+c),f&&s.setPitch(s.getPitch()+f)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Se.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}}let ba;function Zs(d,t,a,s=!1){if(s||!a.getCoveringTilesDetailsProvider().allowWorldCopies())return d?.wrap();let c=new u.W(d.lng,d.lat);if(d=new u.W(d.lng,d.lat),t){let f=new u.W(d.lng-360,d.lat),y=new u.W(d.lng+360,d.lat),b=a.locationToScreenPoint(d).distSqr(t);a.locationToScreenPoint(f).distSqr(t)<b?d=f:a.locationToScreenPoint(y).distSqr(t)<b&&(d=y)}for(;Math.abs(d.lng-a.center.lng)>180;){let f=a.locationToScreenPoint(d);if(f.x>=0&&f.y>=0&&f.x<=a.width&&f.y<=a.height)break;d.lng>a.center.lng?d.lng-=360:d.lng+=360}return d.lng!==c.lng&&a.isPointOnMapSurface(a.locationToScreenPoint(d))?d:c}let An={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 kn(d,t,a){let s=d.classList;for(let c in An)s.remove(`maplibregl-${a}-anchor-${c}`);s.add(`maplibregl-${a}-anchor-${t}`)}class Dn extends u.E{constructor(t){if(super(),this._onClick=a=>{this.fire(new u.n("click",{originalEvent:a}))},this._onKeyPress=a=>{a.code!=="Space"&&a.code!=="Enter"||this.togglePopup()},this._onMapClick=a=>{let s=a.originalEvent.target,c=this._element;this._popup&&(s===c||c.contains(s))&&this.togglePopup()},this._update=a=>{if(!this._map)return;let s=this._map.loaded()&&!this._map.isMoving();(a?.type==="terrain"||a?.type==="render"&&!s)&&this._map.once("render",this._update),this._lngLat=Zs(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 c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let f="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?f="rotateX(0deg)":this._pitchAlignment==="map"&&(f=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),this._element.style.transform=`${An[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${f} ${c}`,ut.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(a?.type==="moveend")})).catch((()=>{}))},this._onMove=a=>{if(!this._isDragging){let s=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=a.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 u.n("dragstart"))),this.fire(new u.n("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 u.n("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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?.anchor||"center",this._color=t?.color||"#3FB1CE",this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=u.P.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=Se.create("div");let a=Se.createNS("http://www.w3.org/2000/svg","svg"),s=41,c=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${s}px`),a.setAttributeNS(null,"width",`${c}px`),a.setAttributeNS(null,"viewBox",`0 0 ${c} ${s}`);let f=Se.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");let y=Se.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");let b=Se.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(3.0, 29.0)"),b.setAttributeNS(null,"fill","#000000");let w=[{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(let Z of w){let Y=Se.createNS("http://www.w3.org/2000/svg","ellipse");Y.setAttributeNS(null,"opacity","0.04"),Y.setAttributeNS(null,"cx","10.5"),Y.setAttributeNS(null,"cy","5.80029008"),Y.setAttributeNS(null,"rx",Z.rx),Y.setAttributeNS(null,"ry",Z.ry),b.appendChild(Y)}let S=Se.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);let P=Se.createNS("http://www.w3.org/2000/svg","path");P.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"),S.appendChild(P);let A=Se.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"opacity","0.25"),A.setAttributeNS(null,"fill","#000000");let k=Se.createNS("http://www.w3.org/2000/svg","path");k.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"),A.appendChild(k);let R=Se.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(6.0, 7.0)"),R.setAttributeNS(null,"fill","#FFFFFF");let V=Se.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(8.0, 8.0)");let q=Se.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");let H=Se.createNS("http://www.w3.org/2000/svg","circle");H.setAttributeNS(null,"fill","#FFFFFF"),H.setAttributeNS(null,"cx","5.5"),H.setAttributeNS(null,"cy","5.5"),H.setAttributeNS(null,"r","5.4999962"),V.appendChild(q),V.appendChild(H),y.appendChild(b),y.appendChild(S),y.appendChild(A),y.appendChild(R),y.appendChild(V),a.appendChild(y),a.setAttributeNS(null,"height",s*this._scale+"px"),a.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(a),this._offset=u.P.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(a=>{a.preventDefault()})),this._element.addEventListener("mousedown",(a=>{a.preventDefault()})),kn(this._element,this._anchor,"marker"),t?.className)for(let a of t.className.split(" "))this._element.classList.add(a);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._element.addEventListener("click",this._onClick),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),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=u.W.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)){let c=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":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],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(){let 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 a,s;let c=(a=this._map)===null||a===void 0?void 0:a.terrain,f=this._map.transform.isLocationOccluded(this._lngLat);if(!c||f){let R=f?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==R&&(this._element.style.opacity=R,this._element.classList.toggle("maplibregl-marker-covered",f)))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let y=this._map,b=y.terrain.depthAtPoint(this._pos),w=y.terrain.getElevationForLngLat(this._lngLat,y.transform);if(y.transform.lngLatToCameraDepth(this._lngLat,w)-b<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove("maplibregl-marker-covered");let S=-this._offset.y/y.transform.pixelsPerMeter,P=Math.sin(y.getPitch()*Math.PI/180)*S,A=y.terrain.depthAtPoint(new u.P(this._pos.x,this._pos.y-this._offset.y)),k=y.transform.lngLatToCameraDepth(this._lngLat,w+P)-A>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&k&&this._popup.remove(),this._element.style.opacity=k?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",k)}getOffset(){return this._offset}setOffset(t){return this._offset=u.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,a){return(this._opacity===void 0||t===void 0&&a===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=String(t)),a!==void 0&&(this._opacityWhenCovered=String(a)),this._map&&this._updateOpacity(!0),this}}let mc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ka=0,Ja=!1,gc={maxWidth:100,unit:"metric"};function $s(d,t,a){let s=a?.maxWidth||100,c=d._container.clientHeight/2,f=d._container.clientWidth/2,y=d.unproject([f-s/2,c]),b=d.unproject([f+s/2,c]),w=Math.round(d.project(b).x-d.project(y).x),S=Math.min(s,w,d._container.clientWidth),P=y.distanceTo(b);if(a?.unit==="imperial"){let A=3.2808*P;A>5280?Qa(t,S,A/5280,d._getUIString("ScaleControl.Miles")):Qa(t,S,A,d._getUIString("ScaleControl.Feet"))}else a?.unit==="nautical"?Qa(t,S,P/1852,d._getUIString("ScaleControl.NauticalMiles")):P>=1e3?Qa(t,S,P/1e3,d._getUIString("ScaleControl.Kilometers")):Qa(t,S,P,d._getUIString("ScaleControl.Meters"))}function Qa(d,t,a,s){let c=(function(f){let y=Math.pow(10,`${Math.floor(f)}`.length-1),b=f/y;return b=b>=10?10:b>=5?5:b>=3?3:b>=2?2:b>=1?1:(function(w){let S=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*S)/S})(b),y*b})(a);d.style.width=t*(c/a)+"px",d.innerHTML=`${c}&nbsp;${s}`}let _c={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},ku=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function yc(d){if(d){if(typeof d=="number"){let t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,d),"top-left":new u.P(t,t),"top-right":new u.P(-t,t),bottom:new u.P(0,-d),"bottom-left":new u.P(t,-t),"bottom-right":new u.P(-t,-t),left:new u.P(d,0),right:new u.P(-d,0)}}if(d instanceof u.P||Array.isArray(d)){let t=u.P.convert(d);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:u.P.convert(d.center||[0,0]),top:u.P.convert(d.top||[0,0]),"top-left":u.P.convert(d["top-left"]||[0,0]),"top-right":u.P.convert(d["top-right"]||[0,0]),bottom:u.P.convert(d.bottom||[0,0]),"bottom-left":u.P.convert(d["bottom-left"]||[0,0]),"bottom-right":u.P.convert(d["bottom-right"]||[0,0]),left:u.P.convert(d.left||[0,0]),right:u.P.convert(d.right||[0,0])}}return yc(new u.P(0,0))}let Du=se;z.AJAXError=u.cG,z.EXTENT=u.a6,z.Event=u.n,z.Evented=u.E,z.LngLat=u.W,z.MercatorCoordinate=u.a7,z.Point=u.P,z.addProtocol=u.cH,z.config=u.c,z.removeProtocol=u.cI,z.AttributionControl=ri,z.BoxZoomHandler=No,z.CanvasSource=Q,z.CooperativeGesturesHandler=Vs,z.DoubleClickZoomHandler=rt,z.DragPanHandler=En,z.DragRotateHandler=tr,z.EdgeInsets=mr,z.FullscreenControl=class extends u.E{constructor(d={}){var t;super(),this._onFullscreenChange=()=>{var a;let s=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((a=s?.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)s=s.shadowRoot.fullscreenElement;s===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(t=d.pseudo)!==null&&t!==void 0&&t,d?.container&&(d.container instanceof HTMLElement?this._container=d.container:u.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(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=Se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let d=this._fullscreenButton=Se.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Se.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_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 u.n("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new u.n("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},z.GeoJSONSource=hr,z.GeolocateControl=class extends u.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new u.n("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_ERROR":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 u.n("geolocate",t)),this._finish()}},this._updateCamera=t=>{let a=new u.W(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,c=this._map.getBearing(),f=u.e({bearing:c},this.options.fitBoundsOptions),y=Pt.fromLngLat(a,s);this._map.fitBounds(y,f,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let a=new u.W(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).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;let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Ja)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.n("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let a=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a||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 u.n("trackuserlocationend")),this.fire(new u.n("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>{t.preventDefault()})),this._geolocateButton=Se.create("button","maplibregl-ctrl-geolocate",this._container),Se.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){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{let a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Se.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Dn({element:this._dotElement}),this._circleElement=Se.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Dn({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",this._onMoveStart)}},this.options=u.e({},mc,d)}onAdd(d){return this._map=d,this._container=Se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return u._(this,arguments,void 0,(function*(t=!1){if(ba!==void 0&&!t)return ba;if(window.navigator.permissions===void 0)return ba=!!window.navigator.geolocation,ba;try{ba=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ba=!!window.navigator.geolocation}return ba}))})().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(),this._container.remove(),this._map.off("movestart",this._onMoveStart),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,Ka=0,Ja=!1}_isOutOfMapMaxBounds(d){let t=this._map.getMaxBounds(),a=d.coords;return t&&(a.longitude<t.getWest()||a.longitude>t.getEast()||a.latitude<t.getSouth()||a.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",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(){let d=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&d))return;let t=this._map.project(d),a=this._map.unproject([t.x+100,t.y]),s=d.distanceTo(a)/100,c=2*this._accuracy/s;this._circleElement.style.width=`${c.toFixed(2)}px`,this._circleElement.style.height=`${c.toFixed(2)}px`}trigger(){if(!this._setup)return u.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 u.n("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ka--,Ja=!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 u.n("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 u.n("trackuserlocationstart")),this.fire(new u.n("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 d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ka++,Ka>1?(d={maximumAge:6e5,timeout:0},Ja=!0):(d=this.options.positionOptions,Ja=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}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)}},z.GlobeControl=class{constructor(){this._toggleProjection=()=>{var d;let t=(d=this._map.getProjection())===null||d===void 0?void 0:d.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var d;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((d=this._map.getProjection())===null||d===void 0?void 0:d.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(d){return this._map=d,this._container=Se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=Se.create("button","maplibregl-ctrl-globe",this._container),Se.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._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},z.Hash=wu,z.ImageSource=Ur,z.KeyboardHandler=nc,z.LngLatBounds=Pt,z.LogoControl=fi,z.Map=Gs,z.MapLibreMap=Gs,z.MapMouseEvent=Mi,z.MapTouchEvent=Ne,z.MapWheelEvent=ic,z.Marker=Dn,z.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{let t=this._map.getZoom(),a=t===this._map.getMaxZoom(),s=t===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.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,a)=>{let s=this._map._getUIString(`NavigationControl.${a}`);t.title=s,t.setAttribute("aria-label",s)},this.options=u.e({},pc,d),this._container=Se.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}))),Se.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}))),Se.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=Se.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,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 fc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),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(d,t){let a=Se.create("button",d,this._container);return a.type="button",a.addEventListener("click",t),a}},z.Popup=class extends u.E{constructor(d){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&&this._content.remove(),this._container&&(this._container.remove(),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("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new u.n("close"))),this),this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=Se.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Se.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let b of this.options.className.split(" "))this._container.classList.add(b);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}let a;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Zs(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),t&&"point"in t&&t.point&&(a=t.point),this._trackPointer&&!a)return;let s=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationToScreenPoint(this._lngLat));let c=this.options.anchor,f=yc(this.options.offset);if(!c){let b=this._container.offsetWidth,w=this._container.offsetHeight,S=(function(A){var k,R,V,q;return A?{top:(k=A.top)!==null&&k!==void 0?k:0,right:(R=A.right)!==null&&R!==void 0?R:0,bottom:(V=A.bottom)!==null&&V!==void 0?V:0,left:(q=A.left)!==null&&q!==void 0?q:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding),P;P=s.y+f.bottom.y<w+S.top?["top"]:s.y>this._map.transform.height-w-S.bottom?["bottom"]:[],s.x<b/2+S.left?P.push("left"):s.x>this._map.transform.width-b/2-S.right&&P.push("right"),c=P.length===0?"bottom":P.join("-")}let y=s.add(f[c]);this.options.subpixelPositioning||(y=y.round()),this._container.style.transform=`${An[c]} translate(${y.x}px,${y.y}px)`,kn(this._container,c,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(_c),d)}addTo(d){return this._map&&this.remove(),this._map=d,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._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),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 u.n("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=u.W.convert(d),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),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._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){let t=document.createDocumentFragment(),a=document.createElement("body"),s;for(a.innerHTML=d;s=a.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Se.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){return this._container&&this._container.classList.add(d),this}removeClassName(d){return this._container&&this._container.classList.remove(d),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}setSubpixelPositioning(d){this.options.subpixelPositioning=d}setPadding(d){this.options.padding=d,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=Se.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let d=this._container.querySelector(ku);d&&d.focus()}},z.RasterDEMTileSource=Sr,z.RasterTileSource=Ai,z.ScaleControl=class{constructor(d){this._onMove=()=>{$s(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,$s(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},gc),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=Se.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},z.ScrollZoomHandler=Ke,z.Style=kl,z.TerrainControl=class{constructor(d){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=d}onAdd(d){return this._map=d,this._container=Se.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Se.create("button","maplibregl-ctrl-terrain",this._container),Se.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(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},z.TwoFingersTouchPitchHandler=oc,z.TwoFingersTouchRotateHandler=Pn,z.TwoFingersTouchZoomHandler=Cu,z.TwoFingersTouchZoomRotateHandler=sc,z.VectorTileSource=ur,z.VideoSource=Ga,z.addSourceType=(d,t)=>u._(void 0,void 0,void 0,(function*(){if(ae(d))throw new Error(`A source type called "${d}" already exists.`);((a,s)=>{we[a]=s})(d,t)})),z.clearPrewarmedResources=function(){let d=Xt;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(hi),Xt=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()"))},z.createTileMesh=gr,z.getGlobalDispatcher=_t,z.getMaxParallelImageRequests=function(){return u.c.MAX_PARALLEL_IMAGE_REQUESTS},z.getRTLTextPluginStatus=function(){return Re().getRTLTextPluginStatus()},z.getVersion=function(){return Du},z.getWorkerCount=function(){return ht.workerCount},z.getWorkerUrl=function(){return u.c.WORKER_URL},z.importScriptInWorkers=function(d){return _t().broadcast("IS",d)},z.isTimeFrozen=function(){return Ue.isFrozen()},z.now=ke,z.prewarm=function(){di().acquire(hi)},z.restoreNow=function(){Ue.restoreNow()},z.setMaxParallelImageRequests=function(d){u.c.MAX_PARALLEL_IMAGE_REQUESTS=d},z.setNow=function(d){Ue.setNow(d)},z.setRTLTextPlugin=function(d,t){return Re().setRTLTextPlugin(d,t)},z.setWorkerCount=function(d){ht.workerCount=d},z.setWorkerUrl=function(d){u.c.WORKER_URL=d}}));var $=E;return $}))});var Nc=q_(Hm(),1);var Xm=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%23333' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%2333b5e5' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`;var Ym="gis_add_layer",Km="gis_set_view",yl="\u5929\u5730\u56FE\u5F71\u50CF",Gn="//your-tile-host/api/gis-map-service/world-map-tiles/images/tiandi-image-3857/{z}/{x}/{y}";var Jm="gis_update_layer_style";var ip="/api/gis-workbench/glyphs/{fontstack}/{range}.pbf",Z_=new Set(["fillColor","fillOpacity","lineColor","lineWidth","lineOpacity","circleColor","circleRadius","circleOpacity","lineVisible","circleVisible","categorical","opacity","label"]),$_=new Set(["field","valueMap","fallback","size","color","haloColor","haloWidth","minzoom","maxzoom","allowOverlap","font","anchor","onePerFeature"]);function vl(E,I){if(!E||typeof E!="object"||Array.isArray(E))throw new Error(I+" must be an object")}function qa(E,I,O,$){if(E===void 0)return;let z=typeof E=="number"?E:Number(E);if(!Number.isFinite(z))throw new Error(I+" must be a number");if(z<O||z>$)throw new Error(I+" must be between "+O+" and "+$);return z}function Zn(E,I){if(E===void 0)return;let O=String(E).trim();if(!O||O.length>80||/[\u0000-\u001f;{}]/.test(O))throw new Error(I+" is not a valid color");return O}function nh(E,I){if(E!==void 0){if(typeof E!="boolean")throw new Error(I+" must be a boolean");return E}}function W_(E){if(E===null||E===!1)return null;vl(E,"style.label");for(let $ of Object.keys(E))if(!$_.has($))throw new Error("Unknown style.label key: "+$);let I=String(E.field||"").trim();if(!I)throw new Error("style.label.field is required");if(I.length>80)throw new Error("style.label.field is too long");let O={field:I};if(E.valueMap!==void 0){vl(E.valueMap,"style.label.valueMap");let $=Object.entries(E.valueMap);if($.length>500)throw new Error("style.label.valueMap supports at most 500 entries");O.valueMap={};for(let[z,u]of $)O.valueMap[String(z)]=String(u).slice(0,200)}if(E.fallback!==void 0&&(O.fallback=String(E.fallback).slice(0,200)),E.size!==void 0&&(O.size=qa(E.size,"style.label.size",6,48)),E.color!==void 0&&(O.color=Zn(E.color,"style.label.color")),E.haloColor!==void 0&&(O.haloColor=Zn(E.haloColor,"style.label.haloColor")),E.haloWidth!==void 0&&(O.haloWidth=qa(E.haloWidth,"style.label.haloWidth",0,4)),E.minzoom!==void 0&&(O.minzoom=qa(E.minzoom,"style.label.minzoom",0,24)),E.maxzoom!==void 0&&(O.maxzoom=qa(E.maxzoom,"style.label.maxzoom",0,24)),O.minzoom!==void 0&&O.maxzoom!==void 0&&O.maxzoom<O.minzoom)throw new Error("style.label.maxzoom must be greater than or equal to minzoom");if(E.allowOverlap!==void 0&&(O.allowOverlap=nh(E.allowOverlap,"style.label.allowOverlap")),E.onePerFeature!==void 0&&(O.onePerFeature=nh(E.onePerFeature,"style.label.onePerFeature")),E.font!==void 0){if(!Array.isArray(E.font)||E.font.length===0)throw new Error("style.label.font must be a non-empty array");O.font=E.font.map($=>String($).slice(0,80))}if(E.anchor!==void 0){let $=String(E.anchor);if(!["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"].includes($))throw new Error("Invalid style.label.anchor");O.anchor=$}return O}function H_(E){vl(E,"stylePatch");let I={};for(let O of Object.keys(E))if(!Z_.has(O))throw new Error("Unknown style key: "+O);if(E.fillColor!==void 0&&(I.fillColor=Zn(E.fillColor,"style.fillColor")),E.fillOpacity!==void 0&&(I.fillOpacity=qa(E.fillOpacity,"style.fillOpacity",0,1)),E.lineColor!==void 0&&(I.lineColor=Zn(E.lineColor,"style.lineColor")),E.lineWidth!==void 0&&(I.lineWidth=qa(E.lineWidth,"style.lineWidth",0,20)),E.lineOpacity!==void 0&&(I.lineOpacity=qa(E.lineOpacity,"style.lineOpacity",0,1)),E.circleColor!==void 0&&(I.circleColor=Zn(E.circleColor,"style.circleColor")),E.circleRadius!==void 0&&(I.circleRadius=qa(E.circleRadius,"style.circleRadius",0,30)),E.circleOpacity!==void 0&&(I.circleOpacity=qa(E.circleOpacity,"style.circleOpacity",0,1)),E.lineVisible!==void 0&&(I.lineVisible=nh(E.lineVisible,"style.lineVisible")),E.circleVisible!==void 0&&(I.circleVisible=nh(E.circleVisible,"style.circleVisible")),E.categorical!==void 0){let O=E.categorical;vl(O,"style.categorical");let $=String(O.field||"").trim();if(!$)throw new Error("style.categorical.field is required");vl(O.values,"style.categorical.values");let z=Object.entries(O.values);if(z.length>500)throw new Error("style.categorical.values supports at most 500 entries");let u={};for(let[se,Ce]of z){vl(Ce,"style.categorical.values."+se);let $e={color:Zn(Ce.color,"style.categorical.values."+se+".color")};if(!$e.color)throw new Error("style.categorical.values."+se+".color is required");Ce.label!==void 0&&($e.label=String(Ce.label).slice(0,120)),u[String(se)]=$e}I.categorical={field:$,values:u},O.fallbackColor!==void 0&&(I.categorical.fallbackColor=Zn(O.fallbackColor,"style.categorical.fallbackColor"))}return E.opacity!==void 0&&(I.opacity=qa(E.opacity,"style.opacity",0,1)),E.label!==void 0&&(I.label=W_(E.label)),I}function Qm(E,I){let O=E&&typeof E=="object"?E:{},$=H_(I||{}),z=Object.assign({},O);for(let[u,se]of Object.entries($))u==="label"?se===null?delete z.label:!O.label||typeof O.label!="object"||O.label.field!==se.field?z.label=se:z.label=Object.assign({},O.label,se):z[u]=se;return z}var sr=[],X_=0,ap=null,rp=0,op=new Set;function Yo(){for(let E of[...op])E()}function sh(E,I,O,$){let z=typeof E=="number"?E:Number(E);return Number.isFinite(z)?Math.min($,Math.max(O,z)):I}function eg(E){let I=2166136261;for(let O=0;O<E.length;O+=1)I^=E.charCodeAt(O),I=Math.imul(I,16777619);return"gis-"+(I>>>0).toString(36)}function tg(E){let I=String(E||"").trim();return/^https?:\/\//i.test(I)?I:I.startsWith("//")?(typeof window<"u"&&window.location?window.location.protocol:"http:")+I:I.startsWith("/")&&typeof window<"u"&&window.location&&window.location.origin?window.location.origin+I:I}function ch(){return sr}function sp(E){return op.add(E),()=>{op.delete(E)}}function ig(E){let I=String(E&&E.name?E.name:yl).trim()||yl,O=String(E&&E.tileUrl?E.tileUrl:Gn).trim()||Gn,$=String(E&&E.key?E.key:"layer-"+(X_+=1)),z={key:$,name:I,renderKind:"raster-tiles",tileUrl:O,tileSize:Number(E&&E.tileSize)===512?512:256,minzoom:sh(E&&E.minzoom,0,0,24),maxzoom:sh(E&&E.maxzoom,18,0,24),attribution:String(E&&E.attribution?E.attribution:"\u5929\u5730\u56FE"),visible:!(E&&E.visible===!1),source:String(E&&E.source?E.source:"conversation"),z:sh(E&&E.z,1e3,-1e3,1e4)},u=sr.find(Ce=>Ce.tileUrl===z.tileUrl);if(u){let Ce=Object.assign({},u,{name:z.name,tileSize:z.tileSize,minzoom:z.minzoom,maxzoom:z.maxzoom,attribution:z.attribution});return sr=sr.map($e=>$e.key===u.key?Ce:$e),Yo(),Ce}let se=Object.assign({},z,{id:eg($)});return sr=[...sr,se].sort((Ce,$e)=>(Ce.z||0)-($e.z||0)),Yo(),se}function uh(E,I){let O=sr.filter(z=>z.source!=="project"),$=(Array.isArray(I)?I:[]).map(z=>Object.assign({},z,{id:z.id||eg(z.key),source:"project",persisted:!0,projectId:E}));sr=[...O,...$].sort((z,u)=>(z.z||0)-(u.z||0)),Yo()}function rg(E,I){let O=!1;return sr=sr.map($=>$.layerId!==E&&$.id!==E?$:(O=!0,Object.assign({},$,{style:Qm($.style,I)}))),O&&Yo(),O}function ag(E,I,O){if(!E||!I||E===I)return!1;let $=sr.findIndex(Ce=>Ce.key===E);if($<0)return!1;let z=sr.slice(),[u]=z.splice($,1),se=z.findIndex(Ce=>Ce.key===I);return se<0?!1:(O&&(se+=1),z.splice(se,0,u),sr=z.map((Ce,$e)=>Ce.z===$e?Ce:Object.assign({},Ce,{z:$e})),Yo(),!0)}function hh(E){let I=sr.filter(O=>O.key!==E);I.length!==sr.length&&(sr=I,Yo())}function lp(E){let I=!1;sr=sr.map(O=>O.key!==E?O:(I=!0,Object.assign({},O,{visible:!O.visible}))),I&&Yo()}function cp(){return ap}function og(E){let I=E&&Array.isArray(E.center)?E.center:null;if(!I||I.length<2)return null;let O=Number(I[0]),$=Number(I[1]);if(!Number.isFinite(O)||!Number.isFinite($))return null;let z=sh(E&&E.zoom,11,0,24);return rp+=1,ap={token:rp,center:[Math.min(180,Math.max(-180,O)),Math.min(85,Math.max(-85,$))],zoom:z,label:String(E&&E.label?E.label:"").trim(),key:String(E&&E.key?E.key:"view-"+rp)},Yo(),ap}var up=`
804
+ .gis-workbench, .gis-workbench *, .gis-chat-wrap, .gis-chat-wrap *, .gis-tool-card, .gis-tool-card *,
805
+ .gis-overlay, .gis-overlay * {
806
+ box-sizing: border-box;
807
+ }
808
+ .gis-overlay {
809
+ position: absolute;
810
+ top: 0;
811
+ left: 0;
812
+ bottom: 0;
813
+ z-index: 1;
814
+ display: flex;
815
+ min-width: 0;
816
+ overflow: hidden;
817
+ pointer-events: auto;
818
+ background: var(--dsw-alias-bg-base);
819
+ border-right: 1px solid var(--dsw-alias-border-l1);
820
+ box-shadow: 8px 0 28px rgba(0, 0, 0, 0.1);
821
+ }
822
+ .gis-overlay > .gis-workbench {
823
+ flex: 1;
824
+ min-width: 0;
825
+ }
826
+ .gis-workbench {
827
+ --gis-map-bg: #e8ece4;
828
+ --gis-map-grid: rgba(71, 96, 87, 0.1);
829
+ --gis-map-glow: rgba(47, 125, 109, 0.12);
830
+ position: relative;
831
+ display: flex;
832
+ flex-direction: column;
833
+ height: 100%;
834
+ min-height: 0;
835
+ overflow: hidden;
836
+ background: var(--dsw-alias-bg-base);
837
+ color: var(--dsw-alias-label-primary);
838
+ font-family: inherit;
839
+ }
840
+ .gis-workbench.gis-dark {
841
+ --gis-map-bg: #121b1a;
842
+ --gis-map-grid: rgba(173, 204, 192, 0.09);
843
+ --gis-map-glow: rgba(86, 173, 148, 0.14);
844
+ }
845
+ .gis-topbar {
846
+ flex: none;
847
+ min-height: 56px;
848
+ display: flex;
849
+ align-items: center;
850
+ gap: 16px;
851
+ padding: 0 16px;
852
+ border-bottom: 1px solid var(--dsw-alias-border-l1);
853
+ background: var(--dsw-alias-bg-layer-1);
854
+ }
855
+ .gis-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
856
+ .gis-brand-mark {
857
+ width: 34px; height: 34px; border-radius: 10px; flex: none;
858
+ display: grid; place-items: center;
859
+ color: var(--dsw-alias-brand-primary);
860
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, var(--dsw-alias-bg-layer-1));
861
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, transparent);
862
+ }
863
+ .gis-brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
864
+ .gis-brand-title { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
865
+ .gis-brand-sub { font-size: 11px; color: var(--dsw-alias-label-secondary); white-space: nowrap; }
866
+ .gis-topbar-center { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; justify-content: center; }
867
+ .gis-mode-chip {
868
+ display: inline-flex; align-items: center; gap: 6px;
869
+ height: 24px; padding: 0 9px; border-radius: 999px;
870
+ font-size: 11px; font-weight: 600; white-space: nowrap;
871
+ color: var(--dsw-alias-brand-primary);
872
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);
873
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, transparent);
874
+ }
875
+ .gis-mode-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dsw-alias-brand-primary); }
876
+ .gis-topbar-meta { font-size: 11px; color: var(--dsw-alias-label-secondary); white-space: nowrap; }
877
+ .gis-topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
878
+ .gis-btn {
879
+ appearance: none; -webkit-appearance: none;
880
+ height: 32px; padding: 0 11px; border-radius: 8px;
881
+ display: inline-flex; align-items: center; justify-content: center; gap: 7px;
882
+ border: 1px solid var(--dsw-alias-border-l1);
883
+ background: var(--dsw-alias-bg-layer-2);
884
+ color: var(--dsw-alias-label-primary);
885
+ font: inherit; font-size: 12px; font-weight: 550; white-space: nowrap; cursor: pointer;
886
+ transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
887
+ }
888
+ .gis-btn:hover { background: color-mix(in srgb, var(--dsw-alias-label-primary) 6%, var(--dsw-alias-bg-layer-2)); }
889
+ .gis-btn-primary {
890
+ color: var(--dsw-alias-brand-primary);
891
+ border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 34%, var(--dsw-alias-border-l1));
892
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 11%, var(--dsw-alias-bg-layer-1));
893
+ }
894
+ .gis-btn-primary:hover { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 17%, var(--dsw-alias-bg-layer-1)); }
895
+ .gis-btn:focus-visible, .gis-icon-btn:focus-visible, .gis-rail-btn:focus-visible,
896
+ .gis-layer-action:focus-visible, .gis-launcher:focus-visible, .gis-chat-collapse:focus-visible,
897
+ .gis-tool-btn:focus-visible, .gis-link-button:focus-visible {
898
+ outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px;
899
+ }
900
+ .gis-main { flex: 1; min-height: 0; display: flex; }
901
+ .gis-rail {
902
+ flex: none; width: 56px;
903
+ display: flex; flex-direction: column; align-items: center; gap: 6px;
904
+ padding: 10px 0;
905
+ border-right: 1px solid var(--dsw-alias-border-l1);
906
+ background: var(--dsw-alias-bg-layer-1);
907
+ }
908
+ .gis-rail-btn {
909
+ width: 38px; height: 38px; border: 0; border-radius: 10px;
910
+ display: grid; place-items: center;
911
+ background: transparent; color: var(--dsw-alias-label-secondary);
912
+ cursor: pointer; transition: background 120ms ease, color 120ms ease;
913
+ }
914
+ .gis-rail-btn:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
915
+ .gis-rail-btn.is-active {
916
+ color: var(--dsw-alias-brand-primary);
917
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);
918
+ }
919
+ .gis-rail-divider { width: 22px; height: 1px; background: var(--dsw-alias-border-l1); margin: 3px 0; }
920
+ .gis-rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-bottom: 2px; }
921
+ .gis-rail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dsw-alias-state-success-primary); }
922
+ .gis-rail-version { font-size: 9px; color: var(--dsw-alias-label-secondary); letter-spacing: 0.04em; }
923
+ .gis-stage { position: relative; flex: 1; min-width: 0; min-height: 0; padding: 12px; background: var(--dsw-alias-bg-base); }
924
+ .gis-map-shell.is-measuring .maplibregl-canvas,
925
+ .gis-map-shell.is-measuring .maplibregl-canvas-container { cursor: crosshair !important; }
926
+ .gis-map-shell {
927
+ position: relative; width: 100%; height: 100%; border-radius: 14px; overflow: hidden;
928
+ border: 1px solid var(--dsw-alias-border-l1);
929
+ background: var(--gis-map-bg);
930
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
931
+ }
932
+ .gis-map {
933
+ position: absolute; inset: 0;
934
+ background-color: var(--gis-map-bg);
935
+ background-image:
936
+ radial-gradient(circle at 50% 42%, var(--gis-map-glow), transparent 55%),
937
+ linear-gradient(var(--gis-map-grid) 1px, transparent 1px),
938
+ linear-gradient(90deg, var(--gis-map-grid) 1px, transparent 1px);
939
+ background-size: auto, 44px 44px, 44px 44px;
940
+ }
941
+ .gis-map .maplibregl-canvas { outline: none; }
942
+ .gis-map .maplibregl-ctrl-logo { margin: 0 0 11px 11px !important; opacity: 0.72; }
943
+ .gis-map .maplibregl-ctrl-bottom-left { z-index: 3; }
944
+ .gis-map .maplibregl-ctrl-scale {
945
+ margin: 0 0 12px 12px !important;
946
+ border-color: var(--dsw-alias-label-secondary) !important;
947
+ color: var(--dsw-alias-label-secondary) !important;
948
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 78%, transparent) !important;
949
+ border-radius: 4px !important;
950
+ font-size: 9px !important;
951
+ }
952
+ .gis-map-loading, .gis-map-error {
953
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
954
+ z-index: 3; display: flex; align-items: center; gap: 8px;
955
+ padding: 8px 12px; border-radius: 8px;
956
+ font-size: 11.5px; color: var(--dsw-alias-label-secondary);
957
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 92%, transparent);
958
+ border: 1px solid var(--dsw-alias-border-l1);
959
+ box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
960
+ pointer-events: none; white-space: nowrap;
961
+ }
962
+ .gis-map-error { color: var(--dsw-alias-state-error-primary); }
963
+ .gis-empty {
964
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
965
+ z-index: 2; width: min(380px, calc(100% - 80px));
966
+ display: flex; flex-direction: column; align-items: center; gap: 8px;
967
+ text-align: center; pointer-events: none;
968
+ }
969
+ .gis-empty-icon {
970
+ width: 46px; height: 46px; border-radius: 14px;
971
+ display: grid; place-items: center;
972
+ color: var(--dsw-alias-brand-primary);
973
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 88%, transparent);
974
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, var(--dsw-alias-border-l1));
975
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
976
+ }
977
+ .gis-empty-title { margin-top: 2px; font-size: 15px; font-weight: 650; }
978
+ .gis-empty-body { font-size: 11.5px; line-height: 1.55; color: var(--dsw-alias-label-secondary); }
979
+ .gis-empty-prompt {
980
+ margin-top: 3px; display: inline-flex; align-items: center; gap: 6px;
981
+ padding: 6px 10px; border-radius: 8px;
982
+ border: 1px dashed color-mix(in srgb, var(--dsw-alias-brand-primary) 38%, var(--dsw-alias-border-l1));
983
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 86%, transparent);
984
+ color: var(--dsw-alias-brand-primary);
985
+ font-size: 11px; font-weight: 600; white-space: nowrap;
986
+ }
987
+ .gis-panel {
988
+ position: absolute; top: 14px; left: 14px; z-index: 4;
989
+ width: 296px; max-width: calc(100% - 92px); max-height: calc(100% - 92px);
990
+ display: flex; flex-direction: column;
991
+ padding: 10px;
992
+ border: 1px solid var(--dsw-alias-border-l1);
993
+ border-radius: 12px;
994
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 94%, transparent);
995
+ box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
996
+ backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
997
+ overflow: auto;
998
+ }
999
+ .gis-panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 2px 7px; }
1000
+ .gis-panel-head-actions { display: flex; align-items: center; gap: 5px; }
1001
+ .gis-measure-close { width: 22px; height: 22px; border-radius: 6px; }
1002
+ .gis-panel-title { font-size: 11px; font-weight: 650; letter-spacing: 0.04em; color: var(--dsw-alias-label-secondary); text-transform: uppercase; }
1003
+ .gis-panel-count { font-size: 10px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }
1004
+ .gis-layer-list { display: flex; flex-direction: column; gap: 5px; }
1005
+ .gis-layer-empty {
1006
+ display: flex; flex-direction: column; gap: 6px;
1007
+ padding: 12px; border-radius: 9px;
1008
+ border: 1px dashed var(--dsw-alias-border-l2);
1009
+ background: color-mix(in srgb, var(--dsw-alias-bg-base) 68%, transparent);
1010
+ }
1011
+ .gis-layer-empty-title { font-size: 12px; font-weight: 600; }
1012
+ .gis-layer-empty-body { font-size: 10.5px; line-height: 1.5; color: var(--dsw-alias-label-secondary); }
1013
+ .gis-layer-example {
1014
+ margin-top: 2px; padding: 5px 7px; border-radius: 6px;
1015
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent);
1016
+ color: var(--dsw-alias-brand-primary);
1017
+ font-size: 10px; line-height: 1.4;
1018
+ }
1019
+ .gis-layer-item {
1020
+ position: relative;
1021
+ display: flex; align-items: center; gap: 8px;
1022
+ cursor: grab;
1023
+ padding: 7px; border-radius: 9px;
1024
+ border: 1px solid var(--dsw-alias-border-l1);
1025
+ background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 78%, transparent);
1026
+ }
1027
+ .gis-layer-thumb {
1028
+ flex: none; width: 30px; height: 30px; border-radius: 7px;
1029
+ display: grid; place-items: center;
1030
+ color: var(--dsw-alias-brand-primary);
1031
+ background:
1032
+ linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent), transparent),
1033
+ var(--dsw-alias-bg-layer-2);
1034
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 20%, var(--dsw-alias-border-l1));
1035
+ }
1036
+ .gis-layer-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
1037
+ .gis-layer-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1038
+ .gis-layer-meta { font-size: 9.5px; color: var(--dsw-alias-label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1039
+ .gis-layer-actions { display: flex; align-items: center; gap: 2px; flex: none; }
1040
+ .gis-layer-action {
1041
+ width: 24px; height: 24px; border: 0; border-radius: 6px; padding: 0;
1042
+ display: grid; place-items: center; background: transparent;
1043
+ color: var(--dsw-alias-label-secondary); cursor: pointer;
1044
+ }
1045
+ .gis-layer-action:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
1046
+ .gis-layer-action.is-off { color: var(--dsw-alias-state-idle-primary); }
1047
+ .gis-panel-foot {
1048
+ flex: none; margin-top: 8px; padding-top: 8px;
1049
+ border-top: 1px solid var(--dsw-alias-border-l1);
1050
+ font-size: 9.5px; color: var(--dsw-alias-label-secondary);
1051
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
1052
+ }
1053
+ .gis-map-title-card {
1054
+ position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
1055
+ display: flex; flex-direction: column; align-items: center; gap: 1px;
1056
+ padding: 7px 14px; border-radius: 999px;
1057
+ border: 1px solid var(--dsw-alias-border-l1);
1058
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 92%, transparent);
1059
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
1060
+ backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
1061
+ pointer-events: none; white-space: nowrap;
1062
+ }
1063
+ .gis-map-title-text { font-size: 12px; font-weight: 600; }
1064
+ .gis-map-title-sub { font-size: 9.5px; color: var(--dsw-alias-label-secondary); letter-spacing: 0.04em; }
1065
+ .gis-map-actions { position: absolute; top: 14px; right: 14px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 6px; }
1066
+ .gis-compass {
1067
+ width: 38px; height: 38px; border-radius: 50%;
1068
+ display: grid; place-items: center;
1069
+ border: 1px solid var(--dsw-alias-border-l1);
1070
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 94%, transparent);
1071
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
1072
+ }
1073
+ .gis-icon-btn {
1074
+ appearance: none; -webkit-appearance: none;
1075
+ width: 34px; height: 34px; border-radius: 9px; padding: 0;
1076
+ display: grid; place-items: center;
1077
+ border: 1px solid var(--dsw-alias-border-l1);
1078
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 94%, transparent);
1079
+ color: var(--dsw-alias-label-primary);
1080
+ cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
1081
+ }
1082
+ .gis-icon-btn:hover { background: var(--dsw-alias-bg-layer-2); }
1083
+ .gis-readout {
1084
+ position: absolute; right: 14px; bottom: 14px; z-index: 4;
1085
+ display: flex; align-items: center; gap: 12px;
1086
+ padding: 6px 9px; border-radius: 8px;
1087
+ border: 1px solid var(--dsw-alias-border-l1);
1088
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 92%, transparent);
1089
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
1090
+ pointer-events: none; font-variant-numeric: tabular-nums;
1091
+ }
1092
+ .gis-readout-item { display: flex; align-items: baseline; gap: 4px; }
1093
+ .gis-readout-key { font-size: 8.5px; font-weight: 650; letter-spacing: 0.05em; color: var(--dsw-alias-label-secondary); text-transform: uppercase; }
1094
+ .gis-readout-val { font-size: 10.5px; color: var(--dsw-alias-label-primary); min-width: 43px; }
1095
+ .gis-hint {
1096
+ position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
1097
+ padding: 5px 10px; border-radius: 999px;
1098
+ font-size: 10.5px; color: var(--dsw-alias-label-secondary);
1099
+ background: color-mix(in srgb, var(--dsw-alias-bg-overlay) 88%, transparent);
1100
+ border: 1px solid var(--dsw-alias-border-l1);
1101
+ pointer-events: none; white-space: nowrap;
1102
+ }
1103
+ .gis-toast {
1104
+ position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 9;
1105
+ padding: 7px 12px; border-radius: 8px;
1106
+ font-size: 11.5px; color: var(--dsw-alias-label-primary);
1107
+ background: var(--dsw-alias-bg-overlay);
1108
+ border: 1px solid var(--dsw-alias-border-l1);
1109
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
1110
+ animation: gis-toast-in 140ms ease-out;
1111
+ }
1112
+ .gis-launcher {
1113
+ appearance: none; -webkit-appearance: none;
1114
+ height: 26px; padding: 0 8px; border-radius: 7px;
1115
+ display: inline-flex; align-items: center; justify-content: center; gap: 5px;
1116
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 26%, var(--dsw-alias-border-l1));
1117
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent);
1118
+ color: var(--dsw-alias-brand-primary);
1119
+ font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
1120
+ cursor: pointer; white-space: nowrap;
1121
+ }
1122
+ .gis-launcher:hover { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 15%, transparent); }
1123
+ .gis-chat-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--dsw-alias-bg-base); }
1124
+ .gis-chat-top {
1125
+ flex: none; display: flex; align-items: center; gap: 8px;
1126
+ padding: 6px 10px; border-bottom: 1px solid var(--dsw-alias-border-l1);
1127
+ background: var(--dsw-alias-bg-layer-1);
1128
+ }
1129
+ .gis-chat-status-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--dsw-alias-state-success-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary) 15%, transparent); }
1130
+ .gis-chat-meta { display: flex; flex-direction: column; gap: 0; min-width: 0; }
1131
+ .gis-chat-title { font-size: 11px; font-weight: 600; white-space: nowrap; }
1132
+ .gis-chat-sub { font-size: 9.5px; color: var(--dsw-alias-label-secondary); white-space: nowrap; }
1133
+ .gis-chat-collapse {
1134
+ margin-left: auto; width: 24px; height: 24px; border: 0; border-radius: 6px; padding: 0;
1135
+ display: grid; place-items: center; background: transparent;
1136
+ color: var(--dsw-alias-label-secondary); cursor: pointer;
1137
+ }
1138
+ .gis-chat-collapse:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
1139
+ .gis-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
1140
+ .gis-chat-body > * { flex: 1; min-height: 0; }
1141
+ .gis-chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; font-size: 12px; color: var(--dsw-alias-label-secondary); text-align: center; }
1142
+ .gis-tool-card {
1143
+ margin: 3px 0;
1144
+ border: 1px solid var(--dsw-alias-border-l1);
1145
+ border-radius: 12px;
1146
+ background: var(--dsw-alias-bg-layer-1);
1147
+ overflow: hidden;
1148
+ }
1149
+ .gis-tool-head { display: flex; align-items: center; gap: 9px; padding: 10px 11px; }
1150
+ .gis-tool-icon {
1151
+ flex: none; width: 30px; height: 30px; border-radius: 8px;
1152
+ display: grid; place-items: center;
1153
+ color: var(--dsw-alias-brand-primary);
1154
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 11%, transparent);
1155
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 20%, transparent);
1156
+ }
1157
+ .gis-tool-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
1158
+ .gis-tool-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1159
+ .gis-tool-sub { font-size: 10px; color: var(--dsw-alias-label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1160
+ .gis-tool-state {
1161
+ flex: none; padding: 2px 7px; border-radius: 999px;
1162
+ font-size: 9.5px; font-weight: 650; white-space: nowrap;
1163
+ color: var(--dsw-alias-label-secondary);
1164
+ background: var(--dsw-alias-bg-layer-2);
1165
+ }
1166
+ .gis-tool-state.is-ok { color: var(--dsw-alias-state-success-primary); background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 11%, transparent); }
1167
+ .gis-tool-state.is-error { color: var(--dsw-alias-state-error-primary); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 11%, transparent); }
1168
+ .gis-tool-body { display: flex; flex-direction: column; gap: 7px; padding: 0 11px 10px; }
1169
+ .gis-tool-url {
1170
+ padding: 5px 7px; border-radius: 6px;
1171
+ background: var(--dsw-alias-bg-base);
1172
+ border: 1px solid var(--dsw-alias-border-l1);
1173
+ color: var(--dsw-alias-label-secondary);
1174
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1175
+ font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
1176
+ }
1177
+ .gis-tool-error {
1178
+ padding: 6px 8px; border-radius: 6px;
1179
+ color: var(--dsw-alias-state-error-primary);
1180
+ background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent);
1181
+ font-size: 10.5px; line-height: 1.45;
1182
+ }
1183
+ .gis-tool-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
1184
+ .gis-tool-btn, .gis-link-button {
1185
+ appearance: none; -webkit-appearance: none;
1186
+ height: 26px; padding: 0 9px; border-radius: 7px;
1187
+ display: inline-flex; align-items: center; gap: 5px;
1188
+ border: 1px solid var(--dsw-alias-border-l1);
1189
+ background: var(--dsw-alias-bg-layer-2);
1190
+ color: var(--dsw-alias-label-primary);
1191
+ font: inherit; font-size: 10.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
1192
+ }
1193
+ .gis-tool-btn:hover, .gis-link-button:hover { background: color-mix(in srgb, var(--dsw-alias-label-primary) 6%, var(--dsw-alias-bg-layer-2)); }
1194
+ .gis-tool-btn.is-primary {
1195
+ color: var(--dsw-alias-brand-primary);
1196
+ border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, var(--dsw-alias-border-l1));
1197
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 9%, transparent);
1198
+ }
1199
+ .gis-link-button { border-color: transparent; background: transparent; color: var(--dsw-alias-label-secondary); padding: 0 5px; }
1200
+ .gis-link-button:hover { color: var(--dsw-alias-state-error-primary); background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); }
1201
+ .gis-loading-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dsw-alias-brand-primary); animation: gis-pulse 1.1s ease-in-out infinite; }
1202
+ @keyframes gis-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
1203
+ @keyframes gis-toast-in { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }
1204
+ @media (max-width: 1180px) {
1205
+ .gis-map-title-card { display: none; }
1206
+ .gis-topbar-center { justify-content: flex-start; }
1207
+ }
1208
+ @media (max-width: 940px) {
1209
+ .gis-brand-sub, .gis-topbar-meta { display: none; }
1210
+ .gis-btn-label { display: none; }
1211
+ .gis-btn { width: 32px; padding: 0; }
1212
+ .gis-rail { width: 48px; }
1213
+ .gis-stage { padding: 8px; }
1214
+ .gis-panel { width: 254px; max-width: calc(100% - 74px); }
1215
+ .gis-hint { display: none; }
1216
+ }
1217
+ @media (max-width: 680px) {
1218
+ .gis-mode-chip { display: none; }
1219
+ .gis-topbar { gap: 8px; padding: 0 10px; }
1220
+ .gis-brand-title { font-size: 13px; }
1221
+ .gis-panel { width: 220px; max-width: calc(100% - 62px); padding: 8px; }
1222
+ .gis-readout { gap: 7px; padding: 5px 7px; }
1223
+ .gis-readout-val { min-width: 34px; font-size: 9.5px; }
1224
+ }
1225
+ @media (prefers-reduced-motion: reduce) {
1226
+ .gis-loading-dot, .gis-toast { animation: none; }
1227
+ }
1228
+
1229
+ .gis-project-control {
1230
+ display: flex; align-items: center; gap: 6px; min-width: 0; flex: none;
1231
+ padding: 3px 4px 3px 8px; border-radius: 8px;
1232
+ border: 1px solid var(--dsw-alias-border-l1);
1233
+ background: var(--dsw-alias-bg-layer-2);
1234
+ color: var(--dsw-alias-label-secondary);
1235
+ }
1236
+ .gis-project-select {
1237
+ appearance: auto; -webkit-appearance: auto;
1238
+ max-width: 168px; min-width: 84px; border: 0; outline: 0;
1239
+ background: transparent; color: var(--dsw-alias-label-primary);
1240
+ font: inherit; font-size: 12px; font-weight: 550; cursor: pointer;
1241
+ }
1242
+ .gis-project-select:disabled { color: var(--dsw-alias-label-secondary); cursor: default; }
1243
+ .gis-project-control:focus-within { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 45%, var(--dsw-alias-border-l1)); }
1244
+ .gis-icon-btn-sm { width: 26px; height: 26px; border-radius: 7px; box-shadow: none; }
1245
+ .gis-layer-item.is-unsupported { opacity: 0.72; }
1246
+ .gis-layer-item.is-unsupported .gis-layer-thumb { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); }
1247
+ .gis-modal {
1248
+ position: absolute; inset: 0; z-index: 60;
1249
+ display: grid; place-items: center; padding: 24px;
1250
+ background: color-mix(in srgb, var(--dsw-alias-bg-mask-1) 75%, transparent);
1251
+ backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
1252
+ pointer-events: auto;
1253
+ }
1254
+ .gis-modal-card {
1255
+ width: min(820px, calc(100vw - 64px));
1256
+ max-height: min(82vh, 760px);
1257
+ display: flex; flex-direction: column;
1258
+ border-radius: 14px; overflow: hidden;
1259
+ border: 1px solid var(--dsw-alias-border-l1);
1260
+ background: var(--dsw-alias-bg-overlay);
1261
+ box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
1262
+ }
1263
+ .gis-modal-small { width: min(420px, calc(100vw - 48px)); max-height: none; }
1264
+ .gis-modal-head {
1265
+ flex: none; display: flex; align-items: center; gap: 10px;
1266
+ padding: 14px 16px; border-bottom: 1px solid var(--dsw-alias-border-l1);
1267
+ }
1268
+ .gis-modal-title { flex: 1; font-size: 14px; font-weight: 650; }
1269
+ .gis-modal-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
1270
+ .gis-modal-actions { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--dsw-alias-border-l1); }
1271
+ .gis-tabs { flex: none; display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--dsw-alias-border-l1); }
1272
+ .gis-tab {
1273
+ appearance: none; -webkit-appearance: none;
1274
+ padding: 9px 10px; border: 0; border-bottom: 2px solid transparent;
1275
+ background: transparent; color: var(--dsw-alias-label-secondary);
1276
+ font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; white-space: nowrap;
1277
+ }
1278
+ .gis-tab:hover { color: var(--dsw-alias-label-primary); }
1279
+ .gis-tab.is-active { color: var(--dsw-alias-brand-primary); border-bottom-color: var(--dsw-alias-brand-primary); }
1280
+ .gis-modal-message {
1281
+ flex: none; margin: 10px 16px 0; padding: 7px 9px; border-radius: 7px;
1282
+ font-size: 11px; color: var(--dsw-alias-label-secondary);
1283
+ background: var(--dsw-alias-bg-layer-1); border: 1px solid var(--dsw-alias-border-l1);
1284
+ overflow-wrap: anywhere;
1285
+ }
1286
+ .gis-field-label { font-size: 11px; font-weight: 600; color: var(--dsw-alias-label-secondary); }
1287
+ .gis-input {
1288
+ width: 100%; height: 32px; padding: 0 9px; border-radius: 8px;
1289
+ border: 1px solid var(--dsw-alias-border-l1);
1290
+ background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary);
1291
+ font: inherit; font-size: 12px; outline: 0;
1292
+ }
1293
+ .gis-input:focus { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, var(--dsw-alias-border-l1)); }
1294
+ .gis-input-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; }
1295
+ .gis-form-error { font-size: 11px; color: var(--dsw-alias-state-error-primary); }
1296
+ .gis-dataset-list { display: flex; flex-direction: column; gap: 6px; }
1297
+ .gis-dataset-card {
1298
+ display: flex; align-items: center; gap: 10px;
1299
+ padding: 9px; border-radius: 10px;
1300
+ border: 1px solid var(--dsw-alias-border-l1);
1301
+ background: var(--dsw-alias-bg-layer-1);
1302
+ }
1303
+ .gis-dataset-icon {
1304
+ flex: none; width: 32px; height: 32px; border-radius: 8px;
1305
+ display: grid; place-items: center;
1306
+ color: var(--dsw-alias-brand-primary);
1307
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);
1308
+ }
1309
+ .gis-dataset-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
1310
+ .gis-dataset-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1311
+ .gis-dataset-meta { font-size: 10px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1312
+ .gis-dataset-uri { font-size: 9.5px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
1313
+ .gis-dataset-actions { flex: none; display: flex; align-items: center; gap: 5px; }
1314
+ .gis-browse { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
1315
+ .gis-browse-bar { display: flex; align-items: center; gap: 6px; }
1316
+ .gis-browse-bar .gis-input { flex: 1; }
1317
+ .gis-browse-list {
1318
+ flex: 1; min-height: 180px; max-height: 330px; overflow: auto;
1319
+ border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px;
1320
+ background: var(--dsw-alias-bg-base); padding: 4px;
1321
+ }
1322
+ .gis-browse-row {
1323
+ display: flex; align-items: center; gap: 8px; width: 100%;
1324
+ padding: 6px 7px; border: 0; border-radius: 6px;
1325
+ background: transparent; color: var(--dsw-alias-label-primary);
1326
+ font: inherit; font-size: 12px; text-align: left; cursor: pointer;
1327
+ }
1328
+ .gis-browse-row:hover { background: var(--dsw-alias-bg-layer-2); }
1329
+ .gis-browse-row.is-selected { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); color: var(--dsw-alias-brand-primary); }
1330
+ .gis-browse-row.is-disabled { opacity: 0.45; cursor: not-allowed; }
1331
+ .gis-browse-icon { flex: none; width: 18px; display: grid; place-items: center; color: var(--dsw-alias-label-secondary); }
1332
+ .gis-browse-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1333
+ .gis-browse-meta { flex: none; font-size: 9.5px; color: var(--dsw-alias-label-secondary); }
1334
+ .gis-browse-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
1335
+ .gis-selected-path { flex: 1; min-width: 0; font-size: 10.5px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1336
+ .gis-upload { display: flex; flex-direction: column; gap: 10px; }
1337
+ .gis-file-input { font-size: 11px; color: var(--dsw-alias-label-secondary); }
1338
+ .gis-empty-note { padding: 12px; font-size: 11px; color: var(--dsw-alias-label-secondary); text-align: center; }
1339
+ .gis-btn:disabled, .gis-tool-btn:disabled, .gis-link-button:disabled { opacity: 0.5; cursor: not-allowed; }
1340
+ @media (max-width: 1180px) {
1341
+ .gis-project-select { max-width: 120px; }
1342
+ }
1343
+ @media (max-width: 940px) {
1344
+ .gis-project-control { padding: 2px 3px 2px 6px; }
1345
+ .gis-project-select { max-width: 96px; min-width: 60px; }
1346
+ .gis-modal { padding: 12px; }
1347
+ .gis-modal-card { width: calc(100vw - 24px); }
1348
+ .gis-dataset-actions .gis-tool-btn { padding: 0 6px; }
1349
+ }
1350
+
1351
+ .gis-browse-roots { display: flex; gap: 5px; flex-wrap: wrap; }
1352
+ .gis-root-chip {
1353
+ max-width: 100%; padding: 3px 7px; border-radius: 5px;
1354
+ border: 1px solid var(--dsw-alias-border-l1);
1355
+ background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-secondary);
1356
+ font: inherit; font-size: 9.5px; cursor: pointer;
1357
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1358
+ }
1359
+ .gis-root-chip:hover { color: var(--dsw-alias-label-primary); }
1360
+ .gis-root-chip.is-active { color: var(--dsw-alias-brand-primary); border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 35%, var(--dsw-alias-border-l1)); }
1361
+
1362
+ .gis-save-button { position: relative; }
1363
+ .gis-save-button.is-dirty {
1364
+ border-color: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 38%, var(--dsw-alias-border-l1));
1365
+ }
1366
+ .gis-save-dot {
1367
+ width: 5px; height: 5px; border-radius: 50%;
1368
+ background: var(--dsw-alias-state-warn-primary);
1369
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-warn-primary) 18%, transparent);
1370
+ flex: none;
1371
+ }
1372
+
1373
+ .gis-upload-hint { font-size: 10px; color: var(--dsw-alias-brand-primary); }
1374
+ .gis-upload-progress { display: flex; flex-direction: column; gap: 5px; }
1375
+ .gis-progress-track {
1376
+ width: 100%; height: 7px; border-radius: 999px; overflow: hidden;
1377
+ background: var(--dsw-alias-bg-layer-2);
1378
+ border: 1px solid var(--dsw-alias-border-l1);
1379
+ }
1380
+ .gis-progress-fill {
1381
+ height: 100%; border-radius: inherit;
1382
+ background: linear-gradient(90deg, var(--dsw-alias-brand-primary), color-mix(in srgb, var(--dsw-alias-brand-primary) 60%, #7fbfb0));
1383
+ transition: width 160ms ease;
1384
+ }
1385
+ .gis-progress-meta { font-size: 10px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }
1386
+ .gis-upload-status { font-size: 10.5px; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
1387
+ .gis-upload-status.is-error { color: var(--dsw-alias-state-error-primary); }
1388
+
1389
+ .gis-tool-panel { width: 280px; }
1390
+ .gis-measure-tabs { display: flex; gap: 4px; padding: 2px 0 8px; }
1391
+ .gis-measure-tabs .gis-tab {
1392
+ flex: 1; padding: 5px 8px; border: 1px solid var(--dsw-alias-border-l1);
1393
+ border-radius: 7px; font-size: 11px;
1394
+ }
1395
+ .gis-measure-tabs .gis-tab.is-active {
1396
+ color: var(--dsw-alias-brand-primary);
1397
+ border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 40%, var(--dsw-alias-border-l1));
1398
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent);
1399
+ }
1400
+ .gis-measure-value {
1401
+ font-size: 22px; font-weight: 650; letter-spacing: -0.02em;
1402
+ color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums;
1403
+ padding: 2px 2px 6px;
1404
+ }
1405
+ .gis-tool-hint { font-size: 10.5px; color: var(--dsw-alias-label-secondary); line-height: 1.45; padding: 0 2px 8px; }
1406
+ .gis-tool-hint.is-finished { color: var(--dsw-alias-brand-primary); font-weight: 600; }
1407
+ .gis-tool-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 2px; }
1408
+ .gis-annotation-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow: auto; padding-bottom: 6px; }
1409
+ .gis-annotation-row { display: flex; align-items: center; gap: 4px; }
1410
+ .gis-annotation-index {
1411
+ flex: none; width: 18px; height: 18px; border-radius: 50%;
1412
+ display: inline-flex; align-items: center; justify-content: center;
1413
+ background: var(--dsw-alias-brand-primary); color: #fff;
1414
+ font-size: 9px; font-weight: 700;
1415
+ }
1416
+ .gis-annotation-input { height: 26px; min-width: 0; flex: 1; font-size: 10.5px; }
1417
+ .gis-marker {
1418
+ min-width: 24px; height: 24px; padding: 0 6px;
1419
+ display: inline-flex; align-items: center; justify-content: center;
1420
+ border-radius: 999px; border: 2px solid #fff;
1421
+ background: var(--dsw-alias-brand-primary); color: #fff;
1422
+ font: 600 11px/1 var(--dsw-font-family, sans-serif);
1423
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
1424
+ cursor: default; user-select: none;
1425
+ }
1426
+
1427
+ .gis-database { display: flex; flex-direction: column; gap: 10px; }
1428
+ .gis-db-heading { display: flex; flex-direction: column; gap: 2px; }
1429
+ .gis-db-title { font-size: 13px; font-weight: 650; color: var(--dsw-alias-label-primary); }
1430
+ .gis-db-list { display: flex; flex-direction: column; gap: 5px; }
1431
+ .gis-db-item {
1432
+ display: flex; align-items: center; justify-content: space-between; gap: 8px;
1433
+ padding: 5px 7px; border-radius: 7px; border: 1px solid var(--dsw-alias-border-l1);
1434
+ background: var(--dsw-alias-bg-layer-1);
1435
+ }
1436
+ .gis-db-item.is-active { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 38%, var(--dsw-alias-border-l1)); }
1437
+ .gis-db-select {
1438
+ display: flex; align-items: center; gap: 6px; min-width: 0;
1439
+ border: 0; background: transparent; color: var(--dsw-alias-label-primary);
1440
+ font: inherit; font-size: 11px; cursor: pointer; text-align: left;
1441
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1442
+ }
1443
+ .gis-db-form { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 9px; }
1444
+ .gis-db-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
1445
+ .gis-db-field .gis-input { height: 29px; }
1446
+ .gis-db-status { font-size: 10px; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
1447
+ .gis-db-tables { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--dsw-alias-border-l1); padding-top: 8px; }
1448
+ .gis-db-table {
1449
+ display: flex; align-items: center; justify-content: space-between; gap: 8px;
1450
+ padding: 6px 7px; border-radius: 7px; border: 1px solid var(--dsw-alias-border-l1);
1451
+ background: var(--dsw-alias-bg-layer-1);
1452
+ }
1453
+ .gis-db-table-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
1454
+ .gis-db-table-name { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1455
+ .gis-db-table-meta { font-size: 9.5px; color: var(--dsw-alias-label-secondary); }
1456
+
1457
+ .gis-layer-legend { display: flex; flex-wrap: wrap; gap: 3px 7px; padding-top: 3px; }
1458
+ .gis-legend-item { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: var(--dsw-alias-label-secondary); }
1459
+ .gis-legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; border: 1px solid rgba(0,0,0,0.08); }
1460
+ .gis-legend-label { line-height: 1.1; }
1461
+
1462
+ .gis-context-backdrop { position: fixed; inset: 0; z-index: 80; background: transparent; }
1463
+ .gis-context-menu {
1464
+ position: fixed; z-index: 81; width: 244px; max-width: calc(100vw - 16px);
1465
+ padding: 6px; border-radius: 9px;
1466
+ border: 1px solid var(--dsw-alias-border-l1);
1467
+ background: var(--dsw-alias-bg-overlay);
1468
+ box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
1469
+ backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
1470
+ }
1471
+ .gis-context-title {
1472
+ padding: 5px 7px 6px; font-size: 10.5px; font-weight: 650;
1473
+ color: var(--dsw-alias-label-secondary);
1474
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1475
+ }
1476
+ .gis-context-action {
1477
+ width: 100%; display: flex; align-items: center; gap: 7px;
1478
+ padding: 7px; border: 0; border-radius: 6px;
1479
+ background: transparent; color: var(--dsw-alias-label-primary);
1480
+ font: inherit; font-size: 11.5px; text-align: left; cursor: pointer;
1481
+ }
1482
+ .gis-context-action:hover { background: var(--dsw-alias-bg-layer-2); }
1483
+ .gis-context-action svg { color: var(--dsw-alias-brand-primary); }
1484
+
1485
+ .gis-layer-item:active { cursor: grabbing; }
1486
+ .gis-layer-item.is-dragging { opacity: 0.5; }
1487
+ .gis-layer-item.is-drop-before::before,
1488
+ .gis-layer-item.is-drop-after::after {
1489
+ content: ''; position: absolute; left: 5px; right: 5px; height: 2px;
1490
+ border-radius: 999px; background: var(--dsw-alias-brand-primary);
1491
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent);
1492
+ }
1493
+ .gis-layer-item.is-drop-before::before { top: -2px; }
1494
+ .gis-layer-item.is-drop-after::after { bottom: -2px; }
1495
+
1496
+ .gis-draw-target {
1497
+ font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary);
1498
+ padding: 2px 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1499
+ }
1500
+
1501
+ .gis-context-subtitle { padding: 0 7px 5px; font-size: 9.5px; color: var(--dsw-alias-label-secondary); }
1502
+ .gis-context-action.is-danger { color: var(--dsw-alias-state-error-primary); }
1503
+ .gis-context-action.is-danger svg { color: var(--dsw-alias-state-error-primary); }
1504
+
1505
+ .gis-vertex-marker {
1506
+ width: 12px; height: 12px; border-radius: 50%;
1507
+ background: #ffffff; border: 2px solid #ff9f1a;
1508
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
1509
+ cursor: grab;
1510
+ }
1511
+ .gis-vertex-marker:active { cursor: grabbing; }
1512
+ `;var hp="/api/gis-workbench";async function Ei(E,I={}){let O={method:I.method||"GET",credentials:"same-origin",headers:{...I.headers||{}}};I.body!==void 0&&(I.body instanceof FormData?O.body=I.body:(O.headers["content-type"]="application/json",O.body=JSON.stringify(I.body)));let $=await fetch(hp+E,O),z=$.headers.get("content-type")||"",u=null;if(z.includes("application/json"))u=await $.json().catch(()=>null);else{let se=await $.text().catch(()=>"");u=se?{error:se}:null}if(!$.ok){let se=new Error(u&&u.error||`Request failed (${$.status})`);throw se.status=$.status,se}return u}function Y_(E,I){let O=new URL(E,"http://local");for(let[$,z]of Object.entries(I||{}))z!=null&&z!==""&&O.searchParams.set($,z);return O.pathname+(O.search||"")}function ng(){return Ei("")}function sg(E){return Ei("/projects",{method:"POST",body:E}).then(I=>I.project)}function lg(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/state",{method:"PUT",body:I})}function cg(E){return Ei("/projects/"+encodeURIComponent(E)+"/datasets").then(I=>I.datasets||[])}function ug(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/datasets",{method:"POST",body:I})}function dp(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/datasets/tile",{method:"POST",body:I})}function hg(E,I={}){return Ei("/datasets/"+encodeURIComponent(E)+"/convert",{method:"POST",body:{force:I.force===!0}}).then(O=>O.dataset)}function dg(E){return Ei("/datasets/"+encodeURIComponent(E),{method:"DELETE"})}function pp(E){return Ei("/projects/"+encodeURIComponent(E)+"/layers").then(I=>I.layers||[])}function fp(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/layers",{method:"POST",body:I}).then(O=>O.layer)}function pg(E){return Ei(Y_("/browse",{path:E}))}function mp(E){return hp+"/datasets/"+encodeURIComponent(E)+"/content"}function fg(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/uploads/init",{method:"POST",body:I}).then(O=>O.upload)}function mg(E){return Ei("/uploads/"+encodeURIComponent(E)).then(I=>I.upload)}function gg(E,I={}){return Ei("/uploads/"+encodeURIComponent(E)+"/complete",{method:"POST",body:I})}function _g(E,I,O,$,z){return new Promise((u,se)=>{let Ce=new XMLHttpRequest,$e=!1,Ye=()=>{z?.removeEventListener("abort",Ue)},Oe=ke=>{$e||($e=!0,Ye(),se(ke))},ut=ke=>{$e||($e=!0,Ye(),u(ke))},Ue=()=>{try{Ce.abort()}catch{}let ke=new Error("Upload aborted");ke.name="AbortError",Oe(ke)};if(Ce.open("PUT",hp+"/uploads/"+encodeURIComponent(E)+"/chunks/"+I),Ce.setRequestHeader("content-type","application/octet-stream"),Ce.upload.onprogress=ke=>{$&&ke.lengthComputable&&$(ke.loaded)},Ce.onload=()=>{let ke=null;try{ke=Ce.responseText?JSON.parse(Ce.responseText):null}catch{ke=null}Ce.status>=200&&Ce.status<300?ut(ke&&ke.upload?ke.upload:ke):Oe(new Error(ke&&ke.error||`Chunk upload failed (${Ce.status})`))},Ce.onerror=()=>Oe(new Error("Network error while uploading chunk")),Ce.ontimeout=()=>Oe(new Error("Chunk upload timed out")),z){if(z.aborted){Ue();return}z.addEventListener("abort",Ue,{once:!0})}Ce.send(O)})}function yg(E){return Ei("/projects/"+encodeURIComponent(E)+"/databases").then(I=>I.databases||[])}function vg(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/databases",{method:"POST",body:I}).then(O=>O.database)}function bg(E){return Ei("/databases/"+encodeURIComponent(E),{method:"DELETE"})}function xg(E){return Ei("/databases/"+encodeURIComponent(E)+"/tables").then(I=>I.tables||[])}function wg(E,I){return Ei("/databases/"+encodeURIComponent(E)+"/tables/import",{method:"POST",body:I})}function Tg(E,I){return Ei("/projects/"+encodeURIComponent(E)+"/vector-layers",{method:"POST",body:I})}function Sg(E,I){return Ei("/datasets/"+encodeURIComponent(E)+"/features",{method:"POST",body:I}).then(O=>O.dataset)}function Pg(E,I){return Ei("/datasets/"+encodeURIComponent(E)+"/features/delete",{method:"POST",body:I}).then(O=>O.dataset)}function Mg(E,I){return Ei("/datasets/"+encodeURIComponent(E)+"/features/update",{method:"POST",body:I}).then(O=>O.dataset)}var Ko=Nc.default&&Nc.default.Map?Nc.default:Nc.default.default,ma,B,at,ft,Tr,ei,J_,Dg,bl=!1,_p=new Set,lo="gisWorkbench",co="gis-chat",yp="@focus-daima/gis-workbench/chat",Q_=Ym,Cg=[104.2,35.5],gp=3.4;function Lg(E){let I=0;for(let O=0;O<E.length-1;O+=1)I+=E[O][0]*E[O+1][1]-E[O+1][0]*E[O][1];return I/2}function Eg(E){let I=0,O=0,$=0;for(let z=0;z<E.length-1;z+=1){let[u,se]=E[z],[Ce,$e]=E[z+1],Ye=u*$e-Ce*se;I+=Ye,O+=(u+Ce)*Ye,$+=(se+$e)*Ye}if(Math.abs(I)<1e-12){let z=E.slice(0,-1);return z.length===0?null:[z.reduce((u,se)=>u+se[0],0)/z.length,z.reduce((u,se)=>u+se[1],0)/z.length]}return[O/(3*I),$/(3*I)]}function vp(E){if(!E||!Array.isArray(E.coordinates))return null;if(E.type==="Point")return E.coordinates.slice(0,2);if(E.type==="MultiPoint"){let I=E.coordinates;return I.length===0?null:[I.reduce((O,$)=>O+$[0],0)/I.length,I.reduce((O,$)=>O+$[1],0)/I.length]}if(E.type==="LineString"){let I=E.coordinates;return I.length>0?I[Math.floor(I.length/2)].slice(0,2):null}if(E.type==="MultiLineString"){let I=E.coordinates;return I.length>0?vp({type:"LineString",coordinates:I[0]}):null}if(E.type==="Polygon"){let I=E.coordinates[0];return!I||I.length<4?null:Eg(I)}if(E.type==="MultiPolygon"){let I=null,O=-1/0;for(let $ of E.coordinates){let z=$&&$[0];if(!z||z.length<4)continue;let u=Math.abs(Lg(z));u>O&&(O=u,I=Eg(z))}return I}if(E.type==="GeometryCollection")for(let I of E.geometries||[]){let O=vp(I);if(O)return O}return null}function ey(E,I){if(!E||!E.field||!E.values)return I;let O=["match",["to-string",["get",E.field]]];for(let[$,z]of Object.entries(E.values))O.push(String($),z.color);return O.push(E.fallbackColor||I),O}function ty(E){if(!E||!Array.isArray(E.coordinates))return null;if(E.type==="Polygon")return E.coordinates[0].map(I=>[I[0],I[1]]);if(E.type==="MultiPolygon"){let I=null,O=-1/0;for(let $ of E.coordinates){let z=$&&$[0];if(!z||z.length<4)continue;let u=Math.abs(Lg(z));u>O&&(O=u,I=z.map(se=>[se[0],se[1]]))}return I}return null}function iy(E){if(!E||E.length<2)return{type:"FeatureCollection",features:[]};let I=E.length>=3?[...E,E[0]]:E,O=[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:I}}];E.length>=3&&O.push({type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[I]}});for(let $ of E.slice(0,-1))O.push({type:"Feature",properties:{},geometry:{type:"Point",coordinates:$}});return{type:"FeatureCollection",features:O}}function Rg(E){let I=["to-string",["get",E.field]];if(!E||!E.valueMap||Object.keys(E.valueMap).length===0)return I;let O=["match",I];for(let[$,z]of Object.entries(E.valueMap))O.push(String($),String(z));return O.push(E.fallback!==void 0?String(E.fallback):I),O}function ry(E,I,O){let $={id:E,type:"symbol",source:I,minzoom:O.minzoom!==void 0?O.minzoom:12,layout:{"text-field":Rg(O),"text-size":O.size!==void 0?O.size:12,"text-max-width":8,"text-allow-overlap":!!O.allowOverlap,"text-ignore-placement":!1,"text-padding":2},paint:{"text-color":O.color||"#16423a","text-halo-color":O.haloColor||"rgba(255, 255, 255, 0.92)","text-halo-width":O.haloWidth!==void 0?O.haloWidth:1.2}};return O.maxzoom!==void 0&&($.maxzoom=O.maxzoom),O.anchor&&($.layout["text-anchor"]=O.anchor),Array.isArray(O.font)&&O.font.length>0&&($.layout["text-font"]=O.font),$}function ay(E){return{version:8,glyphs:typeof window<"u"&&window.location&&window.location.origin?window.location.origin+ip:ip,sources:{},layers:[{id:"gis-background",type:"background",paint:{"background-color":E==="dark"?"#121b1a":"#e8ece4"}}]}}var oy={"mode.enter":"\u8FDB\u5165 GIS \u5DE5\u4F5C\u53F0","mode.exit":"\u8FD4\u56DE\u539F\u7248\u6A21\u5F0F","mode.workbench":"GIS \u5DE5\u4F5C\u53F0","mode.badge":"\u5DE5\u4F5C\u53F0\u6A21\u5F0F","mode.framework":"MapLibre GL JS \u9884\u89C8","mode.original":"\u539F\u7248\u6A21\u5F0F","brand.sub":"MapLibre GL JS \xB7 \u5BF9\u8BDD\u9A71\u52A8\u56FE\u5C42","topbar.stats":"{layers} \u4E2A\u56FE\u5C42","chat.tab":"\u5730\u56FE\u4F1A\u8BDD","chat.toggle":"\u5BF9\u8BDD\u9762\u677F","chat.title":"\u5730\u56FE\u5BF9\u8BDD","chat.subtitle":"\u5F53\u524D\u4F1A\u8BDD \xB7 \u5730\u56FE\u4EA4\u4E92","chat.collapse":"\u6536\u8D77\u5BF9\u8BDD\u9762\u677F","chat.unavailable":"\u53F3\u4FA7\u5BF9\u8BDD\u6682\u4E0D\u53EF\u7528","chat.noSession":"\u9009\u62E9\u4E00\u4E2A\u4F1A\u8BDD\u540E\u5373\u53EF\u5F00\u59CB\u5BF9\u8BDD","layers.title":"\u56FE\u5C42","layers.emptyTitle":"\u6682\u65E0\u56FE\u5C42","layers.emptyBody":"\u4ECE\u6570\u636E\u96C6\u6DFB\u52A0\u56FE\u5C42\uFF0C\u6216\u5728\u53F3\u4FA7\u5BF9\u8BDD\u4E2D\u63CF\u8FF0\u8981\u6DFB\u52A0\u7684\u56FE\u5C42\u3002","layers.example":"\u6253\u5F00\u9876\u90E8\u300C\u6570\u636E\u96C6\u300D\u6CE8\u518C\u6587\u4EF6\u6216\u74E6\u7247\u56FE\u5C42","layers.raster":"\u6805\u683C","layers.show":"\u663E\u793A\u56FE\u5C42","layers.hide":"\u9690\u85CF\u56FE\u5C42","layers.remove":"\u79FB\u9664\u56FE\u5C42","layers.project":"\u5DE5\u7A0B\u56FE\u5C42","layers.session":"\u4F1A\u8BDD\u56FE\u5C42","layers.unsupported":"\u4E0D\u53EF\u6E32\u67D3","layers.noProject":"\u672A\u9009\u62E9\u5DE5\u7A0B","layers.added":"\u56FE\u5C42\u5DF2\u6DFB\u52A0","layers.saveToProject":"\u4FDD\u5B58\u5230\u5DE5\u7A0B","layers.zoomTo":"\u5B9A\u4F4D\u5230\u6570\u636E\u8303\u56F4","layers.addToChat":"\u6DFB\u52A0\u5230\u5BF9\u8BDD","layers.newVector":"\u65B0\u5EFA\u77E2\u91CF\u56FE\u5C42","layers.refresh":"\u5237\u65B0\u56FE\u5C42","layers.editVector":"\u7F16\u8F91\u591A\u8FB9\u5F62","layers.appendVector":"\u8FFD\u52A0\u591A\u8FB9\u5F62","layers.editMode":"\u7F16\u8F91\u591A\u8FB9\u5F62","layers.editSelect":"\u70B9\u51FB\u4E00\u4E2A\u591A\u8FB9\u5F62\u5F00\u59CB\u7F16\u8F91","layers.editHint":"\u62D6\u52A8\u8282\u70B9\u6216\u62D6\u52A8\u591A\u8FB9\u5F62\u5185\u90E8\uFF0C\u4FEE\u6539\u4F1A\u81EA\u52A8\u4FDD\u5B58","layers.editClear":"\u53D6\u6D88\u9009\u62E9","layers.editExit":"\u9000\u51FA\u7F16\u8F91","layers.featureUpdated":"\u8981\u7D20\u5DF2\u66F4\u65B0","layers.featureUpdateFailed":"\u66F4\u65B0\u8981\u7D20\u5931\u8D25","layers.deleteFeature":"\u5220\u9664\u8BE5\u8981\u7D20","layers.featureDeleted":"\u8981\u7D20\u5DF2\u5220\u9664","layers.featureDeleteFailed":"\u5220\u9664\u8981\u7D20\u5931\u8D25","layers.polygon":"\u591A\u8FB9\u5F62","layers.newVectorTitle":"\u65B0\u5EFA\u77E2\u91CF\u56FE\u5C42","layers.vectorName":"\u56FE\u5C42\u540D\u79F0","layers.vectorHint":"\u521B\u5EFA\u540E\u8FDB\u5165\u591A\u8FB9\u5F62\u7ED8\u5236\uFF0C\u5DE6\u952E\u52A0\u70B9\uFF0C\u53F3\u952E\u6216\u201C\u5B8C\u6210\u201D\u95ED\u5408\u4FDD\u5B58\u3002","layers.createVector":"\u521B\u5EFA\u5E76\u7ED8\u5236","layers.drawing":"\u7ED8\u5236\u591A\u8FB9\u5F62","layers.drawHint":"\u5DE6\u952E\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u6216\u201C\u5B8C\u6210\u201D\u95ED\u5408\u591A\u8FB9\u5F62","layers.drawComplete":"\u5B8C\u6210","layers.drawUndo":"\u64A4\u9500","layers.drawCancel":"\u53D6\u6D88","layers.drawMin":"\u81F3\u5C11\u9700\u8981 3 \u4E2A\u70B9\u624D\u80FD\u4FDD\u5B58\u591A\u8FB9\u5F62","layers.drawSaved":"\u591A\u8FB9\u5F62\u5DF2\u4FDD\u5B58","layers.drawFailed":"\u4FDD\u5B58\u591A\u8FB9\u5F62\u5931\u8D25","layers.drawPoints":"{count} \u4E2A\u70B9","layers.addedToChat":"\u56FE\u5C42\u4FE1\u606F\u5DF2\u52A0\u5165\u5BF9\u8BDD\u8F93\u5165\u6846","layers.chatUnavailable":"\u65E0\u6CD5\u5B9A\u4F4D\u5BF9\u8BDD\u8F93\u5165\u6846\uFF0C\u8BF7\u5148\u6253\u5F00\u5730\u56FE\u5BF9\u8BDD","measure.distance":"\u8DDD\u79BB","measure.area":"\u9762\u79EF","measure.hint":"\u5DE6\u952E\u70B9\u51FB\u5730\u56FE\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u6D4B\u91CF","measure.finished":"\u6D4B\u91CF\u5DF2\u5B8C\u6210\uFF08\u53F3\u952E\u7ED3\u675F\uFF09","measure.finish":"\u5B8C\u6210","measure.resume":"\u7EE7\u7EED\u6D4B\u91CF","measure.empty":"\u8FD8\u6CA1\u6709\u6D4B\u91CF\u70B9","measure.undo":"\u64A4\u9500","measure.clear":"\u6E05\u7A7A","measure.points":"{count} \u4E2A\u70B9","annotate.default":"\u6807\u8BB0","annotate.hint":"\u70B9\u51FB\u5730\u56FE\u6DFB\u52A0\u6807\u8BB0","annotate.empty":"\u8FD8\u6CA1\u6709\u6807\u8BB0","annotate.clear":"\u6E05\u7A7A","annotate.delete":"\u5220\u9664\u6807\u8BB0","annotate.locate":"\u5B9A\u4F4D\u5230\u6807\u8BB0","annotate.name":"\u6807\u8BB0\u540D\u79F0","project.title":"\u5DE5\u7A0B","project.select":"\u9009\u62E9\u5DE5\u7A0B","project.new":"\u65B0\u5EFA\u5DE5\u7A0B","project.namePlaceholder":"\u5DE5\u7A0B\u540D\u79F0","project.create":"\u521B\u5EFA","project.cancel":"\u53D6\u6D88","project.loading":"\u52A0\u8F7D\u5DE5\u7A0B\u2026","project.none":"\u6682\u65E0\u5DE5\u7A0B","project.created":"\u5DE5\u7A0B\u5DF2\u521B\u5EFA","project.failed":"\u5DE5\u7A0B\u64CD\u4F5C\u5931\u8D25","project.save":"\u4FDD\u5B58\u5DE5\u7A0B","project.saving":"\u4FDD\u5B58\u4E2D\u2026","project.saved":"\u5DE5\u7A0B\u5DF2\u4FDD\u5B58","project.saveFailed":"\u4FDD\u5B58\u5DE5\u7A0B\u5931\u8D25","project.unsaved":"\u6709\u672A\u4FDD\u5B58\u4FEE\u6539","dataset.manage":"\u6570\u636E\u96C6","dataset.title":"\u6570\u636E\u96C6\u7BA1\u7406","dataset.tabList":"\u5DF2\u6709\u6570\u636E\u96C6","dataset.tabBrowse":"\u670D\u52A1\u5668\u76EE\u5F55","dataset.tabUpload":"\u4E0A\u4F20\u6587\u4EF6","dataset.tabUrl":"\u74E6\u7247 URL","dataset.tabDatabase":"\u6570\u636E\u5E93","dataset.pgDatabase":"pg\u6570\u636E\u5E93","dataset.dbTitle":"PostgreSQL / PostGIS","dataset.dbHint":"\u6CE8\u518C PostGIS \u6570\u636E\u5E93\uFF0C\u9009\u62E9\u7A7A\u95F4\u8868\u5BFC\u5165\u5F53\u524D\u5DE5\u7A0B GPKG \u5E76\u6DFB\u52A0\u4E3A\u56FE\u5C42\u3002","dataset.dbName":"\u8FDE\u63A5\u540D\u79F0","dataset.dbHost":"\u4E3B\u673A","dataset.dbPort":"\u7AEF\u53E3","dataset.dbDatabase":"\u6570\u636E\u5E93","dataset.dbUser":"\u7528\u6237\u540D","dataset.dbPassword":"\u5BC6\u7801","dataset.dbSsl":"SSL \u6A21\u5F0F","dataset.dbRegister":"\u6CE8\u518C\u6570\u636E\u5E93","dataset.dbConnecting":"\u6B63\u5728\u8FDE\u63A5\u5E76\u8BFB\u53D6\u8868...","dataset.dbRegistered":"\u6570\u636E\u5E93\u5DF2\u6CE8\u518C","dataset.dbNoTables":"\u8BE5\u6570\u636E\u5E93\u4E2D\u6CA1\u6709\u53EF\u7528\u7684 PostGIS \u7A7A\u95F4\u8868","dataset.dbTables":"\u7A7A\u95F4\u8868","dataset.dbAddTable":"\u6DFB\u52A0\u4E3A\u56FE\u5C42","dataset.dbImported":"\u6570\u636E\u8868\u5DF2\u5BFC\u5165\u5E76\u6DFB\u52A0\u56FE\u5C42","dataset.dbDelete":"\u5220\u9664\u8FDE\u63A5","dataset.dbSelect":"\u9009\u62E9\u5DF2\u6CE8\u518C\u6570\u636E\u5E93","dataset.dbColumns":"{count} \u4E2A\u5B57\u6BB5","dataset.dbFailed":"\u6570\u636E\u5E93\u64CD\u4F5C\u5931\u8D25","dataset.loading":"\u52A0\u8F7D\u6570\u636E\u96C6\u2026","dataset.empty":"\u8FD8\u6CA1\u6709\u6570\u636E\u96C6","dataset.addLayer":"\u6DFB\u52A0\u4E3A\u56FE\u5C42","dataset.convertCog":"\u8F6C\u4E3A COG","dataset.delete":"\u5220\u9664\u6570\u636E\u96C6","dataset.deleteConfirm":"\u5220\u9664\u8BE5\u6570\u636E\u96C6\u53CA\u5176\u56FE\u5C42\uFF1F","dataset.register":"\u6CE8\u518C\u6570\u636E\u96C6","dataset.upload":"\u4E0A\u4F20\u5E76\u6CE8\u518C","dataset.uploadHint":"\u652F\u6301 GeoJSON\u3001CSV\u3001GeoTIFF\u3001\u56FE\u7247\u548C Shapefile","dataset.urlPlaceholder":"https://\u2026/{z}/{x}/{y}","dataset.urlName":"\u56FE\u5C42\u540D\u79F0","dataset.addUrl":"\u6DFB\u52A0\u74E6\u7247\u6570\u636E\u96C6","dataset.browsePath":"\u8DEF\u5F84","dataset.go":"\u524D\u5F80","dataset.up":"\u4E0A\u7EA7\u76EE\u5F55","dataset.selectFile":"\u9009\u62E9\u6587\u4EF6","dataset.selected":"\u5DF2\u9009\u62E9","dataset.noProject":"\u8BF7\u5148\u521B\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u5DE5\u7A0B","dataset.registered":"\u6570\u636E\u96C6\u5DF2\u6CE8\u518C","dataset.uploadSuccess":"\u6587\u4EF6\u5DF2\u4E0A\u4F20\u5E76\u6CE8\u518C","dataset.uploadSuccessCount":"\u5DF2\u5BFC\u5165 {count} \u4E2A\u6570\u636E\u96C6\u5E76\u6DFB\u52A0\u56FE\u5C42","dataset.uploading":"\u6B63\u5728\u4E0A\u4F20\u2026","dataset.paused":"\u5DF2\u6682\u505C\uFF0C\u53EF\u7EE7\u7EED\u4E0A\u4F20","dataset.completing":"\u6B63\u5728\u5904\u7406\u6570\u636E\uFF08\u5BFC\u5165\u77E2\u91CF / \u8F6C\u6362\u6805\u683C\uFF09\u2026","dataset.resume":"\u7EE7\u7EED\u4E0A\u4F20","dataset.pause":"\u6682\u505C","dataset.uploadResumable":"\u5206\u7247\u4E0A\u4F20 \xB7 \u652F\u6301\u65AD\u70B9\u7EED\u4F20","dataset.uploadProgress":"{percent}% \xB7 {uploaded} / {total}","dataset.uploadFailed":"\u4E0A\u4F20\u5931\u8D25","dataset.conversionFailed":"COG \u8F6C\u6362\u5931\u8D25","dataset.deleted":"\u6570\u636E\u96C6\u5DF2\u5220\u9664","dataset.layerAdded":"\u56FE\u5C42\u5DF2\u6DFB\u52A0","dataset.failed":"\u6570\u636E\u96C6\u64CD\u4F5C\u5931\u8D25","dataset.kind.vector":"\u77E2\u91CF","dataset.kind.raster":"\u6805\u683C","dataset.kind.table":"\u8868","dataset.features":"{count} \u4E2A\u8981\u7D20","dataset.rows":"{count} \u884C","dataset.crs":"CRS {crs}","layers.count":"{count} \u4E2A\u56FE\u5C42","tools.title":"\u5DE5\u5177","tools.layers":"\u56FE\u5C42","tools.measure":"\u6D4B\u91CF","tools.annotate":"\u6807\u8BB0","tools.analyze":"\u7A7A\u95F4\u5206\u6790","tools.data":"\u6570\u636E","tools.pending":"\u8BE5\u5DE5\u5177\u5C06\u5728\u540E\u7EED\u7248\u672C\u63A5\u5165","map.title":"GIS \u5730\u56FE\u89C6\u7A97","map.subtitleEmpty":"\u7A7A\u56FE\u5C42 \xB7 \u7B49\u5F85\u5BF9\u8BDD\u6DFB\u52A0","map.subtitleActive":"{count} \u4E2A\u56FE\u5C42 \xB7 \u5BF9\u8BDD\u9A71\u52A8","map.aria":"GIS \u5730\u56FE\u89C6\u7A97\uFF0C\u53EF\u62D6\u62FD\u5E73\u79FB\u3001\u6EDA\u8F6E\u7F29\u653E","map.reset":"\u91CD\u7F6E\u89C6\u56FE","map.zoomIn":"\u653E\u5927","map.zoomOut":"\u7F29\u5C0F","map.lon":"\u7ECF\u5EA6","map.lat":"\u7EAC\u5EA6","map.zoom":"\u7F29\u653E","map.hint":"\u62D6\u62FD\u5E73\u79FB \xB7 \u6EDA\u8F6E\u7F29\u653E \xB7 \u56FE\u5C42\u901A\u8FC7\u53F3\u4FA7\u5BF9\u8BDD\u6DFB\u52A0","map.attribution":"\xA9 MapLibre","map.emptyTitle":"\u5730\u56FE\u8FD8\u6CA1\u6709\u56FE\u5C42","map.emptyBody":"\u5728\u53F3\u4FA7\u5BF9\u8BDD\u4E2D\u8BF4\u660E\u8981\u6DFB\u52A0\u7684\u56FE\u5C42\uFF0C\u4F8B\u5982\u5929\u5730\u56FE\u5F71\u50CF\u3002","map.emptyPrompt":"\u6DFB\u52A0\u5929\u5730\u56FE\u5F71\u50CF\u56FE\u5C42","map.loading":"\u5730\u56FE\u521D\u59CB\u5316\u4E2D\u2026","map.failed":"\u5730\u56FE\u521D\u59CB\u5316\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 WebGL \u6216\u7F51\u7EDC","gis.tool.title":"\u6DFB\u52A0\u5730\u56FE\u56FE\u5C42","gis.tool.preparing":"\u51C6\u5907\u4E2D","gis.tool.adding":"\u6B63\u5728\u6DFB\u52A0","gis.tool.added":"\u5DF2\u6DFB\u52A0","gis.tool.failed":"\u6DFB\u52A0\u5931\u8D25","gis.tool.defaultName":"\u5929\u5730\u56FE\u5F71\u50CF","gis.tool.viewMap":"\u67E5\u770B\u5730\u56FE","gis.style.title":"\u5730\u56FE\u6837\u5F0F","gis.style.updating":"\u6B63\u5728\u5E94\u7528\u6837\u5F0F","gis.style.updated":"\u6837\u5F0F\u5DF2\u5E94\u7528","gis.style.failed":"\u6837\u5F0F\u5E94\u7528\u5931\u8D25","gis.style.pendingHint":"\u7B49\u5F85\u540E\u7AEF\u6821\u9A8C\u5E76\u4FDD\u5B58\u56FE\u5C42\u6837\u5F0F","gis.style.errorFallback":"\u6837\u5F0F\u66F4\u65B0\u5931\u8D25","gis.style.savedOnly":"\u6837\u5F0F\u5DF2\u4FDD\u5B58\uFF1B\u5F53\u524D\u5730\u56FE\u672A\u52A0\u8F7D\u8BE5\u56FE\u5C42","gis.tool.remove":"\u4ECE\u5730\u56FE\u79FB\u9664","gis.tool.pendingHint":"\u56FE\u5C42\u4F1A\u5728\u7ED3\u679C\u8FD4\u56DE\u540E\u52A0\u5165\u5730\u56FE","gis.tool.errorFallback":"\u56FE\u5C42\u53C2\u6570\u65E0\u6548\uFF0C\u8BF7\u91CD\u8BD5\u3002","gis.view.title":"\u5730\u56FE\u89C6\u91CE","gis.view.locating":"\u6B63\u5728\u5B9A\u4F4D","gis.view.located":"\u5DF2\u5B9A\u4F4D","gis.view.failed":"\u5B9A\u4F4D\u5931\u8D25","gis.view.defaultLabel":"\u76EE\u6807\u533A\u57DF","gis.view.pendingHint":"\u89C6\u91CE\u4F1A\u5728\u7ED3\u679C\u8FD4\u56DE\u540E\u79FB\u52A8","gis.view.errorFallback":"\u89C6\u91CE\u53C2\u6570\u65E0\u6548\uFF0C\u8BF7\u91CD\u8BD5\u3002"},ny={"mode.enter":"Open the GIS workbench","mode.exit":"Return to the standard layout","mode.workbench":"GIS workbench","mode.badge":"Workbench mode","mode.framework":"MapLibre GL JS preview","mode.original":"Standard layout","brand.sub":"MapLibre GL JS \xB7 conversation-driven layers","topbar.stats":"{layers} layers","chat.tab":"Map session","chat.toggle":"Conversation","chat.title":"Map chat","chat.subtitle":"Current session \xB7 map controls","chat.collapse":"Collapse the conversation panel","chat.unavailable":"The conversation panel is unavailable","chat.noSession":"Select a session to start a conversation","layers.title":"Layers","layers.emptyTitle":"No layers yet","layers.emptyBody":"Add layers from datasets, or describe a layer in the conversation.","layers.example":"Open Datasets to register a file or tile layer","layers.raster":"Raster","layers.show":"Show layer","layers.hide":"Hide layer","layers.remove":"Remove layer","layers.project":"Project layers","layers.session":"Session layer","layers.unsupported":"Not renderable","layers.noProject":"No project selected","layers.added":"Layer added","layers.saveToProject":"Save to project","layers.zoomTo":"Zoom to data extent","layers.addToChat":"Add to conversation","layers.newVector":"New vector layer","layers.refresh":"Refresh layers","layers.editVector":"Edit polygon","layers.appendVector":"Append polygon","layers.editMode":"Edit polygon","layers.editSelect":"Click a polygon to start editing","layers.editHint":"Drag a vertex or drag inside the polygon; changes save automatically","layers.editClear":"Clear selection","layers.editExit":"Exit edit","layers.featureUpdated":"Feature updated","layers.featureUpdateFailed":"Could not update feature","layers.deleteFeature":"Delete feature","layers.featureDeleted":"Feature deleted","layers.featureDeleteFailed":"Could not delete feature","layers.polygon":"Polygon","layers.newVectorTitle":"New vector layer","layers.vectorName":"Layer name","layers.vectorHint":"After creation, draw a polygon: left-click points, right-click or Finish to close and save.","layers.createVector":"Create and draw","layers.drawing":"Draw polygon","layers.drawHint":"Left-click points; right-click or Finish to close the polygon","layers.drawComplete":"Finish","layers.drawUndo":"Undo","layers.drawCancel":"Cancel","layers.drawMin":"At least three points are required","layers.drawSaved":"Polygon saved","layers.drawFailed":"Could not save polygon","layers.drawPoints":"{count} points","layers.addedToChat":"Layer context added to the conversation composer","layers.chatUnavailable":"Could not find the conversation composer; open the map chat first","measure.distance":"Distance","measure.area":"Area","measure.hint":"Left-click to add points; right-click to finish","measure.finished":"Measurement finished (right-click)","measure.finish":"Finish","measure.resume":"Resume measuring","measure.empty":"No measurement points yet","measure.undo":"Undo","measure.clear":"Clear","measure.points":"{count} points","annotate.default":"Mark","annotate.hint":"Click the map to add a marker","annotate.empty":"No markers yet","annotate.clear":"Clear","annotate.delete":"Delete marker","annotate.locate":"Center on marker","annotate.name":"Marker name","project.title":"Project","project.select":"Select project","project.new":"New project","project.namePlaceholder":"Project name","project.create":"Create","project.cancel":"Cancel","project.loading":"Loading projects\u2026","project.none":"No projects","project.created":"Project created","project.failed":"Project operation failed","project.save":"Save project","project.saving":"Saving\u2026","project.saved":"Project saved","project.saveFailed":"Could not save project","project.unsaved":"Unsaved changes","dataset.manage":"Datasets","dataset.title":"Dataset manager","dataset.tabList":"Datasets","dataset.tabBrowse":"Server directory","dataset.tabUpload":"Upload file","dataset.tabUrl":"Tile URL","dataset.tabDatabase":"Database","dataset.pgDatabase":"PostgreSQL","dataset.dbTitle":"PostgreSQL / PostGIS","dataset.dbHint":"Register a PostGIS database, import a spatial table into the project GeoPackage, and add it as a layer.","dataset.dbName":"Connection name","dataset.dbHost":"Host","dataset.dbPort":"Port","dataset.dbDatabase":"Database","dataset.dbUser":"Username","dataset.dbPassword":"Password","dataset.dbSsl":"SSL mode","dataset.dbRegister":"Register database","dataset.dbConnecting":"Connecting and reading tables...","dataset.dbRegistered":"Database registered","dataset.dbNoTables":"No PostGIS spatial tables found in this database","dataset.dbTables":"Spatial tables","dataset.dbAddTable":"Add as layer","dataset.dbImported":"Table imported and added as a layer","dataset.dbDelete":"Delete connection","dataset.dbSelect":"Select a registered database","dataset.dbColumns":"{count} columns","dataset.dbFailed":"Database operation failed","dataset.loading":"Loading datasets\u2026","dataset.empty":"No datasets yet","dataset.addLayer":"Add as layer","dataset.convertCog":"Convert to COG","dataset.delete":"Delete dataset","dataset.deleteConfirm":"Delete this dataset and its layers?","dataset.register":"Register dataset","dataset.upload":"Upload and register","dataset.uploadHint":"GeoJSON, CSV, GeoTIFF, images, and Shapefile","dataset.urlPlaceholder":"https://\u2026/{z}/{x}/{y}","dataset.urlName":"Layer name","dataset.addUrl":"Add tile dataset","dataset.browsePath":"Path","dataset.go":"Go","dataset.up":"Parent directory","dataset.selectFile":"Select file","dataset.selected":"Selected","dataset.noProject":"Create or select a project first","dataset.registered":"Dataset registered","dataset.uploadSuccess":"File uploaded and registered","dataset.uploadSuccessCount":"Imported {count} datasets and added layers","dataset.uploading":"Uploading\u2026","dataset.paused":"Paused \u2014 upload can resume","dataset.completing":"Processing data (vector import / raster conversion)\u2026","dataset.resume":"Resume upload","dataset.pause":"Pause","dataset.uploadResumable":"Chunked upload \xB7 resumable","dataset.uploadProgress":"{percent}% \xB7 {uploaded} / {total}","dataset.uploadFailed":"Upload failed","dataset.conversionFailed":"COG conversion failed","dataset.deleted":"Dataset deleted","dataset.layerAdded":"Layer added","dataset.failed":"Dataset operation failed","dataset.kind.vector":"Vector","dataset.kind.raster":"Raster","dataset.kind.table":"Table","dataset.features":"{count} features","dataset.rows":"{count} rows","dataset.crs":"CRS {crs}","layers.count":"{count} layers","tools.title":"Tools","tools.layers":"Layers","tools.measure":"Measure","tools.annotate":"Annotate","tools.analyze":"Spatial analysis","tools.data":"Data","tools.pending":"This tool arrives in a later iteration","map.title":"GIS map view","map.subtitleEmpty":"Empty layers \xB7 waiting for a conversation","map.subtitleActive":"{count} layers \xB7 conversation-driven","map.aria":"GIS map view. Drag to pan and scroll to zoom.","map.reset":"Reset view","map.zoomIn":"Zoom in","map.zoomOut":"Zoom out","map.lon":"Lon","map.lat":"Lat","map.zoom":"Zoom","map.hint":"Drag to pan \xB7 scroll to zoom \xB7 add layers from the conversation on the right","map.attribution":"\xA9 MapLibre","map.emptyTitle":"The map has no layers yet","map.emptyBody":"Describe a layer in the conversation on the right, for example Tianditu imagery.","map.emptyPrompt":"Add the Tianditu image layer","map.loading":"Initializing the map\u2026","map.failed":"The map could not start. Check WebGL and network access.","gis.tool.title":"Add map layer","gis.tool.preparing":"Preparing","gis.tool.adding":"Adding","gis.tool.added":"Added","gis.tool.failed":"Failed","gis.tool.defaultName":"Tianditu imagery","gis.tool.viewMap":"View map","gis.style.title":"Map style","gis.style.updating":"Applying style","gis.style.updated":"Style applied","gis.style.failed":"Style update failed","gis.style.pendingHint":"Waiting for the backend to validate and persist the layer style","gis.style.errorFallback":"Style update failed","gis.style.savedOnly":"Style saved; the layer is not loaded in the current map","gis.tool.remove":"Remove from map","gis.tool.pendingHint":"The layer joins the map after the result settles","gis.tool.errorFallback":"The layer parameters were invalid. Please try again.","gis.view.title":"Map view","gis.view.locating":"Locating","gis.view.located":"Located","gis.view.failed":"Failed","gis.view.defaultLabel":"Target area","gis.view.pendingHint":"The camera moves once the result settles","gis.view.errorFallback":"The view parameters were invalid. Please try again."};function Ig(E,I,O){return Math.min(O,Math.max(I,E))}function Et({name:E,size:I=16,strokeWidth:O=1.6}){let $={width:I,height:I,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:O,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"};return E==="map"?B("svg",$,B("path",{d:"M9 3 3 6v15l6-3 6 3 6-3V3l-6 3-6-3Z"}),B("path",{d:"M9 3v15M15 6v15"})):E==="layers"?B("svg",$,B("path",{d:"m12 3-9 5 9 5 9-5-9-5Z"}),B("path",{d:"m3 12 9 5 9-5M3 16l9 5 9-5"})):E==="image"?B("svg",$,B("rect",{x:3,y:4,width:18,height:16,rx:2}),B("circle",{cx:8.5,cy:9,r:1.5}),B("path",{d:"m21 16-5.5-5L7 20"})):E==="eye"?B("svg",$,B("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"}),B("circle",{cx:12,cy:12,r:2.5})):E==="eye-off"?B("svg",$,B("path",{d:"M3 3l18 18"}),B("path",{d:"M10.6 6.2A10.8 10.8 0 0 1 12 6c6 0 9.5 6 9.5 6a17 17 0 0 1-2.2 3.1M6.3 7.5A17 17 0 0 0 2.5 12s3.5 6 9.5 6a10.8 10.8 0 0 0 4.2-.8"}),B("path",{d:"M9.9 9.9A3 3 0 0 0 14.1 14"})):E==="trash"?B("svg",$,B("path",{d:"M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6M14 11v6"})):E==="ruler"?B("svg",$,B("path",{d:"M3 17 17 3l4 4L7 21l-4-4Z"}),B("path",{d:"m7 13 2 2M10 10l2 2M13 7l2 2"})):E==="pin"?B("svg",$,B("path",{d:"M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11Z"}),B("circle",{cx:12,cy:10,r:2.5})):E==="chart"?B("svg",$,B("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20V8"}),B("path",{d:"M2 20h20"})):E==="folder"?B("svg",$,B("path",{d:"M3 6a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6Z"})):E==="file"?B("svg",$,B("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-6-6Z"}),B("path",{d:"M14 3v6h6"})):E==="locate"?B("svg",$,B("circle",{cx:12,cy:12,r:6.5}),B("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3"}),B("circle",{cx:12,cy:12,r:1.5,fill:"currentColor",stroke:"none"})):E==="refresh"?B("svg",$,B("path",{d:"M20 11a8 8 0 0 0-14.8-3.5L3 10"}),B("path",{d:"M3 5v5h5"}),B("path",{d:"M4 13a8 8 0 0 0 14.8 3.5L21 14"}),B("path",{d:"M21 19v-5h-5"})):E==="pencil"?B("svg",$,B("path",{d:"M4 20l4-1L19 8l-3-3L5 16l-1 4Z"}),B("path",{d:"M14 5l3 3"})):E==="save"?B("svg",$,B("path",{d:"M5 3h11l3 3v15H5V3Z"}),B("path",{d:"M8 3v6h8V3M8 14h8v6H8z"})):E==="upload"?B("svg",$,B("path",{d:"M12 16V4M7 9l5-5 5 5M4 16v4h16v-4"})):E==="chevron-left"?B("svg",$,B("path",{d:"m15 6-6 6 6 6"})):E==="database"?B("svg",$,B("ellipse",{cx:12,cy:5.5,rx:7.5,ry:3}),B("path",{d:"M4.5 5.5v6c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3v-6"}),B("path",{d:"M4.5 11.5v6c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3v-6"})):E==="chat"?B("svg",$,B("path",{d:"M20 15a2 2 0 0 1-2 2H8l-4 4V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10Z"}),B("path",{d:"M8 9h8M8 13h5"})):E==="layout"?B("svg",$,B("rect",{x:3,y:4,width:18,height:16,rx:2}),B("path",{d:"M9 4v16M9 11h12"})):E==="chevron-right"?B("svg",$,B("path",{d:"m9 6 6 6-6 6"})):E==="plus"?B("svg",$,B("path",{d:"M12 5v14M5 12h14"})):E==="minus"?B("svg",$,B("path",{d:"M5 12h14"})):E==="reset"?B("svg",$,B("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),B("path",{d:"M3 4v5h5"})):E==="close"?B("svg",$,B("path",{d:"M6 6l12 12M18 6 6 18"})):E==="warning"?B("svg",$,B("path",{d:"M12 3 2.5 20h19L12 3Z"}),B("path",{d:"M12 9v5M12 17.5v.01"})):B("svg",$,B("circle",{cx:12,cy:12,r:8}))}function _h(){let[E,I]=at(ch);return ft(()=>sp(()=>I(ch())),[]),E}function sy(){let[E,I]=at(cp);return ft(()=>sp(()=>I(cp())),[]),E}function Fg(E){let I=ei(()=>{try{let z=E.theme.getTheme();return z&&z.active&&z.active.colorScheme==="dark"?"dark":"light"}catch{return"light"}},[E]),[O,$]=at(I);return ft(()=>E.on("theme/change",()=>$(I())),[E,I]),O}function Bg(E){if(bl!==E){bl=E;for(let I of[..._p])I()}}function ly(){let[E,I]=at(bl);return ft(()=>{let O=()=>I(bl);return _p.add(O),()=>{_p.delete(O)}},[]),E}function Hn({withMap:E=!1}){return B("style",{"data-gis-workbench":"styles"},E?Xm+`
1513
+ `+up:up)}function cy({runtime:E,t:I,activeTool:O,onToggleLayer:$,onRemoveLayer:z,onSaveLayer:u,onReorderLayers:se,onNotify:Ce,onLayerMenu:$e,onFeatureMenu:Ye,drawTarget:Oe,onSavePolygon:ut,onCancelDraw:Ue,onNewVectorLayer:ke,onEditLayer:Lt,onAppendLayer:Gt,onRefreshLayers:mt,editTarget:Ge,onUpdateFeature:Fi,onCancelEdit:je,projectName:xt}){let Se=Fg(E),Xe=_h(),K=sy(),ee=Tr(0),ne=Tr(null),ve=Tr(null),We=Tr(new Map),ot=Tr(new Set),Ve=Tr(new Map),[Ee,nt]=at(!1),[gt,He]=at(null),[St,Bt]=at(null),[dt,lr]=at(gp),[ti,Ar]=at("distance"),[hi,ht]=at([]),[yi,Xt]=at(!1),[cr,di]=at(null),[vi,_t]=at([]),[vt,qt]=at([]),[Pi,Nt]=at(!1),[It,Pt]=at(null),Qi=Tr(null),ur=Tr([]),Ai=Tr(null),Sr=Tr(0),Ii="gis-measure-source",Te=Tr(new Map),Je=Tr(0);ft(()=>{let Q=ne.current;if(!Q||ve.current)return;let we;try{if(Ko.supported&&!Ko.supported()){He(I("map.failed"));return}we=new Ko.Map({container:Q,style:ay(Se),center:Cg,zoom:gp,minZoom:1,maxZoom:22,localIdeographFontFamily:"sans-serif",attributionControl:!1,logoPosition:"bottom-left",dragRotate:!1,pitchWithRotate:!1,fadeDuration:120,antialias:!0})}catch(ge){console.error("[gis-workbench] map initialization failed",ge),He(I("map.failed"));return}ve.current=we,we.on("load",()=>nt(!0)),we.on("style.load",()=>nt(!0)),we.on("mousemove",ge=>{ge&&ge.lngLat&&Bt({lng:ge.lngLat.lng,lat:ge.lngLat.lat})}),we.on("zoom",()=>lr(we.getZoom())),we.on("mouseout",()=>Bt(null)),we.on("error",ge=>{console.warn("[gis-workbench] map error",ge&&ge.error?ge.error:ge)});try{we.addControl(new Ko.ScaleControl({maxWidth:88,unit:"metric"}),"bottom-left")}catch(ge){console.warn("[gis-workbench] scale control unavailable",ge)}let ae;return typeof ResizeObserver<"u"&&(ae=new ResizeObserver(()=>{try{we.resize()}catch{}}),ae.observe(Q)),()=>{ae&&ae.disconnect(),ve.current=null,We.current=new Map;try{we.remove()}catch{}}},[]),ft(()=>{let Q=ve.current;if(!(!Q||!Ee))try{Q.setPaintProperty("gis-background","background-color",Se==="dark"?"#121b1a":"#e8ece4")}catch(we){console.warn("[gis-workbench] could not update the map background",we)}},[Se,Ee]),ft(()=>{let Q=ve.current;if(!Q||!Ee)return;let we=new Map,ae=be=>{let Re=be.style&&typeof be.style=="object"?be.style:{};return Re.color||Re["fill-color"]||"#2f7d6d"},ge=(be,Re)=>{for(let Ze of Re)try{Q.setLayoutProperty(Ze,"visibility",be.visible?"visible":"none")}catch{}};for(let be of Xe){let Re=be.id;try{if((be.renderKind==="raster-tiles"||be.tileUrl&&!be.renderKind)&&be.tileUrl){let Ze=Re+"-src";Q.getSource(Ze)||Q.addSource(Ze,{type:"raster",tiles:[tg(be.tileUrl)],tileSize:be.tileSize||256,minzoom:be.minzoom??0,maxzoom:be.maxzoom??18,scheme:"xyz",attribution:be.attribution||""}),Q.getLayer(Re)||Q.addLayer({id:Re,type:"raster",source:Ze,paint:{"raster-opacity":be.style&&be.style.opacity!==void 0?be.style.opacity:1,"raster-fade-duration":120}}),ge(be,[Re]),we.set(Re,{sourceId:Ze,layerIds:[Re]});continue}if(be.renderKind==="geojson"&&be.url){let Ze=Re+"-src",st=We.current.get(Re);if(!Q.getSource(Ze))Q.addSource(Ze,{type:"geojson",data:be.url});else if(st&&st.url!==be.url){let sa=Q.getSource(Ze);sa&&typeof sa.setData=="function"&&sa.setData(be.url)}let it=be.style&&typeof be.style=="object"?be.style:{},Zt=it.fillColor||it.lineColor||it.circleColor||it.color||"#2f7d6d",Dt=it.fillOpacity!==void 0?it.fillOpacity:it.opacity!==void 0?it.opacity:.16,he=it.lineOpacity!==void 0?it.lineOpacity:it.opacity!==void 0?it.opacity:.9,$i=it.circleOpacity!==void 0?it.circleOpacity:it.opacity!==void 0?it.opacity:1,Jr=ey(it.categorical,Zt),lt=[Re+"-fill",Re+"-line",Re+"-circle"];Q.getLayer(lt[0])?(Q.setPaintProperty(lt[0],"fill-color",Jr),Q.setPaintProperty(lt[0],"fill-opacity",Dt)):Q.addLayer({id:lt[0],type:"fill",source:Ze,paint:{"fill-color":Jr,"fill-opacity":Dt}}),Q.getLayer(lt[1])?(Q.setPaintProperty(lt[1],"line-color",it.lineColor||Zt),Q.setPaintProperty(lt[1],"line-width",it.lineWidth!==void 0?it.lineWidth:1.4),Q.setPaintProperty(lt[1],"line-opacity",he)):Q.addLayer({id:lt[1],type:"line",source:Ze,paint:{"line-color":it.lineColor||Zt,"line-width":it.lineWidth!==void 0?it.lineWidth:1.4,"line-opacity":he}}),Q.getLayer(lt[2])?(Q.setPaintProperty(lt[2],"circle-color",it.circleColor||Zt),Q.setPaintProperty(lt[2],"circle-radius",it.circleRadius!==void 0?it.circleRadius:3.5),Q.setPaintProperty(lt[2],"circle-opacity",$i)):Q.addLayer({id:lt[2],type:"circle",source:Ze,paint:{"circle-color":it.circleColor||Zt,"circle-radius":it.circleRadius!==void 0?it.circleRadius:3.5,"circle-opacity":$i,"circle-stroke-color":"#ffffff","circle-stroke-width":1}});let Rt=it.label&&it.label.field?it.label:null,Kt=Re+"-label",Bi=Re+"-label-src";if(Rt){let sa=!!Rt.onePerFeature,ho=sa?Bi:Ze;sa?(Q.getSource(Bi)||Q.addSource(Bi,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Ve.current.get(Bi)!==be.url&&(Ve.current.set(Bi,be.url),fetch(be.url,{credentials:"same-origin"}).then(Wi=>{if(!Wi.ok)throw new Error("Label source HTTP "+Wi.status);return Wi.json()}).then(Wi=>{let po=Wi&&Wi.type==="Feature"?[Wi]:Wi&&Array.isArray(Wi.features)?Wi.features:[],la=[];for(let Qr of po){let kr=vp(Qr&&Qr.geometry);kr&&la.push({type:"Feature",properties:Qr.properties||{},geometry:{type:"Point",coordinates:kr}})}let ze=ve.current&&ve.current.getSource(Bi);ze&&ze.setData({type:"FeatureCollection",features:la})}).catch(Wi=>{Ve.current.delete(Bi),console.warn("[gis-workbench] could not build one-per-feature label points",Wi)}))):Q.getSource(Bi)&&(Q.getLayer(Kt)&&Q.removeLayer(Kt),Q.removeSource(Bi),Ve.current.delete(Bi)),Q.getLayer(Kt)&&Q.getLayer(Kt).source!==ho&&Q.removeLayer(Kt),Q.getLayer(Kt)?(Q.setLayoutProperty(Kt,"text-field",Rg(Rt)),Q.setLayoutProperty(Kt,"text-size",Rt.size!==void 0?Rt.size:12),Q.setLayoutProperty(Kt,"text-allow-overlap",!!Rt.allowOverlap),Rt.anchor&&Q.setLayoutProperty(Kt,"text-anchor",Rt.anchor),Array.isArray(Rt.font)&&Rt.font.length>0&&Q.setLayoutProperty(Kt,"text-font",Rt.font),Q.setPaintProperty(Kt,"text-color",Rt.color||"#16423a"),Q.setPaintProperty(Kt,"text-halo-color",Rt.haloColor||"rgba(255, 255, 255, 0.92)"),Q.setPaintProperty(Kt,"text-halo-width",Rt.haloWidth!==void 0?Rt.haloWidth:1.2),Q.setLayerZoomRange(Kt,Rt.minzoom!==void 0?Rt.minzoom:12,Rt.maxzoom!==void 0?Rt.maxzoom:24)):Q.addLayer(ry(Kt,ho,Rt)),lt.push(Kt)}else Q.getLayer(Kt)&&Q.removeLayer(Kt),Q.getSource(Bi)&&(Q.removeSource(Bi),Ve.current.delete(Bi));ge(be,lt);try{Q.setLayoutProperty(lt[1],"visibility",be.visible&&it.lineVisible!==!1?"visible":"none"),Q.setLayoutProperty(lt[2],"visibility",be.visible&&it.circleVisible!==!1?"visible":"none")}catch{}we.set(Re,{sourceId:Ze,layerIds:lt,url:be.url});continue}if(be.renderKind==="image"&&be.url&&Array.isArray(be.bbox)&&be.bbox.length===4){let Ze=Re+"-src",[st,it,Zt,Dt]=be.bbox;Q.getSource(Ze)||Q.addSource(Ze,{type:"image",url:be.url,coordinates:[[st,Dt],[Zt,Dt],[Zt,it],[st,it]]}),Q.getLayer(Re)||Q.addLayer({id:Re,type:"raster",source:Ze,paint:{"raster-opacity":be.style&&be.style.opacity!==void 0?be.style.opacity:1}}),ge(be,[Re]),we.set(Re,{sourceId:Ze,layerIds:[Re]})}}catch(Ze){console.warn("[gis-workbench] could not add the map layer",Ze)}}for(let[be,Re]of We.current)if(!we.has(be))try{for(let Ze of Re.layerIds)Q.getLayer(Ze)&&Q.removeLayer(Ze);Q.getSource(Re.sourceId)&&Q.removeSource(Re.sourceId),Q.getSource(be+"-label-src")&&Q.removeSource(be+"-label-src"),Ve.current.delete(be+"-label-src")}catch(Ze){console.warn("[gis-workbench] could not remove the map layer",Ze)}We.current=we;for(let be of Xe){let Re=we.get(be.id);if(Re){for(let Ze of Re.layerIds)if(Q.getLayer(Ze))try{Q.moveLayer(Ze)}catch{}}}let qe=Xe.filter(be=>Array.isArray(be.bbox)&&be.bbox.length===4&&be.renderKind!=="unsupported"&&!ot.current.has(be.id));if(qe.length>0){let be=1/0,Re=1/0,Ze=-1/0,st=-1/0;for(let it of qe){let[Zt,Dt,he,$i]=it.bbox.map(Number);[Zt,Dt,he,$i].every(Number.isFinite)&&(be=Math.min(be,Zt),Re=Math.min(Re,Dt),Ze=Math.max(Ze,he),st=Math.max(st,$i))}if(Number.isFinite(be)&&Number.isFinite(Re)&&Number.isFinite(Ze)&&Number.isFinite(st))try{Q.fitBounds([[be,Re],[Ze,st]],{padding:70,maxZoom:20,duration:0});for(let it of qe)ot.current.add(it.id)}catch(it){console.warn("[gis-workbench] could not fit the map to the dataset bounds",it)}}},[Xe,Ee]);let Yt=ei(async()=>{if(!Oe||Pi)return;if(vt.length<3){Ce&&Ce(I("layers.drawMin"));return}let Q=[...vt,vt[0]];Nt(!0);try{await ut(Oe,{type:"Polygon",coordinates:[Q]}),qt([])}catch(we){Ce&&Ce(we instanceof Error?we.message:I("layers.drawFailed"))}finally{Nt(!1)}},[Oe,vt,Pi,ut,Ce,I]),jt=ei(()=>{qt([]),Ue&&Ue()},[Ue]),Zi=ei(async()=>{let Q=Qi.current;if(!(!Ge||!Q||!Array.isArray(Q.ring)||Q.ring.length<3))try{await Fi(Ge,Q,Q.ring)}catch(we){Ce&&Ce(we instanceof Error?we.message:I("layers.featureUpdateFailed"))}},[Ge,Fi,Ce,I]);ft(()=>{Qi.current=It},[It]);let hr=Q=>{let we=ve.current;if(!we||!Q||!Array.isArray(Q.bbox)||Q.bbox.length!==4)return;let[ae,ge,qe,be]=Q.bbox.map(Number);if(!(![ae,ge,qe,be].every(Number.isFinite)||ae===qe||ge===be))try{we.fitBounds([[ae,ge],[qe,be]],{padding:70,maxZoom:20,duration:800})}catch(Re){console.warn("[gis-workbench] could not locate the layer extent",Re)}},Ur=Q=>{let we=ve.current;we&&(Q>1?we.zoomIn():we.zoomOut())};ft(()=>{let Q=ve.current;if(!(!Q||!Ee||!K)&&ee.current!==K.token){ee.current=K.token;try{Q.flyTo({center:K.center,zoom:K.zoom,bearing:0,pitch:0,duration:1400,essential:!0})}catch(we){console.warn("[gis-workbench] could not move the map view",we)}}},[K,Ee]);let Ga=()=>{let Q=ve.current;Q&&Q.flyTo({center:Cg,zoom:gp,bearing:0,pitch:0})};return ft(()=>{let Q=ve.current;if(!(!Q||!Ee))return Q.getSource(Ii)||(Q.addSource(Ii,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Q.addLayer({id:"gis-measure-fill",type:"fill",source:Ii,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":"#2f7d6d","fill-opacity":.18}}),Q.addLayer({id:"gis-measure-line",type:"line",source:Ii,filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"#2f7d6d","line-width":2,"line-dasharray":[2,1]}}),Q.addLayer({id:"gis-measure-points",type:"circle",source:Ii,filter:["==",["geometry-type"],"Point"],paint:{"circle-radius":4,"circle-color":"#ffffff","circle-stroke-color":"#2f7d6d","circle-stroke-width":2}}),Q.addSource("gis-measure-rubber-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Q.addLayer({id:"gis-measure-rubber-fill",type:"fill",source:"gis-measure-rubber-source",filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":"#e8843f","fill-opacity":.12}}),Q.addLayer({id:"gis-measure-rubber-line",type:"line",source:"gis-measure-rubber-source",paint:{"line-color":"#e8843f","line-width":1.6,"line-dasharray":[4,3]}})),()=>{try{for(let we of["gis-measure-rubber-line","gis-measure-rubber-fill","gis-measure-points","gis-measure-line","gis-measure-fill"])Q.getLayer(we)&&Q.removeLayer(we);Q.getSource("gis-measure-rubber-source")&&Q.removeSource("gis-measure-rubber-source"),Q.getSource(Ii)&&Q.removeSource(Ii)}catch{}}},[Ee,Ii]),ft(()=>{let Q=ve.current,we=Q&&Q.getSource(Ii);if(!(!we||!Ee)){we.setData(my(hi,ti));for(let ae of["gis-measure-fill","gis-measure-line","gis-measure-points","gis-measure-rubber-fill","gis-measure-rubber-line"])Q.getLayer(ae)&&Q.moveLayer(ae)}},[hi,ti,Ee,Ii]),ft(()=>{let Q=ve.current,we=Q&&Q.getSource("gis-measure-rubber-source");if(!we||!Ee)return;let ae=()=>{we.setData({type:"FeatureCollection",features:[]}),di(null)};if(O!=="measure"||yi||hi.length===0){ae();return}let ge=hi[hi.length-1],qe=Re=>{if(!Re||!Re.lngLat)return;let Ze=[Re.lngLat.lng,Re.lngLat.lat],st=ti==="area"&&hi.length>=2?[...hi,Ze,hi[0]]:null,it=[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:st||[ge,Ze]}}];st&&it.push({type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[st]}}),we.setData({type:"FeatureCollection",features:it});let Zt=Date.now();Zt-Sr.current>=40&&(Sr.current=Zt,di(Ze))},be=()=>ae();return Q.on("mousemove",qe),Q.on("mouseout",be),()=>{Q.off("mousemove",qe),Q.off("mouseout",be),ae()}},[O,yi,ti,hi,Ee]),ft(()=>{let Q=ve.current;if(!(!Q||!Ee))for(let we of["gis-measure-fill","gis-measure-line","gis-measure-points","gis-measure-rubber-fill","gis-measure-rubber-line"])Q.getLayer(we)&&Q.moveLayer(we)},[Xe,Ee]),ft(()=>{let Q=ve.current;if(!Q||!Ee||Oe||Ge||O!=="measure"&&O!=="annotate")return;let we=ae=>{let ge=ae.lngLat.lng,qe=ae.lngLat.lat;if(O==="measure")yi||ht(be=>[...be,[ge,qe]]);else if(O==="annotate"){Je.current+=1;let be=Je.current;_t(Re=>[...Re,{id:"annotation-"+Date.now()+"-"+be,lng:ge,lat:qe,label:I("annotate.default")+" "+be}])}};return Q.on("click",we),O==="measure"&&Q.doubleClickZoom.disable(),()=>{if(Q.off("click",we),O==="measure")try{Q.doubleClickZoom.enable()}catch{}}},[O,Oe,Ge,yi,Ee,I]),ft(()=>{let Q=ve.current;if(!Q||!Ee)return;let we=Q.getCanvas(),ae=we.style.cursor;return Oe?we.style.cursor="crosshair":Ge?we.style.cursor="default":(O==="measure"||O==="annotate")&&(we.style.cursor=O==="measure"&&yi?"default":"crosshair"),()=>{we.style.cursor=ae}},[O,Ee,yi,Oe,Ge]),ft(()=>{let Q=ve.current;if(!Q||!Ee||Oe||Ge||O!=="measure")return;let we=qe=>{qe&&qe.originalEvent&&typeof qe.originalEvent.preventDefault=="function"&&qe.originalEvent.preventDefault(),Xt(!0)},ae=qe=>qe.preventDefault(),ge=Q.getCanvas();return Q.on("contextmenu",we),ge.addEventListener("contextmenu",ae),()=>{Q.off("contextmenu",we),ge.removeEventListener("contextmenu",ae)}},[O,Oe,Ge,Ee]),ft(()=>{qt([])},[Oe&&Oe.layerId]),ft(()=>{let Q=ve.current;if(!(!Q||!Ee))return Q.getSource("gis-draw-source")||(Q.addSource("gis-draw-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Q.addLayer({id:"gis-draw-fill",type:"fill",source:"gis-draw-source",filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":"#e8843f","fill-opacity":.18}}),Q.addLayer({id:"gis-draw-line",type:"line",source:"gis-draw-source",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"#e8843f","line-width":2,"line-dasharray":[2,1]}}),Q.addLayer({id:"gis-draw-points",type:"circle",source:"gis-draw-source",filter:["==",["geometry-type"],"Point"],paint:{"circle-radius":4,"circle-color":"#ffffff","circle-stroke-color":"#e8843f","circle-stroke-width":2}}),Q.addSource("gis-draw-preview-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Q.addLayer({id:"gis-draw-preview-fill",type:"fill",source:"gis-draw-preview-source",filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":"#e8843f","fill-opacity":.12}}),Q.addLayer({id:"gis-draw-preview-line",type:"line",source:"gis-draw-preview-source",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"#e8843f","line-width":1.6,"line-dasharray":[4,3]}})),()=>{try{for(let we of["gis-draw-preview-line","gis-draw-preview-fill","gis-draw-points","gis-draw-line","gis-draw-fill"])Q.getLayer(we)&&Q.removeLayer(we);Q.getSource("gis-draw-preview-source")&&Q.removeSource("gis-draw-preview-source"),Q.getSource("gis-draw-source")&&Q.removeSource("gis-draw-source")}catch{}}},[Ee]),ft(()=>{let Q=ve.current,we=Q&&Q.getSource("gis-draw-source");if(!(!we||!Ee)){we.setData(gy(vt));for(let ae of["gis-draw-fill","gis-draw-line","gis-draw-points","gis-draw-preview-fill","gis-draw-preview-line"])Q.getLayer(ae)&&Q.moveLayer(ae)}},[vt,Ee]),ft(()=>{let Q=ve.current,we=Q&&Q.getSource("gis-draw-preview-source");if(!we||!Ee)return;let ae=()=>we.setData({type:"FeatureCollection",features:[]});if(!Oe||vt.length===0){ae();return}let ge=vt[vt.length-1],qe=Re=>{if(!Re||!Re.lngLat)return;let Ze=[Re.lngLat.lng,Re.lngLat.lat],st=[];if(vt.length>=2){let it=[...vt,Ze,vt[0]];st.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:it}}),st.push({type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[it]}})}else st.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[ge,Ze]}});we.setData({type:"FeatureCollection",features:st})},be=()=>ae();return Q.on("mousemove",qe),Q.on("mouseout",be),()=>{Q.off("mousemove",qe),Q.off("mouseout",be),ae()}},[Oe,vt,Ee]),ft(()=>{let Q=ve.current;if(!(!Q||!Ee))for(let we of["gis-draw-fill","gis-draw-line","gis-draw-points","gis-draw-preview-fill","gis-draw-preview-line"])Q.getLayer(we)&&Q.moveLayer(we)},[Xe,Ee]),ft(()=>{let Q=ve.current;if(!Q||!Ee||!Oe)return;let we=be=>{let Re=be.lngLat.lng,Ze=be.lngLat.lat;qt(st=>[...st,[Re,Ze]])},ae=be=>{be&&be.originalEvent&&typeof be.originalEvent.preventDefault=="function"&&be.originalEvent.preventDefault(),Yt()},ge=be=>be.preventDefault(),qe=Q.getCanvas();return Q.on("click",we),Q.on("contextmenu",ae),qe.addEventListener("contextmenu",ge),Q.doubleClickZoom.disable(),()=>{Q.off("click",we),Q.off("contextmenu",ae),qe.removeEventListener("contextmenu",ge);try{Q.doubleClickZoom.enable()}catch{}}},[Oe,Ee,Yt]),ft(()=>{if(!Oe||typeof window>"u")return;let Q=we=>{we.key==="Escape"&&jt()};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[Oe,jt]),ft(()=>{let Q=ve.current;if(!Q||!Ee)return;let we=ae=>{if(Oe||Ge||O==="measure")return;let ge=ae.point;if(ge)for(let qe of Xe){if(qe.source!=="project"||qe.sourceFormat!=="drawn")continue;let be=[qe.id+"-fill",qe.id+"-line"].filter(st=>Q.getLayer(st));if(be.length===0)continue;let Re=Q.queryRenderedFeatures(ge,{layers:be});if(!Re.length)continue;ae.originalEvent&&typeof ae.originalEvent.preventDefault=="function"&&ae.originalEvent.preventDefault();let Ze=Re[0].properties||{};Ye&&Ye(ae.originalEvent&&ae.originalEvent.clientX?ae.originalEvent.clientX:typeof window<"u"?window.innerWidth/2:0,ae.originalEvent&&ae.originalEvent.clientY?ae.originalEvent.clientY:typeof window<"u"?window.innerHeight/2:0,qe,{name:Ze.name,createdAt:Ze.created_at});return}};return Q.on("contextmenu",we),()=>Q.off("contextmenu",we)},[O,Oe,Ge,Xe,Ee,Ye]),ft(()=>{Pt(null),Qi.current=null},[Ge&&Ge.layerId]),ft(()=>{let Q=ve.current;if(!(!Q||!Ee))return Q.getSource("gis-edit-source")||(Q.addSource("gis-edit-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),Q.addLayer({id:"gis-edit-fill",type:"fill",source:"gis-edit-source",filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":"#ffb84d","fill-opacity":.18}}),Q.addLayer({id:"gis-edit-line",type:"line",source:"gis-edit-source",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"#ff9f1a","line-width":2.2}})),()=>{try{Q.getLayer("gis-edit-line")&&Q.removeLayer("gis-edit-line"),Q.getLayer("gis-edit-fill")&&Q.removeLayer("gis-edit-fill"),Q.getSource("gis-edit-source")&&Q.removeSource("gis-edit-source")}catch{}}},[Ee]),ft(()=>{let Q=ve.current,we=Q&&Q.getSource("gis-edit-source");if(!(!we||!Ee)){we.setData(It?iy(It.ring):{type:"FeatureCollection",features:[]});for(let ae of["gis-edit-fill","gis-edit-line"])Q.getLayer(ae)&&Q.moveLayer(ae)}},[It,Ee]),ft(()=>{let Q=ve.current;if(!Q||!Ee||!Ge)return;let we=Xe.find(ge=>ge.layerId===Ge.layerId);if(!we)return;let ae=ge=>{let qe=[we.id+"-fill",we.id+"-line"].filter(st=>Q.getLayer(st)),be=Q.queryRenderedFeatures(ge.point,{layers:qe});if(!be.length){Pt(null);return}let Re=ty(be[0].geometry);if(!Re)return;let Ze=be[0].properties||{};Pt({name:Ze.name,createdAt:Ze.created_at,ring:Re})};return Q.on("click",ae),()=>Q.off("click",ae)},[Ge,Xe,Ee]),ft(()=>{let Q=ve.current;for(let ae of ur.current)ae.remove();if(ur.current=[],!Q||!Ee||!It||!Array.isArray(It.ring))return;let we=It.ring;for(let ae=0;ae<we.length-1;ae+=1){let ge=document.createElement("div");ge.className="gis-vertex-marker";let qe=new Ko.Marker({element:ge,draggable:!0,anchor:"center"}).setLngLat(we[ae]).addTo(Q);qe.on("drag",()=>{let be=Qi.current;if(!be)return;let Re=qe.getLngLat(),Ze=be.ring.map(it=>it.slice());Ze[ae]=[Re.lng,Re.lat];let st=Object.assign({},be,{ring:Ze});Qi.current=st,Pt(st)}),qe.on("dragend",()=>{Zi()}),ur.current.push(qe)}return()=>{for(let ae of ur.current)ae.remove();ur.current=[]}},[It&&It.name,It&&It.createdAt,Ge&&Ge.layerId,Ee,Zi]),ft(()=>{let Q=ve.current;if(!Q||!Ee||!Ge)return;let we=Xe.find(be=>be.layerId===Ge.layerId);if(!we)return;Q.dragPan.disable();let ae=be=>{let Re=Qi.current;if(!Re)return;let Ze=[we.id+"-fill"].filter(Zt=>Q.getLayer(Zt)),st=Q.queryRenderedFeatures(be.point,{layers:Ze});if(!st.length)return;let it=st[0].properties||{};it.name!==Re.name||it.created_at!==Re.createdAt||(Ai.current={start:[be.lngLat.lng,be.lngLat.lat],ring:Re.ring.map(Zt=>Zt.slice()),moved:!1})},ge=be=>{let Re=Ai.current,Ze=Qi.current;if(!Re||!Ze)return;let st=be.lngLat.lng-Re.start[0],it=be.lngLat.lat-Re.start[1];(Math.abs(st)>1e-10||Math.abs(it)>1e-10)&&(Re.moved=!0);let Zt=Re.ring.map(he=>[he[0]+st,he[1]+it]),Dt=Object.assign({},Ze,{ring:Zt});Qi.current=Dt,Pt(Dt),ur.current.forEach((he,$i)=>{Zt[$i]&&he.setLngLat(Zt[$i])})},qe=()=>{if(!Ai.current)return;let be=Ai.current.moved;Ai.current=null,be&&Zi()};return Q.on("mousedown",ae),Q.on("mousemove",ge),Q.on("mouseup",qe),()=>{Q.off("mousedown",ae),Q.off("mousemove",ge),Q.off("mouseup",qe),Ai.current=null;try{Q.dragPan.enable()}catch{}}},[Ge,Xe,Ee,Zi]),ft(()=>{if(!Ge||typeof window>"u")return;let Q=we=>{we.key==="Escape"&&je()};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[Ge,je]),ft(()=>{let Q=ve.current;if(!Q||!Ee)return;let we=new Set;vi.forEach((ae,ge)=>{we.add(ae.id);let qe=Te.current.get(ae.id);if(qe)qe.setLngLat([ae.lng,ae.lat]);else{let Re=document.createElement("div");Re.className="gis-marker",Re.addEventListener("click",Ze=>Ze.stopPropagation()),qe=new Ko.Marker({element:Re,anchor:"bottom"}).setLngLat([ae.lng,ae.lat]).addTo(Q),Te.current.set(ae.id,qe)}let be=qe.getElement();be.textContent=String(ge+1),be.title=ae.label,be.setAttribute("aria-label",ae.label)});for(let[ae,ge]of Te.current)we.has(ae)||(ge.remove(),Te.current.delete(ae))},[vi,Ee]),ft(()=>()=>{for(let Q of Te.current.values())try{Q.remove()}catch{}Te.current.clear()},[]),B("div",{className:"gis-map-shell"+(O==="measure"&&!yi?" is-measuring":"")},B("div",{ref:ne,className:"gis-map",role:"application","aria-label":I("map.aria"),"data-maplibre-version":Ko&&Ko.version||"maplibre"}),!Ee&&!gt?B("div",{className:"gis-map-loading"},B("span",{className:"gis-loading-dot"}),I("map.loading")):null,gt?B("div",{className:"gis-map-error"},B(Et,{name:"warning",size:13}),gt):null,Ee&&!gt&&Xe.length===0?B("div",{className:"gis-empty"},B("div",{className:"gis-empty-icon"},B(Et,{name:"layers",size:23})),B("div",{className:"gis-empty-title"},I("map.emptyTitle")),B("div",{className:"gis-empty-body"},I("map.emptyBody")),B("div",{className:"gis-empty-prompt"},B(Et,{name:"chat",size:12}),I("map.emptyPrompt"))):null,B("div",{className:"gis-map-title-card"},B("span",{className:"gis-map-title-text"},I("map.title")),B("span",{className:"gis-map-title-sub"},Xe.length===0?I("map.subtitleEmpty"):I("map.subtitleActive",{count:Xe.length}))),B("div",{className:"gis-map-actions"},B("div",{className:"gis-compass",title:"N","aria-hidden":"true"},B("svg",{width:22,height:22,viewBox:"0 0 22 22"},B("circle",{cx:11,cy:11,r:9,fill:"none",stroke:"var(--dsw-alias-border-l2)",strokeWidth:1}),B("path",{d:"M11 3.5 13.2 11H8.8L11 3.5Z",fill:"var(--dsw-alias-brand-primary)"}),B("path",{d:"M11 18.5 8.8 11h4.4L11 18.5Z",fill:"var(--dsw-alias-label-secondary)"}),B("text",{x:11,y:2.6,textAnchor:"middle",style:{fontSize:"4.5px",fontWeight:700,fill:"var(--dsw-alias-label-secondary)"}},"N"))),B("button",{type:"button",className:"gis-icon-btn",title:I("map.zoomIn"),"aria-label":I("map.zoomIn"),onClick:()=>Ur(1.25)},B(Et,{name:"plus",size:16})),B("button",{type:"button",className:"gis-icon-btn",title:I("map.zoomOut"),"aria-label":I("map.zoomOut"),onClick:()=>Ur(.8)},B(Et,{name:"minus",size:16})),B("button",{type:"button",className:"gis-icon-btn",title:I("map.reset"),"aria-label":I("map.reset"),onClick:Ga},B(Et,{name:"reset",size:15}))),B("div",{className:"gis-readout"},B("span",{className:"gis-readout-item"},B("span",{className:"gis-readout-key"},I("map.lon")),B("span",{className:"gis-readout-val"},St?St.lng.toFixed(4)+"\xB0":"\u2014")),B("span",{className:"gis-readout-item"},B("span",{className:"gis-readout-key"},I("map.lat")),B("span",{className:"gis-readout-val"},St?St.lat.toFixed(4)+"\xB0":"\u2014")),B("span",{className:"gis-readout-item"},B("span",{className:"gis-readout-key"},I("map.zoom")),B("span",{className:"gis-readout-val"},dt.toFixed(1)))),B("div",{className:"gis-hint"},I("map.hint")),Oe?B(vy,{t:I,target:Oe,points:vt,saving:Pi,onUndo:()=>qt(Q=>Q.slice(0,-1)),onFinish:Yt,onCancel:jt}):Ge?B(yy,{t:I,target:Ge,feature:It,onClear:()=>Pt(null),onExit:je,onAppend:()=>Gt&&Gt(Ge)}):O==="measure"?B(_y,{t:I,mode:ti,points:hi,hover:cr,finished:yi,onMode:Q=>{Ar(Q),ht([]),Xt(!1)},onUndo:()=>{ht(Q=>Q.slice(0,-1)),Xt(!1)},onClear:()=>{ht([]),Xt(!1)},onFinish:()=>Xt(!0),onResume:()=>Xt(!1)}):O==="annotate"?B(by,{t:I,annotations:vi,onRename:(Q,we)=>_t(ae=>ae.map(ge=>ge.id===Q?Object.assign({},ge,{label:we}):ge)),onDelete:Q=>_t(we=>we.filter(ae=>ae.id!==Q)),onClear:()=>_t([]),onFocus:Q=>{let we=ve.current;we&&we.flyTo({center:[Q.lng,Q.lat],zoom:Math.max(we.getZoom(),16),duration:800})}}):O==="layers"?B(uy,{t:I,onToggleLayer:$,onRemoveLayer:z,onSaveLayer:u,onReorderLayers:se,onLocateLayer:hr,onNotify:Ce,onLayerMenu:$e,onNewVectorLayer:ke,onEditLayer:Lt,onAppendLayer:Gt,onRefreshLayers:mt,projectName:xt}):null)}function uy({t:E,onToggleLayer:I,onRemoveLayer:O,onSaveLayer:$,onReorderLayers:z,onLocateLayer:u,onNotify:se,onLayerMenu:Ce,onNewVectorLayer:$e,onEditLayer:Ye,onAppendLayer:Oe,onRefreshLayers:ut,projectName:Ue}){let ke=_h(),[Lt,Gt]=at(null),[mt,Ge]=at(null),Fi=[...new Set(ke.map(je=>je.attribution).filter(Boolean))].join(" \xB7 ");return B("div",{className:"gis-panel"},B("div",{className:"gis-panel-head"},B("span",{className:"gis-panel-title"},E("layers.title")),B("div",{className:"gis-panel-head-actions"},B("span",{className:"gis-panel-count"},ke.length),ut?B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",title:E("layers.refresh"),"aria-label":E("layers.refresh"),onClick:ut},B(Et,{name:"refresh",size:12})):null,$e?B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",title:E("layers.newVector"),"aria-label":E("layers.newVector"),onClick:$e},B(Et,{name:"plus",size:12})):null)),ke.length===0?B("div",{className:"gis-layer-empty"},B("span",{className:"gis-layer-empty-title"},E("layers.emptyTitle")),B("span",{className:"gis-layer-empty-body"},E("layers.emptyBody")),B("span",{className:"gis-layer-example"},E("layers.example"))):B("div",{className:"gis-layer-list"},ke.map(je=>B("div",{key:je.key,className:"gis-layer-item"+(je.renderKind==="unsupported"?" is-unsupported":"")+(Lt===je.key?" is-dragging":"")+(mt&&mt.key===je.key?" is-drop-"+(mt.after?"after":"before"):""),draggable:!0,title:je.name,"aria-grabbed":Lt===je.key,onContextMenu:xt=>{xt.preventDefault(),xt.stopPropagation(),Ce&&Ce(xt,je)},onDragStart:xt=>{Gt(je.key);try{xt.dataTransfer.effectAllowed="move",xt.dataTransfer.setData("text/plain",je.key)}catch{}},onDragEnd:()=>{Gt(null),Ge(null)},onDragOver:xt=>{if(!Lt||Lt===je.key)return;xt.preventDefault();try{xt.dataTransfer.dropEffect="move"}catch{}let Se=xt.currentTarget.getBoundingClientRect(),Xe=xt.clientY>Se.top+Se.height/2;Ge({key:je.key,after:Xe})},onDragLeave:xt=>{(!xt.relatedTarget||!xt.currentTarget.contains(xt.relatedTarget))&&Ge(null)},onDrop:xt=>{xt.preventDefault();let Se=Lt||xt.dataTransfer&&xt.dataTransfer.getData("text/plain"),Xe=xt.currentTarget.getBoundingClientRect(),K=mt&&mt.key===je.key?mt.after:xt.clientY>Xe.top+Xe.height/2;Gt(null),Ge(null),Se&&Se!==je.key&&z&&z(Se,je.key,K)}},B("span",{className:"gis-layer-thumb"},B(Et,{name:je.renderKind==="unsupported"?"file":"image",size:15})),B("div",{className:"gis-layer-copy"},B("span",{className:"gis-layer-name",title:je.name},je.name),B("span",{className:"gis-layer-meta"},je.source==="project"?Og(je.datasetKind,E)+(xp(je.format,je.sourceFormat,E)?" \xB7 "+xp(je.format,je.sourceFormat,E):"")+(je.renderKind==="unsupported"?" \xB7 "+E("layers.unsupported"):""):E("layers.session")+" \xB7 "+E("layers.raster")),je.style&&je.style.categorical&&je.style.categorical.values?B("div",{className:"gis-layer-legend"},Object.entries(je.style.categorical.values).map(([xt,Se])=>B("span",{key:xt,className:"gis-legend-item"},B("span",{className:"gis-legend-swatch",style:{background:Se.color}}),B("span",{className:"gis-legend-label"},Se.label||xt)))):null),B("div",{className:"gis-layer-actions"},Array.isArray(je.bbox)&&je.bbox.length===4?B("button",{type:"button",className:"gis-layer-action",title:E("layers.zoomTo"),"aria-label":E("layers.zoomTo"),onClick:()=>{u&&u(je)}},B(Et,{name:"locate",size:13})):null,je.source==="project"&&je.sourceFormat==="drawn"&&Ye?B("button",{type:"button",className:"gis-layer-action",title:E("layers.editVector"),"aria-label":E("layers.editVector"),onClick:()=>Ye(je)},B(Et,{name:"pencil",size:13})):null,je.source==="project"&&je.sourceFormat==="drawn"&&Oe?B("button",{type:"button",className:"gis-layer-action",title:E("layers.appendVector"),"aria-label":E("layers.appendVector"),onClick:()=>Oe({datasetId:je.datasetId,layerId:je.layerId,name:je.name})},B(Et,{name:"plus",size:13})):null,je.source!=="project"&&$?B("button",{type:"button",className:"gis-layer-action",title:E("layers.saveToProject"),"aria-label":E("layers.saveToProject"),onClick:()=>$(je)},B(Et,{name:"database",size:13})):null,B("button",{type:"button",className:"gis-layer-action"+(je.visible?"":" is-off"),title:je.visible?E("layers.hide"):E("layers.show"),"aria-label":je.visible?E("layers.hide"):E("layers.show"),"aria-pressed":je.visible,onClick:()=>{I?I(je):lp(je.key)}},B(Et,{name:je.visible?"eye":"eye-off",size:13})),B("button",{type:"button",className:"gis-layer-action",title:E("layers.remove"),"aria-label":E("layers.remove"),onClick:()=>{O?O(je):hh(je.key)}},B(Et,{name:"trash",size:13})))))),B("div",{className:"gis-panel-foot"},(Ue?Ue+" \xB7 ":"")+E("map.attribution")+(Fi?" \xB7 "+Fi:"")))}var bp=63710088e-1;function $n(E){return Number(E)*Math.PI/180}function hy(E){let I=0;for(let O=1;O<E.length;O+=1){let[$,z]=E[O-1],[u,se]=E[O],Ce=$n(se-z),$e=$n(u-$),Ye=Math.sin(Ce/2)**2+Math.cos($n(z))*Math.cos($n(se))*Math.sin($e/2)**2;I+=2*bp*Math.asin(Math.min(1,Math.sqrt(Ye)))}return I}function dy(E){if(E.length<3)return 0;let I=0;for(let O=0;O<E.length;O+=1){let[$,z]=E[O],[u,se]=E[(O+1)%E.length];I+=$n(u-$)*(2+Math.sin($n(z))+Math.sin($n(se)))}return Math.abs(I*bp*bp/2)}function py(E){return!Number.isFinite(E)||E<=0?"\u2014":E<1e3?E.toFixed(1)+" m":(E/1e3).toFixed(2)+" km"}function fy(E){return!Number.isFinite(E)||E<=0?"\u2014":E<1e6?E.toFixed(1)+" m\xB2":(E/1e6).toFixed(2)+" km\xB2"}function my(E,I){let O=[],$=I==="area"&&E.length>=3?[...E,E[0]]:E;$.length>=2&&O.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:$}}),I==="area"&&$.length>=4&&O.push({type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[$]}});for(let z of E)O.push({type:"Feature",properties:{},geometry:{type:"Point",coordinates:z}});return{type:"FeatureCollection",features:O}}function gy(E){let I=[],O=E.length>=3?[...E,E[0]]:E;O.length>=2&&I.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:O}}),E.length>=3&&I.push({type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[O]}});for(let $ of E)I.push({type:"Feature",properties:{},geometry:{type:"Point",coordinates:$}});return{type:"FeatureCollection",features:I}}function _y({t:E,mode:I,points:O,hover:$,finished:z,onMode:u,onUndo:se,onClear:Ce,onFinish:$e,onResume:Ye}){let Oe=$&&!z?[...O,$]:O,ut=I==="area"?Oe.length>=3?fy(dy(Oe)):"\u2014":Oe.length>=2?py(hy(Oe)):"\u2014",Ue=I==="area"?O.length>=3:O.length>=2,ke=z?E("measure.finished"):O.length===0?E("measure.empty"):E("measure.hint");return B("div",{className:"gis-panel gis-tool-panel"},B("div",{className:"gis-panel-head"},B("span",{className:"gis-panel-title"},E("tools.measure")),B("div",{className:"gis-panel-head-actions"},B("span",{className:"gis-panel-count"},E("measure.points",{count:O.length})),z?B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm gis-measure-close",title:E("measure.clear"),"aria-label":E("measure.clear"),onClick:Ce},B(Et,{name:"close",size:12})):null)),B("div",{className:"gis-measure-tabs"},B("button",{type:"button",className:"gis-tab"+(I==="distance"?" is-active":""),onClick:()=>u("distance")},E("measure.distance")),B("button",{type:"button",className:"gis-tab"+(I==="area"?" is-active":""),onClick:()=>u("area")},E("measure.area"))),B("div",{className:"gis-measure-value"},ut),B("div",{className:"gis-tool-hint"+(z?" is-finished":"")},ke),B("div",{className:"gis-tool-actions"},z?B("button",{type:"button",className:"gis-tool-btn",onClick:Ye},E("measure.resume")):[B("button",{key:"undo",type:"button",className:"gis-tool-btn",disabled:O.length===0,onClick:se},E("measure.undo")),B("button",{key:"finish",type:"button",className:"gis-tool-btn gis-btn-primary",disabled:!Ue,onClick:$e},E("measure.finish"))],B("button",{type:"button",className:"gis-tool-btn",disabled:O.length===0,onClick:Ce},E("measure.clear"))))}function yy({t:E,target:I,feature:O,onClear:$,onExit:z,onAppend:u}){return B("div",{className:"gis-panel gis-tool-panel"},B("div",{className:"gis-panel-head"},B("span",{className:"gis-panel-title"},E("layers.editMode")),B("span",{className:"gis-panel-count"},O?O.name||E("layers.polygon"):"")),B("div",{className:"gis-draw-target",title:I?I.name:""},I?I.name:""),B("div",{className:"gis-tool-hint"},E(O?"layers.editHint":"layers.editSelect")),B("div",{className:"gis-tool-actions"},O?B("button",{type:"button",className:"gis-tool-btn",onClick:$},E("layers.editClear")):null,B("button",{type:"button",className:"gis-tool-btn",onClick:u},E("layers.appendVector")),B("button",{type:"button",className:"gis-tool-btn",onClick:z},E("layers.editExit"))))}function vy({t:E,target:I,points:O,saving:$,onUndo:z,onFinish:u,onCancel:se}){return B("div",{className:"gis-panel gis-tool-panel"},B("div",{className:"gis-panel-head"},B("span",{className:"gis-panel-title"},E("layers.drawing")),B("span",{className:"gis-panel-count"},E("layers.drawPoints",{count:O.length}))),B("div",{className:"gis-draw-target",title:I?I.name:""},I?I.name:""),B("div",{className:"gis-tool-hint"},E("layers.drawHint")),B("div",{className:"gis-tool-actions"},B("button",{type:"button",className:"gis-tool-btn",disabled:O.length===0,onClick:z},E("layers.drawUndo")),B("button",{type:"button",className:"gis-tool-btn gis-btn-primary",disabled:$||O.length<3,onClick:u},E("layers.drawComplete")),B("button",{type:"button",className:"gis-tool-btn",onClick:se},E("layers.drawCancel"))))}function by({t:E,annotations:I,onRename:O,onDelete:$,onClear:z,onFocus:u}){return B("div",{className:"gis-panel gis-tool-panel"},B("div",{className:"gis-panel-head"},B("span",{className:"gis-panel-title"},E("tools.annotate")),B("span",{className:"gis-panel-count"},I.length)),I.length===0?B("div",{className:"gis-layer-empty"},E("annotate.empty")):B("div",{className:"gis-annotation-list"},I.map((se,Ce)=>B("div",{key:se.id,className:"gis-annotation-row"},B("span",{className:"gis-annotation-index"},String(Ce+1)),B("input",{className:"gis-input gis-annotation-input",value:se.label,title:E("annotate.name"),"aria-label":E("annotate.name"),onChange:$e=>O(se.id,$e.target.value)}),B("button",{type:"button",className:"gis-layer-action",title:E("annotate.locate"),"aria-label":E("annotate.locate"),onClick:()=>u(se)},B(Et,{name:"locate",size:12})),B("button",{type:"button",className:"gis-layer-action",title:E("annotate.delete"),"aria-label":E("annotate.delete"),onClick:()=>$(se.id)},B(Et,{name:"trash",size:12}))))),B("div",{className:"gis-tool-hint"},E("annotate.hint")),B("div",{className:"gis-tool-actions"},B("button",{type:"button",className:"gis-tool-btn",disabled:I.length===0,onClick:z},E("annotate.clear"))))}function ph(E){let I=Number(E);return!Number.isFinite(I)||I<=0?"\u2014":I<1024?I+" B":I<1024*1024?(I/1024).toFixed(1)+" KB":I<1024*1024*1024?(I/(1024*1024)).toFixed(1)+" MB":(I/(1024*1024*1024)).toFixed(1)+" GB"}function xp(E,I,O){return I==="postgis"?O("dataset.pgDatabase"):E||""}function Og(E,I){return I("dataset.kind."+(E||"table"))}function xy(E,I){let O=E&&E.profile?E.profile:{},$=[Og(E&&E.kind,I)];return(O.format||O.sourceFormat)&&$.push(xp(O.format,O.sourceFormat,I)),Number.isFinite(O.featureCount)&&$.push(I("dataset.features",{count:O.featureCount})),Number.isFinite(O.rowCountSample)&&$.push(I("dataset.rows",{count:O.rowCountSample})),Number.isFinite(O.sizeBytes)&&$.push(ph(O.sizeBytes)),E&&E.crs&&$.push(I("dataset.crs",{crs:E.crs})),O.conversionError&&$.push(I("dataset.conversionFailed")),$.join(" \xB7 ")}function zg(E){let I=String(E||"");return!I||/^https?:/i.test(I)||I.startsWith("//")?I:I.startsWith("/")&&typeof window<"u"&&window.location&&window.location.origin?window.location.origin+I:I}function wy(E,I){let O=E.dataset||{},$=O.profile||{},z=O.format||$.format,u=Array.isArray(O.bbox)?O.bbox:null,se="unsupported",Ce,$e;if(O.kind==="raster"&&z==="xyz")se="raster-tiles",Ce=O.uri;else if(O.kind==="raster"&&z==="cog"&&O.tilesUrl&&$.renderable!==!1)se="raster-tiles",Ce=O.tilesUrl;else if(O.kind==="vector"&&(z==="geojson"||z==="gpkg")&&$.renderable!==!1){se="geojson";let Ye=O.contentUrl||mp(O.id),Oe=[$.updatedAt||"",$.featureCount??0,u?u.join(","):"",$.previewSizeBytes??0].join("|");$e=zg(Ye)+(Ye.includes("?")?"&":"?")+"v="+encodeURIComponent(Oe)}else O.kind==="raster"&&z==="image"&&u&&(se="image",$e=zg(O.contentUrl||mp(O.id)));return{key:"project:"+E.id,name:E.name||$.name||O.uri||"\u56FE\u5C42",visible:E.visible!==!1,z:Number.isFinite(Number(E.z))?Number(E.z):0,source:"project",persisted:!0,layerId:E.id,datasetId:E.datasetId,projectId:I,renderKind:se,tileUrl:Ce,url:$e,bbox:u,style:E.style&&typeof E.style=="object"?E.style:{},datasetKind:O.kind,format:z,sourceFormat:$.sourceFormat,layerName:$.layerName||"",fields:Array.isArray($.fields)?$.fields:[],attribution:$.attribution||"\u5929\u5730\u56FE",tileSize:$.tileSize||256,minzoom:$.minzoom??0,maxzoom:$.maxzoom??18}}function dh(E){let I=E&&E.profile?E.profile:{};if(I.name)return I.name;if(I.fileName)return I.fileName;let O=String(E&&E.uri?E.uri:""),z=O.split(/[?#]/)[0].split("/");return z[z.length-1]||O||"\u6570\u636E\u96C6"}function Ty({t:E,onClose:I,onCreate:O}){let[$,z]=at(""),[u,se]=at(!1),[Ce,$e]=at("");return B("div",{className:"gis-modal",onMouseDown:Oe=>{Oe.target===Oe.currentTarget&&I()}},B("form",{className:"gis-modal-card gis-modal-small",onSubmit:async Oe=>{Oe.preventDefault();let ut=$.trim();if(!(!ut||u)){se(!0),$e("");try{await O(ut),I()}catch(Ue){$e(Ue instanceof Error?Ue.message:String(Ue))}finally{se(!1)}}}},B("div",{className:"gis-modal-head"},B("div",{className:"gis-modal-title"},E("project.new")),B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",onClick:I,"aria-label":E("project.cancel")},B(Et,{name:"close",size:14}))),B("div",{className:"gis-modal-body"},B("label",{className:"gis-field-label"},E("project.title")),B("input",{className:"gis-input",value:$,autoFocus:!0,placeholder:E("project.namePlaceholder"),onChange:Oe=>z(Oe.target.value)}),Ce?B("div",{className:"gis-form-error"},Ce):null),B("div",{className:"gis-modal-actions"},B("button",{type:"button",className:"gis-btn",onClick:I},E("project.cancel")),B("button",{type:"submit",className:"gis-btn gis-btn-primary",disabled:u||!$.trim()},E(u?"project.loading":"project.create")))))}function Sy({t:E,onClose:I,onCreate:O}){let[$,z]=at(""),[u,se]=at(!1),[Ce,$e]=at("");return B("div",{className:"gis-modal",onMouseDown:Oe=>{Oe.target===Oe.currentTarget&&I()}},B("form",{className:"gis-modal-card gis-modal-small",onSubmit:async Oe=>{Oe.preventDefault();let ut=$.trim();if(!(!ut||u)){se(!0),$e("");try{await O(ut),I()}catch(Ue){$e(Ue instanceof Error?Ue.message:String(Ue))}finally{se(!1)}}}},B("div",{className:"gis-modal-head"},B("div",{className:"gis-modal-title"},E("layers.newVectorTitle")),B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",onClick:I,"aria-label":E("project.cancel")},B(Et,{name:"close",size:14}))),B("div",{className:"gis-modal-body"},B("label",{className:"gis-field-label"},E("layers.vectorName")),B("input",{className:"gis-input",value:$,autoFocus:!0,placeholder:E("layers.newVectorTitle"),onChange:Oe=>z(Oe.target.value)}),B("div",{className:"gis-tool-hint"},E("layers.vectorHint")),Ce?B("div",{className:"gis-form-error"},Ce):null),B("div",{className:"gis-modal-actions"},B("button",{type:"button",className:"gis-btn",onClick:I},E("project.cancel")),B("button",{type:"submit",className:"gis-btn gis-btn-primary",disabled:u||!$.trim()},E(u?"project.loading":"layers.createVector")))))}function Py(E){return[E.name,E.size,E.lastModified||0].join(":")}function wp(E){return"gis-workbench.upload."+E}function My(E){try{return window.localStorage.getItem(wp(E))||""}catch{return""}}function Ag(E,I){try{I?window.localStorage.setItem(wp(E),I):window.localStorage.removeItem(wp(E))}catch{}}var kg=8*1024*1024;function Cy({projectId:E,t:I,onClose:O,onChanged:$,notify:z}){let[u,se]=at("list"),[Ce,$e]=at([]),[Ye,Oe]=at(!1),[ut,Ue]=at(""),[ke,Lt]=at(null),[Gt,mt]=at(""),[Ge,Fi]=at(null),[je,xt]=at(null),[Se,Xe]=at(null),[K,ee]=at(!1),[ne,ve]=at(0),[We,ot]=at(0),[Ve,Ee]=at("idle"),[nt,gt]=at(""),He=Tr(null),St=Tr(!1),[Bt,dt]=at(Gn),[lr,ti]=at(yl),[Ar,hi]=at([]),[ht,yi]=at(""),[Xt,cr]=at([]),[di,vi]=at(!1),[_t,vt]=at(""),[qt,Pi]=at({name:"",host:"127.0.0.1",port:5432,dbname:"",username:"",password:"",sslmode:"prefer"}),Nt=ei(ae=>{let ge=ae instanceof Error?ae.message:String(ae||I("dataset.failed"));Ue(ge),z&&z(ge)},[z,I]),It=ei(async()=>{if(E)try{let ae=await cg(E);$e(ae)}catch(ae){Nt(ae)}},[E,Nt]),Pt=ei(async ae=>{Oe(!0);try{let ge=await pg(ae);Lt(ge),mt(ge.path),Fi(null)}catch(ge){Nt(ge)}finally{Oe(!1)}},[Nt]),Qi=ei(async()=>{if(E)try{let ae=await yg(E);hi(ae),yi(ge=>ge&&ae.some(qe=>qe.id===ge)?ge:ae[0]?ae[0].id:"")}catch(ae){vt(ae instanceof Error?ae.message:I("dataset.dbFailed"))}},[E,I]),ur=ei(async ae=>{if(ae){vi(!0),vt("");try{let ge=await xg(ae);cr(ge),ge.length===0&&vt(I("dataset.dbNoTables"))}catch(ge){cr([]),vt(ge instanceof Error?ge.message:I("dataset.dbFailed"))}finally{vi(!1)}}},[I]);ft(()=>{It()},[It]),ft(()=>{u==="database"&&Qi()},[u]),ft(()=>{u==="database"&&ht&&ur(ht)},[ht]),ft(()=>{u==="browse"&&!ke&&Pt(Gt||void 0)},[u]);let Ai=async ae=>{if(!Ye){Oe(!0);try{await fp(E,{datasetId:ae.id,name:dh(ae)}),Ue(I("dataset.layerAdded")),$&&$()}catch(ge){Nt(ge)}finally{Oe(!1)}}},Sr=async ae=>{if(!Ye){Oe(!0),Ue("");try{let ge=await hg(ae.id);ge&&ge.profile&&ge.profile.renderable?((await pp(E)).some(be=>be.datasetId===ge.id)?Ue(I("dataset.registered")):(await fp(E,{datasetId:ge.id,name:dh(ge)}),Ue(I("dataset.layerAdded"))),$&&$()):Ue(I("dataset.conversionFailed")),await It()}catch(ge){Nt(ge)}finally{Oe(!1)}}},Ii=async ae=>{if(!Ye&&!(typeof window<"u"&&!window.confirm(I("dataset.deleteConfirm")))){Oe(!0);try{await dg(ae.id),Ue(I("dataset.deleted")),await It(),$&&$()}catch(ge){Nt(ge)}finally{Oe(!1)}}},Te=async()=>{if(!(!Ge||Ye)){Oe(!0);try{await ug(E,{path:Ge.path,addLayer:!0}),Ue(I("dataset.registered")),Fi(null),await It(),$&&$()}catch(ae){Nt(ae)}finally{Oe(!1)}}};ft(()=>()=>{St.current=!0,He.current&&He.current.abort()},[]);let Je=ae=>{K||(St.current=!1,xt(ae||null),Xe(null),ve(0),ot(0),Ee("idle"),gt(""))},Yt=async()=>{if(!je||K)return;let ae=je,ge=Py(ae);St.current=!1,ee(!0),Ee("uploading"),gt("");let qe=Se;try{let be=qe&&qe.id?qe.id:My(ge);if(be)try{let Dt=await mg(be);Dt&&Dt.status==="uploading"&&Dt.fileName===ae.name&&Number(Dt.size)===ae.size?qe=Dt:qe=null}catch{qe=null}qe||(qe=await fg(E,{fileName:ae.name,size:ae.size,chunkSize:kg,fingerprint:ge}),Ag(ge,qe.id)),Xe(qe);let Re=Number(qe.chunkSize)||kg,Ze=new Set(Array.isArray(qe.receivedChunks)?qe.receivedChunks:[]),st=0;for(let Dt=0;Dt<qe.totalChunks;Dt+=1){if(!Ze.has(Dt))continue;let he=Dt*Re;st+=Math.min(Re,ae.size-he)}ot(st),ve(ae.size>0?Math.min(99,Math.round(st/ae.size*100)):0);for(let Dt=0;Dt<qe.totalChunks&&!St.current;Dt+=1){if(Ze.has(Dt))continue;let he=Dt*Re,$i=Math.min(ae.size,he+Re),Jr=ae.slice(he,$i),lt=new AbortController;He.current=lt;let Rt=Kt=>{if(ae.size<=0){ve(99);return}ve(Math.min(99,Math.round((st+Kt)/ae.size*100)))};await _g(qe.id,Dt,Jr,Rt,lt.signal),Ze.add(Dt),st+=Jr.size,ot(st),ve(ae.size>0?Math.min(99,Math.round(st/ae.size*100)):99),qe=Object.assign({},qe,{receivedChunks:[...Ze].sort((Kt,Bi)=>Kt-Bi)}),Xe(qe)}if(He.current=null,St.current){Ee("paused"),ee(!1);return}Ee("completing");let it=await gg(qe.id,{addLayer:!0}),Zt=Array.isArray(it&&it.datasets)?it.datasets.length:1;Ag(ge,""),Xe(null),xt(null),Ee("done"),ve(100),ot(ae.size),Ue(Zt>1?I("dataset.uploadSuccessCount",{count:Zt}):I("dataset.uploadSuccess")),await It(),$&&$()}catch(be){if(St.current||be&&be.name==="AbortError"){Ee("paused"),ee(!1);return}Ee("error"),gt(be instanceof Error?be.message:I("dataset.uploadFailed")),Nt(be)}finally{He.current=null,ee(!1)}},jt=()=>{St.current=!0,Ee("pausing"),He.current&&He.current.abort()},Zi=async()=>{if(!(!Bt.trim()||Ye)){Oe(!0);try{await dp(E,{name:lr.trim()||yl,tileUrl:Bt.trim(),addLayer:!0}),Ue(I("dataset.registered")),await It(),$&&$()}catch(ae){Nt(ae)}finally{Oe(!1)}}},hr=async()=>{if(!di){if(!qt.host.trim()||!qt.dbname.trim()||!qt.username.trim()){vt(I("dataset.dbFailed"));return}vi(!0),vt(I("dataset.dbConnecting"));try{let ae=await vg(E,Object.assign({},qt,{name:qt.name.trim()||qt.dbname.trim()}));hi(ge=>[...ge,ae]),yi(ae.id),Pi(ge=>Object.assign({},ge,{name:ae.name})),await ur(ae.id),vt(I("dataset.dbRegistered"))}catch(ae){vt(ae instanceof Error?ae.message:I("dataset.dbFailed"))}finally{vi(!1)}}},Ur=async ae=>{if(!(di||!ae)&&!(typeof window<"u"&&typeof window.confirm=="function"&&!window.confirm(I("dataset.dbDelete")+"?"))){vi(!0);try{await bg(ae.id);let ge=Ar.filter(qe=>qe.id!==ae.id);hi(ge),yi(ge[0]?ge[0].id:""),cr([])}catch(ge){vt(ge instanceof Error?ge.message:I("dataset.dbFailed"))}finally{vi(!1)}}},Ga=async ae=>{if(!(di||!ht)){vi(!0),vt("");try{await wg(ht,{schema:ae.schema,table:ae.table,addLayer:!0}),vt(I("dataset.dbImported")),await It(),$&&$()}catch(ge){Nt(ge)}finally{vi(!1)}}},Q=[["list",I("dataset.tabList")],["browse",I("dataset.tabBrowse")],["upload",I("dataset.tabUpload")],["database",I("dataset.tabDatabase")],["url",I("dataset.tabUrl")]],we;if(u==="list")we=B("div",{className:"gis-dataset-list"},Ce.length===0?B("div",{className:"gis-layer-empty"},I("dataset.empty")):null,Ce.map(ae=>B("div",{key:ae.id,className:"gis-dataset-card"},B("div",{className:"gis-dataset-icon"},B(Et,{name:ae.kind==="raster"?"image":ae.kind==="vector"?"map":"database",size:16})),B("div",{className:"gis-dataset-copy"},B("div",{className:"gis-dataset-name",title:dh(ae)},dh(ae)),B("div",{className:"gis-dataset-meta"},xy(ae,I)),B("div",{className:"gis-dataset-uri",title:ae.uri},ae.uri)),B("div",{className:"gis-dataset-actions"},ae.kind==="raster"&&ae.profile&&(ae.profile.format==="geotiff"||ae.profile.conversionError||ae.profile.format==="cog"&&ae.profile.renderable===!1)?B("button",{type:"button",className:"gis-tool-btn is-primary",disabled:Ye,onClick:()=>Sr(ae)},I("dataset.convertCog")):B("button",{type:"button",className:"gis-tool-btn is-primary",disabled:Ye||ae.profile&&ae.profile.renderable===!1,onClick:()=>Ai(ae)},I("dataset.addLayer")),B("button",{type:"button",className:"gis-link-button",disabled:Ye,onClick:()=>Ii(ae)},I("dataset.delete"))))));else if(u==="browse")we=B("div",{className:"gis-browse"},B("div",{className:"gis-browse-bar"},B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",title:I("dataset.up"),disabled:!ke||!ke.parent||Ye,onClick:()=>ke&&ke.parent&&Pt(ke.parent)},B(Et,{name:"chevron-left",size:14})),B("input",{className:"gis-input gis-input-mono",value:Gt,onChange:ae=>mt(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&Pt(Gt)}}),B("button",{type:"button",className:"gis-btn",disabled:Ye,onClick:()=>Pt(Gt)},I("dataset.go"))),ke&&ke.roots&&ke.roots.length>1?B("div",{className:"gis-browse-roots"},ke.roots.map(ae=>B("button",{key:ae,type:"button",className:"gis-root-chip"+(ke.path===ae?" is-active":""),onClick:()=>Pt(ae),title:ae},ae))):null,B("div",{className:"gis-browse-list"},!ke&&Ye?B("div",{className:"gis-empty-note"},I("dataset.loading")):null,ke?ke.entries.map(ae=>B("button",{key:ae.path,type:"button",className:"gis-browse-row"+(Ge&&Ge.path===ae.path?" is-selected":"")+(ae.type==="file"&&!ae.supported?" is-disabled":""),disabled:Ye||ae.type==="file"&&!ae.supported,onClick:()=>{ae.type==="directory"?Pt(ae.path):Fi(ae)}},B("span",{className:"gis-browse-icon"},B(Et,{name:ae.type==="directory"?"folder":"file",size:14})),B("span",{className:"gis-browse-name"},ae.name),B("span",{className:"gis-browse-meta"},ae.type==="directory"?"":(ae.kindHint||"file")+" \xB7 "+ph(ae.size)))):null),B("div",{className:"gis-browse-foot"},B("span",{className:"gis-selected-path",title:Ge?Ge.path:""},Ge?I("dataset.selected")+": "+Ge.name:I("dataset.selectFile")),B("button",{type:"button",className:"gis-btn gis-btn-primary",disabled:!Ge||Ye,onClick:Te},I(Ye?"dataset.loading":"dataset.register"))));else if(u==="upload"){let ae=Ve==="uploading"||Ve==="pausing"?I("dataset.uploading"):Ve==="paused"?I("dataset.paused"):Ve==="completing"?I("dataset.completing"):Ve==="done"?I("dataset.uploadSuccess"):Ve==="error"?nt||I("dataset.uploadFailed"):I("dataset.uploadResumable");we=B("div",{className:"gis-upload"},B("div",{className:"gis-layer-empty"},B("div",{className:"gis-layer-empty-title"},I("dataset.upload")),B("div",{className:"gis-layer-empty-body"},I("dataset.uploadHint")),B("div",{className:"gis-upload-hint"},I("dataset.uploadResumable"))),B("input",{type:"file",className:"gis-file-input",disabled:K,onChange:ge=>Je(ge.target.files&&ge.target.files[0]?ge.target.files[0]:null)}),je||ne>0?B("div",{className:"gis-upload-progress"},B("div",{className:"gis-progress-track"},B("div",{className:"gis-progress-fill",style:{width:ne+"%"}})),B("div",{className:"gis-progress-meta"},I("dataset.uploadProgress",{percent:ne,uploaded:ph(We),total:ph(je?je.size:We)}))):null,B("div",{className:"gis-upload-status"+(Ve==="error"?" is-error":"")},ae),B("div",{className:"gis-browse-foot"},B("span",{className:"gis-selected-path"},je?je.name:I("dataset.selectFile")),K||Ve==="pausing"?B("button",{type:"button",className:"gis-btn",disabled:Ve==="pausing",onClick:jt},I("dataset.pause")):Ve==="done"?null:B("button",{type:"button",className:"gis-btn gis-btn-primary",disabled:!je||Ve==="completing",onClick:Yt},I(Ve==="paused"?"dataset.resume":"dataset.upload"))))}else if(u==="database"){let ae=(ge,qe,be={})=>B("div",{className:"gis-db-field"},B("label",{className:"gis-field-label"},qe),B("input",Object.assign({},be,{className:"gis-input"+(be.mono?" gis-input-mono":""),value:qt[ge],disabled:di,onChange:Re=>Pi(Ze=>Object.assign({},Ze,{[ge]:Re.target.value}))})));we=B("div",{className:"gis-database"},B("div",{className:"gis-db-heading"},B("div",{className:"gis-db-title"},I("dataset.dbTitle")),B("div",{className:"gis-tool-hint"},I("dataset.dbHint"))),Ar.length>0?B("div",{className:"gis-db-list"},B("div",{className:"gis-field-label"},I("dataset.dbSelect")),Ar.map(ge=>B("div",{key:ge.id,className:"gis-db-item"+(ge.id===ht?" is-active":"")},B("button",{type:"button",className:"gis-db-select",onClick:()=>yi(ge.id),title:ge.host+":"+ge.port+"/"+ge.dbname},B(Et,{name:"database",size:13}),ge.name),B("button",{type:"button",className:"gis-link-button",disabled:di,onClick:()=>Ur(ge)},I("dataset.dbDelete"))))):null,B("div",{className:"gis-db-form"},ae("name",I("dataset.dbName"),{placeholder:"gis"}),ae("host",I("dataset.dbHost"),{placeholder:"127.0.0.1"}),ae("port",I("dataset.dbPort"),{type:"number",min:1,max:65535}),ae("dbname",I("dataset.dbDatabase"),{placeholder:"gis"}),ae("username",I("dataset.dbUser"),{placeholder:"postgres"}),ae("password",I("dataset.dbPassword"),{type:"password",autoComplete:"off"}),ae("sslmode",I("dataset.dbSsl"),{placeholder:"prefer"})),B("div",{className:"gis-browse-foot"},B("span",{className:"gis-db-status"},di?I("dataset.dbConnecting"):_t),B("button",{type:"button",className:"gis-btn gis-btn-primary",disabled:di,onClick:hr},I("dataset.dbRegister"))),ht&&Xt.length>0?B("div",{className:"gis-db-tables"},B("div",{className:"gis-field-label"},I("dataset.dbTables")),Xt.map(ge=>B("div",{key:ge.schema+"."+ge.table,className:"gis-db-table"},B("div",{className:"gis-db-table-copy"},B("div",{className:"gis-db-table-name",title:ge.schema+"."+ge.table},ge.schema+"."+ge.table),B("div",{className:"gis-db-table-meta"},(ge.geometryType||"geometry")+" \xB7 EPSG:"+(ge.srid||"?")+" \xB7 "+I("dataset.dbColumns",{count:ge.columns?ge.columns.length:0}))),B("button",{type:"button",className:"gis-tool-btn is-primary",disabled:di,onClick:()=>Ga(ge)},I("dataset.dbAddTable"))))):null)}else we=B("div",{className:"gis-upload"},B("label",{className:"gis-field-label"},I("dataset.urlName")),B("input",{className:"gis-input",value:lr,onChange:ae=>ti(ae.target.value)}),B("label",{className:"gis-field-label"},I("dataset.tabUrl")),B("input",{className:"gis-input gis-input-mono",value:Bt,onChange:ae=>dt(ae.target.value),placeholder:I("dataset.urlPlaceholder")}),B("div",{className:"gis-browse-foot"},B("span",{className:"gis-selected-path"},""),B("button",{type:"button",className:"gis-btn gis-btn-primary",disabled:!Bt.trim()||Ye,onClick:Zi},I(Ye?"dataset.loading":"dataset.addUrl"))));return B("div",{className:"gis-modal",onMouseDown:ae=>{ae.target===ae.currentTarget&&O()}},B("div",{className:"gis-modal-card gis-data-modal"},B("div",{className:"gis-modal-head"},B("div",{className:"gis-modal-title"},I("dataset.title")),B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",onClick:O,"aria-label":I("project.cancel")},B(Et,{name:"close",size:14}))),B("div",{className:"gis-tabs"},Q.map(([ae,ge])=>B("button",{key:ae,type:"button",className:"gis-tab"+(u===ae?" is-active":""),onClick:()=>se(ae)},ge))),ut?B("div",{className:"gis-modal-message"},ut):null,B("div",{className:"gis-modal-body"},we)))}var Ey=[{id:"layers",key:"tools.layers",icon:"layers"},{id:"measure",key:"tools.measure",icon:"ruler"},{id:"annotate",key:"tools.annotate",icon:"pin"},{id:"analyze",key:"tools.analyze",icon:"chart"},{id:"data",key:"tools.data",icon:"database"}];function Iy({runtime:E,t:I}){let O=Fg(E),$=_h(),[z,u]=at("layers"),[se,Ce]=at(null),[$e,Ye]=at([]),[Oe,ut]=at(!0),[Ue,ke]=at(()=>{try{return window.localStorage.getItem("gis-workbench.project")||""}catch{return""}}),[Lt,Gt]=at(0),[mt,Ge]=at(!1),[Fi,je]=at(!1),[xt,Se]=at(!1),[Xe,K]=at(null),[ee,ne]=at(!1),[ve,We]=at(!1),[ot,Ve]=at(null),[Ee,nt]=at(null),gt=Tr(""),[He,St]=at(null),Bt=Tr(null);ft(()=>()=>{Bt.current&&clearTimeout(Bt.current)},[]);let dt=ei(Te=>{Bt.current&&clearTimeout(Bt.current),Ce(Te),Bt.current=setTimeout(()=>{Bt.current=null,Ce(null)},2600)},[]),lr=ei(Te=>{if(Te==="layers"){u(Je=>Je==="layers"?"none":"layers");return}u(Te),Te==="analyze"&&dt(I("tools.pending"))},[dt,I]),ti=ei(()=>{Gt(Te=>Te+1)},[]);ft(()=>{let Te=!0;return ng().then(Je=>{if(!Te)return;let Yt=Array.isArray(Je.projects)?Je.projects:[];Ye(Yt);let jt="";try{jt=window.localStorage.getItem("gis-workbench.project")||""}catch{jt=""}let Zi=Yt.some(hr=>hr.id===jt)?jt:Je.defaultProjectId||Yt[0]&&Yt[0].id||"";ke(Zi),ut(!1)}).catch(Je=>{Te&&(ut(!1),console.warn("[gis-workbench] could not load projects",Je),dt(Je instanceof Error?Je.message:I("project.failed")))}),()=>{Te=!1}},[dt,I]),ft(()=>{if(!ee||typeof window>"u")return;let Te=Je=>{Je.preventDefault(),Je.returnValue=""};return window.addEventListener("beforeunload",Te),()=>{window.removeEventListener("beforeunload",Te)}},[ee]),ft(()=>{try{Ue&&window.localStorage.setItem("gis-workbench.project",Ue)}catch{}},[Ue]),ft(()=>{let Te=!0;if(!Ue){uh(null,[]),gt.current="";return}return gt.current!==Ue&&(gt.current=Ue,uh(Ue,[])),pp(Ue).then(Je=>{Te&&uh(Ue,(Je||[]).map(Yt=>wy(Yt,Ue)))}).catch(Je=>{Te&&(console.warn("[gis-workbench] could not load project layers",Je),dt(Je instanceof Error?Je.message:I("project.failed")))}),()=>{Te=!1}},[Ue,Lt,dt,I]);let Ar=ei(Te=>{lp(Te.key),(Te.source==="project"||Te.persisted)&&ne(!0)},[]),hi=ei(Te=>{hh(Te.key),(Te.source==="project"||Te.persisted)&&ne(!0)},[]),ht=ei(async Te=>{if(!Ue||ve)return!1;We(!0);try{let Yt=(Array.isArray(Te)?Te:$).filter(jt=>jt.source==="project").map(jt=>({id:jt.layerId,datasetId:jt.datasetId,name:jt.name,visible:jt.visible,z:jt.z,style:jt.style||{}}));return await lg(Ue,{layers:Yt}),ne(!1),ti(),dt(I("project.saved")),!0}catch(Je){return dt(Je instanceof Error?Je.message:I("project.saveFailed")),!1}finally{We(!1)}},[Ue,ve,$,ti,dt,I]),yi=ei((Te,Je,Yt)=>{let jt=$.find(hr=>hr.key===Te),Zi=$.find(hr=>hr.key===Je);ag(Te,Je,Yt)&&(jt&&(jt.source==="project"||jt.persisted)||Zi&&(Zi.source==="project"||Zi.persisted))&&(ne(!0),ht(ch()))},[$,ht]),Xt=ei(async()=>{if(!Ue){dt(I("dataset.noProject"));return}ee&&!await ht()||Se(!0)},[Ue,ee,ht,dt,I]),cr=ei(async Te=>{if(!Ue)throw new Error(I("dataset.noProject"));let Je=await Tg(Ue,{name:Te});St(null),K({datasetId:Je.dataset.id,layerId:Je.layer&&Je.layer.id,name:Je.dataset.profile&&Je.dataset.profile.name?Je.dataset.profile.name:Te}),u("layers"),ti(),dt(I("layers.newVector"))},[Ue,ti,dt,I]),di=ei(async(Te,Je)=>{if(!Te)throw new Error(I("layers.drawFailed"));let Yt=await Sg(Te.datasetId,{geometry:Je});return K(null),ti(),dt(I("layers.drawSaved")),Yt},[ti,dt,I]),vi=ei(()=>{K(null)},[]),_t=ei(async Te=>{!Te||!Te.datasetId||ee&&!await ht()||(K(null),St({datasetId:Te.datasetId,layerId:Te.layerId,name:Te.name}),u("layers"))},[ee,ht]),vt=ei(async Te=>{!Te||!Te.datasetId||ee&&!await ht()||(St(null),K({datasetId:Te.datasetId,layerId:Te.layerId,name:Te.name}),u("layers"))},[ee,ht]),qt=ei(async(Te,Je,Yt)=>{if(!Te||!Je)throw new Error(I("layers.featureUpdateFailed"));let jt=await Mg(Te.datasetId,{name:Je.name,createdAt:Je.createdAt,geometry:{type:"Polygon",coordinates:[Yt]}});return ti(),dt(I("layers.featureUpdated")),jt},[ti,dt,I]),Pi=ei(()=>{St(null)},[]),Nt=ei(async Te=>{!Te||Te===Ue||ee&&!await ht()||(K(null),St(null),ke(Te),ne(!1))},[Ue,ee,ht]),It=ei(async()=>{if(!Ue){dt(I("dataset.noProject"));return}ee&&!await ht()||Ge(!0)},[Ue,ee,ht,dt,I]),Pt=ei(async()=>{ee&&!await ht()||tv(E)},[ee,ht,E]),Qi=ei(async Te=>{if(!Ue){dt(I("dataset.noProject"));return}if(!Te.tileUrl){dt(I("dataset.failed"));return}if(!(ee&&!await ht()))try{await dp(Ue,{name:Te.name,tileUrl:Te.tileUrl,tileSize:Te.tileSize,attribution:Te.attribution,addLayer:!0}),hh(Te.key),ti(),dt(I("layers.added"))}catch(Je){dt(Je instanceof Error?Je.message:I("dataset.failed"))}},[Ue,ee,ht,ti,dt,I]),ur=ei(async Te=>{if(ee&&!await ht())throw new Error(I("project.saveFailed"));let Je=await sg({name:Te});Ye(Yt=>[...Yt,Je]),K(null),St(null),ke(Je.id),dt(I("project.created"))},[ee,ht,dt,I]),Ai=$e.find(Te=>Te.id===Ue),Sr=Ai?Ai.name:"";ft(()=>{if(!ot&&!Ee||typeof window>"u")return;let Te=Je=>{Je.key==="Escape"&&(Ve(null),nt(null))};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[ot,Ee]);let Ii=()=>{Qy(E)||dt(I("chat.unavailable"))};return B("div",{className:"gis-workbench"+(O==="dark"?" gis-dark":"")},B(Hn,{withMap:!0}),B("header",{className:"gis-topbar"},B("div",{className:"gis-brand"},B("span",{className:"gis-brand-mark"},B(Et,{name:"map",size:19})),B("div",{className:"gis-brand-text"},B("span",{className:"gis-brand-title"},I("mode.workbench")),B("span",{className:"gis-brand-sub"},I("brand.sub")))),B("div",{className:"gis-topbar-center"},B("div",{className:"gis-project-control"},B(Et,{name:"folder",size:14}),B("select",{className:"gis-project-select",value:Ue,disabled:Oe,title:I("project.select"),onChange:Te=>Nt(Te.target.value)},Oe?B("option",{value:""},I("project.loading")):$e.length>0?$e.map(Te=>B("option",{key:Te.id,value:Te.id},Te.name)):B("option",{value:""},I("project.none"))),B("button",{type:"button",className:"gis-icon-btn gis-icon-btn-sm",title:I("project.new"),"aria-label":I("project.new"),onClick:()=>je(!0)},B(Et,{name:"plus",size:13}))),B("span",{className:"gis-mode-chip"},B("span",{className:"gis-mode-dot"}),I("mode.badge")),B("span",{className:"gis-topbar-meta"},I("mode.framework")+" \xB7 "+I("topbar.stats",{layers:$.length}))),B("div",{className:"gis-topbar-actions"},B("button",{type:"button",className:"gis-btn"+(ee?" gis-save-button is-dirty":" gis-save-button"),onClick:ht,disabled:!Ue||ve,title:I(ee?"project.unsaved":"project.save"),"aria-label":I("project.save")},B(Et,{name:"save",size:15}),B("span",{className:"gis-btn-label"},I(ve?"project.saving":"project.save")),ee?B("span",{className:"gis-save-dot"}):null),B("button",{type:"button",className:"gis-btn",onClick:Ii,title:I("chat.toggle"),"aria-label":I("chat.toggle")},B(Et,{name:"chat",size:15}),B("span",{className:"gis-btn-label"},I("chat.toggle"))),B("button",{type:"button",className:"gis-btn gis-btn-primary",onClick:Pt,title:I("mode.exit"),"aria-label":I("mode.exit")},B(Et,{name:"layout",size:15}),B("span",{className:"gis-btn-label"},I("mode.original"))))),B("div",{className:"gis-main"},B("aside",{className:"gis-rail","aria-label":I("tools.title")},Ey.map(Te=>B("button",{key:Te.id,type:"button",className:"gis-rail-btn"+(Te.id==="data"?mt?" is-active":"":z===Te.id?" is-active":""),title:I(Te.key),"aria-label":I(Te.key),"aria-pressed":Te.id==="data"?mt:z===Te.id,onClick:()=>{Te.id==="data"?It():lr(Te.id)}},B(Et,{name:Te.icon,size:18}))),B("div",{className:"gis-rail-divider"}),B("div",{className:"gis-rail-foot",title:I("mode.framework")},B("span",{className:"gis-rail-dot"}),B("span",{className:"gis-rail-version"},"v0.2"))),B("div",{className:"gis-stage"},B(cy,{runtime:E,t:I,activeTool:z,onToggleLayer:Ar,onRemoveLayer:hi,onSaveLayer:Qi,onReorderLayers:yi,onNotify:dt,drawTarget:Xe,onSavePolygon:di,onCancelDraw:vi,onNewVectorLayer:Xt,onEditLayer:_t,onAppendLayer:vt,onRefreshLayers:ti,editTarget:He,onUpdateFeature:qt,onCancelEdit:Pi,onLayerMenu:(Te,Je)=>{nt(null),Ve({x:Te.clientX,y:Te.clientY,layer:Je})},onFeatureMenu:(Te,Je,Yt,jt)=>{Ve(null),nt({x:Te,y:Je,layer:Yt,feature:jt})},projectName:Sr}),se?B("div",{className:"gis-toast",role:"status"},se):null)),Fi?B(Ty,{t:I,onClose:()=>je(!1),onCreate:ur}):null,xt?B(Sy,{t:I,onClose:()=>Se(!1),onCreate:cr}):null,mt&&Ue?B(Cy,{projectId:Ue,t:I,onClose:()=>Ge(!1),onChanged:ti,notify:dt}):null,ot?B(ma.Fragment,null,B("div",{className:"gis-context-backdrop",onClick:()=>Ve(null),onContextMenu:Te=>{Te.preventDefault(),Ve(null)}}),B("div",{className:"gis-context-menu",style:{left:Math.max(8,Math.min(ot.x,(typeof window<"u"?window.innerWidth:1200)-252))+"px",top:Math.max(8,Math.min(ot.y,(typeof window<"u"?window.innerHeight:800)-96))+"px"},onClick:Te=>Te.stopPropagation()},B("div",{className:"gis-context-title",title:ot.layer.name},ot.layer.name),B("button",{type:"button",className:"gis-context-action",onClick:async()=>{let Te=ot.layer;Ve(null);let Je=await Hy(E,$y(Te,Sr));dt(I(Je?"layers.addedToChat":"layers.chatUnavailable"))}},B(Et,{name:"chat",size:13}),I("layers.addToChat")))):null,Ee?B(ma.Fragment,null,B("div",{className:"gis-context-backdrop",onClick:()=>nt(null),onContextMenu:Te=>{Te.preventDefault(),nt(null)}}),B("div",{className:"gis-context-menu",style:{left:Math.max(8,Math.min(Ee.x,(typeof window<"u"?window.innerWidth:1200)-252))+"px",top:Math.max(8,Math.min(Ee.y,(typeof window<"u"?window.innerHeight:800)-110))+"px"},onClick:Te=>Te.stopPropagation()},B("div",{className:"gis-context-title"},Ee.feature.name||I("layers.polygon")),B("div",{className:"gis-context-subtitle"},Ee.layer.name),B("button",{type:"button",className:"gis-context-action is-danger",onClick:async()=>{let Te=Ee;nt(null);try{await Pg(Te.layer.datasetId,{name:Te.feature.name,createdAt:Te.feature.createdAt}),ti(),dt(I("layers.featureDeleted"))}catch(Je){dt(Je instanceof Error?Je.message:I("layers.featureDeleteFailed"))}}},B(Et,{name:"trash",size:13}),I("layers.deleteFeature")))):null)}function zy({runtime:E,t:I}){let O=ly(),[$,z]=at(0);return ft(()=>{if(!O||typeof document>"u")return;let u=document.querySelector("[data-rightbar-col]");if(!u){z(0);return}let se=()=>z(Math.max(0,Math.round(u.getBoundingClientRect().width)));se();let Ce;return typeof ResizeObserver<"u"&&(Ce=new ResizeObserver(se),Ce.observe(u)),window.addEventListener("resize",se),()=>{Ce&&Ce.disconnect(),window.removeEventListener("resize",se)}},[O]),O?B("div",{className:"gis-overlay",style:{right:$+"px"},role:"region","aria-label":I("mode.workbench")},B(Iy,{runtime:E,t:I})):null}function Ay(E){return E.renderSlot("conversation.session",{view:"chat"})}function ky({runtime:E,t:I,sessionId:O,useSession:$,useConversation:z,useSessions:u,renderFactorySlot:se}){let Ce=$?$(Ge=>Ge):void 0,$e=z?z(Ge=>Ge):void 0,Ye=u?u(Ge=>O&&Ge.byId[O]?Ge.byId[O].blank:void 0):void 0,Oe=()=>{try{E.sidebarRight.isExpanded()&&E.sidebarRight.toggleExpanded()}catch(Ge){console.warn("[gis-workbench] could not collapse the conversation panel",Ge)}},ut=B("div",{className:"gis-chat-top"},B("span",{className:"gis-chat-status-dot"}),B("div",{className:"gis-chat-meta"},B("span",{className:"gis-chat-title"},I("chat.title")),B("span",{className:"gis-chat-sub"},I("chat.subtitle"))),B("button",{type:"button",className:"gis-chat-collapse",title:I("chat.collapse"),"aria-label":I("chat.collapse"),onClick:Oe},B(Et,{name:"chevron-right",size:15})));if(!Ce||!se)return B("div",{className:"gis-chat-wrap"},B(Hn,null),ut,B("div",{className:"gis-chat-empty"},I("chat.noSession")));let ke=$e&&$e.activeTargets&&$e.activeTargets.size>0||!Ce.blank&&!Ce.awaitingFirstTurn||Ce.running?"active":Ce.promptAttempted?"engaging":"blank",Lt=ke==="blank"&&Ce.openState==="loading"&&Ye!==!0,Gt=ke==="blank"&&(Ce.openState==="open"||Ye===!0),mt=null;try{mt=se("conversation.content",{variant:"embedded",phase:Lt?"settling":Gt?"hero":"active",hero:Gt},{slots:{views:Ay}})}catch(Ge){console.error("[gis-workbench] could not render the embedded conversation",Ge)}return B("div",{className:"gis-chat-wrap"},B(Hn,null),ut,B("div",{className:"gis-chat-body"},mt?B(Dg,{fallback:I("chat.unavailable")},mt):B("div",{className:"gis-chat-empty"},I("chat.unavailable"))))}function Dy({runtime:E,t:I,sessionId:O}){return B(ma.Fragment,null,B(Hn,null),B("button",{type:"button",className:"gis-launcher",title:I("mode.enter"),"aria-label":I("mode.enter"),onClick:()=>Tp(E,O)},B(Et,{name:"map",size:13}),B("span",null,"GIS")))}function Wn(E,I){try{return E&&E.args&&E.args.text?E.args.text(I):void 0}catch{return}}function fh(E,I,O){try{let $=E&&E.args&&E.args.value?E.args.value(I):void 0,z=typeof $=="number"?$:Number($);return Number.isFinite(z)?z:O}catch{return O}}function Ly(E,I){try{return E&&E.args&&E.args.value?E.args.value(I):void 0}catch{return}}function Ry({runtime:E,t:I,phase:O,block:$,callId:z,sessionId:u}){let se=Wn($,"layerId")||"",Ce=Ly($,"stylePatch"),$e=O==="result",Ye=$e&&!!($&&$.isError),Oe=$e&&!Ye&&se&&Ce&&typeof Ce=="object",[ut,Ue]=ma.useState(!1);ft(()=>{if(!Oe)return;let Ge=rg(se,Ce);Ue(Ge)},[Oe,se,JSON.stringify(Ce)]);let ke=I("gis.style.updating"),Lt="";Ye?(ke=I("gis.style.failed"),Lt=" is-error"):$e&&(ke=I(ut?"gis.style.updated":"gis.style.savedOnly"),Lt=" is-ok");let Gt=Ye?$&&$.error&&($.error.reason||$.error.code||$.error.name)||I("gis.style.errorFallback"):null,mt=Ce&&typeof Ce=="object"?JSON.stringify(Ce):"";return B("div",{className:"gis-tool-card"},B(Hn,null),B("div",{className:"gis-tool-head"},B("div",{className:"gis-tool-icon"},B(Et,{name:"layers",size:15})),B("div",{className:"gis-tool-copy"},B("div",{className:"gis-tool-title"},I("gis.style.title")),B("div",{className:"gis-tool-sub"},se||"")),B("span",{className:"gis-tool-state"+Lt},ke)),B("div",{className:"gis-tool-body"},mt?B("div",{className:"gis-tool-url",title:mt},mt.slice(0,220)):null,Gt?B("div",{className:"gis-tool-error"},Gt):null,$e?null:B("div",{className:"gis-tool-sub"},I("gis.style.pendingHint"))))}function Fy({runtime:E,t:I,phase:O,block:$,callId:z,sessionId:u}){let se=_h(),Ce=(Wn($,"name")||I("gis.tool.defaultName")).trim()||I("gis.tool.defaultName"),$e=Wn($,"tileUrl")||Gn,Ye=String($e).trim()||Gn,Oe=fh($,"tileSize",256)===512?512:256,ut=Ig(fh($,"minzoom",0),0,24),Ue=Math.max(ut,Ig(fh($,"maxzoom",18),0,24)),ke=Wn($,"attribution")||"\u5929\u5730\u56FE",Lt=O==="result",Gt=Lt&&!!($&&$.isError),mt=Lt&&!Gt,Ge=se.find(Xe=>Xe.tileUrl===Ye),Fi=mt&&!!Ge;ft(()=>{mt&&ig({key:"tool:"+z,name:Ce,tileUrl:Ye,tileSize:Oe,minzoom:ut,maxzoom:Ue,attribution:ke,source:"conversation"})},[mt,z,Ce,Ye,Oe,ut,Ue,ke]);let je=I("gis.tool.preparing"),xt="";O==="start"&&(je=I("gis.tool.adding")),Gt?(je=I("gis.tool.failed"),xt=" is-error"):Lt&&(je=I("gis.tool.added"),xt=" is-ok");let Se=Gt?$&&$.error&&($.error.reason||$.error.code||$.error.name)||I("gis.tool.errorFallback"):null;return B("div",{className:"gis-tool-card"},B(Hn,null),B("div",{className:"gis-tool-head"},B("div",{className:"gis-tool-icon"},B(Et,{name:"layers",size:15})),B("div",{className:"gis-tool-copy"},B("div",{className:"gis-tool-title"},I("gis.tool.title")),B("div",{className:"gis-tool-sub"},Ce)),B("span",{className:"gis-tool-state"+xt},je)),B("div",{className:"gis-tool-body"},B("div",{className:"gis-tool-url",title:Ye},Ye),Se?B("div",{className:"gis-tool-error"},Se):null,B("div",{className:"gis-tool-actions"},Fi?B("button",{type:"button",className:"gis-tool-btn is-primary",onClick:()=>Tp(E,u)},B(Et,{name:"map",size:12}),I("gis.tool.viewMap")):null,Lt?null:B("span",{className:"gis-tool-sub"},I("gis.tool.pendingHint")))))}var By={hangzhou:[120.1551,30.2741],\u676D\u5DDE:[120.1551,30.2741],beijing:[116.4074,39.9042],\u5317\u4EAC:[116.4074,39.9042],shanghai:[121.4737,31.2304],\u4E0A\u6D77:[121.4737,31.2304],shenzhen:[114.0579,22.5431],\u6DF1\u5733:[114.0579,22.5431],guangzhou:[113.2644,23.1291],\u5E7F\u5DDE:[113.2644,23.1291],chengdu:[104.0665,30.5723],\u6210\u90FD:[104.0665,30.5723],xian:[108.9398,34.3416],\u897F\u5B89:[108.9398,34.3416],china:[104.2,35.5],\u4E2D\u56FD:[104.2,35.5]};function Oy(E){let I=null;try{let z=E&&E.args&&E.args.value?E.args.value("center"):void 0;Array.isArray(z)&&z.length>=2&&(I=[Number(z[0]),Number(z[1])])}catch{I=null}let O=(Wn(E,"place")||"").trim().toLowerCase();if((!I||!Number.isFinite(I[0])||!Number.isFinite(I[1]))&&O){let z=By[O];z&&(I=z.slice())}let $=(Wn(E,"label")||Wn(E,"place")||"").trim();return{center:I,zoom:fh(E,"zoom",11),label:$}}function Ny({runtime:E,t:I,phase:O,block:$,callId:z,sessionId:u}){let{center:se,zoom:Ce,label:$e}=Oy($),Ye=O==="result",Oe=Ye&&!!($&&$.isError),ut=Ye&&!Oe&&Array.isArray(se),Ue=Array.isArray(se)&&Number.isFinite(se[0])&&Number.isFinite(se[1]);ft(()=>{ut&&og({key:"tool:"+z,center:se,zoom:Ce,label:$e})},[ut,z,Ce,$e,se?se[0]:null,se?se[1]:null]);let ke=I("gis.view.locating"),Lt="";Oe?(ke=I("gis.view.failed"),Lt=" is-error"):Ye&&(ke=I("gis.view.located"),Lt=" is-ok");let Gt=Ue?se[1].toFixed(4)+"\xB0N, "+se[0].toFixed(4)+"\xB0E":I("gis.view.errorFallback");return B("div",{className:"gis-tool-card"},B(Hn,null),B("div",{className:"gis-tool-head"},B("div",{className:"gis-tool-icon"},B(Et,{name:"map",size:15})),B("div",{className:"gis-tool-copy"},B("div",{className:"gis-tool-title"},I("gis.view.title")),B("div",{className:"gis-tool-sub"},$e||I("gis.view.defaultLabel"))),B("span",{className:"gis-tool-state"+Lt},ke)),B("div",{className:"gis-tool-body"},B("div",{className:"gis-tool-url"},Gt+" \xB7 z"+Number(Ce).toFixed(1)),B("div",{className:"gis-tool-actions"},Ye?B("button",{type:"button",className:"gis-tool-btn is-primary",onClick:()=>Tp(E,u)},B(Et,{name:"map",size:12}),I("gis.tool.viewMap")):null,Ye?null:B("span",{className:"gis-tool-sub"},I("gis.view.pendingHint")))))}function jy(E,I){return function($){return B(Ry,Object.assign({},$,{runtime:E,t:$.t||I}))}}function Vy(E,I){return function($){return B(Ny,Object.assign({},$,{runtime:E,t:$.t||I}))}}function Uy(E,I){return function($){return B(zy,{runtime:E,t:$.t||I})}}function qy(E,I){return function($){return B(ky,Object.assign({},$,{runtime:E,t:$.t||I}))}}function Gy(E,I){return function($){return B(Dy,Object.assign({},$,{runtime:E,t:$.t||I}))}}function Zy(E,I){return function($){return B(Fy,Object.assign({},$,{runtime:E,t:$.t||I}))}}var mh=null;var gh,uo,Ng=0,jg="\u5730\u56FE\u5BF9\u8BDD",Vg=new Map;function $y(E,I){let O=["\u56FE\u5C42\uFF1A"+(E.name||"\u672A\u547D\u540D\u56FE\u5C42")];E.layerId?O.push("layerId\uFF1A"+E.layerId):E.key&&O.push("layerKey\uFF1A"+E.key),E.projectId&&O.push("projectId\uFF1A"+E.projectId),I&&O.push("\u9879\u76EE\uFF1A"+I);let $=E.sourceFormat==="postgis"?"pg\u6570\u636E\u5E93":E.format;if(E.datasetKind&&O.push("\u7C7B\u578B\uFF1A"+E.datasetKind+($?" / "+$:"")),Number.isFinite(Number(E.featureCount))&&O.push("\u8981\u7D20\u6570\uFF1A"+E.featureCount),Array.isArray(E.fields)&&E.fields.length>0&&O.push("\u5B57\u6BB5\uFF1A"+E.fields.join(", ")),Array.isArray(E.bbox)&&E.bbox.length===4&&O.push("\u8303\u56F4\uFF1A"+E.bbox.map(z=>Number(z).toFixed(6)).join(", ")),E.style&&typeof E.style=="object"&&Object.keys(E.style).length>0){let z=JSON.stringify(E.style);z.length<=320&&O.push("\u5F53\u524D\u6837\u5F0F\uFF1A"+z)}return O.push("","\u8BF7\u57FA\u4E8E\u8BE5\u56FE\u5C42\uFF1A"),O.join(`
1514
+ `)}function Wy(E,I){let O=Vg.get(E);if(!O)return!1;let $=String(O.draft||""),z=$.trim()?$.replace(/\s+$/,"")+`
1515
+
1516
+ `+I:I;return O.inputActions.setDraft(z),!0}async function Hy(E,I){let O=uo||gh;if(!O)return!1;try{jc(E,O)}catch{}for(let $=0;$<8;$+=1){if(Wy(O,I))return!0;await new Promise(z=>setTimeout(z,120))}return!1}function Xy({sessionId:E,inputActions:I,useInput:O}){let $=O(z=>z.draft);return ft(()=>{!E||!I||Vg.set(E,{inputActions:I,draft:$})},[E,I,$]),null}function Yy(E,I){return function($){return B(Xy,Object.assign({},$,{runtime:E,t:$.t||I}))}}function Ug(E){let I=E.get("sidebarRightTabs");if(!I||typeof I.register!="function")return!1;try{if(typeof I.get=="function"&&I.get(co))return!0}catch{}try{let O=I.register({id:yp,kind:co,title:()=>jg});return typeof E.effect=="function"&&E.effect(()=>O),!0}catch(O){return console.error("[gis-workbench] could not register the conversation tab type on demand",O),!1}}function jc(E,I){Ug(E);try{let O=E.sidebarRight,$=O.mounted&&O.mounted.getSnapshot?O.mounted.getSnapshot():void 0;if(I&&$!==I&&typeof O.openTabIn=="function")return O.openTabIn(I,co),!0;let u=(O.openTabs&&O.openTabs.getSnapshot?O.openTabs.getSnapshot():[]).find(se=>se.kind===co);if(u){O.isExpanded()||O.toggleExpanded();try{O.focus(u.id)}catch{}return!0}return O.openTab(co),O.isExpanded()||O.toggleExpanded(),!0}catch(O){return console.warn("[gis-workbench] could not open the conversation panel",O),!1}}function Ky(E,I){if(!I)return;let O=()=>{if(!(!bl||uo!==I)){try{let $=E.sidebarRight;typeof $.openTabIn=="function"&&$.openTabIn(I,co)}catch($){console.warn("[gis-workbench] could not target the map session tab",$)}jc(E,I)}};O(),setTimeout(O,120),setTimeout(O,320),setTimeout(O,760),setTimeout(O,1500),setTimeout(O,3e3)}function Jy(E){try{let I=E.sidebarRight,O=I.openTabs&&I.openTabs.getSnapshot?I.openTabs.getSnapshot():[];for(let $ of O)if($.kind===co)try{I.close($.id)}catch(z){console.warn("[gis-workbench] could not close the conversation tab",z)}}catch(I){console.warn("[gis-workbench] could not inspect the conversation tabs",I)}}function Qy(E){if(!uo)return!1;Ug(E);try{let I=E.sidebarRight,$=(I.openTabs&&I.openTabs.getSnapshot?I.openTabs.getSnapshot():[]).find(z=>z.kind===co);if($){let z=I.active();return I.isExpanded()?z&&z.id===$.id?I.toggleExpanded():I.focus($.id):(I.toggleExpanded(),I.focus($.id)),!0}return jc(E,uo)}catch(I){return console.warn("[gis-workbench] could not toggle the conversation panel",I),!1}}function ev(E,I){try{let O=E.sidebarRight;if(I&&I.expanded){if(O.isExpanded()||O.toggleExpanded(),I.activeId)try{O.focus(I.activeId)}catch{}}else O.isExpanded()&&O.toggleExpanded()}catch(O){console.warn("[gis-workbench] could not restore the conversation panel state",O)}}async function Tp(E,I){if(bl)return uo&&jc(E,uo),!0;try{let O=E.sidebarRight,$=O.active();mh={expanded:O.isExpanded(),activeId:$?$.id:null}}catch{mh=null}return gh=I,uo=I||void 0,Bg(!0),++Ng,I?(Ky(E,I),!0):(jc(E),!0)}function tv(E){Ng+=1,Bg(!1);let I=gh,O=uo,$=mh;mh=null,gh=void 0,uo=void 0,Jy(E),ev(E,$)}function qg(E){ma=E,B=ma.createElement,at=ma.useState,ft=ma.useEffect,Tr=ma.useRef,ei=ma.useCallback,J_=ma.useMemo,Dg=class extends ma.Component{constructor($){super($),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch($){console.error("[gis-workbench] embedded conversation failed",$)}render(){return this.state.failed?B("div",{className:"gis-chat-empty"},this.props.fallback):this.props.children}};function I(O){O.effect(()=>O.locale.register(lo,{zh:oy,en:ny}),"gis-workbench: dictionaries");let $=O.locale.bind(lo);jg=$("chat.tab");try{let u=O.get("layout"),se=u&&u.panelInfo&&u.panelInfo.getSnapshot?u.panelInfo.getSnapshot():void 0;se&&se.activePanelId==="gis-workbench"&&u.selectPanel(null)}catch(u){console.warn("[gis-workbench] could not clear the legacy workbench panel selection",u)}let z=O.get("sidebarRightTabs");z&&typeof z.register=="function"?O.effect(()=>{try{return z.register({id:yp,kind:co,title:()=>$("chat.tab")})}catch(u){console.error("[gis-workbench] could not register the conversation tab type",u);return}},"gis-workbench: conversation tab type"):console.warn("[gis-workbench] the sidebar tab registry is unavailable; the map panel still works."),O.slots.inject("shell.overlay",()=>O.slots.register({name:"shell.overlay",id:"gis-workbench-overlay",order:50,locale:lo},Uy(O,$))),O.slots.inject("sidebar.right.pane.tab",()=>O.slots.register({name:"sidebar.right.pane.tab",key:yp,locale:lo},qy(O,$))),O.slots.inject("conversation.input.dock",()=>O.slots.register({name:"conversation.input.dock",id:"gis-composer-bridge",order:30,locale:lo},Yy(O,$))),O.slots.inject("conversation.session.header.utilities",()=>O.slots.register({name:"conversation.session.header.utilities",id:"gis-workbench-launcher",order:40,locale:lo},Gy(O,$))),O.slots.inject("tool.call.toolview",()=>O.slots.register({name:"tool.call.toolview",key:Q_,locale:lo},Zy(O,$))),O.slots.inject("tool.call.toolview",()=>O.slots.register({name:"tool.call.toolview",key:Km,locale:lo},Vy(O,$))),O.slots.inject("tool.call.toolview",()=>O.slots.register({name:"tool.call.toolview",key:Jm,locale:lo},jy(O,$)))}return{inject:["slots","locale","sidebarRight","theme"],apply:I}}window.__ModuleLoader__.load({id:"@focus-daima/gis-workbench",factory(E){let I=E("react");return qg(I)}});})();