From 14790a6fa64ba517c69752bd8f18923640260214 Mon Sep 17 00:00:00 2001 From: bdon Date: Mon, 25 Nov 2024 08:38:43 +0000 Subject: [PATCH] deploy: 16d97138a1e71f13b52e9845699fc9691c680b93 --- .nojekyll | 0 assets/index-BBmLN8dq.js | 594 ++++++++++++++++++++++++++++++++++++++ assets/index-CGcOnYtv.css | 1 + index.html | 14 + 4 files changed, 609 insertions(+) create mode 100644 .nojekyll create mode 100644 assets/index-BBmLN8dq.js create mode 100644 assets/index-CGcOnYtv.css create mode 100644 index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/assets/index-BBmLN8dq.js b/assets/index-BBmLN8dq.js new file mode 100644 index 0000000..f57466b --- /dev/null +++ b/assets/index-BBmLN8dq.js @@ -0,0 +1,594 @@ +(function(){const B=document.createElement("link").relList;if(B&&B.supports&&B.supports("modulepreload"))return;for(const pe of document.querySelectorAll('link[rel="modulepreload"]'))ne(pe);new MutationObserver(pe=>{for(const ye of pe)if(ye.type==="childList")for(const z of ye.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&ne(z)}).observe(document,{childList:!0,subtree:!0});function Y(pe){const ye={};return pe.integrity&&(ye.integrity=pe.integrity),pe.referrerPolicy&&(ye.referrerPolicy=pe.referrerPolicy),pe.crossOrigin==="use-credentials"?ye.credentials="include":pe.crossOrigin==="anonymous"?ye.credentials="omit":ye.credentials="same-origin",ye}function ne(pe){if(pe.ep)return;pe.ep=!0;const ye=Y(pe);fetch(pe.href,ye)}})();const Rf=(E,B)=>E===B,Bf=Symbol("solid-track"),sc={equals:Rf};let Ad=Ed;const ha=1,oc=2,Pd={owned:null,cleanups:null,context:null,owner:null};var Qt=null;let zh=null,Ff=null,Wt=null,zi=null,Sn=null,dc=0;function ac(E,B){const Y=Wt,ne=Qt,pe=E.length===0,ye=B===void 0?ne:B,z=pe?Pd:{owned:null,cleanups:null,context:ye?ye.context:null,owner:ye},p=pe?E:()=>E(()=>el(()=>Qo(z)));Qt=z,Wt=null;try{return il(p,!0)}finally{Wt=Y,Qt=ne}}function Ch(E,B){B=B?Object.assign({},sc,B):sc;const Y={value:E,observers:null,observerSlots:null,comparator:B.equals||void 0},ne=pe=>(typeof pe=="function"&&(pe=pe(Y.value)),Md(Y,pe));return[Cd.bind(Y),ne]}function Yo(E,B,Y){const ne=Dh(E,B,!1,ha);tl(ne)}function zd(E,B,Y){Ad=$f;const ne=Dh(E,B,!1,ha);ne.user=!0,Sn?Sn.push(ne):tl(ne)}function Of(E,B,Y){Y=Y?Object.assign({},sc,Y):sc;const ne=Dh(E,B,!0,0);return ne.observers=null,ne.observerSlots=null,ne.comparator=Y.equals||void 0,tl(ne),Cd.bind(ne)}function el(E){if(Wt===null)return E();const B=Wt;Wt=null;try{return E()}finally{Wt=B}}function jf(E){zd(()=>el(E))}function Vf(E){return Qt===null||(Qt.cleanups===null?Qt.cleanups=[E]:Qt.cleanups.push(E)),E}function Cd(){if(this.sources&&this.state)if(this.state===ha)tl(this);else{const E=zi;zi=null,il(()=>cc(this),!1),zi=E}if(Wt){const E=this.observers?this.observers.length:0;Wt.sources?(Wt.sources.push(this),Wt.sourceSlots.push(E)):(Wt.sources=[this],Wt.sourceSlots=[E]),this.observers?(this.observers.push(Wt),this.observerSlots.push(Wt.sources.length-1)):(this.observers=[Wt],this.observerSlots=[Wt.sources.length-1])}return this.value}function Md(E,B,Y){let ne=E.value;return(!E.comparator||!E.comparator(ne,B))&&(E.value=B,E.observers&&E.observers.length&&il(()=>{for(let pe=0;pe1e6)throw zi=[],new Error},!1)),B}function tl(E){if(!E.fn)return;Qo(E);const B=dc;Nf(E,E.value,B)}function Nf(E,B,Y){let ne;const pe=Qt,ye=Wt;Wt=Qt=E;try{ne=E.fn(B)}catch(z){return E.pure&&(E.state=ha,E.owned&&E.owned.forEach(Qo),E.owned=null),E.updatedAt=Y+1,Ld(z)}finally{Wt=ye,Qt=pe}(!E.updatedAt||E.updatedAt<=Y)&&(E.updatedAt!=null&&"observers"in E?Md(E,ne):E.value=ne,E.updatedAt=Y)}function Dh(E,B,Y,ne=ha,pe){const ye={fn:E,state:ne,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:B,owner:Qt,context:Qt?Qt.context:null,pure:Y};return Qt===null||Qt!==Pd&&(Qt.owned?Qt.owned.push(ye):Qt.owned=[ye]),ye}function lc(E){if(E.state===0)return;if(E.state===oc)return cc(E);if(E.suspense&&el(E.suspense.inFallback))return E.suspense.effects.push(E);const B=[E];for(;(E=E.owner)&&(!E.updatedAt||E.updatedAt=0;Y--)if(E=B[Y],E.state===ha)tl(E);else if(E.state===oc){const ne=zi;zi=null,il(()=>cc(E,B[0]),!1),zi=ne}}function il(E,B){if(zi)return E();let Y=!1;B||(zi=[]),Sn?Y=!0:Sn=[],dc++;try{const ne=E();return Uf(Y),ne}catch(ne){Y||(Sn=null),zi=null,Ld(ne)}}function Uf(E){if(zi&&(Ed(zi),zi=null),E)return;const B=Sn;Sn=null,B.length&&il(()=>Ad(B),!1)}function Ed(E){for(let B=0;B=0;B--)Qo(E.tOwned[B]);delete E.tOwned}if(E.owned){for(B=E.owned.length-1;B>=0;B--)Qo(E.owned[B]);E.owned=null}if(E.cleanups){for(B=E.cleanups.length-1;B>=0;B--)E.cleanups[B]();E.cleanups=null}E.state=0}function qf(E){return E instanceof Error?E:new Error(typeof E=="string"?E:"Unknown error",{cause:E})}function Ld(E,B=Qt){throw qf(E)}const Zf=Symbol("fallback");function xd(E){for(let B=0;B1?[]:null;return Vf(()=>xd(ye)),()=>{let $e=E()||[],We=$e.length,Ke,he;return $e[Bf],el(()=>{let Ut,ei,$t,Ci,yi,ti,zt,Mi,qt;if(We===0)z!==0&&(xd(ye),ye=[],ne=[],pe=[],z=0,p&&(p=[])),Y.fallback&&(ne=[Zf],pe[0]=ac(Ui=>(ye[0]=Ui,Y.fallback())),z=1);else if(z===0){for(pe=new Array(We),he=0;he=ti&&Mi>=ti&&ne[zt]===$e[Mi];zt--,Mi--)$t[Mi]=pe[zt],Ci[Mi]=ye[zt],p&&(yi[Mi]=p[zt]);for(Ut=new Map,ei=new Array(Mi+1),he=Mi;he>=ti;he--)qt=$e[he],Ke=Ut.get(qt),ei[he]=Ke===void 0?-1:Ke,Ut.set(qt,he);for(Ke=ti;Ke<=zt;Ke++)qt=ne[Ke],he=Ut.get(qt),he!==void 0&&he!==-1?($t[he]=pe[Ke],Ci[he]=ye[Ke],p&&(yi[he]=p[Ke]),he=ei[he],Ut.set(qt,he)):ye[Ke]();for(he=ti;heE(B||{}))}function Hf(E){const B="fallback"in E&&{fallback:()=>E.fallback};return Of(Gf(()=>E.each,E.children,B||void 0))}function Xf(E,B,Y){let ne=Y.length,pe=B.length,ye=ne,z=0,p=0,$e=B[pe-1].nextSibling,We=null;for(;zKe-p){const ei=B[z];for(;p{pe=ye,B===document?E():hc(B,E(),B.firstChild?null:void 0,Y)},ne.owner),()=>{pe(),B.textContent=""}}function Lh(E,B,Y){let ne;const pe=()=>{const z=document.createElement("template");return z.innerHTML=E,z.content.firstChild},ye=()=>(ne||(ne=pe())).cloneNode(!0);return ye.cloneNode=ye,ye}function Kf(E,B=window.document){const Y=B[bd]||(B[bd]=new Set);for(let ne=0,pe=E.length;neuc(E,B(),pe,Y),ne)}function Jf(E){let B=E.target;const Y=`$$${E.type}`,ne=E.target,pe=E.currentTarget,ye=$e=>Object.defineProperty(E,"target",{configurable:!0,value:$e}),z=()=>{const $e=B[Y];if($e&&!B.disabled){const We=B[`${Y}Data`];if(We!==void 0?$e.call(B,We,E):$e.call(B,E),E.cancelBubble)return}return B.host&&typeof B.host!="string"&&!B.host._$host&&B.contains(E.target)&&ye(B.host),!0},p=()=>{for(;z()&&(B=B._$host||B.parentNode||B.host););};if(Object.defineProperty(E,"currentTarget",{configurable:!0,get(){return B||document}}),E.composedPath){const $e=E.composedPath();ye($e[0]);for(let We=0;We<$e.length-2&&(B=$e[We],!!z());We++){if(B._$host){B=B._$host,p();break}if(B.parentNode===pe)break}}else p();ye(ne)}function uc(E,B,Y,ne,pe){for(;typeof Y=="function";)Y=Y();if(B===Y)return Y;const ye=typeof B,z=ne!==void 0;if(E=z&&Y[0]&&Y[0].parentNode||E,ye==="string"||ye==="number"){if(ye==="number"&&(B=B.toString(),B===Y))return Y;if(z){let p=Y[0];p&&p.nodeType===3?p.data!==B&&(p.data=B):p=document.createTextNode(B),Y=Vs(E,Y,ne,p)}else Y!==""&&typeof Y=="string"?Y=E.firstChild.data=B:Y=E.textContent=B}else if(B==null||ye==="boolean")Y=Vs(E,Y,ne);else{if(ye==="function")return Yo(()=>{let p=B();for(;typeof p=="function";)p=p();Y=uc(E,p,Y,ne)}),()=>Y;if(Array.isArray(B)){const p=[],$e=Y&&Array.isArray(Y);if(Eh(p,B,Y,pe))return Yo(()=>Y=uc(E,p,Y,ne,!0)),()=>Y;if(p.length===0){if(Y=Vs(E,Y,ne),z)return Y}else $e?Y.length===0?vd(E,p,ne):Xf(E,Y,p):(Y&&Vs(E),vd(E,p));Y=p}else if(B.nodeType){if(Array.isArray(Y)){if(z)return Y=Vs(E,Y,ne,B);Vs(E,Y,null,B)}else Y==null||Y===""||!E.firstChild?E.appendChild(B):E.replaceChild(B,E.firstChild);Y=B}}return Y}function Eh(E,B,Y,ne){let pe=!1;for(let ye=0,z=B.length;ye=0;z--){const p=B[z];if(pe!==p){const $e=p.parentNode===E;!ye&&!z?$e?E.replaceChild(pe,p):E.insertBefore(pe,Y):$e&&p.remove()}else ye=!0}}else E.insertBefore(pe,Y);return[pe]}var Yf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(E){return E&&E.__esModule&&Object.prototype.hasOwnProperty.call(E,"default")?E.default:E}var Rd={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + */(function(E,B){(function(Y,ne){E.exports=ne()})(Yf,function(){var Y={},ne={};function pe(z,p,$e){if(ne[z]=$e,z==="index"){var We="var sharedModule = {}; ("+ne.shared+")(sharedModule); ("+ne.worker+")(sharedModule);",Ke={};return ne.shared(Ke),ne.index(Y,Ke),typeof window<"u"&&Y.setWorkerUrl(window.URL.createObjectURL(new Blob([We],{type:"text/javascript"}))),Y}}pe("shared",["exports"],function(z){function p(i,t,r,a){return new(r||(r=Promise))(function(l,u){function d(x){try{_(a.next(x))}catch(b){u(b)}}function f(x){try{_(a.throw(x))}catch(b){u(b)}}function _(x){var b;x.done?l(x.value):(b=x.value,b instanceof r?b:new r(function(w){w(b)})).then(d,f)}_((a=a.apply(i,t||[])).next())})}function $e(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var We=Ke;function Ke(i,t){this.x=i,this.y=t}Ke.prototype={clone:function(){return new Ke(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,t){var r=Math.cos(i),a=Math.sin(i),l=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ke.convert=function(i){return i instanceof Ke?i:Array.isArray(i)?new Ke(i[0],i[1]):i};var he=$e(We),oe=Ut;function Ut(i,t,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=a}Ut.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var ei=$e(oe);let $t,Ci;function yi(){return $t==null&&($t=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),$t}function ti(){if(Ci==null&&(Ci=!1,yi())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let a=0;a<5*5;a++){const l=4*a;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(a%5,Math.floor(a/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){Ci=!0;break}}}return Ci||!1}function zt(i,t,r,a){const l=new ei(i,t,r,a);return u=>l.solve(u)}const Mi=zt(.25,.1,.25,1);function qt(i,t,r){return Math.min(r,Math.max(t,i))}function Ui(i,t,r){const a=r-t,l=((i-t)%a+a)%a+t;return l===t?r:l}function $i(i,...t){for(const r of t)for(const a in r)i[a]=r[a];return i}let $a=1;function mr(i,t,r){const a={};for(const l in i)a[l]=t.call(this,i[l],l,i);return a}function ua(i,t,r){const a={};for(const l in i)t.call(this,i[l],l,i)&&(a[l]=i[l]);return a}function mt(i){return Array.isArray(i)?i.map(mt):typeof i=="object"&&i?mr(i,mt):i}const qa={};function ii(i){qa[i]||(typeof console<"u"&&console.warn(i),qa[i]=!0)}function ui(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function Pr(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let Tn=null;function _r(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Za="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function tn(i,t,r,a,l){return p(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(i,{timestamp:0});try{const d=u==null?void 0:u.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);const f=d.startsWith("BGR"),_=new Uint8ClampedArray(a*l*4);if(yield u.copyTo(_,function(x,b,w,I,P){const M=4*Math.max(-b,0),D=(Math.max(0,w)-w)*I*4+M,j=4*I,$=Math.max(0,b),ie=Math.max(0,w);return{rect:{x:$,y:ie,width:Math.min(x.width,b+I)-$,height:Math.min(x.height,w+P)-ie},layout:[{offset:D,stride:j}]}}(i,t,r,a,l)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{u.close()}})}let zr,xi;const er="AbortError";function In(){return new Error(er)}const jr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function gr(i){return jr.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const kn="global-dispatcher";class Ei extends Error{constructor(t,r,a,l){super(`AJAXError: ${r} (${t}): ${a}`),this.status=t,this.statusText=r,this.url=a,this.body=l}}const tr=()=>Pr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,rn=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const a=gr(i.url);if(a)return a(i,t);if(Pr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:kn},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(tr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,l){return p(this,void 0,void 0,function*(){const u=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:tr(),signal:l.signal});a.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");const d=yield fetch(u);if(!d.ok){const x=yield d.blob();throw new Ei(d.status,d.statusText,a.url,x)}let f;f=a.type==="arrayBuffer"||a.type==="image"?d.arrayBuffer():a.type==="json"?d.json():d.text();const _=yield f;if(l.signal.aborted)throw In();return{data:_,cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}})}(i,t);if(Pr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:kn},t)}var r;return function(a,l){return new Promise((u,d)=>{var f;const _=new XMLHttpRequest;_.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(_.responseType="arraybuffer");for(const x in a.headers)_.setRequestHeader(x,a.headers[x]);a.type==="json"&&(_.responseType="text",!((f=a.headers)===null||f===void 0)&&f.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=a.credentials==="include",_.onerror=()=>{d(new Error(_.statusText))},_.onload=()=>{if(!l.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let x=_.response;if(a.type==="json")try{x=JSON.parse(_.response)}catch(b){return void d(b)}u({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});d(new Ei(_.status,_.statusText,a.url,x))}},l.signal.addEventListener("abort",()=>{_.abort(),d(In())}),_.send(a.body)})}(i,t)};function nn(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function da(i,t,r){r[i]&&r[i].indexOf(t)!==-1||(r[i]=r[i]||[],r[i].push(t))}function Cr(i,t,r){if(r&&r[i]){const a=r[i].indexOf(t);a!==-1&&r[i].splice(a,1)}}class Vr{constructor(t,r={}){$i(this,r),this.type=t}}class Nr extends Vr{constructor(t,r={}){super("error",$i({error:t},r))}}class An{on(t,r){return this._listeners=this._listeners||{},da(t,r,this._listeners),this}off(t,r){return Cr(t,r,this._listeners),Cr(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},da(t,r,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,r){typeof t=="string"&&(t=new Vr(t,r||{}));const a=t.type;if(this.listens(a)){t.target=this;const l=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of l)f.call(this,t);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of u)Cr(a,f,this._oneTimeListeners),f.call(this,t);const d=this._eventedParent;d&&($i(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(t))}else t instanceof Nr&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var se={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},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},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},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_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","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"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},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"}}};const an=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function pa(i,t){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return an.forEach(a=>{a in t&&(r[a]=t[a])}),r}function ht(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${t}>`}return i.kind}const R=[$r,we,Ye,Ue,bi,Er,ir,A(He),qr,vr,U];function V(i,t){if(t.kind==="error")return null;if(i.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!V(i.itemType,t.itemType))&&(typeof i.N!="number"||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if(i.kind==="value"){for(const r of R)if(!V(r,t))return null}}return`Expected ${k(i)} but found ${k(t)} instead.`}function W(i,t){return t.some(r=>r.kind===i.kind)}function J(i,t){return t.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function te(i,t){return i.kind==="array"&&t.kind==="array"?i.itemType.kind===t.itemType.kind&&typeof i.N=="number":i.kind===t.kind}const G=.96422,ce=.82521,fe=4/29,ae=6/29,xe=3*ae*ae,Oe=ae*ae*ae,je=Math.PI/180,st=180/Math.PI;function Xe(i){return(i%=360)<0&&(i+=360),i}function ot([i,t,r,a]){let l,u;const d=Ot((.2225045*(i=it(i))+.7168786*(t=it(t))+.0606169*(r=it(r)))/1);i===t&&t===r?l=u=d:(l=Ot((.4360747*i+.3850649*t+.1430804*r)/G),u=Ot((.0139322*i+.0971045*t+.7141733*r)/ce));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),a]}function it(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Ot(i){return i>Oe?Math.pow(i,1/3):i/xe+fe}function Mt([i,t,r,a]){let l=(i+16)/116,u=isNaN(t)?l:l+t/500,d=isNaN(r)?l:l-r/200;return l=1*pt(l),u=G*pt(u),d=ce*pt(d),[Qe(3.1338561*u-1.6168667*l-.4906146*d),Qe(-.9787684*u+1.9161415*l+.033454*d),Qe(.0719453*u-.2289914*l+1.4052427*d),a]}function Qe(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function pt(i){return i>ae?i*i*i:xe*(i-fe)}function Pt(i){return parseInt(i.padEnd(2,i),16)/255}function Zt(i,t){return Kt(t?i/100:i,0,1)}function Kt(i,t,r){return Math.min(Math.max(t,i),r)}function pi(i){return!i.some(Number.isNaN)}const zn={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]};class ft{constructor(t,r,a,l=1,u=!0){this.r=t,this.g=r,this.b=a,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,a,l]))}static parse(t){if(t instanceof ft)return t;if(typeof t!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=zn[a];if(l){const[d,f,_]=l;return[d/255,f/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const d=a.length<6?1:2;let f=1;return[Pt(a.slice(f,f+=d)),Pt(a.slice(f,f+=d)),Pt(a.slice(f,f+=d)),Pt(a.slice(f,f+d)||"ff")]}if(a.startsWith("rgb")){const d=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,_,x,b,w,I,P,M,D,j,$,ie]=d,X=[b||" ",P||" ",j].join("");if(X===" "||X===" /"||X===",,"||X===",,,"){const ee=[x,I,D].join(""),le=ee==="%%%"?100:ee===""?255:0;if(le){const me=[Kt(+_/le,0,1),Kt(+w/le,0,1),Kt(+M/le,0,1),$?Zt(+$,ie):1];if(pi(me))return me}}return}}const u=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[d,f,_,x,b,w,I,P,M]=u,D=[_||" ",b||" ",I].join("");if(D===" "||D===" /"||D===",,"||D===",,,"){const j=[+f,Kt(+x,0,100),Kt(+w,0,100),P?Zt(+P,M):1];if(pi(j))return function([$,ie,X,ee]){function le(me){const Pe=(me+$/30)%12,Ve=ie*Math.min(X,1-X);return X-Ve*Math.max(-1,Math.min(Pe-3,9-Pe,1))}return $=Xe($),ie/=100,X/=100,[le(0),le(8),le(4),ee]}(j)}}}(t);return r?new ft(...r,!1):void 0}get rgb(){const{r:t,g:r,b:a,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[t/u,r/u,a/u,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,a,l,u]=ot(t),d=Math.sqrt(a*a+l*l);return[Math.round(1e4*d)?Xe(Math.atan2(l,a)*st):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ot(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,a,l]=this.rgb;return`rgba(${[t,r,a].map(u=>Math.round(255*u)).join(",")},${l})`}}ft.black=new ft(0,0,0,1),ft.white=new ft(1,1,1,1),ft.transparent=new ft(0,0,0,0),ft.red=new ft(1,0,0,1);class $s{constructor(t,r,a){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class qs{constructor(t,r,a,l,u){this.text=t,this.image=r,this.scale=a,this.fontStack=l,this.textColor=u}}class Di{constructor(t){this.sections=t}static fromString(t){return new Di([new qs(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Di?t:Di.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class Li{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Li)return t;if(typeof t=="number")return new Li([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Li(t)}}toString(){return JSON.stringify(this.values)}}const fc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Zi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Zi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&i<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,t,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,t,r,a]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sn(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof ft||i instanceof $s||i instanceof Di||i instanceof Li||i instanceof Zi||i instanceof Ri)return!0;if(Array.isArray(i)){for(const t of i)if(!sn(t))return!1;return!0}if(typeof i=="object"){for(const t in i)if(!sn(i[t]))return!1;return!0}return!1}function jt(i){if(i===null)return $r;if(typeof i=="string")return Ye;if(typeof i=="boolean")return Ue;if(typeof i=="number")return we;if(i instanceof ft)return bi;if(i instanceof $s)return br;if(i instanceof Di)return Er;if(i instanceof Li)return qr;if(i instanceof Zi)return U;if(i instanceof Ri)return vr;if(Array.isArray(i)){const t=i.length;let r;for(const a of i){const l=jt(a);if(r){if(r===l)continue;r=He;break}r=l}return A(r||He,t)}return ir}function ga(i){const t=typeof i;return i===null?"":t==="string"||t==="number"||t==="boolean"?String(i):i instanceof ft||i instanceof Di||i instanceof Li||i instanceof Zi||i instanceof Ri?i.toString():JSON.stringify(i)}class rr{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!sn(t[1]))return r.error("invalid value");const a=t[1];let l=jt(a);const u=r.expectedType;return l.kind!=="array"||l.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(l=u),new rr(l,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Bt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ga={string:Ye,number:we,boolean:Ue,object:ir};class nr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a,l=1;const u=t[0];if(u==="array"){let f,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in Ga)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Ga[x],l++}else f=He;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],l++}a=A(f,_)}else{if(!Ga[u])throw new Error(`Types doesn't contain name = ${u}`);a=Ga[u]}const d=[];for(;lt.outputDefined())}}const Zs={"to-boolean":Ue,"to-color":bi,"to-number":we,"to-string":Ye};class ar{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[0];if(!Zs[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&t.length!==2)return r.error("Expected one argument.");const l=Zs[a],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Cn(r[0],r[1],r[2],r[3]),!a))return new ft(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Bt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(t);const l=Li.parse(r);if(l)return l}throw new Bt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(t);const l=Zi.parse(r);if(l)return l}throw new Bt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(t),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new Bt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Di.fromString(ga(this.args[0].evaluate(t)));case"resolvedImage":return Ri.fromString(ga(this.args[0].evaluate(t)));default:return ga(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const mc=["Unknown","Point","LineString","Polygon"];class Ha{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?mc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=ft.parse(t)),r}}class on{constructor(t,r,a=[],l,u=new xr,d=[]){this.registry=t,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(t,r,a,l,u={}){return r?this.concat(r,a,l)._parse(t,u):this._parse(t,u)}_parse(t,r){function a(l,u,d){return d==="assert"?new nr(u,[l]):d==="coerce"?new ar(u,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const u=this.registry[l];if(u){let d=u.parse(t,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,_=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"coerce");else d=a(d,f,r.typeAnnotation||"assert")}if(!(d instanceof rr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new Ha;try{d=new rr(d.type,d.evaluate(f))}catch(_){return this.error(_.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,a){const l=typeof t=="number"?this.path.concat(t):this.path,u=a?this.scope.concat(a):this.scope;return new on(this.registry,this._isConstant,l,r||null,u,this.errors)}error(t,...r){const a=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new di(a,t))}checkSubtype(t,r){const a=V(t,r);return a&&this.error(a),a}}class Zr{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let u=1;u=a.length)throw new Bt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Bt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Hs{constructor(t,r){this.type=Ue,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,He),l=r.parse(t[2],2,He);return a&&l?W(a.type,[Ue,Ye,we,$r,He])?new Hs(a,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${k(a.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!J(r,["boolean","string","number","null"]))throw new Bt(`Expected first argument to be of type boolean, string, number or null, but found ${k(jt(r))} instead.`);if(!J(a,["string","array"]))throw new Bt(`Expected second argument to be of type array or string, but found ${k(jt(a))} instead.`);return a.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Mn{constructor(t,r,a){this.type=we,this.needle=t,this.haystack=r,this.fromIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,He),l=r.parse(t[2],2,He);if(!a||!l)return null;if(!W(a.type,[Ue,Ye,we,$r,He]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${k(a.type)} instead`);if(t.length===4){const u=r.parse(t[3],3,we);return u?new Mn(a,l,u):null}return new Mn(a,l)}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!J(r,["boolean","string","number","null"]))throw new Bt(`Expected first argument to be of type boolean, string, number or null, but found ${k(jt(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),J(a,["string"])){const u=a.indexOf(r,l);return u===-1?-1:[...a.slice(0,u)].length}if(J(a,["array"]))return a.indexOf(r,l);throw new Bt(`Expected second argument to be of type array or string, but found ${k(jt(a))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Xs{constructor(t,r,a,l,u,d){this.inputType=t,this.type=r,this.input=a,this.cases=l,this.outputs=u,this.otherwise=d}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let a,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return I.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return I.error("Numeric branch labels must be integer values.");if(a){if(I.checkSubtype(a,jt(M)))return null}else a=jt(M);if(u[String(M)]!==void 0)return I.error("Branch labels must be unique.");u[String(M)]=d.length}const P=r.parse(w,x,l);if(!P)return null;l=l||P.type,d.push(P)}const f=r.parse(t[1],1,He);if(!f)return null;const _=r.parse(t[t.length-1],t.length-1,l);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new Xs(a,l,f,u,d,_):null}evaluate(t){const r=this.input.evaluate(t);return(jt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Xa{constructor(t,r,a){this.type=t,this.branches=r,this.otherwise=a}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class ya{constructor(t,r,a,l){this.type=t,this.input=r,this.beginIndex=a,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,He),l=r.parse(t[2],2,we);if(!a||!l)return null;if(!W(a.type,[A(He),Ye,He]))return r.error(`Expected first argument to be of type array or string, but found ${k(a.type)} instead`);if(t.length===4){const u=r.parse(t[3],3,we);return u?new ya(a.type,a,l,u):null}return new ya(a.type,a,l)}evaluate(t){const r=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),J(r,["string"]))return[...r].slice(a,l).join("");if(J(r,["array"]))return r.slice(a,l);throw new Bt(`Expected first argument to be of type array or string, but found ${k(jt(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Wa(i,t){const r=i.length-1;let a,l,u=0,d=r,f=0;for(;u<=d;)if(f=Math.floor((u+d)/2),a=i[f],l=i[f+1],a<=t){if(f===r||tt))throw new Bt("Input is not a number.");d=f-1}return 0}class En{constructor(t,r,a){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of a)this.labels.push(l),this.outputs.push(u)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(t[1],1,we);if(!a)return null;const l=[];let u=null;r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let d=1;d=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const w=r.parse(_,b,u);if(!w)return null;u=u||w.type,l.push([f,w])}return new En(u,a,l)}evaluate(t){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return a[0].evaluate(t);const u=r.length;return l>=r[u-1]?a[u-1].evaluate(t):a[Wa(r,l)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function rl(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var _c=nl;function nl(i,t,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=a}nl.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(t===void 0&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var l=this.sampleCurveX(r)-i;if(Math.abs(l)l?d=r:f=r,r=.5*(f-d)+d;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var gc=rl(_c);function ln(i,t,r){return i+r*(t-i)}function xa(i,t,r){return i.map((a,l)=>ln(a,t[l],r))}const vi={number:ln,color:function(i,t,r,a="rgb"){switch(a){case"rgb":{const[l,u,d,f]=xa(i.rgb,t.rgb,r);return new ft(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[_,x,b,w]=t.hcl;let I,P;if(isNaN(l)||isNaN(_))isNaN(l)?isNaN(_)?I=NaN:(I=_,d!==1&&d!==0||(P=x)):(I=l,b!==1&&b!==0||(P=u));else{let ie=_-l;_>l&&ie>180?ie-=360:_180&&(ie+=360),I=l+r*ie}const[M,D,j,$]=function([ie,X,ee,le]){return ie=isNaN(ie)?0:ie*je,Mt([ee,Math.cos(ie)*X,Math.sin(ie)*X,le])}([I,P??ln(u,x,r),ln(d,b,r),ln(f,w,r)]);return new ft(M,D,j,$,!1)}case"lab":{const[l,u,d,f]=Mt(xa(i.lab,t.lab,r));return new ft(l,u,d,f,!1)}}},array:xa,padding:function(i,t,r){return new Li(xa(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const a=i.values,l=t.values;if(a.length!==l.length)throw new Bt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const u=[];for(let d=0;dtypeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,we),!u)return null;const f=[];let _=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=bi:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',I);const M=r.parse(w,P,_);if(!M)return null;_=_||M.type,f.push([b,M])}return te(_,we)||te(_,bi)||te(_,qr)||te(_,U)||te(_,A(we))?new wi(_,a,l,u,f):r.error(`Type ${k(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return a[0].evaluate(t);const u=r.length;if(l>=r[u-1])return a[u-1].evaluate(t);const d=Wa(r,l),f=wi.interpolationFactor(this.interpolation,l,r[d],r[d+1]),_=a[d].evaluate(t),x=a[d+1].evaluate(t);switch(this.operator){case"interpolate":return vi[this.type.kind](_,x,f);case"interpolate-hcl":return vi.color(_,x,f,"hcl");case"interpolate-lab":return vi.color(_,x,f,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ka(i,t,r,a){const l=a-r,u=i-r;return l===0?0:t===1?u/l:(Math.pow(t,u)-1)/(Math.pow(t,l)-1)}class Ja{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let a=null;const l=r.expectedType;l&&l.kind!=="value"&&(a=l);const u=[];for(const f of t.slice(1)){const _=r.parse(f,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,u.push(_)}if(!a)throw new Error("No output type");const d=l&&u.some(f=>V(l,f.type));return new Ja(d?He:a,u)}evaluate(t){let r,a=null,l=0;for(const u of this.args)if(l++,a=u.evaluate(t),a&&a instanceof Ri&&!a.available&&(r||(r=a.name),a=null,l===this.args.length&&(a=r)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Ya(i,t){return i==="=="||i==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function al(i,t,r,a){return a.compare(t,r)===0}function Dn(i,t,r){const a=i!=="=="&&i!=="!=";return class Bd{constructor(u,d,f){this.type=Ue,this.lhs=u,this.rhs=d,this.collator=f,this.hasUntypedArgument=u.type.kind==="value"||d.type.kind==="value"}static parse(u,d){if(u.length!==3&&u.length!==4)return d.error("Expected two or three arguments.");const f=u[0];let _=d.parse(u[1],1,He);if(!_)return null;if(!Ya(f,_.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${k(_.type)}'.`);let x=d.parse(u[2],2,He);if(!x)return null;if(!Ya(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${k(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${k(_.type)}' and '${k(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new nr(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new nr(_.type,[x])));let b=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(u[3],3,br),!b)return null}return new Bd(_,x,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const _=jt(d),x=jt(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Bt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=jt(d),x=jt(f);if(_.kind!=="string"||x.kind!=="string")return t(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):t(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const yc=Dn("==",function(i,t,r){return t===r},al),sl=Dn("!=",function(i,t,r){return t!==r},function(i,t,r,a){return!al(0,t,r,a)}),ol=Dn("<",function(i,t,r){return t",function(i,t,r){return t>r},function(i,t,r,a){return a.compare(t,r)>0}),bc=Dn("<=",function(i,t,r){return t<=r},function(i,t,r,a){return a.compare(t,r)<=0}),ll=Dn(">=",function(i,t,r){return t>=r},function(i,t,r,a){return a.compare(t,r)>=0});class ba{constructor(t,r,a){this.type=br,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const l=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ue);if(!l)return null;const u=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ue);if(!u)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Ye),!d)?null:new ba(l,u,d)}evaluate(t){return new $s(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Ws{constructor(t,r,a,l,u){this.type=Ye,this.number=t,this.locale=r,this.currency=a,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const a=r.parse(t[1],1,we);if(!a)return null;const l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let u=null;if(l.locale&&(u=r.parse(l.locale,1,Ye),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Ye),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,we),!f))return null;let _=null;return l["max-fraction-digits"]&&(_=r.parse(l["max-fraction-digits"],1,we),!_)?null:new Ws(a,u,d,f,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Qa{constructor(t){this.type=Er,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let d=1;d<=t.length-1;++d){const f=t[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,we),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,A(Ye)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,bi),!b))return null;const w=l[l.length-1];w.scale=_,w.font=x,w.textColor=b}else{const _=r.parse(t[d],1,He);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,l.push({content:_,scale:null,font:null,textColor:null})}}return new Qa(l)}evaluate(t){return new Di(this.sections.map(r=>{const a=r.content.evaluate(t);return jt(a)===vr?new qs("",a,null,null,null):new qs(ga(a),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Ks{constructor(t){this.type=vr,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const a=r.parse(t[1],1,Ye);return a?new Ks(a):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),a=Ri.fromString(r);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(r)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class Js{constructor(t){this.type=we,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=r.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${k(a.type)} instead.`):new Js(a):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new Bt(`Expected value to be of type string or array, but found ${k(jt(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const wr=8192;function vc(i,t){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*wr),Math.round(a*l*wr)]}function Ys(i,t){const r=Math.pow(2,t.z);return[(l=(i[0]/wr+t.x)/r,360*l-180),(a=(i[1]/wr+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,l}function cn(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function Gr(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function dt(i,t,r){const a=i[0]-t[0],l=i[1]-t[1],u=i[0]-r[0],d=i[1]-r[1];return a*d-u*l==0&&a*u<=0&&l*d<=0}function es(i,t,r,a){return(l=[a[0]-r[0],a[1]-r[1]])[0]*(u=[t[0]-i[0],t[1]-i[1]])[1]-l[1]*u[0]!=0&&!(!hl(i,t,r,a)||!hl(r,a,i,t));var l,u}function wc(i,t,r){for(const a of r)for(let l=0;l(l=i)[1]!=(d=f[_+1])[1]>l[1]&&l[0]<(d[0]-u[0])*(l[1]-u[1])/(d[1]-u[1])+u[0]&&(a=!a)}var l,u,d;return a}function Sc(i,t){for(const r of t)if(Ln(i,r))return!0;return!1}function cl(i,t){for(const r of i)if(!Ln(r,t))return!1;for(let r=0;r0&&f<0||d<0&&f>0}function Qs(i,t,r){const a=[];for(let l=0;lr[2]){const l=.5*a;let u=i[0]-r[0]>l?-a:r[0]-i[0]>l?a:0;u===0&&(u=i[0]-r[2]>l?-a:r[2]-i[0]>l?a:0),i[0]+=u}cn(t,i)}function pl(i,t,r,a){const l=Math.pow(2,a.z)*wr,u=[a.x*wr,a.y*wr],d=[];for(const f of i)for(const _ of f){const x=[_.x+u[0],_.y+u[1]];dl(x,t,r,l),d.push(x)}return d}function fl(i,t,r,a){const l=Math.pow(2,a.z)*wr,u=[a.x*wr,a.y*wr],d=[];for(const _ of i){const x=[];for(const b of _){const w=[b.x+u[0],b.y+u[1]];cn(t,w),x.push(w)}d.push(x)}if(t[2]-t[0]<=l/2){(f=t)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of d)for(const x of _)dl(x,t,r,l)}var f;return d}class hn{constructor(t,r){this.type=Ue,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(sn(t[1])){const a=t[1];if(a.type==="FeatureCollection"){const l=[];for(const u of a.features){const{type:d,coordinates:f}=u.geometry;d==="Polygon"&&l.push(f),d==="MultiPolygon"&&l.push(...f)}if(l.length)return new hn(a,{type:"MultiPolygon",coordinates:l})}else if(a.type==="Feature"){const l=a.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new hn(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new hn(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,a){const l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=Qs(a.coordinates,u,d),_=pl(r.geometry(),l,u,d);if(!Gr(l,u))return!1;for(const x of _)if(!Ln(x,f))return!1}if(a.type==="MultiPolygon"){const f=ul(a.coordinates,u,d),_=pl(r.geometry(),l,u,d);if(!Gr(l,u))return!1;for(const x of _)if(!Sc(x,f))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,a){const l=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],d=r.canonicalID();if(a.type==="Polygon"){const f=Qs(a.coordinates,u,d),_=fl(r.geometry(),l,u,d);if(!Gr(l,u))return!1;for(const x of _)if(!cl(x,f))return!1}if(a.type==="MultiPolygon"){const f=ul(a.coordinates,u,d),_=fl(r.geometry(),l,u,d);if(!Gr(l,u))return!1;for(const x of _)if(!Tc(x,f))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let ml=class{constructor(i=[],t=(r,a)=>ra?1:0){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:t,compare:r}=this,a=t[i];for(;i>0;){const l=i-1>>1,u=t[l];if(r(a,u)>=0)break;t[i]=u,i=l}t[i]=a}_down(i){const{data:t,compare:r}=this,a=this.length>>1,l=t[i];for(;i=0)break;t[i]=t[u],i=u}t[i]=l}};function Ic(i,t,r,a,l){_l(i,t,r,a||i.length-1,l||kc)}function _l(i,t,r,a,l){for(;a>r;){if(a-r>600){var u=a-r+1,d=t-r+1,f=Math.log(u),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(u-_)/u)*(d-u/2<0?-1:1);_l(i,t,Math.max(r,Math.floor(t-d*_/u+x)),Math.min(a,Math.floor(t+(u-d)*_/u+x)),l)}var b=i[t],w=r,I=a;for(va(i,r,t),l(i[a],b)>0&&va(i,r,a);w0;)I--}l(i[r],b)===0?va(i,r,I):va(i,++I,a),I<=t&&(r=I+1),t<=I&&(a=I-1)}}function va(i,t,r){var a=i[t];i[t]=i[r],i[r]=a}function kc(i,t){return it?1:0}function ts(i,t){if(i.length<=1)return[i];const r=[];let a,l;for(const u of i){const d=Pc(u);d!==0&&(u.area=Math.abs(d),l===void 0&&(l=d<0),l===d<0?(a&&r.push(a),a=[u]):a.push(u))}if(a&&r.push(a),t>1)for(let u=0;u1?(x=t[_+1][0],b=t[_+1][1]):P>0&&(x+=w/this.kx*P,b+=I/this.ky*P)),w=this.wrap(r[0]-x)*this.kx,I=(r[1]-b)*this.ky;const M=w*w+I*I;M180;)t-=360;return t}}function bl(i,t){return t[0]-i[0]}function is(i){return i[1]-i[0]+1}function Dr(i,t){return i[1]>=i[0]&&i[1]i[1])return[null,null];const r=is(i);if(t){if(r===2)return[i,null];const l=Math.floor(r/2);return[[i[0],i[0]+l],[i[0]+l,i[1]]]}if(r===1)return[i,null];const a=Math.floor(r/2)-1;return[[i[0],i[0]+a],[i[0]+a+1,i[1]]]}function io(i,t){if(!Dr(t,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)cn(r,i[a]);return r}function ro(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const a of r)cn(t,a);return t}function rs(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function no(i,t,r){if(!rs(i)||!rs(t))return NaN;let a=0,l=0;return i[2]t[2]&&(a=i[0]-t[2]),i[1]>t[3]&&(l=i[1]-t[3]),i[3]=a)return a;if(Gr(l,u)){if(ns(i,t))return 0}else if(ns(t,i))return 0;let d=1/0;for(const f of i)for(let _=0,x=f.length,b=x-1;_0;){const _=d.pop();if(_[0]>=u)continue;const x=_[1],b=t?50:100;if(is(x)<=b){if(!Dr(x,i.length))return NaN;if(t){const w=et(i,x,r,a);if(isNaN(w)||w===0)return w;u=Math.min(u,w)}else for(let w=x[0];w<=x[1];++w){const I=Cc(i[w],r,a);if(u=Math.min(u,I),u===0)return 0}}else{const w=to(x,t);_t(d,u,a,i,f,w[0]),_t(d,u,a,i,f,w[1])}}return u}function Sa(i,t,r,a,l,u=1/0){let d=Math.min(u,l.distance(i[0],r[0]));if(d===0)return d;const f=new ml([[0,[0,i.length-1],[0,r.length-1]]],bl);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],b=_[2],w=t?50:100,I=a?50:100;if(is(x)<=w&&is(b)<=I){if(!Dr(x,i.length)&&Dr(b,r.length))return NaN;let P;if(t&&a)P=zc(i,x,r,b,l),d=Math.min(d,P);else if(t&&!a){const M=i.slice(x[0],x[1]+1);for(let D=b[0];D<=b[1];++D)if(P=un(r[D],M,l),d=Math.min(d,P),d===0)return d}else if(!t&&a){const M=r.slice(b[0],b[1]+1);for(let D=x[0];D<=x[1];++D)if(P=un(i[D],M,l),d=Math.min(d,P),d===0)return d}else P=Dt(i,x,r,b,l),d=Math.min(d,P)}else{const P=to(x,t),M=to(b,a);dn(f,d,l,i,r,P[0],M[0]),dn(f,d,l,i,r,P[0],M[1]),dn(f,d,l,i,r,P[1],M[0]),dn(f,d,l,i,r,P[1],M[1])}}return d}function so(i){return i.type==="MultiPolygon"?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):i.type==="MultiLineString"?i.coordinates.map(t=>({type:"LineString",coordinates:t})):i.type==="MultiPoint"?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class pn{constructor(t,r){this.type=we,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(sn(t[1])){const a=t[1];if(a.type==="FeatureCollection")return new pn(a,a.features.map(l=>so(l.geometry)).flat());if(a.type==="Feature")return new pn(a,so(a.geometry));if("type"in a&&"coordinates"in a)return new pn(a,so(a))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,a){const l=r.geometry(),u=l.flat().map(_=>Ys([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new eo(u[0][1]);let f=1/0;for(const _ of a){switch(_.type){case"Point":f=Math.min(f,Sa(u,!1,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Sa(u,!1,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,wa(u,!1,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,a){const l=r.geometry(),u=l.flat().map(_=>Ys([_.x,_.y],r.canonical));if(l.length===0)return NaN;const d=new eo(u[0][1]);let f=1/0;for(const _ of a){switch(_.type){case"Point":f=Math.min(f,Sa(u,!0,[_.coordinates],!1,d,f));break;case"LineString":f=Math.min(f,Sa(u,!0,_.coordinates,!0,d,f));break;case"Polygon":f=Math.min(f,wa(u,!0,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,a){const l=r.geometry();if(l.length===0||l[0].length===0)return NaN;const u=ts(l,0).map(_=>_.map(x=>x.map(b=>Ys([b.x,b.y],r.canonical)))),d=new eo(u[0][0][0][1]);let f=1/0;for(const _ of a)for(const x of u){switch(_.type){case"Point":f=Math.min(f,wa([_.coordinates],!1,x,d,f));break;case"LineString":f=Math.min(f,wa(_.coordinates,!0,x,d,f));break;case"Polygon":f=Math.min(f,bt(x,_.coordinates,d,f))}if(f===0)return f}return f}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Rn={"==":yc,"!=":sl,">":xc,"<":ol,">=":ll,"<=":bc,array:nr,at:Gs,boolean:nr,case:Xa,coalesce:Ja,collator:ba,format:Qa,image:Ks,in:Hs,"index-of":Mn,interpolate:wi,"interpolate-hcl":wi,"interpolate-lab":wi,length:Js,let:Zr,literal:rr,match:Xs,number:nr,"number-format":Ws,object:nr,slice:ya,step:En,string:nr,"to-boolean":ar,"to-color":ar,"to-number":ar,"to-string":ar,var:ut,within:hn,distance:pn};class Gi{constructor(t,r,a,l){this.name=t,this.type=r,this._evaluate=a,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const a=t[0],l=Gi.definitions[a];if(!l)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const u=Array.isArray(l)?l[0]:l.type,d=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,f=d.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,b]of f){_=new on(r.registry,Ta,r.path,null,r.scope);const w=[];let I=!1;for(let P=1;P{return I=w,Array.isArray(I)?`(${I.map(k).join(", ")})`:`(${k(I.type)}...)`;var I}).join(" | "),b=[];for(let w=1;w{r=t?r&&Ta(a):r&&a instanceof rr}),!!r&&Ia(i)&&ka(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ia(i){if(i instanceof Gi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof hn||i instanceof pn)return!1;let t=!0;return i.eachChild(r=>{t&&!Ia(r)&&(t=!1)}),t}function Bn(i){if(i instanceof Gi&&i.name==="feature-state")return!1;let t=!0;return i.eachChild(r=>{t&&!Bn(r)&&(t=!1)}),t}function ka(i,t){if(i instanceof Gi&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!ka(a,t)&&(r=!1)}),r}function as(i){return{result:"success",value:i}}function Fn(i){return{result:"error",value:i}}function On(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function vl(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function ho(i){return!!i.expression&&i.expression.interpolated}function lt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function ss(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Mc(i){return i}function wl(i,t){const r=t.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",l=a||!(a||i.property!==void 0),u=i.type||(ho(t)?"exponential":"interval");if(r||t.type==="padding"){const b=r?ft.parse:Li.parse;(i=yr({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],b(w[1])])),i.default=b(i.default?i.default:t.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,_,x;if(u==="exponential")f=Tl;else if(u==="interval")f=os;else if(u==="categorical"){f=Sl,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=Il}if(a){const b={},w=[];for(let M=0;MM[0]),evaluate:({zoom:M},D)=>Tl({stops:I,base:i.base},t,M).evaluate(M,D)}}if(l){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:wi.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,t,w,_,x)}}return{kind:"source",evaluate(b,w){const I=w&&w.properties?w.properties[i.property]:void 0;return I===void 0?jn(i.default,t.default):f(i,t,I,_,x)}}}function jn(i,t,r){return i!==void 0?i:t!==void 0?t:r!==void 0?r:void 0}function Sl(i,t,r,a,l){return jn(typeof r===l?a[r]:void 0,i.default,t.default)}function os(i,t,r){if(lt(r)!=="number")return jn(i.default,t.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const l=Wa(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function Tl(i,t,r){const a=i.base!==void 0?i.base:1;if(lt(r)!=="number")return jn(i.default,t.default);const l=i.stops.length;if(l===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[l-1][0])return i.stops[l-1][1];const u=Wa(i.stops.map(b=>b[0]),r),d=function(b,w,I,P){const M=P-I,D=b-I;return M===0?0:w===1?D/M:(Math.pow(w,D)-1)/(Math.pow(w,M)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],_=i.stops[u+1][1],x=vi[t.type]||Mc;return typeof f.evaluate=="function"?{evaluate(...b){const w=f.evaluate.apply(void 0,b),I=_.evaluate.apply(void 0,b);if(w!==void 0&&I!==void 0)return x(w,I,d,i.colorSpace)}}:x(f,_,d,i.colorSpace)}function Il(i,t,r){switch(t.type){case"color":r=ft.parse(r);break;case"formatted":r=Di.fromString(r.toString());break;case"resolvedImage":r=Ri.fromString(r.toString());break;case"padding":r=Li.parse(r);break;default:lt(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return jn(r,i.default,t.default)}Gi.register(Rn,{error:[{kind:"error"},[Ye],(i,[t])=>{throw new Bt(t.evaluate(i))}],typeof:[Ye,[He],(i,[t])=>k(jt(t.evaluate(i)))],"to-rgba":[A(we,4),[bi],(i,[t])=>{const[r,a,l,u]=t.evaluate(i).rgb;return[255*r,255*a,255*l,u]}],rgb:[bi,[we,we,we],oo],rgba:[bi,[we,we,we,we],oo],has:{type:Ue,overloads:[[[Ye],(i,[t])=>lo(t.evaluate(i),i.properties())],[[Ye,ir],(i,[t,r])=>lo(t.evaluate(i),r.evaluate(i))]]},get:{type:He,overloads:[[[Ye],(i,[t])=>co(t.evaluate(i),i.properties())],[[Ye,ir],(i,[t,r])=>co(t.evaluate(i),r.evaluate(i))]]},"feature-state":[He,[Ye],(i,[t])=>co(t.evaluate(i),i.featureState||{})],properties:[ir,[],i=>i.properties()],"geometry-type":[Ye,[],i=>i.geometryType()],id:[He,[],i=>i.id()],zoom:[we,[],i=>i.globals.zoom],"heatmap-density":[we,[],i=>i.globals.heatmapDensity||0],"line-progress":[we,[],i=>i.globals.lineProgress||0],accumulated:[He,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[we,fn(we),(i,t)=>{let r=0;for(const a of t)r+=a.evaluate(i);return r}],"*":[we,fn(we),(i,t)=>{let r=1;for(const a of t)r*=a.evaluate(i);return r}],"-":{type:we,overloads:[[[we,we],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[we],(i,[t])=>-t.evaluate(i)]]},"/":[we,[we,we],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[we,[we,we],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[we,[],()=>Math.LN2],pi:[we,[],()=>Math.PI],e:[we,[],()=>Math.E],"^":[we,[we,we],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[we,[we],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[we,[we],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[we,[we],(i,[t])=>Math.log(t.evaluate(i))],log2:[we,[we],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[we,[we],(i,[t])=>Math.sin(t.evaluate(i))],cos:[we,[we],(i,[t])=>Math.cos(t.evaluate(i))],tan:[we,[we],(i,[t])=>Math.tan(t.evaluate(i))],asin:[we,[we],(i,[t])=>Math.asin(t.evaluate(i))],acos:[we,[we],(i,[t])=>Math.acos(t.evaluate(i))],atan:[we,[we],(i,[t])=>Math.atan(t.evaluate(i))],min:[we,fn(we),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[we,fn(we),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[we,[we],(i,[t])=>Math.abs(t.evaluate(i))],round:[we,[we],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[we,[we],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[we,[we],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Ue,[Ye,He],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Ue,[He],(i,[t])=>i.id()===t.value],"filter-type-==":[Ue,[Ye],(i,[t])=>i.geometryType()===t.value],"filter-<":[Ue,[Ye,He],(i,[t,r])=>{const a=i.properties()[t.value],l=r.value;return typeof a==typeof l&&a{const r=i.id(),a=t.value;return typeof r==typeof a&&r":[Ue,[Ye,He],(i,[t,r])=>{const a=i.properties()[t.value],l=r.value;return typeof a==typeof l&&a>l}],"filter-id->":[Ue,[He],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ue,[Ye,He],(i,[t,r])=>{const a=i.properties()[t.value],l=r.value;return typeof a==typeof l&&a<=l}],"filter-id-<=":[Ue,[He],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ue,[Ye,He],(i,[t,r])=>{const a=i.properties()[t.value],l=r.value;return typeof a==typeof l&&a>=l}],"filter-id->=":[Ue,[He],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ue,[He],(i,[t])=>t.value in i.properties()],"filter-has-id":[Ue,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ue,[A(Ye)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ue,[A(He)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Ue,[Ye,A(He)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Ue,[Ye,A(He)],(i,[t,r])=>function(a,l,u,d){for(;u<=d;){const f=u+d>>1;if(l[f]===a)return!0;l[f]>a?d=f-1:u=f+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Ue,overloads:[[[Ue,Ue],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[fn(Ue),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ue,overloads:[[[Ue,Ue],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[fn(Ue),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Ue,[Ue],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Ue,[Ye],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[Ye,[Ye],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[Ye,[Ye],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[Ye,fn(He),(i,t)=>t.map(r=>ga(r.evaluate(i))).join("")],"resolved-locale":[Ye,[br],(i,[t])=>t.evaluate(i).resolvedLocale()]});class ls{constructor(t,r){var a;this.expression=t,this._warningHistory={},this._evaluator=new Ha,this._defaultValue=r?(a=r).type==="color"&&ss(a.default)?new ft(0,0,0,0):a.type==="color"?ft.parse(a.default)||null:a.type==="padding"?Li.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Zi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,a,l,u,d){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(t,r,a,l,u,d){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=l,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=d||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Bt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function cs(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Rn}function Vn(i,t){const r=new on(Rn,Ta,[],t?function(l){const u={color:bi,string:Ye,number:we,enum:Ye,boolean:Ue,formatted:Er,padding:qr,resolvedImage:vr,variableAnchorOffsetCollection:U};return l.type==="array"?A(u[l.value]||He,l.length):u[l.type]}(t):void 0),a=r.parse(i,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?as(new ls(a,t)):Fn(r.errors)}class Nn{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Bn(r.expression)}evaluateWithoutErrorHandling(t,r,a,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,l,u,d)}evaluate(t,r,a,l,u,d){return this._styleExpression.evaluate(t,r,a,l,u,d)}}class Un{constructor(t,r,a,l){this.kind=t,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Bn(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,a,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,l,u,d)}evaluate(t,r,a,l,u,d){return this._styleExpression.evaluate(t,r,a,l,u,d)}interpolationFactor(t,r,a){return this.interpolationType?wi.interpolationFactor(this.interpolationType,t,r,a):0}}function uo(i,t){const r=Vn(i,t);if(r.result==="error")return r;const a=r.value.expression,l=Ia(a);if(!l&&!On(t))return Fn([new di("","data expressions not supported")]);const u=ka(a,["zoom"]);if(!u&&!vl(t))return Fn([new di("","zoom expressions not supported")]);const d=Aa(a);return d||u?d instanceof di?Fn([d]):d instanceof wi&&!ho(t)?Fn([new di("",'"interpolate" expressions cannot be used with this property')]):as(d?new Un(l?"camera":"composite",r.value,d.labels,d instanceof wi?d.interpolation:void 0):new Nn(l?"constant":"source",r.value)):Fn([new di("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class $n{constructor(t,r){this._parameters=t,this._specification=r,yr(this,wl(this._parameters,this._specification))}static deserialize(t){return new $n(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Aa(i){let t=null;if(i instanceof Zr)t=Aa(i.result);else if(i instanceof Ja){for(const r of i.args)if(t=Aa(r),t)break}else(i instanceof En||i instanceof wi)&&i.input instanceof Gi&&i.input.name==="zoom"&&(t=i);return t instanceof di||i.eachChild(r=>{const a=Aa(r);a instanceof di?t=a:!t&&a?t=new di("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new di("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function hs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!hs(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const us={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function po(i){if(i==null)return{filter:()=>!0,needGeometry:!1};hs(i)||(i=ds(i));const t=Vn(i,us);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,l)=>t.value.evaluate(r,a,{},l),needGeometry:kl(i)}}function Ec(i,t){return it?1:0}function kl(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?fo(i[1],i[2],t):t==="any"?(r=i.slice(1),["any"].concat(r.map(ds))):t==="all"?["all"].concat(i.slice(1).map(ds)):t==="none"?["all"].concat(i.slice(1).map(ds).map(ri)):t==="in"?Pa(i[1],i.slice(2)):t==="!in"?ri(Pa(i[1],i.slice(2))):t==="has"?za(i[1]):t!=="!has"||ri(za(i[1]));var r}function fo(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function Pa(i,t){if(t.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(Ec)]]:["filter-in-small",i,["literal",t]]}}function za(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function ri(i){return["!",i]}function mn(i){const t=typeof i;if(t==="number"||t==="boolean"||t==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${mn(u)},`;return`${l}]`}const r=Object.keys(i).sort();let a="{";for(let l=0;la.maximum?[new ge(t,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function ps(i){const t=i.valueSpec,r=Lt(i.value.type);let a,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=lt(i.value.stops)==="array"&<(i.value.stops[0])==="array"&<(i.value.stops[0][0])==="object",b=Bi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(P){if(r==="identity")return[new ge(P.key,P.value,'identity function may not have a "stops" property')];let M=[];const D=P.value;return M=M.concat(Ca({key:P.key,value:D,valueSpec:P.valueSpec,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,arrayElementValidator:w})),lt(D)==="array"&&D.length===0&&M.push(new ge(P.key,D,"array must have at least one stop")),M},default:function(P){return P.validateSpec({key:P.key,value:P.value,valueSpec:t,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec})}}});return r==="identity"&&f&&b.push(new ge(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new ge(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!ho(i.valueSpec)&&b.push(new ge(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!On(i.valueSpec)?b.push(new ge(i.key,i.value,"property functions not supported")):f&&!vl(i.valueSpec)&&b.push(new ge(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new ge(i.key,i.value,'"property" property is required')),b;function w(P){let M=[];const D=P.value,j=P.key;if(lt(D)!=="array")return[new ge(j,D,`array expected, ${lt(D)} found`)];if(D.length!==2)return[new ge(j,D,`array length 2 expected, length ${D.length} found`)];if(x){if(lt(D[0])!=="object")return[new ge(j,D,`object expected, ${lt(D[0])} found`)];if(D[0].zoom===void 0)return[new ge(j,D,"object stop key must have zoom")];if(D[0].value===void 0)return[new ge(j,D,"object stop key must have value")];if(u&&u>Lt(D[0].zoom))return[new ge(j,D[0].zoom,"stop zoom values must appear in ascending order")];Lt(D[0].zoom)!==u&&(u=Lt(D[0].zoom),l=void 0,d={}),M=M.concat(Bi({key:`${j}[0]`,value:D[0],valueSpec:{zoom:{}},validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,objectElementValidators:{zoom:mo,value:I}}))}else M=M.concat(I({key:`${j}[0]`,value:D[0],valueSpec:{},validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec},D));return cs(sr(D[1]))?M.concat([new ge(`${j}[1]`,D[1],"expressions are not allowed in function stops.")]):M.concat(P.validateSpec({key:`${j}[1]`,value:D[1],valueSpec:t,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec}))}function I(P,M){const D=lt(P.value),j=Lt(P.value),$=P.value!==null?P.value:M;if(a){if(D!==a)return[new ge(P.key,$,`${D} stop domain type must match previous stop domain type ${a}`)]}else a=D;if(D!=="number"&&D!=="string"&&D!=="boolean")return[new ge(P.key,$,"stop domain value must be a number, string, or boolean")];if(D!=="number"&&r!=="categorical"){let ie=`number expected, ${D} found`;return On(t)&&r===void 0&&(ie+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ge(P.key,$,ie)]}return r!=="categorical"||D!=="number"||isFinite(j)&&Math.floor(j)===j?r!=="categorical"&&D==="number"&&l!==void 0&&jnew ge(`${i.key}${a.key}`,i.value,a.message));const r=t.value.expression||t.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new ge(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Bn(r))return[new ge(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Bn(r))return[new ge(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!ka(r,["zoom","feature-state"]))return[new ge(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Ia(r))return[new ge(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Lr(i){const t=i.key,r=i.value,a=i.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Lt(r))===-1&&l.push(new ge(t,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(Lt(r))===-1&&l.push(new ge(t,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function _o(i){return hs(sr(i.value))?qn(yr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):fs(i)}function fs(i){const t=i.value,r=i.key;if(lt(t)!=="array")return[new ge(r,t,`array expected, ${lt(t)} found`)];const a=i.styleSpec;let l,u=[];if(t.length<1)return[new ge(r,t,"filter array must have at least 1 element")];switch(u=u.concat(Lr({key:`${r}[0]`,value:t[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Lt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Lt(t[1])==="$type"&&u.push(new ge(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&u.push(new ge(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=lt(t[1]),l!=="string"&&u.push(new ge(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let d=2;d{x in r&&t.push(new ge(a,r[x],`"${x}" is prohibited for ref layers`))}),l.layers.forEach(x=>{Lt(x.id)===f&&(_=x)}),_?_.ref?t.push(new ge(a,r.ref,"ref cannot reference another ref layer")):d=Lt(_.type):t.push(new ge(a,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const _=l.sources&&l.sources[r.source],x=_&&Lt(_.type);_?x==="vector"&&d==="raster"?t.push(new ge(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?t.push(new ge(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?t.push(new ge(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?t.push(new ge(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||t.push(new ge(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ge(a,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ge(a,r.source,`source "${r.source}" not found`))}else t.push(new ge(a,r,'missing required property "source"'));return t=t.concat(Bi({key:a,value:r,valueSpec:u.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:u.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:_o,layout:_=>Bi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>yo(yr({layerType:d},x))}}),paint:_=>Bi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>ms(yr({layerType:d},x))}})}})),t}function _n(i){const t=i.value,r=i.key,a=lt(t);return a!=="string"?[new ge(r,t,`string expected, ${a} found`)]:[]}const _s={promoteId:function({key:i,value:t}){if(lt(t)==="string")return _n({key:i,value:t});{const r=[];for(const a in t)r.push(..._n({key:`${i}.${a}`,value:t[a]}));return r}}};function Ma(i){const t=i.value,r=i.key,a=i.styleSpec,l=i.style,u=i.validateSpec;if(!t.type)return[new ge(r,t,'"type" is required')];const d=Lt(t.type);let f;switch(d){case"vector":case"raster":return f=Bi({key:r,value:t,valueSpec:a[`source_${d.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:_s,validateSpec:u}),f;case"raster-dem":return f=function(_){var x;const b=(x=_.sourceName)!==null&&x!==void 0?x:"",w=_.value,I=_.styleSpec,P=I.source_raster_dem,M=_.style;let D=[];const j=lt(w);if(w===void 0)return D;if(j!=="object")return D.push(new ge("source_raster_dem",w,`object expected, ${j} found`)),D;const $=Lt(w.encoding)==="custom",ie=["redFactor","greenFactor","blueFactor","baseShift"],X=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const ee in w)!$&&ie.includes(ee)?D.push(new ge(ee,w[ee],`In "${b}": "${ee}" is only valid when "encoding" is set to "custom". ${X} encoding found`)):P[ee]?D=D.concat(_.validateSpec({key:ee,value:w[ee],valueSpec:P[ee],validateSpec:_.validateSpec,style:M,styleSpec:I})):D.push(new ge(ee,w[ee],`unknown property "${ee}"`));return D}({sourceName:r,value:t,style:i.style,styleSpec:a,validateSpec:u}),f;case"geojson":if(f=Bi({key:r,value:t,valueSpec:a.source_geojson,style:l,styleSpec:a,validateSpec:u,objectElementValidators:_s}),t.cluster)for(const _ in t.clusterProperties){const[x,b]=t.clusterProperties[_],w=typeof x=="string"?[x,["accumulated"],["get",_]]:x;f.push(...qn({key:`${r}.${_}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...qn({key:`${r}.${_}.reduce`,value:w,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return Bi({key:r,value:t,valueSpec:a.source_video,style:l,validateSpec:u,styleSpec:a});case"image":return Bi({key:r,value:t,valueSpec:a.source_image,style:l,validateSpec:u,styleSpec:a});case"canvas":return[new ge(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Lr({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:a})}}function bo(i){const t=i.value,r=i.styleSpec,a=r.light,l=i.style;let u=[];const d=lt(t);if(t===void 0)return u;if(d!=="object")return u=u.concat([new ge("light",t,`object expected, ${d} found`)]),u;for(const f in t){const _=f.match(/^(.*)-transition$/);u=u.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:f,value:t[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ge(f,t[f],`unknown property "${f}"`)])}return u}function vo(i){const t=i.value,r=i.styleSpec,a=r.sky,l=i.style,u=lt(t);if(t===void 0)return[];if(u!=="object")return[new ge("sky",t,`object expected, ${u} found`)];let d=[];for(const f in t)d=d.concat(a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],style:l,styleSpec:r}):[new ge(f,t[f],`unknown property "${f}"`)]);return d}function wo(i){const t=i.value,r=i.styleSpec,a=r.terrain,l=i.style;let u=[];const d=lt(t);if(t===void 0)return u;if(d!=="object")return u=u.concat([new ge("terrain",t,`object expected, ${d} found`)]),u;for(const f in t)u=u.concat(a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new ge(f,t[f],`unknown property "${f}"`)]);return u}function So(i){let t=[];const r=i.value,a=i.key;if(Array.isArray(r)){const l=[],u=[];for(const d in r)r[d].id&&l.includes(r[d].id)&&t.push(new ge(a,r,`all the sprites' ids must be unique, but ${r[d].id} is duplicated`)),l.push(r[d].id),r[d].url&&u.includes(r[d].url)&&t.push(new ge(a,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),t=t.concat(Bi({key:`${a}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return _n({key:a,value:r})}const gs={"*":()=>[],array:Ca,boolean:function(i){const t=i.value,r=i.key,a=lt(t);return a!=="boolean"?[new ge(r,t,`boolean expected, ${a} found`)]:[]},number:mo,color:function(i){const t=i.key,r=i.value,a=lt(r);return a!=="string"?[new ge(t,r,`color expected, ${a} found`)]:ft.parse(String(r))?[]:[new ge(t,r,`color expected, "${r}" found`)]},constants:Pl,enum:Lr,filter:_o,function:ps,layer:xo,object:Bi,source:Ma,light:bo,sky:vo,terrain:wo,projection:function(i){const t=i.value,r=i.styleSpec,a=r.projection,l=i.style,u=lt(t);if(t===void 0)return[];if(u!=="object")return[new ge("projection",t,`object expected, ${u} found`)];let d=[];for(const f in t)d=d.concat(a[f]?i.validateSpec({key:f,value:t[f],valueSpec:a[f],style:l,styleSpec:r}):[new ge(f,t[f],`unknown property "${f}"`)]);return d},string:_n,formatted:function(i){return _n(i).length===0?[]:qn(i)},resolvedImage:function(i){return _n(i).length===0?[]:qn(i)},padding:function(i){const t=i.key,r=i.value;if(lt(r)==="array"){if(r.length<1||r.length>4)return[new ge(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let l=[];for(let u=0;u[]}})),i.constants&&(r=r.concat(Pl({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:Zn}))),To(r)}function Sr(i){return function(t){return i({...t,validateSpec:Zn})}}function To(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function or(i){return function(...t){return To(i.apply(this,t))}}Hi.source=or(Sr(Ma)),Hi.sprite=or(Sr(So)),Hi.glyphs=or(Sr(zl)),Hi.light=or(Sr(bo)),Hi.sky=or(Sr(vo)),Hi.terrain=or(Sr(wo)),Hi.layer=or(Sr(xo)),Hi.filter=or(Sr(_o)),Hi.paintProperty=or(Sr(ms)),Hi.layoutProperty=or(Sr(yo));const gn=Hi,Dc=gn.light,Lc=gn.sky,Cl=gn.paintProperty,Ml=gn.layoutProperty;function Io(i,t){let r=!1;if(t&&t.length)for(const a of t)i.fire(new Nr(new Error(a.message))),r=!0;return r}class Gn{constructor(t,r,a){const l=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const d=new Int32Array(this.arrayBuffer);t=d[0],this.d=(r=d[1])+2*(a=d[2]);for(let _=0;_=w[M+0]&&l>=w[M+1])?(f[P]=!0,d.push(b[P])):f[P]=!1}}}}_forEachCell(t,r,a,l,u,d,f,_){const x=this._convertToCellCoord(t),b=this._convertToCellCoord(r),w=this._convertToCellCoord(a),I=this._convertToCellCoord(l);for(let P=x;P<=w;P++)for(let M=b;M<=I;M++){const D=this.d*M+P;if((!_||_(this._convertFromCellCoord(P),this._convertFromCellCoord(M),this._convertFromCellCoord(P+1),this._convertFromCellCoord(M+1)))&&u.call(this,t,r,a,l,D,d,f,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let a=0;for(let d=0;d=0)continue;const d=i[u];l[u]=Xi[r].shallow.indexOf(u)>=0?d:Hn(d,t)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(l.$name=r),l}function Xn(i){if(El(i))return i;if(Array.isArray(i))return i.map(Xn);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);const t=ko(i)||"Object";if(!Xi[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Xi[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];a[l]=Xi[t].shallow.indexOf(l)>=0?u:Xn(u)}return a}class Ao{constructor(){this.first=!0}update(t,r){const a=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Po(i){for(const t of i)if(Co(t.charCodeAt(0)))return!0;return!1}function Rc(i){for(const t of i)if(!Wn(t.charCodeAt(0)))return!1;return!0}function zo(i){const t=i.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(t.join("|"),"u")}const Bc=zo(["Arab","Dupl","Mong","Ougr","Syrc"]);function Wn(i){return!Bc.test(String.fromCodePoint(i))}const Dl=zo(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Co(i){return!(i!==746&&i!==747&&(i<4352||!(nt["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||nt["CJK Compatibility"](i)||nt["CJK Strokes"](i)||!(!nt["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||nt["Enclosed CJK Letters and Months"](i)||nt["Ideographic Description Characters"](i)||nt.Kanbun(i)||nt.Katakana(i)&&i!==12540||!(!nt["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!nt["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||nt["Vertical Forms"](i)||nt["Yijing Hexagram Symbols"](i)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(i))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(i))||Dl.test(String.fromCodePoint(i)))))}function Ll(i){return!(Co(i)||function(t){return!!(nt["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||nt["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||nt["Letterlike Symbols"](t)||nt["Number Forms"](t)||nt["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||nt["Control Pictures"](t)&&t!==9251||nt["Optical Character Recognition"](t)||nt["Enclosed Alphanumerics"](t)||nt["Geometric Shapes"](t)||nt["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||nt["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||nt["CJK Symbols and Punctuation"](t)||nt.Katakana(t)||nt["Private Use Area"](t)||nt["CJK Compatibility Forms"](t)||nt["Small Form Variants"](t)||nt["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(i))}const Fc=zo(["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 Mo(i){return Fc.test(String.fromCodePoint(i))}function Oc(i,t){return!(!t&&Mo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||nt.Khmer(i))}function jc(i){for(const t of i)if(Mo(t.charCodeAt(0)))return!0;return!1}const Fi=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class wt{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ao,this.transition={})}isSupportedScript(t){return function(r,a){for(const l of r)if(!Oc(l.charCodeAt(0),a))return!1;return!0}(t,Fi.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),a=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Kn{constructor(t,r){this.property=t,this.value=r,this.expression=function(a,l){if(ss(a))return new $n(a,l);if(cs(a)){const u=uo(a,l);if(u.result==="error")throw new Error(u.value.map(d=>`${d.key}: ${d.message}`).join(", "));return u.value}{let u=a;return l.type==="color"&&typeof a=="string"?u=ft.parse(a):l.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(u=Zi.parse(a)):u=Li.parse(a),{kind:"constant",evaluate:()=>u}}}(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,a){return this.property.possiblyEvaluate(this,t,r,a)}}class xs{constructor(t){this.property=t,this.value=new Kn(t,void 0)}transitioned(t,r){return new Rl(this.property,this.value,r,$i({},t.transition,this.transition),t.now)}untransitioned(){return new Rl(this.property,this.value,null,{},0)}}class bs{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return mt(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new xs(this._values[t].property)),this._values[t].value=new Kn(this._values[t].property,r===null?void 0:mt(r))}getTransition(t){return mt(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new xs(this._values[t].property)),this._values[t].transition=mt(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(t[r]=a);const l=this.getTransition(r);l!==void 0&&(t[`${r}-transition`]=l)}return t}transitioned(t,r){const a=new Ea(this._properties);for(const l of Object.keys(this._values))a._values[l]=this._values[l].transitioned(t,r._values[l]);return a}untransitioned(){const t=new Ea(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class Rl{constructor(t,r,a,l,u){this.property=t,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,t.specification.transition&&(l.delay||l.duration)&&(this.prior=a)}possiblyEvaluate(t,r,a){const l=t.now||0,u=this.value.possiblyEvaluate(t,r,a),d=this.prior;if(d){if(l>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(l=1)return 1;const x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(f))}}return u}}class Ea{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,a){const l=new La(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,a);return l}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Da{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return mt(this._values[t].value)}setValue(t,r){this._values[t]=new Kn(this._values[t].property,r===null?void 0:mt(r))}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(t[r]=a)}return t}possiblyEvaluate(t,r,a){const l=new La(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(t,r,a);return l}}class Tr{constructor(t,r,a){this.property=t,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,a,l){return this.property.evaluate(this.value,this.parameters,t,r,a,l)}}class La{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class De{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,a){const l=vi[this.specification.type];return l?l(t,r,a):t}}class Ne{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,a,l){return new Tr(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(r,null,{},a,l)}:t.expression,r)}interpolate(t,r,a){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new Tr(this,{kind:"constant",value:void 0},t.parameters);const l=vi[this.specification.type];if(l){const u=l(t.value.value,r.value.value,a);return new Tr(this,{kind:"constant",value:u},t.parameters)}return t}evaluate(t,r,a,l,u,d){return t.kind==="constant"?t.value:t.evaluate(r,a,l,u,d)}}class vs extends Ne{possiblyEvaluate(t,r,a,l){if(t.value===void 0)return new Tr(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){const u=t.expression.evaluate(r,null,{},a,l),d=t.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new Tr(this,{kind:"constant",value:f},r)}if(t.expression.kind==="camera"){const u=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new Tr(this,{kind:"constant",value:u},r)}return new Tr(this,t.expression,r)}evaluate(t,r,a,l,u,d){if(t.kind==="source"){const f=t.evaluate(r,a,l,u,d);return this._calculate(f,f,f,r)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},a,l),t.evaluate({zoom:Math.floor(r.zoom)},a,l),t.evaluate({zoom:Math.floor(r.zoom)+1},a,l),r):t.value}_calculate(t,r,a,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class ws{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,l){if(t.value!==void 0){if(t.expression.kind==="constant"){const u=t.expression.evaluate(r,null,{},a,l);return this._calculate(u,u,u,r)}return this._calculate(t.expression.evaluate(new wt(Math.floor(r.zoom-1),r)),t.expression.evaluate(new wt(Math.floor(r.zoom),r)),t.expression.evaluate(new wt(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,a,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class Eo{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,l){return!!t.expression.evaluate(r,null,{},a,l)}interpolate(){return!1}}class h{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const a=t[r];a.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new Kn(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new xs(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Me("DataDrivenProperty",Ne),Me("DataConstantProperty",De),Me("CrossFadedDataDrivenProperty",vs),Me("CrossFadedProperty",ws),Me("ColorRampProperty",Eo);const e="-transition";class n extends An{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new Da(r.layout)),r.paint)){this._transitionablePaint=new bs(r.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new La(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,a={}){r!=null&&this._validate(Ml,`layers.${this.id}.layout.${t}`,t,r,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(e)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,a={}){if(r!=null&&this._validate(Cl,`layers.${this.id}.paint.${t}`,t,r,a))return!1;if(t.endsWith(e))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[t],u=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(t,f,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,a){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),ua(t,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(t,r,a,l,u={}){return(!u||u.validate!==!1)&&Io(this,t.call(gn,{key:r,layerType:this.type,objectKey:a,value:l,styleSpec:se,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof Tr&&On(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const s={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class o{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class c{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function m(i,t=1){let r=0,a=0;return{members:i.map(l=>{const u=s[l.type].BYTES_PER_ELEMENT,d=r=g(r,Math.max(t,u)),f=l.components||1;return a=Math.max(a,u),r+=u*f,{name:l.name,type:l.type,components:f,offset:d}}),size:g(r,Math.max(a,t)),alignment:t}}function g(i,t){return Math.ceil(i/t)*t}class y extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const l=2*t;return this.int16[l+0]=r,this.int16[l+1]=a,t}}y.prototype.bytesPerElement=4,Me("StructArrayLayout2i4",y);class v extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,a)}emplace(t,r,a,l){const u=3*t;return this.int16[u+0]=r,this.int16[u+1]=a,this.int16[u+2]=l,t}}v.prototype.bytesPerElement=6,Me("StructArrayLayout3i6",v);class S extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,r,a,l)}emplace(t,r,a,l,u){const d=4*t;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=l,this.int16[d+3]=u,t}}S.prototype.bytesPerElement=8,Me("StructArrayLayout4i8",S);class T extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,l,u,d)}emplace(t,r,a,l,u,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=l,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,t}}T.prototype.bytesPerElement=12,Me("StructArrayLayout2i4i12",T);class C extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,l,u,d)}emplace(t,r,a,l,u,d,f){const _=4*t,x=8*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=l,this.uint8[x+5]=u,this.uint8[x+6]=d,this.uint8[x+7]=f,t}}C.prototype.bytesPerElement=8,Me("StructArrayLayout2i4ub8",C);class L extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const l=2*t;return this.float32[l+0]=r,this.float32[l+1]=a,t}}L.prototype.bytesPerElement=8,Me("StructArrayLayout2f8",L);class F extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d,f,_,x,b){const w=this.length;return this.resize(w+1),this.emplace(w,t,r,a,l,u,d,f,_,x,b)}emplace(t,r,a,l,u,d,f,_,x,b,w){const I=10*t;return this.uint16[I+0]=r,this.uint16[I+1]=a,this.uint16[I+2]=l,this.uint16[I+3]=u,this.uint16[I+4]=d,this.uint16[I+5]=f,this.uint16[I+6]=_,this.uint16[I+7]=x,this.uint16[I+8]=b,this.uint16[I+9]=w,t}}F.prototype.bytesPerElement=20,Me("StructArrayLayout10ui20",F);class N extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d,f,_,x,b,w,I){const P=this.length;return this.resize(P+1),this.emplace(P,t,r,a,l,u,d,f,_,x,b,w,I)}emplace(t,r,a,l,u,d,f,_,x,b,w,I,P){const M=12*t;return this.int16[M+0]=r,this.int16[M+1]=a,this.int16[M+2]=l,this.int16[M+3]=u,this.uint16[M+4]=d,this.uint16[M+5]=f,this.uint16[M+6]=_,this.uint16[M+7]=x,this.int16[M+8]=b,this.int16[M+9]=w,this.int16[M+10]=I,this.int16[M+11]=P,t}}N.prototype.bytesPerElement=24,Me("StructArrayLayout4i4ui4i24",N);class q extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,a)}emplace(t,r,a,l){const u=3*t;return this.float32[u+0]=r,this.float32[u+1]=a,this.float32[u+2]=l,t}}q.prototype.bytesPerElement=12,Me("StructArrayLayout3f12",q);class Z extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}Z.prototype.bytesPerElement=4,Me("StructArrayLayout1ul4",Z);class H extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d,f,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,r,a,l,u,d,f,_,x)}emplace(t,r,a,l,u,d,f,_,x,b){const w=10*t,I=5*t;return this.int16[w+0]=r,this.int16[w+1]=a,this.int16[w+2]=l,this.int16[w+3]=u,this.int16[w+4]=d,this.int16[w+5]=f,this.uint32[I+3]=_,this.uint16[w+8]=x,this.uint16[w+9]=b,t}}H.prototype.bytesPerElement=20,Me("StructArrayLayout6i1ul2ui20",H);class O extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,l,u,d)}emplace(t,r,a,l,u,d,f){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=l,this.int16[_+3]=u,this.int16[_+4]=d,this.int16[_+5]=f,t}}O.prototype.bytesPerElement=12,Me("StructArrayLayout2i2i2i12",O);class K extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,a,l,u)}emplace(t,r,a,l,u,d){const f=4*t,_=8*t;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=l,this.int16[_+6]=u,this.int16[_+7]=d,t}}K.prototype.bytesPerElement=16,Me("StructArrayLayout2f1f2i16",K);class Q extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,l,u,d)}emplace(t,r,a,l,u,d,f){const _=16*t,x=4*t,b=8*t;return this.uint8[_+0]=r,this.uint8[_+1]=a,this.float32[x+1]=l,this.float32[x+2]=u,this.int16[b+6]=d,this.int16[b+7]=f,t}}Q.prototype.bytesPerElement=16,Me("StructArrayLayout2ub2f2i16",Q);class re extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,a)}emplace(t,r,a,l){const u=3*t;return this.uint16[u+0]=r,this.uint16[u+1]=a,this.uint16[u+2]=l,t}}re.prototype.bytesPerElement=6,Me("StructArrayLayout3ui6",re);class de extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$){const ie=this.length;return this.resize(ie+1),this.emplace(ie,t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$)}emplace(t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$,ie){const X=24*t,ee=12*t,le=48*t;return this.int16[X+0]=r,this.int16[X+1]=a,this.uint16[X+2]=l,this.uint16[X+3]=u,this.uint32[ee+2]=d,this.uint32[ee+3]=f,this.uint32[ee+4]=_,this.uint16[X+10]=x,this.uint16[X+11]=b,this.uint16[X+12]=w,this.float32[ee+7]=I,this.float32[ee+8]=P,this.uint8[le+36]=M,this.uint8[le+37]=D,this.uint8[le+38]=j,this.uint32[ee+10]=$,this.int16[X+22]=ie,t}}de.prototype.bytesPerElement=48,Me("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",de);class _e extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$,ie,X,ee,le,me,Pe,Ve,ke,Te,Be,Ee){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$,ie,X,ee,le,me,Pe,Ve,ke,Te,Be,Ee)}emplace(t,r,a,l,u,d,f,_,x,b,w,I,P,M,D,j,$,ie,X,ee,le,me,Pe,Ve,ke,Te,Be,Ee,Ce){const ue=32*t,Fe=16*t;return this.int16[ue+0]=r,this.int16[ue+1]=a,this.int16[ue+2]=l,this.int16[ue+3]=u,this.int16[ue+4]=d,this.int16[ue+5]=f,this.int16[ue+6]=_,this.int16[ue+7]=x,this.uint16[ue+8]=b,this.uint16[ue+9]=w,this.uint16[ue+10]=I,this.uint16[ue+11]=P,this.uint16[ue+12]=M,this.uint16[ue+13]=D,this.uint16[ue+14]=j,this.uint16[ue+15]=$,this.uint16[ue+16]=ie,this.uint16[ue+17]=X,this.uint16[ue+18]=ee,this.uint16[ue+19]=le,this.uint16[ue+20]=me,this.uint16[ue+21]=Pe,this.uint16[ue+22]=Ve,this.uint32[Fe+12]=ke,this.float32[Fe+13]=Te,this.float32[Fe+14]=Be,this.uint16[ue+30]=Ee,this.uint16[ue+31]=Ce,t}}_e.prototype.bytesPerElement=64,Me("StructArrayLayout8i15ui1ul2f2ui64",_e);class Ie extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}Ie.prototype.bytesPerElement=4,Me("StructArrayLayout1f4",Ie);class ze extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,a)}emplace(t,r,a,l){const u=3*t;return this.uint16[6*t+0]=r,this.float32[u+1]=a,this.float32[u+2]=l,t}}ze.prototype.bytesPerElement=12,Me("StructArrayLayout1ui2f12",ze);class ve extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,r,a)}emplace(t,r,a,l){const u=4*t;return this.uint32[2*t+0]=r,this.uint16[u+2]=a,this.uint16[u+3]=l,t}}ve.prototype.bytesPerElement=8,Me("StructArrayLayout1ul2ui8",ve);class be extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const l=2*t;return this.uint16[l+0]=r,this.uint16[l+1]=a,t}}be.prototype.bytesPerElement=4,Me("StructArrayLayout2ui4",be);class Le extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}Le.prototype.bytesPerElement=2,Me("StructArrayLayout1ui2",Le);class Ge extends c{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,r,a,l)}emplace(t,r,a,l,u){const d=4*t;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=l,this.float32[d+3]=u,t}}Ge.prototype.bytesPerElement=16,Me("StructArrayLayout4f16",Ge);class Se extends o{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 he(this.anchorPointX,this.anchorPointY)}}Se.prototype.size=20;class Ae extends H{get(t){return new Se(this,t)}}Me("CollisionBoxArray",Ae);class qe extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qe.prototype.size=48;class St extends de{get(t){return new qe(this,t)}}Me("PlacedSymbolArray",St);class Je extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Je.prototype.size=64;class rt extends _e{get(t){return new Je(this,t)}}Me("SymbolInstanceArray",rt);class Tt extends Ie{getoffsetX(t){return this.float32[1*t+0]}}Me("GlyphOffsetArray",Tt);class ni extends v{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Me("SymbolLineVertexArray",ni);class lr extends o{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]}}lr.prototype.size=12;class It extends ze{get(t){return new lr(this,t)}}Me("TextAnchorOffsetArray",It);class Si extends o{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]}}Si.prototype.size=8;class fi extends ve{get(t){return new Si(this,t)}}Me("FeatureIndexArray",fi);class ai extends y{}class mi extends y{}class Ir extends y{}class Jn extends T{}class Ss extends C{}class Yn extends L{}class Wi extends F{}class Ts extends N{}class Do extends q{}class Ki extends Z{}class Ji extends O{}class Hr extends Q{}class cr extends re{}class Jt extends be{}const si=m([{name:"a_pos",components:2,type:"Int16"}],4),{members:Oi}=si;class at{constructor(t=[]){this.segments=t}prepareSegment(t,r,a,l){let u=this.segments[this.segments.length-1];return t>at.MAX_VERTEX_ARRAY_LENGTH&&ii(`Max vertices per segment is ${at.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!u||u.vertexLength+t>at.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==l)&&(u={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},l!==void 0&&(u.sortKey=l),this.segments.push(u)),u}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,a,l){return new at([{vertexOffset:t,primitiveOffset:r,vertexLength:a,primitiveLength:l,vaos:{},sortKey:0}])}}function yn(i,t){return 256*(i=qt(Math.floor(i),0,255))+qt(Math.floor(t),0,255)}at.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Me("SegmentVector",at);const Qn=m([{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"}]);var ea={exports:{}},Bl={exports:{}};Bl.exports=function(i,t){var r,a,l,u,d,f,_,x;for(a=i.length-(r=3&i.length),l=t,d=3432918353,f=461845907,x=0;x>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:l^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*d+(((_>>>16)*d&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return l^=i.length,l=2246822507*(65535&(l^=l>>>16))+((2246822507*(l>>>16)&65535)<<16)&4294967295,l=3266489909*(65535&(l^=l>>>13))+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^=l>>>16)>>>0};var Vc=Bl.exports,Fl={exports:{}};Fl.exports=function(i,t){for(var r,a=i.length,l=t^a,u=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(r>>>16)&65535)<<16),l=1540483477*(65535&l)+((1540483477*(l>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++u;switch(a){case 3:l^=(255&i.charCodeAt(u+2))<<16;case 2:l^=(255&i.charCodeAt(u+1))<<8;case 1:l=1540483477*(65535&(l^=255&i.charCodeAt(u)))+((1540483477*(l>>>16)&65535)<<16)}return l=1540483477*(65535&(l^=l>>>13))+((1540483477*(l>>>16)&65535)<<16),(l^=l>>>15)>>>0};var Xr=Vc,Ol=Fl.exports;ea.exports=Xr,ea.exports.murmur3=Xr,ea.exports.murmur2=Ol;var Is=$e(ea.exports);class Ra{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,a,l){this.ids.push(ks(t)),this.positions.push(r,a,l)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=ks(t);let a=0,l=this.ids.length-1;for(;a>1;this.ids[d]>=r?l=d:a=d+1}const u=[];for(;this.ids[a]===r;)u.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return u}static serialize(t,r){const a=new Float64Array(t.ids),l=new Uint32Array(t.positions);return As(a,l,0,a.length-1),r&&r.push(a.buffer,l.buffer),{ids:a,positions:l}}static deserialize(t){const r=new Ra;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function ks(i){const t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:Is(String(i))}function As(i,t,r,a){for(;r>1];let u=r-1,d=a+1;for(;;){do u++;while(i[u]l);if(u>=d)break;ta(i,u,d),ta(t,3*u,3*d),ta(t,3*u+1,3*d+1),ta(t,3*u+2,3*d+2)}d-r`u_${l}`),this.type=a}setUniform(t,r,a){t.set(a.constantOr(this.value))}getBinding(t,r,a){return this.type==="color"?new Fh(t,r):new jl(t,r)}}class Ps{constructor(t,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,a,l){const u=l==="u_pattern_to"?this.patternTo:l==="u_pattern_from"?this.patternFrom:l==="u_pixel_ratio_to"?this.pixelRatioTo:l==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&t.set(u)}getBinding(t,r,a){return a.substr(0,9)==="u_pattern"?new Bh(t,r):new jl(t,r)}}class xn{constructor(t,r,a,l){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(u=>({name:`a_${u}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new l}populatePaintArray(t,r,a,l,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new wt(0),r,{},l,[],u);this.paintVertexArray.resize(t),this._setPaintValue(d,t,f)}updatePaintArray(t,r,a,l){const u=this.expression.evaluate({zoom:0},a,l);this._setPaintValue(t,r,u)}_setPaintValue(t,r,a){if(this.type==="color"){const l=Nc(a);for(let u=t;u`u_${f}_t`),this.type=a,this.useIntegerZoom=l,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(t,r,a,l,u){const d=this.expression.evaluate(new wt(this.zoom),r,{},l,[],u),f=this.expression.evaluate(new wt(this.zoom+1),r,{},l,[],u),_=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(_,t,d,f)}updatePaintArray(t,r,a,l){const u=this.expression.evaluate({zoom:this.zoom},a,l),d=this.expression.evaluate({zoom:this.zoom+1},a,l);this._setPaintValue(t,r,u,d)}_setPaintValue(t,r,a,l){if(this.type==="color"){const u=Nc(a),d=Nc(l);for(let f=t;f`#define HAS_UNIFORM_${l}`))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof xn||a instanceof Rr)for(let l=0;l!0){this.programConfigurations={};for(const l of t)this.programConfigurations[l.id]=new Oh(l,r,a);this.needsUpload=!1,this._featureMap=new Ra,this._bufferOffset=0}populatePaintArrays(t,r,a,l,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(t,r,l,u,d);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,a,l){for(const u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(t,this._featureMap,r,u,l)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function $d(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function jh(i,t,r){const a={color:{source:L,composite:Ge},number:{source:Ie,composite:L}},l=function(u){return{"line-pattern":{source:Wi,composite:Wi},"fill-pattern":{source:Wi,composite:Wi},"fill-extrusion-pattern":{source:Wi,composite:Wi}}[u]}(i);return l&&l[r]||a[t][r]}Me("ConstantBinder",Lo),Me("CrossFadedConstantBinder",Ps),Me("SourceExpressionBinder",xn),Me("CrossFadedCompositeBinder",ia),Me("CompositeExpressionBinder",Rr),Me("ProgramConfiguration",Oh,{omit:["_buffers"]}),Me("ProgramConfigurationSet",Fa);const Vt=8192,Uc=Math.pow(2,14)-1,Vh=-Uc-1;function Oa(i){const t=Vt/i.extent,r=i.loadGeometry();for(let a=0;ad.x+1||_d.y+1)&&ii("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ja(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?Oa(i):[]}}function Vl(i,t,r,a,l){i.emplaceBack(2*t+(a+1)/2,2*r+(l+1)/2)}class $c{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new mi,this.indexArray=new cr,this.segments=new at,this.programConfigurations=new Fa(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){const l=this.layers[0],u=[];let d=null,f=!1;l.type==="circle"&&(d=l.layout.get("circle-sort-key"),f=!d.isConstant());for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of t){const I=this.layers[0]._featureFilter.needGeometry,P=ja(_,I);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),P,a))continue;const M=f?d.evaluate(P,{},a):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:I?P.geometry:Oa(_),patterns:{},sortKey:M};u.push(D)}f&&u.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:w}=_,I=t[b].feature;this.addFeature(_,x,b,a),r.featureIndex.insert(I,x,b,w,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Oi),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,a,l){for(const u of r)for(const d of u){const f=d.x,_=d.y;if(f<0||f>=Vt||_<0||_>=Vt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),b=x.vertexLength;Vl(this.layoutVertexArray,f,_,-1,-1),Vl(this.layoutVertexArray,f,_,1,-1),Vl(this.layoutVertexArray,f,_,1,1),Vl(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},l)}}function Nh(i,t){for(let r=0;r1){if(qc(i,t))return!0;for(let a=0;a1?r:r.sub(t)._mult(l)._add(t))}function qh(i,t){let r,a,l,u=!1;for(let d=0;dt.y!=l.y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(u=!u)}return u}function zs(i,t){let r=!1;for(let a=0,l=i.length-1;at.y!=d.y>t.y&&t.x<(d.x-u.x)*(t.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function Hd(i,t,r){const a=r[0],l=r[2];if(i.xl.x&&t.x>l.x||i.yl.y&&t.y>l.y)return!1;const u=ui(i,t,r[0]);return u!==ui(i,t,r[1])||u!==ui(i,t,r[2])||u!==ui(i,t,r[3])}function Ro(i,t,r){const a=t.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(i)}function Nl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Ul(i,t,r,a,l){if(!t[0]&&!t[1])return i;const u=he.convert(t)._mult(l);r==="viewport"&&u._rotate(-a);const d=[];for(let f=0;fXh(j,D))}(x,_),P=w?b*f:b;for(const M of l)for(const D of M){const j=w?D:Xh(D,_);let $=P;const ie=$l([],[D.x,D.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=ie[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=d.cameraToCenterDistance/ie[3]),qd(I,j,$))return!0}return!1}}function Xh(i,t){const r=$l([],[i.x,i.y,0,1],t);return new he(r[0]/r[3],r[1]/r[3])}class Wh extends $c{}let Kh;Me("HeatmapBucket",Wh,{omit:["layers"]});var Jd={get paint(){return Kh=Kh||new h({"heatmap-radius":new Ne(se.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ne(se.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new De(se.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Eo(se.paint_heatmap["heatmap-color"]),"heatmap-opacity":new De(se.paint_heatmap["heatmap-opacity"])})}};function Hc(i,{width:t,height:r},a,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==t*r*a)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${t*r*a}`)}else l=new Uint8Array(t*r*a);return i.width=t,i.height=r,i.data=l,i}function Jh(i,{width:t,height:r},a){if(t===i.width&&r===i.height)return;const l=Hc({},{width:t,height:r},a);Xc(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},a),i.width=t,i.height=r,i.data=l.data}function Xc(i,t,r,a,l,u){if(l.width===0||l.height===0)return t;if(l.width>i.width||l.height>i.height||r.x>i.width-l.width||r.y>i.height-l.height)throw new RangeError("out of range source coordinates for image copy");if(l.width>t.width||l.height>t.height||a.x>t.width-l.width||a.y>t.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=t.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_{t[i.evaluationKey]=_;const x=i.expression.evaluate(t);l.data[d+f+0]=Math.floor(255*x.r/x.a),l.data[d+f+1]=Math.floor(255*x.g/x.a),l.data[d+f+2]=Math.floor(255*x.b/x.a),l.data[d+f+3]=Math.floor(255*x.a)};if(i.clips)for(let d=0,f=0;d80*r){f=1/0,_=1/0;let b=-1/0,w=-1/0;for(let I=r;Ib&&(b=P),M>w&&(w=M)}x=Math.max(b-f,w-_),x=x!==0?32767/x:0}return Oo(u,d,r,f,_,x,0),d}function tu(i,t,r,a,l){let u;if(l===function(d,f,_,x){let b=0;for(let w=f,I=_-x;w<_;w+=x)b+=(d[I]-d[w])*(d[w+1]+d[I+1]),I=w;return b}(i,t,r,a)>0)for(let d=t;d=t;d-=a)u=nu(d/a|0,i[d],i[d+1],u);return u&&ql(u,u.next)&&(Vo(u),u=u.next),u}function Va(i,t){if(!i)return i;t||(t=i);let r,a=i;do if(r=!1,a.steiner||!ql(a,a.next)&&Ft(a.prev,a,a.next)!==0)a=a.next;else{if(Vo(a),a=t=a.prev,a===a.next)break;r=!0}while(r||a!==t);return t}function Oo(i,t,r,a,l,u,d){if(!i)return;!d&&u&&function(_,x,b,w){let I=_;do I.z===0&&(I.z=Kc(I.x,I.y,x,b,w)),I.prevZ=I.prev,I.nextZ=I.next,I=I.next;while(I!==_);I.prevZ.nextZ=null,I.prevZ=null,function(P){let M,D=1;do{let j,$=P;P=null;let ie=null;for(M=0;$;){M++;let X=$,ee=0;for(let me=0;me0||le>0&&X;)ee!==0&&(le===0||!X||$.z<=X.z)?(j=$,$=$.nextZ,ee--):(j=X,X=X.nextZ,le--),ie?ie.nextZ=j:P=j,j.prevZ=ie,ie=j;$=X}ie.nextZ=null,D*=2}while(M>1)}(I)}(i,a,l,u);let f=i;for(;i.prev!==i.next;){const _=i.prev,x=i.next;if(u?np(i,a,l,u):rp(i))t.push(_.i,i.i,x.i),Vo(i),i=x.next,f=x.next;else if((i=x)===f){d?d===1?Oo(i=ap(Va(i),t),t,r,a,l,u,2):d===2&&sp(i,t,r,a,l,u):Oo(Va(i),t,r,a,l,u,1);break}}}function rp(i){const t=i.prev,r=i,a=i.next;if(Ft(t,r,a)>=0)return!1;const l=t.x,u=r.x,d=a.x,f=t.y,_=r.y,x=a.y,b=lu?l>d?l:d:u>d?u:d,P=f>_?f>x?f:x:_>x?_:x;let M=a.next;for(;M!==t;){if(M.x>=b&&M.x<=I&&M.y>=w&&M.y<=P&&Ms(l,f,u,_,d,x,M.x,M.y)&&Ft(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function np(i,t,r,a){const l=i.prev,u=i,d=i.next;if(Ft(l,u,d)>=0)return!1;const f=l.x,_=u.x,x=d.x,b=l.y,w=u.y,I=d.y,P=f<_?f_?f>x?f:x:_>x?_:x,j=b>w?b>I?b:I:w>I?w:I,$=Kc(P,M,t,r,a),ie=Kc(D,j,t,r,a);let X=i.prevZ,ee=i.nextZ;for(;X&&X.z>=$&&ee&&ee.z<=ie;){if(X.x>=P&&X.x<=D&&X.y>=M&&X.y<=j&&X!==l&&X!==d&&Ms(f,b,_,w,x,I,X.x,X.y)&&Ft(X.prev,X,X.next)>=0||(X=X.prevZ,ee.x>=P&&ee.x<=D&&ee.y>=M&&ee.y<=j&&ee!==l&&ee!==d&&Ms(f,b,_,w,x,I,ee.x,ee.y)&&Ft(ee.prev,ee,ee.next)>=0))return!1;ee=ee.nextZ}for(;X&&X.z>=$;){if(X.x>=P&&X.x<=D&&X.y>=M&&X.y<=j&&X!==l&&X!==d&&Ms(f,b,_,w,x,I,X.x,X.y)&&Ft(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;ee&&ee.z<=ie;){if(ee.x>=P&&ee.x<=D&&ee.y>=M&&ee.y<=j&&ee!==l&&ee!==d&&Ms(f,b,_,w,x,I,ee.x,ee.y)&&Ft(ee.prev,ee,ee.next)>=0)return!1;ee=ee.nextZ}return!0}function ap(i,t){let r=i;do{const a=r.prev,l=r.next.next;!ql(a,l)&&iu(a,r,r.next,l)&&jo(a,l)&&jo(l,a)&&(t.push(a.i,r.i,l.i),Vo(r),Vo(r.next),r=i=l),r=r.next}while(r!==i);return Va(r)}function sp(i,t,r,a,l,u){let d=i;do{let f=d.next.next;for(;f!==d.prev;){if(d.i!==f.i&&up(d,f)){let _=ru(d,f);return d=Va(d,d.next),_=Va(_,_.next),Oo(d,t,r,a,l,u,0),void Oo(_,t,r,a,l,u,0)}f=f.next}d=d.next}while(d!==i)}function op(i,t){return i.x-t.x}function lp(i,t){const r=function(l,u){let d=u;const f=l.x,_=l.y;let x,b=-1/0;do{if(_<=d.y&&_>=d.next.y&&d.next.y!==d.y){const D=d.x+(_-d.y)*(d.next.x-d.x)/(d.next.y-d.y);if(D<=f&&D>b&&(b=D,x=d.x=d.x&&d.x>=I&&f!==d.x&&Ms(_x.x||d.x===x.x&&cp(x,d)))&&(x=d,M=D)}d=d.next}while(d!==w);return x}(i,t);if(!r)return t;const a=ru(r,i);return Va(a,a.next),Va(r,r.next)}function cp(i,t){return Ft(i.prev,i,t.prev)<0&&Ft(t.next,i,i.next)<0}function Kc(i,t,r,a,l){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*l|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*l|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function hp(i){let t=i,r=i;do(t.x=(i-d)*(u-f)&&(i-d)*(a-f)>=(r-d)*(t-f)&&(r-d)*(u-f)>=(l-d)*(a-f)}function up(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,a){let l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&iu(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1}(i,t)&&(jo(i,t)&&jo(t,i)&&function(r,a){let l=r,u=!1;const d=(r.x+a.x)/2,f=(r.y+a.y)/2;do l.y>f!=l.next.y>f&&l.next.y!==l.y&&d<(l.next.x-l.x)*(f-l.y)/(l.next.y-l.y)+l.x&&(u=!u),l=l.next;while(l!==r);return u}(i,t)&&(Ft(i.prev,i,t.prev)||Ft(i,t.prev,t))||ql(i,t)&&Ft(i.prev,i,i.next)>0&&Ft(t.prev,t,t.next)>0)}function Ft(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function ql(i,t){return i.x===t.x&&i.y===t.y}function iu(i,t,r,a){const l=Gl(Ft(i,t,r)),u=Gl(Ft(i,t,a)),d=Gl(Ft(r,a,i)),f=Gl(Ft(r,a,t));return l!==u&&d!==f||!(l!==0||!Zl(i,r,t))||!(u!==0||!Zl(i,a,t))||!(d!==0||!Zl(r,i,a))||!(f!==0||!Zl(r,t,a))}function Zl(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function Gl(i){return i>0?1:i<0?-1:0}function jo(i,t){return Ft(i.prev,i,i.next)<0?Ft(i,t,i.next)>=0&&Ft(i,i.prev,t)>=0:Ft(i,t,i.prev)<0||Ft(i,i.next,t)<0}function ru(i,t){const r=Jc(i.i,i.x,i.y),a=Jc(t.i,t.x,t.y),l=i.next,u=t.prev;return i.next=t,t.prev=i,r.next=l,l.prev=r,a.next=r,r.prev=a,u.next=a,a.prev=u,a}function nu(i,t,r,a){const l=Jc(i,t,r);return a?(l.next=a.next,l.prev=a,a.next.prev=l,a.next=l):(l.prev=l,l.next=l),l}function Vo(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Jc(i,t,r){return{i,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Yc(i,t,r){const a=r.patternDependencies;let l=!1;for(const u of t){const d=u.paint.get(`${i}-pattern`);d.isConstant()||(l=!0);const f=d.constantOr(null);f&&(l=!0,a[f.to]=!0,a[f.from]=!0)}return l}function Qc(i,t,r,a,l){const u=l.patternDependencies;for(const d of t){const f=d.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:a-1},r,{},l.availableImages),x=f.evaluate({zoom:a},r,{},l.availableImages),b=f.evaluate({zoom:a+1},r,{},l.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,b=b&&b.name?b.name:b,u[_]=!0,u[x]=!0,u[b]=!0,r.patterns[d.id]={min:_,mid:x,max:b}}}return r}class eh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ir,this.indexArray=new cr,this.indexArray2=new Jt,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new at,this.segments2=new at,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Yc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const w=this.layers[0]._featureFilter.needGeometry,I=ja(f,w);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),I,a))continue;const P=u?l.evaluate(I,{},a,r.availableImages):void 0,M={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?I.geometry:Oa(f),patterns:{},sortKey:P};d.push(M)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=Qc("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ip),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,a,l,u){for(const d of ts(r,500)){let f=0;for(const P of d)f+=P.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const P of d){if(P.length===0)continue;P!==d[0]&&w.push(b.length/2);const M=this.segments2.prepareSegment(P.length,this.layoutVertexArray,this.indexArray2),D=M.vertexLength;this.layoutVertexArray.emplaceBack(P[0].x,P[0].y),this.indexArray2.emplaceBack(D+P.length-1,D),b.push(P[0].x),b.push(P[0].y);for(let j=1;j>3}if(l--,a===1||a===2)u+=i.readSVarint(),d+=i.readSVarint(),a===1&&(t&&f.push(t),t=[]),t.push(new gp(u,d));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&f.push(t),f},Es.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,a=0,l=0,u=0,d=1/0,f=-1/0,_=1/0,x=-1/0;i.pos>3}if(a--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())<_&&(_=u),u>x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,_,f,x]},Es.prototype.toGeoJSON=function(i,t,r){var a,l,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*t,_=this.loadGeometry(),x=Es.types[this.type];function b(P){for(var M=0;M>3;l=d===1?a.readString():d===2?a.readFloat():d===3?a.readDouble():d===4?a.readVarint64():d===5?a.readVarint():d===6?a.readSVarint():d===7?a.readBoolean():null}return l}(r))}cu.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new bp(this._pbf,t,this.extent,this._keys,this._values)};var wp=lu;function Sp(i,t,r){if(i===3){var a=new wp(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}ra.VectorTile=function(i,t){this.layers=i.readFields(Sp,{},t)},ra.VectorTileFeature=ou,ra.VectorTileLayer=lu;const Tp=ra.VectorTileFeature.types,th=Math.pow(2,13);function No(i,t,r,a,l,u,d,f){i.emplaceBack(t,r,2*Math.floor(a*th)+d,l*th*2,u*th*2,Math.round(f))}class ih{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Jn,this.centroidVertexArray=new ai,this.indexArray=new cr,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new at,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.features=[],this.hasPattern=Yc("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:d,sourceLayerIndex:f}of t){const _=this.layers[0]._featureFilter.needGeometry,x=ja(l,_);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),x,a))continue;const b={id:u,sourceLayerIndex:f,index:d,geometry:_?x.geometry:Oa(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(Qc("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,d,a,{}),r.featureIndex.insert(l,b.geometry,d,f,this.index,!0)}}addFeatures(t,r,a){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,a)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_p),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,mp.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,a,l,u){for(const d of ts(r,500)){const f={x:0,y:0,vertexCount:0};let _=0;for(const M of d)_+=M.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const M of d){if(M.length===0||kp(M))continue;let D=0;for(let j=0;j=1){const ie=M[j-1];if(!Ip($,ie)){x.vertexLength+4>at.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const X=$.sub(ie)._perp()._unit(),ee=ie.dist($);D+ee>32768&&(D=0),No(this.layoutVertexArray,$.x,$.y,X.x,X.y,0,0,D),No(this.layoutVertexArray,$.x,$.y,X.x,X.y,0,1,D),f.x+=2*$.x,f.y+=2*$.y,f.vertexCount+=2,D+=ee,No(this.layoutVertexArray,ie.x,ie.y,X.x,X.y,0,0,D),No(this.layoutVertexArray,ie.x,ie.y,X.x,X.y,0,1,D),f.x+=2*ie.x,f.y+=2*ie.y,f.vertexCount+=2;const le=x.vertexLength;this.indexArray.emplaceBack(le,le+2,le+1),this.indexArray.emplaceBack(le+1,le+2,le+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>at.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),Tp[t.type]!=="Polygon")continue;const b=[],w=[],I=x.vertexLength;for(const M of d)if(M.length!==0){M!==d[0]&&w.push(b.length/2);for(let D=0;DVt)||i.y===t.y&&(i.y<0||i.y>Vt)}function kp(i){return i.every(t=>t.x<0)||i.every(t=>t.x>Vt)||i.every(t=>t.y<0)||i.every(t=>t.y>Vt)}let hu;Me("FillExtrusionBucket",ih,{omit:["layers","features"]});var Ap={get paint(){return hu=hu||new h({"fill-extrusion-opacity":new De(se["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ne(se["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new De(se["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new De(se["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new vs(se["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ne(se["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ne(se["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new De(se["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Pp extends n{constructor(t){super(t,Ap)}createBucket(t){return new ih(t)}queryRadius(){return Nl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,a,l,u,d,f,_){const x=Ul(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,f),b=this.paint.get("fill-extrusion-height").evaluate(r,a),w=this.paint.get("fill-extrusion-base").evaluate(r,a),I=function(M,D,j,$){const ie=[];for(const X of M){const ee=[X.x,X.y,0,1];$l(ee,ee,D),ie.push(new he(ee[0]/ee[3],ee[1]/ee[3]))}return ie}(x,_),P=function(M,D,j,$){const ie=[],X=[],ee=$[8]*D,le=$[9]*D,me=$[10]*D,Pe=$[11]*D,Ve=$[8]*j,ke=$[9]*j,Te=$[10]*j,Be=$[11]*j;for(const Ee of M){const Ce=[],ue=[];for(const Fe of Ee){const Re=Fe.x,Ze=Fe.y,xt=$[0]*Re+$[4]*Ze+$[12],yt=$[1]*Re+$[5]*Ze+$[13],Gt=$[2]*Re+$[6]*Ze+$[14],kr=$[3]*Re+$[7]*Ze+$[15],li=Gt+me,Ht=kr+Pe,Ii=xt+Ve,ki=yt+ke,Ai=Gt+Te,Rt=kr+Be,Xt=new he((xt+ee)/Ht,(yt+le)/Ht);Xt.z=li/Ht,Ce.push(Xt);const _i=new he(Ii/Rt,ki/Rt);_i.z=Ai/Rt,ue.push(_i)}ie.push(Ce),X.push(ue)}return[ie,X]}(l,w,b,_);return function(M,D,j){let $=1/0;Uh(j,D)&&($=uu(j,D[0]));for(let ie=0;ier.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Ss,this.layoutVertexArray2=new Yn,this.indexArray=new cr,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new at,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Yc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of t){const w=this.layers[0]._featureFilter.needGeometry,I=ja(f,w);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),I,a))continue;const P=u?l.evaluate(I,{},a):void 0,M={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?I.geometry:Oa(f),patterns:{},sortKey:P};d.push(M)}u&&d.sort((f,_)=>f.sortKey-_.sortKey);for(const f of d){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=Qc("line",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,b,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const l of this.patternFeatures)this.addFeature(l,l.geometry,l.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ep)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Cp),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,a,l,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(t,{}),_=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const w of r)this.addLine(w,t,f,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,u,l)}addLine(t,r,a,l,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$=2&&t[_-1].equals(t[_-2]);)_--;let x=0;for(;x<_-1&&t[x].equals(t[x+1]);)x++;if(_<(f?3:2))return;a==="bevel"&&(u=1.05);const b=this.overscaling<=16?15*Vt/(512*this.overscaling):0,w=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let I,P,M,D,j;this.e1=this.e2=-1,f&&(I=t[_-2],j=t[x].sub(I)._unit()._perp());for(let $=x;$<_;$++){if(M=$===_-1?f?t[x+1]:void 0:t[$+1],M&&t[$].equals(M))continue;j&&(D=j),I&&(P=I),I=t[$],j=M?M.sub(I)._unit()._perp():D,D=D||j;let ie=D.add(j);ie.x===0&&ie.y===0||ie._unit();const X=D.x*j.x+D.y*j.y,ee=ie.x*j.x+ie.y*j.y,le=ee!==0?1/ee:1/0,me=2*Math.sqrt(2-2*ee),Pe=ee0;if(Pe&&$>x){const Be=I.dist(P);if(Be>2*b){const Ee=I.sub(I.sub(P)._mult(b/Be)._round());this.updateDistance(P,Ee),this.addCurrentVertex(Ee,D,0,0,w),P=Ee}}const ke=P&&M;let Te=ke?a:f?"butt":l;if(ke&&Te==="round"&&(leu&&(Te="bevel"),Te==="bevel"&&(le>2&&(Te="flipbevel"),le100)ie=j.mult(-1);else{const Be=le*D.add(j).mag()/D.sub(j).mag();ie._perp()._mult(Be*(Ve?-1:1))}this.addCurrentVertex(I,ie,0,0,w),this.addCurrentVertex(I,ie.mult(-1),0,0,w)}else if(Te==="bevel"||Te==="fakeround"){const Be=-Math.sqrt(le*le-1),Ee=Ve?Be:0,Ce=Ve?0:Be;if(P&&this.addCurrentVertex(I,D,Ee,Ce,w),Te==="fakeround"){const ue=Math.round(180*me/Math.PI/20);for(let Fe=1;Fe2*b){const Ee=I.add(M.sub(I)._mult(b/Be)._round());this.updateDistance(I,Ee),this.addCurrentVertex(Ee,j,0,0,w),I=Ee}}}}addCurrentVertex(t,r,a,l,u,d=!1){const f=r.y*l-r.x,_=-r.y-r.x*l;this.addHalfVertex(t,r.x+r.y*a,r.y-r.x*a,d,!1,a,u),this.addHalfVertex(t,f,_,d,!0,-l,u),this.distance>du/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,a,l,u,d))}addHalfVertex({x:t,y:r},a,l,u,d,f,_){const x=.5*(this.lineClips?this.scaledDistance*(du-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(u?1:0),(r<<1)+(d?1:0),Math.round(63*a)+128,Math.round(63*l)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let pu,fu;Me("LineBucket",rh,{omit:["layers","patternFeatures"]});var mu={get paint(){return fu=fu||new h({"line-opacity":new Ne(se.paint_line["line-opacity"]),"line-color":new Ne(se.paint_line["line-color"]),"line-translate":new De(se.paint_line["line-translate"]),"line-translate-anchor":new De(se.paint_line["line-translate-anchor"]),"line-width":new Ne(se.paint_line["line-width"]),"line-gap-width":new Ne(se.paint_line["line-gap-width"]),"line-offset":new Ne(se.paint_line["line-offset"]),"line-blur":new Ne(se.paint_line["line-blur"]),"line-dasharray":new ws(se.paint_line["line-dasharray"]),"line-pattern":new vs(se.paint_line["line-pattern"]),"line-gradient":new Eo(se.paint_line["line-gradient"])})},get layout(){return pu=pu||new h({"line-cap":new De(se.layout_line["line-cap"]),"line-join":new Ne(se.layout_line["line-join"]),"line-miter-limit":new De(se.layout_line["line-miter-limit"]),"line-round-limit":new De(se.layout_line["line-round-limit"]),"line-sort-key":new Ne(se.layout_line["line-sort-key"])})}};class Rp extends Ne{possiblyEvaluate(t,r){return r=new wt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,a,l){return r=$i({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,a,l)}}let Hl;class Bp extends n{constructor(t){super(t,mu),this.gradientVersion=0,Hl||(Hl=new Rp(mu.paint.properties["line-width"].specification),Hl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof En,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Hl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new rh(t)}queryRadius(t){const r=t,a=_u(Ro("line-width",this,r),Ro("line-gap-width",this,r)),l=Ro("line-offset",this,r);return a/2+Math.abs(l)+Nl(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,a,l,u,d,f){const _=Ul(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*_u(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),b=this.paint.get("line-offset").evaluate(r,a);return b&&(l=function(w,I){const P=[];for(let M=0;M=3){for(let j=0;j0?t+2*i:i}const Fp=m([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Op=m([{name:"a_projected_pos",components:3,type:"Float32"}],4);m([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const jp=m([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);m([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const gu=m([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Vp=m([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Np(i,t,r){return i.sections.forEach(a=>{a.text=function(l,u,d){const f=u.layout.get("text-transform").evaluate(d,{});return f==="uppercase"?l=l.toLocaleUpperCase():f==="lowercase"&&(l=l.toLocaleLowerCase()),Fi.applyArabicShaping&&(l=Fi.applyArabicShaping(l)),l}(a.text,t,r)}),i}m([{name:"triangle",components:3,type:"Uint16"}]),m([{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"}]),m([{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"}]),m([{type:"Float32",name:"offsetX"}]),m([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),m([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const $o={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Nt=24,yu=gt,xu=function(i,t,r,a,l){var u,d,f=8*l-a-1,_=(1<>1,b=-7,w=l-1,I=-1,P=i[t+w];for(w+=I,u=P&(1<<-b)-1,P>>=-b,b+=f;b>0;u=256*u+i[t+w],w+=I,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=a;b>0;d=256*d+i[t+w],w+=I,b-=8);if(u===0)u=1-x;else{if(u===_)return d?NaN:1/0*(P?-1:1);d+=Math.pow(2,a),u-=x}return(P?-1:1)*d*Math.pow(2,u-a)},bu=function(i,t,r,a,l,u){var d,f,_,x=8*u-l-1,b=(1<>1,I=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=0,M=1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,d=b):(d=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-d))<1&&(d--,_*=2),(t+=d+w>=1?I/_:I*Math.pow(2,1-w))*_>=2&&(d++,_/=2),d+w>=b?(f=0,d=b):d+w>=1?(f=(t*_-1)*Math.pow(2,l),d+=w):(f=t*Math.pow(2,w-1)*Math.pow(2,l),d=0));l>=8;i[r+P]=255&f,P+=M,f/=256,l-=8);for(d=d<0;i[r+P]=255&d,P+=M,d/=256,x-=8);i[r+P-M]|=128*D};function gt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}gt.Varint=0,gt.Fixed64=1,gt.Bytes=2,gt.Fixed32=5;var nh=4294967296,vu=1/nh,wu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function bn(i){return i.type===gt.Bytes?i.readVarint()+i.pos:i.pos+1}function Ds(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}function Su(i,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=i;l--)r.buf[l+a]=r.buf[l]}function Up(i,t){for(var r=0;r>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function Tu(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}gt.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&a,i(l,t,this),this.pos===u&&this.skip(a)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=Xl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Tu(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Xl(this.buf,this.pos)+Xl(this.buf,this.pos+4)*nh;return this.pos+=8,i},readSFixed64:function(){var i=Xl(this.buf,this.pos)+Tu(this.buf,this.pos+4)*nh;return this.pos+=8,i},readFloat:function(){var i=xu(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=xu(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(l,u,d){var f,_,x=d.buf;if(f=(112&(_=x[d.pos++]))>>4,_<128||(f|=(127&(_=x[d.pos++]))<<3,_<128)||(f|=(127&(_=x[d.pos++]))<<10,_<128)||(f|=(127&(_=x[d.pos++]))<<17,_<128)||(f|=(127&(_=x[d.pos++]))<<24,_<128)||(f|=(1&(_=x[d.pos++]))<<31,_<128))return Ds(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&wu?function(r,a,l){return wu.decode(r.subarray(a,l))}(this.buf,t,i):function(r,a,l){for(var u="",d=a;d239?4:b>223?3:b>191?2:1;if(d+I>l)break;I===1?b<128&&(w=b):I===2?(192&(f=r[d+1]))==128&&(w=(31&b)<<6|63&f)<=127&&(w=null):I===3?(_=r[d+2],(192&(f=r[d+1]))==128&&(192&_)==128&&((w=(15&b)<<12|(63&f)<<6|63&_)<=2047||w>=55296&&w<=57343)&&(w=null)):I===4&&(_=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&_)==128&&(192&x)==128&&((w=(15&b)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,I=1):w>65535&&(w-=65536,u+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),u+=String.fromCharCode(w),d+=I}return u}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==gt.Bytes)return i.push(this.readVarint(t));var r=bn(this);for(i=i||[];this.pos127;);else if(t===gt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===gt.Fixed32)this.pos+=4;else{if(t!==gt.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t268435455||i<0?function(t,r){var a,l;if(t>=0?(a=t%4294967296|0,l=t/4294967296|0):(l=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,l=l+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(u,d,f){f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,u>>>=7,f.buf[f.pos++]=127&u|128,f.buf[f.pos]=127&(u>>>=7)}(a,0,r),function(u,d){var f=(7&u)<<4;d.buf[d.pos++]|=f|((u>>>=3)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u|((u>>>=7)?128:0),u&&(d.buf[d.pos++]=127&u)))))}(l,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(a,l,u){for(var d,f,_=0;_55295&&d<57344){if(!f){d>56319||_+1===l.length?(a[u++]=239,a[u++]=191,a[u++]=189):f=d;continue}if(d<56320){a[u++]=239,a[u++]=191,a[u++]=189,f=d;continue}d=f-55296<<10|d-56320|65536,f=null}else f&&(a[u++]=239,a[u++]=191,a[u++]=189,f=null);d<128?a[u++]=d:(d<2048?a[u++]=d>>6|192:(d<65536?a[u++]=d>>12|224:(a[u++]=d>>18|240,a[u++]=d>>12&63|128),a[u++]=d>>6&63|128),a[u++]=63&d|128)}return u}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&Su(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),bu(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),bu(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Su(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,t,r){this.writeTag(i,gt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,Up,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,$p,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,Gp,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,qp,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,Zp,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,Hp,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,Xp,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,Wp,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,Kp,t)},writeBytesField:function(i,t){this.writeTag(i,gt.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,gt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,gt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,gt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(i,t){this.writeTag(i,gt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,gt.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,gt.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,gt.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,gt.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,gt.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var ah=$e(yu);const sh=3;function Jp(i,t,r){i===1&&r.readMessage(Yp,t)}function Yp(i,t,r){if(i===3){const{id:a,bitmap:l,width:u,height:d,left:f,top:_,advance:x}=r.readMessage(Qp,{});t.push({id:a,bitmap:new Fo({width:u+2*sh,height:d+2*sh},l),metrics:{width:u,height:d,left:f,top:_,advance:x}})}}function Qp(i,t,r){i===1?t.id=r.readVarint():i===2?t.bitmap=r.readBytes():i===3?t.width=r.readVarint():i===4?t.height=r.readVarint():i===5?t.left=r.readSVarint():i===6?t.top=r.readSVarint():i===7&&(t.advance=r.readVarint())}const Iu=sh;function ku(i){let t=0,r=0;for(const d of i)t+=d.w*d.h,r=Math.max(r,d.w);i.sort((d,f)=>f.h-d.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let l=0,u=0;for(const d of i)for(let f=a.length-1;f>=0;f--){const _=a[f];if(!(d.w>_.w||d.h>_.h)){if(d.x=_.x,d.y=_.y,u=Math.max(u,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===_.w&&d.h===_.h){const x=a.pop();f=0&&a>=t&&Kl[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const a=new Rs;return a.text=this.text.substring(t,r),a.sectionIndex=this.sectionIndex.slice(t,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Zo.forText(t.scale,t.fontStack||r));const a=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Wl(i,t,r,a,l,u,d,f,_,x,b,w,I,P,M){const D=Rs.fromFeature(i,l);let j;w===z.ah.vertical&&D.verticalizePunctuation();const{processBidirectionalText:$,processStyledBidirectionalText:ie}=Fi;if($&&D.sections.length===1){j=[];const le=$(D.toString(),lh(D,x,u,t,a,P));for(const me of le){const Pe=new Rs;Pe.text=me,Pe.sections=D.sections;for(let Ve=0;Ve0&&vn>hi&&(hi=vn)}else{const pr=Pe[ct.fontStack],Yt=pr&&pr[kt];if(Yt&&Yt.rect)js=Yt.rect,Et=Yt.metrics;else{const vn=me[ct.fontStack],Jo=vn&&vn[kt];if(!Jo)continue;Et=Jo.metrics}Yi=(Xt-ct.scale)*Nt}Ar?(le.verticalizable=!0,Pi.push({glyph:kt,imageName:Kr,x:Ze,y:xt+Yi,vertical:Ar,scale:ct.scale,fontStack:ct.fontStack,sectionIndex:vt,metrics:Et,rect:js}),Ze+=Jr*ct.scale+ue):(Pi.push({glyph:kt,imageName:Kr,x:Ze,y:xt+Yi,vertical:Ar,scale:ct.scale,fontStack:ct.fontStack,sectionIndex:vt,metrics:Et,rect:js}),Ze+=Et.advance*ct.scale+ue)}Pi.length!==0&&(yt=Math.max(Ze-ue,yt),nf(Pi,0,Pi.length-1,kr,hi)),Ze=0;const dr=Te*Xt+hi;ci.lineOffset=Math.max(hi,_i),xt+=dr,Gt=Math.max(dr,Gt),++li}var Ht;const Ii=xt-qo,{horizontalAlign:ki,verticalAlign:Ai}=ch(Be);(function(Rt,Xt,_i,ci,Pi,hi,dr,Vi,ct){const vt=(Xt-_i)*Pi;let kt=0;kt=hi!==dr?-Vi*ci-qo:(-ci*ct+.5)*dr;for(const Yi of Rt)for(const Et of Yi.positionedGlyphs)Et.x+=vt,Et.y+=kt})(le.positionedLines,kr,ki,Ai,yt,Gt,Te,Ii,ke.length),le.top+=-Ai*Ii,le.bottom=le.top+Ii,le.left+=-ki*yt,le.right=le.left+yt}(ee,t,r,a,j,d,f,_,w,x,I,M),!function(le){for(const me of le)if(me.positionedGlyphs.length!==0)return!1;return!0}(X)&&ee}const Kl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ef={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},tf={40:!0};function Pu(i,t,r,a,l,u){if(t.imageName){const d=a[t.imageName];return d?d.displaySize[0]*t.scale*Nt/u+l:0}{const d=r[t.fontStack],f=d&&d[i];return f?f.metrics.advance*t.scale+l:0}}function zu(i,t,r,a){const l=Math.pow(i-t,2);return a?i=0;let x=0;for(let w=0;wx){const b=Math.ceil(u/x);l*=b/d,d=b}return{x1:a,y1:l,x2:a+u,y2:l+d}}function Du(i,t,r,a,l,u){const d=i.image;let f;if(d.content){const j=d.content,$=d.pixelRatio||1;f=[j[0]/$,j[1]/$,d.displaySize[0]-j[2]/$,d.displaySize[1]-j[3]/$]}const _=t.left*u,x=t.right*u;let b,w,I,P;r==="width"||r==="both"?(P=l[0]+_-a[3],w=l[0]+x+a[1]):(P=l[0]+(_+x-d.displaySize[0])/2,w=P+d.displaySize[0]);const M=t.top*u,D=t.bottom*u;return r==="height"||r==="both"?(b=l[1]+M-a[0],I=l[1]+D+a[2]):(b=l[1]+(M+D-d.displaySize[1])/2,I=b+d.displaySize[1]),{image:d,top:b,right:w,bottom:I,left:P,collisionPadding:f}}const Go=255,Wr=128,aa=Go*Wr;function Lu(i,t){const{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new wt(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:l}=r;let u=0;for(;ud.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Gc([]),this.placementViewportMatrix=Gc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lu(this.zoom,r["text-size"]),this.iconSizeData=Lu(this.zoom,r["icon-size"]);const a=this.layers[0].layout,l=a.get("symbol-sort-key"),u=a.get("symbol-z-order");this.canOverlap=hh(a,"text-overlap","text-allow-overlap")!=="never"||hh(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!l.isConstant(),this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(d=>z.ah[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=t.sourceID}createArrays(){this.text=new dh(new Fa(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new dh(new Fa(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Tt,this.lineVertexArray=new ni,this.symbolInstances=new rt,this.textAnchorOffsets=new It}calculateGlyphDependencies(t,r,a,l,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,w=u.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const I=r.iconDependencies,P=r.glyphDependencies,M=r.availableImages,D=new wt(this.zoom);for(const{feature:j,id:$,index:ie,sourceLayerIndex:X}of t){const ee=l._featureFilter.needGeometry,le=ja(j,ee);if(!l._featureFilter.filter(D,le,a))continue;let me,Pe;if(ee||(le.geometry=Oa(j)),x){const ke=l.getValueAndResolveTokens("text-field",le,a,M),Te=Di.factory(ke),Be=this.hasRTLText=this.hasRTLText||lf(Te);(!Be||Fi.getRTLTextPluginStatus()==="unavailable"||Be&&Fi.isParsed())&&(me=Np(Te,l,le))}if(b){const ke=l.getValueAndResolveTokens("icon-image",le,a,M);Pe=ke instanceof Ri?ke:Ri.fromString(ke)}if(!me&&!Pe)continue;const Ve=this.sortFeaturesByKey?w.evaluate(le,{},a):void 0;if(this.features.push({id:$,text:me,icon:Pe,index:ie,sourceLayerIndex:X,geometry:le.geometry,properties:j.properties,type:sf[j.type],sortKey:Ve}),Pe&&(I[Pe.name]=!0),me){const ke=d.evaluate(le,{},a).join(","),Te=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(z.ah.vertical)>=0;for(const Be of me.sections)if(Be.image)I[Be.image.name]=!0;else{const Ee=Po(me.toString()),Ce=Be.fontStack||ke,ue=P[Ce]=P[Ce]||{};this.calculateGlyphDependencies(Be.text,ue,Te,this.allowVerticalPlacement,Ee)}}}u.get("symbol-placement")==="line"&&(this.features=function(j){const $={},ie={},X=[];let ee=0;function le(ke){X.push(j[ke]),ee++}function me(ke,Te,Be){const Ee=ie[ke];return delete ie[ke],ie[Te]=Ee,X[Ee].geometry[0].pop(),X[Ee].geometry[0]=X[Ee].geometry[0].concat(Be[0]),Ee}function Pe(ke,Te,Be){const Ee=$[Te];return delete $[Te],$[ke]=Ee,X[Ee].geometry[0].shift(),X[Ee].geometry[0]=Be[0].concat(X[Ee].geometry[0]),Ee}function Ve(ke,Te,Be){const Ee=Be?Te[0][Te[0].length-1]:Te[0][0];return`${ke}:${Ee.x}:${Ee.y}`}for(let ke=0;keke.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((j,$)=>j.sortKey-$.sortKey)}update(t,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const a=this.lineVertexArray.length;if(t.segment!==void 0){let l=t.dist(r[t.segment+1]),u=t.dist(r[t.segment]);const d={};for(let f=t.segment+1;f=0;f--)d[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:u},f>0&&(u+=r[f-1].dist(r[f]));for(let f=0;f0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const a=t.placedSymbolArray.get(r),l=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;ul[f]-l[_]||u[_]-u[f]),d}addToSortKeyRanges(t,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((l,u,d)=>{l>=0&&d.indexOf(l)===u&&this.addIndicesForPlacedSymbol(this.text,l)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Ru,Bu;Me("SymbolBucket",Bs,{omit:["layers","collisionBoxArray","features","compareText"]}),Bs.MAX_GLYPHS=65535,Bs.addDynamicAttributes=uh;var fh={get paint(){return Bu=Bu||new h({"icon-opacity":new Ne(se.paint_symbol["icon-opacity"]),"icon-color":new Ne(se.paint_symbol["icon-color"]),"icon-halo-color":new Ne(se.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ne(se.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ne(se.paint_symbol["icon-halo-blur"]),"icon-translate":new De(se.paint_symbol["icon-translate"]),"icon-translate-anchor":new De(se.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ne(se.paint_symbol["text-opacity"]),"text-color":new Ne(se.paint_symbol["text-color"],{runtimeType:bi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Ne(se.paint_symbol["text-halo-color"]),"text-halo-width":new Ne(se.paint_symbol["text-halo-width"]),"text-halo-blur":new Ne(se.paint_symbol["text-halo-blur"]),"text-translate":new De(se.paint_symbol["text-translate"]),"text-translate-anchor":new De(se.paint_symbol["text-translate-anchor"])})},get layout(){return Ru=Ru||new h({"symbol-placement":new De(se.layout_symbol["symbol-placement"]),"symbol-spacing":new De(se.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new De(se.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ne(se.layout_symbol["symbol-sort-key"]),"symbol-z-order":new De(se.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new De(se.layout_symbol["icon-allow-overlap"]),"icon-overlap":new De(se.layout_symbol["icon-overlap"]),"icon-ignore-placement":new De(se.layout_symbol["icon-ignore-placement"]),"icon-optional":new De(se.layout_symbol["icon-optional"]),"icon-rotation-alignment":new De(se.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ne(se.layout_symbol["icon-size"]),"icon-text-fit":new De(se.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new De(se.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ne(se.layout_symbol["icon-image"]),"icon-rotate":new Ne(se.layout_symbol["icon-rotate"]),"icon-padding":new Ne(se.layout_symbol["icon-padding"]),"icon-keep-upright":new De(se.layout_symbol["icon-keep-upright"]),"icon-offset":new Ne(se.layout_symbol["icon-offset"]),"icon-anchor":new Ne(se.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new De(se.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new De(se.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new De(se.layout_symbol["text-rotation-alignment"]),"text-field":new Ne(se.layout_symbol["text-field"]),"text-font":new Ne(se.layout_symbol["text-font"]),"text-size":new Ne(se.layout_symbol["text-size"]),"text-max-width":new Ne(se.layout_symbol["text-max-width"]),"text-line-height":new De(se.layout_symbol["text-line-height"]),"text-letter-spacing":new Ne(se.layout_symbol["text-letter-spacing"]),"text-justify":new Ne(se.layout_symbol["text-justify"]),"text-radial-offset":new Ne(se.layout_symbol["text-radial-offset"]),"text-variable-anchor":new De(se.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ne(se.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ne(se.layout_symbol["text-anchor"]),"text-max-angle":new De(se.layout_symbol["text-max-angle"]),"text-writing-mode":new De(se.layout_symbol["text-writing-mode"]),"text-rotate":new Ne(se.layout_symbol["text-rotate"]),"text-padding":new De(se.layout_symbol["text-padding"]),"text-keep-upright":new De(se.layout_symbol["text-keep-upright"]),"text-transform":new Ne(se.layout_symbol["text-transform"]),"text-offset":new Ne(se.layout_symbol["text-offset"]),"text-allow-overlap":new De(se.layout_symbol["text-allow-overlap"]),"text-overlap":new De(se.layout_symbol["text-overlap"]),"text-ignore-placement":new De(se.layout_symbol["text-ignore-placement"]),"text-optional":new De(se.layout_symbol["text-optional"])})}};class Fu{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:$r,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Me("FormatSectionOverride",Fu,{omit:["defaultValue"]});class Yl extends n{constructor(t){super(t,fh)}recalculate(t,r){if(super.recalculate(t,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const l=[];for(const u of a)l.indexOf(u)<0&&l.push(u);this.layout._values["text-writing-mode"]=l}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,a,l){const u=this.layout.get(t).evaluate(r,{},a,l),d=this._unevaluatedLayout._values[t];return d.isDataDriven()||cs(d.value)||!u?u:function(f,_){return _.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,u)}createBucket(t){return new Bs(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of fh.paint.overridableProperties){if(!Yl.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),a=new Fu(r),l=new ls(a,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new Nn("source",l):new Un("composite",l,r.value.zoomStops),this.paint._values[t]=new Tr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&Yl.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const a=t.get("text-field"),l=fh.paint.properties[r];let u=!1;const d=f=>{for(const _ of f)if(l.overrides&&l.overrides.hasOverride(_))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Di)d(a.value.value.sections);else if(a.value.kind==="source"){const f=x=>{u||(x instanceof rr&&jt(x.value)===Er?d(x.value.sections):x instanceof Qa?d(x.sections):x.eachChild(f))},_=a.value;_._styleExpression&&f(_._styleExpression.expression)}return u}}let Ou;var cf={get paint(){return Ou=Ou||new h({"background-color":new De(se.paint_background["background-color"]),"background-pattern":new ws(se.paint_background["background-pattern"]),"background-opacity":new De(se.paint_background["background-opacity"])})}};class hf extends n{constructor(t){super(t,cf)}}let ju;var uf={get paint(){return ju=ju||new h({"raster-opacity":new De(se.paint_raster["raster-opacity"]),"raster-hue-rotate":new De(se.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new De(se.paint_raster["raster-brightness-min"]),"raster-brightness-max":new De(se.paint_raster["raster-brightness-max"]),"raster-saturation":new De(se.paint_raster["raster-saturation"]),"raster-contrast":new De(se.paint_raster["raster-contrast"]),"raster-resampling":new De(se.paint_raster["raster-resampling"]),"raster-fade-duration":new De(se.paint_raster["raster-fade-duration"])})}};class df extends n{constructor(t){super(t,uf)}}class pf extends n{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class ff{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const mh=63710088e-1;class sa{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new sa(Ui(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,a=this.lat*r,l=t.lat*r,u=Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos((t.lng-this.lng)*r);return mh*Math.acos(Math.min(u,1))}static convert(t){if(t instanceof sa)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new sa(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new sa(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const Vu=2*Math.PI*mh;function Nu(i){return Vu*Math.cos(i*Math.PI/180)}function Uu(i){return(180+i)/360}function $u(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function qu(i,t){return i/Nu(t)}function _h(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Ho{constructor(t,r,a=0){this.x=+t,this.y=+r,this.z=+a}static fromLngLat(t,r=0){const a=sa.convert(t);return new Ho(Uu(a.lng),$u(a.lat),qu(r,a.lat))}toLngLat(){return new sa(360*this.x-180,_h(this.y))}toAltitude(){return this.z*Nu(_h(this.y))}meterInMercatorCoordinateUnits(){return 1/Vu*(t=_h(this.y),1/Math.cos(t*Math.PI/180));var t}}function Zu(i,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class gh{constructor(t,r,a){if(!function(l,u,d){return!(l<0||l>25||d<0||d>=Math.pow(2,l)||u<0||u>=Math.pow(2,l))}(t,r,a))throw new Error(`x=${r}, y=${a}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=r,this.y=a,this.key=Xo(0,t,t,r,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,a){const l=(d=this.y,f=this.z,_=Zu(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),x=Zu(256*(u+1),256*(d+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var u,d,f,_,x;const b=function(w,I,P){let M,D="";for(let j=w;j>0;j--)M=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new he((t.x*r-this.x)*Vt,(t.y*r-this.y)*Vt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Gu{constructor(t,r){this.wrap=t,this.canonical=r,this.key=Xo(t,r.z,r.z,r.x,r.y)}}class ur{constructor(t,r,a,l,u){if(t= z; overscaledZ = ${t}; z = ${a}`);this.overscaledZ=t,this.wrap=r,this.canonical=new gh(a,+l,+u),this.key=Xo(r,t,a,l,u)}clone(){return new ur(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new ur(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ur(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-t;return t>this.canonical.z?Xo(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Xo(this.wrap*+r,t,t,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new ur(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,l=2*this.canonical.y;return[new ur(r,this.wrap,r,a,l),new ur(r,this.wrap,r,a+1,l),new ur(r,this.wrap,r,a,l+1),new ur(r,this.wrap,r,a+1,l+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=w),w=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,a){return t*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new hr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let l=r*this.dim,u=r*this.dim+this.dim,d=a*this.dim,f=a*this.dim+this.dim;switch(r){case-1:l=u-1;break;case 1:u=l+1}switch(a){case-1:d=f-1;break;case 1:f=d+1}const _=-r*this.dim,x=-a*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Wu{constructor(t,r,a,l,u){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=a,t._y=l,this.properties=t.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(t[r]=this[r]);return t}}class Ku{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Gn(Vt,16,0),this.grid3D=new Gn(Vt,16,0),this.featureIndexArray=new fi,this.promoteId=r}insert(t,r,a,l,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,l,u);const _=d?this.grid3D:this.grid;for(let x=0;x=0&&w[3]>=0&&_.insert(f,w[0],w[1],w[2],w[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ra.VectorTile(new ah(this.rawTileData)).layers,this.sourceLayerCoder=new Xu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,a,l){this.loadVTLayers();const u=t.params||{},d=Vt/t.tileSize/t.scale,f=po(u.filter),_=t.queryGeometry,x=t.queryPadding*d,b=Yu(_),w=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),I=Yu(t.cameraQueryGeometry),P=this.grid3D.query(I.minX-x,I.minY-x,I.maxX+x,I.maxY+x,(j,$,ie,X)=>function(ee,le,me,Pe,Ve){for(const Te of ee)if(le<=Te.x&&me<=Te.y&&Pe>=Te.x&&Ve>=Te.y)return!0;const ke=[new he(le,me),new he(le,Ve),new he(Pe,Ve),new he(Pe,me)];if(ee.length>2){for(const Te of ke)if(zs(ee,Te))return!0}for(let Te=0;Te(X||(X=Oa(ee)),le.queryIntersectsFeature(_,ee,me,X,this.z,t.transform,d,t.pixelPosMatrix)))}return M}loadMatchingFeature(t,r,a,l,u,d,f,_,x,b,w){const I=this.bucketLayerIDs[r];if(d&&!function(j,$){for(let ie=0;ie=0)return!0;return!1}(d,I))return;const P=this.sourceLayerCoder.decode(a),M=this.vtLayers[P].feature(l);if(u.needGeometry){const j=ja(M,!0);if(!u.filter(new wt(this.tileID.overscaledZ),j,this.tileID.canonical))return}else if(!u.filter(new wt(this.tileID.overscaledZ),M))return;const D=this.getId(M,P);for(let j=0;j{const f=t instanceof La?t.get(d):null;return f&&f.evaluate?f.evaluate(r,a,l):f})}function Yu(i){let t=1/0,r=1/0,a=-1/0,l=-1/0;for(const u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),l=Math.max(l,u.y);return{minX:t,minY:r,maxX:a,maxY:l}}function mf(i,t){return t-i}function Qu(i,t,r,a,l){const u=[];for(let d=0;d=a&&w.x>=a||(b.x>=a?b=new he(a,b.y+(a-b.x)/(w.x-b.x)*(w.y-b.y))._round():w.x>=a&&(w=new he(a,b.y+(a-b.x)/(w.x-b.x)*(w.y-b.y))._round()),b.y>=l&&w.y>=l||(b.y>=l?b=new he(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round():w.y>=l&&(w=new he(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round()),_&&b.equals(_[_.length-1])||(_=[b],u.push(_)),_.push(w)))))}}return u}Me("FeatureIndex",Ku,{omit:["rawTileData","sourceLayerCoder"]});class oa extends he{constructor(t,r,a,l){super(t,r),this.angle=a,l!==void 0&&(this.segment=l)}clone(){return new oa(this.x,this.y,this.angle,this.segment)}}function ed(i,t,r,a,l){if(t.segment===void 0||r===0)return!0;let u=t,d=t.segment+1,f=0;for(;f>-r/2;){if(d--,d<0)return!1;f-=i[d].dist(u),u=i[d]}f+=i[d].dist(i[d+1]),d++;const _=[];let x=0;for(;fa;)x-=_.shift().angleDelta;if(x>l)return!1;d++,f+=b.dist(w)}return!0}function td(i){let t=0;for(let r=0;rx){const M=(x-_)/P,D=vi.number(w.x,I.x,M),j=vi.number(w.y,I.y,M),$=new oa(D,j,I.angleTo(w),b);return $._round(),!d||ed(i,$,f,d,t)?$:void 0}_+=P}}function gf(i,t,r,a,l,u,d,f,_){const x=id(a,u,d),b=rd(a,l),w=b*d,I=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return t-w=0&&ee<_&&le>=0&&le<_&&I-x>=0&&I+x<=b){const me=new oa(ee,le,ie,M);me._round(),a&&!ed(i,me,u,a,l)||P.push(me)}}w+=$}return f||P.length||d||(P=nd(i,w/2,r,a,l,u,d,!0,_)),P}Me("Anchor",oa);const Fs=ji;function ad(i,t,r,a){const l=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*Fs,_=u.paddedRect.h-2*Fs;let x={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const b=u.stretchX||[[0,f]],w=u.stretchY||[[0,_]],I=(ue,Fe)=>ue+Fe[1]-Fe[0],P=b.reduce(I,0),M=w.reduce(I,0),D=f-P,j=_-M;let $=0,ie=P,X=0,ee=M,le=0,me=D,Pe=0,Ve=j;if(u.content&&a){const ue=u.content,Fe=ue[2]-ue[0],Re=ue[3]-ue[1];(u.textFitWidth||u.textFitHeight)&&(x=Eu(i)),$=Ql(b,0,ue[0]),X=Ql(w,0,ue[1]),ie=Ql(b,ue[0],ue[2]),ee=Ql(w,ue[1],ue[3]),le=ue[0]-$,Pe=ue[1]-X,me=Fe-ie,Ve=Re-ee}const ke=x.x1,Te=x.y1,Be=x.x2-ke,Ee=x.y2-Te,Ce=(ue,Fe,Re,Ze)=>{const xt=ec(ue.stretch-$,ie,Be,ke),yt=tc(ue.fixed-le,me,ue.stretch,P),Gt=ec(Fe.stretch-X,ee,Ee,Te),kr=tc(Fe.fixed-Pe,Ve,Fe.stretch,M),li=ec(Re.stretch-$,ie,Be,ke),Ht=tc(Re.fixed-le,me,Re.stretch,P),Ii=ec(Ze.stretch-X,ee,Ee,Te),ki=tc(Ze.fixed-Pe,Ve,Ze.stretch,M),Ai=new he(xt,Gt),Rt=new he(li,Gt),Xt=new he(li,Ii),_i=new he(xt,Ii),ci=new he(yt/d,kr/d),Pi=new he(Ht/d,ki/d),hi=t*Math.PI/180;if(hi){const ct=Math.sin(hi),vt=Math.cos(hi),kt=[vt,-ct,ct,vt];Ai._matMult(kt),Rt._matMult(kt),_i._matMult(kt),Xt._matMult(kt)}const dr=ue.stretch+ue.fixed,Vi=Fe.stretch+Fe.fixed;return{tl:Ai,tr:Rt,bl:_i,br:Xt,tex:{x:u.paddedRect.x+Fs+dr,y:u.paddedRect.y+Fs+Vi,w:Re.stretch+Re.fixed-dr,h:Ze.stretch+Ze.fixed-Vi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ci,pixelOffsetBR:Pi,minFontScaleX:me/d/Be,minFontScaleY:Ve/d/Ee,isSDF:r}};if(a&&(u.stretchX||u.stretchY)){const ue=sd(b,D,P),Fe=sd(w,j,M);for(let Re=0;Re0&&(D=Math.max(10,D),this.circleDiameter=D)}else{const I=!((w=d.image)===null||w===void 0)&&w.content&&(d.image.textFitWidth||d.image.textFitHeight)?Eu(d):{x1:d.left,y1:d.top,x2:d.right,y2:d.bottom};I.y1=I.y1*f-_[0],I.y2=I.y2*f+_[2],I.x1=I.x1*f-_[3],I.x2=I.x2*f+_[1];const P=d.collisionPadding;if(P&&(I.x1-=P[0]*f,I.y1-=P[1]*f,I.x2+=P[2]*f,I.y2+=P[3]*f),b){const M=new he(I.x1,I.y1),D=new he(I.x2,I.y1),j=new he(I.x1,I.y2),$=new he(I.x2,I.y2),ie=b*Math.PI/180;M._rotate(ie),D._rotate(ie),j._rotate(ie),$._rotate(ie),I.x1=Math.min(M.x,D.x,j.x,$.x),I.x2=Math.max(M.x,D.x,j.x,$.x),I.y1=Math.min(M.y,D.y,j.y,$.y),I.y2=Math.max(M.y,D.y,j.y,$.y)}t.emplaceBack(r.x,r.y,I.x1,I.y1,I.x2,I.y2,a,l,u)}this.boxEndIndex=t.length}}class yf{constructor(t=[],r=(a,l)=>al?1:0){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:a}=this,l=r[t];for(;t>0;){const u=t-1>>1,d=r[u];if(a(l,d)>=0)break;r[t]=d,t=u}r[t]=l}_down(t){const{data:r,compare:a}=this,l=this.length>>1,u=r[t];for(;t=0)break;r[t]=r[d],t=d}r[t]=u}}function xf(i,t=1,r=!1){let a=1/0,l=1/0,u=-1/0,d=-1/0;const f=i[0];for(let P=0;Pu)&&(u=M.x),(!P||M.y>d)&&(d=M.y)}const _=Math.min(u-a,d-l);let x=_/2;const b=new yf([],bf);if(_===0)return new he(a,l);for(let P=a;Pw.d||!w.d)&&(w=P,r&&console.log("found best %d after %d probes",Math.round(1e4*P.d)/1e4,I)),P.max-w.d<=t||(x=P.h/2,b.push(new Os(P.p.x-x,P.p.y-x,x,i)),b.push(new Os(P.p.x+x,P.p.y-x,x,i)),b.push(new Os(P.p.x-x,P.p.y+x,x,i)),b.push(new Os(P.p.x+x,P.p.y+x,x,i)),I+=4)}return r&&(console.log(`num probes: ${I}`),console.log(`best distance: ${w.d}`)),w.p}function bf(i,t){return t.max-i.max}function Os(i,t,r,a){this.p=new he(i,t),this.h=r,this.d=function(l,u){let d=!1,f=1/0;for(let _=0;_l.y!=M.y>l.y&&l.x<(M.x-P.x)*(l.y-P.y)/(M.y-P.y)+P.x&&(d=!d),f=Math.min(f,$h(l,P,M))}}return(d?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var oi;z.aq=void 0,(oi=z.aq||(z.aq={}))[oi.center=1]="center",oi[oi.left=2]="left",oi[oi.right=3]="right",oi[oi.top=4]="top",oi[oi.bottom=5]="bottom",oi[oi["top-left"]=6]="top-left",oi[oi["top-right"]=7]="top-right",oi[oi["bottom-left"]=8]="bottom-left",oi[oi["bottom-right"]=9]="bottom-right";const la=7,yh=Number.POSITIVE_INFINITY;function od(i,t){return t[1]!==yh?function(r,a,l){let u=0,d=0;switch(a=Math.abs(a),l=Math.abs(l),r){case"top-right":case"top-left":case"top":d=l-la;break;case"bottom-right":case"bottom-left":case"bottom":d=-l+la}switch(r){case"top-right":case"bottom-right":case"right":u=-a;break;case"top-left":case"bottom-left":case"left":u=a}return[u,d]}(i,t[0],t[1]):function(r,a){let l=0,u=0;a<0&&(a=0);const d=a/Math.SQRT2;switch(r){case"top-right":case"top-left":u=d-la;break;case"bottom-right":case"bottom-left":u=-d+la;break;case"bottom":u=-a+la;break;case"top":u=a-la}switch(r){case"top-right":case"bottom-right":l=-d;break;case"top-left":case"bottom-left":l=d;break;case"left":l=a;break;case"right":l=-a}return[l,u]}(i,t[0])}function ld(i,t,r){var a;const l=i.layout,u=(a=l.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(t,{},r);if(u){const f=u.values,_=[];for(let x=0;xI*Nt);b.startsWith("top")?w[1]-=la:b.startsWith("bottom")&&(w[1]+=la),_[x+1]=w}return new Zi(_)}const d=l.get("text-variable-anchor");if(d){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[l.get("text-radial-offset").evaluate(t,{},r)*Nt,yh]:l.get("text-offset").evaluate(t,{},r).map(x=>x*Nt);const _=[];for(const x of d)_.push(x,od(x,f));return new Zi(_)}return null}function xh(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function vf(i,t,r,a,l,u,d,f,_,x,b){let w=u.textMaxSize.evaluate(t,{});w===void 0&&(w=d);const I=i.layers[0].layout,P=I.get("icon-offset").evaluate(t,{},b),M=hd(r.horizontal),D=d/24,j=i.tilePixelRatio*D,$=i.tilePixelRatio*w/24,ie=i.tilePixelRatio*f,X=i.tilePixelRatio*I.get("symbol-spacing"),ee=I.get("text-padding")*i.tilePixelRatio,le=function(ue,Fe,Re,Ze=1){const xt=ue.get("icon-padding").evaluate(Fe,{},Re),yt=xt&&xt.values;return[yt[0]*Ze,yt[1]*Ze,yt[2]*Ze,yt[3]*Ze]}(I,t,b,i.tilePixelRatio),me=I.get("text-max-angle")/180*Math.PI,Pe=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point",Ve=I.get("icon-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",ke=I.get("symbol-placement"),Te=X/2,Be=I.get("icon-text-fit");let Ee;a&&Be!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Ee=Du(a,r.vertical,Be,I.get("icon-text-fit-padding"),P,D)),M&&(a=Du(a,M,Be,I.get("icon-text-fit-padding"),P,D)));const Ce=(ue,Fe)=>{Fe.x<0||Fe.x>=Vt||Fe.y<0||Fe.y>=Vt||function(Re,Ze,xt,yt,Gt,kr,li,Ht,Ii,ki,Ai,Rt,Xt,_i,ci,Pi,hi,dr,Vi,ct,vt,kt,Yi,Et,js){const Kr=Re.addToLineVertexArray(Ze,xt);let Jr,Ar,pr,Yt,vn=0,Jo=0,fd=0,md=0,Ah=-1,Ph=-1;const wn={};let _d=Is("");if(Re.allowVerticalPlacement&&yt.vertical){const gi=Ht.layout.get("text-rotate").evaluate(vt,{},Et)+90;pr=new ic(Ii,Ze,ki,Ai,Rt,yt.vertical,Xt,_i,ci,gi),li&&(Yt=new ic(Ii,Ze,ki,Ai,Rt,li,hi,dr,ci,gi))}if(Gt){const gi=Ht.layout.get("icon-rotate").evaluate(vt,{}),fr=Ht.layout.get("icon-text-fit")!=="none",Na=ad(Gt,gi,Yi,fr),Fr=li?ad(li,gi,Yi,fr):void 0;Ar=new ic(Ii,Ze,ki,Ai,Rt,Gt,hi,dr,!1,gi),vn=4*Na.length;const Ua=Re.iconSizeData;let Yr=null;Ua.kind==="source"?(Yr=[Wr*Ht.layout.get("icon-size").evaluate(vt,{})],Yr[0]>aa&&ii(`${Re.layerIds[0]}: Value for "icon-size" is >= ${Go}. Reduce your "icon-size".`)):Ua.kind==="composite"&&(Yr=[Wr*kt.compositeIconSizes[0].evaluate(vt,{},Et),Wr*kt.compositeIconSizes[1].evaluate(vt,{},Et)],(Yr[0]>aa||Yr[1]>aa)&&ii(`${Re.layerIds[0]}: Value for "icon-size" is >= ${Go}. Reduce your "icon-size".`)),Re.addSymbols(Re.icon,Na,Yr,ct,Vi,vt,z.ah.none,Ze,Kr.lineStartIndex,Kr.lineLength,-1,Et),Ah=Re.icon.placedSymbolArray.length-1,Fr&&(Jo=4*Fr.length,Re.addSymbols(Re.icon,Fr,Yr,ct,Vi,vt,z.ah.vertical,Ze,Kr.lineStartIndex,Kr.lineLength,-1,Et),Ph=Re.icon.placedSymbolArray.length-1)}const gd=Object.keys(yt.horizontal);for(const gi of gd){const fr=yt.horizontal[gi];if(!Jr){_d=Is(fr.text);const Fr=Ht.layout.get("text-rotate").evaluate(vt,{},Et);Jr=new ic(Ii,Ze,ki,Ai,Rt,fr,Xt,_i,ci,Fr)}const Na=fr.positionedLines.length===1;if(fd+=cd(Re,Ze,fr,kr,Ht,ci,vt,Pi,Kr,yt.vertical?z.ah.horizontal:z.ah.horizontalOnly,Na?gd:[gi],wn,Ah,kt,Et),Na)break}yt.vertical&&(md+=cd(Re,Ze,yt.vertical,kr,Ht,ci,vt,Pi,Kr,z.ah.vertical,["vertical"],wn,Ph,kt,Et));const Tf=Jr?Jr.boxStartIndex:Re.collisionBoxArray.length,If=Jr?Jr.boxEndIndex:Re.collisionBoxArray.length,kf=pr?pr.boxStartIndex:Re.collisionBoxArray.length,Af=pr?pr.boxEndIndex:Re.collisionBoxArray.length,Pf=Ar?Ar.boxStartIndex:Re.collisionBoxArray.length,zf=Ar?Ar.boxEndIndex:Re.collisionBoxArray.length,Cf=Yt?Yt.boxStartIndex:Re.collisionBoxArray.length,Mf=Yt?Yt.boxEndIndex:Re.collisionBoxArray.length;let Br=-1;const nc=(gi,fr)=>gi&&gi.circleDiameter?Math.max(gi.circleDiameter,fr):fr;Br=nc(Jr,Br),Br=nc(pr,Br),Br=nc(Ar,Br),Br=nc(Yt,Br);const yd=Br>-1?1:0;yd&&(Br*=js/Nt),Re.glyphOffsetArray.length>=Bs.MAX_GLYPHS&&ii("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vt.sortKey!==void 0&&Re.addToSortKeyRanges(Re.symbolInstances.length,vt.sortKey);const Ef=ld(Ht,vt,Et),[Df,Lf]=function(gi,fr){const Na=gi.length,Fr=fr==null?void 0:fr.values;if((Fr==null?void 0:Fr.length)>0)for(let Ua=0;Ua=0?wn.right:-1,wn.center>=0?wn.center:-1,wn.left>=0?wn.left:-1,wn.vertical||-1,Ah,Ph,_d,Tf,If,kf,Af,Pf,zf,Cf,Mf,ki,fd,md,vn,Jo,yd,0,Xt,Br,Df,Lf)}(i,Fe,ue,r,a,l,Ee,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,j,[ee,ee,ee,ee],Pe,_,ie,le,Ve,P,t,u,x,b,d)};if(ke==="line")for(const ue of Qu(t.geometry,0,0,Vt,Vt)){const Fe=gf(ue,X,me,r.vertical||M,a,24,$,i.overscaling,Vt);for(const Re of Fe)M&&wf(i,M.text,Te,Re)||Ce(ue,Re)}else if(ke==="line-center"){for(const ue of t.geometry)if(ue.length>1){const Fe=_f(ue,me,r.vertical||M,a,24,$);Fe&&Ce(ue,Fe)}}else if(t.type==="Polygon")for(const ue of ts(t.geometry,0)){const Fe=xf(ue,16);Ce(ue[0],new oa(Fe.x,Fe.y,0))}else if(t.type==="LineString")for(const ue of t.geometry)Ce(ue,new oa(ue[0].x,ue[0].y,0));else if(t.type==="Point")for(const ue of t.geometry)for(const Fe of ue)Ce([Fe],new oa(Fe.x,Fe.y,0))}function cd(i,t,r,a,l,u,d,f,_,x,b,w,I,P,M){const D=function(ie,X,ee,le,me,Pe,Ve,ke){const Te=le.layout.get("text-rotate").evaluate(Pe,{})*Math.PI/180,Be=[];for(const Ee of X.positionedLines)for(const Ce of Ee.positionedGlyphs){if(!Ce.rect)continue;const ue=Ce.rect||{};let Fe=Iu+1,Re=!0,Ze=1,xt=0;const yt=(me||ke)&&Ce.vertical,Gt=Ce.metrics.advance*Ce.scale/2;if(ke&&X.verticalizable&&(xt=Ee.lineOffset/2-(Ce.imageName?-(Nt-Ce.metrics.width*Ce.scale)/2:(Ce.scale-1)*Nt)),Ce.imageName){const ct=Ve[Ce.imageName];Re=ct.sdf,Ze=ct.pixelRatio,Fe=ji/Ze}const kr=me?[Ce.x+Gt,Ce.y]:[0,0];let li=me?[0,0]:[Ce.x+Gt+ee[0],Ce.y+ee[1]-xt],Ht=[0,0];yt&&(Ht=li,li=[0,0]);const Ii=Ce.metrics.isDoubleResolution?2:1,ki=(Ce.metrics.left-Fe)*Ce.scale-Gt+li[0],Ai=(-Ce.metrics.top-Fe)*Ce.scale+li[1],Rt=ki+ue.w/Ii*Ce.scale/Ze,Xt=Ai+ue.h/Ii*Ce.scale/Ze,_i=new he(ki,Ai),ci=new he(Rt,Ai),Pi=new he(ki,Xt),hi=new he(Rt,Xt);if(yt){const ct=new he(-Gt,Gt-qo),vt=-Math.PI/2,kt=Nt/2-Gt,Yi=new he(5-qo-kt,-(Ce.imageName?kt:0)),Et=new he(...Ht);_i._rotateAround(vt,ct)._add(Yi)._add(Et),ci._rotateAround(vt,ct)._add(Yi)._add(Et),Pi._rotateAround(vt,ct)._add(Yi)._add(Et),hi._rotateAround(vt,ct)._add(Yi)._add(Et)}if(Te){const ct=Math.sin(Te),vt=Math.cos(Te),kt=[vt,-ct,ct,vt];_i._matMult(kt),ci._matMult(kt),Pi._matMult(kt),hi._matMult(kt)}const dr=new he(0,0),Vi=new he(0,0);Be.push({tl:_i,tr:ci,bl:Pi,br:hi,tex:ue,writingMode:X.writingMode,glyphOffset:kr,sectionIndex:Ce.sectionIndex,isSDF:Re,pixelOffsetTL:dr,pixelOffsetBR:Vi,minFontScaleX:0,minFontScaleY:0})}return Be}(0,r,f,l,u,d,a,i.allowVerticalPlacement),j=i.textSizeData;let $=null;j.kind==="source"?($=[Wr*l.layout.get("text-size").evaluate(d,{})],$[0]>aa&&ii(`${i.layerIds[0]}: Value for "text-size" is >= ${Go}. Reduce your "text-size".`)):j.kind==="composite"&&($=[Wr*P.compositeTextSizes[0].evaluate(d,{},M),Wr*P.compositeTextSizes[1].evaluate(d,{},M)],($[0]>aa||$[1]>aa)&&ii(`${i.layerIds[0]}: Value for "text-size" is >= ${Go}. Reduce your "text-size".`)),i.addSymbols(i.text,D,$,f,u,d,x,t,_.lineStartIndex,_.lineLength,I,M);for(const ie of b)w[ie]=i.text.placedSymbolArray.length-1;return 4*D.length}function hd(i){for(const t in i)return i[t];return null}function wf(i,t,r,a){const l=i.compareText;if(t in l){const u=l[t];for(let d=u.length-1;d>=0;d--)if(a.dist(u[d])>4;if(l!==1)throw new Error(`Got v${l} data when expected v1.`);const u=ud[15&a];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(t,2,1),[f]=new Uint32Array(t,4,1);return new bh(f,d,u,t)}constructor(t,r=64,a=Float64Array,l){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const u=ud.indexOf(this.ArrayType),d=2*t*this.ArrayType.BYTES_PER_ELEMENT,f=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(u<0)throw new Error(`Unexpected typed array class: ${a}.`);l&&l instanceof ArrayBuffer?(this.data=l,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+f+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=r,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return vh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,a,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,_=[0,u.length-1,0],x=[];for(;_.length;){const b=_.pop()||0,w=_.pop()||0,I=_.pop()||0;if(w-I<=f){for(let j=I;j<=w;j++){const $=d[2*j],ie=d[2*j+1];$>=t&&$<=a&&ie>=r&&ie<=l&&x.push(u[j])}continue}const P=I+w>>1,M=d[2*P],D=d[2*P+1];M>=t&&M<=a&&D>=r&&D<=l&&x.push(u[P]),(b===0?t<=M:r<=D)&&(_.push(I),_.push(P-1),_.push(1-b)),(b===0?a>=M:l>=D)&&(_.push(P+1),_.push(w),_.push(1-b))}return x}within(t,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:l,coords:u,nodeSize:d}=this,f=[0,l.length-1,0],_=[],x=a*a;for(;f.length;){const b=f.pop()||0,w=f.pop()||0,I=f.pop()||0;if(w-I<=d){for(let j=I;j<=w;j++)pd(u[2*j],u[2*j+1],t,r)<=x&&_.push(l[j]);continue}const P=I+w>>1,M=u[2*P],D=u[2*P+1];pd(M,D,t,r)<=x&&_.push(l[P]),(b===0?t-a<=M:r-a<=D)&&(f.push(I),f.push(P-1),f.push(1-b)),(b===0?t+a>=M:r+a>=D)&&(f.push(P+1),f.push(w),f.push(1-b))}return _}}function vh(i,t,r,a,l,u){if(l-a<=r)return;const d=a+l>>1;dd(i,t,d,a,l,u),vh(i,t,r,a,d-1,1-u),vh(i,t,r,d+1,l,1-u)}function dd(i,t,r,a,l,u){for(;l>a;){if(l-a>600){const x=l-a+1,b=r-a+1,w=Math.log(x),I=.5*Math.exp(2*w/3),P=.5*Math.sqrt(w*I*(x-I)/x)*(b-x/2<0?-1:1);dd(i,t,r,Math.max(a,Math.floor(r-b*I/x+P)),Math.min(l,Math.floor(r+(x-b)*I/x+P)),u)}const d=t[2*r+u];let f=a,_=l;for(Wo(i,t,a,r),t[2*l+u]>d&&Wo(i,t,a,l);f<_;){for(Wo(i,t,f,_),f++,_--;t[2*f+u]d;)_--}t[2*a+u]===d?Wo(i,t,a,_):(_++,Wo(i,t,_,l)),_<=r&&(a=_+1),r<=_&&(l=_-1)}}function Wo(i,t,r,a){wh(i,r,a),wh(t,2*r,2*a),wh(t,2*r+1,2*a+1)}function wh(i,t,r){const a=i[t];i[t]=i[r],i[r]=a}function pd(i,t,r,a){const l=i-r,u=t-a;return l*l+u*u}var Sh;z.bg=void 0,(Sh=z.bg||(z.bg={})).create="create",Sh.load="load",Sh.fullLoad="fullLoad";let rc=null,Ko=[];const Th=1e3/60,Ih="loadTime",kh="fullLoadTime",Sf={mark(i){performance.mark(i)},frame(i){const t=i;rc!=null&&Ko.push(t-rc),rc=t},clearMetrics(){rc=null,Ko=[],performance.clearMeasures(Ih),performance.clearMeasures(kh);for(const i in z.bg)performance.clearMarks(z.bg[i])},getPerformanceMetrics(){performance.measure(Ih,z.bg.create,z.bg.load),performance.measure(kh,z.bg.create,z.bg.fullLoad);const i=performance.getEntriesByName(Ih)[0].duration,t=performance.getEntriesByName(kh)[0].duration,r=Ko.length,a=1/(Ko.reduce((u,d)=>u+d,0)/r/1e3),l=Ko.filter(u=>u>Th).reduce((u,d)=>u+(d-Th)/Th,0);return{loadTime:i,fullLoadTime:t,fps:a,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};z.$=class extends S{},z.A=Cs,z.B=Lc,z.C=function(i){if(Tn==null){const t=i.navigator?i.navigator.userAgent:null;Tn=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Tn},z.D=De,z.E=An,z.F=class{constructor(i,t){this.target=i,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new ff(()=>this.process()),this.subscription=function(r,a,l,u){return r.addEventListener(a,l,!1),{unsubscribe:()=>{r.removeEventListener(a,l,!1)}}}(this.target,"message",r=>this.receive(r)),this.globalScope=Pr(self)?i:window}registerMessageHandler(i,t){this.messageHandlers[i]=t}sendAsync(i,t){return new Promise((r,a)=>{const l=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[l]={resolve:r,reject:a},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[l];const f={id:l,type:"",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(f)},{once:!0});const u=[],d=Object.assign(Object.assign({},i),{id:l,sourceMapId:this.mapId,origin:location.origin,data:Hn(i.data,u)});this.target.postMessage(d,{transfer:u})})}receive(i){const t=i.data,r=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type===""){delete this.tasks[r];const a=this.abortControllers[r];return delete this.abortControllers[r],void(a&&a.abort())}if(Pr(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),t=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(i,t)}processTask(i,t){return p(this,void 0,void 0,function*(){if(t.type===""){const l=this.resolveRejects[i];return delete this.resolveRejects[i],l?void(t.error?l.reject(Xn(t.error)):l.resolve(Xn(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=Xn(t.data),a=new AbortController;this.abortControllers[i]=a;try{const l=yield this.messageHandlers[t.type](t.sourceMapId,r,a);this.completeTask(i,null,l)}catch(l){this.completeTask(i,l)}})}completeTask(i,t,r){const a=[];delete this.abortControllers[i];const l={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?Hn(t):null,data:Hn(r,a)};this.target.postMessage(l,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},z.G=kn,z.H=function(){var i=new Cs(16);return Cs!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},z.I=oh,z.J=function(i,t,r){var a,l,u,d,f,_,x,b,w,I,P,M,D=r[0],j=r[1],$=r[2];return t===i?(i[12]=t[0]*D+t[4]*j+t[8]*$+t[12],i[13]=t[1]*D+t[5]*j+t[9]*$+t[13],i[14]=t[2]*D+t[6]*j+t[10]*$+t[14],i[15]=t[3]*D+t[7]*j+t[11]*$+t[15]):(l=t[1],u=t[2],d=t[3],f=t[4],_=t[5],x=t[6],b=t[7],w=t[8],I=t[9],P=t[10],M=t[11],i[0]=a=t[0],i[1]=l,i[2]=u,i[3]=d,i[4]=f,i[5]=_,i[6]=x,i[7]=b,i[8]=w,i[9]=I,i[10]=P,i[11]=M,i[12]=a*D+f*j+w*$+t[12],i[13]=l*D+_*j+I*$+t[13],i[14]=u*D+x*j+P*$+t[14],i[15]=d*D+b*j+M*$+t[15]),i},z.K=function(i,t,r){var a=r[0],l=r[1],u=r[2];return i[0]=t[0]*a,i[1]=t[1]*a,i[2]=t[2]*a,i[3]=t[3]*a,i[4]=t[4]*l,i[5]=t[5]*l,i[6]=t[6]*l,i[7]=t[7]*l,i[8]=t[8]*u,i[9]=t[9]*u,i[10]=t[10]*u,i[11]=t[11]*u,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},z.L=Hh,z.M=function(i,t){const r={};for(let a=0;a{const t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(const a of i){const l=window.document.createElement("source");nn(a)||(t.crossOrigin="Anonymous"),l.src=a,t.appendChild(l)}})},z.a4=function(){return $a++},z.a5=Ae,z.a6=Bs,z.a7=po,z.a8=ja,z.a9=Wu,z.aA=function(i){if(i.type==="custom")return new pf(i);switch(i.type){case"background":return new hf(i);case"circle":return new Kd(i);case"fill":return new pp(i);case"fill-extrusion":return new Pp(i);case"heatmap":return new Yd(i);case"hillshade":return new ep(i);case"line":return new Bp(i);case"raster":return new df(i);case"symbol":return new Yl(i)}},z.aB=mt,z.aC=function(i,t){if(!i)return[{command:"setStyle",args:[t]}];let r=[];try{if(!ht(i.version,t.version))return[{command:"setStyle",args:[t]}];ht(i.center,t.center)||r.push({command:"setCenter",args:[t.center]}),ht(i.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),ht(i.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),ht(i.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),ht(i.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),ht(i.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),ht(i.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),ht(i.light,t.light)||r.push({command:"setLight",args:[t.light]}),ht(i.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),ht(i.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),ht(i.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const a={},l=[];(function(d,f,_,x){let b;for(b in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,b)&&(Object.prototype.hasOwnProperty.call(f,b)||Ur(b,_,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(d,b)?ht(d[b],f[b])||(d[b].type==="geojson"&&f[b].type==="geojson"&&Pn(d,f,b)?Ct(_,{command:"setGeoJSONSourceData",args:[b,f[b].data]}):Mr(b,f,_,x)):fa(b,f,_))})(i.sources,t.sources,l,a);const u=[];i.layers&&i.layers.forEach(d=>{"source"in d&&a[d.source]?r.push({command:"removeLayer",args:[d.id]}):u.push(d)}),r=r.concat(l),function(d,f,_){f=f||[];const x=(d=d||[]).map(ma),b=f.map(ma),w=d.reduce(_a,{}),I=f.reduce(_a,{}),P=x.slice(),M=Object.create(null);let D,j,$,ie,X;for(let ee=0,le=0;ee@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,l,u)=>{const d=l||u;return t[a]=!d||d.toLowerCase(),""}),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},z.ab=function(i,t){const r=[];for(const a in i)a in t||r.push(a);return r},z.ac=qt,z.ad=function(i,t,r){var a=Math.sin(r),l=Math.cos(r),u=t[0],d=t[1],f=t[2],_=t[3],x=t[4],b=t[5],w=t[6],I=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=u*l+x*a,i[1]=d*l+b*a,i[2]=f*l+w*a,i[3]=_*l+I*a,i[4]=x*l-u*a,i[5]=b*l-d*a,i[6]=w*l-f*a,i[7]=I*l-_*a,i},z.ae=function(i){var t=new Cs(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},z.af=$l,z.ag=function(i,t){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:l,minZoom:u,maxZoom:d}=i,f=l?qt(wi.interpolationFactor(l,t,u,d),0,1):0;i.kind==="camera"?a=vi.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:a}},z.ai=function(i,{uSize:t,uSizeT:r},{lowerSize:a,upperSize:l}){return i.kind==="source"?a/Wr:i.kind==="composite"?vi.number(a/Wr,l/Wr,r):t},z.aj=uh,z.ak=function(i,t,r,a){const l=t.y-i.y,u=t.x-i.x,d=a.y-r.y,f=a.x-r.x,_=d*u-f*l;if(_===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/_;return new he(i.x+x*u,i.y+x*l)},z.al=Qu,z.am=Nh,z.an=Gc,z.ao=function(i){let t=1/0,r=1/0,a=-1/0,l=-1/0;for(const u of i)t=Math.min(t,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),l=Math.max(l,u.y);return[t,r,a,l]},z.ap=Nt,z.ar=hh,z.as=function(i,t){var r=t[0],a=t[1],l=t[2],u=t[3],d=t[4],f=t[5],_=t[6],x=t[7],b=t[8],w=t[9],I=t[10],P=t[11],M=t[12],D=t[13],j=t[14],$=t[15],ie=r*f-a*d,X=r*_-l*d,ee=r*x-u*d,le=a*_-l*f,me=a*x-u*f,Pe=l*x-u*_,Ve=b*D-w*M,ke=b*j-I*M,Te=b*$-P*M,Be=w*j-I*D,Ee=w*$-P*D,Ce=I*$-P*j,ue=ie*Ce-X*Ee+ee*Be+le*Te-me*ke+Pe*Ve;return ue?(i[0]=(f*Ce-_*Ee+x*Be)*(ue=1/ue),i[1]=(l*Ee-a*Ce-u*Be)*ue,i[2]=(D*Pe-j*me+$*le)*ue,i[3]=(I*me-w*Pe-P*le)*ue,i[4]=(_*Te-d*Ce-x*ke)*ue,i[5]=(r*Ce-l*Te+u*ke)*ue,i[6]=(j*ee-M*Pe-$*X)*ue,i[7]=(b*Pe-I*ee+P*X)*ue,i[8]=(d*Ee-f*Te+x*Ve)*ue,i[9]=(a*Te-r*Ee-u*Ve)*ue,i[10]=(M*me-D*ee+$*ie)*ue,i[11]=(w*ee-b*me-P*ie)*ue,i[12]=(f*ke-d*Be-_*Ve)*ue,i[13]=(r*Be-a*ke+l*Ve)*ue,i[14]=(D*X-M*le-j*ie)*ue,i[15]=(b*le-w*X+I*ie)*ue,i):null},z.at=xh,z.au=ch,z.av=bh,z.aw=function(){const i={},t=se.$version;for(const r in se.$root){const a=se.$root[r];if(a.required){let l=null;l=r==="version"?t:a.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},z.ax=Ao,z.ay=tr,z.az=function(i){i=i.slice();const t=Object.create(null);for(let r=0;r25||a<0||a>=1||r<0||r>=1)},z.bc=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},z.bd=class extends v{},z.be=mh,z.bf=Sf,z.bh=Ei,z.bi=function(i,t){jr.REGISTERED_PROTOCOLS[i]=t},z.bj=function(i){delete jr.REGISTERED_PROTOCOLS[i]},z.bk=function(i,t){const r={};for(let l=0;lCe*Nt)}let ke=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const Te=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Nt:1/0,Be=()=>{i.bucket.allowVerticalPlacement&&Po(ee)&&(M.vertical=Wl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,Te,u,Pe,"left",me,$,z.ah.vertical,!0,I,w))};if(!d&&Ve){const Ee=new Set;if(ke==="auto")for(let ue=0;uep(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),z.e=$i,z.f=i=>new Promise((t,r)=>{const a=new Image;a.onload=()=>{t(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame(()=>{a.src=Za})},a.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const l=new Blob([new Uint8Array(i)],{type:"image/png"});a.src=i.byteLength?URL.createObjectURL(l):Za}),z.g=gr,z.h=(i,t)=>rn($i(i,{type:"json"}),t),z.i=Pr,z.j=Nr,z.k=Vr,z.l=(i,t)=>rn($i(i,{type:"arrayBuffer"}),t),z.m=rn,z.n=function(i){return new ah(i).readFields(Jp,[])},z.o=Fo,z.p=ku,z.q=h,z.r=Dc,z.s=nn,z.t=Io,z.u=gn,z.v=se,z.w=ii,z.x=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}},z.y=vi,z.z=wt}),pe("worker",["./shared"],function(z){class p{constructor(A){this.keyCache={},A&&this.replace(A)}replace(A){this._layerConfigs={},this._layers={},this.update(A,[])}update(A,k){for(const V of A){this._layerConfigs[V.id]=V;const W=this._layers[V.id]=z.aA(V);W._featureFilter=z.a7(W.filter),this.keyCache[V.id]&&delete this.keyCache[V.id]}for(const V of k)delete this.keyCache[V],delete this._layerConfigs[V],delete this._layers[V];this.familiesBySource={};const R=z.bk(Object.values(this._layerConfigs),this.keyCache);for(const V of R){const W=V.map(ae=>this._layers[ae.id]),J=W[0];if(J.visibility==="none")continue;const te=J.source||"";let G=this.familiesBySource[te];G||(G=this.familiesBySource[te]={});const ce=J.sourceLayer||"_geojsonTileLayer";let fe=G[ce];fe||(fe=G[ce]=[]),fe.push(W)}}}class $e{constructor(A){const k={},R=[];for(const te in A){const G=A[te],ce=k[te]={};for(const fe in G){const ae=G[+fe];if(!ae||ae.bitmap.width===0||ae.bitmap.height===0)continue;const xe={x:0,y:0,w:ae.bitmap.width+2,h:ae.bitmap.height+2};R.push(xe),ce[fe]={rect:xe,metrics:ae.metrics}}}const{w:V,h:W}=z.p(R),J=new z.o({width:V||1,height:W||1});for(const te in A){const G=A[te];for(const ce in G){const fe=G[+ce];if(!fe||fe.bitmap.width===0||fe.bitmap.height===0)continue;const ae=k[te][ce].rect;z.o.copy(fe.bitmap,J,{x:0,y:0},{x:ae.x+1,y:ae.y+1},fe.bitmap)}}this.image=J,this.positions=k}}z.bl("GlyphAtlas",$e);class We{constructor(A){this.tileID=new z.S(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[]}parse(A,k,R,V){return z._(this,void 0,void 0,function*(){this.status="parsing",this.data=A,this.collisionBoxArray=new z.a5;const W=new z.bm(Object.keys(A.layers).sort()),J=new z.bn(this.tileID,this.promoteId);J.bucketLayerIDs=[];const te={},G={featureIndex:J,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:R},ce=k.familiesBySource[this.source];for(const Qe in ce){const pt=A.layers[Qe];if(!pt)continue;pt.version===1&&z.w(`Vector tile source "${this.source}" layer "${Qe}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Pt=W.encode(Qe),Zt=[];for(let Kt=0;Kt=pi.maxzoom||pi.visibility!=="none"&&(Ke(Kt,this.zoom,R),(te[pi.id]=pi.createBucket({index:J.bucketLayerIDs.length,layers:Kt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Pt,sourceID:this.source})).populate(Zt,G,this.tileID.canonical),J.bucketLayerIDs.push(Kt.map(zn=>zn.id)))}}const fe=z.aF(G.glyphDependencies,Qe=>Object.keys(Qe).map(Number));this.inFlightDependencies.forEach(Qe=>Qe==null?void 0:Qe.abort()),this.inFlightDependencies=[];let ae=Promise.resolve({});if(Object.keys(fe).length){const Qe=new AbortController;this.inFlightDependencies.push(Qe),ae=V.sendAsync({type:"GG",data:{stacks:fe,source:this.source,tileID:this.tileID,type:"glyphs"}},Qe)}const xe=Object.keys(G.iconDependencies);let Oe=Promise.resolve({});if(xe.length){const Qe=new AbortController;this.inFlightDependencies.push(Qe),Oe=V.sendAsync({type:"GI",data:{icons:xe,source:this.source,tileID:this.tileID,type:"icons"}},Qe)}const je=Object.keys(G.patternDependencies);let st=Promise.resolve({});if(je.length){const Qe=new AbortController;this.inFlightDependencies.push(Qe),st=V.sendAsync({type:"GI",data:{icons:je,source:this.source,tileID:this.tileID,type:"patterns"}},Qe)}const[Xe,ot,it]=yield Promise.all([ae,Oe,st]),Ot=new $e(Xe),Mt=new z.bo(ot,it);for(const Qe in te){const pt=te[Qe];pt instanceof z.a6?(Ke(pt.layers,this.zoom,R),z.bp({bucket:pt,glyphMap:Xe,glyphPositions:Ot.positions,imageMap:ot,imagePositions:Mt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):pt.hasPattern&&(pt instanceof z.bq||pt instanceof z.br||pt instanceof z.bs)&&(Ke(pt.layers,this.zoom,R),pt.addFeatures(G,this.tileID.canonical,Mt.patternPositions))}return this.status="done",{buckets:Object.values(te).filter(Qe=>!Qe.isEmpty()),featureIndex:J,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ot.image,imageAtlas:Mt,glyphMap:this.returnDependencies?Xe:null,iconMap:this.returnDependencies?ot:null,glyphPositions:this.returnDependencies?Ot.positions:null}})}}function Ke(U,A,k){const R=new z.z(A);for(const V of U)V.recalculate(R,k)}class he{constructor(A,k,R){this.actor=A,this.layerIndex=k,this.availableImages=R,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(A,k){return z._(this,void 0,void 0,function*(){const R=yield z.l(A.request,k);try{return{vectorTile:new z.bt.VectorTile(new z.bu(R.data)),rawData:R.data,cacheControl:R.cacheControl,expires:R.expires}}catch(V){const W=new Uint8Array(R.data);let J=`Unable to parse the tile at ${A.request.url}, `;throw J+=W[0]===31&&W[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${V.message}`,new Error(J)}})}loadTile(A){return z._(this,void 0,void 0,function*(){const k=A.uid,R=!!(A&&A.request&&A.request.collectResourceTiming)&&new z.bv(A.request),V=new We(A);this.loading[k]=V;const W=new AbortController;V.abort=W;try{const J=yield this.loadVectorTile(A,W);if(delete this.loading[k],!J)return null;const te=J.rawData,G={};J.expires&&(G.expires=J.expires),J.cacheControl&&(G.cacheControl=J.cacheControl);const ce={};if(R){const ae=R.finish();ae&&(ce.resourceTiming=JSON.parse(JSON.stringify(ae)))}V.vectorTile=J.vectorTile;const fe=V.parse(J.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[k]=V,this.fetching[k]={rawTileData:te,cacheControl:G,resourceTiming:ce};try{const ae=yield fe;return z.e({rawTileData:te.slice(0)},ae,G,ce)}finally{delete this.fetching[k]}}catch(J){throw delete this.loading[k],V.status="done",this.loaded[k]=V,J}})}reloadTile(A){return z._(this,void 0,void 0,function*(){const k=A.uid;if(!this.loaded||!this.loaded[k])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const R=this.loaded[k];if(R.showCollisionBoxes=A.showCollisionBoxes,R.status==="parsing"){const V=yield R.parse(R.vectorTile,this.layerIndex,this.availableImages,this.actor);let W;if(this.fetching[k]){const{rawTileData:J,cacheControl:te,resourceTiming:G}=this.fetching[k];delete this.fetching[k],W=z.e({rawTileData:J.slice(0)},V,te,G)}else W=V;return W}if(R.status==="done"&&R.vectorTile)return R.parse(R.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(A){return z._(this,void 0,void 0,function*(){const k=this.loading,R=A.uid;k&&k[R]&&k[R].abort&&(k[R].abort.abort(),delete k[R])})}removeTile(A){return z._(this,void 0,void 0,function*(){this.loaded&&this.loaded[A.uid]&&delete this.loaded[A.uid]})}}class oe{constructor(){this.loaded={}}loadTile(A){return z._(this,void 0,void 0,function*(){const{uid:k,encoding:R,rawImageData:V,redFactor:W,greenFactor:J,blueFactor:te,baseShift:G}=A,ce=V.width+2,fe=V.height+2,ae=z.b(V)?new z.R({width:ce,height:fe},yield z.bw(V,-1,-1,ce,fe)):V,xe=new z.bx(k,ae,R,W,J,te,G);return this.loaded=this.loaded||{},this.loaded[k]=xe,xe})}removeTile(A){const k=this.loaded,R=A.uid;k&&k[R]&&delete k[R]}}function Ut(U,A){if(U.length!==0){ei(U[0],A);for(var k=1;k=Math.abs(te)?k-G+te:te-G+k,k=G}k+R>=0!=!!A&&U.reverse()}var $t=z.by(function U(A,k){var R,V=A&&A.type;if(V==="FeatureCollection")for(R=0;R>31}function Pr(U,A){for(var k=U.loadGeometry(),R=U.type,V=0,W=0,J=k.length,te=0;teU},tn=Math.fround||(zr=new Float32Array(1),U=>(zr[0]=+U,zr[0]));var zr;const xi=3,er=5,In=6;class jr{constructor(A){this.options=Object.assign(Object.create(Za),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:k,minZoom:R,maxZoom:V}=this.options;k&&console.time("total time");const W=`prepare ${A.length} points`;k&&console.time(W),this.points=A;const J=[];for(let G=0;G=R;G--){const ce=+Date.now();te=this.trees[G]=this._createTree(this._cluster(te,G)),k&&console.log("z%d: %d clusters in %dms",G,te.numItems,+Date.now()-ce)}return k&&console.timeEnd("total time"),this}getClusters(A,k){let R=((A[0]+180)%360+360)%360-180;const V=Math.max(-90,Math.min(90,A[1]));let W=A[2]===180?180:((A[2]+180)%360+360)%360-180;const J=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)R=-180,W=180;else if(R>W){const ae=this.getClusters([R,V,180,J],k),xe=this.getClusters([-180,V,W,J],k);return ae.concat(xe)}const te=this.trees[this._limitZoom(k)],G=te.range(Ei(R),tr(J),Ei(W),tr(V)),ce=te.data,fe=[];for(const ae of G){const xe=this.stride*ae;fe.push(ce[xe+er]>1?gr(ce,xe,this.clusterProps):this.points[ce[xe+xi]])}return fe}getChildren(A){const k=this._getOriginId(A),R=this._getOriginZoom(A),V="No cluster with the specified id.",W=this.trees[R];if(!W)throw new Error(V);const J=W.data;if(k*this.stride>=J.length)throw new Error(V);const te=this.options.radius/(this.options.extent*Math.pow(2,R-1)),G=W.within(J[k*this.stride],J[k*this.stride+1],te),ce=[];for(const fe of G){const ae=fe*this.stride;J[ae+4]===A&&ce.push(J[ae+er]>1?gr(J,ae,this.clusterProps):this.points[J[ae+xi]])}if(ce.length===0)throw new Error(V);return ce}getLeaves(A,k,R){const V=[];return this._appendLeaves(V,A,k=k||10,R=R||0,0),V}getTile(A,k,R){const V=this.trees[this._limitZoom(A)],W=Math.pow(2,A),{extent:J,radius:te}=this.options,G=te/J,ce=(R-G)/W,fe=(R+1+G)/W,ae={features:[]};return this._addTileFeatures(V.range((k-G)/W,ce,(k+1+G)/W,fe),V.data,k,R,W,ae),k===0&&this._addTileFeatures(V.range(1-G/W,ce,1,fe),V.data,W,R,W,ae),k===W-1&&this._addTileFeatures(V.range(0,ce,G/W,fe),V.data,-1,R,W,ae),ae.features.length?ae:null}getClusterExpansionZoom(A){let k=this._getOriginZoom(A)-1;for(;k<=this.options.maxZoom;){const R=this.getChildren(A);if(k++,R.length!==1)break;A=R[0].properties.cluster_id}return k}_appendLeaves(A,k,R,V,W){const J=this.getChildren(k);for(const te of J){const G=te.properties;if(G&&G.cluster?W+G.point_count<=V?W+=G.point_count:W=this._appendLeaves(A,G.cluster_id,R,V,W):W1;let fe,ae,xe;if(ce)fe=kn(k,G,this.clusterProps),ae=k[G],xe=k[G+1];else{const st=this.points[k[G+xi]];fe=st.properties;const[Xe,ot]=st.geometry.coordinates;ae=Ei(Xe),xe=tr(ot)}const Oe={type:1,geometry:[[Math.round(this.options.extent*(ae*W-R)),Math.round(this.options.extent*(xe*W-V))]],tags:fe};let je;je=ce||this.options.generateId?k[G+xi]:this.points[k[G+xi]].id,je!==void 0&&(Oe.id=je),J.features.push(Oe)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,k){const{radius:R,extent:V,reduce:W,minPoints:J}=this.options,te=R/(V*Math.pow(2,k)),G=A.data,ce=[],fe=this.stride;for(let ae=0;aek&&(Xe+=G[it+er])}if(Xe>st&&Xe>=J){let ot,it=xe*st,Ot=Oe*st,Mt=-1;const Qe=((ae/fe|0)<<5)+(k+1)+this.points.length;for(const pt of je){const Pt=pt*fe;if(G[Pt+2]<=k)continue;G[Pt+2]=k;const Zt=G[Pt+er];it+=G[Pt]*Zt,Ot+=G[Pt+1]*Zt,G[Pt+4]=Qe,W&&(ot||(ot=this._map(G,ae,!0),Mt=this.clusterProps.length,this.clusterProps.push(ot)),W(ot,this._map(G,Pt)))}G[ae+4]=Qe,ce.push(it/Xe,Ot/Xe,1/0,Qe,-1,Xe),W&&ce.push(Mt)}else{for(let ot=0;ot1)for(const ot of je){const it=ot*fe;if(!(G[it+2]<=k)){G[it+2]=k;for(let Ot=0;Ot>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,k,R){if(A[k+er]>1){const J=this.clusterProps[A[k+In]];return R?Object.assign({},J):J}const V=this.points[A[k+xi]].properties,W=this.options.map(V);return R&&W===V?Object.assign({},W):W}}function gr(U,A,k){return{type:"Feature",id:U[A+xi],properties:kn(U,A,k),geometry:{type:"Point",coordinates:[(R=U[A],360*(R-.5)),rn(U[A+1])]}};var R}function kn(U,A,k){const R=U[A+er],V=R>=1e4?`${Math.round(R/1e3)}k`:R>=1e3?Math.round(R/100)/10+"k":R,W=U[A+In],J=W===-1?{}:Object.assign({},k[W]);return Object.assign(J,{cluster:!0,cluster_id:U[A+xi],point_count:R,point_count_abbreviated:V})}function Ei(U){return U/360+.5}function tr(U){const A=Math.sin(U*Math.PI/180),k=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return k<0?0:k>1?1:k}function rn(U){const A=(180-360*U)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function nn(U,A,k,R){let V=R;const W=A+(k-A>>1);let J,te=k-A;const G=U[A],ce=U[A+1],fe=U[k],ae=U[k+1];for(let xe=A+3;xeV)J=xe,V=Oe;else if(Oe===V){const je=Math.abs(xe-W);jeR&&(J-A>3&&nn(U,A,J,R),U[J+2]=V,k-J>3&&nn(U,J,k,R))}function da(U,A,k,R,V,W){let J=V-k,te=W-R;if(J!==0||te!==0){const G=((U-k)*J+(A-R)*te)/(J*J+te*te);G>1?(k=V,R=W):G>0&&(k+=J*G,R+=te*G)}return J=U-k,te=A-R,J*J+te*te}function Cr(U,A,k,R){const V={id:U??null,type:A,geometry:k,tags:R,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(A==="Point"||A==="MultiPoint"||A==="LineString")Vr(V,k);else if(A==="Polygon")Vr(V,k[0]);else if(A==="MultiLineString")for(const W of k)Vr(V,W);else if(A==="MultiPolygon")for(const W of k)Vr(V,W[0]);return V}function Vr(U,A){for(let k=0;k0&&(J+=R?(V*fe-ce*W)/2:Math.sqrt(Math.pow(ce-V,2)+Math.pow(fe-W,2))),V=ce,W=fe}const te=A.length-3;A[2]=1,nn(A,0,te,k),A[te+2]=1,A.size=Math.abs(J),A.start=0,A.end=A.size}function an(U,A,k,R){for(let V=0;V1?1:k}function Ct(U,A,k,R,V,W,J,te){if(R/=A,W>=(k/=A)&&J=R)return null;const G=[];for(const ce of U){const fe=ce.geometry;let ae=ce.type;const xe=V===0?ce.minX:ce.minY,Oe=V===0?ce.maxX:ce.maxY;if(xe>=k&&Oe=R)continue;let je=[];if(ae==="Point"||ae==="MultiPoint")fa(fe,je,k,R,V);else if(ae==="LineString")Ur(fe,je,k,R,V,!1,te.lineMetrics);else if(ae==="MultiLineString")Pn(fe,je,k,R,V,!1);else if(ae==="Polygon")Pn(fe,je,k,R,V,!0);else if(ae==="MultiPolygon")for(const st of fe){const Xe=[];Pn(st,Xe,k,R,V,!0),Xe.length&&je.push(Xe)}if(je.length){if(te.lineMetrics&&ae==="LineString"){for(const st of je)G.push(Cr(ce.id,ae,st,ce.tags));continue}ae!=="LineString"&&ae!=="MultiLineString"||(je.length===1?(ae="LineString",je=je[0]):ae="MultiLineString"),ae!=="Point"&&ae!=="MultiPoint"||(ae=je.length===3?"Point":"MultiPoint"),G.push(Cr(ce.id,ae,je,ce.tags))}}return G.length?G:null}function fa(U,A,k,R,V){for(let W=0;W=k&&J<=R&&qi(A,U[W],U[W+1],U[W+2])}}function Ur(U,A,k,R,V,W,J){let te=Mr(U);const G=V===0?ma:_a;let ce,fe,ae=U.start;for(let Xe=0;Xek&&(fe=G(te,ot,it,Mt,Qe,k),J&&(te.start=ae+ce*fe)):pt>R?Pt=k&&(fe=G(te,ot,it,Mt,Qe,k),Zt=!0),Pt>R&&pt<=R&&(fe=G(te,ot,it,Mt,Qe,R),Zt=!0),!W&&Zt&&(J&&(te.end=ae+ce*fe),A.push(te),te=Mr(U)),J&&(ae+=ce)}let xe=U.length-3;const Oe=U[xe],je=U[xe+1],st=V===0?Oe:je;st>=k&&st<=R&&qi(te,Oe,je,U[xe+2]),xe=te.length-3,W&&xe>=3&&(te[xe]!==te[0]||te[xe+1]!==te[1])&&qi(te,te[0],te[1],te[2]),te.length&&A.push(te)}function Mr(U){const A=[];return A.size=U.size,A.start=U.start,A.end=U.end,A}function Pn(U,A,k,R,V,W){for(const J of U)Ur(J,A,k,R,V,W,!1)}function qi(U,A,k,R){U.push(A,k,R)}function ma(U,A,k,R,V,W){const J=(W-A)/(R-A);return qi(U,W,k+(V-k)*J,1),J}function _a(U,A,k,R,V,W){const J=(W-k)/(V-k);return qi(U,A+(R-A)*J,W,1),J}function ge(U,A){const k=[];for(let R=0;R0&&A.size<(V?J:R))return void(k.numPoints+=A.length/3);const te=[];for(let G=0;GJ)&&(k.numSimplified++,te.push(A[G],A[G+1])),k.numPoints++;V&&function(G,ce){let fe=0;for(let ae=0,xe=G.length,Oe=xe-2;ae0===ce)for(let ae=0,xe=G.length;ae24)throw new Error("maxZoom should be in the 0-24 range");if(k.promoteId&&k.generateId)throw new Error("promoteId and generateId cannot be used together.");let V=function(W,J){const te=[];if(W.type==="FeatureCollection")for(let G=0;G1&&console.time("creation"),Oe=this.tiles[xe]=$r(A,k,R,V,ce),this.tileCoords.push({z:k,x:R,y:V}),fe)){fe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",k,R,V,Oe.numFeatures,Oe.numPoints,Oe.numSimplified),console.timeEnd("creation"));const Zt=`z${k}`;this.stats[Zt]=(this.stats[Zt]||0)+1,this.total++}if(Oe.source=A,W==null){if(k===ce.indexMaxZoom||Oe.numPoints<=ce.indexMaxPoints)continue}else{if(k===ce.maxZoom||k===W)continue;if(W!=null){const Zt=W-k;if(R!==J>>Zt||V!==te>>Zt)continue}}if(Oe.source=null,A.length===0)continue;fe>1&&console.time("clipping");const je=.5*ce.buffer/ce.extent,st=.5-je,Xe=.5+je,ot=1+je;let it=null,Ot=null,Mt=null,Qe=null,pt=Ct(A,ae,R-je,R+Xe,0,Oe.minX,Oe.maxX,ce),Pt=Ct(A,ae,R+st,R+ot,0,Oe.minX,Oe.maxX,ce);A=null,pt&&(it=Ct(pt,ae,V-je,V+Xe,1,Oe.minY,Oe.maxY,ce),Ot=Ct(pt,ae,V+st,V+ot,1,Oe.minY,Oe.maxY,ce),pt=null),Pt&&(Mt=Ct(Pt,ae,V-je,V+Xe,1,Oe.minY,Oe.maxY,ce),Qe=Ct(Pt,ae,V+st,V+ot,1,Oe.minY,Oe.maxY,ce),Pt=null),fe>1&&console.timeEnd("clipping"),G.push(it||[],k+1,2*R,2*V),G.push(Ot||[],k+1,2*R,2*V+1),G.push(Mt||[],k+1,2*R+1,2*V),G.push(Qe||[],k+1,2*R+1,2*V+1)}}getTile(A,k,R){A=+A,k=+k,R=+R;const V=this.options,{extent:W,debug:J}=V;if(A<0||A>24)return null;const te=1<1&&console.log("drilling down to z%d-%d-%d",A,k,R);let ce,fe=A,ae=k,xe=R;for(;!ce&&fe>0;)fe--,ae>>=1,xe>>=1,ce=this.tiles[ir(fe,ae,xe)];return ce&&ce.source?(J>1&&(console.log("found parent tile z%d-%d-%d",fe,ae,xe),console.time("drilling down")),this.splitTile(ce.source,fe,ae,xe,A,k,R),J>1&&console.timeEnd("drilling down"),this.tiles[G]?di(this.tiles[G],W):null):null}}function ir(U,A,k){return 32*((1<{ae.properties=Oe;const je={};for(const st of xe)je[st]=G[st].evaluate(fe,ae);return je},J.reduce=(Oe,je)=>{ae.properties=je;for(const st of xe)fe.accumulated=Oe[st],Oe[st]=ce[st].evaluate(fe,ae)},J}(A)).load((yield this._pendingData).features):(V=yield this._pendingData,new bi(V,A.geojsonVtOptions)),this.loaded={};const W={};if(R){const J=R.finish();J&&(W.resourceTiming={},W.resourceTiming[A.source]=JSON.parse(JSON.stringify(J)))}return W}catch(W){if(delete this._pendingRequest,z.bB(W))return{abandoned:!0};throw W}var V})}getData(){return z._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(A){const k=this.loaded;return k&&k[A.uid]?super.reloadTile(A):this.loadTile(A)}loadAndProcessGeoJSON(A,k){return z._(this,void 0,void 0,function*(){let R=yield this.loadGeoJSON(A,k);if(delete this._pendingRequest,typeof R!="object")throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if($t(R,!0),A.filter){const V=z.bC(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(V.result==="error")throw new Error(V.value.map(J=>`${J.key}: ${J.message}`).join(", "));R={type:"FeatureCollection",features:R.features.filter(J=>V.value.evaluate({zoom:0},J))}}return R})}loadGeoJSON(A,k){return z._(this,void 0,void 0,function*(){const{promoteId:R}=A;if(A.request){const V=yield z.h(A.request,k);return this._dataUpdateable=br(V.data,R)?Er(V.data,R):void 0,V.data}if(typeof A.data=="string")try{const V=JSON.parse(A.data);return this._dataUpdateable=br(V,R)?Er(V,R):void 0,V}catch{throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`)}if(!A.dataDiff)throw new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${A.source}`);return function(V,W,J){var te,G,ce,fe;if(W.removeAll&&V.clear(),W.remove)for(const ae of W.remove)V.delete(ae);if(W.add)for(const ae of W.add){const xe=He(ae,J);xe!=null&&V.set(xe,ae)}if(W.update)for(const ae of W.update){let xe=V.get(ae.id);if(xe==null)continue;const Oe=!ae.removeAllProperties&&(((te=ae.removeProperties)===null||te===void 0?void 0:te.length)>0||((G=ae.addOrUpdateProperties)===null||G===void 0?void 0:G.length)>0);if((ae.newGeometry||ae.removeAllProperties||Oe)&&(xe=Object.assign({},xe),V.set(ae.id,xe),Oe&&(xe.properties=Object.assign({},xe.properties))),ae.newGeometry&&(xe.geometry=ae.newGeometry),ae.removeAllProperties)xe.properties={};else if(((ce=ae.removeProperties)===null||ce===void 0?void 0:ce.length)>0)for(const je of ae.removeProperties)Object.prototype.hasOwnProperty.call(xe.properties,je)&&delete xe.properties[je];if(((fe=ae.addOrUpdateProperties)===null||fe===void 0?void 0:fe.length)>0)for(const{key:je,value:st}of ae.addOrUpdateProperties)xe.properties[je]=st}}(this._dataUpdateable,A.dataDiff,R),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(A){return z._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(A){return this._geoJSONIndex.getClusterExpansionZoom(A.clusterId)}getClusterChildren(A){return this._geoJSONIndex.getChildren(A.clusterId)}getClusterLeaves(A){return this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset)}}class vr{constructor(A){this.self=A,this.actor=new z.F(A),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(k,R)=>{if(this.externalWorkerSourceTypes[k])throw new Error(`Worker source with name "${k}" already registered.`);this.externalWorkerSourceTypes[k]=R},this.self.addProtocol=z.bi,this.self.removeProtocol=z.bj,this.self.registerRTLTextPlugin=k=>{if(z.bD.isParsed())throw new Error("RTL text plugin already registered.");z.bD.setMethods(k)},this.actor.registerMessageHandler("LDT",(k,R)=>this._getDEMWorkerSource(k,R.source).loadTile(R)),this.actor.registerMessageHandler("RDT",(k,R)=>z._(this,void 0,void 0,function*(){this._getDEMWorkerSource(k,R.source).removeTile(R)})),this.actor.registerMessageHandler("GCEZ",(k,R)=>z._(this,void 0,void 0,function*(){return this._getWorkerSource(k,R.type,R.source).getClusterExpansionZoom(R)})),this.actor.registerMessageHandler("GCC",(k,R)=>z._(this,void 0,void 0,function*(){return this._getWorkerSource(k,R.type,R.source).getClusterChildren(R)})),this.actor.registerMessageHandler("GCL",(k,R)=>z._(this,void 0,void 0,function*(){return this._getWorkerSource(k,R.type,R.source).getClusterLeaves(R)})),this.actor.registerMessageHandler("LD",(k,R)=>this._getWorkerSource(k,R.type,R.source).loadData(R)),this.actor.registerMessageHandler("GD",(k,R)=>this._getWorkerSource(k,R.type,R.source).getData()),this.actor.registerMessageHandler("LT",(k,R)=>this._getWorkerSource(k,R.type,R.source).loadTile(R)),this.actor.registerMessageHandler("RT",(k,R)=>this._getWorkerSource(k,R.type,R.source).reloadTile(R)),this.actor.registerMessageHandler("AT",(k,R)=>this._getWorkerSource(k,R.type,R.source).abortTile(R)),this.actor.registerMessageHandler("RMT",(k,R)=>this._getWorkerSource(k,R.type,R.source).removeTile(R)),this.actor.registerMessageHandler("RS",(k,R)=>z._(this,void 0,void 0,function*(){if(!this.workerSources[k]||!this.workerSources[k][R.type]||!this.workerSources[k][R.type][R.source])return;const V=this.workerSources[k][R.type][R.source];delete this.workerSources[k][R.type][R.source],V.removeSource!==void 0&&V.removeSource(R)})),this.actor.registerMessageHandler("RM",k=>z._(this,void 0,void 0,function*(){delete this.layerIndexes[k],delete this.availableImages[k],delete this.workerSources[k],delete this.demWorkerSources[k]})),this.actor.registerMessageHandler("SR",(k,R)=>z._(this,void 0,void 0,function*(){this.referrer=R})),this.actor.registerMessageHandler("SRPS",(k,R)=>this._syncRTLPluginState(k,R)),this.actor.registerMessageHandler("IS",(k,R)=>z._(this,void 0,void 0,function*(){this.self.importScripts(R)})),this.actor.registerMessageHandler("SI",(k,R)=>this._setImages(k,R)),this.actor.registerMessageHandler("UL",(k,R)=>z._(this,void 0,void 0,function*(){this._getLayerIndex(k).update(R.layers,R.removedIds)})),this.actor.registerMessageHandler("SL",(k,R)=>z._(this,void 0,void 0,function*(){this._getLayerIndex(k).replace(R)}))}_setImages(A,k){return z._(this,void 0,void 0,function*(){this.availableImages[A]=k;for(const R in this.workerSources[A]){const V=this.workerSources[A][R];for(const W in V)V[W].availableImages=k}})}_syncRTLPluginState(A,k){return z._(this,void 0,void 0,function*(){if(z.bD.isParsed())return z.bD.getState();if(k.pluginStatus!=="loading")return z.bD.setState(k),k;const R=k.pluginURL;if(this.self.importScripts(R),z.bD.isParsed()){const V={pluginStatus:"loaded",pluginURL:R};return z.bD.setState(V),V}throw z.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${R}`)})}_getAvailableImages(A){let k=this.availableImages[A];return k||(k=[]),k}_getLayerIndex(A){let k=this.layerIndexes[A];return k||(k=this.layerIndexes[A]=new p),k}_getWorkerSource(A,k,R){if(this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][k]||(this.workerSources[A][k]={}),!this.workerSources[A][k][R]){const V={sendAsync:(W,J)=>(W.targetMapId=A,this.actor.sendAsync(W,J))};switch(k){case"vector":this.workerSources[A][k][R]=new he(V,this._getLayerIndex(A),this._getAvailableImages(A));break;case"geojson":this.workerSources[A][k][R]=new qr(V,this._getLayerIndex(A),this._getAvailableImages(A));break;default:this.workerSources[A][k][R]=new this.externalWorkerSourceTypes[k](V,this._getLayerIndex(A),this._getAvailableImages(A))}}return this.workerSources[A][k][R]}_getDEMWorkerSource(A,k){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][k]||(this.demWorkerSources[A][k]=new oe),this.demWorkerSources[A][k]}}return z.i(self)&&(self.worker=new vr(self)),vr}),pe("index",["exports","./shared"],function(z,p){var $e="4.7.1";let We,Ke;const he={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:h=>new Promise((e,n)=>{const s=requestAnimationFrame(e);h.signal.addEventListener("abort",()=>{cancelAnimationFrame(s),n(p.c())})}),getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,n.drawImage(h,0,0,h.width,h.height),n},resolveURL:h=>(We||(We=document.createElement("a")),We.href=h,We.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Ke==null&&(Ke=matchMedia("(prefers-reduced-motion: reduce)")),Ke.matches)}};class oe{static testProp(e){if(!oe.docStyle)return e[0];for(let n=0;n{window.removeEventListener("click",oe.suppressClickInternal,!0)},0)}static getScale(e){const n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}static getPoint(e,n,s){const o=n.boundingClientRect;return new p.P((s.clientX-o.left)/n.x-e.clientLeft,(s.clientY-o.top)/n.y-e.clientTop)}static mousePos(e,n){const s=oe.getScale(e);return oe.getPoint(e,s,n)}static touchPos(e,n){const s=[],o=oe.getScale(e);for(let c=0;c{ei&&ti(ei),ei=null,yi=!0},$t.onerror=()=>{Ci=!0,ei=null},$t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(h){let e,n,s,o;h.resetRequestQueue=()=>{e=[],n=0,s=0,o={}},h.addThrottleControl=y=>{const v=s++;return o[v]=y,v},h.removeThrottleControl=y=>{delete o[y],m()},h.getImage=(y,v,S=!0)=>new Promise((T,C)=>{Ut.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),p.e(y,{type:"image"}),e.push({abortController:v,requestParameters:y,supportImageRefresh:S,state:"queued",onError:L=>{C(L)},onSuccess:L=>{T(L)}}),m()});const c=y=>p._(this,void 0,void 0,function*(){y.state="running";const{requestParameters:v,supportImageRefresh:S,onError:T,onSuccess:C,abortController:L}=y,F=S===!1&&!p.i(self)&&!p.g(v.url)&&(!v.headers||Object.keys(v.headers).reduce((Z,H)=>Z&&H==="accept",!0));n++;const N=F?g(v,L):p.m(v,L);try{const Z=yield N;delete y.abortController,y.state="completed",Z.data instanceof HTMLImageElement||p.b(Z.data)?C(Z):Z.data&&C({data:yield(q=Z.data,typeof createImageBitmap=="function"?p.d(q):p.f(q)),cacheControl:Z.cacheControl,expires:Z.expires})}catch(Z){delete y.abortController,T(Z)}finally{n--,m()}var q}),m=()=>{const y=(()=>{for(const v of Object.keys(o))if(o[v]())return!0;return!1})()?p.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:p.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let v=n;v0;v++){const S=e.shift();S.abortController.signal.aborted?v--:c(S)}},g=(y,v)=>new Promise((S,T)=>{const C=new Image,L=y.url,F=y.credentials;F&&F==="include"?C.crossOrigin="use-credentials":(F&&F==="same-origin"||!p.s(L))&&(C.crossOrigin="anonymous"),v.signal.addEventListener("abort",()=>{C.src="",T(p.c())}),C.fetchPriority="high",C.onload=()=>{C.onerror=C.onload=null,S({data:C})},C.onerror=()=>{C.onerror=C.onload=null,v.signal.aborted||T(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."))},C.src=L})}(zt||(zt={})),zt.resetRequestQueue();class Mi{constructor(e){this._transformRequestFn=e}transformRequest(e,n){return this._transformRequestFn&&this._transformRequestFn(e,n)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function qt(h){var e=new p.A(3);return e[0]=h[0],e[1]=h[1],e[2]=h[2],e}var Ui,$i=function(h,e,n){return h[0]=e[0]-n[0],h[1]=e[1]-n[1],h[2]=e[2]-n[2],h};Ui=new p.A(3),p.A!=Float32Array&&(Ui[0]=0,Ui[1]=0,Ui[2]=0);var $a=function(h){var e=h[0],n=h[1];return e*e+n*n};function mr(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const n=[];for(const{id:s,url:o}of h){const c=`${s}${o}`;n.indexOf(c)===-1&&(n.push(c),e.push({id:s,url:o}))}}return e}function ua(h,e,n){const s=h.split("?");return s[0]+=`${e}${n}`,s.join("?")}(function(){var h=new p.A(2);p.A!=Float32Array&&(h[0]=0,h[1]=0)})();class mt{constructor(e,n,s,o){this.context=e,this.format=s,this.texture=e.gl.createTexture(),this.update(n,o)}update(e,n,s){const{width:o,height:c}=e,m=!(this.size&&this.size[0]===o&&this.size[1]===c||s),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[o,c],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,e):y.texImage2D(y.TEXTURE_2D,0,this.format,o,c,0,this.format,y.UNSIGNED_BYTE,e.data);else{const{x:v,y:S}=s||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||p.b(e)?y.texSubImage2D(y.TEXTURE_2D,0,v,S,y.RGBA,y.UNSIGNED_BYTE,e):y.texSubImage2D(y.TEXTURE_2D,0,v,S,o,c,y.RGBA,y.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(e,n,s){const{context:o}=this,{gl:c}=o;c.bindTexture(c.TEXTURE_2D,this.texture),s!==c.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=c.LINEAR),e!==this.filter&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,e),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,s||e),this.filter=e),n!==this.wrap&&(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,n),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function qa(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class ii extends p.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new p.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:n,promiseResolve:s}of this.requestors)s(this._getImagesForIds(n));this.requestors=[]}}getImage(e){const n=this.images[e];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new p.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(e,n){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,n)&&(this.images[e]=n)}_validate(e,n){let s=!0;const o=n.data||n.spriteData;return this._validateStretch(n.stretchX,o&&o.width)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,o&&o.height)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new p.j(new Error(`Image "${e}" has invalid "content" value`))),s=!1),s}_validateStretch(e,n){if(!e)return!0;let s=0;for(const o of e){if(o[0]{let o=!0;if(!this.isLoaded())for(const c of e)this.images[c]||(o=!1);this.isLoaded()||o?n(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:n})})}_getImagesForIds(e){const n={};for(const s of e){let o=this.getImage(s);o||(this.fire(new p.k("styleimagemissing",{id:s})),o=this.getImage(s)),o?n[s]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,textFitWidth:o.textFitWidth,textFitHeight:o.textFitHeight,hasRenderCallback:!!(o.userImage&&o.userImage.render)}:p.w(`Image "${s}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return n}getPixelSize(){const{width:e,height:n}=this.atlasImage;return{width:e,height:n}}getPattern(e){const n=this.patterns[e],s=this.getImage(e);if(!s)return null;if(n&&n.position.version===s.version)return n.position;if(n)n.position.version=s.version;else{const o={w:s.data.width+2,h:s.data.height+2,x:0,y:0},c=new p.I(o,s);this.patterns[e]={bin:o,position:c}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new mt(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const c in this.patterns)e.push(this.patterns[c].bin);const{w:n,h:s}=p.p(e),o=this.atlasImage;o.resize({width:n||1,height:s||1});for(const c in this.patterns){const{bin:m}=this.patterns[c],g=m.x+1,y=m.y+1,v=this.getImage(c).data,S=v.width,T=v.height;p.R.copy(v,o,{x:0,y:0},{x:g,y},{width:S,height:T}),p.R.copy(v,o,{x:0,y:T-1},{x:g,y:y-1},{width:S,height:1}),p.R.copy(v,o,{x:0,y:0},{x:g,y:y+T},{width:S,height:1}),p.R.copy(v,o,{x:S-1,y:0},{x:g-1,y},{width:1,height:T}),p.R.copy(v,o,{x:0,y:0},{x:g+S,y},{width:1,height:T})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.getImage(n);s||p.w(`Image with ID: "${n}" was not found`),qa(s)&&this.updateImage(n,s)}}}const ui=1e20;function Pr(h,e,n,s,o,c,m,g,y){for(let v=e;v-1);y++,c[y]=g,m[y]=v,m[y+1]=ui}for(let g=0,y=0;g65535)throw new Error("glyphs > 65535 not supported");if(s.ranges[c])return{stack:e,id:n,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!s.requests[c]){const g=_r.loadGlyphRange(e,c,this.url,this.requestManager);s.requests[c]=g}const m=yield s.requests[c];for(const g in m)this._doesCharSupportLocalGlyph(+g)||(s.glyphs[+g]=m[+g]);return s.ranges[c]=!0,{stack:e,id:n,glyph:m[n]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,n,s){const o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(s))return;let c=e.tinySDF;if(!c){let g="400";/bold/i.test(n)?g="900":/medium/i.test(n)?g="500":/light/i.test(n)&&(g="200"),c=e.tinySDF=new _r.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:g})}const m=c.draw(String.fromCharCode(s));return{id:s,bitmap:new p.o({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}_r.loadGlyphRange=function(h,e,n,s){return p._(this,void 0,void 0,function*(){const o=256*e,c=o+255,m=s.transformRequest(n.replace("{fontstack}",h).replace("{range}",`${o}-${c}`),"Glyphs"),g=yield p.l(m,new AbortController);if(!g||!g.data)throw new Error(`Could not load glyph range. range: ${e}, ${o}-${c}`);const y={};for(const v of p.n(g.data))y[v.id]=v;return y})},_r.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:n=8,cutoff:s=.25,fontFamily:o="sans-serif",fontWeight:c="normal",fontStyle:m="normal"}={}){this.buffer=e,this.cutoff=s,this.radius=n;const g=this.size=h+4*e,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${c} ${h}px ${o}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:o,actualBoundingBoxRight:c}=this.ctx.measureText(h),m=Math.ceil(n),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-o))),y=Math.min(this.size-this.buffer,m+Math.ceil(s)),v=g+2*this.buffer,S=y+2*this.buffer,T=Math.max(v*S,0),C=new Uint8ClampedArray(T),L={data:C,width:v,height:S,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:e};if(g===0||y===0)return L;const{ctx:F,buffer:N,gridInner:q,gridOuter:Z}=this;F.clearRect(N,N,g,y),F.fillText(h,N,N+m);const H=F.getImageData(N,N,g,y);Z.fill(ui,0,T),q.fill(0,0,T);for(let O=0;O0?de*de:0,q[re]=de<0?de*de:0}}Pr(Z,0,0,v,S,v,this.f,this.v,this.z),Pr(q,N,N,g,y,v,this.f,this.v,this.z);for(let O=0;O1&&(y=e[++g]);const S=Math.abs(v-y.left),T=Math.abs(v-y.right),C=Math.min(S,T);let L;const F=c/s*(o+1);if(y.isDash){const N=o-Math.abs(F);L=Math.sqrt(C*C+N*N)}else L=o-Math.sqrt(C*C+F*F);this.data[m+v]=Math.max(0,Math.min(255,L+128))}}}addRegularDash(e){for(let g=e.length-1;g>=0;--g){const y=e[g],v=e[g+1];y.zeroLength?e.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,e.splice(g,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const o=this.width*this.nextRow;let c=0,m=e[c];for(let g=0;g1&&(m=e[++c]);const y=Math.abs(g-m.left),v=Math.abs(g-m.right),S=Math.min(y,v);this.data[o+g]=Math.max(0,Math.min(255,(m.isDash?S:-S)+128))}}addDash(e,n){const s=n?7:0,o=2*s+1;if(this.nextRow+o>this.height)return p.w("LineAtlas out of space"),null;let c=0;for(let g=0;g{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[jr]}numActive(){return Object.keys(this.active).length}}const kn=Math.floor(he.hardwareConcurrency/2);let Ei,tr;function rn(){return Ei||(Ei=new gr),Ei}gr.workerCount=p.C(globalThis)?Math.max(Math.min(kn,3),1):1;class nn{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const s=this.workerPool.acquire(n);for(let o=0;o{n.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,n){for(const s of this.actors)s.registerMessageHandler(e,n)}}function da(){return tr||(tr=new nn(rn(),p.G),tr.registerMessageHandler("GR",(h,e,n)=>p.m(e,n))),tr}function Cr(h,e){const n=p.H();return p.J(n,n,[1,1,0]),p.K(n,n,[.5*h.width,.5*h.height,1]),p.L(n,n,h.calculatePosMatrix(e.toUnwrapped()))}function Vr(h,e,n,s,o,c){const m=function(T,C,L){if(T)for(const F of T){const N=C[F];if(N&&N.source===L&&N.type==="fill-extrusion")return!0}else for(const F in C){const N=C[F];if(N.source===L&&N.type==="fill-extrusion")return!0}return!1}(o&&o.layers,e,h.id),g=c.maxPitchScaleFactor(),y=h.tilesIn(s,g,m);y.sort(Nr);const v=[];for(const T of y)v.push({wrappedTileID:T.tileID.wrapped().key,queryResults:T.tile.queryRenderedFeatures(e,n,h._state,T.queryGeometry,T.cameraQueryGeometry,T.scale,o,c,g,Cr(h.transform,T.tileID))});const S=function(T){const C={},L={};for(const F of T){const N=F.queryResults,q=F.wrappedTileID,Z=L[q]=L[q]||{};for(const H in N){const O=N[H],K=Z[H]=Z[H]||{},Q=C[H]=C[H]||[];for(const re of O)K[re.featureIndex]||(K[re.featureIndex]=!0,Q.push(re))}}return C}(v);for(const T in S)S[T].forEach(C=>{const L=C.feature,F=h.getFeatureState(L.layer["source-layer"],L.id);L.source=L.layer.source,L.layer["source-layer"]&&(L.sourceLayer=L.layer["source-layer"]),L.state=F});return S}function Nr(h,e){const n=h.tileID,s=e.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}function An(h,e,n){return p._(this,void 0,void 0,function*(){let s=h;if(h.url?s=(yield p.h(e.transformRequest(h.url,"Source"),n)).data:yield he.frameAsync(n),!s)return null;const o=p.M(p.e(s,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(o.vectorLayerIds=s.vector_layers.map(c=>c.id)),o})}class se{constructor(e,n){e&&(n?this.setSouthWest(e).setNorthEast(n):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof p.N?new p.N(e.lng,e.lat):p.N.convert(e),this}extend(e){const n=this._sw,s=this._ne;let o,c;if(e instanceof p.N)o=e,c=e;else{if(!(e instanceof se))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(se.convert(e)):this.extend(p.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(p.N.convert(e)):this;if(o=e._sw,c=e._ne,!o||!c)return this}return n||s?(n.lng=Math.min(o.lng,n.lng),n.lat=Math.min(o.lat,n.lat),s.lng=Math.max(c.lng,s.lng),s.lat=Math.max(c.lat,s.lat)):(this._sw=new p.N(o.lng,o.lat),this._ne=new p.N(c.lng,c.lat)),this}getCenter(){return new p.N((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 p.N(this.getWest(),this.getNorth())}getSouthEast(){return new p.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:n,lat:s}=p.N.convert(e);let o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&o}static convert(e){return e instanceof se?e:e&&new se(e)}static fromLngLat(e,n=0){const s=360*n/40075017,o=s/Math.cos(Math.PI/180*e.lat);return new se(new p.N(e.lng-o,e.lat-s),new p.N(e.lng+o,e.lat+s))}adjustAntiMeridian(){const e=new p.N(this._sw.lng,this._sw.lat),n=new p.N(this._ne.lng,this._ne.lat);return new se(e,e.lng>n.lng?new p.N(n.lng+360,n.lat):n)}}class an{constructor(e,n,s){this.bounds=se.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const n=Math.pow(2,e.z),s=Math.floor(p.O(this.bounds.getWest())*n),o=Math.floor(p.Q(this.bounds.getNorth())*n),c=Math.ceil(p.O(this.bounds.getEast())*n),m=Math.ceil(p.Q(this.bounds.getSouth())*n);return e.x>=s&&e.x=o&&e.y{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return p.e({},this._options)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:this.map._requestManager.transformRequest(n,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((c,m)=>{e.reloadPromise={resolve:c,reject:m}})}else e.actor=this.dispatcher.getActor(),o="LT";e.abortController=new AbortController;try{const c=yield e.actor.sendAsync({type:o,data:s},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,c)}catch(c){if(delete e.abortController,e.aborted)return;if(c&&c.status!==404)throw c;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,n){if(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),e.reloadPromise){const s=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(s.resolve).catch(s.reject)}}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ht extends p.E{constructor(e,n,s,o){super(),this.id=e,this.dispatcher=s,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=p.e({type:"raster"},n),p.e(this,p.M(n,["url","scheme","tileSize"]))}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield An(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(p.e(this,e),e.bounds&&(this.tileBounds=new an(e.bounds,this.minzoom,this.maxzoom)),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new p.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return p.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const s=yield zt.getImage(this.map._requestManager.transformRequest(n,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(s&&s.data){this.map._refreshExpiredTiles&&s.cacheControl&&s.expires&&e.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});const o=this.map.painter.context,c=o.gl,m=s.data;e.texture=this.map.painter.getTileTexture(m.width),e.texture?e.texture.update(m,{useMipmap:!0}):(e.texture=new mt(o,m,c.RGBA,{useMipmap:!0}),e.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(s){if(delete e.abortController,e.aborted)e.state="unloaded";else if(s)throw e.state="errored",s}})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Ct extends ht{constructor(e,n,s,o){super(e,n,s,o),this.type="raster-dem",this.maxzoom=22,this._options=p.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=this.map._requestManager.transformRequest(n,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const o=yield zt.getImage(s,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){const c=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const m=p.b(c)&&p.U()?c:yield this.readImageNow(c),g={type:this.type,uid:e.uid,source:this.id,rawImageData:m,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const y=yield e.actor.sendAsync({type:"LDT",data:g});e.dem=y,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}readImageNow(e){return p._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&p.V()){const n=e.width+2,s=e.height+2;try{return new p.R({width:n,height:s},yield p.W(e,-1,-1,n,s))}catch{}}return he.getImageData(e,1)})}_getNeighboringTiles(e){const n=e.canonical,s=Math.pow(2,n.z),o=(n.x-1+s)%s,c=n.x===0?e.wrap-1:e.wrap,m=(n.x+1+s)%s,g=n.x+1===s?e.wrap+1:e.wrap,y={};return y[new p.S(e.overscaledZ,c,n.z,o,n.y).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(y[new p.S(e.overscaledZ,c,n.z,o,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new p.S(e.overscaledZ,g,n.z,m,n.y-1).key]={backfilled:!1}),n.y+10&&p.e(c,{resourceTiming:o}),this.fire(new p.k("data",Object.assign(Object.assign({},c),{sourceDataType:"metadata"}))),this.fire(new p.k("data",Object.assign(Object.assign({},c),{sourceDataType:"content"})))}catch(s){if(this._pendingLoads--,this._removed)return void this.fire(new p.k("dataabort",{dataType:"source"}));this.fire(new p.j(s))}})}loaded(){return this._pendingLoads===0}loadTile(e){return p._(this,void 0,void 0,function*(){const n=e.actor?"RT":"LT";e.actor=this.actor;const s={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const o=yield this.actor.sendAsync({type:n,data:s},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(o,this.map.painter,n==="RT")})}abortTile(e){return p._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return p._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return p.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ur=p.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Mr extends p.E{constructor(e,n,s,o){super(),this.id=e,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=n}load(e){return p._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new p.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield zt.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,e&&(this.coordinates=e),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new p.j(n))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const n=e.map(p.Z.fromLngLat);this.tileID=function(o){let c=1/0,m=1/0,g=-1/0,y=-1/0;for(const C of o)c=Math.min(c,C.x),m=Math.min(m,C.y),g=Math.max(g,C.x),y=Math.max(y,C.y);const v=Math.max(g-c,y-m),S=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,S);return new p.a1(S,Math.floor((c+g)/2*T),Math.floor((m+y)/2*T))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new p.$,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,p.X,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,p.X),this._boundsArray.emplaceBack(s[2].x,s[2].y,p.X,p.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new p.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Ur.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new mt(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,s=!0)}s&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return p._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Pn extends Mr{constructor(e,n,s,o){super(e,n,s,o),this.roundZoom=!0,this.type="video",this.options=n}load(){return p._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const n of e.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield p.a3(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new p.j(n))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const n=this.video.seekable;en.end(0)?this.fire(new p.j(new p.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Ur.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new mt(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const c=this.tiles[o];c.state!=="loaded"&&(c.state="loaded",c.texture=this.texture,s=!0)}s&&this.fire(new p.k("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 qi extends Mr{constructor(e,n,s,o){super(e,n,s,o),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(c=>!Array.isArray(c)||c.length!==2||c.some(m=>typeof m!="number"))||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new p.j(new p.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new p.j(new p.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new p.j(new p.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return p._(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 p.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,s=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Ur.members)),this.boundsSegments||(this.boundsSegments=p.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new mt(n,this.canvas,s.RGBA,{premultiply:!0});let o=!1;for(const c in this.tiles){const m=this.tiles[c];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,o=!0)}o&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const ma={},_a=h=>{switch(h){case"geojson":return fa;case"image":return Mr;case"raster":return ht;case"raster-dem":return Ct;case"vector":return pa;case"video":return Pn;case"canvas":return qi}return ma[h]},ge="RTLPluginLoaded";class yr extends p.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=da()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return p._(this,arguments,void 0,function*(n,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=he.resolveURL(n),!this.url)throw new Error(`requested url ${n} 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 p._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new p.k(ge))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let di=null;function xr(){return di||(di=new yr),di}class $r{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=p.a4(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const n=e+this.timeAdded;nc.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(S=>S.id===v)[0]));for(const v of y)m[v.id]=g}}return m}(e.buckets,n.style),this.hasSymbolBuckets=!1;for(const o in this.buckets){const c=this.buckets[o];if(c instanceof p.a6){if(this.hasSymbolBuckets=!0,!s)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const o in this.buckets){const c=this.buckets[o];if(c instanceof p.a6&&c.hasRTLText){this.hasRTLText=!0,xr().lazyLoad();break}}this.queryPadding=0;for(const o in this.buckets){const c=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(o).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new p.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const s in this.buckets){const o=this.buckets[s];o.uploadPending()&&o.upload(e)}const n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new mt(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new mt(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,n,s,o,c,m,g,y,v,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:c,scale:m,tileSize:this.tileSize,pixelPosMatrix:S,transform:y,params:g,queryPadding:this.queryPadding*v},e,n,s):{}}querySourceFeatures(e,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const o=s.loadVTLayers(),c=n&&n.sourceLayer?n.sourceLayer:"",m=o._geojsonTileLayer||o[c];if(!m)return;const g=p.a7(n&&n.filter),{z:y,x:v,y:S}=this.tileID.canonical,T={z:y,x:v,y:S};for(let C=0;Cs)o=!1;else if(n)if(this.expirationTime{this.remove(e,c)},s)),this.data[o].push(c),this.order.push(o),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const n=this.data[e].shift();return n.timeout&&clearTimeout(n.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),n.value}getByKey(e){const n=this.data[e];return n?n[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,n){if(!this.has(e))return this;const s=e.wrapped().key,o=n===void 0?0:this.data[s].indexOf(n),c=this.data[s][o];return this.data[s].splice(o,1),c.timeout&&clearTimeout(c.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(c.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(e){const n=[];for(const s in this.data)for(const o of this.data[s])e(o.value)||n.push(o);for(const s of n)this.remove(s.value.tileID,s)}}class Ye{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,s){const o=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},p.e(this.stateChanges[e][o],s),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==o&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][o]===null){this.deletedStates[e][o]={};for(const c in this.state[e][o])s[c]||(this.deletedStates[e][o][c]=null)}else for(const c in s)this.deletedStates[e]&&this.deletedStates[e][o]&&this.deletedStates[e][o][c]===null&&delete this.deletedStates[e][o][c]}removeFeatureState(e,n,s){if(this.deletedStates[e]===null)return;const o=String(n);if(this.deletedStates[e]=this.deletedStates[e]||{},s&&n!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][s]=null);else if(n!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o])for(s in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][s]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,n){const s=String(n),o=p.e({},(this.state[e]||{})[s],(this.stateChanges[e]||{})[s]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][n];if(c===null)return{};for(const m in c)delete o[m]}return o}initializeTileState(e,n){e.setFeatureState(this.state,n)}coalesceChanges(e,n){const s={};for(const o in this.stateChanges){this.state[o]=this.state[o]||{};const c={};for(const m in this.stateChanges[o])this.state[o][m]||(this.state[o][m]={}),p.e(this.state[o][m],this.stateChanges[o][m]),c[m]=this.state[o][m];s[o]=c}for(const o in this.deletedStates){this.state[o]=this.state[o]||{};const c={};if(this.deletedStates[o]===null)for(const m in this.state[o])c[m]={},this.state[o][m]={};else for(const m in this.deletedStates[o]){if(this.deletedStates[o][m]===null)this.state[o][m]={};else for(const g of Object.keys(this.deletedStates[o][m]))delete this.state[o][m][g];c[m]=this.state[o][m]}s[o]=s[o]||{},p.e(s[o],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const o in e)e[o].setFeatureState(s,n)}}class Ue extends p.E{constructor(e,n,s){super(),this.id=e,this.dispatcher=s,this.on("data",o=>this._dataHandler(o)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((o,c,m,g)=>{const y=new(_a(c.type))(o,c,m,g);if(y.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${y.id}`);return y})(e,n,s,this),this._tiles={},this._cache=new we(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ye,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const n=this._tiles[e];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,s){return p._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,s)}catch(o){e.state="errored",o.status!==404?this._source.fire(new p.j(o,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new p.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const s=this._tiles[n];s.upload(e),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(bi).map(e=>e.key)}getRenderableIds(e){const n=[];for(const s in this._tiles)this._isIdRenderable(s,e)&&n.push(this._tiles[s]);return e?n.sort((s,o)=>{const c=s.tileID,m=o.tileID,g=new p.P(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),y=new p.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(bi).map(s=>s.key)}hasRenderableParent(e){const n=this.findLoadedParent(e,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(e,n){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(n||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,n){return p._(this,void 0,void 0,function*(){const s=this._tiles[e];s&&(s.state!=="loading"&&(s.state=n),yield this._loadTile(s,e,n))})}_tileLoaded(e,n,s){e.timeAdded=he.now(),s==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new p.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const n=this.getRenderableIds();for(let o=0;o1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),c.dem&&o.dem&&(o.dem.backfillBorder(c.dem,m,g),o.neighboringTiles&&o.neighboringTiles[v]&&(o.neighboringTiles[v].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,n,s,o){for(const c in this._tiles){let m=this._tiles[c];if(o[c]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>s)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>n+1;){const v=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[v.key],m&&m.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),e[y.key]){o[g.key]=g;break}}}findLoadedParent(e,n){if(e.key in this._loadedParentTiles){const s=this._loadedParentTiles[e.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=e.overscaledZ-1;s>=n;s--){const o=e.scaledTo(s),c=this._getLoadedTile(o);if(c)return c}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const n=this._tiles[e.key];return n&&n.hasData()?n:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const n=Math.ceil(e.width/this._source.tileSize)+1,s=Math.ceil(e.height/this._source.tileSize)+1,o=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?p.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),c=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(c)}handleWrapJump(e){const n=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,n){const s={};for(const o in this._tiles){const c=this._tiles[o];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+n),s[c.tileID.key]=c}this._tiles=s;for(const o in this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(const o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}_updateCoveredAndRetainedTiles(e,n,s,o,c,m){const g={},y={},v=Object.keys(e),S=he.now();for(const T of v){const C=e[T],L=this._tiles[T];if(!L||L.fadeEndTime!==0&&L.fadeEndTime<=S)continue;const F=this.findLoadedParent(C,n),N=this.findLoadedSibling(C),q=F||N||null;q&&(this._addTile(q.tileID),g[q.tileID.key]=q.tileID),y[T]=C}this._retainLoadedChildren(y,o,s,e);for(const T in g)e[T]||(this._coveredTiles[T]=!0,e[T]=g[T]);if(m){const T={},C={};for(const L of c)this._tiles[L.key].hasData()?T[L.key]=L:C[L.key]=L;for(const L in C){const F=C[L].children(this._source.maxzoom);this._tiles[F[0].key]&&this._tiles[F[1].key]&&this._tiles[F[2].key]&&this._tiles[F[3].key]&&(T[F[0].key]=e[F[0].key]=F[0],T[F[1].key]=e[F[1].key]=F[1],T[F[2].key]=e[F[2].key]=F[2],T[F[3].key]=e[F[3].key]=F[3],delete C[L])}for(const L in C){const F=C[L],N=this.findLoadedParent(F,this._source.minzoom),q=this.findLoadedSibling(F),Z=N||q||null;if(Z){T[Z.tileID.key]=e[Z.tileID.key]=Z.tileID;for(const H in T)T[H].isChildOf(Z.tileID)&&delete T[H]}}for(const L in this._tiles)T[L]||(this._coveredTiles[L]=!0)}}update(e,n){if(!this._sourceLoaded||this._paused)return;let s;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(S=>new p.S(S.canonical.z,S.wrap,S.canonical.z,S.canonical.x,S.canonical.y)):(s=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(s=s.filter(S=>this._source.hasTile(S)))):s=[];const o=e.coveringZoomLevel(this._source),c=Math.max(o-Ue.maxOverzooming,this._source.minzoom),m=Math.max(o+Ue.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const S={};for(const T of s)if(T.canonical.z>this._source.minzoom){const C=T.scaledTo(T.canonical.z-1);S[C.key]=C;const L=T.scaledTo(Math.max(this._source.minzoom,Math.min(T.canonical.z,5)));S[L.key]=L}s=s.concat(Object.values(S))}const g=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new p.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(s,o);ir(this._source.type)&&this._updateCoveredAndRetainedTiles(y,c,m,o,s,n);for(const S in y)this._tiles[S].clearFadeHold();const v=p.ab(this._tiles,y);for(const S of v){const T=this._tiles[S];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.symbolFadeFinished()||this._removeTile(S)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,n){var s;const o={},c={},m=Math.max(n-Ue.maxOverzooming,this._source.minzoom),g=Math.max(n+Ue.maxUnderzooming,this._source.minzoom),y={};for(const v of e){const S=this._addTile(v);o[v.key]=v,S.hasData()||nthis._source.maxzoom){const C=v.children(this._source.maxzoom)[0],L=this.getTile(C);if(L&&L.hasData()){o[C.key]=C;continue}}else{const C=v.children(this._source.maxzoom);if(o[C[0].key]&&o[C[1].key]&&o[C[2].key]&&o[C[3].key])continue}let T=S.wasRequested();for(let C=v.overscaledZ-1;C>=m;--C){const L=v.scaledTo(C);if(c[L.key])break;if(c[L.key]=!0,S=this.getTile(L),!S&&T&&(S=this._addTile(L)),S){const F=S.hasData();if((F||!(!((s=this.map)===null||s===void 0)&&s.cancelPendingTileRequestsWhileZooming)||T)&&(o[L.key]=L),T=S.wasRequested(),F)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const n=[];let s,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){s=this._loadedParentTiles[o.key];break}n.push(o.key);const c=o.scaledTo(o.overscaledZ-1);if(s=this._getLoadedTile(c),s)break;o=c}for(const c of n)this._loadedParentTiles[c]=s}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const n=this._tiles[e].tileID,s=this._getLoadedTile(n);this._loadedSiblingTiles[n.key]=s}}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));const s=n;return n||(n=new $r(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,s||this._source.fire(new p.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(e,n){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const s=n.getExpiryTimeout();s&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},s))}_removeTile(e){const n=this._tiles[e];n&&(n.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(e){const n=e.sourceDataType;e.dataType==="source"&&n==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&n==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,s){const o=[],c=this.transform;if(!c)return o;const m=s?c.getCameraQueryGeometry(e):e,g=e.map(F=>c.pointCoordinate(F,this.terrain)),y=m.map(F=>c.pointCoordinate(F,this.terrain)),v=this.getIds();let S=1/0,T=1/0,C=-1/0,L=-1/0;for(const F of y)S=Math.min(S,F.x),T=Math.min(T,F.y),C=Math.max(C,F.x),L=Math.max(L,F.y);for(let F=0;F=0&&O[1].y+H>=0){const K=g.map(re=>q.getTilePoint(re)),Q=y.map(re=>q.getTilePoint(re));o.push({tile:N,tileID:q,queryGeometry:K,cameraQueryGeometry:Q,scale:Z})}}return o}getVisibleCoordinates(e){const n=this.getRenderableIds(e).map(s=>this._tiles[s].tileID);for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(ir(this._source.type)){const e=he.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=e)return!0}return!1}setFeatureState(e,n,s){this._state.updateState(e=e||"_geojsonTileLayer",n,s)}removeFeatureState(e,n,s){this._state.removeFeatureState(e=e||"_geojsonTileLayer",n,s)}getFeatureState(e,n){return this._state.getState(e=e||"_geojsonTileLayer",n)}setDependencies(e,n,s){const o=this._tiles[e];o&&o.setDependencies(n,s)}reloadTilesForDependencies(e,n){for(const s in this._tiles)this._tiles[s].hasDependency(e,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(e,n))}}function bi(h,e){const n=Math.abs(2*h.wrap)-+(h.wrap<0),s=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||s-n||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function ir(h){return h==="raster"||h==="image"||h==="video"}Ue.maxOverzooming=10,Ue.maxUnderzooming=3;class He{constructor(e,n){this.reset(e,n)}reset(e,n){this.points=e||[],this._distances=[0];for(let s=1;s0?(o-m)/g:0;return this.points[c].mult(1-y).add(this.points[n].mult(y))}}function br(h,e){let n=!0;return h==="always"||h!=="never"&&e!=="never"||(n=!1),n}class Er{constructor(e,n,s){const o=this.boxCells=[],c=this.circleCells=[];this.xCellCount=Math.ceil(e/s),this.yCellCount=Math.ceil(n/s);for(let m=0;mthis.width||o<0||n>this.height)return[];const y=[];if(e<=0&&n<=0&&this.width<=s&&this.height<=o){if(c)return[{key:null,x1:e,y1:n,x2:s,y2:o}];for(let v=0;v0}hitTestCircle(e,n,s,o,c){const m=e-s,g=e+s,y=n-s,v=n+s;if(g<0||m>this.width||v<0||y>this.height)return!1;const S=[];return this._forEachCell(m,y,g,v,this._queryCellCircle,S,{hitTest:!0,overlapMode:o,circle:{x:e,y:n,radius:s},seenUids:{box:{},circle:{}}},c),S.length>0}_queryCell(e,n,s,o,c,m,g,y){const{seenUids:v,hitTest:S,overlapMode:T}=g,C=this.boxCells[c];if(C!==null){const F=this.bboxes;for(const N of C)if(!v.box[N]){v.box[N]=!0;const q=4*N,Z=this.boxKeys[N];if(e<=F[q+2]&&n<=F[q+3]&&s>=F[q+0]&&o>=F[q+1]&&(!y||y(Z))&&(!S||!br(T,Z.overlapMode))&&(m.push({key:Z,x1:F[q],y1:F[q+1],x2:F[q+2],y2:F[q+3]}),S))return!0}}const L=this.circleCells[c];if(L!==null){const F=this.circles;for(const N of L)if(!v.circle[N]){v.circle[N]=!0;const q=3*N,Z=this.circleKeys[N];if(this._circleAndRectCollide(F[q],F[q+1],F[q+2],e,n,s,o)&&(!y||y(Z))&&(!S||!br(T,Z.overlapMode))){const H=F[q],O=F[q+1],K=F[q+2];if(m.push({key:Z,x1:H-K,y1:O-K,x2:H+K,y2:O+K}),S)return!0}}}return!1}_queryCellCircle(e,n,s,o,c,m,g,y){const{circle:v,seenUids:S,overlapMode:T}=g,C=this.boxCells[c];if(C!==null){const F=this.bboxes;for(const N of C)if(!S.box[N]){S.box[N]=!0;const q=4*N,Z=this.boxKeys[N];if(this._circleAndRectCollide(v.x,v.y,v.radius,F[q+0],F[q+1],F[q+2],F[q+3])&&(!y||y(Z))&&!br(T,Z.overlapMode))return m.push(!0),!0}}const L=this.circleCells[c];if(L!==null){const F=this.circles;for(const N of L)if(!S.circle[N]){S.circle[N]=!0;const q=3*N,Z=this.circleKeys[N];if(this._circlesCollide(F[q],F[q+1],F[q+2],v.x,v.y,v.radius)&&(!y||y(Z))&&!br(T,Z.overlapMode))return m.push(!0),!0}}}_forEachCell(e,n,s,o,c,m,g,y){const v=this._convertToXCellCoord(e),S=this._convertToYCellCoord(n),T=this._convertToXCellCoord(s),C=this._convertToYCellCoord(o);for(let L=v;L<=T;L++)for(let F=S;F<=C;F++)if(c.call(this,e,n,s,o,this.xCellCount*F+L,m,g,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,n,s,o,c,m){const g=o-e,y=c-n,v=s+m;return v*v>g*g+y*y}_circleAndRectCollide(e,n,s,o,c,m,g){const y=(m-o)/2,v=Math.abs(e-(o+y));if(v>y+s)return!1;const S=(g-c)/2,T=Math.abs(n-(c+S));if(T>S+s)return!1;if(v<=y||T<=S)return!0;const C=v-y,L=T-S;return C*C+L*L<=s*s}}function qr(h,e,n,s,o){const c=p.H();return e?(p.K(c,c,[1/o,1/o,1]),n||p.ad(c,c,s.angle)):p.L(c,s.labelPlaneMatrix,h),c}function vr(h,e,n,s,o){if(e){const c=p.ae(h);return p.K(c,c,[o,o,1]),n||p.ad(c,c,-s.angle),c}return s.glCoordMatrix}function U(h,e,n,s){let o;s?(o=[h,e,s(h,e),1],p.af(o,o,n)):(o=[h,e,0,1],st(o,o,n));const c=o[3];return{point:new p.P(o[0]/c,o[1]/c),signedDistanceFromCamera:c,isOccluded:!1}}function A(h,e){return .5+h/e*.5}function k(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function R(h,e,n,s,o,c,m,g,y,v,S,T,C,L,F){const N=s?h.textSizeData:h.iconSizeData,q=p.ag(N,n.transform.zoom),Z=[256/n.width*2+1,256/n.height*2+1],H=s?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;H.clear();const O=h.lineVertexArray,K=s?h.text.placedSymbolArray:h.icon.placedSymbolArray,Q=n.transform.width/n.transform.height;let re=!1;for(let de=0;deMath.abs(n.x-e.x)*s?{useVertical:!0}:(h===p.ah.vertical?e.yn.x)?{needsFlipping:!0}:null}function J(h,e,n,s,o,c,m,g,y,v,S){const T=n/24,C=e.lineOffsetX*T,L=e.lineOffsetY*T;let F;if(e.numGlyphs>1){const N=e.glyphStartIndex+e.numGlyphs,q=e.lineStartIndex,Z=e.lineStartIndex+e.lineLength,H=V(T,g,C,L,s,e,S,h);if(!H)return{notEnoughRoom:!0};const O=U(H.first.point.x,H.first.point.y,m,h.getElevation).point,K=U(H.last.point.x,H.last.point.y,m,h.getElevation).point;if(o&&!s){const Q=W(e.writingMode,O,K,v);if(Q)return Q}F=[H.first];for(let Q=e.glyphStartIndex+1;Q0?O.point:function(re,de,_e,Ie,ze,ve){return te(re,de,_e,1,ze,ve)}(h.tileAnchorPoint,H,q,0,c,h),Q=W(e.writingMode,q,K,v);if(Q)return Q}const N=xe(T*g.getoffsetX(e.glyphStartIndex),C,L,s,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,h,S);if(!N||h.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};F=[N]}for(const N of F)p.aj(y,N.point,N.angle);return{}}function te(h,e,n,s,o,c){const m=h.add(h.sub(e)._unit()),g=o!==void 0?U(m.x,m.y,o,c.getElevation).point:ce(m.x,m.y,c).point,y=n.sub(g);return n.add(y._mult(s/y.mag()))}function G(h,e,n){const s=e.projectionCache;if(s.projections[h])return s.projections[h];const o=new p.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),c=ce(o.x,o.y,e);if(c.signedDistanceFromCamera>0)return s.projections[h]=c.point,s.anyProjectionOccluded=s.anyProjectionOccluded||c.isOccluded,c.point;const m=h-n.direction;return function(g,y,v,S,T){return te(g,y,v,S,void 0,T)}(n.distanceFromAnchor===0?e.tileAnchorPoint:new p.P(e.lineVertexArray.getx(m),e.lineVertexArray.gety(m)),o,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,e)}function ce(h,e,n){const s=h+n.translation[0],o=e+n.translation[1];let c;return!n.pitchWithMap&&n.projection.useSpecialProjectionForSymbols?(c=n.projection.projectTileCoordinates(s,o,n.unwrappedTileID,n.getElevation),c.point.x=(.5*c.point.x+.5)*n.width,c.point.y=(.5*-c.point.y+.5)*n.height):(c=U(s,o,n.labelPlaneMatrix,n.getElevation),c.isOccluded=!1),c}function fe(h,e,n){return h._unit()._perp()._mult(e*n)}function ae(h,e,n,s,o,c,m,g,y){if(g.projectionCache.offsets[h])return g.projectionCache.offsets[h];const v=n.add(e);if(h+y.direction=o)return g.projectionCache.offsets[h]=v,v;const S=G(h+y.direction,g,y),T=fe(S.sub(n),m,y.direction),C=n.add(T),L=S.add(T);return g.projectionCache.offsets[h]=p.ak(c,v,C,L)||v,g.projectionCache.offsets[h]}function xe(h,e,n,s,o,c,m,g,y){const v=s?h-e:h+e;let S=v>0?1:-1,T=0;s&&(S*=-1,T=Math.PI),S<0&&(T+=Math.PI);let C,L=S>0?c+o:c+o+1;g.projectionCache.cachedAnchorPoint?C=g.projectionCache.cachedAnchorPoint:(C=ce(g.tileAnchorPoint.x,g.tileAnchorPoint.y,g).point,g.projectionCache.cachedAnchorPoint=C);let F,N,q=C,Z=C,H=0,O=0;const K=Math.abs(v),Q=[];let re;for(;H+O<=K;){if(L+=S,L=m)return null;H+=O,Z=q,N=F;const Ie={absOffsetX:K,direction:S,distanceFromAnchor:H,previousVertex:Z};if(q=G(L,g,Ie),n===0)Q.push(Z),re=q.sub(Z);else{let ze;const ve=q.sub(Z);ze=ve.mag()===0?fe(G(L+S,g,Ie).sub(q),n,S):fe(ve,n,S),N||(N=Z.add(ze)),F=ae(L,ze,q,c,m,N,n,g,Ie),Q.push(N),re=F.sub(N)}O=re.mag()}const de=re._mult((K-H)/O)._add(N||Z),_e=T+Math.atan2(q.y-Z.y,q.x-Z.x);return Q.push(de),{point:de,angle:y?_e:0,path:Q}}const Oe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function je(h,e){for(let n=0;n=1;Je--)Ae.push(Ge.path[Je]);for(let Je=1;Jert.signedDistanceFromCamera<=0)?[]:Je.map(rt=>rt.point)}let St=[];if(Ae.length>0){const Je=Ae[0].clone(),rt=Ae[0].clone();for(let Tt=1;Tt=ve.x&&rt.x<=be.x&&Je.y>=ve.y&&rt.y<=be.y?[Ae]:rt.xbe.x||rt.ybe.y?[]:p.al([Ae],ve.x,ve.y,be.x,be.y)}for(const Je of St){Le.reset(Je,.25*ze);let rt=0;rt=Le.length<=.5*ze?1:Math.ceil(Le.paddedLength/qe)+1;for(let Tt=0;TtU(o.x,o.y,s,n.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[];let s=1/0,o=1/0,c=-1/0,m=-1/0;for(const S of e){const T=new p.P(S.x+Xe,S.y+Xe);s=Math.min(s,T.x),o=Math.min(o,T.y),c=Math.max(c,T.x),m=Math.max(m,T.y),n.push(T)}const g=this.grid.query(s,o,c,m).concat(this.ignoredGrid.query(s,o,c,m)),y={},v={};for(const S of g){const T=S.key;if(y[T.bucketInstanceId]===void 0&&(y[T.bucketInstanceId]={}),y[T.bucketInstanceId][T.featureIndex])continue;const C=[new p.P(S.x1,S.y1),new p.P(S.x2,S.y1),new p.P(S.x2,S.y2),new p.P(S.x1,S.y2)];p.am(n,C)&&(y[T.bucketInstanceId][T.featureIndex]=!0,v[T.bucketInstanceId]===void 0&&(v[T.bucketInstanceId]=[]),v[T.bucketInstanceId].push(T.featureIndex))}return v}insertCollisionBox(e,n,s,o,c,m){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:o,featureIndex:c,collisionGroupID:m,overlapMode:n},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,n,s,o,c,m){const g=s?this.ignoredGrid:this.grid,y={bucketInstanceId:o,featureIndex:c,collisionGroupID:m,overlapMode:n};for(let v=0;v=this.screenRightBoundary||othis.screenBottomBoundary}isInsideGrid(e,n,s,o){return s>=0&&e=0&&nthis.projectAndGetPerspectiveRatio(s,ze.x,ze.y,o,v));_e=Ie.some(ze=>!ze.isOccluded),de=Ie.map(ze=>ze.point)}else _e=!0;return{box:p.ao(de),allPointsOccluded:!_e}}}function it(h,e,n){return e*(p.X/(h.tileSize*Math.pow(2,n-h.tileID.overscaledZ)))}class Ot{constructor(e,n,s,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?n:-n))):o&&s?1:0,this.placed=s}isHidden(){return this.opacity===0&&!this.placed}}class Mt{constructor(e,n,s,o,c){this.text=new Ot(e?e.text:null,n,s,c),this.icon=new Ot(e?e.icon:null,n,o,c)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Qe{constructor(e,n,s){this.text=e,this.icon=n,this.skipFade=s}}class pt{constructor(){this.invProjMatrix=p.H(),this.viewportMatrix=p.H(),this.circles=[]}}class Pt{constructor(e,n,s,o,c){this.bucketInstanceId=e,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=o,this.tileID=c}}class Zt{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const n=++this.maxGroupID;this.collisionGroups[e]={ID:n,predicate:s=>s.collisionGroupID===n}}return this.collisionGroups[e]}}function Kt(h,e,n,s,o){const{horizontalAlign:c,verticalAlign:m}=p.au(h);return new p.P(-(c-.5)*e+s[0]*o,-(m-.5)*n+s[1]*o)}class pi{constructor(e,n,s,o,c,m){this.transform=e.clone(),this.terrain=s,this.collisionIndex=new ot(this.transform,n),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Zt(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const n=this.terrain;return n?(s,o)=>n.getElevation(e,s,o):null}getBucketParts(e,n,s,o){const c=s.getBucket(n),m=s.latestFeatureIndex;if(!c||!m||n.id!==c.layerIds[0])return;const g=s.collisionBoxArray,y=c.layers[0].layout,v=c.layers[0].paint,S=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),T=s.tileSize/p.X,C=s.tileID.toUnwrapped(),L=this.transform.calculatePosMatrix(C),F=y.get("text-pitch-alignment")==="map",N=y.get("text-rotation-alignment")==="map",q=it(s,1,this.transform.zoom),Z=this.collisionIndex.mapProjection.translatePosition(this.transform,s,v.get("text-translate"),v.get("text-translate-anchor")),H=this.collisionIndex.mapProjection.translatePosition(this.transform,s,v.get("icon-translate"),v.get("icon-translate-anchor")),O=qr(L,F,N,this.transform,q);let K=null;if(F){const re=vr(L,F,N,this.transform,q);K=p.L([],this.transform.labelPlaneMatrix,re)}this.retainedQueryData[c.bucketInstanceId]=new Pt(c.bucketInstanceId,m,c.sourceLayerIndex,c.index,s.tileID);const Q={bucket:c,layout:y,translationText:Z,translationIcon:H,posMatrix:L,unwrappedTileID:C,textLabelPlaneMatrix:O,labelToScreenMatrix:K,scale:S,textPixelRatio:T,holdingForFade:s.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:p.ag(c.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(c.sourceID)};if(o)for(const re of c.sortKeyRanges){const{sortKey:de,symbolInstanceStart:_e,symbolInstanceEnd:Ie}=re;e.push({sortKey:de,symbolInstanceStart:_e,symbolInstanceEnd:Ie,parameters:Q})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:c.symbolInstances.length,parameters:Q})}attemptAnchorPlacement(e,n,s,o,c,m,g,y,v,S,T,C,L,F,N,q,Z,H,O){const K=p.aq[e.textAnchor],Q=[e.textOffset0,e.textOffset1],re=Kt(K,s,o,Q,c),de=this.collisionIndex.placeCollisionBox(n,C,y,v,S,g,m,q,T.predicate,O,re);if((!H||this.collisionIndex.placeCollisionBox(H,C,y,v,S,g,m,Z,T.predicate,O,re).placeable)&&de.placeable){let _e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID].text&&(_e=this.prevPlacement.variableOffsets[L.crossTileID].anchor),L.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[L.crossTileID]={textOffset:Q,width:s,height:o,anchor:K,textBoxScale:c,prevAnchor:_e},this.markUsedJustification(F,K,L,N),F.allowVerticalPlacement&&(this.markUsedOrientation(F,N,L),this.placedOrientations[L.crossTileID]=N),{shift:re,placedGlyphBoxes:de}}}placeLayerBucketPart(e,n,s){const{bucket:o,layout:c,translationText:m,translationIcon:g,posMatrix:y,unwrappedTileID:v,textLabelPlaneMatrix:S,labelToScreenMatrix:T,textPixelRatio:C,holdingForFade:L,collisionBoxArray:F,partiallyEvaluatedTextSize:N,collisionGroup:q}=e.parameters,Z=c.get("text-optional"),H=c.get("icon-optional"),O=p.ar(c,"text-overlap","text-allow-overlap"),K=O==="always",Q=p.ar(c,"icon-overlap","icon-allow-overlap"),re=Q==="always",de=c.get("text-rotation-alignment")==="map",_e=c.get("text-pitch-alignment")==="map",Ie=c.get("icon-text-fit")!=="none",ze=c.get("symbol-z-order")==="viewport-y",ve=K&&(re||!o.hasIconData()||H),be=re&&(K||!o.hasTextData()||Z);!o.collisionArrays&&F&&o.deserializeCollisionBoxes(F);const Le=this._getTerrainElevationFunc(this.retainedQueryData[o.bucketInstanceId].tileID),Ge=(Se,Ae,qe)=>{var St,Je;if(n[Se.crossTileID])return;if(L)return void(this.placements[Se.crossTileID]=new Qe(!1,!1,!1));let rt=!1,Tt=!1,ni=!0,lr=null,It={box:null,placeable:!1,offscreen:null},Si={box:null,placeable:!1,offscreen:null},fi=null,ai=null,mi=null,Ir=0,Jn=0,Ss=0;Ae.textFeatureIndex?Ir=Ae.textFeatureIndex:Se.useRuntimeCollisionCircles&&(Ir=Se.featureIndex),Ae.verticalTextFeatureIndex&&(Jn=Ae.verticalTextFeatureIndex);const Yn=Ae.textBox;if(Yn){const Ki=Jt=>{let si=p.ah.horizontal;if(o.allowVerticalPlacement&&!Jt&&this.prevPlacement){const Oi=this.prevPlacement.placedOrientations[Se.crossTileID];Oi&&(this.placedOrientations[Se.crossTileID]=Oi,si=Oi,this.markUsedOrientation(o,si,Se))}return si},Ji=(Jt,si)=>{if(o.allowVerticalPlacement&&Se.numVerticalGlyphVertices>0&&Ae.verticalTextBox){for(const Oi of o.writingModes)if(Oi===p.ah.vertical?(It=si(),Si=It):It=Jt(),It&&It.placeable)break}else It=Jt()},Hr=Se.textAnchorOffsetStartIndex,cr=Se.textAnchorOffsetEndIndex;if(cr===Hr){const Jt=(si,Oi)=>{const at=this.collisionIndex.placeCollisionBox(si,O,C,y,v,_e,de,m,q.predicate,Le);return at&&at.placeable&&(this.markUsedOrientation(o,Oi,Se),this.placedOrientations[Se.crossTileID]=Oi),at};Ji(()=>Jt(Yn,p.ah.horizontal),()=>{const si=Ae.verticalTextBox;return o.allowVerticalPlacement&&Se.numVerticalGlyphVertices>0&&si?Jt(si,p.ah.vertical):{box:null,offscreen:null}}),Ki(It&&It.placeable)}else{let Jt=p.aq[(Je=(St=this.prevPlacement)===null||St===void 0?void 0:St.variableOffsets[Se.crossTileID])===null||Je===void 0?void 0:Je.anchor];const si=(at,yn,Qn)=>{const ea=at.x2-at.x1,Bl=at.y2-at.y1,Vc=Se.textBoxScale,Fl=Ie&&Q==="never"?yn:null;let Xr=null,Ol=O==="never"?1:2,Is="never";Jt&&Ol++;for(let Ra=0;Rasi(Yn,Ae.iconBox,p.ah.horizontal),()=>{const at=Ae.verticalTextBox;return o.allowVerticalPlacement&&(!It||!It.placeable)&&Se.numVerticalGlyphVertices>0&&at?si(at,Ae.verticalIconBox,p.ah.vertical):{box:null,occluded:!0,offscreen:null}}),It&&(rt=It.placeable,ni=It.offscreen);const Oi=Ki(It&&It.placeable);if(!rt&&this.prevPlacement){const at=this.prevPlacement.variableOffsets[Se.crossTileID];at&&(this.variableOffsets[Se.crossTileID]=at,this.markUsedJustification(o,at.anchor,Se,Oi))}}}if(fi=It,rt=fi&&fi.placeable,ni=fi&&fi.offscreen,Se.useRuntimeCollisionCircles){const Ki=o.text.placedSymbolArray.get(Se.centerJustifiedTextSymbolIndex),Ji=p.ai(o.textSizeData,N,Ki),Hr=c.get("text-padding");ai=this.collisionIndex.placeCollisionCircles(O,Ki,o.lineVertexArray,o.glyphOffsetArray,Ji,y,v,S,T,s,_e,q.predicate,Se.collisionCircleDiameter,Hr,m,Le),ai.circles.length&&ai.collisionDetected&&!s&&p.w("Collisions detected, but collision boxes are not shown"),rt=K||ai.circles.length>0&&!ai.collisionDetected,ni=ni&&ai.offscreen}if(Ae.iconFeatureIndex&&(Ss=Ae.iconFeatureIndex),Ae.iconBox){const Ki=Ji=>this.collisionIndex.placeCollisionBox(Ji,Q,C,y,v,_e,de,g,q.predicate,Le,Ie&&lr?lr:void 0);Si&&Si.placeable&&Ae.verticalIconBox?(mi=Ki(Ae.verticalIconBox),Tt=mi.placeable):(mi=Ki(Ae.iconBox),Tt=mi.placeable),ni=ni&&mi.offscreen}const Wi=Z||Se.numHorizontalGlyphVertices===0&&Se.numVerticalGlyphVertices===0,Ts=H||Se.numIconVertices===0;Wi||Ts?Ts?Wi||(Tt=Tt&&rt):rt=Tt&&rt:Tt=rt=Tt&&rt;const Do=Tt&&mi.placeable;if(rt&&fi.placeable&&this.collisionIndex.insertCollisionBox(fi.box,O,c.get("text-ignore-placement"),o.bucketInstanceId,Si&&Si.placeable&&Jn?Jn:Ir,q.ID),Do&&this.collisionIndex.insertCollisionBox(mi.box,Q,c.get("icon-ignore-placement"),o.bucketInstanceId,Ss,q.ID),ai&&rt&&this.collisionIndex.insertCollisionCircles(ai.circles,O,c.get("text-ignore-placement"),o.bucketInstanceId,Ir,q.ID),s&&this.storeCollisionData(o.bucketInstanceId,qe,Ae,fi,mi,ai),Se.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(o.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Se.crossTileID]=new Qe(rt||ve,Tt||be,ni||o.justReloaded),n[Se.crossTileID]=!0};if(ze){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Se=o.getSortedSymbolIndexes(this.transform.angle);for(let Ae=Se.length-1;Ae>=0;--Ae){const qe=Se[Ae];Ge(o.symbolInstances.get(qe),o.collisionArrays[qe],qe)}}else for(let Se=e.symbolInstanceStart;Se=0&&(e.text.placedSymbolArray.get(g).crossTileID=c>=0&&g!==c?0:s.crossTileID)}markUsedOrientation(e,n,s){const o=n===p.ah.horizontal||n===p.ah.horizontalOnly?n:0,c=n===p.ah.vertical?n:0,m=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const g of m)e.text.placedSymbolArray.get(g).placedOrientation=o;s.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=c)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const o=n?n.symbolFadeChange(e):1,c=n?n.opacities:{},m=n?n.variableOffsets:{},g=n?n.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],S=c[y];S?(this.opacities[y]=new Mt(S,o,v.text,v.icon),s=s||v.text!==S.text.placed||v.icon!==S.icon.placed):(this.opacities[y]=new Mt(null,o,v.text,v.icon,v.skipFade),s=s||v.text||v.icon)}for(const y in c){const v=c[y];if(!this.opacities[y]){const S=new Mt(v,o,!1,!1);S.isHidden()||(this.opacities[y]=S,s=s||v.text.placed||v.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:e)}updateLayerOpacities(e,n){const s={};for(const o of n){const c=o.getBucket(e);c&&o.latestFeatureIndex&&e.id===c.layerIds[0]&&this.updateBucketOpacities(c,o.tileID,s,o.collisionBoxArray)}}updateBucketOpacities(e,n,s,o){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const c=e.layers[0],m=c.layout,g=new Mt(null,0,!1,!1,!0),y=m.get("text-allow-overlap"),v=m.get("icon-allow-overlap"),S=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=m.get("text-rotation-alignment")==="map",C=m.get("text-pitch-alignment")==="map",L=m.get("icon-text-fit")!=="none",F=new Mt(null,0,y&&(v||!e.hasIconData()||m.get("icon-optional")),v&&(y||!e.hasTextData()||m.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);const N=(Z,H,O)=>{for(let K=0;K0,_e=this.placedOrientations[H.crossTileID],Ie=_e===p.ah.vertical,ze=_e===p.ah.horizontal||_e===p.ah.horizontalOnly;if(O>0||K>0){const be=Ri(re.text);N(e.text,O,Ie?Cn:be),N(e.text,K,ze?Cn:be);const Le=re.text.isHidden();[H.rightJustifiedTextSymbolIndex,H.centerJustifiedTextSymbolIndex,H.leftJustifiedTextSymbolIndex].forEach(Ae=>{Ae>=0&&(e.text.placedSymbolArray.get(Ae).hidden=Le||Ie?1:0)}),H.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(H.verticalPlacedTextSymbolIndex).hidden=Le||ze?1:0);const Ge=this.variableOffsets[H.crossTileID];Ge&&this.markUsedJustification(e,Ge.anchor,H,_e);const Se=this.placedOrientations[H.crossTileID];Se&&(this.markUsedJustification(e,"left",H,Se),this.markUsedOrientation(e,Se,H))}if(de){const be=Ri(re.icon),Le=!(L&&H.verticalPlacedIconSymbolIndex&&Ie);H.placedIconSymbolIndex>=0&&(N(e.icon,H.numIconVertices,Le?be:Cn),e.icon.placedSymbolArray.get(H.placedIconSymbolIndex).hidden=re.icon.isHidden()),H.verticalPlacedIconSymbolIndex>=0&&(N(e.icon,H.numVerticalIconVertices,Le?Cn:be),e.icon.placedSymbolArray.get(H.verticalPlacedIconSymbolIndex).hidden=re.icon.isHidden())}const ve=q&&q.has(Z)?q.get(Z):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const be=e.collisionArrays[Z];if(be){let Le=new p.P(0,0);if(be.textBox||be.verticalTextBox){let Ge=!0;if(S){const Se=this.variableOffsets[Q];Se?(Le=Kt(Se.anchor,Se.width,Se.height,Se.textOffset,Se.textBoxScale),T&&Le._rotate(C?this.transform.angle:-this.transform.angle)):Ge=!1}if(be.textBox||be.verticalTextBox){let Se;be.textBox&&(Se=Ie),be.verticalTextBox&&(Se=ze),zn(e.textCollisionBox.collisionVertexArray,re.text.placed,!Ge||Se,ve.text,Le.x,Le.y)}}if(be.iconBox||be.verticalIconBox){const Ge=!!(!ze&&be.verticalIconBox);let Se;be.iconBox&&(Se=Ge),be.verticalIconBox&&(Se=!Ge),zn(e.iconCollisionBox.collisionVertexArray,re.icon.placed,Se,ve.icon,L?Le.x:0,L?Le.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const Z=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=Z.invProjMatrix,e.placementViewportMatrix=Z.viewportMatrix,e.collisionCircleArray=Z.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function zn(h,e,n,s,o,c){s&&s.length!==0||(s=[0,0,0,0]);const m=s[0]-Xe,g=s[1]-Xe,y=s[2]-Xe,v=s[3]-Xe;h.emplaceBack(e?1:0,n?1:0,o||0,c||0,m,g),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,y,g),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,y,v),h.emplaceBack(e?1:0,n?1:0,o||0,c||0,m,v)}const ft=Math.pow(2,25),$s=Math.pow(2,24),qs=Math.pow(2,17),Di=Math.pow(2,16),Li=Math.pow(2,9),fc=Math.pow(2,8),Zi=Math.pow(2,1);function Ri(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,n=Math.floor(127*h.opacity);return n*ft+e*$s+n*qs+e*Di+n*Li+e*fc+n*Zi+e}const Cn=0;function sn(){return{isOccluded:(h,e,n)=>!1,getPitchedTextCorrection:(h,e,n)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(h,e,n,s){throw new Error("Not implemented.")},translatePosition:(h,e,n,s)=>function(o,c,m,g,y=!1){if(!m[0]&&!m[1])return[0,0];const v=y?g==="map"?o.angle:0:g==="viewport"?-o.angle:0;if(v){const S=Math.sin(v),T=Math.cos(v);m=[m[0]*T-m[1]*S,m[0]*S+m[1]*T]}return[y?m[0]:it(c,m[0],o.zoom),y?m[1]:it(c,m[1],o.zoom)]}(h,e,n,s),getCircleRadiusCorrection:h=>1}}class jt{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,n,s,o,c){const m=this._bucketParts;for(;this._currentTileIndexg.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&he.now()-o>2;for(;this._currentPlacementIndex>=0;){const m=n[e[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new jt(m)),this._inProgressLayer.continuePlacement(s[m.source],this.placement,this._showCollisionBoxes,m,c))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const rr=512/p.X/2;class Bt{constructor(e,n,s){this.tileID=e,this.bucketInstanceId=s,this._symbolsByKey={};const o=new Map;for(let c=0;c({x:Math.floor(y.anchorX*rr),y:Math.floor(y.anchorY*rr)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new p.av(g.positions.length,16,Uint16Array);for(const{x:v,y:S}of g.positions)y.add(v,S);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[c]=g}}getScaledCoordinates(e,n){const{x:s,y:o,z:c}=this.tileID.canonical,{x:m,y:g,z:y}=n.canonical,v=rr/Math.pow(2,y-c),S=(g*p.X+e.anchorY)*v,T=o*p.X*rr;return{x:Math.floor((m*p.X+e.anchorX)*v-s*p.X*rr),y:Math.floor(S-T)}}findMatches(e,n,s){const o=this.tileID.canonical.ze)}}class Ga{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class nr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const n=Math.round((e-this.lng)/360);if(n!==0)for(const s in this.indexes){const o=this.indexes[s],c={};for(const m in o){const g=o[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+n),c[g.tileID.key]=g}this.indexes[s]=c}this.lng=e}addBucket(e,n,s){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let c=0;ce.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(e)&&y.findMatches(n.symbolInstances,e,o)}else{const g=m[e.scaledTo(Number(c)).key];g&&g.findMatches(n.symbolInstances,e,o)}}for(let c=0;c{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const ar=(h,e)=>p.t(h,e&&e.filter(n=>n.identifier!=="source.canvas")),mc=p.aw();class Ha extends p.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(const s in this.sourceCaches){const o=this.sourceCaches[s].getSource().type;o!=="vector"&&o!=="geojson"||this.sourceCaches[s].reload()}},this.map=e,this.dispatcher=new nn(rn(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(s,o)=>this.getGlyphs(s,o)),this.dispatcher.registerMessageHandler("GI",(s,o)=>this.getImages(s,o)),this.imageManager=new ii,this.imageManager.setEventedParent(this),this.glyphManager=new _r(e._requestManager,n.localIdeographFontFamily),this.lineAtlas=new In(256,512),this.crossTileSymbolIndex=new Zs,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new p.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",p.ay()),xr().on(ge,this._rtlPluginLoaded),this.on("data",s=>{if(s.dataType!=="source"||s.sourceDataType!=="metadata")return;const o=this.sourceCaches[s.sourceId];if(!o)return;const c=o.getSource();if(c&&c.vectorLayerIds)for(const m in this._layers){const g=this._layers[m];g.source===c.id&&this._validateLayer(g)}})}loadURL(e,n={},s){this.fire(new p.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const o=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const c=this._loadStyleRequest;p.h(o,this._loadStyleRequest).then(m=>{this._loadStyleRequest=null,this._load(m.data,n,s)}).catch(m=>{this._loadStyleRequest=null,m&&!c.signal.aborted&&this.fire(new p.j(m))})}loadJSON(e,n={},s){this.fire(new p.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,he.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(e,n,s)}).catch(()=>{})}loadEmpty(){this.fire(new p.k("dataloading",{dataType:"style"})),this._load(mc,{validate:!1})}_load(e,n,s){var o;const c=n.transformStyle?n.transformStyle(s,e):e;if(!n.validate||!ar(this,p.u(c))){this._loaded=!0,this.stylesheet=c;for(const m in c.sources)this.addSource(m,c.sources[m],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs),this._createLayers(),this.light=new zr(this.stylesheet.light),this.sky=new er(this.stylesheet.sky),this.map.setTerrain((o=this.stylesheet.terrain)!==null&&o!==void 0?o:null),this.fire(new p.k("data",{dataType:"style"})),this.fire(new p.k("style.load"))}}_createLayers(){const e=p.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of e){const s=p.aA(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(e,n=!1,s=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(c,m,g,y){return p._(this,void 0,void 0,function*(){const v=mr(c),S=g>1?"@2x":"",T={},C={};for(const{id:L,url:F}of v){const N=m.transformRequest(ua(F,S,".json"),"SpriteJSON");T[L]=p.h(N,y);const q=m.transformRequest(ua(F,S,".png"),"SpriteImage");C[L]=zt.getImage(q,y)}return yield Promise.all([...Object.values(T),...Object.values(C)]),function(L,F){return p._(this,void 0,void 0,function*(){const N={};for(const q in L){N[q]={};const Z=he.getImageCanvasContext((yield F[q]).data),H=(yield L[q]).data;for(const O in H){const{width:K,height:Q,x:re,y:de,sdf:_e,pixelRatio:Ie,stretchX:ze,stretchY:ve,content:be,textFitWidth:Le,textFitHeight:Ge}=H[O];N[q][O]={data:null,pixelRatio:Ie,sdf:_e,stretchX:ze,stretchY:ve,content:be,textFitWidth:Le,textFitHeight:Ge,spriteData:{width:K,height:Q,x:re,y:de,context:Z}}}}return N})}(T,C)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(c=>{if(this._spriteRequest=null,c)for(const m in c){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in c)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in c[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,c[m][y],!1):this.imageManager.addImage(v,c[m][y]),n&&(this._changedImages[v]=!0)}}}).catch(c=>{this._spriteRequest=null,o=c,this.fire(new p.j(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"})),s&&s(o)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}_validateLayer(e){const n=this.sourceCaches[e.source];if(!n)return;const s=e.sourceLayer;if(!s)return;const o=n.getSource();(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(s)===-1)&&this.fire(new p.j(new Error(`Source layer "${s}" does not exist on source "${o.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){const s=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?p.aB(s):s);const o=[];for(const c of e)if(s[c]){const m=n?p.aB(s[c]):s[c];o.push(m)}return o}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const o=this._layers[s];o.type!=="custom"&&(e[s]=o.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const n=this._changed;if(n){const o=Object.keys(this._updatedLayers),c=Object.keys(this._removedLayers);(o.length||c.length)&&this._updateWorkerLayers(o,c);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const s={};for(const o in this.sourceCaches){const c=this.sourceCaches[o];s[o]=c.used,c.used=!1}for(const o of this._order){const c=this._layers[o];c.recalculate(e,this._availableImages),!c.isHidden(e.zoom)&&c.source&&(this.sourceCaches[c.source].used=!0)}for(const o in s){const c=this.sourceCaches[o];!!s[o]!=!!c.used&&c.fire(new p.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,n&&this.fire(new p.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var s;this._checkLoaded();const o=this.serialize();if(e=n.transformStyle?n.transformStyle(o,e):e,((s=n.validate)===null||s===void 0||s)&&ar(this,p.u(e)))return!1;(e=p.aB(e)).layers=p.az(e.layers);const c=p.aC(o,e),m=this._getOperationsToPerform(c);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(const g of m.operations)g();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const n=[],s=[];for(const o of e)switch(o.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,o.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,o.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,o.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,o.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,o.args));break;case"addSource":n.push(()=>this.addSource.apply(this,o.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,o.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,o.args));break;case"setLight":n.push(()=>this.setLight.apply(this,o.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,o.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,o.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,o.args));break;case"setSky":n.push(()=>this.setSky.apply(this,o.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,o.args));break;case"setTransition":n.push(()=>{});break;default:s.push(o.command)}return{operations:n,unimplemented:s}}addImage(e,n){if(this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,n){this.imageManager.updateImage(e,n)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new p.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,s={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(p.u.source,`sources.${e}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const o=this.sourceCaches[e]=new Ue(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:e})),o.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===e)return this.fire(new p.j(new Error(`Source "${e}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new p.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,n){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const s=this.sourceCaches[e].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,s={}){this._checkLoaded();const o=e.id;if(this.getLayer(o))return void this.fire(new p.j(new Error(`Layer "${o}" already exists on this map.`)));let c;if(e.type==="custom"){if(ar(this,p.aD(e)))return;c=p.aA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(o,e.source),e=p.aB(e),e=p.e(e,{source:o})),this._validate(p.u.layer,`layers.${o}`,e,{arrayIndex:-1},s))return;c=p.aA(e),this._validateLayer(c),c.setEventedParent(this,{layer:{id:o}})}const m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new p.j(new Error(`Cannot add layer "${o}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,o),this._layerOrderChanged=!0,this._layers[o]=c,this._removedLayers[o]&&c.source&&c.type!=="custom"){const g=this._removedLayers[o];delete this._removedLayers[o],g.type!==c.type?this._updatedSources[c.source]="clear":(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause())}this._updateLayer(c),c.onAdd&&c.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new p.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;const s=this._order.indexOf(e);this._order.splice(s,1);const o=n?this._order.indexOf(n):this._order.length;n&&o===-1?this.fire(new p.j(new Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const n=this._layers[e];if(!n)return void this.fire(new p.j(new Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);const s=this._order.indexOf(e);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,s){this._checkLoaded();const o=this.getLayer(e);o?o.minzoom===n&&o.maxzoom===s||(n!=null&&(o.minzoom=n),s!=null&&(o.maxzoom=s),this._updateLayer(o)):this.fire(new p.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,s={}){this._checkLoaded();const o=this.getLayer(e);if(o){if(!p.aE(o.filter,n))return n==null?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(p.u.filter,`layers.${o.id}.filter`,n,null,s)||(o.filter=p.aB(n),this._updateLayer(o)))}else this.fire(new p.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return p.aB(this.getLayer(e).filter)}setLayoutProperty(e,n,s,o={}){this._checkLoaded();const c=this.getLayer(e);c?p.aE(c.getLayoutProperty(n),s)||(c.setLayoutProperty(n,s,o),this._updateLayer(c)):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){const s=this.getLayer(e);if(s)return s.getLayoutProperty(n);this.fire(new p.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,s,o={}){this._checkLoaded();const c=this.getLayer(e);c?p.aE(c.getPaintProperty(n),s)||(c.setPaintProperty(n,s,o)&&this._updateLayer(c),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new p.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,n){return this.getLayer(e).getPaintProperty(n)}setFeatureState(e,n){this._checkLoaded();const s=e.source,o=e.sourceLayer,c=this.sourceCaches[s];if(c===void 0)return void this.fire(new p.j(new Error(`The source '${s}' does not exist in the map's style.`)));const m=c.getSource().type;m==="geojson"&&o?this.fire(new p.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||o?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),c.setFeatureState(o,e.id,n)):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,n){this._checkLoaded();const s=e.source,o=this.sourceCaches[s];if(o===void 0)return void this.fire(new p.j(new Error(`The source '${s}' does not exist in the map's style.`)));const c=o.getSource().type,m=c==="vector"?e.sourceLayer:void 0;c!=="vector"||m?n&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new p.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(m,e.id,n):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const n=e.source,s=e.sourceLayer,o=this.sourceCaches[n];if(o!==void 0)return o.getSource().type!=="vector"||s?(e.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(s,e.id)):void this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new p.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return p.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=p.aF(this.sourceCaches,c=>c.serialize()),n=this._serializeByIds(this._order,!0),s=this.map.getTerrain()||void 0,o=this.stylesheet;return p.aG({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:e,layers:n,terrain:s},c=>c!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const n=m=>this._layers[m].type==="fill-extrusion",s={},o=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g)){s[g]=m;for(const y of e){const v=y[g];if(v)for(const S of v)o.push(S)}}}o.sort((m,g)=>g.intersectionZ-m.intersectionZ);const c=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(n(g))for(let y=o.length-1;y>=0;y--){const v=o[y].feature;if(s[v.layer.id]{const _e=Z.featureSortOrder;if(_e){const Ie=_e.indexOf(re.featureIndex);return _e.indexOf(de.featureIndex)-Ie}return de.featureIndex-re.featureIndex});for(const re of Q)K.push(re)}}for(const Z in F)F[Z].forEach(H=>{const O=H.feature,K=v[g[Z].source].getFeatureState(O.layer["source-layer"],O.id);O.source=O.layer.source,O.layer["source-layer"]&&(O.sourceLayer=O.layer["source-layer"]),O.state=K});return F}(this._layers,m,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)}querySourceFeatures(e,n){n&&n.filter&&this._validate(p.u.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[e];return s?function(o,c){const m=o.getRenderableIds().map(v=>o.getTileByID(v)),g=[],y={};for(let v=0;vC.getTileByID(L)).sort((L,F)=>F.tileID.overscaledZ-L.tileID.overscaledZ||(L.tileID.isLessThan(F.tileID)?-1:1))}const T=this.crossTileSymbolIndex.addLayer(S,y[S.source],e.center.lng);m=m||T}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((c=c||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(he.now(),e.zoom))&&(this.pauseablePlacement=new ga(e,this.map.terrain,this._order,c,n,s,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(he.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const v of this._order){const S=this._layers[v];S.type==="symbol"&&this.placement.updateLayerOpacities(S,y[S.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(he.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return p._(this,void 0,void 0,function*(){const s=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,n.icons),s})}getGlyphs(e,n){return p._(this,void 0,void 0,function*(){const s=yield this.glyphManager.getGlyphs(n.stacks),o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,[""]),s})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(p.u.glyphs,"glyphs",e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,n,s={},o){this._checkLoaded();const c=[{id:e,url:n}],m=[...mr(this.stylesheet.sprite),...c];this._validate(p.u.sprite,"sprite",m,null,s)||(this.stylesheet.sprite=m,this._loadSprite(c,!0,o))}removeSprite(e){this._checkLoaded();const n=mr(this.stylesheet.sprite);if(n.find(s=>s.id===e)){if(this._spritesImagesIds[e])for(const s of this._spritesImagesIds[e])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex(s=>s.id===e),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}else this.fire(new p.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return mr(this.stylesheet.sprite)}setSprite(e,n={},s){this._checkLoaded(),e&&this._validate(p.u.sprite,"sprite",e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,s):(this._unloadSprite(),s&&s(null)))}}var on=p.Y([{name:"a_pos",type:"Int16",components:2}]);const Zr={prelude:ut(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +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 +);}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;} +#ifdef TERRAIN3D +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; +#endif +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) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +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; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +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; +#else +return 0.0; +#endif +}`),background:ut(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ut(`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;varying vec2 v_pos_a;varying 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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;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;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);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:ut(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +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));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);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:ut("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ut(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:ut(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying 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:ut("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}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:ut("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);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);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;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;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ut("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ut(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ut(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ut(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +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=texture2D(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=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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=u_matrix*vec4(a_pos,0,1);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;}`),fillPattern:ut(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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=u_matrix*vec4(a_pos,0,1);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:ut(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);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;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);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:ut(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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=texture2D(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=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;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 vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*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:ut(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;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))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:ut(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +#define PI 3.141592653589793 +void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;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_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ut(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:ut(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:ut(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ut(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:ut(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying 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=texture2D(u_image0,v_pos0);vec4 color1=texture2D(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ut(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +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);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +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;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;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ut(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +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 fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +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;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +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;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ut(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +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;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +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);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +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;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;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:ut("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;varying vec2 v_texture_pos;varying 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=texture2D(u_texture,v_texture_pos);if (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);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ut("varying 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() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ut("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ut("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ut(h,e){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=e.match(/attribute ([\w]+) ([\w]+)/g),o=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),c=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=c?c.concat(o):o,g={};return{fragmentSource:h=h.replace(n,(y,v,S,T,C)=>(g[C]=!0,v==="define"?` +#ifndef HAS_UNIFORM_u_${C} +varying ${S} ${T} ${C}; +#else +uniform ${S} ${T} u_${C}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${C} + ${S} ${T} ${C} = u_${C}; +#endif +`)),vertexSource:e=e.replace(n,(y,v,S,T,C)=>{const L=T==="float"?"vec2":"vec4",F=C.match(/color/)?"color":L;return g[C]?v==="define"?` +#ifndef HAS_UNIFORM_u_${C} +uniform lowp float u_${C}_t; +attribute ${S} ${L} a_${C}; +varying ${S} ${T} ${C}; +#else +uniform ${S} ${T} u_${C}; +#endif +`:F==="vec4"?` +#ifndef HAS_UNIFORM_u_${C} + ${C} = a_${C}; +#else + ${S} ${T} ${C} = u_${C}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${C} + ${C} = unpack_mix_${F}(a_${C}, u_${C}_t); +#else + ${S} ${T} ${C} = u_${C}; +#endif +`:v==="define"?` +#ifndef HAS_UNIFORM_u_${C} +uniform lowp float u_${C}_t; +attribute ${S} ${L} a_${C}; +#else +uniform ${S} ${T} u_${C}; +#endif +`:F==="vec4"?` +#ifndef HAS_UNIFORM_u_${C} + ${S} ${T} ${C} = a_${C}; +#else + ${S} ${T} ${C} = u_${C}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${C} + ${S} ${T} ${C} = unpack_mix_${F}(a_${C}, u_${C}_t); +#else + ${S} ${T} ${C} = u_${C}; +#endif +`}),staticAttributes:s,staticUniforms:m}}class Gs{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,n,s,o,c,m,g,y,v){this.context=e;let S=this.boundPaintVertexBuffers.length!==o.length;for(let T=0;!S&&T({u_matrix:h,u_texture:0,u_ele_delta:e,u_fog_matrix:n,u_fog_color:s?s.properties.get("fog-color"):p.aM.white,u_fog_ground_blend:s?s.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:s?s.calculateFogBlendOpacity(o):0,u_horizon_color:s?s.properties.get("horizon-color"):p.aM.white,u_horizon_fog_blend:s?s.properties.get("horizon-fog-blend"):1});function Mn(h){const e=[];for(let n=0;n({u_depth:new p.aH(re,de.u_depth),u_terrain:new p.aH(re,de.u_terrain),u_terrain_dim:new p.aI(re,de.u_terrain_dim),u_terrain_matrix:new p.aJ(re,de.u_terrain_matrix),u_terrain_unpack:new p.aK(re,de.u_terrain_unpack),u_terrain_exaggeration:new p.aI(re,de.u_terrain_exaggeration)}))(e,Q),this.binderUniforms=s?s.getUniforms(e,Q):[]}draw(e,n,s,o,c,m,g,y,v,S,T,C,L,F,N,q,Z,H){const O=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(s),e.setStencilMode(o),e.setColorMode(c),e.setCullFace(m),y){e.activeTexture.set(O.TEXTURE2),O.bindTexture(O.TEXTURE_2D,y.depthTexture),e.activeTexture.set(O.TEXTURE3),O.bindTexture(O.TEXTURE_2D,y.texture);for(const Q in this.terrainUniforms)this.terrainUniforms[Q].set(y[Q])}for(const Q in this.fixedUniforms)this.fixedUniforms[Q].set(g[Q]);N&&N.setUniforms(e,this.binderUniforms,L,{zoom:F});let K=0;switch(n){case O.LINES:K=2;break;case O.TRIANGLES:K=3;break;case O.LINE_STRIP:K=1}for(const Q of C.get()){const re=Q.vaos||(Q.vaos={});(re[v]||(re[v]=new Gs)).bind(e,this,S,N?N.getPaintVertexBuffers():[],T,Q.vertexOffset,q,Z,H),O.drawElements(n,Q.primitiveLength*K,O.UNSIGNED_SHORT,Q.primitiveOffset*K*2)}}}function Xa(h,e,n){const s=1/it(n,1,e.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,e.transform.tileZoom)/o,m=c*(n.tileID.canonical.x+n.tileID.wrap*o),g=c*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[m>>16,g>>16],u_pixel_coord_lower:[65535&m,65535&g]}}const ya=(h,e,n,s)=>{const o=e.style.light,c=o.properties.get("position"),m=[c.x,c.y,c.z],g=function(){var v=new p.A(9);return p.A!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}();o.properties.get("anchor")==="viewport"&&function(v,S){var T=Math.sin(S),C=Math.cos(S);v[0]=C,v[1]=T,v[2]=0,v[3]=-T,v[4]=C,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(g,-e.transform.angle),function(v,S,T){var C=S[0],L=S[1],F=S[2];v[0]=C*T[0]+L*T[3]+F*T[6],v[1]=C*T[1]+L*T[4]+F*T[7],v[2]=C*T[2]+L*T[5]+F*T[8]}(m,m,g);const y=o.properties.get("color");return{u_matrix:h,u_lightpos:m,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:s}},Wa=(h,e,n,s,o,c,m)=>p.e(ya(h,e,n,s),Xa(c,e,m),{u_height_factor:-Math.pow(2,o.overscaledZ)/m.tileSize/8}),En=h=>({u_matrix:h}),rl=(h,e,n,s)=>p.e(En(h),Xa(n,e,s)),_c=(h,e)=>({u_matrix:h,u_world:e}),nl=(h,e,n,s,o)=>p.e(rl(h,e,n,s),{u_world:o}),gc=(h,e,n,s)=>{const o=h.transform;let c,m;if(s.paint.get("circle-pitch-alignment")==="map"){const g=it(n,1,o.zoom);c=!0,m=[g,g]}else c=!1,m=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(e.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+c,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:m}},ln=(h,e,n)=>({u_matrix:h,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),xa=(h,e,n=1)=>({u_matrix:h,u_color:e,u_overlay:0,u_overlay_scale:n}),vi=h=>({u_matrix:h}),wi=(h,e,n,s)=>({u_matrix:h,u_extrude_scale:it(e,1,n),u_intensity:s}),Ka=(h,e,n,s)=>{const o=p.H();p.aP(o,0,h.width,h.height,0,0,1);const c=h.context.gl;return{u_matrix:o,u_world:[c.drawingBufferWidth,c.drawingBufferHeight],u_image:n,u_color_ramp:s,u_opacity:e.paint.get("heatmap-opacity")}};function Ja(h,e){const n=Math.pow(2,e.canonical.z),s=e.canonical.y;return[new p.Z(0,s/n).toLngLat().lat,new p.Z(0,(s+1)/n).toLngLat().lat]}const Ya=(h,e,n,s)=>{const o=h.transform;return{u_matrix:ol(h,e,n,s),u_ratio:1/it(e,1,o.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},al=(h,e,n,s,o)=>p.e(Ya(h,e,n,o),{u_image:0,u_image_height:s}),Dn=(h,e,n,s,o)=>{const c=h.transform,m=sl(e,c);return{u_matrix:ol(h,e,n,o),u_texsize:e.imageAtlasTexture.size,u_ratio:1/it(e,1,c.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[m,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},yc=(h,e,n,s,o,c)=>{const m=h.lineAtlas,g=sl(e,h.transform),y=n.layout.get("line-cap")==="round",v=m.getDash(s.from,y),S=m.getDash(s.to,y),T=v.width*o.fromScale,C=S.width*o.toScale;return p.e(Ya(h,e,n,c),{u_patternscale_a:[g/T,-v.height/2],u_patternscale_b:[g/C,-S.height/2],u_sdfgamma:m.width/(256*Math.min(T,C)*h.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:S.y,u_mix:o.t})};function sl(h,e){return 1/it(h,1,e.tileZoom)}function ol(h,e,n,s){return h.translatePosMatrix(s?s.posMatrix:e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const xc=(h,e,n,s,o)=>{return{u_matrix:h,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(m=o.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(c=o.paint.get("raster-contrast"),c>0?1/(1-c):1+c),u_spin_weights:bc(o.paint.get("raster-hue-rotate"))};var c,m};function bc(h){h*=Math.PI/180;const e=Math.sin(h),n=Math.cos(h);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}const ll=(h,e,n,s,o,c,m,g,y,v,S,T,C,L)=>{const F=m.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:F.cameraToCenterDistance,u_pitch:F.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:F.width/F.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:g,u_label_plane_matrix:y,u_coord_matrix:v,u_is_text:+T,u_pitch_with_map:+s,u_is_along_line:o,u_is_variable_anchor:c,u_texsize:C,u_texture:0,u_translation:S,u_pitched_scale:L}},ba=(h,e,n,s,o,c,m,g,y,v,S,T,C,L,F)=>{const N=m.transform;return p.e(ll(h,e,n,s,o,c,m,g,y,v,S,T,C,F),{u_gamma_scale:s?Math.cos(N._pitch)*N.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+L})},Ws=(h,e,n,s,o,c,m,g,y,v,S,T,C,L)=>p.e(ba(h,e,n,s,o,c,m,g,y,v,S,!0,T,!0,L),{u_texsize_icon:C,u_texture_icon:1}),Qa=(h,e,n)=>({u_matrix:h,u_opacity:e,u_color:n}),Ks=(h,e,n,s,o,c)=>p.e(function(m,g,y,v){const S=y.imageManager.getPattern(m.from.toString()),T=y.imageManager.getPattern(m.to.toString()),{width:C,height:L}=y.imageManager.getPixelSize(),F=Math.pow(2,v.tileID.overscaledZ),N=v.tileSize*Math.pow(2,y.transform.tileZoom)/F,q=N*(v.tileID.canonical.x+v.tileID.wrap*F),Z=N*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:T.tl,u_pattern_br_b:T.br,u_texsize:[C,L],u_mix:g.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:T.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/it(v,1,y.transform.tileZoom),u_pixel_coord_upper:[q>>16,Z>>16],u_pixel_coord_lower:[65535&q,65535&Z]}}(s,c,n,o),{u_matrix:h,u_opacity:e}),Js={fillExtrusion:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_opacity:new p.aI(h,e.u_opacity)}),fillExtrusionPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_lightpos:new p.aN(h,e.u_lightpos),u_lightintensity:new p.aI(h,e.u_lightintensity),u_lightcolor:new p.aN(h,e.u_lightcolor),u_vertical_gradient:new p.aI(h,e.u_vertical_gradient),u_height_factor:new p.aI(h,e.u_height_factor),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade),u_opacity:new p.aI(h,e.u_opacity)}),fill:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),fillPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),fillOutline:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world)}),fillOutlinePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_texsize:new p.aO(h,e.u_texsize),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),circle:(h,e)=>({u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_scale_with_map:new p.aH(h,e.u_scale_with_map),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_extrude_scale:new p.aO(h,e.u_extrude_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_matrix:new p.aJ(h,e.u_matrix)}),collisionBox:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_pixel_extrude_scale:new p.aO(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_inv_matrix:new p.aJ(h,e.u_inv_matrix),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_viewport_size:new p.aO(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new p.aL(h,e.u_color),u_matrix:new p.aJ(h,e.u_matrix),u_overlay:new p.aH(h,e.u_overlay),u_overlay_scale:new p.aI(h,e.u_overlay_scale)}),clippingMask:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix)}),heatmap:(h,e)=>({u_extrude_scale:new p.aI(h,e.u_extrude_scale),u_intensity:new p.aI(h,e.u_intensity),u_matrix:new p.aJ(h,e.u_matrix)}),heatmapTexture:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_world:new p.aO(h,e.u_world),u_image:new p.aH(h,e.u_image),u_color_ramp:new p.aH(h,e.u_color_ramp),u_opacity:new p.aI(h,e.u_opacity)}),hillshade:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_latrange:new p.aO(h,e.u_latrange),u_light:new p.aO(h,e.u_light),u_shadow:new p.aL(h,e.u_shadow),u_highlight:new p.aL(h,e.u_highlight),u_accent:new p.aL(h,e.u_accent)}),hillshadePrepare:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_image:new p.aH(h,e.u_image),u_dimension:new p.aO(h,e.u_dimension),u_zoom:new p.aI(h,e.u_zoom),u_unpack:new p.aK(h,e.u_unpack)}),line:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_image:new p.aH(h,e.u_image),u_image_height:new p.aI(h,e.u_image_height)}),linePattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texsize:new p.aO(h,e.u_texsize),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_image:new p.aH(h,e.u_image),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_scale:new p.aN(h,e.u_scale),u_fade:new p.aI(h,e.u_fade)}),lineSDF:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ratio:new p.aI(h,e.u_ratio),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_units_to_pixels:new p.aO(h,e.u_units_to_pixels),u_patternscale_a:new p.aO(h,e.u_patternscale_a),u_patternscale_b:new p.aO(h,e.u_patternscale_b),u_sdfgamma:new p.aI(h,e.u_sdfgamma),u_image:new p.aH(h,e.u_image),u_tex_y_a:new p.aI(h,e.u_tex_y_a),u_tex_y_b:new p.aI(h,e.u_tex_y_b),u_mix:new p.aI(h,e.u_mix)}),raster:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_tl_parent:new p.aO(h,e.u_tl_parent),u_scale_parent:new p.aI(h,e.u_scale_parent),u_buffer_scale:new p.aI(h,e.u_buffer_scale),u_fade_t:new p.aI(h,e.u_fade_t),u_opacity:new p.aI(h,e.u_opacity),u_image0:new p.aH(h,e.u_image0),u_image1:new p.aH(h,e.u_image1),u_brightness_low:new p.aI(h,e.u_brightness_low),u_brightness_high:new p.aI(h,e.u_brightness_high),u_saturation_factor:new p.aI(h,e.u_saturation_factor),u_contrast_factor:new p.aI(h,e.u_contrast_factor),u_spin_weights:new p.aN(h,e.u_spin_weights)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texture:new p.aH(h,e.u_texture),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new p.aH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aH(h,e.u_is_size_feature_constant),u_size_t:new p.aI(h,e.u_size_t),u_size:new p.aI(h,e.u_size),u_camera_to_center_distance:new p.aI(h,e.u_camera_to_center_distance),u_pitch:new p.aI(h,e.u_pitch),u_rotate_symbol:new p.aH(h,e.u_rotate_symbol),u_aspect_ratio:new p.aI(h,e.u_aspect_ratio),u_fade_change:new p.aI(h,e.u_fade_change),u_matrix:new p.aJ(h,e.u_matrix),u_label_plane_matrix:new p.aJ(h,e.u_label_plane_matrix),u_coord_matrix:new p.aJ(h,e.u_coord_matrix),u_is_text:new p.aH(h,e.u_is_text),u_pitch_with_map:new p.aH(h,e.u_pitch_with_map),u_is_along_line:new p.aH(h,e.u_is_along_line),u_is_variable_anchor:new p.aH(h,e.u_is_variable_anchor),u_texsize:new p.aO(h,e.u_texsize),u_texsize_icon:new p.aO(h,e.u_texsize_icon),u_texture:new p.aH(h,e.u_texture),u_texture_icon:new p.aH(h,e.u_texture_icon),u_gamma_scale:new p.aI(h,e.u_gamma_scale),u_device_pixel_ratio:new p.aI(h,e.u_device_pixel_ratio),u_is_halo:new p.aH(h,e.u_is_halo),u_translation:new p.aO(h,e.u_translation),u_pitched_scale:new p.aI(h,e.u_pitched_scale)}),background:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_color:new p.aL(h,e.u_color)}),backgroundPattern:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_opacity:new p.aI(h,e.u_opacity),u_image:new p.aH(h,e.u_image),u_pattern_tl_a:new p.aO(h,e.u_pattern_tl_a),u_pattern_br_a:new p.aO(h,e.u_pattern_br_a),u_pattern_tl_b:new p.aO(h,e.u_pattern_tl_b),u_pattern_br_b:new p.aO(h,e.u_pattern_br_b),u_texsize:new p.aO(h,e.u_texsize),u_mix:new p.aI(h,e.u_mix),u_pattern_size_a:new p.aO(h,e.u_pattern_size_a),u_pattern_size_b:new p.aO(h,e.u_pattern_size_b),u_scale_a:new p.aI(h,e.u_scale_a),u_scale_b:new p.aI(h,e.u_scale_b),u_pixel_coord_upper:new p.aO(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new p.aO(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new p.aI(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_ele_delta:new p.aI(h,e.u_ele_delta),u_fog_matrix:new p.aJ(h,e.u_fog_matrix),u_fog_color:new p.aL(h,e.u_fog_color),u_fog_ground_blend:new p.aI(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new p.aI(h,e.u_fog_ground_blend_opacity),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon_fog_blend:new p.aI(h,e.u_horizon_fog_blend)}),terrainDepth:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_ele_delta:new p.aI(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_matrix:new p.aJ(h,e.u_matrix),u_texture:new p.aH(h,e.u_texture),u_terrain_coords_id:new p.aI(h,e.u_terrain_coords_id),u_ele_delta:new p.aI(h,e.u_ele_delta)}),sky:(h,e)=>({u_sky_color:new p.aL(h,e.u_sky_color),u_horizon_color:new p.aL(h,e.u_horizon_color),u_horizon:new p.aI(h,e.u_horizon),u_sky_horizon_blend:new p.aI(h,e.u_sky_horizon_blend)})};class wr{constructor(e,n,s){this.context=e;const o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const vc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ys{constructor(e,n,s,o){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=o,this.context=e;const c=e.gl;this.buffer=c.createBuffer(),e.bindVertexBuffer.set(this.buffer),c.bufferData(c.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,n){for(let s=0;s0){const re=p.H();p.aQ(re,O.placementInvProjMatrix,h.transform.glCoordMatrix),p.aQ(re,re,O.placementViewportMatrix),y.push({circleArray:Q,circleOffset:S,transform:H.posMatrix,invTransform:re,coord:H}),v+=Q.length/4,S=v}K&&g.draw(c,m.LINES,et.disabled,bt.disabled,h.colorModeForRenderPass(),_t.disabled,{u_matrix:H.posMatrix,u_pixel_extrude_scale:[1/(T=h.transform).width,1/T.height]},h.style.map.terrain&&h.style.map.terrain.getTerrainData(H),n.id,K.layoutVertexBuffer,K.indexBuffer,K.segments,null,h.transform.zoom,null,null,K.collisionVertexBuffer)}var T;if(!o||!y.length)return;const C=h.useProgram("collisionCircle"),L=new p.aR;L.resize(4*v),L._trim();let F=0;for(const Z of y)for(let H=0;H=0&&(Z[O.associatedIconIndex]={shiftedAnchor:qe,angle:St})}else je(O.numGlyphs,N)}if(v){q.clear();const H=h.icon.placedSymbolArray;for(let O=0;Oh.style.map.terrain.getElevation(ve,Qn,ea):null,yn=n.layout.get("text-rotation-alignment")==="map";R(Le,ve.posMatrix,h,o,Jn,Yn,Z,v,yn,N,ve.toUnwrapped(),F.width,F.height,Wi,at)}const Ki=ve.posMatrix,Ji=o&&_e||Do,Hr=H||Ji?Sa:Jn,cr=Ss,Jt=Ae&&n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let si;si=Ae?Le.iconsInText?Ws(qe.kind,rt,O,Z,H,Ji,h,Ki,Hr,cr,Wi,ni,fi,ze):ba(qe.kind,rt,O,Z,H,Ji,h,Ki,Hr,cr,Wi,o,ni,!0,ze):ll(qe.kind,rt,O,Z,H,Ji,h,Ki,Hr,cr,Wi,o,ni,ze);const Oi={program:Je,buffers:Ge,uniformValues:si,atlasTexture:lr,atlasTextureIcon:ai,atlasInterpolation:It,atlasInterpolationIcon:Si,isSDF:Ae,hasHalo:Jt};if(Q&&Le.canOverlap){re=!0;const at=Ge.segments.get();for(const yn of at)Ie.push({segments:new p.a0([yn]),sortKey:yn.sortKey,state:Oi,terrainData:Tt})}else Ie.push({segments:Ge.segments,sortKey:0,state:Oi,terrainData:Tt})}re&&Ie.sort((ve,be)=>ve.sortKey-be.sortKey);for(const ve of Ie){const be=ve.state;if(C.activeTexture.set(L.TEXTURE0),be.atlasTexture.bind(be.atlasInterpolation,L.CLAMP_TO_EDGE),be.atlasTextureIcon&&(C.activeTexture.set(L.TEXTURE1),be.atlasTextureIcon&&be.atlasTextureIcon.bind(be.atlasInterpolationIcon,L.CLAMP_TO_EDGE)),be.isSDF){const Le=be.uniformValues;be.hasHalo&&(Le.u_is_halo=1,lo(be.buffers,ve.segments,n,h,be.program,de,S,T,Le,ve.terrainData)),Le.u_is_halo=0}lo(be.buffers,ve.segments,n,h,be.program,de,S,T,be.uniformValues,ve.terrainData)}}function lo(h,e,n,s,o,c,m,g,y,v){const S=s.context;o.draw(S,S.gl.TRIANGLES,c,m,g,_t.disabled,y,v,n.id,h.layoutVertexBuffer,h.indexBuffer,e,n.paint,s.transform.zoom,h.programConfigurations.get(n.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function co(h,e,n,s){const o=h.context,c=o.gl,m=bt.disabled,g=new Dt([c.ONE,c.ONE],p.aM.transparent,[!0,!0,!0,!0]),y=e.getBucket(n);if(!y)return;const v=s.key;let S=n.heatmapFbos.get(v);S||(S=Ta(o,e.tileSize,e.tileSize),n.heatmapFbos.set(v,S)),o.bindFramebuffer.set(S.framebuffer),o.viewport.set([0,0,e.tileSize,e.tileSize]),o.clear({color:p.aM.transparent});const T=y.programConfigurations.get(n.id),C=h.useProgram("heatmap",T),L=h.style.map.terrain.getTerrainData(s);C.draw(o,c.TRIANGLES,et.disabled,m,g,_t.disabled,wi(s.posMatrix,e,h.transform.zoom,n.paint.get("heatmap-intensity")),L,n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,n.paint,h.transform.zoom,T)}function fn(h,e,n){const s=h.context,o=s.gl;s.setColorMode(h.colorModeForRenderPass());const c=Ia(s,e),m=n.key,g=e.heatmapFbos.get(m);g&&(s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,g.colorAttachment.get()),s.activeTexture.set(o.TEXTURE1),c.bind(o.LINEAR,o.CLAMP_TO_EDGE),h.useProgram("heatmapTexture").draw(s,o.TRIANGLES,et.disabled,bt.disabled,h.colorModeForRenderPass(),_t.disabled,Ka(h,e,0,1),null,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,h.transform.zoom),g.destroy(),e.heatmapFbos.delete(m))}function Ta(h,e,n){var s,o;const c=h.gl,m=c.createTexture();c.bindTexture(c.TEXTURE_2D,m),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);const g=(s=h.HALF_FLOAT)!==null&&s!==void 0?s:c.UNSIGNED_BYTE,y=(o=h.RGBA16F)!==null&&o!==void 0?o:c.RGBA;c.texImage2D(c.TEXTURE_2D,0,y,e,n,0,c.RGBA,g,null);const v=h.createFramebuffer(e,n,!1,!1);return v.colorAttachment.set(m),v}function Ia(h,e){return e.colorRampTexture||(e.colorRampTexture=new mt(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function Bn(h,e,n,s,o){if(!n||!s||!s.imageAtlas)return;const c=s.imageAtlas.patternPositions;let m=c[n.to.toString()],g=c[n.from.toString()];if(!m&&g&&(m=g),!g&&m&&(g=m),!m||!g){const y=o.getPaintProperty(e);m=c[y],g=c[y]}m&&g&&h.setConstantPatternPositions(m,g)}function ka(h,e,n,s,o,c,m){const g=h.context.gl,y="fill-pattern",v=n.paint.get(y),S=v&&v.constantOr(1),T=n.getCrossfadeParameters();let C,L,F,N,q;m?(L=S&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",C=g.LINES):(L=S?"fillPattern":"fill",C=g.TRIANGLES);const Z=v.constantOr(null);for(const H of s){const O=e.getTile(H);if(S&&!O.patternsLoaded())continue;const K=O.getBucket(n);if(!K)continue;const Q=K.programConfigurations.get(n.id),re=h.useProgram(L,Q),de=h.style.map.terrain&&h.style.map.terrain.getTerrainData(H);S&&(h.context.activeTexture.set(g.TEXTURE0),O.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),Q.updatePaintBuffers(T)),Bn(Q,y,Z,O,n);const _e=de?H:null,Ie=h.translatePosMatrix(_e?_e.posMatrix:H.posMatrix,O,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){N=K.indexBuffer2,q=K.segments2;const ze=[g.drawingBufferWidth,g.drawingBufferHeight];F=L==="fillOutlinePattern"&&S?nl(Ie,h,T,O,ze):_c(Ie,ze)}else N=K.indexBuffer,q=K.segments,F=S?rl(Ie,h,T,O):En(Ie);re.draw(h.context,C,o,h.stencilModeForClipping(H),c,_t.disabled,F,de,n.id,K.layoutVertexBuffer,N,q,n.paint,h.transform.zoom,Q)}}function as(h,e,n,s,o,c,m){const g=h.context,y=g.gl,v="fill-extrusion-pattern",S=n.paint.get(v),T=S.constantOr(1),C=n.getCrossfadeParameters(),L=n.paint.get("fill-extrusion-opacity"),F=S.constantOr(null);for(const N of s){const q=e.getTile(N),Z=q.getBucket(n);if(!Z)continue;const H=h.style.map.terrain&&h.style.map.terrain.getTerrainData(N),O=Z.programConfigurations.get(n.id),K=h.useProgram(T?"fillExtrusionPattern":"fillExtrusion",O);T&&(h.context.activeTexture.set(y.TEXTURE0),q.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),O.updatePaintBuffers(C)),Bn(O,v,F,q,n);const Q=h.translatePosMatrix(N.posMatrix,q,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),re=n.paint.get("fill-extrusion-vertical-gradient"),de=T?Wa(Q,h,re,L,N,C,q):ya(Q,h,re,L);K.draw(g,g.gl.TRIANGLES,o,c,m,_t.backCCW,de,H,n.id,Z.layoutVertexBuffer,Z.indexBuffer,Z.segments,n.paint,h.transform.zoom,O,h.style.map.terrain&&Z.centroidVertexBuffer)}}function Fn(h,e,n,s,o,c,m){const g=h.context,y=g.gl,v=n.fbo;if(!v)return;const S=h.useProgram("hillshade"),T=h.style.map.terrain&&h.style.map.terrain.getTerrainData(e);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),S.draw(g,y.TRIANGLES,o,c,m,_t.disabled,((C,L,F,N)=>{const q=F.paint.get("hillshade-shadow-color"),Z=F.paint.get("hillshade-highlight-color"),H=F.paint.get("hillshade-accent-color");let O=F.paint.get("hillshade-illumination-direction")*(Math.PI/180);F.paint.get("hillshade-illumination-anchor")==="viewport"&&(O-=C.transform.angle);const K=!C.options.moving;return{u_matrix:N?N.posMatrix:C.transform.calculatePosMatrix(L.tileID.toUnwrapped(),K),u_image:0,u_latrange:Ja(0,L.tileID),u_light:[F.paint.get("hillshade-exaggeration"),O],u_shadow:q,u_highlight:Z,u_accent:H}})(h,n,s,T?e:null),T,s.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}function On(h,e,n,s,o,c){const m=h.context,g=m.gl,y=e.dem;if(y&&y.data){const v=y.dim,S=y.stride,T=y.getPixels();if(m.activeTexture.set(g.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||h.getTileTexture(S),e.demTexture){const L=e.demTexture;L.update(T,{premultiply:!1}),L.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else e.demTexture=new mt(m,T,g.RGBA,{premultiply:!1}),e.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);m.activeTexture.set(g.TEXTURE0);let C=e.fbo;if(!C){const L=new mt(m,{width:v,height:v,data:null},g.RGBA);L.bind(g.LINEAR,g.CLAMP_TO_EDGE),C=e.fbo=m.createFramebuffer(v,v,!0,!1),C.colorAttachment.set(L.texture)}m.bindFramebuffer.set(C.framebuffer),m.viewport.set([0,0,v,v]),h.useProgram("hillshadePrepare").draw(m,g.TRIANGLES,s,o,c,_t.disabled,((L,F)=>{const N=F.stride,q=p.H();return p.aP(q,0,p.X,-p.X,0,0,1),p.J(q,q,[0,-p.X,0]),{u_matrix:q,u_image:1,u_dimension:[N,N],u_zoom:L.overscaledZ,u_unpack:F.getUnpackVector()}})(e.tileID,y),null,n.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function vl(h,e,n,s,o,c){const m=s.paint.get("raster-fade-duration");if(!c&&m>0){const g=he.now(),y=(g-h.timeAdded)/m,v=e?(g-e.timeAdded)/m:-1,S=n.getSource(),T=o.coveringZoomLevel({tileSize:S.tileSize,roundZoom:S.roundZoom}),C=!e||Math.abs(e.tileID.overscaledZ-T)>Math.abs(h.tileID.overscaledZ-T),L=C&&h.refreshedUponExpiration?1:p.ac(C?y:1-v,0,1);return h.refreshedUponExpiration&&y>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-L}:{opacity:L,mix:0}}return{opacity:1,mix:0}}const ho=new p.aM(1,0,0,1),lt=new p.aM(0,1,0,1),ss=new p.aM(0,0,1,1),Mc=new p.aM(1,0,1,1),wl=new p.aM(0,1,1,1);function jn(h,e,n,s){os(h,0,e+n/2,h.transform.width,n,s)}function Sl(h,e,n,s){os(h,e-n/2,0,n,h.transform.height,s)}function os(h,e,n,s,o,c){const m=h.context,g=m.gl;g.enable(g.SCISSOR_TEST),g.scissor(e*h.pixelRatio,n*h.pixelRatio,s*h.pixelRatio,o*h.pixelRatio),m.clear({color:c}),g.disable(g.SCISSOR_TEST)}function Tl(h,e,n){const s=h.context,o=s.gl,c=n.posMatrix,m=h.useProgram("debug"),g=et.disabled,y=bt.disabled,v=h.colorModeForRenderPass(),S="$debug",T=h.style.map.terrain&&h.style.map.terrain.getTerrainData(n);s.activeTexture.set(o.TEXTURE0);const C=e.getTileByID(n.key).latestRawTileData,L=Math.floor((C&&C.byteLength||0)/1024),F=e.getTile(n).tileSize,N=512/Math.min(F,512)*(n.overscaledZ/h.transform.zoom)*.5;let q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=` => ${n.overscaledZ}`),function(Z,H){Z.initDebugOverlayCanvas();const O=Z.debugOverlayCanvas,K=Z.context.gl,Q=Z.debugOverlayCanvas.getContext("2d");Q.clearRect(0,0,O.width,O.height),Q.shadowColor="white",Q.shadowBlur=2,Q.lineWidth=1.5,Q.strokeStyle="white",Q.textBaseline="top",Q.font="bold 36px Open Sans, sans-serif",Q.fillText(H,5,5),Q.strokeText(H,5,5),Z.debugOverlayTexture.update(O),Z.debugOverlayTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE)}(h,`${q} ${L}kB`),m.draw(s,o.TRIANGLES,g,y,Dt.alphaBlended,_t.disabled,xa(c,p.aM.transparent,N),null,S,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),m.draw(s,o.LINE_STRIP,g,y,v,_t.disabled,xa(c,p.aM.red),T,S,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function Il(h,e,n){const s=h.context,o=s.gl,c=h.colorModeForRenderPass(),m=new et(o.LEQUAL,et.ReadWrite,h.depthRangeFor3D),g=h.useProgram("terrain"),y=e.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,h.width,h.height]);for(const v of n){const S=h.renderToTexture.getTexture(v),T=e.getTerrainData(v.tileID);s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,S.texture);const C=h.transform.calculatePosMatrix(v.tileID.toUnwrapped()),L=e.getMeshFrameDelta(h.transform.zoom),F=h.transform.calculateFogMatrix(v.tileID.toUnwrapped()),N=Hs(C,L,F,h.style.sky,h.transform.pitch);g.draw(s,o.TRIANGLES,m,bt.disabled,c,_t.backCCW,N,T,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class ls{constructor(e,n,s){this.vertexBuffer=e,this.indexBuffer=n,this.segments=s}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class cs{constructor(e,n){this.context=new Cc(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:p.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ue.maxUnderzooming+Ue.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Zs}resize(e,n,s){if(this.width=Math.floor(e*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const o of this.style._order)this.style._layers[o].resize()}setup(){const e=this.context,n=new p.aX;n.emplaceBack(0,0),n.emplaceBack(p.X,0),n.emplaceBack(0,p.X),n.emplaceBack(p.X,p.X),this.tileExtentBuffer=e.createVertexBuffer(n,on.members),this.tileExtentSegments=p.a0.simpleSegment(0,0,4,2);const s=new p.aX;s.emplaceBack(0,0),s.emplaceBack(p.X,0),s.emplaceBack(0,p.X),s.emplaceBack(p.X,p.X),this.debugBuffer=e.createVertexBuffer(s,on.members),this.debugSegments=p.a0.simpleSegment(0,0,4,5);const o=new p.$;o.emplaceBack(0,0,0,0),o.emplaceBack(p.X,0,p.X,0),o.emplaceBack(0,p.X,0,p.X),o.emplaceBack(p.X,p.X,p.X,p.X),this.rasterBoundsBuffer=e.createVertexBuffer(o,Ur.members),this.rasterBoundsSegments=p.a0.simpleSegment(0,0,4,2);const c=new p.aX;c.emplaceBack(0,0),c.emplaceBack(1,0),c.emplaceBack(0,1),c.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(c,on.members),this.viewportSegments=p.a0.simpleSegment(0,0,4,2);const m=new p.aZ;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(m);const g=new p.aY;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(g);const y=this.context.gl;this.stencilClearMode=new bt({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=p.H();p.aP(s,0,this.width,this.height,0,0,1),p.K(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,et.disabled,this.stencilClearMode,Dt.disabled,_t.disabled,vi(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!n||!n.length)return;this.currentStencilSource=e.source;const s=this.context,o=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Dt.disabled),s.setDepthMode(et.disabled);const c=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const g=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);c.draw(s,o.TRIANGLES,et.disabled,new bt({func:o.ALWAYS,mask:0},g,255,o.KEEP,o.KEEP,o.REPLACE),Dt.disabled,_t.disabled,vi(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,n=this.context.gl;return new bt({func:n.NOTEQUAL,mask:255},e,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(e){const n=this.context.gl;return new bt({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(e){const n=this.context.gl,s=e.sort((m,g)=>g.overscaledZ-m.overscaledZ),o=s[s.length-1].overscaledZ,c=s[0].overscaledZ-o+1;if(c>1){this.currentStencilSource=void 0,this.nextStencilID+c>256&&this.clearStencil();const m={};for(let g=0;g({u_sky_color:Z.properties.get("sky-color"),u_horizon_color:Z.properties.get("horizon-color"),u_horizon:(H.height/2+H.getHorizon())*O,u_sky_horizon_blend:Z.properties.get("sky-horizon-blend")*H.height/2*O}))(v,y.style.map.transform,y.pixelRatio),L=new et(T.LEQUAL,et.ReadWrite,[0,1]),F=bt.disabled,N=y.colorModeForRenderPass(),q=y.useProgram("sky");if(!v.mesh){const Z=new p.aX;Z.emplaceBack(-1,-1),Z.emplaceBack(1,-1),Z.emplaceBack(1,1),Z.emplaceBack(-1,1);const H=new p.aY;H.emplaceBack(0,1,2),H.emplaceBack(0,2,3),v.mesh=new ls(S.createVertexBuffer(Z,on.members),S.createIndexBuffer(H),p.a0.simpleSegment(0,0,Z.length,H.length))}q.draw(S,T.TRIANGLES,L,F,N,_t.disabled,C,void 0,"sky",v.mesh.vertexBuffer,v.mesh.indexBuffer,v.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){const y=this.style._layers[s[this.currentLayer]],v=o[y.source],S=c[y.source];this._renderTileClippingMasks(y,S),this.renderLayer(this,v,y,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerq.source&&!q.isHidden(S)?[v.sourceCaches[q.source]]:[]),L=C.filter(q=>q.getSource().type==="vector"),F=C.filter(q=>q.getSource().type!=="vector"),N=q=>{(!T||T.getSource().maxzoomN(q)),T||F.forEach(q=>N(q)),T}(this.style,this.transform.zoom);y&&function(v,S,T){for(let C=0;C0),o&&(p.b0(n,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(c,m){const g=c.context,y=g.gl,v=Dt.unblended,S=new et(y.LEQUAL,et.ReadWrite,[0,1]),T=m.getTerrainMesh(),C=m.sourceCache.getRenderableTiles(),L=c.useProgram("terrainDepth");g.bindFramebuffer.set(m.getFramebuffer("depth").framebuffer),g.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1});for(const F of C){const N=m.getTerrainData(F.tileID),q={u_matrix:c.transform.calculatePosMatrix(F.tileID.toUnwrapped()),u_ele_delta:m.getMeshFrameDelta(c.transform.zoom)};L.draw(g,y.TRIANGLES,S,bt.disabled,v,_t.backCCW,q,N,"terrain",T.vertexBuffer,T.indexBuffer,T.segments)}g.bindFramebuffer.set(null),g.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain),function(c,m){const g=c.context,y=g.gl,v=Dt.unblended,S=new et(y.LEQUAL,et.ReadWrite,[0,1]),T=m.getTerrainMesh(),C=m.getCoordsTexture(),L=m.sourceCache.getRenderableTiles(),F=c.useProgram("terrainCoords");g.bindFramebuffer.set(m.getFramebuffer("coords").framebuffer),g.viewport.set([0,0,c.width/devicePixelRatio,c.height/devicePixelRatio]),g.clear({color:p.aM.transparent,depth:1}),m.coordsIndex=[];for(const N of L){const q=m.getTerrainData(N.tileID);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,C.texture);const Z={u_matrix:c.transform.calculatePosMatrix(N.tileID.toUnwrapped()),u_terrain_coords_id:(255-m.coordsIndex.length)/255,u_texture:0,u_ele_delta:m.getMeshFrameDelta(c.transform.zoom)};F.draw(g,y.TRIANGLES,S,bt.disabled,v,_t.backCCW,Z,q,"terrain",T.vertexBuffer,T.indexBuffer,T.segments),m.coordsIndex.push(N.tileID.key)}g.bindFramebuffer.set(null),g.viewport.set([0,0,c.width,c.height])}(this,this.style.map.terrain))}renderLayer(e,n,s,o){if(!s.isHidden(this.transform.zoom)&&(s.type==="background"||s.type==="custom"||(o||[]).length))switch(this.id=s.id,s.type){case"symbol":(function(c,m,g,y,v){if(c.renderPass!=="translucent")return;const S=bt.disabled,T=c.colorModeForRenderPass();(g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(C,L,F,N,q,Z,H,O,K){const Q=L.transform,re=sn(),de=q==="map",_e=Z==="map";for(const Ie of C){const ze=N.getTile(Ie),ve=ze.getBucket(F);if(!ve||!ve.text||!ve.text.segments.get().length)continue;const be=p.ag(ve.textSizeData,Q.zoom),Le=it(ze,1,L.transform.zoom),Ge=qr(Ie.posMatrix,_e,de,L.transform,Le),Se=F.layout.get("icon-text-fit")!=="none"&&ve.hasIconData();if(be){const Ae=Math.pow(2,Q.zoom-ze.tileID.overscaledZ),qe=L.style.map.terrain?(Je,rt)=>L.style.map.terrain.getElevation(Ie,Je,rt):null,St=re.translatePosition(Q,ze,H,O);Rn(ve,de,_e,K,Q,Ge,Ie.posMatrix,Ae,be,Se,re,St,Ie.toUnwrapped(),qe)}}}(y,c,g,m,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),v),g.paint.get("icon-opacity").constantOr(1)!==0&&oo(c,m,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),S,T),g.paint.get("text-opacity").constantOr(1)!==0&&oo(c,m,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),S,T),m.map.showCollisionBoxes&&(wa(c,m,g,y,!0),wa(c,m,g,y,!1))})(e,n,s,o,this.style.placement.variableOffsets);break;case"circle":(function(c,m,g,y){if(c.renderPass!=="translucent")return;const v=g.paint.get("circle-opacity"),S=g.paint.get("circle-stroke-width"),T=g.paint.get("circle-stroke-opacity"),C=!g.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(S.constantOr(1)===0||T.constantOr(1)===0))return;const L=c.context,F=L.gl,N=c.depthModeForSublayer(0,et.ReadOnly),q=bt.disabled,Z=c.colorModeForRenderPass(),H=[];for(let O=0;OO.sortKey-K.sortKey);for(const O of H){const{programConfiguration:K,program:Q,layoutVertexBuffer:re,indexBuffer:de,uniformValues:_e,terrainData:Ie}=O.state;Q.draw(L,F.TRIANGLES,N,q,Z,_t.disabled,_e,Ie,g.id,re,de,O.segments,g.paint,c.transform.zoom,K)}})(e,n,s,o);break;case"heatmap":(function(c,m,g,y){if(g.paint.get("heatmap-opacity")===0)return;const v=c.context;if(c.style.map.terrain){for(const S of y){const T=m.getTile(S);m.hasRenderableParent(S)||(c.renderPass==="offscreen"?co(c,T,g,S):c.renderPass==="translucent"&&fn(c,g,S))}v.viewport.set([0,0,c.width,c.height])}else c.renderPass==="offscreen"?function(S,T,C,L){const F=S.context,N=F.gl,q=bt.disabled,Z=new Dt([N.ONE,N.ONE],p.aM.transparent,[!0,!0,!0,!0]);(function(H,O,K){const Q=H.gl;H.activeTexture.set(Q.TEXTURE1),H.viewport.set([0,0,O.width/4,O.height/4]);let re=K.heatmapFbos.get(p.aU);re?(Q.bindTexture(Q.TEXTURE_2D,re.colorAttachment.get()),H.bindFramebuffer.set(re.framebuffer)):(re=Ta(H,O.width/4,O.height/4),K.heatmapFbos.set(p.aU,re))})(F,S,C),F.clear({color:p.aM.transparent});for(let H=0;H20&&S.texParameterf(S.TEXTURE_2D,v.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,v.extTextureFilterAnisotropicMax);const ve=c.style.map.terrain&&c.style.map.terrain.getTerrainData(H),be=ve?H:null,Le=be?be.posMatrix:c.transform.calculatePosMatrix(H.toUnwrapped(),Z),Ge=xc(Le,Ie||[0,0],_e||1,de,g);T instanceof Mr?C.draw(v,S.TRIANGLES,O,bt.disabled,L,_t.disabled,Ge,ve,g.id,T.boundsBuffer,c.quadTriangleIndexBuffer,T.boundsSegments):C.draw(v,S.TRIANGLES,O,F[H.overscaledZ],L,_t.disabled,Ge,ve,g.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments)}})(e,n,s,o);break;case"background":(function(c,m,g,y){const v=g.paint.get("background-color"),S=g.paint.get("background-opacity");if(S===0)return;const T=c.context,C=T.gl,L=c.transform,F=L.tileSize,N=g.paint.get("background-pattern");if(c.isPatternMissing(N))return;const q=!N&&v.a===1&&S===1&&c.opaquePassEnabledForLayer()?"opaque":"translucent";if(c.renderPass!==q)return;const Z=bt.disabled,H=c.depthModeForSublayer(0,q==="opaque"?et.ReadWrite:et.ReadOnly),O=c.colorModeForRenderPass(),K=c.useProgram(N?"backgroundPattern":"background"),Q=y||L.coveringTiles({tileSize:F,terrain:c.style.map.terrain});N&&(T.activeTexture.set(C.TEXTURE0),c.imageManager.bind(c.context));const re=g.getCrossfadeParameters();for(const de of Q){const _e=y?de.posMatrix:c.transform.calculatePosMatrix(de.toUnwrapped()),Ie=N?Ks(_e,S,c,N,{tileID:de,tileSize:F},re):Qa(_e,S,v),ze=c.style.map.terrain&&c.style.map.terrain.getTerrainData(de);K.draw(T,C.TRIANGLES,H,Z,O,_t.disabled,Ie,ze,g.id,c.tileExtentBuffer,c.quadTriangleIndexBuffer,c.tileExtentSegments)}})(e,0,s,o);break;case"custom":(function(c,m,g){const y=c.context,v=g.implementation;if(c.renderPass==="offscreen"){const S=v.prerender;S&&(c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),S.call(v,y.gl,c.transform.customLayerMatrix()),y.setDirty(),c.setBaseState())}else if(c.renderPass==="translucent"){c.setCustomLayerDefaults(),y.setColorMode(c.colorModeForRenderPass()),y.setStencilMode(bt.disabled);const S=v.renderingMode==="3d"?new et(c.context.gl.LEQUAL,et.ReadWrite,c.depthRangeFor3D):c.depthModeForSublayer(0,et.ReadOnly);y.setDepthMode(S),v.render(y.gl,c.transform.customLayerMatrix(),{farZ:c.transform.farZ,nearZ:c.transform.nearZ,fov:c.transform._fov,modelViewProjectionMatrix:c.transform.modelViewProjectionMatrix,projectionMatrix:c.transform.projectionMatrix}),y.setDirty(),c.setBaseState(),y.bindFramebuffer.set(null)}})(e,0,s)}}translatePosMatrix(e,n,s,o,c){if(!s[0]&&!s[1])return e;const m=c?o==="map"?this.transform.angle:0:o==="viewport"?-this.transform.angle:0;if(m){const v=Math.sin(m),S=Math.cos(m);s=[s[0]*S-s[1]*v,s[0]*v+s[1]*S]}const g=[c?s[0]:it(n,s[0],this.transform.zoom),c?s[1]:it(n,s[1],this.transform.zoom),0],y=new Float32Array(16);return p.J(y,e,g),y}saveTileTexture(e){const n=this._tileTextures[e.size[0]];n?n.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const n=this._tileTextures[e];return n&&n.length>0?n.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const n=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!n||!s}useProgram(e,n){this.cache=this.cache||{};const s=e+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new Xs(this.context,Zr[e],n,Js[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new mt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:n}=this.context.gl;return this.width!==e||this.height!==n}}class Vn{constructor(e,n){this.points=e,this.planes=n}static fromInvProjectionMatrix(e,n,s){const o=Math.pow(2,s),c=[[-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(g=>{const y=1/(g=p.af([],g,e))[3]/n*o;return p.b1(g,g,[y,y,1/g[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{const y=function(C,L){var F=L[0],N=L[1],q=L[2],Z=F*F+N*N+q*q;return Z>0&&(Z=1/Math.sqrt(Z)),C[0]=L[0]*Z,C[1]=L[1]*Z,C[2]=L[2]*Z,C}([],function(C,L,F){var N=L[0],q=L[1],Z=L[2],H=F[0],O=F[1],K=F[2];return C[0]=q*K-Z*O,C[1]=Z*H-N*K,C[2]=N*O-q*H,C}([],$i([],c[g[0]],c[g[1]]),$i([],c[g[2]],c[g[1]]))),v=-((S=y)[0]*(T=c[g[1]])[0]+S[1]*T[1]+S[2]*T[2]);var S,T;return y.concat(v)});return new Vn(c,m)}}class Nn{constructor(e,n){this.min=e,this.max=n,this.center=function(s,o,c){return s[0]=.5*o[0],s[1]=.5*o[1],s[2]=.5*o[2],s}([],function(s,o,c){return s[0]=o[0]+c[0],s[1]=o[1]+c[1],s[2]=o[2]+c[2],s}([],this.min,this.max))}quadrant(e){const n=[e%2==0,e<2],s=qt(this.min),o=qt(this.max);for(let c=0;c=0&&m++;if(m===0)return 0;m!==n.length&&(s=!1)}if(s)return 2;for(let o=0;o<3;o++){let c=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let g=0;gthis.max[o]-this.min[o])return 0}return 1}}class Un{constructor(e=0,n=0,s=0,o=0){if(isNaN(e)||e<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=s,this.right=o}interpolate(e,n,s){return n.top!=null&&e.top!=null&&(this.top=p.y.number(e.top,n.top,s)),n.bottom!=null&&e.bottom!=null&&(this.bottom=p.y.number(e.bottom,n.bottom,s)),n.left!=null&&e.left!=null&&(this.left=p.y.number(e.left,n.left,s)),n.right!=null&&e.right!=null&&(this.right=p.y.number(e.right,n.right,s)),this}getCenter(e,n){const s=p.ac((this.left+e-this.right)/2,0,e),o=p.ac((this.top+n-this.bottom)/2,0,n);return new p.P(s,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Un(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const uo=85.051129;class $n{constructor(e,n,s,o,c){this.tileSize=512,this._renderWorldCopies=c===void 0||!!c,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=o??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new p.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Un,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new $n(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new p.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const n=-p.b3(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var s=new p.A(4);return p.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s}(),function(s,o,c){var m=o[0],g=o[1],y=o[2],v=o[3],S=Math.sin(c),T=Math.cos(c);s[0]=m*T+y*S,s[1]=g*T+v*S,s[2]=m*-S+y*T,s[3]=g*-S+v*T}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const n=p.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const n=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,n,s){this._unmodified=!1,this._edgeInsets.interpolate(e,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const n=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(e){const n=[new p.b4(0,e)];if(this._renderWorldCopies){const s=this.pointCoordinate(new p.P(0,0)),o=this.pointCoordinate(new p.P(this.width,0)),c=this.pointCoordinate(new p.P(this.width,this.height)),m=this.pointCoordinate(new p.P(0,this.height)),g=Math.floor(Math.min(s.x,o.x,c.x,m.x)),y=Math.floor(Math.max(s.x,o.x,c.x,m.x)),v=1;for(let S=g-v;S<=y+v;S++)S!==0&&n.push(new p.b4(S,e))}return n}coveringTiles(e){var n,s;let o=this.coveringZoomLevel(e);const c=o;if(e.minzoom!==void 0&&oe.maxzoom&&(o=e.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),g=p.Z.fromLngLat(this.center),y=Math.pow(2,o),v=[y*m.x,y*m.y,0],S=[y*g.x,y*g.y,0],T=Vn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,o);let C=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(C=o);const L=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,F=O=>({aabb:new Nn([O*y,0,0],[(O+1)*y,y,0]),zoom:0,x:0,y:0,wrap:O,fullyVisible:!1}),N=[],q=[],Z=o,H=e.reparseOverscaled?c:o;if(this._renderWorldCopies)for(let O=1;O<=3;O++)N.push(F(-O)),N.push(F(O));for(N.push(F(0));N.length>0;){const O=N.pop(),K=O.x,Q=O.y;let re=O.fullyVisible;if(!re){const ve=O.aabb.intersects(T);if(ve===0)continue;re=ve===2}const de=e.terrain?v:S,_e=O.aabb.distanceX(de),Ie=O.aabb.distanceY(de),ze=Math.max(Math.abs(_e),Math.abs(Ie));if(O.zoom===Z||ze>L+(1<=C){const ve=Z-O.zoom,be=v[0]-.5-(K<>1),Ge=O.zoom+1;let Se=O.aabb.quadrant(ve);if(e.terrain){const Ae=new p.S(Ge,O.wrap,Ge,be,Le),qe=e.terrain.getMinMaxElevation(Ae),St=(n=qe.minElevation)!==null&&n!==void 0?n:this.elevation,Je=(s=qe.maxElevation)!==null&&s!==void 0?s:this.elevation;Se=new Nn([Se.min[0],Se.min[1],St],[Se.max[0],Se.max[1],Je])}N.push({aabb:Se,zoom:Ge,x:be,y:Le,wrap:O.wrap,fullyVisible:re})}}return q.sort((O,K)=>O.distanceSq-K.distanceSq).map(O=>O.tileID)}resize(e,n){this.width=e,this.height=n,this.pixelsToGLUnits=[2/e,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const n=p.ac(e.lat,-85.051129,uo);return new p.P(p.O(e.lng)*this.worldSize,p.Q(n)*this.worldSize)}unproject(e){return new p.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const n=this.elevation,s=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,e),c=e.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-c))return;const m=s+n-c,g=Math.cos(this._pitch)*this.cameraToCenterDistance/m/p.b5(1,o.lat),y=this.scaleZoom(g/this.tileSize);this._elevation=c,this._center=o,this.zoom=y}setLocationAtPoint(e,n){const s=this.pointCoordinate(n),o=this.pointCoordinate(this.centerPoint),c=this.locationCoordinate(e),m=new p.Z(c.x-(s.x-o.x),c.y-(s.y-o.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,n){return n?this.coordinatePoint(this.locationCoordinate(e),n.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,n){return this.coordinateLocation(this.pointCoordinate(e,n))}locationCoordinate(e){return p.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){const C=n.pointCoordinate(e);if(C!=null)return C}const s=[e.x,e.y,0,1],o=[e.x,e.y,1,1];p.af(s,s,this.pixelMatrixInverse),p.af(o,o,this.pixelMatrixInverse);const c=s[3],m=o[3],g=s[1]/c,y=o[1]/m,v=s[2]/c,S=o[2]/m,T=v===S?0:(0-v)/(S-v);return new p.Z(p.y.number(s[0]/c,o[0]/m,T)/this.worldSize,p.y.number(g,y,T)/this.worldSize)}coordinatePoint(e,n=0,s=this.pixelMatrix){const o=[e.x*this.worldSize,e.y*this.worldSize,n,1];return p.af(o,o,s),new p.P(o[0]/o[3],o[1]/o[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return new se().extend(this.pointLocation(new p.P(0,e))).extend(this.pointLocation(new p.P(this.width,e))).extend(this.pointLocation(new p.P(this.width,this.height))).extend(this.pointLocation(new p.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new se([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,uo])}calculateTileMatrix(e){const n=e.canonical,s=this.worldSize/this.zoomScale(n.z),o=n.x+Math.pow(2,n.z)*e.wrap,c=p.an(new Float64Array(16));return p.J(c,c,[o*s,n.y*s,0]),p.K(c,c,[s/p.X,s/p.X,1]),c}calculatePosMatrix(e,n=!1){const s=e.key,o=n?this._alignedPosMatrixCache:this._posMatrixCache;if(o[s])return o[s];const c=this.calculateTileMatrix(e);return p.L(c,n?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,c),o[s]=new Float32Array(c),o[s]}calculateFogMatrix(e){const n=e.key,s=this._fogMatrixCache;if(s[n])return s[n];const o=this.calculateTileMatrix(e);return p.L(o,this.fogMatrix,o),s[n]=new Float32Array(o),s[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){n=p.ac(+n,this.minZoom,this.maxZoom);const s={center:new p.N(e.lng,e.lat),zoom:n};let o=this.lngRange;if(!this._renderWorldCopies&&o===null){const O=179.9999999999;o=[-O,O]}const c=this.tileSize*this.zoomScale(s.zoom);let m=0,g=c,y=0,v=c,S=0,T=0;const{x:C,y:L}=this.size;if(this.latRange){const O=this.latRange;m=p.Q(O[1])*c,g=p.Q(O[0])*c,g-mg&&(Z=g-O)}if(o){const O=(y+v)/2;let K=F;this._renderWorldCopies&&(K=p.b3(F,O-c/2,O+c/2));const Q=C/2;K-Qv&&(q=v-Q)}if(q!==void 0||Z!==void 0){const O=new p.P(q??F,Z??N);s.center=this.unproject.call({worldSize:c},O).wrap()}return s}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:n,zoom:s}=this.getConstrained(this.center,this.zoom);this.center=n,this.zoom=s,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=p.b5(1,this.center.lat)*this.worldSize;let o=p.an(new Float64Array(16));p.K(o,o,[this.width/2,-this.height/2,1]),p.J(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=p.an(new Float64Array(16)),p.K(o,o,[1,-1,1]),p.J(o,o,[-1,-1,0]),p.K(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;const c=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this.minElevationForCurrentTile),g=c-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?g:c,v=Math.PI/2+this._pitch,S=this._fov*(.5+e.y/this.height),T=Math.sin(S)*y/Math.sin(p.ac(Math.PI-v-S,.01,Math.PI-.01)),C=this.getHorizon(),L=2*Math.atan(C/this.cameraToCenterDistance)*(.5+e.y/(2*C)),F=Math.sin(L)*y/Math.sin(p.ac(Math.PI-v-L,.01,Math.PI-.01)),N=Math.min(T,F);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*N+y),this.nearZ=this.height/50,o=new Float64Array(16),p.b6(o,this._fov,this.width/this.height,this.nearZ,this.farZ),o[8]=2*-e.x/this.width,o[9]=2*e.y/this.height,this.projectionMatrix=p.ae(o),p.K(o,o,[1,-1,1]),p.J(o,o,[0,0,-this.cameraToCenterDistance]),p.b7(o,o,this._pitch),p.ad(o,o,this.angle),p.J(o,o,[-n,-s,0]),this.mercatorMatrix=p.K([],o,[this.worldSize,this.worldSize,this.worldSize]),p.K(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=p.L(new Float64Array(16),this.labelPlaneMatrix,o),p.J(o,o,[0,0,-this.elevation]),this.modelViewProjectionMatrix=o,this.invModelViewProjectionMatrix=p.as([],o),this.fogMatrix=new Float64Array(16),p.b6(this.fogMatrix,this._fov,this.width/this.height,c,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,p.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),p.b7(this.fogMatrix,this.fogMatrix,this._pitch),p.ad(this.fogMatrix,this.fogMatrix,this.angle),p.J(this.fogMatrix,this.fogMatrix,[-n,-s,0]),p.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),p.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=p.L(new Float64Array(16),this.labelPlaneMatrix,o);const q=this.width%2/2,Z=this.height%2/2,H=Math.cos(this.angle),O=Math.sin(this.angle),K=n-Math.round(n)+H*q+O*Z,Q=s-Math.round(s)+H*Z+O*q,re=new Float64Array(o);if(p.J(re,re,[K>.5?K-1:K,Q>.5?Q-1:Q,0]),this.alignedModelViewProjectionMatrix=re,o=p.as(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new p.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return p.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new p.P(0,e))}getCameraQueryGeometry(e){const n=this.getCameraPoint();if(e.length===1)return[e[0],n];{let s=n.x,o=n.y,c=n.x,m=n.y;for(const g of e)s=Math.min(s,g.x),o=Math.min(o,g.y),c=Math.max(c,g.x),m=Math.max(m,g.y);return[new p.P(s,o),new p.P(c,o),new p.P(c,m),new p.P(s,m),new p.P(s,o)]}}lngLatToCameraDepth(e,n){const s=this.locationCoordinate(e),o=[s.x*this.worldSize,s.y*this.worldSize,n,1];return p.af(o,o,this.modelViewProjectionMatrix),o[2]/o[3]}}function Aa(h,e){let n,s=!1,o=null,c=null;const m=()=>{o=null,s&&(h.apply(c,n),o=setTimeout(m,e),s=!1)};return(...g)=>(s=!0,c=this,n=g,o||m(),o)}class hs{constructor(e){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(s=o)}),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(s=>isNaN(s))){const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(n.length===0)return;const s=n.join("/");let o=s;o.split("&").length>0&&(o=o.split("&")[0]),this._hashName&&(o=`${this._hashName}=${s}`);let c=window.location.hash.replace(o,"");c.startsWith("#&")?c=c.slice(0,1)+c.slice(2):c==="#"&&(c="");let m=window.location.href.replace(/(#.+)?$/,c);m=m.replace("&&","&"),window.history.replaceState(window.history.state,null,m)},this._updateHash=Aa(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,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(e){const n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,o=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),c=Math.pow(10,o),m=Math.round(n.lng*c)/c,g=Math.round(n.lat*c)/c,y=this._map.getBearing(),v=this._map.getPitch();let S="";if(S+=e?`/${m}/${g}/${s}`:`${s}/${g}/${m}`,(y||v)&&(S+="/"+Math.round(10*y)/10),v&&(S+=`/${Math.round(v)}`),this._hashName){const T=this._hashName;let C=!1;const L=window.location.hash.slice(1).split("&").map(F=>{const N=F.split("=")[0];return N===T?(C=!0,`${N}=${S}`):F}).filter(F=>F);return C||L.push(`${T}=${S}`),`#${L.join("&")}`}return`#${S}`}}const us={linearity:.3,easing:p.b8(0,0,.3,1)},po=p.e({deceleration:2500,maxSpeed:1400},us),Ec=p.e({deceleration:20,maxSpeed:1400},us),kl=p.e({deceleration:1e3,maxSpeed:360},us),ds=p.e({deceleration:1e3,maxSpeed:90},us);class fo{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:he.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,n=he.now();for(;e.length>0&&n-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new p.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:c}of this._inertiaBuffer)n.zoom+=c.zoomDelta||0,n.bearing+=c.bearingDelta||0,n.pitch+=c.pitchDelta||0,c.panDelta&&n.pan._add(c.panDelta),c.around&&(n.around=c.around),c.pinchAround&&(n.pinchAround=c.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){const c=za(n.pan.mag(),s,p.e({},po,e||{}));o.offset=n.pan.mult(c.amount/n.pan.mag()),o.center=this._map.transform.center,Pa(o,c)}if(n.zoom){const c=za(n.zoom,s,Ec);o.zoom=this._map.transform.zoom+c.amount,Pa(o,c)}if(n.bearing){const c=za(n.bearing,s,kl);o.bearing=this._map.transform.bearing+p.ac(c.amount,-179,179),Pa(o,c)}if(n.pitch){const c=za(n.pitch,s,ds);o.pitch=this._map.transform.pitch+c.amount,Pa(o,c)}if(o.zoom||o.bearing){const c=n.pinchAround===void 0?n.around:n.pinchAround;o.around=c?this._map.unproject(c):this._map.getCenter()}return this.clear(),p.e(o,{noMoveStart:!0})}}function Pa(h,e){(!h.duration||h.durationn.unproject(y)),g=c.reduce((y,v,S,T)=>y.add(v.div(T.length)),new p.P(0,0));super(e,{points:c,point:g,lngLats:m,lngLat:n.unproject(g),originalEvent:s}),this._defaultPrevented=!1}}class Al extends p.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class Pl{constructor(e,n){this._map=e,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Al(e.type,this._map,e))}mousedown(e,n){return this._mousedownPos=n,this._firePreventable(new ri(e.type,this._map,e))}mouseup(e){this._map.fire(new ri(e.type,this._map,e))}click(e,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new ri(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ri(e.type,this._map,e))}mouseover(e){this._map.fire(new ri(e.type,this._map,e))}mouseout(e){this._map.fire(new ri(e.type,this._map,e))}touchstart(e){return this._firePreventable(new mn(e.type,this._map,e))}touchmove(e){this._map.fire(new mn(e.type,this._map,e))}touchend(e){this._map.fire(new mn(e.type,this._map,e))}touchcancel(e){this._map.fire(new mn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Lt{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new ri(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ri("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ri(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sr{constructor(e){this._map=e}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(e){return this.transform.pointLocation(p.P.convert(e),this._map.terrain)}}class Bi{constructor(e,n){this._map=e,this._tr=new sr(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,n){this.isEnabled()&&e.shiftKey&&e.button===0&&(oe.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(e,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)c.fitScreenCoordinates(s,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(oe.remove(this._box),this._box=null),oe.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new p.k(e,{originalEvent:n}))}}function Ca(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const n={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=function(o){const c=new p.P(0,0);for(const m of o)c._add(m);return c.div(o.length)}(n),this.touches=Ca(s,n)))}touchmove(e,n,s){if(this.aborted||!this.centroid)return;const o=Ca(s,n);for(const c in this.touches){const m=o[c];(!m||m.dist(this.touches[c])>30)&&(this.aborted=!0)}}touchend(e,n,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class ps{constructor(e){this.singleTap=new mo(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,n,s){this.singleTap.touchstart(e,n,s)}touchmove(e,n,s){this.singleTap.touchmove(e,n,s)}touchend(e,n,s){const o=this.singleTap.touchend(e,n,s);if(o){const c=e.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(o)<30;if(c&&m||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class qn{constructor(e){this._tr=new sr(e),this._zoomIn=new ps({numTouches:1,numTaps:2}),this._zoomOut=new ps({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,n,s){this._zoomIn.touchstart(e,n,s),this._zoomOut.touchstart(e,n,s)}touchmove(e,n,s){this._zoomIn.touchmove(e,n,s),this._zoomOut.touchmove(e,n,s)}touchend(e,n,s){const o=this._zoomIn.touchend(e,n,s),c=this._zoomOut.touchend(e,n,s),m=this._tr;return o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(o)},{originalEvent:e})}):c?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(c)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Lr{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const n=this._moveFunction(...e);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(e,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const o=n.length?n[0]:n;return!this._moved&&o.dist(s){h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}},yo=({enable:h,clickTolerance:e,bearingDegreesPerPixelMoved:n=.8})=>{const s=new fs({checkCorrectEvent:o=>oe.mouseButton(o)===0&&o.ctrlKey||oe.mouseButton(o)===2});return new Lr({clickTolerance:e,move:(o,c)=>({bearingDelta:(c.x-o.x)*n}),moveStateManager:s,enable:h,assignEvents:ms})},xo=({enable:h,clickTolerance:e,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new fs({checkCorrectEvent:o=>oe.mouseButton(o)===0&&o.ctrlKey||oe.mouseButton(o)===2});return new Lr({clickTolerance:e,move:(o,c)=>({pitchDelta:(c.y-o.y)*n}),moveStateManager:s,enable:h,assignEvents:ms})};class _n{constructor(e,n){this._clickTolerance=e.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new p.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,n,s){return this._calculateTransform(e,n,s)}touchmove(e,n,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,n,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,n,s){this._calculateTransform(e,n,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,s){s.length>0&&(this._active=!0);const o=Ca(s,n),c=new p.P(0,0),m=new p.P(0,0);let g=0;for(const v in o){const S=o[v],T=this._touches[v];T&&(c._add(S),m._add(S.sub(T)),g++,o[v]=S)}if(this._touches=o,this._shouldBePrevented(g)||!m.mag())return;const y=m.div(g);return this._sum._add(y),this._sum.mag()Math.abs(h.x)}class Zn extends _s{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,n,s){super.touchstart(e,n,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,gs(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,n,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const o=e[0].sub(this._lastPoints[0]),c=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,c,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+c.y)/2*-.5}):void 0}gestureBeginsVertically(e,n,s){if(this._valid!==void 0)return this._valid;const o=e.mag()>=2,c=n.mag()>=2;if(!o&&!c)return;if(!o||!c)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const m=e.y>0==n.y>0;return gs(e)&&gs(n)&&m}}const zl={panStep:100,bearingStep:15,pitchStep:10};class Hi{constructor(e){this._tr=new sr(e);const n=zl;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,s=0,o=0,c=0,m=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),c=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),c=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),m=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(s=0,o=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:Sr,zoom:n?Math.round(y.zoom)+n*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+s*this._bearingStep,pitch:y.pitch+o*this._pitchStep,offset:[-c*this._panStep,-m*this._panStep],center:y.center},{originalEvent:e})}}}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 Sr(h){return h*(2-h)}const To=4.000244140625;class or{constructor(e,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new sr(e),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const s=he.now(),o=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%To==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=oe.mousePos(this._map.getCanvas(),e),s=this._tr;this._around=n.y>s.transform.height/2-s.transform.getHorizon()?p.N.convert(this._aroundCenter?s.center:s.unproject(n)):p.N.convert(s.center),this._aroundPoint=s.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(this._delta!==0){const y=this._type==="wheel"&&Math.abs(this._delta)>To?this._wheelZoomRate:this._defaultZoomRate;let v=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&v!==0&&(v=1/v);const S=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(S*v))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,s=this._startZoom,o=this._easing;let c,m=!1;const g=he.now()-this._lastWheelEventTime;if(this._type==="wheel"&&s&&o&&g){const y=Math.min(g/200,1),v=o(y);c=p.y.number(s,n,v),y<1?this._frameId||(this._frameId=!0):m=!0}else c=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:c-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=p.b9;if(this._prevEase){const s=this._prevEase,o=(he.now()-s.start)/s.duration,c=s.easing(o+.01)-s.easing(o),m=.27/Math.sqrt(c*c+1e-4)*.01,g=Math.sqrt(.0729-m*m);n=p.b8(m,g,.25,1)}return this._prevEase={start:he.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class gn{constructor(e,n){this._clickZoom=e,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Dc{constructor(e){this._tr=new sr(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Lc{constructor(){this._tap=new ps({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,n,s){if(!this._swipePoint)if(this._tapTime){const o=n[0],c=e.timeStamp-this._tapTime<500,m=this._tapPoint.dist(o)<30;c&&m?s.length>0&&(this._swipePoint=o,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,n,s)}touchmove(e,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const o=n[0],c=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:c/128}}}else this._tap.touchmove(e,n,s)}touchend(e,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const o=this._tap.touchend(e,n,s);o&&(this._tapTime=e.timeStamp,this._tapPoint=o)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cl{constructor(e,n,s){this._el=e,this._mousePan=n,this._touchPan=s}enable(e){this._inertiaOptions=e||{},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 Ml{constructor(e,n,s){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Io{constructor(e,n,s,o){this._el=e,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Gn{constructor(e,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=oe.create("div","maplibregl-cooperative-gesture-screen",e);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),o=document.createElement("div");o.className="maplibregl-desktop-message",o.textContent=n,this._container.appendChild(o);const c=document.createElement("div");c.className="maplibregl-mobile-message",c.textContent=s,this._container.appendChild(c),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(oe.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new p.k("cooperativegestureprevented",{gestureType:e,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Xi=h=>h.zoom||h.drag||h.pitch||h.rotate;class Me extends p.k{}function ys(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}class ko{constructor(e,n){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,c)=>{if(o.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=o.type==="renderFrame"?void 0:o,g={needsRenderFrame:!1},y={},v={},S=o.touches,T=S?this._getMapTouches(S):void 0,C=T?oe.touchPos(this._map.getCanvas(),T):oe.mousePos(this._map.getCanvas(),o);for(const{handlerName:N,handler:q,allowed:Z}of this._handlers){if(!q.isEnabled())continue;let H;this._blockedByActive(v,Z,N)?q.reset():q[c||o.type]&&(H=q[c||o.type](o,C,T),this.mergeHandlerResult(g,y,H,N,m),H&&H.needsRenderFrame&&this._triggerRenderFrame()),(H||q.isActive())&&(v[N]=q)}const L={};for(const N in this._previousActiveHandlers)v[N]||(L[N]=m);this._previousActiveHandlers=v,(Object.keys(L).length||ys(g))&&(this._changes.push([g,y,L]),this._triggerRenderFrame()),(Object.keys(v).length||ys(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:F}=g;F&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],F(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new fo(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const 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],[document,"mousemove",{capture:!0}],[document,"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],[window,"blur",void 0]];for(const[o,c,m]of this._listeners)oe.addEventListener(o,c,o===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[e,n,s]of this._listeners)oe.removeEventListener(e,n,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new Pl(n,e));const o=n.boxZoom=new Bi(n,e);this._add("boxZoom",o),e.interactive&&e.boxZoom&&o.enable();const c=n.cooperativeGestures=new Gn(n,e.cooperativeGestures);this._add("cooperativeGestures",c),e.cooperativeGestures&&c.enable();const m=new qn(n),g=new Dc(n);n.doubleClickZoom=new gn(g,m),this._add("tapZoom",m),this._add("clickZoom",g),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();const y=new Lc;this._add("tapDragZoom",y);const v=n.touchPitch=new Zn(n);this._add("touchPitch",v),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);const S=yo(e),T=xo(e);n.dragRotate=new Ml(e,S,T),this._add("mouseRotate",S,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]),e.interactive&&e.dragRotate&&n.dragRotate.enable();const C=(({enable:H,clickTolerance:O})=>{const K=new fs({checkCorrectEvent:Q=>oe.mouseButton(Q)===0&&!Q.ctrlKey});return new Lr({clickTolerance:O,move:(Q,re)=>({around:re,panDelta:re.sub(Q)}),activateOnStart:!0,moveStateManager:K,enable:H,assignEvents:ms})})(e),L=new _n(e,n);n.dragPan=new Cl(s,C,L),this._add("mousePan",C),this._add("touchPan",L,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);const F=new So,N=new vo;n.touchZoomRotate=new Io(s,N,F,y),this._add("touchRotate",F,["touchPan","touchZoom"]),this._add("touchZoom",N,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate);const q=n.scrollZoom=new or(n,()=>this._triggerRenderFrame());this._add("scrollZoom",q,["mousePan"]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);const Z=n.keyboard=new Hi(n);this._add("keyboard",Z),e.interactive&&e.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new Lt(n))}_add(e,n,s){this._handlers.push({handlerName:e,handler:n,allowed:s}),this._handlersById[e]=n}stop(e){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Xi(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,n,s){for(const o in e)if(o!==s&&(!n||n.indexOf(o)<0))return!0;return!1}_getMapTouches(e){const n=[];for(const s of e)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(e,n,s,o,c){if(!s)return;p.e(e,s);const m={handlerName:o,originalEvent:s.originalEvent||c};s.zoomDelta!==void 0&&(n.zoom=m),s.panDelta!==void 0&&(n.drag=m),s.pitchDelta!==void 0&&(n.pitch=m),s.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){const e={},n={},s={};for(const[o,c,m]of this._changes)o.panDelta&&(e.panDelta=(e.panDelta||new p.P(0,0))._add(o.panDelta)),o.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+o.pitchDelta),o.around!==void 0&&(e.around=o.around),o.pinchAround!==void 0&&(e.pinchAround=o.pinchAround),o.noInertia&&(e.noInertia=o.noInertia),p.e(n,c),p.e(s,m);this._updateMapTransform(e,n,s),this._changes=[]}_updateMapTransform(e,n,s){const o=this._map,c=o._getTransformForUpdate(),m=o.terrain;if(!(ys(e)||m&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:g,zoomDelta:y,bearingDelta:v,pitchDelta:S,around:T,pinchAround:C}=e;C!==void 0&&(T=C),o._stop(!0),T=T||o.transform.centerPoint;const L=c.pointLocation(g?T.sub(g):T);v&&(c.bearing+=v),S&&(c.pitch+=S),y&&(c.zoom+=y),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?c.center=c.pointLocation(c.centerPoint.sub(g)):c.setLocationAtPoint(L,T):(this._terrainMovement=!0,this._map._elevationFreeze=!0,c.setLocationAtPoint(L,T)):c.setLocationAtPoint(L,T),o._applyUpdatedTransform(c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(n,s,!0)}_fireEvents(e,n,s){const o=Xi(this._eventsInProgress),c=Xi(e),m={};for(const T in e){const{originalEvent:C}=e[T];this._eventsInProgress[T]||(m[`${T}start`]=C),this._eventsInProgress[T]=e[T]}!o&&c&&this._fireEvent("movestart",c.originalEvent);for(const T in m)this._fireEvent(T,m[T]);c&&this._fireEvent("move",c.originalEvent);for(const T in e){const{originalEvent:C}=e[T];this._fireEvent(T,C)}const g={};let y;for(const T in this._eventsInProgress){const{handlerName:C,originalEvent:L}=this._eventsInProgress[T];this._handlersById[C].isActive()||(delete this._eventsInProgress[T],y=n[C]||L,g[`${T}end`]=y)}for(const T in g)this._fireEvent(T,g[T]);const v=Xi(this._eventsInProgress),S=(o||c)&&!v;if(S&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const T=this._map._getTransformForUpdate();T.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(T)}if(s&&S){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),C=L=>L!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Me("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class El extends p.E{constructor(e,n){super(),this._renderFrameCallback=()=>{const s=Math.min((he.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new p.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,n){return this.jumpTo({center:e},n)}panBy(e,n,s){return e=p.P.convert(e).mult(-1),this.panTo(this.transform.center,p.e({offset:e},n),s)}panTo(e,n,s){return this.easeTo(p.e({center:e},n),s)}getZoom(){return this.transform.zoom}setZoom(e,n){return this.jumpTo({zoom:e},n),this}zoomTo(e,n,s){return this.easeTo(p.e({zoom:e},n),s)}zoomIn(e,n){return this.zoomTo(this.getZoom()+1,e,n),this}zoomOut(e,n){return this.zoomTo(this.getZoom()-1,e,n),this}getBearing(){return this.transform.bearing}setBearing(e,n){return this.jumpTo({bearing:e},n),this}getPadding(){return this.transform.padding}setPadding(e,n){return this.jumpTo({padding:e},n),this}rotateTo(e,n,s){return this.easeTo(p.e({bearing:e},n),s)}resetNorth(e,n){return this.rotateTo(0,p.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(p.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=p.y.number(c,q,de)),this._rotating&&(o.bearing=p.y.number(m,v,de)),this._pitching&&(o.pitch=p.y.number(g,S,de)),this._padding&&(o.interpolatePadding(y,T,de),L=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(de),K)o.setLocationAtPoint(K,Q);else{const _e=o.zoomScale(o.zoom-c),Ie=q>c?Math.min(2,O):Math.max(.5,O),ze=Math.pow(Ie,1-de),ve=o.unproject(Z.add(H.mult(de*ze)).mult(_e));o.setLocationAtPoint(o.renderWorldCopies?ve.wrap():ve,L)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},de=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,de)},e),this}_prepareEase(e,n,s={}){this._moving=!0,n||s.moving||this.fire(new p.k("movestart",e)),this._zooming&&!s.zooming&&this.fire(new p.k("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new p.k("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new p.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(n-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=p.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const n=e.getCameraPosition(),s=this.terrain.getElevationForLngLatZoom(n.lngLat,e.zoom);if(n.altitudethis._elevateCameraIfInsideTerrain(o)),this.transformCameraUpdate&&n.push(o=>this.transformCameraUpdate(o)),!n.length)return;const s=e.clone();for(const o of n){const c=s.clone(),{center:m,zoom:g,pitch:y,bearing:v,elevation:S}=o(c);m&&(c.center=m),g!==void 0&&(c.zoom=g),y!==void 0&&(c.pitch=y),v!==void 0&&(c.bearing=v),S!==void 0&&(c.elevation=S),s.apply(c)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new p.k("move",e)),this._zooming&&this.fire(new p.k("zoom",e)),this._rotating&&this.fire(new p.k("rotate",e)),this._pitching&&this.fire(new p.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,o=this._rotating,c=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new p.k("zoomend",e)),o&&this.fire(new p.k("rotateend",e)),c&&this.fire(new p.k("pitchend",e)),this.fire(new p.k("moveend",e))}flyTo(e,n){var s;if(!e.essential&&he.prefersReducedMotion){const Ae=p.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ae,n)}this.stop(),e=p.e({offset:[0,0],speed:1.2,curve:1.42,easing:p.b9},e);const o=this._getTransformForUpdate(),c=o.zoom,m=o.bearing,g=o.pitch,y=o.padding,v="bearing"in e?this._normalizeBearing(e.bearing,m):m,S="pitch"in e?+e.pitch:g,T="padding"in e?e.padding:o.padding,C=p.P.convert(e.offset);let L=o.centerPoint.add(C);const F=o.pointLocation(L),{center:N,zoom:q}=o.getConstrained(p.N.convert(e.center||F),(s=e.zoom)!==null&&s!==void 0?s:c);this._normalizeCenter(N,o);const Z=o.zoomScale(q-c),H=o.project(F),O=o.project(N).sub(H);let K=e.curve;const Q=Math.max(o.width,o.height),re=Q/Z,de=O.mag();if("minZoom"in e){const Ae=p.ac(Math.min(e.minZoom,c,q),o.minZoom,o.maxZoom),qe=Q/o.zoomScale(Ae-c);K=Math.sqrt(qe/de*2)}const _e=K*K;function Ie(Ae){const qe=(re*re-Q*Q+(Ae?-1:1)*_e*_e*de*de)/(2*(Ae?re:Q)*_e*de);return Math.log(Math.sqrt(qe*qe+1)-qe)}function ze(Ae){return(Math.exp(Ae)-Math.exp(-Ae))/2}function ve(Ae){return(Math.exp(Ae)+Math.exp(-Ae))/2}const be=Ie(!1);let Le=function(Ae){return ve(be)/ve(be+K*Ae)},Ge=function(Ae){return Q*((ve(be)*(ze(qe=be+K*Ae)/ve(qe))-ze(be))/_e)/de;var qe},Se=(Ie(!0)-be)/K;if(Math.abs(de)<1e-6||!isFinite(Se)){if(Math.abs(Q-re)<1e-6)return this.easeTo(e,n);const Ae=re0,Le=qe=>Math.exp(Ae*K*qe)}return e.duration="duration"in e?+e.duration:1e3*Se/("screenSpeed"in e?+e.screenSpeed/K:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=m!==v,this._pitching=S!==g,this._padding=!o.isPaddingEqual(T),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(N),this._ease(Ae=>{const qe=Ae*Se,St=1/Le(qe);o.zoom=Ae===1?q:c+o.scaleZoom(St),this._rotating&&(o.bearing=p.y.number(m,v,Ae)),this._pitching&&(o.pitch=p.y.number(g,S,Ae)),this._padding&&(o.interpolatePadding(y,T,Ae),L=o.centerPoint.add(C)),this.terrain&&!e.freezeElevation&&this._updateElevation(Ae);const Je=Ae===1?N:o.unproject(H.add(O.mult(Ge(qe))).mult(St));o.setLocationAtPoint(o.renderWorldCopies?Je.wrap():Je,L),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,n){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}return e||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(e,n,s){s.animate===!1||s.duration===0?(e(1),n()):(this._easeStart=he.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=p.b3(e,-180,180);const s=Math.abs(e-n);return Math.abs(e-360-n)180?-360:s<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(p.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const Hn={compact:!0,customAttribution:'MapLibre'};class Xn{constructor(e=Hn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=oe.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=oe.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=oe.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(){oe.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,n){const s=this._map._getUIString(`AttributionControl.${n}`);e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(o=>typeof o!="string"?"":o)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}const n=this._map.style.sourceCaches;for(const o in n){const c=n[o];if(c.used||c.usedForTerrain){const m=c.getSource();m.attribution&&e.indexOf(m.attribution)<0&&e.push(m.attribution)}}e=e.filter(o=>String(o).trim()),e.sort((o,c)=>o.length-c.length),e=e.filter((o,c)=>{for(let m=c+1;m=0)return!1;return!0});const s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ao{constructor(e={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=oe.create("div","maplibregl-ctrl");const n=oe.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){oe.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nt{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const n=++this._id;return this._queue.push({callback:e,id:n,cancelled:!1}),n}remove(e){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const o of s)if(o.id===e)return void(o.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Po=p.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Rc extends p.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];const s={};for(const o of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.posMatrix=new Float64Array(16),p.aP(o.posMatrix,0,p.X,0,p.X,0,1),this._tiles[o.key]=new $r(o,this.tileSize));for(const o in this._tiles)s[o]||delete this._tiles[o]}freeRtt(e){for(const n in this._tiles){const s=this._tiles[n];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const n={};for(const s of this._renderableTilesKeys){const o=this._tiles[s].tileID;if(o.canonical.equals(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16),p.aP(c.posMatrix,0,p.X,0,p.X,0,1),n[s]=c}else if(o.canonical.isChildOf(e.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=o.canonical.z-e.canonical.z,g=o.canonical.x-(o.canonical.x>>m<>m<>m;p.aP(c.posMatrix,0,v,0,v,0,1),p.J(c.posMatrix,c.posMatrix,[-g*v,-y*v,0]),n[s]=c}else if(e.canonical.isChildOf(o.canonical)){const c=e.clone();c.posMatrix=new Float64Array(16);const m=e.canonical.z-o.canonical.z,g=e.canonical.x-(e.canonical.x>>m<>m<>m;p.aP(c.posMatrix,0,p.X,0,p.X,0,1),p.J(c.posMatrix,c.posMatrix,[g*v,y*v,0]),p.K(c.posMatrix,c.posMatrix,[1/2**m,1/2**m,0]),n[s]=c}}return n}getSourceTile(e,n){const s=this.sourceCache._source;let o=e.overscaledZ-this.deltaZoom;if(o>s.maxzoom&&(o=s.maxzoom),o=s.minzoom&&(!c||!c.dem);)c=this.sourceCache.getTileByID(e.scaledTo(o--).key);return c}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=e)}}class zo{constructor(e,n,s){this.painter=e,this.sourceCache=new Rc(n),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}getDEMElevation(e,n,s,o=p.X){var c;if(!(n>=0&&n=0&&se.canonical.z&&(e.canonical.z>=o?c=e.canonical.z-o:p.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=e.canonical.x-(e.canonical.x>>c<>c<>8<<4|c>>8,n[m+3]=0;const s=new p.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),o=new mt(e,s,e.gl.RGBA,{premultiply:!1});return o.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),s=this.painter.context,o=s.gl,c=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),m=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),g=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(c,g-m-1,1,1,o.RGBA,o.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const y=n[0]+(n[2]>>4<<8),v=n[1]+((15&n[2])<<8),S=this.coordsIndex[255-n[3]],T=S&&this.sourceCache.getTileByID(S);if(!T)return null;const C=this._coordsTextureSize,L=(1<e.id!==n),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse)===!1}}const Wn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Dl{constructor(e,n){this.painter=e,this.terrain=n,this.pool=new Bc(e.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(s=>!e._layers[s].isHidden(n)),this._coordsDescendingInv={};for(const s in e.sourceCaches){this._coordsDescendingInv[s]={};const o=e.sourceCaches[s].getVisibleCoordinates();for(const c of o){const m=this.terrain.sourceCache.getTerrainCoords(c);for(const g in m)this._coordsDescendingInv[s][g]||(this._coordsDescendingInv[s][g]=[]),this._coordsDescendingInv[s][g].push(m[g])}}this._coordsDescendingInvStr={};for(const s of e._order){const o=e._layers[s],c=o.source;if(Wn[o.type]&&!this._coordsDescendingInvStr[c]){this._coordsDescendingInvStr[c]={};for(const m in this._coordsDescendingInv[c])this._coordsDescendingInvStr[c][m]=this._coordsDescendingInv[c][m].map(g=>g.key).sort().join()}}for(const s of this._renderableTiles)for(const o in this._coordsDescendingInvStr){const c=this._coordsDescendingInvStr[o][s.tileID.key];c&&c!==s.rttCoords[o]&&(s.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const n=e.type,s=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Wn[n]&&(this._prevType&&Wn[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(Wn[this._prevType]||Wn[n]&&o){this._prevType=n;const c=this._stacks.length-1,m=this._stacks[c]||[];for(const g of this._renderableTiles){if(this.pool.isFull()&&(Il(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[c]){const v=this.pool.getObjectForId(g.rtt[c].id);if(v.stamp===g.rtt[c].stamp){this.pool.useObject(v);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[c]={id:y.id,stamp:y.stamp},s.context.bindFramebuffer.set(y.fbo.framebuffer),s.context.clear({color:p.aM.transparent,stencil:0}),s.currentStencilSource=void 0;for(let v=0;v{h.touchstart=h.dragStart,h.touchmoveWindow=h.dragMove,h.touchend=h.dragEnd},Oc={showCompass:!0,showZoom:!0,visualizePitch:!1};class jc{constructor(e,n,s=!1){this.mousedown=m=>{this.startMouse(p.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),oe.mousePos(this.element,m)),oe.addEventListener(window,"mousemove",this.mousemove),oe.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,oe.mousePos(this.element,m))},this.mouseup=m=>{this.mouseRotate.dragEnd(m),this.mousePitch&&this.mousePitch.dragEnd(m),this.offTemp()},this.touchstart=m=>{m.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=oe.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),oe.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),oe.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=oe.touchPos(this.element,m.targetTouches)[0],this.moveTouch(m,this._lastPos))},this.touchend=m=>{m.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const o=e.dragRotate._mouseRotate.getClickTolerance(),c=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=yo({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{const v=new go;return new Lr({clickTolerance:g,move:(S,T)=>({bearingDelta:(T.x-S.x)*y}),moveStateManager:v,enable:m,assignEvents:Mo})})({clickTolerance:o,enable:!0}),this.map=e,s&&(this.mousePitch=xo({clickTolerance:c,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{const v=new go;return new Lr({clickTolerance:g,move:(S,T)=>({pitchDelta:(T.y-S.y)*y}),moveStateManager:v,enable:m,assignEvents:Mo})})({clickTolerance:c,enable:!0})),oe.addEventListener(n,"mousedown",this.mousedown),oe.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),oe.addEventListener(n,"touchcancel",this.reset)}startMouse(e,n){this.mouseRotate.dragStart(e,n),this.mousePitch&&this.mousePitch.dragStart(e,n),oe.disableDrag()}startTouch(e,n){this.touchRotate.dragStart(e,n),this.touchPitch&&this.touchPitch.dragStart(e,n),oe.disableDrag()}moveMouse(e,n){const s=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(e,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.mousePitch){const{pitchDelta:c}=this.mousePitch.dragMove(e,n)||{};c&&s.setPitch(s.getPitch()+c)}}moveTouch(e,n){const s=this.map,{bearingDelta:o}=this.touchRotate.dragMove(e,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.touchPitch){const{pitchDelta:c}=this.touchPitch.dragMove(e,n)||{};c&&s.setPitch(s.getPitch()+c)}}off(){const e=this.element;oe.removeEventListener(e,"mousedown",this.mousedown),oe.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),oe.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),oe.removeEventListener(window,"touchend",this.touchend),oe.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){oe.enableDrag(),oe.removeEventListener(window,"mousemove",this.mousemove),oe.removeEventListener(window,"mouseup",this.mouseup),oe.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),oe.removeEventListener(window,"touchend",this.touchend)}}let Fi;function wt(h,e,n){const s=new p.N(h.lng,h.lat);if(h=new p.N(h.lng,h.lat),e){const o=new p.N(h.lng-360,h.lat),c=new p.N(h.lng+360,h.lat),m=n.locationPoint(h).distSqr(e);n.locationPoint(o).distSqr(e)180;){const o=n.locationPoint(h);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;h.lng>n.center.lng?h.lng-=360:h.lng+=360}return h.lng!==s.lng&&n.locationPoint(h).y>n.height/2-n.getHorizon()?h:s}const Kn={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 xs(h,e,n){const s=h.classList;for(const o in Kn)s.remove(`maplibregl-${n}-anchor-${o}`);s.add(`maplibregl-${n}-anchor-${e}`)}class bs extends p.E{constructor(e){if(super(),this._onKeyPress=n=>{const s=n.code,o=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&o!==32&&o!==13||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,o=this._element;this._popup&&(s===o||o.contains(s))&&this.togglePopup()},this._update=n=>{var s;if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?wt(this._lngLat,this._flatPos,this._map.transform):(s=this._lngLat)===null||s===void 0?void 0:s.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(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 m="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?m="rotateX(0deg)":this._pitchAlignment==="map"&&(m=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),oe.setTransform(this._element,`${Kn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${c}`),he.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new p.k("dragstart"))),this.fire(new p.k("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 p.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=p.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=oe.create("div");const n=oe.createNS("http://www.w3.org/2000/svg","svg"),s=41,o=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${o}px`),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${s}`);const c=oe.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"stroke","none"),c.setAttributeNS(null,"stroke-width","1"),c.setAttributeNS(null,"fill","none"),c.setAttributeNS(null,"fill-rule","evenodd");const m=oe.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const g=oe.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const Z of y){const H=oe.createNS("http://www.w3.org/2000/svg","ellipse");H.setAttributeNS(null,"opacity","0.04"),H.setAttributeNS(null,"cx","10.5"),H.setAttributeNS(null,"cy","5.80029008"),H.setAttributeNS(null,"rx",Z.rx),H.setAttributeNS(null,"ry",Z.ry),g.appendChild(H)}const v=oe.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);const S=oe.createNS("http://www.w3.org/2000/svg","path");S.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"),v.appendChild(S);const T=oe.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"opacity","0.25"),T.setAttributeNS(null,"fill","#000000");const C=oe.createNS("http://www.w3.org/2000/svg","path");C.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"),T.appendChild(C);const L=oe.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(6.0, 7.0)"),L.setAttributeNS(null,"fill","#FFFFFF");const F=oe.createNS("http://www.w3.org/2000/svg","g");F.setAttributeNS(null,"transform","translate(8.0, 8.0)");const N=oe.createNS("http://www.w3.org/2000/svg","circle");N.setAttributeNS(null,"fill","#000000"),N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"cx","5.5"),N.setAttributeNS(null,"cy","5.5"),N.setAttributeNS(null,"r","5.4999962");const q=oe.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#FFFFFF"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962"),F.appendChild(N),F.appendChild(q),m.appendChild(g),m.appendChild(v),m.appendChild(T),m.appendChild(L),m.appendChild(F),n.appendChild(m),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",o*this._scale+"px"),this._element.appendChild(n),this._offset=p.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),xs(this._element,this._anchor,"marker"),e&&e.className)for(const n of e.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("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),oe.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=p.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const o=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[o,-1*(38.1-13.5+o)],"bottom-right":[-o,-1*(38.1-13.5+o)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var n,s;if(!(!((n=this._map)===null||n===void 0)&&n.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,c=o.terrain.depthAtPoint(this._pos),m=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,m)-c<.006)return void(this._element.style.opacity=this._opacity);const g=-this._offset.y/o.transform._pixelPerMeter,y=Math.sin(o.getPitch()*Math.PI/180)*g,v=o.terrain.depthAtPoint(new p.P(this._pos.x,this._pos.y-this._offset.y)),S=o.transform.lngLatToCameraDepth(this._lngLat,m+y)-v>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&S&&this._popup.remove(),this._element.style.opacity=S?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=p.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,n){return e===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const Rl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ea=0,Da=!1;const Tr={maxWidth:100,unit:"metric"};function La(h,e,n){const s=n&&n.maxWidth||100,o=h._container.clientHeight/2,c=h.unproject([0,o]),m=h.unproject([s,o]),g=c.distanceTo(m);if(n&&n.unit==="imperial"){const y=3.2808*g;y>5280?De(e,s,y/5280,h._getUIString("ScaleControl.Miles")):De(e,s,y,h._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?De(e,s,g/1852,h._getUIString("ScaleControl.NauticalMiles")):g>=1e3?De(e,s,g/1e3,h._getUIString("ScaleControl.Kilometers")):De(e,s,g,h._getUIString("ScaleControl.Meters"))}function De(h,e,n,s){const o=function(c){const m=Math.pow(10,`${Math.floor(c)}`.length-1);let g=c/m;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){const v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(g),m*g}(n);h.style.width=e*(o/n)+"px",h.innerHTML=`${o} ${s}`}const Ne={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},vs=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ws(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new p.P(0,0),top:new p.P(0,h),"top-left":new p.P(e,e),"top-right":new p.P(-e,e),bottom:new p.P(0,-h),"bottom-left":new p.P(e,-e),"bottom-right":new p.P(-e,-e),left:new p.P(h,0),right:new p.P(-h,0)}}if(h instanceof p.P||Array.isArray(h)){const e=p.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:p.P.convert(h.center||[0,0]),top:p.P.convert(h.top||[0,0]),"top-left":p.P.convert(h["top-left"]||[0,0]),"top-right":p.P.convert(h["top-right"]||[0,0]),bottom:p.P.convert(h.bottom||[0,0]),"bottom-left":p.P.convert(h["bottom-left"]||[0,0]),"bottom-right":p.P.convert(h["bottom-right"]||[0,0]),left:p.P.convert(h.left||[0,0]),right:p.P.convert(h.right||[0,0])}}return ws(new p.P(0,0))}const Eo=$e;z.AJAXError=p.bh,z.Evented=p.E,z.LngLat=p.N,z.MercatorCoordinate=p.Z,z.Point=p.P,z.addProtocol=p.bi,z.config=p.a,z.removeProtocol=p.bj,z.AttributionControl=Xn,z.BoxZoomHandler=Bi,z.CanvasSource=qi,z.CooperativeGesturesHandler=Gn,z.DoubleClickZoomHandler=gn,z.DragPanHandler=Cl,z.DragRotateHandler=Ml,z.EdgeInsets=Un,z.FullscreenControl=class extends p.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=n==null?void 0:n.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:p.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(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=oe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){oe.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=oe.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);oe.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_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 p.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new p.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},z.GeoJSONSource=fa,z.GeolocateControl=class extends p.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new p.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new p.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const n=new p.N(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,o=this._map.getBearing(),c=p.e({bearing:o},this.options.fitBoundsOptions),m=se.fromLngLat(n,s);this._map.fitBounds(m,c,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const n=new p.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Da)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new p.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=oe.create("button","maplibregl-ctrl-geolocate",this._container),oe.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){p.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=oe.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new bs({element:this._dotElement}),this._circleElement=oe.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new bs({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new p.k("trackuserlocationend")),this.fire(new p.k("userlocationlostfocus")))})}},this.options=p.e({},Rl,h)}onAdd(h){return this._map=h,this._container=oe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return p._(this,arguments,void 0,function*(e=!1){if(Fi!==void 0&&!e)return Fi;if(window.navigator.permissions===void 0)return Fi=!!window.navigator.geolocation,Fi;try{Fi=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Fi=!!window.navigator.geolocation}return Fi})}().then(e=>this._finishSetupUI(e)),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(),oe.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ea=0,Da=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),n=h.coords;return e&&(n.longitudee.getEast()||n.latitudee.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":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),n=h.getNorthEast(),s=e.distanceTo(n),o=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}trigger(){if(!this._setup)return p.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 p.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ea--,Da=!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 p.k("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 p.k("trackuserlocationstart")),this.fire(new p.k("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 h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ea++,Ea>1?(h={maximumAge:6e5,timeout:0},Da=!0):(h=this.options.positionOptions,Da=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}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.Hash=hs,z.ImageSource=Mr,z.KeyboardHandler=Hi,z.LngLatBounds=se,z.LogoControl=Ao,z.Map=class extends El{constructor(h){p.bf.mark(p.bg.create);const e=Object.assign(Object.assign({},Fc),h);if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new $n(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new nt,this._controls=[],this._mapId=p.a4(),this._contextLost=n=>{n.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new p.k("webglcontextlost",{originalEvent:n}))},this._contextRestored=n=>{this._setupPainter(),this.resize(),this._update(),this.fire(new p.k("webglcontextrestored",{originalEvent:n}))},this._onMapScroll=n=>{if(n.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=e.preserveDrawingBuffer===!0,this._antialias=e.antialias===!0,this._trackResize=e.trackResize===!0,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Co),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=zt.addThrottleControl(()=>this.isMoving()),this._requestManager=new Mi(e.transformRequest),typeof e.container=="string"){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;const s=Aa(o=>{this._trackResize&&!this._removed&&(this.resize(o),this.redraw())},50);this._resizeObserver=new ResizeObserver(o=>{n?s(o):n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ko(this,e),this._hash=e.hash&&new hs(typeof e.hash=="string"&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,p.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Xn(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new Ao,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update(n.dataType==="style"),this.fire(new p.k(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new p.k(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new p.k("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new p.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=h.onAdd(this);this._controls.push(h);const s=this._controlPositions[e];return e.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new p.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,n,s)}resize(h){var e;const n=this._containerDimensions(),s=n[0],o=n[1],c=this._getClampedPixelRatio(s,o);if(this._resizeCanvas(s,o,c),this.painter.resize(s,o,c),this.painter.overLimit()){const g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];const y=this._getClampedPixelRatio(s,o);this._resizeCanvas(s,o,y),this.painter.resize(s,o,y)}this.transform.resize(s,o),(e=this._requestedCameraState)===null||e===void 0||e.resize(s,o);const m=!this._moving;return m&&(this.stop(),this.fire(new p.k("movestart",h)).fire(new p.k("move",h))),this.fire(new p.k("resize",h)),m&&this.fire(new p.k("moveend",h)),this}_getClampedPixelRatio(h,e){const{0:n,1:s}=this._maxCanvasSize,o=this.getPixelRatio(),c=h*o,m=e*o;return Math.min(c>n?n/c:1,m>s?s/m:1)*o}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(se.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.minZoom=h,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=h,this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.minPitch=h,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(h>=this.transform.minPitch)return this.transform.maxPitch=h,this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.renderWorldCopies=h,this._update()}project(h){return this.transform.locationPoint(p.N.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.pointLocation(p.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,n){if(h==="mouseenter"||h==="mouseover"){let s=!1;return{layers:e,listener:n,delegates:{mousemove:c=>{const m=e.filter(y=>this.getLayer(y)),g=m.length!==0?this.queryRenderedFeatures(c.point,{layers:m}):[];g.length?s||(s=!0,n.call(this,new ri(h,this,c.originalEvent,{features:g}))):s=!1},mouseout:()=>{s=!1}}}}if(h==="mouseleave"||h==="mouseout"){let s=!1;return{layers:e,listener:n,delegates:{mousemove:m=>{const g=e.filter(y=>this.getLayer(y));(g.length!==0?this.queryRenderedFeatures(m.point,{layers:g}):[]).length?s=!0:s&&(s=!1,n.call(this,new ri(h,this,m.originalEvent)))},mouseout:m=>{s&&(s=!1,n.call(this,new ri(h,this,m.originalEvent)))}}}}{const s=o=>{const c=e.filter(g=>this.getLayer(g)),m=c.length!==0?this.queryRenderedFeatures(o.point,{layers:c}):[];m.length&&(o.features=m,n.call(this,o),delete o.features)};return{layers:e,listener:n,delegates:{[h]:s}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,n){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const s=this._delegatedListeners[h];for(let o=0;oe.includes(m))){for(const m in c.delegates)this.off(m,c.delegates[m]);return void s.splice(o,1)}}}on(h,e,n){if(n===void 0)return super.on(h,e);const s=this._createDelegatedListener(h,typeof e=="string"?[e]:e,n);this._saveDelegatedListener(h,s);for(const o in s.delegates)this.on(o,s.delegates[o]);return this}once(h,e,n){if(n===void 0)return super.once(h,e);const s=typeof e=="string"?[e]:e,o=this._createDelegatedListener(h,s,n);for(const c in o.delegates){const m=o.delegates[c];o.delegates[c]=(...g)=>{this._removeDelegatedListener(h,s,n),m(...g)}}this._saveDelegatedListener(h,o);for(const c in o.delegates)this.once(c,o.delegates[c]);return this}off(h,e,n){return n===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,n),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let n;const s=h instanceof p.P||Array.isArray(h),o=s?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:h)||{},o instanceof p.P||typeof o[0]=="number")n=[p.P.convert(o)];else{const c=p.P.convert(o[0]),m=p.P.convert(o[1]);n=[c,new p.P(m.x,c.y),m,new p.P(c.x,m.y),c]}return this.style.queryRenderedFeatures(n,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=p.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const n=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Ha(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,n):this.style.loadJSON(h,e,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ha(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const n=this._requestManager.transformRequest(h,"Style");p.h(n,new AbortController).then(s=>{this._updateDiff(s.data,e)}).catch(s=>{s&&this.fire(new p.j(s))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(n){p.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():p.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new p.j(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const n in this.style._layers){const s=this.style._layers[n];s.type==="hillshade"&&s.source===h.source&&p.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.")}this.terrain=new zo(this.painter,e,h),this.painter.renderToTexture=new Dl(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==h.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new p.k("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const n=h[e]._tiles;for(const s in n){const o=n[s];if(o.state!=="loaded"&&o.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}addImage(h,e,n={}){const{pixelRatio:s=1,sdf:o=!1,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:v}=n;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||p.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new p.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:S,height:T,data:C}=e,L=e;return this.style.addImage(h,{data:new p.R({width:S,height:T},new Uint8Array(C)),pixelRatio:s,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:v,sdf:o,version:0,userImage:L}),L.onAdd&&L.onAdd(this,h),this}}{const{width:S,height:T,data:C}=he.getImageData(e);this.style.addImage(h,{data:new p.R({width:S,height:T},C),pixelRatio:s,stretchX:c,stretchY:m,content:g,textFitWidth:y,textFitHeight:v,sdf:o,version:0})}}updateImage(h,e){const n=this.style.getImage(h);if(!n)return this.fire(new p.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=e instanceof HTMLImageElement||p.b(e)?he.getImageData(e):e,{width:o,height:c,data:m}=s;if(o===void 0||c===void 0)return this.fire(new p.j(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(o!==n.data.width||c!==n.data.height)return this.fire(new p.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(e instanceof HTMLImageElement||p.b(e));return n.data.replace(m,g),this.style.updateImage(h,n),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new p.j(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return zt.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,n){return this.style.setLayerZoomRange(h,e,n),this._update(!0)}setFilter(h,e,n={}){return this.style.setFilter(h,e,n),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,n,s={}){return this.style.setPaintProperty(h,e,n,s),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,n,s={}){return this.style.setLayoutProperty(h,e,n,s),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,n,s=>{s||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,n=>{n||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h){return this._lazyInitEmptyStyle(),this.style.setSky(h),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=oe.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=oe.create("canvas","maplibregl-canvas",e),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");const n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const o=this._controlContainer=oe.create("div","maplibregl-control-container",h),c=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{c[m]=oe.create("div",`maplibregl-ctrl-${m} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,n){this._canvas.width=Math.floor(n*h),this._canvas.height=Math.floor(n*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{e={requestedAttributes:h},s&&(e.statusMessage=s.statusMessage,e.type=s.type)},{once:!0});const n=this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h);if(!n){const s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new cs(n,this.transform),Ut.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const o=this.transform.zoom,c=he.now();this.style.zoomHistory.update(o,c);const m=new p.z(o,{now:c,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=m.crossFadingFactor();g===1&&g===this._crossFadingFactor||(n=!0,this._crossFadingFactor=g),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new p.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,p.bf.mark(p.bg.load),this.fire(new p.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new p.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,p.bf.mark(p.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),zt.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),oe.remove(this._canvasContainer),oe.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),p.bf.clearMetrics(),this._removed=!0,this.fire(new p.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,he.frameAsync(this._frameRequest).then(h=>{p.bf.frame(h),this._frameRequest=null,this._render(h)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return Ll}getCameraTargetElevation(){return this.transform.elevation}},z.MapMouseEvent=ri,z.MapTouchEvent=mn,z.MapWheelEvent=Al,z.Marker=bs,z.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),n=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);e.title=s,e.setAttribute("aria-label",s)},this.options=p.e({},Oc,h),this._container=oe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),oe.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),oe.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=oe.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new jc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){oe.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const n=oe.create("button",h,this._container);return n.type="button",n.addEventListener("click",e),n}},z.Popup=class extends p.E{constructor(h){super(),this.remove=()=>(this._content&&oe.remove(this._content),this._container&&(oe.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new p.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=oe.create("div","maplibregl-popup",this._map.getContainer()),this._tip=oe.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?wt(this._lngLat,this._flatPos,this._map.transform):(n=this._lngLat)===null||n===void 0?void 0:n.wrap(),this._trackPointer&&!e)return;const s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor;const c=ws(this.options.offset);if(!o){const g=this._container.offsetWidth,y=this._container.offsetHeight;let v;v=s.y+c.bottom.ythis._map.transform.height-y?["bottom"]:[],s.xthis._map.transform.width-g/2&&v.push("right"),o=v.length===0?"bottom":v.join("-")}let m=s.add(c[o]);this.options.subpixelPositioning||(m=m.round()),oe.setTransform(this._container,`${Kn[o]} translate(${m.x}px,${m.y}px)`),xs(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=p.e(Object.create(Ne),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new p.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=p.N.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=h;s=n.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=oe.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=oe.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(vs);h&&h.focus()}},z.RasterDEMTileSource=Ct,z.RasterTileSource=ht,z.ScaleControl=class{constructor(h){this._onMove=()=>{La(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,La(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Tr),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=oe.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){oe.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},z.ScrollZoomHandler=or,z.Style=Ha,z.TerrainControl=class{constructor(h){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=h}onAdd(h){return this._map=h,this._container=oe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=oe.create("button","maplibregl-ctrl-terrain",this._container),oe.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(){oe.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},z.TwoFingersTouchPitchHandler=Zn,z.TwoFingersTouchRotateHandler=So,z.TwoFingersTouchZoomHandler=vo,z.TwoFingersTouchZoomRotateHandler=Io,z.VectorTileSource=pa,z.VideoSource=Pn,z.addSourceType=(h,e)=>p._(void 0,void 0,void 0,function*(){if(_a(h))throw new Error(`A source type called "${h}" already exists.`);((n,s)=>{ma[n]=s})(h,e)}),z.clearPrewarmedResources=function(){const h=Ei;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(jr),Ei=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.getMaxParallelImageRequests=function(){return p.a.MAX_PARALLEL_IMAGE_REQUESTS},z.getRTLTextPluginStatus=function(){return xr().getRTLTextPluginStatus()},z.getVersion=function(){return Eo},z.getWorkerCount=function(){return gr.workerCount},z.getWorkerUrl=function(){return p.a.WORKER_URL},z.importScriptInWorkers=function(h){return da().broadcast("IS",h)},z.prewarm=function(){rn().acquire(jr)},z.setMaxParallelImageRequests=function(h){p.a.MAX_PARALLEL_IMAGE_REQUESTS=h},z.setRTLTextPlugin=function(h,e){return xr().setRTLTextPlugin(h,e)},z.setWorkerCount=function(h){gr.workerCount=h},z.setWorkerUrl=function(h){p.a.WORKER_URL=h}});var ye=Y;return ye})})(Rd);var em=Rd.exports;const wd=Qf(em);var Fd=Object.defineProperty,Sd=Object.getOwnPropertySymbols,tm=Object.prototype.hasOwnProperty,im=Object.prototype.propertyIsEnumerable,Td=(E,B,Y)=>B in E?Fd(E,B,{enumerable:!0,configurable:!0,writable:!0,value:Y}):E[B]=Y,Id=(E,B)=>{for(var Y in B||(B={}))tm.call(B,Y)&&Td(E,Y,B[Y]);if(Sd)for(var Y of Sd(B))im.call(B,Y)&&Td(E,Y,B[Y]);return E},Ni=(E,B)=>Fd(E,"name",{value:B,configurable:!0});function Qi(E,B){let Y="script";return E==="name"?Y="script":E==="name2"?Y="script2":E==="name3"&&(Y="script3"),[["coalesce",["get",`pgf:${E}`],["get",E]],{"text-font":["case",["==",["get",Y],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[B||"Noto Sans Regular"]]]}]}Ni(Qi,"get_name_block");function Qr(E,B,Y){let ne="name";return Y==="name"?ne="":Y==="name2"?ne="2":Y==="name3"&&(ne="3"),B==="Latin"?["has",`script${ne}`]:E==="ja"?["all",["!=",["get",`script${ne}`],"Han"],["!=",["get",`script${ne}`],"Hiragana"],["!=",["get",`script${ne}`],"Katakana"],["!=",["get",`script${ne}`],"Mixed-Japanese"]]:["!=",["get",`script${ne}`],B]}Ni(Qr,"is_not_in_target_script");function Or(E){return E==="Devanagari"?{"text-font":["literal",["Noto Sans Devanagari Regular v1"]]}:{}}Ni(Or,"get_font_formatting");function Rh(E){let B=rm.find(Y=>Y.lang===E);return B===void 0?"Latin":B.script}Ni(Rh,"get_default_script");function Od(E,B){let Y=B||Rh(E),ne;return Y==="Devanagari"?ne="pgf:":ne="",["format",["coalesce",["get",`${ne}name:${E}`],["get","name:en"]],Or(Y)]}Ni(Od,"get_country_name");function en(E,B,Y){let ne=B||Rh(E),pe;return ne==="Devanagari"?pe="pgf:":pe="",["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",Qr(E,ne,"name"),["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get",`${pe}name:${E}`],["get","name:en"]],Or(ne),` +`,{},["case",["all",["!",["has",`${pe}name:${E}`]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[Y||"Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name"],["get","name"]],Or(ne)]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",Qr(E,ne,"name"),Qr(E,ne,"name2")],["format",["get",`${pe}name:${E}`],Or(ne),` +`,{},...Qi("name"),` +`,{},...Qi("name2")],["case",Qr(E,ne,"name2"),["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name"],["get","name"]],Or(ne),` +`,{},...Qi("name2")],["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name2"],["get","name2"]],Or(ne),` +`,{},...Qi("name")]]],["case",["all",Qr(E,ne,"name"),Qr(E,ne,"name2"),Qr(E,ne,"name3")],["format",["get",`${pe}name:${E}`],Or(ne),` +`,{},...Qi("name"),` +`,{},...Qi("name2"),` +`,{},...Qi("name3")],["case",["!",Qr(E,ne,"name")],["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name"],["get","name"]],Or(ne),` +`,{},...Qi("name2"),` +`,{},...Qi("name3")],["!",Qr(E,ne,"name2")],["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name2"],["get","name2"]],Or(ne),` +`,{},...Qi("name"),` +`,{},...Qi("name3")],["format",["coalesce",["get",`${pe}name:${E}`],["get","pgf:name3"],["get","name3"]],Or(ne),` +`,{},...Qi("name"),` +`,{},...Qi("name2")]]]]}Ni(en,"get_multiline_name");var rm=[{lang:"ar",full_name:"Arabic",script:"Arabic"},{lang:"cs",full_name:"Czech",script:"Latin"},{lang:"bg",full_name:"Bulgarian",script:"Cyrillic"},{lang:"da",full_name:"Danish",script:"Latin"},{lang:"de",full_name:"German",script:"Latin"},{lang:"el",full_name:"Greek",script:"Greek"},{lang:"en",full_name:"English",script:"Latin"},{lang:"es",full_name:"Spanish",script:"Latin"},{lang:"et",full_name:"Estonian",script:"Latin"},{lang:"fa",full_name:"Persian",script:"Arabic"},{lang:"fi",full_name:"Finnish",script:"Latin"},{lang:"fr",full_name:"French",script:"Latin"},{lang:"ga",full_name:"Irish",script:"Latin"},{lang:"he",full_name:"Hebrew",script:"Hebrew"},{lang:"hi",full_name:"Hindi",script:"Devanagari"},{lang:"hr",full_name:"Croatian",script:"Latin"},{lang:"hu",full_name:"Hungarian",script:"Latin"},{lang:"id",full_name:"Indonesian",script:"Latin"},{lang:"it",full_name:"Italian",script:"Latin"},{lang:"ja",full_name:"Japanese",script:""},{lang:"ko",full_name:"Korean",script:"Hangul"},{lang:"lt",full_name:"Lithuanian",script:"Latin"},{lang:"lv",full_name:"Latvian",script:"Latin"},{lang:"ne",full_name:"Nepali",script:"Devanagari"},{lang:"nl",full_name:"Dutch",script:"Latin"},{lang:"no",full_name:"Norwegian",script:"Latin"},{lang:"mr",full_name:"Marathi",script:"Devanagari"},{lang:"mt",full_name:"Maltese",script:"Latin"},{lang:"pl",full_name:"Polish",script:"Latin"},{lang:"pt",full_name:"Portuguese",script:"Latin"},{lang:"ro",full_name:"Romanian",script:"Latin"},{lang:"ru",full_name:"Russian",script:"Cyrillic"},{lang:"sk",full_name:"Slovak",script:"Latin"},{lang:"sl",full_name:"Slovenian",script:"Latin"},{lang:"sv",full_name:"Swedish",script:"Latin"},{lang:"tr",full_name:"Turkish",script:"Latin"},{lang:"uk",full_name:"Ukrainian",script:"Cyrillic"},{lang:"ur",full_name:"Urdu",script:"Arabic"},{lang:"vi",full_name:"Vietnamese",script:"Latin"},{lang:"zh-Hans",full_name:"Chinese (Simplified)",script:"Han"},{lang:"zh-Hant",full_name:"Chinese (Traditional)",script:"Han"}];function Ns(E,B){return[{id:"background",type:"background",paint:{"background-color":B.background}},{id:"earth",type:"fill",filter:["==",["geometry-type"],"Polygon"],source:E,"source-layer":"earth",paint:{"fill-color":B.earth}},...B.landcover?[{id:"landcover",type:"fill",source:E,"source-layer":"landcover",paint:{"fill-color":["match",["get","kind"],"grassland",B.landcover.grassland,"barren",B.landcover.barren,"urban_area",B.landcover.urban_area,"farmland",B.landcover.farmland,"glacier",B.landcover.glacier,"scrub",B.landcover.scrub,B.landcover.forest],"fill-opacity":["interpolate",["linear"],["zoom"],5,1,7,0]}}]:[],{id:"landuse_park",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course","wood","nature_reserve","forest","scrub","grassland","grass","military","naval_base","airfield"],paint:{"fill-opacity":["interpolate",["linear"],["zoom"],6,0,11,1],"fill-color":["case",["in",["get","kind"],["literal",["national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course"]]],B.park_b,["in",["get","kind"],["literal",["wood","nature_reserve","forest"]]],B.wood_b,["in",["get","kind"],["literal",["scrub","grassland","grass"]]],B.scrub_b,["in",["get","kind"],["literal",["glacier"]]],B.glacier,["in",["get","kind"],["literal",["sand"]]],B.sand,["in",["get","kind"],["literal",["military","naval_base","airfield"]]],B.zoo,B.earth]}},{id:"landuse_urban_green",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","allotments","village_green","playground"],paint:{"fill-color":B.park_b,"fill-opacity":.7}},{id:"landuse_hospital",type:"fill",source:E,"source-layer":"landuse",filter:["==","kind","hospital"],paint:{"fill-color":B.hospital}},{id:"landuse_industrial",type:"fill",source:E,"source-layer":"landuse",filter:["==","kind","industrial"],paint:{"fill-color":B.industrial}},{id:"landuse_school",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","school","university","college"],paint:{"fill-color":B.school}},{id:"landuse_beach",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","beach"],paint:{"fill-color":B.beach}},{id:"landuse_zoo",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","zoo"],paint:{"fill-color":B.zoo}},{id:"landuse_aerodrome",type:"fill",source:E,"source-layer":"landuse",filter:["in","kind","aerodrome"],paint:{"fill-color":B.aerodrome}},{id:"roads_runway",type:"line",source:E,"source-layer":"roads",filter:["==","kind_detail","runway"],paint:{"line-color":B.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,12,4,18,30]}},{id:"roads_taxiway",type:"line",source:E,"source-layer":"roads",minzoom:13,filter:["==","kind_detail","taxiway"],paint:{"line-color":B.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,15,6]}},{id:"landuse_runway",type:"fill",source:E,"source-layer":"landuse",filter:["any",["in","kind","runway","taxiway"]],paint:{"fill-color":B.runway}},{id:"water",type:"fill",filter:["==",["geometry-type"],"Polygon"],source:E,"source-layer":"water",paint:{"fill-color":B.water}},{id:"water_stream",type:"line",source:E,"source-layer":"water",minzoom:14,filter:["in","kind","stream"],paint:{"line-color":B.water,"line-width":.5}},{id:"water_river",type:"line",source:E,"source-layer":"water",minzoom:9,filter:["in","kind","river"],paint:{"line-color":B.water,"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1,18,12]}},{id:"landuse_pedestrian",type:"fill",source:E,"source-layer":"landuse",filter:["==","kind","pedestrian"],paint:{"fill-color":B.pedestrian}},{id:"landuse_pier",type:"fill",source:E,"source-layer":"landuse",filter:["==","kind","pier"],paint:{"fill-color":B.pier}},{id:"roads_tunnels_other_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":B.tunnel_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":B.tunnel_minor_casing,"line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_link_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":B.tunnel_link_casing,"line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_major_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.tunnel_major_casing,"line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_tunnels_highway_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.tunnel_highway_casing,"line-dasharray":[6,.5],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_tunnels_other",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":B.tunnel_other,"line-dasharray":[4.5,.5],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":B.tunnel_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_tunnels_link",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":B.tunnel_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_tunnels_major",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","major_road"]],paint:{"line-color":B.tunnel_major,"line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_tunnels_highway",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==",["get","kind"],"highway"],["!",["has","is_link"]]],paint:{"line-color":B.tunnel_highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"buildings",type:"fill",source:E,"source-layer":"buildings",paint:{"fill-color":B.buildings,"fill-opacity":.5}},{id:"roads_pier",type:"line",source:E,"source-layer":"roads",filter:["==","kind_detail","pier"],paint:{"line-color":B.pier,"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,16]}},{id:"roads_minor_service_casing",type:"line",source:E,"source-layer":"roads",minzoom:13,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":B.minor_service_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,.8]}},{id:"roads_minor_casing",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":B.minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_link_casing",type:"line",source:E,"source-layer":"roads",minzoom:13,filter:["has","is_link"],paint:{"line-color":B.minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1.5]}},{id:"roads_major_casing_late",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.major_casing_late,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_highway_casing_late",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.highway_casing_late,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_other",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["in","kind","other","path"],["!=","kind_detail","pier"]],paint:{"line-color":B.other,"line-dasharray":[3,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_link",type:"line",source:E,"source-layer":"roads",filter:["has","is_link"],paint:{"line-color":B.link,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_minor_service",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":B.minor_service,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8]}},{id:"roads_minor",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":["interpolate",["exponential",1.6],["zoom"],11,B.minor_a,16,B.minor_b],"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_major_casing_early",type:"line",source:E,"source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.major_casing_early,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_major",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.major,"line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_highway_casing_early",type:"line",source:E,"source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.highway_casing_early,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1]}},{id:"roads_highway",type:"line",source:E,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"roads_rail",type:"line",source:E,"source-layer":"roads",filter:["==","kind","rail"],paint:{"line-dasharray":[.3,.75],"line-opacity":.5,"line-color":B.railway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,.15,18,9]}},{id:"boundaries_country",type:"line",source:E,"source-layer":"boundaries",filter:["<=","kind_detail",2],paint:{"line-color":B.boundaries,"line-width":1,"line-dasharray":[3,2]}},{id:"boundaries",type:"line",source:E,"source-layer":"boundaries",filter:[">","kind_detail",2],paint:{"line-color":B.boundaries,"line-width":.5,"line-dasharray":[3,2]}},{id:"roads_bridges_other_casing",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":B.bridges_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_link_casing",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":B.bridges_minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1.5]}},{id:"roads_bridges_minor_casing",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":B.bridges_minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,.8]}},{id:"roads_bridges_major_casing",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.bridges_major_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,18,10],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1.5]}},{id:"roads_bridges_other",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":B.bridges_other,"line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_minor",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":B.bridges_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_bridges_link",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":B.bridges_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_bridges_major",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":B.bridges_major,"line-width":["interpolate",["exponential",1.6],["zoom"],6,0,12,1.6,15,3,18,13]}},{id:"roads_bridges_highway_casing",type:"line",source:E,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.bridges_highway_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],3,0,3.5,.5,18,15],"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,1,20,15]}},{id:"roads_bridges_highway",type:"line",source:E,"source-layer":"roads",filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":B.bridges_highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}}]}Ni(Ns,"nolabels_layers");function Us(E,B,Y,ne){return[{id:"water_waterway_label",type:"symbol",source:E,"source-layer":"water",minzoom:13,filter:["in","kind","river","stream"],layout:{"symbol-placement":"line","text-font":[B.italic||"Noto Sans Italic"],"text-field":en(Y,ne),"text-size":12,"text-letter-spacing":.2},paint:{"text-color":B.ocean_label}},{id:"roads_labels_minor",type:"symbol",source:E,"source-layer":"roads",minzoom:15,filter:["in","kind","minor_road","other","path"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":[B.regular||"Noto Sans Regular"],"text-field":en(Y,ne),"text-size":12},paint:{"text-color":B.roads_label_minor,"text-halo-color":B.roads_label_minor_halo,"text-halo-width":1,"text-halo-blur":1}},{id:"water_label_ocean",type:"symbol",source:E,"source-layer":"water",filter:["in","kind","sea","ocean","lake","water","bay","strait","fjord"],layout:{"text-font":[B.italic||"Noto Sans Italic"],"text-field":en(Y,ne,B.regular),"text-size":["interpolate",["linear"],["zoom"],3,10,10,12],"text-letter-spacing":.1,"text-max-width":9,"text-transform":"uppercase"},paint:{"text-color":B.ocean_label}},{id:"water_label_lakes",type:"symbol",source:E,"source-layer":"water",filter:["in","kind","lake","water"],layout:{"text-font":[B.italic||"Noto Sans Italic"],"text-field":en(Y,ne,B.regular),"text-size":["interpolate",["linear"],["zoom"],3,0,6,12,10,12],"text-letter-spacing":.1,"text-max-width":9},paint:{"text-color":B.ocean_label}},{id:"roads_labels_major",type:"symbol",source:E,"source-layer":"roads",minzoom:11,filter:["in","kind","highway","major_road"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":[B.regular||"Noto Sans Regular"],"text-field":en(Y,ne,B.regular),"text-size":12},paint:{"text-color":B.roads_label_major,"text-halo-color":B.roads_label_major_halo,"text-halo-width":1,"text-halo-blur":1}},...B.pois?[{id:"pois",type:"symbol",source:E,"source-layer":"pois",filter:["all",["in",["get","kind"],["literal",["beach","forest","marina","park","peak","zoo","garden","bench","aerodrome","station","bus_stop","ferry_terminal","stadium","university","library","school","animal","toilets","drinking_water"]]],[">=",["zoom"],["+",["get","min_zoom"],0]]],layout:{"icon-image":["match",["get","kind"],"station","train_station",["get","kind"]],"text-font":[B.regular||"Noto Sans Regular"],"text-justify":"auto","text-field":en(Y,ne,B.regular),"text-size":["interpolate",["linear"],["zoom"],17,10,19,16],"text-max-width":8,"text-offset":[1.1,0],"text-variable-anchor":["left","right"]},paint:{"text-color":["case",["in",["get","kind"],["literal",["beach","forest","marina","park","peak","zoo","garden","bench"]]],B.pois.green,["in",["get","kind"],["literal",["aerodrome","station","bus_stop","ferry_terminal"]]],B.pois.lapis,["in",["get","kind"],["literal",["stadium","university","library","school","animal","toilets","drinking_water"]]],B.pois.slategray,B.earth]}}]:[],{id:"places_subplace",type:"symbol",source:E,"source-layer":"places",filter:["==","kind","neighbourhood"],layout:{"symbol-sort-key":["get","min_zoom"],"text-field":en(Y,ne,B.regular),"text-font":[B.regular||"Noto Sans Regular"],"text-max-width":7,"text-letter-spacing":.1,"text-padding":["interpolate",["linear"],["zoom"],5,2,8,4,12,18,15,20],"text-size":["interpolate",["exponential",1.2],["zoom"],11,8,14,14,18,24],"text-transform":"uppercase"},paint:{"text-color":B.subplace_label,"text-halo-color":B.subplace_label_halo,"text-halo-width":1,"text-halo-blur":1}},{id:"places_locality",type:"symbol",source:E,"source-layer":"places",filter:["==","kind","locality"],layout:{"icon-image":["step",["zoom"],"townspot",8,""],"icon-size":.7,"text-field":en(Y,ne,B.regular),"text-font":["case",["<=",["get","min_zoom"],5],["literal",[B.bold||"Noto Sans Medium"]],["literal",[B.regular||"Noto Sans Regular"]]],"text-padding":["interpolate",["linear"],["zoom"],5,3,8,7,12,11],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],13],8,[">=",["get","population_rank"],13],13,0],4,["case",["<",["get","population_rank"],13],10,[">=",["get","population_rank"],13],15,0],6,["case",["<",["get","population_rank"],12],11,[">=",["get","population_rank"],12],17,0],8,["case",["<",["get","population_rank"],11],11,[">=",["get","population_rank"],11],18,0],10,["case",["<",["get","population_rank"],9],12,[">=",["get","population_rank"],9],20,0],15,["case",["<",["get","population_rank"],8],12,[">=",["get","population_rank"],8],22,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,0,8,4,10,8,12,6,22,2],"text-justify":"auto","text-anchor":["step",["zoom"],"left",8,"center"],"text-radial-offset":.4},paint:{"text-color":B.city_label,"text-halo-color":B.city_label_halo,"text-halo-width":1,"text-halo-blur":1}},{id:"places_region",type:"symbol",source:E,"source-layer":"places",filter:["==","kind","region"],layout:{"symbol-sort-key":["get","min_zoom"],"text-field":["step",["zoom"],["get","name:short"],6,en(Y,ne,B.regular)],"text-font":[B.regular||"Noto Sans Regular"],"text-size":["interpolate",["linear"],["zoom"],3,11,7,16],"text-radial-offset":.2,"text-anchor":"center","text-transform":"uppercase"},paint:{"text-color":B.state_label,"text-halo-color":B.state_label_halo,"text-halo-width":1,"text-halo-blur":1}},{id:"places_country",type:"symbol",source:E,"source-layer":"places",filter:["==","kind","country"],layout:{"symbol-sort-key":["get","min_zoom"],"text-field":Od(Y,ne),"text-font":[B.bold||"Noto Sans Medium"],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],10],8,[">=",["get","population_rank"],10],12,0],6,["case",["<",["get","population_rank"],8],10,[">=",["get","population_rank"],8],18,0],8,["case",["<",["get","population_rank"],7],11,[">=",["get","population_rank"],7],20,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,2,14,2,16,20,17,2,22,2],"text-transform":"uppercase"},paint:{"text-color":B.country_label}}]}Ni(Us,"labels_layers");var nm={background:"#dddddd",earth:"#ededed",park_a:"#bfc99c",park_b:"#bfc99c",hospital:"#ffeae8",industrial:"#f8ffed",school:"#f2fef9",wood_a:"#bfc99c",wood_b:"#bfc99c",pedestrian:"#eef0f0",scrub_a:"#bfc99c",scrub_b:"#bfc99c",glacier:"#ffffff",sand:"#ebe7da",beach:"#ebe7da",aerodrome:"#dbe7e7",runway:"#d1d9d9",water:"#84b7cf",zoo:"#ebe6ed",military:"#ebe6ed",tunnel_other_casing:"#ffffff",tunnel_minor_casing:"#e2e2e2",tunnel_link_casing:"#e2e2e2",tunnel_major_casing:"#e3cfd3",tunnel_highway_casing:"#ebcea2",tunnel_other:"#f7f7f7",tunnel_minor:"#ebebeb",tunnel_link:"#ebebeb",tunnel_major:"#ebebeb",tunnel_highway:"#ebebeb",pier:"#ededed",buildings:"#cbcece",minor_service_casing:"#e2e2e2",minor_casing:"#e2e2e2",link_casing:"#e2e2e2",major_casing_late:"#e3cfd3",highway_casing_late:"#ebcea2",other:"#ffffff",minor_service:"#ffffff",minor_a:"#fff2bb",minor_b:"#fff2bb",link:"#fff2bb",major_casing_early:"#e3cfd3",major:"#ffdf59",highway_casing_early:"#ebcea2",highway:"#e9ac77",railway:"#b3bcc9",boundaries:"#5c4a6b",waterway_label:"#a4cae1",bridges_other_casing:"#ffffff",bridges_minor_casing:"#e2e2e2",bridges_link_casing:"#e1e1e1",bridges_major_casing:"#e3cfd3",bridges_highway_casing:"#ebcea2",bridges_other:"#ffffff",bridges_minor:"#ffffff",bridges_link:"#e1e1e1",bridges_major:"#ffffff",bridges_highway:"#fefffc",roads_label_minor:"#91888b",roads_label_minor_halo:"#ffffff",roads_label_major:"#91888b",roads_label_major_halo:"#ffffff",ocean_label:"#ffffff",peak_label:"#61bb5b",subplace_label:"#757d91",subplace_label_halo:"#ffffff",city_label:"#3c3c3c",city_label_halo:"#ffffff",state_label:"#777777",state_label_halo:"#ffffff",country_label:"#9590aa"},am={background:"#cccccc",earth:"#e2dfda",park_a:"#cfddd5",park_b:"#9cd3b4",hospital:"#e4dad9",industrial:"#d1dde1",school:"#e4ded7",wood_a:"#d0ded0",wood_b:"#a0d9a0",pedestrian:"#e3e0d4",scrub_a:"#cedcd7",scrub_b:"#99d2bb",glacier:"#e7e7e7",sand:"#e2e0d7",beach:"#e8e4d0",aerodrome:"#dadbdf",runway:"#e9e9ed",water:"#80deea",zoo:"#c6dcdc",military:"#dcdcdc",tunnel_other_casing:"#e0e0e0",tunnel_minor_casing:"#e0e0e0",tunnel_link_casing:"#e0e0e0",tunnel_major_casing:"#e0e0e0",tunnel_highway_casing:"#e0e0e0",tunnel_other:"#d5d5d5",tunnel_minor:"#d5d5d5",tunnel_link:"#d5d5d5",tunnel_major:"#d5d5d5",tunnel_highway:"#d5d5d5",pier:"#e0e0e0",buildings:"#cccccc",minor_service_casing:"#e0e0e0",minor_casing:"#e0e0e0",link_casing:"#e0e0e0",major_casing_late:"#e0e0e0",highway_casing_late:"#e0e0e0",other:"#ebebeb",minor_service:"#ebebeb",minor_a:"#ebebeb",minor_b:"#ffffff",link:"#ffffff",major_casing_early:"#e0e0e0",major:"#ffffff",highway_casing_early:"#e0e0e0",highway:"#ffffff",railway:"#a7b1b3",boundaries:"#adadad",waterway_label:"#ffffff",bridges_other_casing:"#e0e0e0",bridges_minor_casing:"#e0e0e0",bridges_link_casing:"#e0e0e0",bridges_major_casing:"#e0e0e0",bridges_highway_casing:"#e0e0e0",bridges_other:"#ebebeb",bridges_minor:"#ffffff",bridges_link:"#ffffff",bridges_major:"#f5f5f5",bridges_highway:"#ffffff",roads_label_minor:"#91888b",roads_label_minor_halo:"#ffffff",roads_label_major:"#938a8d",roads_label_major_halo:"#ffffff",ocean_label:"#728dd4",peak_label:"#7e9aa0",subplace_label:"#8f8f8f",subplace_label_halo:"#e0e0e0",city_label:"#5c5c5c",city_label_halo:"#e0e0e0",state_label:"#b3b3b3",state_label_halo:"#e0e0e0",country_label:"#a3a3a3",pois:{blue:"#1A8CBD",green:"#20834D",lapis:"#315BCF",pink:"#EF56BA",red:"#F2567A",slategray:"#6A5B8F",tangerine:"#CB6704",turquoise:"#00C3D4"},landcover:{grassland:"rgba(210, 239, 207, 1)",barren:"rgba(255, 243, 215, 1)",urban_area:"rgba(230, 230, 230, 1)",farmland:"rgba(216, 239, 210, 1)",glacier:"rgba(255, 255, 255, 1)",scrub:"rgba(234, 239, 210, 1)",forest:"rgba(196, 231, 210, 1)"}},sm={background:"#34373d",earth:"#1f1f1f",park_a:"#1c2421",park_b:"#192a24",hospital:"#252424",industrial:"#222222",school:"#262323",wood_a:"#202121",wood_b:"#202121",pedestrian:"#1e1e1e",scrub_a:"#222323",scrub_b:"#222323",glacier:"#1c1c1c",sand:"#212123",beach:"#28282a",aerodrome:"#1e1e1e",runway:"#333333",water:"#31353f",zoo:"#222323",military:"#242323",tunnel_other_casing:"#141414",tunnel_minor_casing:"#141414",tunnel_link_casing:"#141414",tunnel_major_casing:"#141414",tunnel_highway_casing:"#141414",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",pier:"#333333",buildings:"#111111",minor_service_casing:"#1f1f1f",minor_casing:"#1f1f1f",link_casing:"#1f1f1f",major_casing_late:"#1f1f1f",highway_casing_late:"#1f1f1f",other:"#333333",minor_service:"#333333",minor_a:"#3d3d3d",minor_b:"#333333",link:"#3d3d3d",major_casing_early:"#1f1f1f",major:"#3d3d3d",highway_casing_early:"#1f1f1f",highway:"#474747",railway:"#000000",boundaries:"#5b6374",waterway_label:"#717784",bridges_other_casing:"#2b2b2b",bridges_minor_casing:"#1f1f1f",bridges_link_casing:"#1f1f1f",bridges_major_casing:"#1f1f1f",bridges_highway_casing:"#1f1f1f",bridges_other:"#333333",bridges_minor:"#333333",bridges_link:"#3d3d3d",bridges_major:"#3d3d3d",bridges_highway:"#474747",roads_label_minor:"#525252",roads_label_minor_halo:"#1f1f1f",roads_label_major:"#666666",roads_label_major_halo:"#1f1f1f",ocean_label:"#717784",peak_label:"#898080",subplace_label:"#525252",subplace_label_halo:"#1f1f1f",city_label:"#7a7a7a",city_label_halo:"#212121",state_label:"#3d3d3d",state_label_halo:"#1f1f1f",country_label:"#5c5c5c",pois:{blue:"#4299BB",green:"#30C573",lapis:"#2B5CEA",pink:"#EF56BA",red:"#F2567A",slategray:"#93939F",tangerine:"#F19B6E",turquoise:"#00C3D4"},landcover:{grassland:"rgba(30, 41, 31, 1)",barren:"rgba(38, 38, 36, 1)",urban_area:"rgba(28, 28, 28, 1)",farmland:"rgba(31, 36, 32, 1)",glacier:"rgba(43, 43, 43, 1)",scrub:"rgba(34, 36, 30, 1)",forest:"rgba(28, 41, 37, 1)"}},om={background:"#ffffff",earth:"#ffffff",park_a:"#fcfcfc",park_b:"#fcfcfc",hospital:"#f8f8f8",industrial:"#fcfcfc",school:"#f8f8f8",wood_a:"#fafafa",wood_b:"#fafafa",pedestrian:"#fdfdfd",scrub_a:"#fafafa",scrub_b:"#fafafa",glacier:"#fcfcfc",sand:"#fafafa",beach:"#f6f6f6",aerodrome:"#fdfdfd",runway:"#efefef",water:"#dcdcdc",zoo:"#f7f7f7",military:"#fcfcfc",tunnel_other_casing:"#d6d6d6",tunnel_minor_casing:"#fcfcfc",tunnel_link_casing:"#fcfcfc",tunnel_major_casing:"#fcfcfc",tunnel_highway_casing:"#fcfcfc",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",pier:"#efefef",buildings:"#efefef",minor_service_casing:"#ffffff",minor_casing:"#ffffff",link_casing:"#ffffff",major_casing_late:"#ffffff",highway_casing_late:"#ffffff",other:"#f5f5f5",minor_service:"#f5f5f5",minor_a:"#ebebeb",minor_b:"#f5f5f5",link:"#ebebeb",major_casing_early:"#ffffff",major:"#ebebeb",highway_casing_early:"#ffffff",highway:"#ebebeb",railway:"#d6d6d6",boundaries:"#adadad",waterway_label:"#adadad",bridges_other_casing:"#ffffff",bridges_minor_casing:"#ffffff",bridges_link_casing:"#ffffff",bridges_major_casing:"#ffffff",bridges_highway_casing:"#ffffff",bridges_other:"#f5f5f5",bridges_minor:"#f5f5f5",bridges_link:"#ebebeb",bridges_major:"#ebebeb",bridges_highway:"#ebebeb",roads_label_minor:"#adadad",roads_label_minor_halo:"#ffffff",roads_label_major:"#999999",roads_label_major_halo:"#ffffff",ocean_label:"#adadad",peak_label:"#adadad",subplace_label:"#8f8f8f",subplace_label_halo:"#ffffff",city_label:"#5c5c5c",city_label_halo:"#ffffff",state_label:"#b3b3b3",state_label_halo:"#ffffff",country_label:"#b8b8b8"},lm={background:"#a3a3a3",earth:"#cccccc",park_a:"#c2c2c2",park_b:"#c2c2c2",hospital:"#d0d0d0",industrial:"#c6c6c6",school:"#d0d0d0",wood_a:"#c2c2c2",wood_b:"#c2c2c2",pedestrian:"#c4c4c4",scrub_a:"#c2c2c2",scrub_b:"#c2c2c2",glacier:"#d2d2d2",sand:"#d2d2d2",beach:"#d2d2d2",aerodrome:"#c9c9c9",runway:"#f5f5f5",water:"#a3a3a3",zoo:"#c7c7c7",military:"#bfbfbf",tunnel_other_casing:"#b8b8b8",tunnel_minor_casing:"#b8b8b8",tunnel_link_casing:"#b8b8b8",tunnel_major_casing:"#b8b8b8",tunnel_highway_casing:"#b8b8b8",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",pier:"#b8b8b8",buildings:"#e0e0e0",minor_service_casing:"#cccccc",minor_casing:"#cccccc",link_casing:"#cccccc",major_casing_late:"#cccccc",highway_casing_late:"#cccccc",other:"#e0e0e0",minor_service:"#e0e0e0",minor_a:"#ebebeb",minor_b:"#e0e0e0",link:"#ebebeb",major_casing_early:"#cccccc",major:"#ebebeb",highway_casing_early:"#cccccc",highway:"#ebebeb",railway:"#f5f5f5",boundaries:"#5c5c5c",waterway_label:"#7a7a7a",bridges_other_casing:"#cccccc",bridges_minor_casing:"#cccccc",bridges_link_casing:"#cccccc",bridges_major_casing:"#cccccc",bridges_highway_casing:"#cccccc",bridges_other:"#e0e0e0",bridges_minor:"#e0e0e0",bridges_link:"#ebebeb",bridges_major:"#ebebeb",bridges_highway:"#ebebeb",roads_label_minor:"#999999",roads_label_minor_halo:"#e0e0e0",roads_label_major:"#8f8f8f",roads_label_major_halo:"#ebebeb",ocean_label:"#7a7a7a",peak_label:"#5c5c5c",subplace_label:"#7a7a7a",subplace_label_halo:"#cccccc",city_label:"#474747",city_label_halo:"#cccccc",state_label:"#999999",state_label_halo:"#cccccc",country_label:"#858585"},cm={background:"#2b2b2b",earth:"#141414",park_a:"#181818",park_b:"#181818",hospital:"#1d1d1d",industrial:"#101010",school:"#111111",wood_a:"#1a1a1a",wood_b:"#1a1a1a",pedestrian:"#191919",scrub_a:"#1c1c1c",scrub_b:"#1c1c1c",glacier:"#191919",sand:"#161616",beach:"#1f1f1f",aerodrome:"#191919",runway:"#323232",water:"#333333",zoo:"#191919",military:"#121212",tunnel_other_casing:"#101010",tunnel_minor_casing:"#101010",tunnel_link_casing:"#101010",tunnel_major_casing:"#101010",tunnel_highway_casing:"#101010",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",pier:"#0a0a0a",buildings:"#0a0a0a",minor_service_casing:"#141414",minor_casing:"#141414",link_casing:"#141414",major_casing_late:"#141414",highway_casing_late:"#141414",other:"#1f1f1f",minor_service:"#1f1f1f",minor_a:"#292929",minor_b:"#1f1f1f",link:"#1f1f1f",major_casing_early:"#141414",major:"#292929",highway_casing_early:"#141414",highway:"#292929",railway:"#292929",boundaries:"#707070",waterway_label:"#707070",bridges_other_casing:"#141414",bridges_minor_casing:"#141414",bridges_link_casing:"#141414",bridges_major_casing:"#141414",bridges_highway_casing:"#141414",bridges_other:"#1f1f1f",bridges_minor:"#1f1f1f",bridges_link:"#292929",bridges_major:"#292929",bridges_highway:"#292929",roads_label_minor:"#525252",roads_label_minor_halo:"#141414",roads_label_major:"#5c5c5c",roads_label_major_halo:"#141414",ocean_label:"#707070",peak_label:"#707070",subplace_label:"#5c5c5c",subplace_label_halo:"#141414",city_label:"#999999",city_label_halo:"#141414",state_label:"#3d3d3d",state_label_halo:"#141414",country_label:"#707070"},hm={light:am,dark:sm,white:om,grayscale:lm,black:cm,contrast:nm},pc=hm;function um(E,B,Y,ne){let pe=pc[B];return Ns(E,pe).concat(Us(E,pe,Y,ne))}Ni(um,"default");function dm(E,B){let Y=pc[B];return Ns(E,Y)}Ni(dm,"noLabels");function pm(E,B,Y,ne){let pe=pc[B];return Us(E,pe,Y,ne)}Ni(pm,"labels");function jd(E,B,Y,ne){return Ns(E,B).concat(Us(E,B,Y,ne))}Ni(jd,"layersWithCustomTheme");function fm(E,B,Y,ne,pe){let ye=Id(Id({},pc[B]),Y);return Ns(E,ye).concat(Us(E,ye,ne,pe))}Ni(fm,"layersWithPartialCustomTheme");function Vd(E,B){return Ns(E,B)}Ni(Vd,"noLabelsWithCustomTheme");function mm(E,B,Y,ne){return Us(E,B,Y,ne)}Ni(mm,"labelsWithCustomTheme");const _m={background:"#dddddd",earth:"#ededed",park_a:"#bfc99c",park_b:"#bfc99c",hospital:"#ffeae8",industrial:"#f8ffed",school:"#f2fef9",wood_a:"#bfc99c",wood_b:"#bfc99c",pedestrian:"#eef0f0",scrub_a:"#bfc99c",scrub_b:"#bfc99c",glacier:"#ffffff",sand:"#ebe7da",beach:"#ebe7da",aerodrome:"#dbe7e7",runway:"#d1d9d9",water:"#84b7cf",zoo:"#ebe6ed",military:"#ebe6ed",tunnel_other_casing:"#ffffff",tunnel_minor_casing:"#e2e2e2",tunnel_link_casing:"#e2e2e2",tunnel_major_casing:"#e3cfd3",tunnel_highway_casing:"#ebcea2",tunnel_other:"#f7f7f7",tunnel_minor:"#ebebeb",tunnel_link:"#ebebeb",tunnel_major:"#ebebeb",tunnel_highway:"#ebebeb",pier:"#ededed",buildings:"#cbcece",minor_service_casing:"#e2e2e2",minor_casing:"#e2e2e2",link_casing:"#e2e2e2",major_casing_late:"#e3cfd3",highway_casing_late:"#ebcea2",other:"#ffffff",minor_service:"#ffffff",minor_a:"#fff2bb",minor_b:"#fff2bb",link:"#fff2bb",major_casing_early:"#e3cfd3",major:"#ffdf59",highway_casing_early:"#ebcea2",highway:"#e9ac77",railway:"#b3bcc9",boundaries:"#5c4a6b",waterway_label:"#a4cae1",bridges_other_casing:"#ffffff",bridges_minor_casing:"#e2e2e2",bridges_link_casing:"#e1e1e1",bridges_major_casing:"#e3cfd3",bridges_highway_casing:"#ebcea2",bridges_other:"#ffffff",bridges_minor:"#ffffff",bridges_link:"#e1e1e1",bridges_major:"#ffffff",bridges_highway:"#fefffc",roads_label_minor:"#91888b",roads_label_minor_halo:"#ffffff",roads_label_major:"#91888b",roads_label_major_halo:"#ffffff",ocean_label:"#ffffff",peak_label:"#61bb5b",subplace_label:"#757d91",subplace_label_halo:"#ffffff",city_label:"#3c3c3c",city_label_halo:"#ffffff",state_label:"#777777",state_label_halo:"#ffffff",country_label:"#9590aa"},gm={background:"rgba(255, 255, 255, 1)",earth:"rgba(226, 222, 235, 1)",park_a:"#51cbdd",park_b:"#51cbdd",hospital:"rgba(242, 175, 195, 1)",industrial:"rgba(183, 196, 240, 1)",school:"rgba(242, 174, 78, 1)",wood_a:"#52c5a7",wood_b:"#52c5a7",pedestrian:"rgba(205, 198, 218, 1)",scrub_a:"#eccb6a",scrub_b:"#eccb6a",glacier:"rgba(238, 230, 240, 1)",sand:"rgba(240, 200, 73, 1)",beach:"rgba(244, 219, 118, 1)",aerodrome:"rgba(221, 222, 187, 1)",runway:"rgba(255, 255, 255, 1)",water:"rgba(138, 222, 255, 1)",zoo:"rgba(145, 214, 197, 1)",military:"rgba(145, 214, 197, 1)",tunnel_other_casing:"rgba(226, 222, 235, 1)",tunnel_minor_casing:"rgba(226, 222, 235, 1)",tunnel_link_casing:"rgba(226, 222, 235, 1)",tunnel_major_casing:"rgba(226, 222, 235, 1)",tunnel_highway_casing:"rgba(226, 222, 235, 1)",tunnel_other:"rgba(255, 255, 255, 1)",tunnel_minor:"rgba(255, 255, 255, 1)",tunnel_link:"rgba(255, 255, 255, 1)",tunnel_major:"rgba(255, 255, 255, 1)",tunnel_highway:"rgba(255, 255, 255, 1)",pier:"rgba(109, 177, 236, 1)",buildings:"rgba(204, 201, 220, 1)",minor_service_casing:"rgba(226, 222, 235, 1)",minor_casing:"rgba(226, 222, 235, 1)",link_casing:"rgba(226, 222, 235, 1)",major_casing_late:"rgba(226, 222, 235, 1)",highway_casing_late:"rgba(226, 222, 235, 1)",other:"rgba(255, 255, 255, 1)",minor_service:"rgba(255, 255, 255, 1)",minor_a:"#ffffff",minor_b:"#ffffff",link:"rgba(255, 255, 255, 1)",major_casing_early:"rgba(226, 222, 235, 1)",major:"rgba(255, 255, 255, 1)",highway_casing_early:"rgba(226, 222, 235, 1)",highway:"rgba(255, 255, 255, 1)",railway:"rgba(252, 249, 248, 1)",boundaries:"rgba(16, 24, 101, 1)",waterway_label:"",bridges_other_casing:"rgba(226, 222, 235, 1)",bridges_minor_casing:"rgba(226, 222, 235, 1)",bridges_link_casing:"rgba(226, 222, 235, 1)",bridges_major_casing:"rgba(226, 222, 235, 1)",bridges_highway_casing:"rgba(226, 222, 235, 1)",bridges_other:"rgba(255, 255, 255, 1)",bridges_minor:"rgba(255, 255, 255, 1)",bridges_link:"rgba(255, 255, 255, 1)",bridges_major:"rgba(255, 255, 255, 1)",bridges_highway:"rgba(255, 255, 255, 1)",roads_label_minor:"rgba(55, 22, 65, 1)",roads_label_minor_halo:"rgba(255, 255, 255, 1)",roads_label_major:"rgba(55, 22, 65, 1)",roads_label_major_halo:"#ffffff",ocean_label:"rgba(44, 107, 216, 1)",peak_label:"#61bb5b",subplace_label:"rgba(130, 109, 145, 1)",subplace_label_halo:"rgba(0,0,0,0)",city_label:"rgba(3, 23, 74, 1)",city_label_halo:"rgba(0,0,0,0)",state_label:"rgba(112, 78, 125, 1)",state_label_halo:"rgba(0,0,0,0)",country_label:"rgba(94, 96, 126, 1)",regular:"Poppins Regular",bold:"Poppins Medium",italic:"Poppins Italic",landcover:{grassland:"rgba(56, 224, 140, 1)",barren:"rgba(224, 195, 133, 1)",urban_area:"rgba(232, 190, 247, 1)",farmland:"rgba(44, 203, 158, 1)",glacier:"rgba(238, 230, 240, 1)",scrub:"rgba(122, 205, 111, 1)",forest:"rgba(57, 205, 151, 1)"}},ym={background:"rgba(231, 240, 221, 1)",earth:"rgba(231, 240, 221, 1)",park_a:"#8ad3d4",park_b:"#8ad3d4",hospital:"rgba(253, 160, 179, 1)",industrial:"rgba(191, 189, 186, 1)",school:"rgba(250, 220, 166, 1)",wood_a:"#94ccc3",wood_b:"#94ccc3",pedestrian:"rgba(198, 220, 216, 1)",scrub_a:"#a4c6a2",scrub_b:"#a4c6a2",glacier:"rgba(239, 240, 231, 1)",sand:"rgba(222, 218, 189, 1)",beach:"rgba(236, 251, 218, 1)",aerodrome:"rgba(218, 211, 208, 1)",runway:"rgba(232, 250, 238, 1)",water:"rgba(173, 230, 221, 1)",zoo:"rgba(143, 211, 167, 1)",military:"rgba(173, 188, 195, 1)",tunnel_other_casing:"rgba(231, 240, 221, 1)",tunnel_minor_casing:"rgba(231, 240, 221, 1)",tunnel_link_casing:"rgba(231, 240, 221, 1)",tunnel_major_casing:"rgba(231, 240, 221, 1)",tunnel_highway_casing:"rgba(231, 240, 221, 1)",tunnel_other:"rgba(255, 255, 255, 1)",tunnel_minor:"rgba(255, 255, 255, 1)",tunnel_link:"rgba(255, 255, 255, 1)",tunnel_major:"rgba(255, 255, 255, 1)",tunnel_highway:"rgba(255, 255, 255, 1)",pier:"rgba(137, 195, 217, 1)",buildings:"rgba(218, 222, 217, 1)",minor_service_casing:"rgba(231, 240, 221, 1)",minor_casing:"rgba(231, 240, 221, 1)",link_casing:"rgba(231, 240, 221, 1)",major_casing_late:"rgba(231, 240, 221, 1)",highway_casing_late:"rgba(231, 240, 221, 1)",other:"rgba(255, 255, 255, 1)",minor_service:"rgba(255, 255, 255, 1)",minor_a:"#ffffff",minor_b:"#ffffff",link:"rgba(255, 255, 255, 1)",major_casing_early:"rgba(231, 240, 221, 1)",major:"rgba(255, 255, 255, 1)",highway_casing_early:"rgba(231, 240, 221, 1)",highway:"rgba(255, 255, 255, 1)",railway:"rgba(255, 255, 255, 1)",boundaries:"rgba(136, 148, 136, 1)",waterway_label:"rgba(90, 145, 147, 1)",bridges_other_casing:"rgba(231, 240, 221, 1)",bridges_minor_casing:"rgba(231, 240, 221, 1)",bridges_link_casing:"rgba(231, 240, 221, 1)",bridges_major_casing:"rgba(231, 240, 221, 1)",bridges_highway_casing:"rgba(231, 240, 221, 1)",bridges_other:"rgba(255, 255, 255, 1)",bridges_minor:"#ffffff",bridges_link:"#ffffff",bridges_major:"rgba(255, 255, 255, 1)",bridges_highway:"#ffffff",roads_label_minor:"rgba(137, 149, 142, 1)",roads_label_minor_halo:"#ffffff",roads_label_major:"rgba(137, 149, 142, 1)",roads_label_major_halo:"#ffffff",ocean_label:"rgba(91, 179, 181, 1)",peak_label:"rgba(95, 108, 135, 1)",subplace_label:"rgba(131, 130, 130, 1)",subplace_label_halo:"rgba(0,0,0,0)",city_label:"rgba(84, 92, 94, 1)",city_label_halo:"rgba(0,0,0,0)",state_label:"rgba(118, 118, 118, 1)",state_label_halo:"rgba(0,0,0,0)",country_label:"rgba(130, 145, 155, 1)",regular:"Jost Regular",bold:"Jost Medium",italic:"Jost Italic",landcover:{grassland:"rgba(143, 201, 173, 1)",barren:"rgba(232, 214, 183, 1)",urban_area:"rgba(224, 232, 216, 1)",farmland:"rgba(165, 213, 166, 1)",glacier:"rgba(239, 240, 231, 1)",scrub:"rgba(176, 205, 174, 1)",forest:"rgba(149, 207, 194, 1)"}},tt="rgba(255, 255, 255, 1)",At="rgba(0, 0, 0, 1)",xm={background:tt,earth:tt,park_a:tt,park_b:tt,hospital:tt,industrial:tt,school:tt,wood_a:tt,wood_b:tt,pedestrian:tt,scrub_a:tt,scrub_b:tt,glacier:tt,sand:tt,beach:tt,aerodrome:tt,runway:At,water:At,zoo:tt,military:tt,tunnel_other_casing:tt,tunnel_minor_casing:tt,tunnel_link_casing:tt,tunnel_major_casing:tt,tunnel_highway_casing:tt,tunnel_other:At,tunnel_minor:At,tunnel_link:At,tunnel_major:At,tunnel_highway:At,pier:tt,buildings:"rgba(218, 222, 217, 1)",minor_service_casing:tt,minor_casing:tt,link_casing:tt,major_casing_late:tt,highway_casing_late:tt,other:At,minor_service:At,minor_a:At,minor_b:At,link:At,major_casing_early:tt,major:At,highway_casing_early:tt,highway:At,railway:At,boundaries:At,waterway_label:tt,bridges_other_casing:tt,bridges_minor_casing:tt,bridges_link_casing:tt,bridges_major_casing:tt,bridges_highway_casing:tt,bridges_other:At,bridges_minor:At,bridges_link:At,bridges_major:At,bridges_highway:At,roads_label_minor:At,roads_label_minor_halo:tt,roads_label_major:At,roads_label_major_halo:tt,ocean_label:tt,peak_label:At,subplace_label:At,subplace_label_halo:tt,city_label:At,city_label_halo:tt,state_label:At,state_label_halo:tt,country_label:At},bm={background:"rgba(255, 228, 207, 1)",earth:"rgba(255, 195, 195, 1)",park_a:"#bbd285",park_b:"#bbd285",hospital:"rgba(240, 149, 169, 1)",industrial:"rgba(237, 188, 182, 1)",school:"rgba(254, 185, 100, 1)",wood_a:"#d7cc7f",wood_b:"#d7cc7f",pedestrian:"rgba(223, 197, 224, 1)",scrub_a:"#d8d3a0",scrub_b:"#d8d3a0",glacier:"rgba(252, 218, 218, 1)",sand:"rgba(245, 209, 169, 1)",beach:"rgba(241, 225, 144, 1)",aerodrome:"rgba(255, 202, 170, 1)",runway:"rgba(254, 234, 210, 1)",water:"rgba(255, 228, 207, 1)",zoo:"rgba(134, 213, 161, 1)",military:"rgba(227, 203, 171, 1)",tunnel_other_casing:"rgba(255, 195, 195, 1)",tunnel_minor_casing:"rgba(255, 195, 195, 1)",tunnel_link_casing:"rgba(255, 195, 195, 1)",tunnel_major_casing:"rgba(255, 195, 195, 1)",tunnel_highway_casing:"rgba(255, 195, 195, 1)",tunnel_other:"rgba(254, 235, 220, 1)",tunnel_minor:"rgba(254, 235, 220, 1)",tunnel_link:"rgba(254, 235, 220, 1)",tunnel_major:"rgba(254, 235, 220, 1)",tunnel_highway:"rgba(254, 235, 220, 1)",pier:"rgba(220, 198, 159, 1)",buildings:"rgba(229, 101, 114, 1)",minor_service_casing:"rgba(255, 195, 195, 1)",minor_casing:"rgba(255, 195, 195, 1)",link_casing:"rgba(255, 195, 195, 1)",major_casing_late:"rgba(255, 195, 195, 1)",highway_casing_late:"rgba(255, 195, 195, 1)",other:"rgba(254, 235, 220, 1)",minor_service:"rgba(254, 235, 220, 1)",minor_a:"#FEEBDC",minor_b:"#FEEBDC",link:"rgba(254, 235, 220, 1)",major_casing_early:"rgba(255, 195, 195, 1)",major:"rgba(254, 235, 220, 1)",highway_casing_early:"rgba(255, 195, 195, 1)",highway:"rgba(254, 235, 220, 1)",railway:"rgba(255, 250, 217, 1)",boundaries:"rgba(144, 91, 77, 1)",waterway_label:"rgba(174, 136, 99, 1)",bridges_other_casing:"rgba(255, 195, 195, 1)",bridges_minor_casing:"rgba(255, 195, 195, 1)",bridges_link_casing:"rgba(255, 195, 195, 1)",bridges_major_casing:"rgba(255, 195, 195, 1)",bridges_highway_casing:"rgba(255, 195, 195, 1)",bridges_other:"rgba(254, 235, 220, 1)",bridges_minor:"rgba(254, 235, 220, 1)",bridges_link:"rgba(254, 235, 220, 1)",bridges_major:"rgba(254, 235, 220, 1)",bridges_highway:"#FEEBDC",roads_label_minor:"rgba(173, 119, 113, 1)",roads_label_minor_halo:"rgba(254, 235, 220, 1)",roads_label_major:"rgba(173, 119, 113, 1)",roads_label_major_halo:"rgba(254, 235, 220, 1)",ocean_label:"rgba(174, 136, 99, 1)",peak_label:"rgba(119, 92, 47, 1)",subplace_label:"rgba(138, 104, 113, 1)",subplace_label_halo:"rgba(255, 195, 195, 1)",city_label:"rgba(25, 4, 0, 1)",city_label_halo:"rgba(0,0,0,0)",state_label:"rgba(146, 121, 106, 1)",state_label_halo:"rgba(0,0,0,0)",country_label:"rgba(120, 75, 46, 1)",regular:"Josefin Sans Regular",bold:"Josefin Sans Medium",italic:"Josefin Sans Italic",landcover:{grassland:"rgba(147, 214, 182, 1)",barren:"rgba(246, 204, 157, 1)",urban_area:"rgba(255, 168, 168, 1)",farmland:"rgba(159, 211, 159, 1)",glacier:"rgba(251, 213, 213, 1)",scrub:"rgba(191, 211, 160, 1)",forest:"rgba(136, 210, 168, 1)"}};var vm=Lh("
"),wm=Lh("
"),Sm=Lh("
");const Nd=["contrast","bright","calm","black_and_white","pink"],ca=new Map;ca.set("contrast",_m);ca.set("bright",gm);ca.set("calm",ym);ca.set("black_and_white",xm);ca.set("pink",bm);const kd=(E,B)=>{let Y=Nd[E],ne;return B?ne=jd("protomaps",ca.get(Y),"en"):ne=Vd("protomaps",ca.get(Y)),{version:8,glyphs:"https://bdon.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf",sources:{protomaps:{type:"vector",url:"https://api.protomaps.com/tiles/v4.json?key=1003762824b9687f"}},layers:ne}},Tm=E=>(()=>{var B=vm();return hc(B,()=>E.name),Yo(Y=>{var ne=E.theme.background,pe=E.theme.city_label;return ne!==Y.e&&((Y.e=ne)!=null?B.style.setProperty("background-color",ne):B.style.removeProperty("background-color")),pe!==Y.t&&((Y.t=pe)!=null?B.style.setProperty("color",pe):B.style.removeProperty("color")),Y},{e:void 0,t:void 0}),B})();function Im(){let E;const[B,Y]=Ch(0),[ne,pe]=Ch(!0);jf(async()=>{wd.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js",!0),E=new wd.Map({container:"map",style:kd(B(),ne())})}),zd(()=>{E.setStyle(kd(B(),ne()))});const ye=p=>{Y(p)},z=p=>{const $e=p.target;pe($e.checked)};return console.log(ne()),(()=>{var p=wm(),$e=p.firstChild,We=$e.firstChild;return hc($e,Mh(Hf,{each:Nd,children:(Ke,he)=>(()=>{var oe=Sm();return oe.$$click=()=>ye(he()),hc(oe,Mh(Tm,{name:Ke,get theme(){return ca.get(Ke)}})),oe})()}),We),We.addEventListener("change",z),Yo(()=>We.checked=ne()),p})()}Kf(["click"]);const km=document.getElementById("root");Wf(()=>Mh(Im,{}),km); diff --git a/assets/index-CGcOnYtv.css b/assets/index-CGcOnYtv.css new file mode 100644 index 0000000..d070285 --- /dev/null +++ b/assets/index-CGcOnYtv.css @@ -0,0 +1 @@ +:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.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 #0000001a}@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}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.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-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(0)}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:#ffffff80;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:#ffffff80;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:#0000000d}.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:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.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}.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:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;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 #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@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:#0006;color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left: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),(width <= 480px){.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}#root{margin:0 auto;width:100%;height:100vh}#container{display:flex;height:100vh}.sidebar{width:25%;min-width:250px;padding:10px}#map{height:100vh;width:75%}.themeRow{border:1px solid #111;padding:.5rem;margin-bottom:1rem}.themeRow:hover{border:1px solid #aaa;cursor:pointer} diff --git a/index.html b/index.html new file mode 100644 index 0000000..8879a28 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + + Basemaps Themes + + + + +
+ +