diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/CNAME b/CNAME new file mode 100644 index 00000000..fae7709b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +maps.protomaps.com diff --git a/assets/builds-0a02ac75.js b/assets/builds-0a02ac75.js new file mode 100644 index 00000000..6d8427d3 --- /dev/null +++ b/assets/builds-0a02ac75.js @@ -0,0 +1 @@ +import{r as p,j as t,c as b,R as g}from"./index-81f15401.js";function $(e){const s=parseInt(e.substring(0,4),10),n=parseInt(e.substring(4,6),10)-1,r=parseInt(e.substring(6,8),10);return new Date(s,n,r).getDay()===1}function f(e,s=2){if(!+e)return"0 Bytes";const n=1024,r=s<0?0:s,l=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**i).toFixed(r))} ${l[i]}`}function B(e){const s=e.build,n=`https://build.protomaps.com/${s.key}`,r=s.key.substr(0,8),l=`https://build.protomaps.com/${r}.layerstats.parquet`,i=e.idx,c=()=>{e.setCmpA(i)},d=()=>{e.setCmpB(i)};return t.jsxs("tr",{style:{color:$(r)?"white":"#aaa"},children:[t.jsxs("td",{children:[t.jsx("span",{style:{display:"inline-block",width:"20px"},children:i>e.cmpB&&t.jsx("input",{type:"radio",onChange:c,checked:i===e.cmpA})}),t.jsx("span",{style:{display:"inline-block",width:"20px"},children:i="20231228"?t.jsx("a",{href:l,children:"stats"}):null})]})}function k(){const[e,s]=p.useState([]),[n,r]=p.useState(1),[l,i]=p.useState(0),c="2.0.0-alpha.0",d="light",m=()=>{const o=`https://build.protomaps.com/${e[n].key}`,a=`https://build.protomaps.com/${e[l].key}`;open(`/visualtests/?leftTiles=${o}&rightTiles=${a}`)},y=()=>{const o=e[n].key.replace(".pmtiles",""),a=e[l].key.replace(".pmtiles",""),h={name:`${o} ${c} ${d}`,type:"maplibre-gl",renderer:"maplibre-gl",index:0,url:`https://build-metadata.protomaps.dev/style@${c}+theme@${d}+tiles@${o}.json`},x={name:`${a} ${c} ${d}`,type:"maplibre-gl",renderer:"maplibre-gl",index:0,url:`https://build-metadata.protomaps.dev/style@${c}+theme@${d}+tiles@${a}.json`},j=JSON.stringify([h,x]);open(`https://stamen.github.io/maperture/#maps=${encodeURIComponent(j)}`)};return p.useEffect(()=>{fetch("https://build-metadata.protomaps.dev/builds.json").then(o=>o.json()).then(o=>{s(o.sort((a,h)=>a.keyt.jsx(B,{build:o,idx:a,cmpA:n,cmpB:l,setCmpA:r,setCmpB:i},o.key))})})]})}const u=document.getElementById("root");u&&b.createRoot(u).render(t.jsx(g.StrictMode,{children:t.jsx(k,{})})); diff --git a/assets/index-24ba74c6.js b/assets/index-24ba74c6.js new file mode 100644 index 00000000..5783e932 --- /dev/null +++ b/assets/index-24ba74c6.js @@ -0,0 +1,580 @@ +import{a as Pp,g as Dp}from"./index-81f15401.js";var Au={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.3/LICENSE.txt + */(function(D,L){(function(H,Q){D.exports=Q()})(Pp,function(){var H={},Q={};function oe(A,p,Oe){if(Q[A]=Oe,A==="index"){var je="var sharedModule = {}; ("+Q.shared+")(sharedModule); ("+Q.worker+")(sharedModule);",Pe={};return Q.shared(Pe),Q.index(H,Pe),typeof window<"u"&&H.setWorkerUrl(window.URL.createObjectURL(new Blob([je],{type:"text/javascript"}))),H}}oe("shared",["exports"],function(A){function p(i,e,r,a){return new(r||(r=Promise))(function(l,u){function d(x){try{g(a.next(x))}catch(b){u(b)}}function f(x){try{g(a.throw(x))}catch(b){u(b)}}function g(x){var b;x.done?l(x.value):(b=x.value,b instanceof r?b:new r(function(w){w(b)})).then(d,f)}g((a=a.apply(i,e||[])).next())})}function Oe(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var je=Pe;function Pe(i,e){this.x=i,this.y=e}Pe.prototype={clone:function(){return new Pe(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,e){return this.clone()._rotateAround(i,e)},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 e=i.x-this.x,r=i.y-this.y;return e*e+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,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add: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 e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),l=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=l,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Pe.convert=function(i){return i instanceof Pe?i:Array.isArray(i)?new Pe(i[0],i[1]):i};var ce=Oe(je),re=xt;function xt(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}xt.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,e){if(e===void 0&&(e=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,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Lt=Oe(re);let Rt,xi;function Ci(){return Rt==null&&(Rt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Rt}function vt(){if(xi==null&&(xi=!1,Ci())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){const l=4*a;e.fillStyle=`rgb(${l},${l+1},${l+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){xi=!0;break}}}return xi||!1}function hi(i,e,r,a){const l=new Lt(i,e,r,a);return function(u){return l.solve(u)}}const sn=hi(.25,.1,.25,1);function Ei(i,e,r){return Math.min(r,Math.max(e,i))}function lr(i,e,r){const a=r-e,l=((i-e)%a+a)%a+e;return l===e?r:l}function ui(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let cr=1;function hr(i,e,r){const a={};for(const l in i)a[l]=e.call(r||this,i[l],l,i);return a}function Ut(i,e,r){const a={};for(const l in i)e.call(r||this,i[l],l,i)&&(a[l]=i[l]);return a}function ct(i){return Array.isArray(i)?i.map(ct):typeof i=="object"&&i?hr(i,ct):i}const An={};function si(i){An[i]||(typeof console<"u"&&console.warn(i),An[i]=!0)}function oi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function ur(i){let e=0;for(let r,a,l=0,u=i.length,d=u-1;l"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"),g=new Uint8ClampedArray(a*l*4);if(yield u.copyTo(g,function(x,b,w,k,C){const M=4*Math.max(-b,0),B=(Math.max(0,w)-w)*k*4+M,U=4*k,q=Math.max(0,b),te=Math.max(0,w);return{rect:{x:q,y:te,width:Math.min(x.width,b+k)-q,height:Math.min(x.height,w+C)-te},layout:[{offset:B,stride:U}]}}(i,e,r,a,l)),f)for(let x=0;xMi(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Tr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const a=tr(i.url);if(a)return a(i,e);if(Mi(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:Pi},e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(Zr())&&!/^\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:Zr(),signal:l.signal});a.type==="json"&&u.headers.set("Accept","application/json");const d=yield fetch(u);if(!d.ok){const x=yield d.blob();throw new qi(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 g=yield f;if(l.signal.aborted)throw dr();return{data:g,cacheControl:d.headers.get("Cache-Control"),expires:d.headers.get("Expires")}})}(i,e);if(Mi(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:Pi},e)}var r;return function(a,l){return new Promise((u,d)=>{const f=new XMLHttpRequest;f.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(f.responseType="arraybuffer");for(const g in a.headers)f.setRequestHeader(g,a.headers[g]);a.type==="json"&&(f.responseType="text",f.setRequestHeader("Accept","application/json")),f.withCredentials=a.credentials==="include",f.onerror=()=>{d(new Error(f.statusText))},f.onload=()=>{if(!l.signal.aborted)if((f.status>=200&&f.status<300||f.status===0)&&f.response!==null){let g=f.response;if(a.type==="json")try{g=JSON.parse(f.response)}catch(x){return void d(x)}u({data:g,cacheControl:f.getResponseHeader("Cache-Control"),expires:f.getResponseHeader("Expires")})}else{const g=new Blob([f.response],{type:f.getResponseHeader("Content-Type")});d(new qi(f.status,f.statusText,a.url,g))}},l.signal.addEventListener("abort",()=>{f.abort(),d(dr())}),f.send(a.body)})}(i,e)};function on(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function ir(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function Gr(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Nt{constructor(e,r={}){ui(this,r),this.type=e}}class ln extends Nt{constructor(e,r={}){super("error",ui({error:e},r))}}class cn{on(e,r){return this._listeners=this._listeners||{},ir(e,r,this._listeners),this}off(e,r){return Gr(e,r,this._listeners),Gr(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},ir(e,r,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,r){typeof e=="string"&&(e=new Nt(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const l=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of l)f.call(this,e);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of u)Gr(a,f,this._oneTimeListeners),f.call(this,e);const d=this._eventedParent;d&&(ui(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof ln&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var he={$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"},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":{},within:{}}},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},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-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}},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 zn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Jn(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return zn.forEach(a=>{a in e&&(r[a]=e[a])}),r}function it(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const X=[fi,ke,Qe,Ke,jt,Kt,Ir,P(Ge),N,I,z];function K(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!K(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of X)if(!K(r,e))return null}}return`Expected ${F(i)} but found ${F(e)} instead.`}function ee(i,e){return e.some(r=>r.kind===i.kind)}function G(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function ie(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const me=.96422,de=.82521,pe=4/29,Fe=6/29,Ue=3*Fe*Fe,He=Fe*Fe*Fe,Ze=Math.PI/180,nt=180/Math.PI;function pt(i){return(i%=360)<0&&(i+=360),i}function bt([i,e,r,a]){let l,u;const d=Ye((.2225045*(i=$t(i))+.7168786*(e=$t(e))+.0606169*(r=$t(r)))/1);i===e&&e===r?l=u=d:(l=Ye((.4360747*i+.3850649*e+.1430804*r)/me),u=Ye((.0139322*i+.0971045*e+.7141733*r)/de));const f=116*d-16;return[f<0?0:f,500*(l-d),200*(d-u),a]}function $t(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Ye(i){return i>He?Math.pow(i,1/3):i/Ue+pe}function Et([i,e,r,a]){let l=(i+16)/116,u=isNaN(e)?l:l+e/500,d=isNaN(r)?l:l-r/200;return l=1*bi(l),u=me*bi(u),d=de*bi(d),[Yt(3.1338561*u-1.6168667*l-.4906146*d),Yt(-.9787684*u+1.9161415*l+.033454*d),Yt(.0719453*u-.2289914*l+1.4052427*d),a]}function Yt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function bi(i){return i>Fe?i*i*i:Ue*(i-pe)}function Di(i){return parseInt(i.padEnd(2,i),16)/255}function ci(i,e){return kr(e?i/100:i,0,1)}function kr(i,e,r){return Math.min(Math.max(e,i),r)}function Po(i){return!i.some(Number.isNaN)}const Ol={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 ht{constructor(e,r,a,l=1,u=!0){this.r=e,this.g=r,this.b=a,this.a=l,u||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[e,r,a,l]))}static parse(e){if(e instanceof ht)return e;if(typeof e!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=Ol[a];if(l){const[d,f,g]=l;return[d/255,f/255,g/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[Di(a.slice(f,f+=d)),Di(a.slice(f,f+=d)),Di(a.slice(f,f+=d)),Di(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,g,x,b,w,k,C,M,B,U,q,te]=d,Z=[b||" ",C||" ",U].join("");if(Z===" "||Z===" /"||Z===",,"||Z===",,,"){const Y=[x,k,B].join(""),ue=Y==="%%%"?100:Y===""?255:0;if(ue){const fe=[kr(+g/ue,0,1),kr(+w/ue,0,1),kr(+M/ue,0,1),q?ci(+q,te):1];if(Po(fe))return fe}}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,g,x,b,w,k,C,M]=u,B=[g||" ",b||" ",k].join("");if(B===" "||B===" /"||B===",,"||B===",,,"){const U=[+f,kr(+x,0,100),kr(+w,0,100),C?ci(+C,M):1];if(Po(U))return function([q,te,Z,Y]){function ue(fe){const Ee=(fe+q/30)%12,Le=te*Math.min(Z,1-Z);return Z-Le*Math.max(-1,Math.min(Ee-3,9-Ee,1))}return q=pt(q),te/=100,Z/=100,[ue(0),ue(8),ue(4),Y]}(U)}}}(e);return r?new ht(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:l}=this,u=l||1/0;return this.overwriteGetter("rgb",[e/u,r/u,a/u,l])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,a,l,u]=bt(e),d=Math.sqrt(a*a+l*l);return[Math.round(1e4*d)?pt(Math.atan2(l,a)*nt):NaN,d,r,u]}(this.rgb))}get lab(){return this.overwriteGetter("lab",bt(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,l]=this.rgb;return`rgba(${[e,r,a].map(u=>Math.round(255*u)).join(",")},${l})`}}ht.black=new ht(0,0,0,1),ht.white=new ht(1,1,1,1),ht.transparent=new ht(0,0,0,0),ht.red=new ht(1,0,0,1);class As{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class zs{constructor(e,r,a,l,u){this.text=e,this.image=r,this.scale=a,this.fontStack=l,this.textColor=u}}class Gi{constructor(e){this.sections=e}static fromString(e){return new Gi([new zs(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Gi?e:Gi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}}const ea=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class rr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Aa(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof ht||i instanceof As||i instanceof Gi||i instanceof Li||i instanceof rr||i instanceof nr)return!0;if(Array.isArray(i)){for(const e of i)if(!Aa(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!Aa(i[e]))return!1;return!0}return!1}function qt(i){if(i===null)return fi;if(typeof i=="string")return Qe;if(typeof i=="boolean")return Ke;if(typeof i=="number")return ke;if(i instanceof ht)return jt;if(i instanceof As)return un;if(i instanceof Gi)return Kt;if(i instanceof Li)return N;if(i instanceof rr)return z;if(i instanceof nr)return I;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const l=qt(a);if(r){if(r===l)continue;r=Ge;break}r=l}return P(r||Ge,e)}return Ir}function ta(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof ht||i instanceof Gi||i instanceof Li||i instanceof rr||i instanceof nr?i.toString():JSON.stringify(i)}class Wr{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Aa(e[1]))return r.error("invalid value");const a=e[1];let l=qt(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 Wr(l,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class It{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const za={string:Qe,number:ke,boolean:Ke,object:Ir};class Hi{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,l=1;const u=e[0];if(u==="array"){let f,g;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in za)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=za[x],l++}else f=Ge;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=e[2],l++}a=P(f,g)}else{if(!za[u])throw new Error(`Types doesn't contain name = ${u}`);a=za[u]}const d=[];for(;le.outputDefined())}}const Ca={"to-boolean":Ke,"to-color":jt,"to-number":ke,"to-string":Qe};class Ar{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!Ca[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const l=Ca[a],u=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Dn(r[0],r[1],r[2],r[3]),!a))return new ht(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new It(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const l=Li.parse(r);if(l)return l}throw new It(`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(e);const l=rr.parse(r);if(l)return l}throw new It(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new It(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Gi.fromString(ta(this.args[0].evaluate(e)));case"resolvedImage":return nr.fromString(ta(this.args[0].evaluate(e)));default:return ta(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ia=["Unknown","Point","LineString","Polygon"];class ut{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"?ia[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=ht.parse(e)),r}}class Ea{constructor(e,r,a=[],l,u=new Qn,d=[]){this.registry=e,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=u,this.errors=d,this.expectedType=l,this._isConstant=r}parse(e,r,a,l,u={}){return r?this.concat(r,a,l)._parse(e,u):this._parse(e,u)}_parse(e,r){function a(l,u,d){return d==="assert"?new Hi(u,[l]):d==="coerce"?new Ar(u,[l]):l}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=e[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(e,this);if(!d)return null;if(this.expectedType){const f=this.expectedType,g=d.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(f.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||g.kind!=="value"&&g.kind!=="array"){if(this.checkSubtype(f,g))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 Wr)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){const f=new ut;try{d=new Wr(d.type,d.evaluate(f))}catch(g){return this.error(g.message),null}}return d}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,a){const l=typeof e=="number"?this.path.concat(e):this.path,u=a?this.scope.concat(a):this.scope;return new Ea(this.registry,this._isConstant,l,r||null,u,this.errors)}error(e,...r){const a=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new Zi(a,e))}checkSubtype(e,r){const a=K(e,r);return a&&this.error(a),a}}class Ln{constructor(e,r,a){this.type=un,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const l=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ke);if(!l)return null;const u=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ke);if(!u)return null;let d=null;return a.locale&&(d=r.parse(a.locale,1,Qe),!d)?null:new Ln(l,u,d)}evaluate(e){return new As(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const Xr=8192;function Ma(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function ra(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Vl(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,e.z);return[Math.round(r*l*Xr),Math.round(a*l*Xr)]}function Do(i,e,r){const a=i[0]-e[0],l=i[1]-e[1],u=i[0]-r[0],d=i[1]-r[1];return a*d-u*l==0&&a*u<=0&&l*d<=0}function Pa(i,e){let r=!1;for(let d=0,f=e.length;d(a=i)[1]!=(u=g[x+1])[1]>a[1]&&a[0]<(u[0]-l[0])*(a[1]-l[1])/(u[1]-l[1])+l[0]&&(r=!r)}}var a,l,u;return r}function Ul(i,e){for(let r=0;r0&&f<0||d<0&&f>0}function Nl(i,e,r){for(const x of r)for(let b=0;br[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}Ma(e,i)}function La(i,e,r,a){const l=Math.pow(2,a.z)*Xr,u=[a.x*Xr,a.y*Xr],d=[];for(const f of i)for(const g of f){const x=[g.x+u[0],g.y+u[1]];Oo(x,e,r,l),d.push(x)}return d}function Vo(i,e,r,a){const l=Math.pow(2,a.z)*Xr,u=[a.x*Xr,a.y*Xr],d=[];for(const g of i){const x=[];for(const b of g){const w=[b.x+u[0],b.y+u[1]];Ma(e,w),x.push(w)}d.push(x)}if(e[2]-e[0]<=l/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const g of d)for(const x of g)Oo(x,e,r,l)}var f;return d}class dn{constructor(e,r){this.type=Ke,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Aa(e[1])){const a=e[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 dn(a,{type:"MultiPolygon",coordinates:l})}else if(a.type==="Feature"){const l=a.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new dn(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new dn(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,a){const 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=Da(a.coordinates,u,d),g=La(r.geometry(),l,u,d);if(!ra(l,u))return!1;for(const x of g)if(!Pa(x,f))return!1}if(a.type==="MultiPolygon"){const f=Fo(a.coordinates,u,d),g=La(r.geometry(),l,u,d);if(!ra(l,u))return!1;for(const x of g)if(!Ul(x,f))return!1}return!0}(e,this.geometries);if(e.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=Da(a.coordinates,u,d),g=Vo(r.geometry(),l,u,d);if(!ra(l,u))return!1;for(const x of g)if(!Ro(x,f))return!1}if(a.type==="MultiPolygon"){const f=Fo(a.coordinates,u,d),g=Vo(r.geometry(),l,u,d);if(!ra(l,u))return!1;for(const x of g)if(!Bo(x,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Ra{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new Ra(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Wi{constructor(e,r,a,l){this.name=e,this.type=r,this._evaluate=a,this.args=l}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const a=e[0],l=Wi.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===e.length-1);let g=null;for(const[x,b]of f){g=new Ea(r.registry,na,r.path,null,r.scope);const w=[];let k=!1;for(let C=1;C{return k=w,Array.isArray(k)?`(${k.map(F).join(", ")})`:`(${F(k.type)}...)`;var k}).join(" | "),b=[];for(let w=1;w{r=e?r&&na(a):r&&a instanceof Wr}),!!r&&Ba(i)&&sa(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ba(i){if(i instanceof Wi&&(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 dn)return!1;let e=!0;return i.eachChild(r=>{e&&!Ba(r)&&(e=!1)}),e}function aa(i){if(i instanceof Wi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!aa(r)&&(e=!1)}),e}function sa(i,e){if(i instanceof Wi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!sa(a,e)&&(r=!1)}),r}function oa(i,e){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<=e){if(f===r||ee))throw new It("Input is not a number.");d=f-1}return 0}class la{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[l,u]of a)this.labels.push(l),this.outputs.push(u)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,ke);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(g,b,u);if(!w)return null;u=u||w.type,l.push([f,w])}return new la(u,a,l)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return a[0].evaluate(e);const u=r.length;return l>=r[u-1]?a[u-1].evaluate(e):a[oa(r,l)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function jl(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var $l=Uo;function Uo(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}Uo.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,e){if(e===void 0&&(e=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,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var ql=jl($l);function pn(i,e,r){return i+r*(e-i)}function Fa(i,e,r){return i.map((a,l)=>pn(a,e[l],r))}const wi={number:pn,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[l,u,d,f]=Fa(i.rgb,e.rgb,r);return new ht(l,u,d,f,!1)}case"hcl":{const[l,u,d,f]=i.hcl,[g,x,b,w]=e.hcl;let k,C;if(isNaN(l)||isNaN(g))isNaN(l)?isNaN(g)?k=NaN:(k=g,d!==1&&d!==0||(C=x)):(k=l,b!==1&&b!==0||(C=u));else{let te=g-l;g>l&&te>180?te-=360:g180&&(te+=360),k=l+r*te}const[M,B,U,q]=function([te,Z,Y,ue]){return te=isNaN(te)?0:te*Ze,Et([Y,Math.cos(te)*Z,Math.sin(te)*Z,ue])}([k,C??pn(u,x,r),pn(d,b,r),pn(f,w,r)]);return new ht(M,B,U,q,!1)}case"lab":{const[l,u,d,f]=Et(Fa(i.lab,e.lab,r));return new ht(l,u,d,f,!1)}}},array:Fa,padding:function(i,e,r){return new Li(Fa(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,l=e.values;if(a.length!==l.length)throw new It(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.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(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(u=r.parse(u,2,ke),!u)return null;const f=[];let g=null;a==="interpolate-hcl"||a==="interpolate-lab"?g=jt:r.expectedType&&r.expectedType.kind!=="value"&&(g=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.',k);const M=r.parse(w,C,g);if(!M)return null;g=g||M.type,f.push([b,M])}return ie(g,ke)||ie(g,jt)||ie(g,N)||ie(g,z)||ie(g,P(ke))?new mi(g,a,l,u,f):r.error(`Type ${F(g)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const l=this.input.evaluate(e);if(l<=r[0])return a[0].evaluate(e);const u=r.length;if(l>=r[u-1])return a[u-1].evaluate(e);const d=oa(r,l),f=mi.interpolationFactor(this.interpolation,l,r[d],r[d+1]),g=a[d].evaluate(e),x=a[d+1].evaluate(e);switch(this.operator){case"interpolate":return wi[this.type.kind](g,x,f);case"interpolate-hcl":return wi.color(g,x,f,"hcl");case"interpolate-lab":return wi.color(g,x,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function lt(i,e,r,a){const l=a-r,u=i-r;return l===0?0:e===1?u/l:(Math.pow(e,u)-1)/(Math.pow(e,l)-1)}class Oa{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.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 e.slice(1)){const g=r.parse(f,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!g)return null;a=a||g.type,u.push(g)}if(!a)throw new Error("No output type");const d=l&&u.some(f=>K(l,f.type));return new Oa(d?Ge:a,u)}evaluate(e){let r,a=null,l=0;for(const u of this.args)if(l++,a=u.evaluate(e),a&&a instanceof nr&&!a.available&&(r||(r=a.name),a=null,l===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Va{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let u=1;u=a.length)throw new It(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new It(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Es{constructor(e,r){this.type=Ke,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ge),l=r.parse(e[2],2,Ge);return a&&l?ee(a.type,[Ke,Qe,ke,fi,Ge])?new Es(a,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${F(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!G(r,["boolean","string","number","null"]))throw new It(`Expected first argument to be of type boolean, string, number or null, but found ${F(qt(r))} instead.`);if(!G(a,["string","array"]))throw new It(`Expected second argument to be of type array or string, but found ${F(qt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ua{constructor(e,r,a){this.type=ke,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ge),l=r.parse(e[2],2,Ge);if(!a||!l)return null;if(!ee(a.type,[Ke,Qe,ke,fi,Ge]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${F(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ke);return u?new Ua(a,l,u):null}return new Ua(a,l)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!G(r,["boolean","string","number","null"]))throw new It(`Expected first argument to be of type boolean, string, number or null, but found ${F(qt(r))} instead.`);if(!G(a,["string","array"]))throw new It(`Expected second argument to be of type array or string, but found ${F(qt(a))} instead.`);if(this.fromIndex){const l=this.fromIndex.evaluate(e);return a.indexOf(r,l)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Ms{constructor(e,r,a,l,u,d){this.inputType=e,this.type=r,this.input=a,this.cases=l,this.outputs=u,this.otherwise=d}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const u={},d=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return k.error("Numeric branch labels must be integer values.");if(a){if(k.checkSubtype(a,qt(M)))return null}else a=qt(M);if(u[String(M)]!==void 0)return k.error("Branch labels must be unique.");u[String(M)]=d.length}const C=r.parse(w,x,l);if(!C)return null;l=l||C.type,d.push(C)}const f=r.parse(e[1],1,Ge);if(!f)return null;const g=r.parse(e[e.length-1],e.length-1,l);return g?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new Ms(a,l,f,u,d,g):null}evaluate(e){const r=this.input.evaluate(e);return(qt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Ps{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const l=[];for(let d=1;dr.outputDefined())&&this.otherwise.outputDefined()}}class Na{constructor(e,r,a,l){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=l}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Ge),l=r.parse(e[2],2,ke);if(!a||!l)return null;if(!ee(a.type,[P(Ge),Qe,Ge]))return r.error(`Expected first argument to be of type array or string, but found ${F(a.type)} instead`);if(e.length===4){const u=r.parse(e[3],3,ke);return u?new Na(a.type,a,l,u):null}return new Na(a.type,a,l)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!G(r,["string","array"]))throw new It(`Expected first argument to be of type array or string, but found ${F(qt(r))} instead.`);if(this.endIndex){const l=this.endIndex.evaluate(e);return r.slice(a,l)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function No(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function jo(i,e,r,a){return a.compare(e,r)===0}function Rn(i,e,r){const a=i!=="=="&&i!=="!=";return class zu{constructor(u,d,f){this.type=Ke,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 g=d.parse(u[1],1,Ge);if(!g)return null;if(!No(f,g.type))return d.concat(1).error(`"${f}" comparisons are not supported for type '${F(g.type)}'.`);let x=d.parse(u[2],2,Ge);if(!x)return null;if(!No(f,x.type))return d.concat(2).error(`"${f}" comparisons are not supported for type '${F(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return d.error(`Cannot compare types '${F(g.type)}' and '${F(x.type)}'.`);a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Hi(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Hi(g.type,[x])));let b=null;if(u.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.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,un),!b)return null}return new zu(g,x,b)}evaluate(u){const d=this.lhs.evaluate(u),f=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const g=qt(d),x=qt(f);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new It(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const g=qt(d),x=qt(f);if(g.kind!=="string"||x.kind!=="string")return e(u,d,f)}return this.collator?r(u,d,f,this.collator.evaluate(u)):e(u,d,f)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const Zl=Rn("==",function(i,e,r){return e===r},jo),Gl=Rn("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!jo(0,e,r,a)}),Hl=Rn("<",function(i,e,r){return e",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),Xl=Rn("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),Kl=Rn(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class Ds{constructor(e,r,a,l,u){this.type=Qe,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=l,this.maxFractionDigits=u}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,ke);if(!a)return null;const l=e[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,Qe),!u))return null;let d=null;if(l.currency&&(d=r.parse(l.currency,1,Qe),!d))return null;let f=null;if(l["min-fraction-digits"]&&(f=r.parse(l["min-fraction-digits"],1,ke),!f))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,ke),!g)?null:new Ds(a,u,d,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class ja{constructor(e){this.type=Kt,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const l=[];let u=!1;for(let d=1;d<=e.length-1;++d){const f=e[d];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;let g=null;if(f["font-scale"]&&(g=r.parse(f["font-scale"],1,ke),!g))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,P(Qe)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,jt),!b))return null;const w=l[l.length-1];w.scale=g,w.font=x,w.textColor=b}else{const g=r.parse(e[d],1,Ge);if(!g)return null;const x=g.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:g,scale:null,font:null,textColor:null})}}return new ja(l)}evaluate(e){return new Gi(this.sections.map(r=>{const a=r.content.evaluate(e);return qt(a)===I?new zs("",a,null,null,null):new zs(ta(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Ls{constructor(e){this.type=I,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Qe);return a?new Ls(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=nr.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class Rs{constructor(e){this.type=ke,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${F(a.type)} instead.`):new Rs(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new It(`Expected value to be of type string or array, but found ${F(qt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Bn={"==":Zl,"!=":Gl,">":Wl,"<":Hl,">=":Kl,"<=":Xl,array:Hi,at:Cs,boolean:Hi,case:Ps,coalesce:Oa,collator:Ln,format:ja,image:Ls,in:Es,"index-of":Ua,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Rs,let:Va,literal:Wr,match:Ms,number:Hi,"number-format":Ds,object:Hi,slice:Na,step:la,string:Hi,"to-boolean":Ar,"to-color":Ar,"to-number":Ar,"to-string":Ar,var:Ra,within:dn};function $o(i,[e,r,a,l]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const u=l?l.evaluate(i):1,d=Dn(e,r,a,u);if(d)throw new It(d);return new ht(e/255,r/255,a/255,u,!1)}function qo(i,e){return i in e}function Bs(i,e){const r=e[i];return r===void 0?null:r}function fn(i){return{type:i}}function Zo(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 Go(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Fs(i){return!!i.expression&&i.expression.interpolated}function ot(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function $a(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Yl(i){return i}function Ho(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",l=a||!(a||i.property!==void 0),u=i.type||(Fs(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?ht.parse:Li.parse;(i=Sr({},i)).stops&&(i.stops=i.stops.map(w=>[w[0],b(w[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let f,g,x;if(u==="exponential")f=at;else if(u==="interval")f=Jl;else if(u==="categorical"){f=Ft,g=Object.create(null);for(const b of i.stops)g[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(u!=="identity")throw new Error(`Unknown function type "${u}"`);f=Os}if(a){const b={},w=[];for(let M=0;MM[0]),evaluate:({zoom:M},B)=>at({stops:k,base:i.base},e,M).evaluate(M,B)}}if(l){const b=u==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:mi.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(w=>w[0]),evaluate:({zoom:w})=>f(i,e,w,g,x)}}return{kind:"source",evaluate(b,w){const k=w&&w.properties?w.properties[i.property]:void 0;return k===void 0?ca(i.default,e.default):f(i,e,k,g,x)}}}function ca(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ft(i,e,r,a,l){return ca(typeof r===l?a[r]:void 0,i.default,e.default)}function Jl(i,e,r){if(ot(r)!=="number")return ca(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const l=oa(i.stops.map(u=>u[0]),r);return i.stops[l][1]}function at(i,e,r){const a=i.base!==void 0?i.base:1;if(ot(r)!=="number")return ca(i.default,e.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=oa(i.stops.map(b=>b[0]),r),d=function(b,w,k,C){const M=C-k,B=b-k;return M===0?0:w===1?B/M:(Math.pow(w,B)-1)/(Math.pow(w,M)-1)}(r,a,i.stops[u][0],i.stops[u+1][0]),f=i.stops[u][1],g=i.stops[u+1][1],x=wi[e.type]||Yl;return typeof f.evaluate=="function"?{evaluate(...b){const w=f.evaluate.apply(void 0,b),k=g.evaluate.apply(void 0,b);if(w!==void 0&&k!==void 0)return x(w,k,d,i.colorSpace)}}:x(f,g,d,i.colorSpace)}function Os(i,e,r){switch(e.type){case"color":r=ht.parse(r);break;case"formatted":r=Gi.fromString(r.toString());break;case"resolvedImage":r=nr.fromString(r.toString());break;case"padding":r=Li.parse(r);break;default:ot(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return ca(r,i.default,e.default)}Wi.register(Bn,{error:[{kind:"error"},[Qe],(i,[e])=>{throw new It(e.evaluate(i))}],typeof:[Qe,[Ge],(i,[e])=>F(qt(e.evaluate(i)))],"to-rgba":[P(ke,4),[jt],(i,[e])=>{const[r,a,l,u]=e.evaluate(i).rgb;return[255*r,255*a,255*l,u]}],rgb:[jt,[ke,ke,ke],$o],rgba:[jt,[ke,ke,ke,ke],$o],has:{type:Ke,overloads:[[[Qe],(i,[e])=>qo(e.evaluate(i),i.properties())],[[Qe,Ir],(i,[e,r])=>qo(e.evaluate(i),r.evaluate(i))]]},get:{type:Ge,overloads:[[[Qe],(i,[e])=>Bs(e.evaluate(i),i.properties())],[[Qe,Ir],(i,[e,r])=>Bs(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Ge,[Qe],(i,[e])=>Bs(e.evaluate(i),i.featureState||{})],properties:[Ir,[],i=>i.properties()],"geometry-type":[Qe,[],i=>i.geometryType()],id:[Ge,[],i=>i.id()],zoom:[ke,[],i=>i.globals.zoom],"heatmap-density":[ke,[],i=>i.globals.heatmapDensity||0],"line-progress":[ke,[],i=>i.globals.lineProgress||0],accumulated:[Ge,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ke,fn(ke),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[ke,fn(ke),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:ke,overloads:[[[ke,ke],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[ke],(i,[e])=>-e.evaluate(i)]]},"/":[ke,[ke,ke],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[ke,[ke,ke],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[ke,[],()=>Math.LN2],pi:[ke,[],()=>Math.PI],e:[ke,[],()=>Math.E],"^":[ke,[ke,ke],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[ke,[ke],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[ke,[ke],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[ke,[ke],(i,[e])=>Math.log(e.evaluate(i))],log2:[ke,[ke],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[ke,[ke],(i,[e])=>Math.sin(e.evaluate(i))],cos:[ke,[ke],(i,[e])=>Math.cos(e.evaluate(i))],tan:[ke,[ke],(i,[e])=>Math.tan(e.evaluate(i))],asin:[ke,[ke],(i,[e])=>Math.asin(e.evaluate(i))],acos:[ke,[ke],(i,[e])=>Math.acos(e.evaluate(i))],atan:[ke,[ke],(i,[e])=>Math.atan(e.evaluate(i))],min:[ke,fn(ke),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[ke,fn(ke),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[ke,[ke],(i,[e])=>Math.abs(e.evaluate(i))],round:[ke,[ke],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[ke,[ke],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[ke,[ke],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ke,[Qe,Ge],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ke,[Ge],(i,[e])=>i.id()===e.value],"filter-type-==":[Ke,[Qe],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ke,[Qe,Ge],(i,[e,r])=>{const a=i.properties()[e.value],l=r.value;return typeof a==typeof l&&a{const r=i.id(),a=e.value;return typeof r==typeof a&&r":[Ke,[Qe,Ge],(i,[e,r])=>{const a=i.properties()[e.value],l=r.value;return typeof a==typeof l&&a>l}],"filter-id->":[Ke,[Ge],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ke,[Qe,Ge],(i,[e,r])=>{const a=i.properties()[e.value],l=r.value;return typeof a==typeof l&&a<=l}],"filter-id-<=":[Ke,[Ge],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ke,[Qe,Ge],(i,[e,r])=>{const a=i.properties()[e.value],l=r.value;return typeof a==typeof l&&a>=l}],"filter-id->=":[Ke,[Ge],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ke,[Ge],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ke,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ke,[P(Qe)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ke,[P(Ge)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ke,[Qe,P(Ge)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ke,[Qe,P(Ge)],(i,[e,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()[e.value],r.value,0,r.value.length-1)],all:{type:Ke,overloads:[[[Ke,Ke],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[fn(Ke),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ke,overloads:[[[Ke,Ke],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[fn(Ke),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ke,[Ke],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ke,[Qe],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Qe,[Qe],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Qe,fn(Ge),(i,e)=>e.map(r=>ta(r.evaluate(i))).join("")],"resolved-locale":[Qe,[un],(i,[e])=>e.evaluate(i).resolvedLocale()]});class gt{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new ut,this._defaultValue=r?(a=r).type==="color"&&$a(a.default)?new ht(0,0,0,0):a.type==="color"?ht.parse(a.default)||null:a.type==="padding"?Li.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?rr.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,l,u,d){return this._evaluator.globals=e,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(e,r,a,l,u,d){this._evaluator.globals=e,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 It(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).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 _t(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Bn}function mn(i,e){const r=new Ea(Bn,na,[],e?function(l){const u={color:jt,string:Qe,number:ke,enum:Qe,boolean:Ke,formatted:Kt,padding:N,resolvedImage:I,variableAnchorOffsetCollection:z};return l.type==="array"?P(u[l.value]||Ge,l.length):u[l.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Zo(new gt(a,e)):Fn(r.errors)}class qa{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!aa(r.expression)}evaluateWithoutErrorHandling(e,r,a,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,l,u,d)}evaluate(e,r,a,l,u,d){return this._styleExpression.evaluate(e,r,a,l,u,d)}}class Vs{constructor(e,r,a,l){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!aa(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(e,r,a,l,u,d){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,l,u,d)}evaluate(e,r,a,l,u,d){return this._styleExpression.evaluate(e,r,a,l,u,d)}interpolationFactor(e,r,a){return this.interpolationType?mi.interpolationFactor(this.interpolationType,e,r,a):0}}function Wo(i,e){const r=mn(i,e);if(r.result==="error")return r;const a=r.value.expression,l=Ba(a);if(!l&&!On(e))return Fn([new Zi("","data expressions not supported")]);const u=sa(a,["zoom"]);if(!u&&!Go(e))return Fn([new Zi("","zoom expressions not supported")]);const d=Ga(a);return d||u?d instanceof Zi?Fn([d]):d instanceof mi&&!Fs(e)?Fn([new Zi("",'"interpolate" expressions cannot be used with this property')]):Zo(d?new Vs(l?"camera":"composite",r.value,d.labels,d instanceof mi?d.interpolation:void 0):new qa(l?"constant":"source",r.value)):Fn([new Zi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Za{constructor(e,r){this._parameters=e,this._specification=r,Sr(this,Ho(this._parameters,this._specification))}static deserialize(e){return new Za(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ga(i){let e=null;if(i instanceof Va)e=Ga(i.result);else if(i instanceof Oa){for(const r of i.args)if(e=Ga(r),e)break}else(i instanceof la||i instanceof mi)&&i.input instanceof Wi&&i.input.name==="zoom"&&(e=i);return e instanceof Zi||i.eachChild(r=>{const a=Ga(r);a instanceof Zi?e=a:!e&&a?e=new Zi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new Zi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ha(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Ha(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Xo={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wa(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Ha(i)||(i=Ka(i));const e=mn(i,Xo);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,l)=>e.value.evaluate(r,a,{},l),needGeometry:Xa(i)}}function Ko(i,e){return ie?1:0}function Xa(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Us(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(Ka))):e==="all"?["all"].concat(i.slice(1).map(Ka)):e==="none"?["all"].concat(i.slice(1).map(Ka).map(Ya)):e==="in"?Yo(i[1],i.slice(2)):e==="!in"?Ya(Yo(i[1],i.slice(2))):e==="has"?Jo(i[1]):e==="!has"?Ya(Jo(i[1])):e!=="within"||i;var r}function Us(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Yo(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Ko)]]:["filter-in-small",i,["literal",e]]}}function Jo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Ya(i){return["!",i]}function Ns(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let l="[";for(const u of i)l+=`${Ns(u)},`;return`${l}]`}const r=Object.keys(i).sort();let a="{";for(let l=0;la.maximum?[new be(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function el(i){const e=i.valueSpec,r=Mt(i.value.type);let a,l,u,d={};const f=r!=="categorical"&&i.value.property===void 0,g=!f,x=ot(i.value.stops)==="array"&&ot(i.value.stops[0])==="array"&&ot(i.value.stops[0][0])==="object",b=Ti({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new be(C.key,C.value,'identity function may not have a "stops" property')];let M=[];const B=C.value;return M=M.concat(js({key:C.key,value:B,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:w})),ot(B)==="array"&&B.length===0&&M.push(new be(C.key,B,"array must have at least one stop")),M},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new be(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new be(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Fs(i.valueSpec)&&b.push(new be(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(g&&!On(i.valueSpec)?b.push(new be(i.key,i.value,"property functions not supported")):f&&!Go(i.valueSpec)&&b.push(new be(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new be(i.key,i.value,'"property" property is required')),b;function w(C){let M=[];const B=C.value,U=C.key;if(ot(B)!=="array")return[new be(U,B,`array expected, ${ot(B)} found`)];if(B.length!==2)return[new be(U,B,`array length 2 expected, length ${B.length} found`)];if(x){if(ot(B[0])!=="object")return[new be(U,B,`object expected, ${ot(B[0])} found`)];if(B[0].zoom===void 0)return[new be(U,B,"object stop key must have zoom")];if(B[0].value===void 0)return[new be(U,B,"object stop key must have value")];if(u&&u>Mt(B[0].zoom))return[new be(U,B[0].zoom,"stop zoom values must appear in ascending order")];Mt(B[0].zoom)!==u&&(u=Mt(B[0].zoom),l=void 0,d={}),M=M.concat(Ti({key:`${U}[0]`,value:B[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Ja,value:k}}))}else M=M.concat(k({key:`${U}[0]`,value:B[0],valueSpec:{},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},B));return _t(Kr(B[1]))?M.concat([new be(`${U}[1]`,B[1],"expressions are not allowed in function stops.")]):M.concat(C.validateSpec({key:`${U}[1]`,value:B[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function k(C,M){const B=ot(C.value),U=Mt(C.value),q=C.value!==null?C.value:M;if(a){if(B!==a)return[new be(C.key,q,`${B} stop domain type must match previous stop domain type ${a}`)]}else a=B;if(B!=="number"&&B!=="string"&&B!=="boolean")return[new be(C.key,q,"stop domain value must be a number, string, or boolean")];if(B!=="number"&&r!=="categorical"){let te=`number expected, ${B} found`;return On(e)&&r===void 0&&(te+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(C.key,q,te)]}return r!=="categorical"||B!=="number"||isFinite(U)&&Math.floor(U)===U?r!=="categorical"&&B==="number"&&l!==void 0&&Unew be(`${i.key}${a.key}`,i.value,a.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new be(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"&&!aa(r))return[new be(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!aa(r))return[new be(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!sa(r,["zoom","feature-state"]))return[new be(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Ba(r))return[new be(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jr(i){const e=i.key,r=i.value,a=i.valueSpec,l=[];return Array.isArray(a.values)?a.values.indexOf(Mt(r))===-1&&l.push(new be(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(Mt(r))===-1&&l.push(new be(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function Vn(i){return Ha(Kr(i.value))?Yr(Sr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$s(i)}function $s(i){const e=i.value,r=i.key;if(ot(e)!=="array")return[new be(r,e,`array expected, ${ot(e)} found`)];const a=i.styleSpec;let l,u=[];if(e.length<1)return[new be(r,e,"filter array must have at least 1 element")];switch(u=u.concat(Jr({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Mt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Mt(e[1])==="$type"&&u.push(new be(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&u.push(new be(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(l=ot(e[1]),l!=="string"&&u.push(new be(`${r}[1]`,e[1],`string expected, ${l} found`)));for(let d=2;d{x in r&&e.push(new be(a,r[x],`"${x}" is prohibited for ref layers`))}),l.layers.forEach(x=>{Mt(x.id)===f&&(g=x)}),g?g.ref?e.push(new be(a,r.ref,"ref cannot reference another ref layer")):d=Mt(g.type):e.push(new be(a,r.ref,`ref layer "${f}" not found`))}else if(d!=="background")if(r.source){const g=l.sources&&l.sources[r.source],x=g&&Mt(g.type);g?x==="vector"&&d==="raster"?e.push(new be(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&d==="hillshade"?e.push(new be(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&d!=="raster"?e.push(new be(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&d!=="hillshade"?e.push(new be(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||e.push(new be(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new be(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new be(a,r.source,`source "${r.source}" not found`))}else e.push(new be(a,r,'missing required property "source"'));return e=e.concat(Ti({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:Vn,layout:g=>Ti({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>Zs(Sr({layerType:d},x))}}),paint:g=>Ti({layer:r,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>qs(Sr({layerType:d},x))}})}})),e}function _n(i){const e=i.value,r=i.key,a=ot(e);return a!=="string"?[new be(r,e,`string expected, ${a} found`)]:[]}const tl={promoteId:function({key:i,value:e}){if(ot(e)==="string")return _n({key:i,value:e});{const r=[];for(const a in e)r.push(..._n({key:`${i}.${a}`,value:e[a]}));return r}}};function il(i){const e=i.value,r=i.key,a=i.styleSpec,l=i.style,u=i.validateSpec;if(!e.type)return[new be(r,e,'"type" is required')];const d=Mt(e.type);let f;switch(d){case"vector":case"raster":return f=Ti({key:r,value:e,valueSpec:a[`source_${d.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:tl,validateSpec:u}),f;case"raster-dem":return f=function(g){var x;const b=(x=g.sourceName)!==null&&x!==void 0?x:"",w=g.value,k=g.styleSpec,C=k.source_raster_dem,M=g.style;let B=[];const U=ot(w);if(w===void 0)return B;if(U!=="object")return B.push(new be("source_raster_dem",w,`object expected, ${U} found`)),B;const q=Mt(w.encoding)==="custom",te=["redFactor","greenFactor","blueFactor","baseShift"],Z=g.value.encoding?`"${g.value.encoding}"`:"Default";for(const Y in w)!q&&te.includes(Y)?B.push(new be(Y,w[Y],`In "${b}": "${Y}" is only valid when "encoding" is set to "custom". ${Z} encoding found`)):C[Y]?B=B.concat(g.validateSpec({key:Y,value:w[Y],valueSpec:C[Y],validateSpec:g.validateSpec,style:M,styleSpec:k})):B.push(new be(Y,w[Y],`unknown property "${Y}"`));return B}({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:u}),f;case"geojson":if(f=Ti({key:r,value:e,valueSpec:a.source_geojson,style:l,styleSpec:a,validateSpec:u,objectElementValidators:tl}),e.cluster)for(const g in e.clusterProperties){const[x,b]=e.clusterProperties[g],w=typeof x=="string"?[x,["accumulated"],["get",g]]:x;f.push(...Yr({key:`${r}.${g}.map`,value:b,validateSpec:u,expressionContext:"cluster-map"})),f.push(...Yr({key:`${r}.${g}.reduce`,value:w,validateSpec:u,expressionContext:"cluster-reduce"}))}return f;case"video":return Ti({key:r,value:e,valueSpec:a.source_video,style:l,validateSpec:u,styleSpec:a});case"image":return Ti({key:r,value:e,valueSpec:a.source_image,style:l,validateSpec:u,styleSpec:a});case"canvas":return[new be(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jr({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:l,validateSpec:u,styleSpec:a})}}function rl(i){const e=i.value,r=i.styleSpec,a=r.light,l=i.style;let u=[];const d=ot(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new be("light",e,`object expected, ${d} found`)]),u;for(const f in e){const g=f.match(/^(.*)-transition$/);u=u.concat(g&&a[g[1]]&&a[g[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:l,styleSpec:r}):a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new be(f,e[f],`unknown property "${f}"`)])}return u}function nl(i){const e=i.value,r=i.styleSpec,a=r.sky,l=i.style,u=ot(e);if(e===void 0)return[];if(u!=="object")return[new be("sky",e,`object expected, ${u} found`)];let d=[];for(const f in e)d=d.concat(a[f]?zr({key:f,value:e[f],valueSpec:a[f],style:l,styleSpec:r}):[new be(f,e[f],`unknown property "${f}"`)]);return d}function ua(i){const e=i.value,r=i.styleSpec,a=r.terrain,l=i.style;let u=[];const d=ot(e);if(e===void 0)return u;if(d!=="object")return u=u.concat([new be("terrain",e,`object expected, ${d} found`)]),u;for(const f in e)u=u.concat(a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:l,styleSpec:r}):[new be(f,e[f],`unknown property "${f}"`)]);return u}function da(i){let e=[];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)&&e.push(new be(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)&&e.push(new be(a,r,`all the sprites' URLs must be unique, but ${r[d].url} is duplicated`)),u.push(r[d].url),e=e.concat(Ti({key:`${a}[${d}]`,value:r[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return _n({key:a,value:r})}const Ri={"*":()=>[],array:js,boolean:function(i){const e=i.value,r=i.key,a=ot(e);return a!=="boolean"?[new be(r,e,`boolean expected, ${a} found`)]:[]},number:Ja,color:function(i){const e=i.key,r=i.value,a=ot(r);return a!=="string"?[new be(e,r,`color expected, ${a} found`)]:ht.parse(String(r))?[]:[new be(e,r,`color expected, "${r}" found`)]},constants:Qo,enum:Jr,filter:Vn,function:el,layer:ha,object:Ti,source:il,light:rl,sky:nl,terrain:ua,string:_n,formatted:function(i){return _n(i).length===0?[]:Yr(i)},resolvedImage:function(i){return _n(i).length===0?[]:Yr(i)},padding:function(i){const e=i.key,r=i.value;if(ot(r)==="array"){if(r.length<1||r.length>4)return[new be(e,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(Qo({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:zr}))),Un(r)}function Cr(i){return function(e){return i({...e,validateSpec:zr})}}function Un(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function fr(i){return function(...e){return Un(i.apply(this,e))}}pr.source=fr(Cr(il)),pr.sprite=fr(Cr(da)),pr.glyphs=fr(Cr(Gs)),pr.light=fr(Cr(rl)),pr.sky=fr(Cr(nl)),pr.terrain=fr(Cr(ua)),pr.layer=fr(Cr(ha)),pr.filter=fr(Cr(Vn)),pr.paintProperty=fr(Cr(qs)),pr.layoutProperty=fr(Cr(Zs));const gn=pr,ec=gn.light,Hs=gn.paintProperty,tc=gn.layoutProperty;function Nn(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new ln(new Error(a.message))),r=!0;return r}class pa{constructor(e,r,a){const l=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(r=d[1])+2*(a=d[2]);for(let g=0;g=w[M+0]&&l>=w[M+1])?(f[C]=!0,d.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,a,l,u,d,f,g){const x=this._convertToCellCoord(e),b=this._convertToCellCoord(r),w=this._convertToCellCoord(a),k=this._convertToCellCoord(l);for(let C=x;C<=w;C++)for(let M=b;M<=k;M++){const B=this.d*M+C;if((!g||g(this._convertFromCellCoord(C),this._convertFromCellCoord(M),this._convertFromCellCoord(C+1),this._convertFromCellCoord(M+1)))&&u.call(this,e,r,a,l,B,d,f,g))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=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]=Er[a].shallow.indexOf(u)>=0?d:jn(d,e)}i instanceof Error&&(l.message=i.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(l.$name=a),l}throw new Error("can't serialize object of type "+typeof i)}function $n(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||es(i)||di(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map($n);if(typeof i=="object"){const e=i.$name||"Object";if(!Er[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Er[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const l of Object.keys(i)){if(l==="$name")continue;const u=i[l];a[l]=Er[e].shallow.indexOf(l)>=0?u:$n(u)}return a}throw new Error("can't deserialize object of type "+typeof i)}class al{constructor(){this.first=!0}update(e,r){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"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,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function qn(i){for(const e of i)if(ts(e.charCodeAt(0)))return!0;return!1}function sl(i){for(const e of i)if(!ol(e.charCodeAt(0)))return!1;return!0}function ol(i){return!(ze.Arabic(i)||ze["Arabic Supplement"](i)||ze["Arabic Extended-A"](i)||ze["Arabic Presentation Forms-A"](i)||ze["Arabic Presentation Forms-B"](i))}function ts(i){return!(i!==746&&i!==747&&(i<4352||!(ze["Bopomofo Extended"](i)||ze.Bopomofo(i)||ze["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||ze["CJK Compatibility Ideographs"](i)||ze["CJK Compatibility"](i)||ze["CJK Radicals Supplement"](i)||ze["CJK Strokes"](i)||!(!ze["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||ze["CJK Unified Ideographs Extension A"](i)||ze["CJK Unified Ideographs"](i)||ze["Enclosed CJK Letters and Months"](i)||ze["Hangul Compatibility Jamo"](i)||ze["Hangul Jamo Extended-A"](i)||ze["Hangul Jamo Extended-B"](i)||ze["Hangul Jamo"](i)||ze["Hangul Syllables"](i)||ze.Hiragana(i)||ze["Ideographic Description Characters"](i)||ze.Kanbun(i)||ze["Kangxi Radicals"](i)||ze["Katakana Phonetic Extensions"](i)||ze.Katakana(i)&&i!==12540||!(!ze["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)||!(!ze["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||ze["Unified Canadian Aboriginal Syllabics"](i)||ze["Unified Canadian Aboriginal Syllabics Extended"](i)||ze["Vertical Forms"](i)||ze["Yijing Hexagram Symbols"](i)||ze["Yi Syllables"](i)||ze["Yi Radicals"](i))))}function Ws(i){return!(ts(i)||function(e){return!!(ze["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||ze["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||ze["Letterlike Symbols"](e)||ze["Number Forms"](e)||ze["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||ze["Control Pictures"](e)&&e!==9251||ze["Optical Character Recognition"](e)||ze["Enclosed Alphanumerics"](e)||ze["Geometric Shapes"](e)||ze["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ze["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ze["CJK Symbols and Punctuation"](e)||ze.Katakana(e)||ze["Private Use Area"](e)||ze["CJK Compatibility Forms"](e)||ze["Small Form Variants"](e)||ze["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function is(i){return i>=1424&&i<=2303||ze["Arabic Presentation Forms-A"](i)||ze["Arabic Presentation Forms-B"](i)}function ll(i,e){return!(!e&&is(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||ze.Khmer(i))}function ic(i){for(const e of i)if(is(e.charCodeAt(0)))return!0;return!1}const Qr=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(e,r){this.zoom=e,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 al,this.transition={})}isSupportedScript(e){return function(r,a){for(const l of r)if(!ll(l.charCodeAt(0),a))return!1;return!0}(e,Qr.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class fa{constructor(e,r){this.property=e,this.value=r,this.expression=function(a,l){if($a(a))return new Za(a,l);if(_t(a)){const u=Wo(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=ht.parse(a):l.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?l.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(u=rr.parse(a)):u=Li.parse(a),{kind:"constant",evaluate:()=>u}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class rs{constructor(e){this.property=e,this.value=new fa(e,void 0)}transitioned(e,r){return new cl(this.property,this.value,r,ui({},e.transition,this.transition),e.now)}untransitioned(){return new cl(this.property,this.value,null,{},0)}}class Xs{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return ct(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new rs(this._values[e].property)),this._values[e].value=new fa(this._values[e].property,r===null?void 0:ct(r))}getTransition(e){return ct(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new rs(this._values[e].property)),this._values[e].transition=ct(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const l=this.getTransition(r);l!==void 0&&(e[`${r}-transition`]=l)}return e}transitioned(e,r){const a=new hl(this._properties);for(const l of Object.keys(this._values))a._values[l]=this._values[l].transitioned(e,r._values[l]);return a}untransitioned(){const e=new hl(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class cl{constructor(e,r,a,l,u){this.property=e,this.value=r,this.begin=u+l.delay||0,this.end=this.begin+l.duration||0,e.specification.transition&&(l.delay||l.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const l=e.now||0,u=this.value.possiblyEvaluate(e,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=g*g,b=x*g;return 4*(g<.5?b:3*(g-x)+b-.75)}(f))}}return u}}class hl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const l=new ma(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,a);return l}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class ul{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return ct(this._values[e].value)}setValue(e,r){this._values[e]=new fa(this._values[e].property,r===null?void 0:ct(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const l=new ma(this._properties);for(const u of Object.keys(this._values))l._values[u]=this._values[u].possiblyEvaluate(e,r,a);return l}}class mr{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,l){return this.property.evaluate(this.value,this.parameters,e,r,a,l)}}class ma{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Be{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const l=wi[this.specification.type];return l?l(e,r,a):e}}class Ne{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,l){return new mr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,l)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new mr(this,{kind:"constant",value:void 0},e.parameters);const l=wi[this.specification.type];if(l){const u=l(e.value.value,r.value.value,a);return new mr(this,{kind:"constant",value:u},e.parameters)}return e}evaluate(e,r,a,l,u,d){return e.kind==="constant"?e.value:e.evaluate(r,a,l,u,d)}}class ns extends Ne{possiblyEvaluate(e,r,a,l){if(e.value===void 0)return new mr(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,l),d=e.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,f=this._calculate(d,d,d,r);return new mr(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const u=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new mr(this,{kind:"constant",value:u},r)}return new mr(this,e.expression,r)}evaluate(e,r,a,l,u,d){if(e.kind==="source"){const f=e.evaluate(r,a,l,u,d);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,l),e.evaluate({zoom:Math.floor(r.zoom)},a,l),e.evaluate({zoom:Math.floor(r.zoom)+1},a,l),r):e.value}_calculate(e,r,a,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class _a{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,l){if(e.value!==void 0){if(e.expression.kind==="constant"){const u=e.expression.evaluate(r,null,{},a,l);return this._calculate(u,u,u,r)}return this._calculate(e.expression.evaluate(new wt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new wt(Math.floor(r.zoom),r)),e.expression.evaluate(new wt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,l){return l.zoom>l.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Ks{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,l){return!!e.expression.evaluate(r,null,{},a,l)}interpolate(){return!1}}class Bi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const l=this.defaultPropertyValues[r]=new fa(a,void 0),u=this.defaultTransitionablePropertyValues[r]=new rs(a);this.defaultTransitioningPropertyValues[r]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=l.possiblyEvaluate({})}}}Me("DataDrivenProperty",Ne),Me("DataConstantProperty",Be),Me("CrossFadedDataDrivenProperty",ns),Me("CrossFadedProperty",_a),Me("ColorRampProperty",Ks);const Ys="-transition";class _r extends cn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ul(r.layout)),r.paint)){this._transitionablePaint=new Xs(r.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ma(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(tc,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Ys)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(Hs,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(Ys))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const l=this._transitionablePaint._values[e],u=l.property.specification["property-type"]==="cross-faded-data-driven",d=l.value.isDataDriven(),f=l.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const g=this._transitionablePaint._values[e].value;return g.isDataDriven()||d||u||this._handleOverridablePaintPropertyUpdate(e,f,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Ut(e,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(e,r,a,l,u={}){return(!u||u.validate!==!1)&&Nn(this,e.call(gn,{key:r,layerType:this.type,objectKey:a,value:l,styleSpec:he,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof mr&&On(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const dl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ga{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Pt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ot(i,e=1){let r=0,a=0;return{members:i.map(l=>{const u=dl[l.type].BYTES_PER_ELEMENT,d=r=pl(r,Math.max(e,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:pl(r,Math.max(a,e)),alignment:e}}function pl(i,e){return Math.ceil(i/e)*e}class ya extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const l=2*e;return this.int16[l+0]=r,this.int16[l+1]=a,e}}ya.prototype.bytesPerElement=4,Me("StructArrayLayout2i4",ya);class Br extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,a)}emplace(e,r,a,l){const u=3*e;return this.int16[u+0]=r,this.int16[u+1]=a,this.int16[u+2]=l,e}}Br.prototype.bytesPerElement=6,Me("StructArrayLayout3i6",Br);class Js extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,l)}emplace(e,r,a,l,u){const d=4*e;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=l,this.int16[d+3]=u,e}}Js.prototype.bytesPerElement=8,Me("StructArrayLayout4i8",Js);class Qs extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,l,u,d)}emplace(e,r,a,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}Qs.prototype.bytesPerElement=12,Me("StructArrayLayout2i4i12",Qs);class eo extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,l,u,d)}emplace(e,r,a,l,u,d,f){const g=4*e,x=8*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.uint8[x+4]=l,this.uint8[x+5]=u,this.uint8[x+6]=d,this.uint8[x+7]=f,e}}eo.prototype.bytesPerElement=8,Me("StructArrayLayout2i4ub8",eo);class xa extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const l=2*e;return this.float32[l+0]=r,this.float32[l+1]=a,e}}xa.prototype.bytesPerElement=8,Me("StructArrayLayout2f8",xa);class as extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d,f,g,x,b){const w=this.length;return this.resize(w+1),this.emplace(w,e,r,a,l,u,d,f,g,x,b)}emplace(e,r,a,l,u,d,f,g,x,b,w){const k=10*e;return this.uint16[k+0]=r,this.uint16[k+1]=a,this.uint16[k+2]=l,this.uint16[k+3]=u,this.uint16[k+4]=d,this.uint16[k+5]=f,this.uint16[k+6]=g,this.uint16[k+7]=x,this.uint16[k+8]=b,this.uint16[k+9]=w,e}}as.prototype.bytesPerElement=20,Me("StructArrayLayout10ui20",as);class to extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d,f,g,x,b,w,k){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,a,l,u,d,f,g,x,b,w,k)}emplace(e,r,a,l,u,d,f,g,x,b,w,k,C){const M=12*e;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]=g,this.uint16[M+7]=x,this.int16[M+8]=b,this.int16[M+9]=w,this.int16[M+10]=k,this.int16[M+11]=C,e}}to.prototype.bytesPerElement=24,Me("StructArrayLayout4i4ui4i24",to);class io extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,a)}emplace(e,r,a,l){const u=3*e;return this.float32[u+0]=r,this.float32[u+1]=a,this.float32[u+2]=l,e}}io.prototype.bytesPerElement=12,Me("StructArrayLayout3f12",io);class Fr extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}Fr.prototype.bytesPerElement=4,Me("StructArrayLayout1ul4",Fr);class ss extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d,f,g,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,a,l,u,d,f,g,x)}emplace(e,r,a,l,u,d,f,g,x,b){const w=10*e,k=5*e;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[k+3]=g,this.uint16[w+8]=x,this.uint16[w+9]=b,e}}ss.prototype.bytesPerElement=20,Me("StructArrayLayout6i1ul2ui20",ss);class va extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,l,u,d)}emplace(e,r,a,l,u,d,f){const g=6*e;return this.int16[g+0]=r,this.int16[g+1]=a,this.int16[g+2]=l,this.int16[g+3]=u,this.int16[g+4]=d,this.int16[g+5]=f,e}}va.prototype.bytesPerElement=12,Me("StructArrayLayout2i2i2i12",va);class os extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,l,u)}emplace(e,r,a,l,u,d){const f=4*e,g=8*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=l,this.int16[g+6]=u,this.int16[g+7]=d,e}}os.prototype.bytesPerElement=16,Me("StructArrayLayout2f1f2i16",os);class ba extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,l)}emplace(e,r,a,l,u){const d=12*e,f=3*e;return this.uint8[d+0]=r,this.uint8[d+1]=a,this.float32[f+1]=l,this.float32[f+2]=u,e}}ba.prototype.bytesPerElement=12,Me("StructArrayLayout2ub2f12",ba);class ls extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,a)}emplace(e,r,a,l){const u=3*e;return this.uint16[u+0]=r,this.uint16[u+1]=a,this.uint16[u+2]=l,e}}ls.prototype.bytesPerElement=6,Me("StructArrayLayout3ui6",ls);class Zn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q){const te=this.length;return this.resize(te+1),this.emplace(te,e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q)}emplace(e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q,te){const Z=24*e,Y=12*e,ue=48*e;return this.int16[Z+0]=r,this.int16[Z+1]=a,this.uint16[Z+2]=l,this.uint16[Z+3]=u,this.uint32[Y+2]=d,this.uint32[Y+3]=f,this.uint32[Y+4]=g,this.uint16[Z+10]=x,this.uint16[Z+11]=b,this.uint16[Z+12]=w,this.float32[Y+7]=k,this.float32[Y+8]=C,this.uint8[ue+36]=M,this.uint8[ue+37]=B,this.uint8[ue+38]=U,this.uint32[Y+10]=q,this.int16[Z+22]=te,e}}Zn.prototype.bytesPerElement=48,Me("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zn);class yn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q,te,Z,Y,ue,fe,Ee,Le,Ce,Ae,we,De){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q,te,Z,Y,ue,fe,Ee,Le,Ce,Ae,we,De)}emplace(e,r,a,l,u,d,f,g,x,b,w,k,C,M,B,U,q,te,Z,Y,ue,fe,Ee,Le,Ce,Ae,we,De,Ie){const xe=32*e,Ve=16*e;return this.int16[xe+0]=r,this.int16[xe+1]=a,this.int16[xe+2]=l,this.int16[xe+3]=u,this.int16[xe+4]=d,this.int16[xe+5]=f,this.int16[xe+6]=g,this.int16[xe+7]=x,this.uint16[xe+8]=b,this.uint16[xe+9]=w,this.uint16[xe+10]=k,this.uint16[xe+11]=C,this.uint16[xe+12]=M,this.uint16[xe+13]=B,this.uint16[xe+14]=U,this.uint16[xe+15]=q,this.uint16[xe+16]=te,this.uint16[xe+17]=Z,this.uint16[xe+18]=Y,this.uint16[xe+19]=ue,this.uint16[xe+20]=fe,this.uint16[xe+21]=Ee,this.uint16[xe+22]=Le,this.uint32[Ve+12]=Ce,this.float32[Ve+13]=Ae,this.float32[Ve+14]=we,this.uint16[xe+30]=De,this.uint16[xe+31]=Ie,e}}yn.prototype.bytesPerElement=64,Me("StructArrayLayout8i15ui1ul2f2ui64",yn);class cs extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}cs.prototype.bytesPerElement=4,Me("StructArrayLayout1f4",cs);class hs extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,a)}emplace(e,r,a,l){const u=3*e;return this.uint16[6*e+0]=r,this.float32[u+1]=a,this.float32[u+2]=l,e}}hs.prototype.bytesPerElement=12,Me("StructArrayLayout1ui2f12",hs);class xn extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const l=this.length;return this.resize(l+1),this.emplace(l,e,r,a)}emplace(e,r,a,l){const u=4*e;return this.uint32[2*e+0]=r,this.uint16[u+2]=a,this.uint16[u+3]=l,e}}xn.prototype.bytesPerElement=8,Me("StructArrayLayout1ul2ui8",xn);class ro extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const l=2*e;return this.uint16[l+0]=r,this.uint16[l+1]=a,e}}ro.prototype.bytesPerElement=4,Me("StructArrayLayout2ui4",ro);class no extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}no.prototype.bytesPerElement=2,Me("StructArrayLayout1ui2",no);class us extends Pt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,l){const u=this.length;return this.resize(u+1),this.emplace(u,e,r,a,l)}emplace(e,r,a,l,u){const d=4*e;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=l,this.float32[d+3]=u,e}}us.prototype.bytesPerElement=16,Me("StructArrayLayout4f16",us);class fl extends ga{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 ce(this.anchorPointX,this.anchorPointY)}}fl.prototype.size=20;class c extends ss{get(e){return new fl(this,e)}}Me("CollisionBoxArray",c);class t extends ga{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}t.prototype.size=48;class n extends Zn{get(e){return new t(this,e)}}Me("PlacedSymbolArray",n);class s extends ga{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}s.prototype.size=64;class o extends yn{get(e){return new s(this,e)}}Me("SymbolInstanceArray",o);class h extends cs{getoffsetX(e){return this.float32[1*e+0]}}Me("GlyphOffsetArray",h);class m extends Br{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Me("SymbolLineVertexArray",m);class _ extends ga{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]}}_.prototype.size=12;class y extends hs{get(e){return new _(this,e)}}Me("TextAnchorOffsetArray",y);class v extends ga{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]}}v.prototype.size=8;class T extends xn{get(e){return new v(this,e)}}Me("FeatureIndexArray",T);class S extends ya{}class E extends ya{}class V extends ya{}class O extends Qs{}class j extends eo{}class R extends xa{}class W extends as{}class ne extends to{}class $ extends io{}class J extends Fr{}class ae extends va{}class se extends ba{}class le extends ls{}class ge extends ro{}const _e=Ot([{name:"a_pos",components:2,type:"Int16"}],4),{members:ve}=_e;class Te{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,l){let u=this.segments[this.segments.length-1];return e>Te.MAX_VERTEX_ARRAY_LENGTH&&si(`Max vertices per segment is ${Te.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!u||u.vertexLength+e>Te.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 e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,l){return new Te([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:l,vaos:{},sortKey:0}])}}function We(i,e){return 256*(i=Ei(Math.floor(i),0,255))+Ei(Math.floor(e),0,255)}Te.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Me("SegmentVector",Te);const Se=Ot([{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 $e={exports:{}},Xe={exports:{}};Xe.exports=function(i,e){var r,a,l,u,d,f,g,x;for(a=i.length-(r=3&i.length),l=e,d=3432918353,f=461845907,x=0;x>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>16)*f&65535)<<16)&4294967295)<<13|l>>>19))+((5*(l>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(g=0,r){case 3:g^=(255&i.charCodeAt(x+2))<<16;case 2:g^=(255&i.charCodeAt(x+1))<<8;case 1:l^=g=(65535&(g=(g=(65535&(g^=255&i.charCodeAt(x)))*d+(((g>>>16)*d&65535)<<16)&4294967295)<<15|g>>>17))*f+(((g>>>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 st=Xe.exports,qe={exports:{}};qe.exports=function(i,e){for(var r,a=i.length,l=e^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 Je=st,et=qe.exports;$e.exports=Je,$e.exports.murmur3=Je,$e.exports.murmur2=et;var Dt=Oe($e.exports);class dt{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,l){this.ids.push(Xi(e)),this.positions.push(r,a,l)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Xi(e);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(e,r){const a=new Float64Array(e.ids),l=new Uint32Array(e.positions);return Jt(a,l,0,a.length-1),r&&r.push(a.buffer,l.buffer),{ids:a,positions:l}}static deserialize(e){const r=new dt;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Xi(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Dt(String(i))}function Jt(i,e,r,a){for(;r>1];let u=r-1,d=a+1;for(;;){do u++;while(i[u]l);if(u>=d)break;kt(i,u,d),kt(e,3*u,3*d),kt(e,3*u+1,3*d+1),kt(e,3*u+2,3*d+2)}d-r`u_${l}`),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new en(e,r):new Ki(e,r)}}class Zt{constructor(e,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,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&&e.set(u)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new Mr(e,r):new Ki(e,r)}}class At{constructor(e,r,a,l){this.expression=e,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(e,r,a,l,u){const d=this.paintVertexArray.length,f=this.expression.evaluate(new wt(0),r,{},l,[],u);this.paintVertexArray.resize(e),this._setPaintValue(d,e,f)}updatePaintArray(e,r,a,l){const u=this.expression.evaluate({zoom:0},a,l);this._setPaintValue(e,r,u)}_setPaintValue(e,r,a){if(this.type==="color"){const l=tn(a);for(let u=e;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(e,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),g=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(g,e,d,f)}updatePaintArray(e,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(e,r,u,d)}_setPaintValue(e,r,a,l){if(this.type==="color"){const u=tn(a),d=tn(l);for(let f=e;f`#define HAS_UNIFORM_${l}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof At||a instanceof Tt)for(let l=0;l!0){this.programConfigurations={};for(const l of e)this.programConfigurations[l.id]=new Gt(l,r,a);this.needsUpload=!1,this._featureMap=new dt,this._bufferOffset=0}populatePaintArrays(e,r,a,l,u,d){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,l,u,d);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,l){for(const u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,r,u,l)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function sr(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Ht(i,e,r){const a={color:{source:xa,composite:us},number:{source:cs,composite:xa}},l=function(u){return{"line-pattern":{source:W,composite:W},"fill-pattern":{source:W,composite:W},"fill-extrusion-pattern":{source:W,composite:W}}[u]}(i);return l&&l[r]||a[e][r]}Me("ConstantBinder",Pr),Me("CrossFadedConstantBinder",Zt),Me("SourceExpressionBinder",At),Me("CrossFadedCompositeBinder",ar),Me("CompositeExpressionBinder",Tt),Me("ProgramConfiguration",Gt,{omit:["_buffers"]}),Me("ProgramConfigurationSet",zt);const Bt=8192,ao=Math.pow(2,14)-1,ml=-ao-1;function vn(i){const e=Bt/i.extent,r=i.loadGeometry();for(let a=0;ad.x+1||gd.y+1)&&si("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function bn(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?vn(i):[]}}function ds(i,e,r,a,l){i.emplaceBack(2*e+(a+1)/2,2*r+(l+1)/2)}class rn{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new E,this.indexArray=new le,this.segments=new Te,this.programConfigurations=new zt(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,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:g,id:x,index:b,sourceLayerIndex:w}of e){const k=this.layers[0]._featureFilter.needGeometry,C=bn(g,k);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),C,a))continue;const M=f?d.evaluate(C,{},a):void 0,B={id:x,properties:g.properties,type:g.type,sourceLayerIndex:w,index:b,geometry:k?C.geometry:vn(g),patterns:{},sortKey:M};u.push(B)}f&&u.sort((g,x)=>g.sortKey-x.sortKey);for(const g of u){const{geometry:x,index:b,sourceLayerIndex:w}=g,k=e[b].feature;this.addFeature(g,x,b,a),r.featureIndex.insert(k,x,b,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ve),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,a,l){for(const u of r)for(const d of u){const f=d.x,g=d.y;if(f<0||f>=Bt||g<0||g>=Bt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=x.vertexLength;ds(this.layoutVertexArray,f,g,-1,-1),ds(this.layoutVertexArray,f,g,1,-1),ds(this.layoutVertexArray,f,g,1,1),ds(this.layoutVertexArray,f,g,-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,e,a,{},l)}}function so(i,e){for(let r=0;r1){if(ps(i,e))return!0;for(let a=0;a1?r:r.sub(e)._mult(l)._add(e))}function Kc(i,e){let r,a,l,u=!1;for(let d=0;de.y!=l.y>e.y&&e.x<(l.x-a.x)*(e.y-a.y)/(l.y-a.y)+a.x&&(u=!u)}return u}function fs(i,e){let r=!1;for(let a=0,l=i.length-1;ae.y!=d.y>e.y&&e.x<(d.x-u.x)*(e.y-u.y)/(d.y-u.y)+u.x&&(r=!r)}return r}function ju(i,e,r){const a=r[0],l=r[2];if(i.xl.x&&e.x>l.x||i.yl.y&&e.y>l.y)return!1;const u=oi(i,e,r[0]);return u!==oi(i,e,r[1])||u!==oi(i,e,r[2])||u!==oi(i,e,r[3])}function ho(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function gl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function yl(i,e,r,a,l){if(!e[0]&&!e[1])return i;const u=ce.convert(e)._mult(l);r==="viewport"&&u._rotate(-a);const d=[];for(let f=0;feh(U,B))}(x,g),C=w?b*f:b;for(const M of l)for(const B of M){const U=w?B:eh(B,g);let q=C;const te=xl([],[B.x,B.y,0,1],g);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?q*=te[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(q*=d.cameraToCenterDistance/te[3]),_l(k,U,q))return!0}return!1}}function eh(i,e){const r=xl([],[i.x,i.y,0,1],e);return new ce(r[0]/r[3],r[1]/r[3])}class th extends rn{}let ih;Me("HeatmapBucket",th,{omit:["layers"]});var Gu={get paint(){return ih=ih||new Bi({"heatmap-radius":new Ne(he.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ne(he.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Be(he.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ks(he.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Be(he.paint_heatmap["heatmap-opacity"])})}};function ac(i,{width:e,height:r},a,l){if(l){if(l instanceof Uint8ClampedArray)l=new Uint8Array(l.buffer);else if(l.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${l.length} but got: ${e*r*a}`)}else l=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=l,i}function rh(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const l=ac({},{width:e,height:r},a);sc(i,l,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=l.data}function sc(i,e,r,a,l,u){if(l.width===0||l.height===0)return e;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>e.width||l.height>e.height||a.x>e.width-l.width||a.y>e.height-l.height)throw new RangeError("out of range destination coordinates for image copy");const d=i.data,f=e.data;if(d===f)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g{e[i.evaluationKey]=g;const x=i.expression.evaluate(e);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){a=u=i[0],l=d=i[1];for(var M=r;Mu&&(u=f),g>d&&(d=g);x=(x=Math.max(u-a,d-l))!==0?32767/x:0}return fo(k,C,r,a,l,x,0),C}function sh(i,e,r,a,l){var u,d;if(l===hc(i,e,r,a)>0)for(u=e;u=e;u-=a)d=ch(u,i[u],i[u+1],d);return d&&bl(d,d.next)&&(_o(d),d=d.next),d}function Ta(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!bl(a,a.next)&&Vt(a.prev,a,a.next)!==0)a=a.next;else{if(_o(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function fo(i,e,r,a,l,u,d){if(i){!d&&u&&function(b,w,k,C){var M=b;do M.z===0&&(M.z=lc(M.x,M.y,w,k,C)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==b);M.prevZ.nextZ=null,M.prevZ=null,function(B){var U,q,te,Z,Y,ue,fe,Ee,Le=1;do{for(q=B,B=null,Y=null,ue=0;q;){for(ue++,te=q,fe=0,U=0;U0||Ee>0&&te;)fe!==0&&(Ee===0||!te||q.z<=te.z)?(Z=q,q=q.nextZ,fe--):(Z=te,te=te.nextZ,Ee--),Y?Y.nextZ=Z:B=Z,Z.prevZ=Y,Y=Z;q=te}Y.nextZ=null,Le*=2}while(ue>1)}(M)}(i,a,l,u);for(var f,g,x=i;i.prev!==i.next;)if(f=i.prev,g=i.next,u?Qu(i,a,l,u):Ju(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(g.i/r|0),_o(i),i=g.next,x=g.next;else if((i=g)===x){d?d===1?fo(i=ed(Ta(i),e,r),e,r,a,l,u,2):d===2&&td(i,e,r,a,l,u):fo(Ta(i),e,r,a,l,u,1);break}}}function Ju(i){var e=i.prev,r=i,a=i.next;if(Vt(e,r,a)>=0)return!1;for(var l=e.x,u=r.x,d=a.x,f=e.y,g=r.y,x=a.y,b=lu?l>d?l:d:u>d?u:d,C=f>g?f>x?f:x:g>x?g:x,M=a.next;M!==e;){if(M.x>=b&&M.x<=k&&M.y>=w&&M.y<=C&&_s(l,f,u,g,d,x,M.x,M.y)&&Vt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Qu(i,e,r,a){var l=i.prev,u=i,d=i.next;if(Vt(l,u,d)>=0)return!1;for(var f=l.x,g=u.x,x=d.x,b=l.y,w=u.y,k=d.y,C=fg?f>x?f:x:g>x?g:x,U=b>w?b>k?b:k:w>k?w:k,q=lc(C,M,e,r,a),te=lc(B,U,e,r,a),Z=i.prevZ,Y=i.nextZ;Z&&Z.z>=q&&Y&&Y.z<=te;){if(Z.x>=C&&Z.x<=B&&Z.y>=M&&Z.y<=U&&Z!==l&&Z!==d&&_s(f,b,g,w,x,k,Z.x,Z.y)&&Vt(Z.prev,Z,Z.next)>=0||(Z=Z.prevZ,Y.x>=C&&Y.x<=B&&Y.y>=M&&Y.y<=U&&Y!==l&&Y!==d&&_s(f,b,g,w,x,k,Y.x,Y.y)&&Vt(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;Z&&Z.z>=q;){if(Z.x>=C&&Z.x<=B&&Z.y>=M&&Z.y<=U&&Z!==l&&Z!==d&&_s(f,b,g,w,x,k,Z.x,Z.y)&&Vt(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;Y&&Y.z<=te;){if(Y.x>=C&&Y.x<=B&&Y.y>=M&&Y.y<=U&&Y!==l&&Y!==d&&_s(f,b,g,w,x,k,Y.x,Y.y)&&Vt(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function ed(i,e,r){var a=i;do{var l=a.prev,u=a.next.next;!bl(l,u)&&oh(l,a,a.next,u)&&mo(l,u)&&mo(u,l)&&(e.push(l.i/r|0),e.push(a.i/r|0),e.push(u.i/r|0),_o(a),_o(a.next),a=i=u),a=a.next}while(a!==i);return Ta(a)}function td(i,e,r,a,l,u){var d=i;do{for(var f=d.next.next;f!==d.prev;){if(d.i!==f.i&&sd(d,f)){var g=lh(d,f);return d=Ta(d,d.next),g=Ta(g,g.next),fo(d,e,r,a,l,u,0),void fo(g,e,r,a,l,u,0)}f=f.next}d=d.next}while(d!==i)}function id(i,e){return i.x-e.x}function rd(i,e){var r=function(l,u){var d,f=u,g=l.x,x=l.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var w=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(w<=g&&w>b&&(b=w,d=f.x=f.x&&f.x>=M&&g!==f.x&&_s(xd.x||f.x===d.x&&nd(d,f)))&&(d=f,U=k)),f=f.next;while(f!==C);return d}(i,e);if(!r)return e;var a=lh(r,i);return Ta(a,a.next),Ta(r,r.next)}function nd(i,e){return Vt(i.prev,i,e.prev)<0&&Vt(e.next,i,i.next)<0}function lc(i,e,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))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*l|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ad(i){var e=i,r=i;do(e.x=(i-d)*(u-f)&&(i-d)*(a-f)>=(r-d)*(e-f)&&(r-d)*(u-f)>=(l-d)*(a-f)}function sd(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,a){var l=r;do{if(l.i!==r.i&&l.next.i!==r.i&&l.i!==a.i&&l.next.i!==a.i&&oh(l,l.next,r,a))return!0;l=l.next}while(l!==r);return!1}(i,e)&&(mo(i,e)&&mo(e,i)&&function(r,a){var l=r,u=!1,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,e)&&(Vt(i.prev,i,e.prev)||Vt(i,e.prev,e))||bl(i,e)&&Vt(i.prev,i,i.next)>0&&Vt(e.prev,e,e.next)>0)}function Vt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function bl(i,e){return i.x===e.x&&i.y===e.y}function oh(i,e,r,a){var l=Tl(Vt(i,e,r)),u=Tl(Vt(i,e,a)),d=Tl(Vt(r,a,i)),f=Tl(Vt(r,a,e));return l!==u&&d!==f||!(l!==0||!wl(i,r,e))||!(u!==0||!wl(i,a,e))||!(d!==0||!wl(r,i,a))||!(f!==0||!wl(r,e,a))}function wl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Tl(i){return i>0?1:i<0?-1:0}function mo(i,e){return Vt(i.prev,i,i.next)<0?Vt(i,e,i.next)>=0&&Vt(i,i.prev,e)>=0:Vt(i,e,i.prev)<0||Vt(i,i.next,e)<0}function lh(i,e){var r=new cc(i.i,i.x,i.y),a=new cc(e.i,e.x,e.y),l=i.next,u=e.prev;return i.next=e,e.prev=i,r.next=l,l.prev=r,a.next=r,r.prev=a,u.next=a,a.prev=u,a}function ch(i,e,r,a){var l=new cc(i,e,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 _o(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 cc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function hc(i,e,r,a){for(var l=0,u=e,d=r-a;u0&&r.holes.push(a+=i[l-1].length)}return r};var hh=Oe(oc.exports);function od(i,e,r,a,l){uh(i,e,r||0,a||i.length-1,l||ld)}function uh(i,e,r,a,l){for(;a>r;){if(a-r>600){var u=a-r+1,d=e-r+1,f=Math.log(u),g=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*g*(u-g)/u)*(d-u/2<0?-1:1);uh(i,e,Math.max(r,Math.floor(e-d*g/u+x)),Math.min(a,Math.floor(e+(u-d)*g/u+x)),l)}var b=i[e],w=r,k=a;for(go(i,r,e),l(i[a],b)>0&&go(i,r,a);w0;)k--}l(i[r],b)===0?go(i,r,k):go(i,++k,a),k<=e&&(r=k+1),e<=k&&(a=k-1)}}function go(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function ld(i,e){return ie?1:0}function uc(i,e){const r=i.length;if(r<=1)return[i];const a=[];let l,u;for(let d=0;d1)for(let d=0;dr.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new V,this.indexArray=new le,this.indexArray2=new ge,this.programConfigurations=new zt(e.layers,e.zoom),this.segments=new Te,this.segments2=new Te,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=dc("fill",this.layers,r);const l=this.layers[0].layout.get("fill-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:x,sourceLayerIndex:b}of e){const w=this.layers[0]._featureFilter.needGeometry,k=bn(f,w);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),k,a))continue;const C=u?l.evaluate(k,{},a,r.availableImages):void 0,M={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?k.geometry:vn(f),patterns:{},sortKey:C};d.push(M)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=pc("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,g,x,a,{});r.featureIndex.insert(e[x].feature,g,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,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(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yu),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,a,l,u){for(const d of uc(r,500)){let f=0;for(const C of d)f+=C.length;const g=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=g.vertexLength,b=[],w=[];for(const C of d){if(C.length===0)continue;C!==d[0]&&w.push(b.length/2);const M=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),B=M.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(B+C.length-1,B),b.push(C[0].x),b.push(C[0].y);for(let U=1;U>3}if(l--,a===1||a===2)u+=i.readSVarint(),d+=i.readSVarint(),a===1&&(e&&f.push(e),e=[]),e.push(new md(u,d));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&f.push(e),f},gs.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,l=0,u=0,d=1/0,f=-1/0,g=1/0,x=-1/0;i.pos>3}if(a--,r===1||r===2)(l+=i.readSVarint())f&&(f=l),(u+=i.readSVarint())x&&(x=u);else if(r!==7)throw new Error("unknown command "+r)}return[d,g,f,x]},gs.prototype.toGeoJSON=function(i,e,r){var a,l,u=this.extent*Math.pow(2,r),d=this.extent*i,f=this.extent*e,g=this.loadGeometry(),x=gs.types[this.type];function b(C){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))}_h.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 e=this._pbf.readVarint()+this._pbf.pos;return new yd(this._pbf,e,this.extent,this._keys,this._values)};var vd=mh;function bd(i,e,r){if(i===3){var a=new vd(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}Gn.VectorTile=function(i,e){this.layers=i.readFields(bd,{},e)},Gn.VectorTileFeature=fh,Gn.VectorTileLayer=mh;const wd=Gn.VectorTileFeature.types,mc=Math.pow(2,13);function yo(i,e,r,a,l,u,d,f){i.emplaceBack(e,r,2*Math.floor(a*mc)+d,l*mc*2,u*mc*2,Math.round(f))}class _c{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new O,this.centroidVertexArray=new S,this.indexArray=new le,this.programConfigurations=new zt(e.layers,e.zoom),this.segments=new Te,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.features=[],this.hasPattern=dc("fill-extrusion",this.layers,r);for(const{feature:l,id:u,index:d,sourceLayerIndex:f}of e){const g=this.layers[0]._featureFilter.needGeometry,x=bn(l,g);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),x,a))continue;const b={id:u,sourceLayerIndex:f,index:d,geometry:g?x.geometry:vn(l),properties:l.properties,type:l.type,patterns:{}};this.hasPattern?this.features.push(pc("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(e,r,a){for(const l of this.features){const{geometry:u}=l;this.addFeature(l,u,l.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,pd.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,a,l,u){const d={x:0,y:0,vertexCount:0};for(const f of uc(r,500)){let g=0;for(const M of f)g+=M.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const M of f){if(M.length===0||Sd(M))continue;let B=0;for(let U=0;U=1){const te=M[U-1];if(!Td(q,te)){x.vertexLength+4>Te.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Z=q.sub(te)._perp()._unit(),Y=te.dist(q);B+Y>32768&&(B=0),yo(this.layoutVertexArray,q.x,q.y,Z.x,Z.y,0,0,B),yo(this.layoutVertexArray,q.x,q.y,Z.x,Z.y,0,1,B),d.x+=2*q.x,d.y+=2*q.y,d.vertexCount+=2,B+=Y,yo(this.layoutVertexArray,te.x,te.y,Z.x,Z.y,0,0,B),yo(this.layoutVertexArray,te.x,te.y,Z.x,Z.y,0,1,B),d.x+=2*te.x,d.y+=2*te.y,d.vertexCount+=2;const ue=x.vertexLength;this.indexArray.emplaceBack(ue,ue+2,ue+1),this.indexArray.emplaceBack(ue+1,ue+2,ue+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+g>Te.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray)),wd[e.type]!=="Polygon")continue;const b=[],w=[],k=x.vertexLength;for(const M of f)if(M.length!==0){M!==f[0]&&w.push(b.length/2);for(let B=0;BBt)||i.y===e.y&&(i.y<0||i.y>Bt)}function Sd(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Bt)||i.every(e=>e.y<0)||i.every(e=>e.y>Bt)}let gh;Me("FillExtrusionBucket",_c,{omit:["layers","features"]});var Id={get paint(){return gh=gh||new Bi({"fill-extrusion-opacity":new Be(he["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ne(he["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Be(he["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Be(he["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ns(he["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ne(he["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ne(he["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Be(he["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class kd extends _r{constructor(e){super(e,Id)}createBucket(e){return new _c(e)}queryRadius(){return gl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,l,u,d,f,g){const x=yl(e,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),k=function(M,B,U,q){const te=[];for(const Z of M){const Y=[Z.x,Z.y,0,1];xl(Y,Y,B),te.push(new ce(Y[0]/Y[3],Y[1]/Y[3]))}return te}(x,g),C=function(M,B,U,q){const te=[],Z=[],Y=q[8]*B,ue=q[9]*B,fe=q[10]*B,Ee=q[11]*B,Le=q[8]*U,Ce=q[9]*U,Ae=q[10]*U,we=q[11]*U;for(const De of M){const Ie=[],xe=[];for(const Ve of De){const Re=Ve.x,tt=Ve.y,yt=q[0]*Re+q[4]*tt+q[12],St=q[1]*Re+q[5]*tt+q[13],ti=q[2]*Re+q[6]*tt+q[14],or=q[3]*Re+q[7]*tt+q[15],Oi=ti+fe,Wt=or+Ee,pi=yt+Le,gi=St+Ce,Vi=ti+Ae,Ui=or+we,ii=new ce((yt+Y)/Wt,(St+ue)/Wt);ii.z=Oi/Wt,Ie.push(ii);const ri=new ce(pi/Ui,gi/Ui);ri.z=Vi/Ui,xe.push(ri)}te.push(Ie),Z.push(xe)}return[te,Z]}(l,w,b,g);return function(M,B,U){let q=1/0;oo(U,B)&&(q=yh(U,B[0]));for(let te=0;ter.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new j,this.layoutVertexArray2=new R,this.indexArray=new le,this.programConfigurations=new zt(e.layers,e.zoom),this.segments=new Te,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=dc("line",this.layers,r);const l=this.layers[0].layout.get("line-sort-key"),u=!l.isConstant(),d=[];for(const{feature:f,id:g,index:x,sourceLayerIndex:b}of e){const w=this.layers[0]._featureFilter.needGeometry,k=bn(f,w);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),k,a))continue;const C=u?l.evaluate(k,{},a):void 0,M={id:g,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:w?k.geometry:vn(f),patterns:{},sortKey:C};d.push(M)}u&&d.sort((f,g)=>f.sortKey-g.sortKey);for(const f of d){const{geometry:g,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const w=pc("line",this.layers,f,this.zoom,r);this.patternFeatures.push(w)}else this.addFeature(f,g,x,a,{});r.featureIndex.insert(e[x].feature,g,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,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(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ed)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,l,u){const d=this.layers[0].layout,f=d.get("line-join").evaluate(e,{}),g=d.get("line-cap"),x=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const w of r)this.addLine(w,e,f,g,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,u,l)}addLine(e,r,a,l,u,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let q=0;q=2&&e[g-1].equals(e[g-2]);)g--;let x=0;for(;x0;if(Ee&&q>x){const we=k.dist(C);if(we>2*b){const De=k.sub(k.sub(C)._mult(b/we)._round());this.updateDistance(C,De),this.addCurrentVertex(De,B,0,0,w),C=De}}const Ce=C&&M;let Ae=Ce?a:f?"butt":l;if(Ce&&Ae==="round"&&(ueu&&(Ae="bevel"),Ae==="bevel"&&(ue>2&&(Ae="flipbevel"),ue100)te=U.mult(-1);else{const we=ue*B.add(U).mag()/B.sub(U).mag();te._perp()._mult(we*(Le?-1:1))}this.addCurrentVertex(k,te,0,0,w),this.addCurrentVertex(k,te.mult(-1),0,0,w)}else if(Ae==="bevel"||Ae==="fakeround"){const we=-Math.sqrt(ue*ue-1),De=Le?we:0,Ie=Le?0:we;if(C&&this.addCurrentVertex(k,B,De,Ie,w),Ae==="fakeround"){const xe=Math.round(180*fe/Math.PI/20);for(let Ve=1;Ve2*b){const De=k.add(M.sub(k)._mult(b/we)._round());this.updateDistance(k,De),this.addCurrentVertex(De,U,0,0,w),k=De}}}}addCurrentVertex(e,r,a,l,u,d=!1){const f=r.y*l-r.x,g=-r.y-r.x*l;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,d,!1,a,u),this.addHalfVertex(e,f,g,d,!0,-l,u),this.distance>xh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,l,u,d))}addHalfVertex({x:e,y:r},a,l,u,d,f,g){const x=.5*(this.lineClips?this.scaledDistance*(xh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<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=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),g.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(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let vh,bh;Me("LineBucket",gc,{omit:["layers","patternFeatures"]});var wh={get paint(){return bh=bh||new Bi({"line-opacity":new Ne(he.paint_line["line-opacity"]),"line-color":new Ne(he.paint_line["line-color"]),"line-translate":new Be(he.paint_line["line-translate"]),"line-translate-anchor":new Be(he.paint_line["line-translate-anchor"]),"line-width":new Ne(he.paint_line["line-width"]),"line-gap-width":new Ne(he.paint_line["line-gap-width"]),"line-offset":new Ne(he.paint_line["line-offset"]),"line-blur":new Ne(he.paint_line["line-blur"]),"line-dasharray":new _a(he.paint_line["line-dasharray"]),"line-pattern":new ns(he.paint_line["line-pattern"]),"line-gradient":new Ks(he.paint_line["line-gradient"])})},get layout(){return vh=vh||new Bi({"line-cap":new Be(he.layout_line["line-cap"]),"line-join":new Ne(he.layout_line["line-join"]),"line-miter-limit":new Be(he.layout_line["line-miter-limit"]),"line-round-limit":new Be(he.layout_line["line-round-limit"]),"line-sort-key":new Ne(he.layout_line["line-sort-key"])})}};class Dd extends Ne{possiblyEvaluate(e,r){return r=new wt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,l){return r=ui({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,l)}}let Sl;class Ld extends _r{constructor(e){super(e,wh),this.gradientVersion=0,Sl||(Sl=new Dd(wh.paint.properties["line-width"].specification),Sl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof la,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Sl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new gc(e)}queryRadius(e){const r=e,a=Th(ho("line-width",this,r),ho("line-gap-width",this,r)),l=ho("line-offset",this,r);return a/2+Math.abs(l)+gl(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,l,u,d,f){const g=yl(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,f),x=f/2*Th(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,k){const C=[];for(let M=0;M=3){for(let U=0;U0?e+2*i:i}const Rd=Ot([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bd=Ot([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ot([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Fd=Ot([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Ot([{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 Sh=Ot([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Od=Ot([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Vd(i,e,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()),Qr.applyArabicShaping&&(l=Qr.applyArabicShaping(l)),l}(a.text,e,r)}),i}Ot([{name:"triangle",components:3,type:"Uint16"}]),Ot([{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"}]),Ot([{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"}]),Ot([{type:"Float32",name:"offsetX"}]),Ot([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ot([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const vo={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ei=24,Ih=ft,kh=function(i,e,r,a,l){var u,d,f=8*l-a-1,g=(1<>1,b=-7,w=r?l-1:0,k=r?-1:1,C=i[e+w];for(w+=k,u=C&(1<<-b)-1,C>>=-b,b+=f;b>0;u=256*u+i[e+w],w+=k,b-=8);for(d=u&(1<<-b)-1,u>>=-b,b+=a;b>0;d=256*d+i[e+w],w+=k,b-=8);if(u===0)u=1-x;else{if(u===g)return d?NaN:1/0*(C?-1:1);d+=Math.pow(2,a),u-=x}return(C?-1:1)*d*Math.pow(2,u-a)},Ah=function(i,e,r,a,l,u){var d,f,g,x=8*u-l-1,b=(1<>1,k=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=a?0:u-1,M=a?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),(e+=d+w>=1?k/g:k*Math.pow(2,1-w))*g>=2&&(d++,g/=2),d+w>=b?(f=0,d=b):d+w>=1?(f=(e*g-1)*Math.pow(2,l),d+=w):(f=e*Math.pow(2,w-1)*Math.pow(2,l),d=0));l>=8;i[r+C]=255&f,C+=M,f/=256,l-=8);for(d=d<0;i[r+C]=255&d,C+=M,d/=256,x-=8);i[r+C-M]|=128*B};function ft(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}ft.Varint=0,ft.Fixed64=1,ft.Bytes=2,ft.Fixed32=5;var yc=4294967296,zh=1/yc,Ch=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function wn(i){return i.type===ft.Bytes?i.readVarint()+i.pos:i.pos+1}function ys(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Eh(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var l=r.pos-1;l>=i;l--)r.buf[l+a]=r.buf[l]}function Ud(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function Mh(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}ft.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,u=this.pos;this.type=7&a,i(l,e,this),this.pos===u&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Il(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Mh(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Il(this.buf,this.pos)+Il(this.buf,this.pos+4)*yc;return this.pos+=8,i},readSFixed64:function(){var i=Il(this.buf,this.pos)+Mh(this.buf,this.pos+4)*yc;return this.pos+=8,i},readFloat:function(){var i=kh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=kh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:function(l,u,d){var f,g,x=d.buf;if(f=(112&(g=x[d.pos++]))>>4,g<128||(f|=(127&(g=x[d.pos++]))<<3,g<128)||(f|=(127&(g=x[d.pos++]))<<10,g<128)||(f|=(127&(g=x[d.pos++]))<<17,g<128)||(f|=(127&(g=x[d.pos++]))<<24,g<128)||(f|=(1&(g=x[d.pos++]))<<31,g<128))return ys(l,f,u);throw new Error("Expected varint not more than 10 bytes")}(e|=(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,e=this.pos;return this.pos=i,i-e>=12&&Ch?function(r,a,l){return Ch.decode(r.subarray(a,l))}(this.buf,e,i):function(r,a,l){for(var u="",d=a;d239?4:b>223?3:b>191?2:1;if(d+k>l)break;k===1?b<128&&(w=b):k===2?(192&(f=r[d+1]))==128&&(w=(31&b)<<6|63&f)<=127&&(w=null):k===3?(g=r[d+2],(192&(f=r[d+1]))==128&&(192&g)==128&&((w=(15&b)<<12|(63&f)<<6|63&g)<=2047||w>=55296&&w<=57343)&&(w=null)):k===4&&(g=r[d+2],x=r[d+3],(192&(f=r[d+1]))==128&&(192&g)==128&&(192&x)==128&&((w=(15&b)<<18|(63&f)<<12|(63&g)<<6|63&x)<=65535||w>=1114112)&&(w=null)),w===null?(w=65533,k=1):w>65535&&(w-=65536,u+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),u+=String.fromCharCode(w),d+=k}return u}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==ft.Bytes)return i.push(this.readVarint(e));var r=wn(this);for(i=i||[];this.pos127;);else if(e===ft.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ft.Fixed32)this.pos+=4;else{if(e!==ft.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,r){var a,l;if(e>=0?(a=e%4294967296|0,l=e/4294967296|0):(l=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,l=l+1|0)),e>=18446744073709552e3||e<-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 e=this.pos;this.pos=function(a,l,u){for(var d,f,g=0;g55295&&d<57344){if(!f){d>56319||g+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-e;r>=128&&Eh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Ah(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Ah(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Eh(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,ft.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Ud,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Nd,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,qd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,jd,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,$d,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Zd,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Gd,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Hd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Wd,e)},writeBytesField:function(i,e){this.writeTag(i,ft.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,ft.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,ft.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,ft.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,ft.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,ft.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,ft.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,ft.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,ft.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,ft.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var xc=Oe(Ih);const vc=3;function Xd(i,e,r){i===1&&r.readMessage(Kd,e)}function Kd(i,e,r){if(i===3){const{id:a,bitmap:l,width:u,height:d,left:f,top:g,advance:x}=r.readMessage(Yd,{});e.push({id:a,bitmap:new po({width:u+2*vc,height:d+2*vc},l),metrics:{width:u,height:d,left:f,top:g,advance:x}})}}function Yd(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const Ph=vc;function Dh(i){let e=0,r=0;for(const d of i)e+=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(e/.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 g=a[f];if(!(d.w>g.w||d.h>g.h)){if(d.x=g.x,d.y=g.y,u=Math.max(u,d.y+d.h),l=Math.max(l,d.x+d.w),d.w===g.w&&d.h===g.h){const x=a.pop();f=0&&a>=e&&Al[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new vs;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(wo.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function kl(i,e,r,a,l,u,d,f,g,x,b,w,k,C,M,B){const U=vs.fromFeature(i,l);let q;w===A.ah.vertical&&U.verticalizePunctuation();const{processBidirectionalText:te,processStyledBidirectionalText:Z}=Qr;if(te&&U.sections.length===1){q=[];const fe=te(U.toString(),wc(U,x,u,e,a,C,M));for(const Ee of fe){const Le=new vs;Le.text=Ee,Le.sections=U.sections;for(let Ce=0;Ce0&&Sn>Ji&&(Ji=Sn)}else{const xr=Le[rt.fontStack],er=xr&&xr[yi];if(er&&er.rect)Or=er.rect,Dr=er.metrics;else{const Sn=Ee[rt.fontStack],Ao=Sn&&Sn[yi];if(!Ao)continue;Dr=Ao.metrics}ai=(ri-rt.scale)*ei}Lr?(fe.verticalizable=!0,Ii.push({glyph:yi,imageName:Vr,x:yt,y:St+ai,vertical:Lr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:ki,metrics:Dr,rect:Or}),yt+=Tn*rt.scale+Ve):(Ii.push({glyph:yi,imageName:Vr,x:yt,y:St+ai,vertical:Lr,scale:rt.scale,fontStack:rt.fontStack,sectionIndex:ki,metrics:Dr,rect:Or}),yt+=Dr.advance*rt.scale+Ve)}Ii.length!==0&&(ti=Math.max(yt-Ve,ti),ep(Ii,0,Ii.length-1,Oi,Ji)),yt=0;const Qi=we*ri+Ji;Ni.lineOffset=Math.max(Ji,Si),St+=Qi,or=Math.max(Qi,or),++Wt}var pi;const gi=St-bo,{horizontalAlign:Vi,verticalAlign:Ui}=Tc(De);(function(ii,ri,Si,Ni,Ii,Ji,Qi,ni,rt){const ki=(ri-Si)*Ii;let yi=0;yi=Ji!==Qi?-ni*Ni-bo:(-Ni*rt+.5)*Qi;for(const ai of ii)for(const Dr of ai.positionedGlyphs)Dr.x+=ki,Dr.y+=yi})(fe.positionedLines,Oi,Vi,Ui,ti,or,we,gi,Ae.length),fe.top+=-Ui*gi,fe.bottom=fe.top+gi,fe.left+=-Vi*ti,fe.right=fe.left+ti}(ue,e,r,a,q,d,f,g,w,x,k,B),!function(fe){for(const Ee of fe)if(Ee.positionedGlyphs.length!==0)return!1;return!0}(Y)&&ue}const Al={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Jd={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Rh(i,e,r,a,l,u){if(e.imageName){const d=a[e.imageName];return d?d.displaySize[0]*e.scale*ei/u+l:0}{const d=r[e.fontStack],f=d&&d[i];return f?f.metrics.advance*e.scale+l:0}}function Bh(i,e,r,a){const l=Math.pow(i-e,2);return a?i=0;let b=0;for(let k=0;kd.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=nc([]),this.placementViewportMatrix=nc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Uh(this.zoom,r["text-size"]),this.iconSizeData=Uh(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=Sc(a,"text-overlap","text-allow-overlap")!=="never"||Sc(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=>A.ah[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new kc(new zt(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new kc(new zt(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new h,this.lineVertexArray=new m,this.symbolInstances=new o,this.textAnchorOffsets=new y}calculateGlyphDependencies(e,r,a,l,u){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,w=u.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const k=r.iconDependencies,C=r.glyphDependencies,M=r.availableImages,B=new wt(this.zoom);for(const{feature:U,id:q,index:te,sourceLayerIndex:Z}of e){const Y=l._featureFilter.needGeometry,ue=bn(U,Y);if(!l._featureFilter.filter(B,ue,a))continue;let fe,Ee;if(Y||(ue.geometry=vn(U)),x){const Ce=l.getValueAndResolveTokens("text-field",ue,a,M),Ae=Gi.factory(Ce),we=this.hasRTLText=this.hasRTLText||np(Ae);(!we||Qr.getRTLTextPluginStatus()==="unavailable"||we&&Qr.isParsed())&&(fe=Vd(Ae,l,ue))}if(b){const Ce=l.getValueAndResolveTokens("icon-image",ue,a,M);Ee=Ce instanceof nr?Ce:nr.fromString(Ce)}if(!fe&&!Ee)continue;const Le=this.sortFeaturesByKey?w.evaluate(ue,{},a):void 0;if(this.features.push({id:q,text:fe,icon:Ee,index:te,sourceLayerIndex:Z,geometry:ue.geometry,properties:U.properties,type:ip[U.type],sortKey:Le}),Ee&&(k[Ee.name]=!0),fe){const Ce=d.evaluate(ue,{},a).join(","),Ae=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(A.ah.vertical)>=0;for(const we of fe.sections)if(we.image)k[we.image.name]=!0;else{const De=qn(fe.toString()),Ie=we.fontStack||Ce,xe=C[Ie]=C[Ie]||{};this.calculateGlyphDependencies(we.text,xe,Ae,this.allowVerticalPlacement,De)}}}u.get("symbol-placement")==="line"&&(this.features=function(U){const q={},te={},Z=[];let Y=0;function ue(Ce){Z.push(U[Ce]),Y++}function fe(Ce,Ae,we){const De=te[Ce];return delete te[Ce],te[Ae]=De,Z[De].geometry[0].pop(),Z[De].geometry[0]=Z[De].geometry[0].concat(we[0]),De}function Ee(Ce,Ae,we){const De=q[Ae];return delete q[Ae],q[Ce]=De,Z[De].geometry[0].shift(),Z[De].geometry[0]=we[0].concat(Z[De].geometry[0]),De}function Le(Ce,Ae,we){const De=we?Ae[0][Ae[0].length-1]:Ae[0][0];return`${Ce}:${De.x}:${De.y}`}for(let Ce=0;CeCe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((U,q)=>U.sortKey-q.sortKey)}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,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(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let l=e.dist(r[e.segment+1]),u=e.dist(r[e.segment]);const d={};for(let f=e.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(e,r){const a=e.placedSymbolArray.get(r),l=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;ul[f]-l[g]||u[g]-u[f]),d}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((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 Nh,jh;Me("SymbolBucket",bs,{omit:["layers","collisionBoxArray","features","compareText"]}),bs.MAX_GLYPHS=65535,bs.addDynamicAttributes=Ic;var zc={get paint(){return jh=jh||new Bi({"icon-opacity":new Ne(he.paint_symbol["icon-opacity"]),"icon-color":new Ne(he.paint_symbol["icon-color"]),"icon-halo-color":new Ne(he.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ne(he.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ne(he.paint_symbol["icon-halo-blur"]),"icon-translate":new Be(he.paint_symbol["icon-translate"]),"icon-translate-anchor":new Be(he.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ne(he.paint_symbol["text-opacity"]),"text-color":new Ne(he.paint_symbol["text-color"],{runtimeType:jt,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Ne(he.paint_symbol["text-halo-color"]),"text-halo-width":new Ne(he.paint_symbol["text-halo-width"]),"text-halo-blur":new Ne(he.paint_symbol["text-halo-blur"]),"text-translate":new Be(he.paint_symbol["text-translate"]),"text-translate-anchor":new Be(he.paint_symbol["text-translate-anchor"])})},get layout(){return Nh=Nh||new Bi({"symbol-placement":new Be(he.layout_symbol["symbol-placement"]),"symbol-spacing":new Be(he.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Be(he.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ne(he.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Be(he.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Be(he.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Be(he.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Be(he.layout_symbol["icon-ignore-placement"]),"icon-optional":new Be(he.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Be(he.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ne(he.layout_symbol["icon-size"]),"icon-text-fit":new Be(he.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Be(he.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ne(he.layout_symbol["icon-image"]),"icon-rotate":new Ne(he.layout_symbol["icon-rotate"]),"icon-padding":new Ne(he.layout_symbol["icon-padding"]),"icon-keep-upright":new Be(he.layout_symbol["icon-keep-upright"]),"icon-offset":new Ne(he.layout_symbol["icon-offset"]),"icon-anchor":new Ne(he.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Be(he.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Be(he.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Be(he.layout_symbol["text-rotation-alignment"]),"text-field":new Ne(he.layout_symbol["text-field"]),"text-font":new Ne(he.layout_symbol["text-font"]),"text-size":new Ne(he.layout_symbol["text-size"]),"text-max-width":new Ne(he.layout_symbol["text-max-width"]),"text-line-height":new Be(he.layout_symbol["text-line-height"]),"text-letter-spacing":new Ne(he.layout_symbol["text-letter-spacing"]),"text-justify":new Ne(he.layout_symbol["text-justify"]),"text-radial-offset":new Ne(he.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Be(he.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ne(he.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ne(he.layout_symbol["text-anchor"]),"text-max-angle":new Be(he.layout_symbol["text-max-angle"]),"text-writing-mode":new Be(he.layout_symbol["text-writing-mode"]),"text-rotate":new Ne(he.layout_symbol["text-rotate"]),"text-padding":new Be(he.layout_symbol["text-padding"]),"text-keep-upright":new Be(he.layout_symbol["text-keep-upright"]),"text-transform":new Ne(he.layout_symbol["text-transform"]),"text-offset":new Ne(he.layout_symbol["text-offset"]),"text-allow-overlap":new Be(he.layout_symbol["text-allow-overlap"]),"text-overlap":new Be(he.layout_symbol["text-overlap"]),"text-ignore-placement":new Be(he.layout_symbol["text-ignore-placement"]),"text-optional":new Be(he.layout_symbol["text-optional"])})}};class $h{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:fi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Me("FormatSectionOverride",$h,{omit:["defaultValue"]});class Cl extends _r{constructor(e){super(e,zc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const 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(e,r,a,l){const u=this.layout.get(e).evaluate(r,{},a,l),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||_t(d.value)||!u?u:function(f,g){return g.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,u)}createBucket(e){return new bs(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of zc.paint.overridableProperties){if(!Cl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new $h(r),l=new gt(a,r.property.specification);let u=null;u=r.value.kind==="constant"||r.value.kind==="source"?new qa("source",l):new Vs("composite",l,r.value.zoomStops),this.paint._values[e]=new mr(r.property,u,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&Cl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),l=zc.paint.properties[r];let u=!1;const d=f=>{for(const g of f)if(l.overrides&&l.overrides.hasOverride(g))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Gi)d(a.value.value.sections);else if(a.value.kind==="source"){const f=x=>{u||(x instanceof Wr&&qt(x.value)===Kt?d(x.value.sections):x instanceof ja?d(x.sections):x.eachChild(f))},g=a.value;g._styleExpression&&f(g._styleExpression.expression)}return u}}let qh;var ap={get paint(){return qh=qh||new Bi({"background-color":new Be(he.paint_background["background-color"]),"background-pattern":new _a(he.paint_background["background-pattern"]),"background-opacity":new Be(he.paint_background["background-opacity"])})}};class sp extends _r{constructor(e){super(e,ap)}}let Zh;var op={get paint(){return Zh=Zh||new Bi({"raster-opacity":new Be(he.paint_raster["raster-opacity"]),"raster-hue-rotate":new Be(he.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Be(he.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Be(he.paint_raster["raster-brightness-max"]),"raster-saturation":new Be(he.paint_raster["raster-saturation"]),"raster-contrast":new Be(he.paint_raster["raster-contrast"]),"raster-resampling":new Be(he.paint_raster["raster-resampling"]),"raster-fade-duration":new Be(he.paint_raster["raster-fade-duration"])})}};class lp extends _r{constructor(e){super(e,op)}}class cp extends _r{constructor(e){super(e,{}),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=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class hp{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Cc=63710088e-1;class Xn{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Xn(lr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,l=e.lat*r,u=Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos((e.lng-this.lng)*r);return Cc*Math.acos(Math.min(u,1))}static convert(e){if(e instanceof Xn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Xn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Xn(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const Gh=2*Math.PI*Cc;function Hh(i){return Gh*Math.cos(i*Math.PI/180)}function Wh(i){return(180+i)/360}function Xh(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Kh(i,e){return i/Hh(e)}function Ec(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class El{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=Xn.convert(e);return new El(Wh(a.lng),Xh(a.lat),Kh(r,a.lat))}toLngLat(){return new Xn(360*this.x-180,Ec(this.y))}toAltitude(){return this.z*Hh(Ec(this.y))}meterInMercatorCoordinateUnits(){return 1/Gh*(e=Ec(this.y),1/Math.cos(e*Math.PI/180));var e}}function Yh(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class Mc{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${a}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=a,this.key=So(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const l=(d=this.y,f=this.z,g=Yh(256*(u=this.x),256*(d=Math.pow(2,f)-d-1),f),x=Yh(256*(u+1),256*(d+1),f),g[0]+","+g[1]+","+x[0]+","+x[1]);var u,d,f,g,x;const b=function(w,k,C){let M,B="";for(let U=w;U>0;U--)M=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new ce((e.x*r-this.x)*Bt,(e.y*r-this.y)*Bt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Jh{constructor(e,r){this.wrap=e,this.canonical=r,this.key=So(e,r.z,r.z,r.x,r.y)}}class yr{constructor(e,r,a,l,u){if(e= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Mc(a,+l,+u),this.key=So(r,e,a,l,u)}clone(){return new yr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new yr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new yr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-e;return e>this.canonical.z?So(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):So(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new yr(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 yr(r,this.wrap,r,a,l),new yr(r,this.wrap,r,a+1,l),new yr(r,this.wrap,r,a,l+1),new yr(r,this.wrap,r,a+1,l+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.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+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new gr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let 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 g=-r*this.dim,x=-a*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class tu{constructor(e,r,a,l,u){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=l,this.properties=e.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(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class iu{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new pa(Bt,16,0),this.grid3D=new pa(Bt,16,0),this.featureIndexArray=new T,this.promoteId=r}insert(e,r,a,l,u,d){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,l,u);const g=d?this.grid3D:this.grid;for(let x=0;x=0&&w[3]>=0&&g.insert(f,w[0],w[1],w[2],w[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Gn.VectorTile(new xc(this.rawTileData)).layers,this.sourceLayerCoder=new eu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,l){this.loadVTLayers();const u=e.params||{},d=Bt/e.tileSize/e.scale,f=Wa(u.filter),g=e.queryGeometry,x=e.queryPadding*d,b=nu(g),w=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),k=nu(e.cameraQueryGeometry),C=this.grid3D.query(k.minX-x,k.minY-x,k.maxX+x,k.maxY+x,(U,q,te,Z)=>function(Y,ue,fe,Ee,Le){for(const Ae of Y)if(ue<=Ae.x&&fe<=Ae.y&&Ee>=Ae.x&&Le>=Ae.y)return!0;const Ce=[new ce(ue,fe),new ce(ue,Le),new ce(Ee,Le),new ce(Ee,fe)];if(Y.length>2){for(const Ae of Ce)if(fs(Y,Ae))return!0}for(let Ae=0;Ae(Z||(Z=vn(Y)),ue.queryIntersectsFeature(g,Y,fe,Z,this.z,e.transform,d,e.pixelPosMatrix)))}return M}loadMatchingFeature(e,r,a,l,u,d,f,g,x,b,w){const k=this.bucketLayerIDs[r];if(d&&!function(U,q){for(let te=0;te=0)return!0;return!1}(d,k))return;const C=this.sourceLayerCoder.decode(a),M=this.vtLayers[C].feature(l);if(u.needGeometry){const U=bn(M,!0);if(!u.filter(new wt(this.tileID.overscaledZ),U,this.tileID.canonical))return}else if(!u.filter(new wt(this.tileID.overscaledZ),M))return;const B=this.getId(M,C);for(let U=0;U{const f=e instanceof ma?e.get(d):null;return f&&f.evaluate?f.evaluate(r,a,l):f})}function nu(i){let e=1/0,r=1/0,a=-1/0,l=-1/0;for(const u of i)e=Math.min(e,u.x),r=Math.min(r,u.y),a=Math.max(a,u.x),l=Math.max(l,u.y);return{minX:e,minY:r,maxX:a,maxY:l}}function up(i,e){return e-i}function au(i,e,r,a,l){const u=[];for(let d=0;d=a&&w.x>=a||(b.x>=a?b=new ce(a,b.y+(a-b.x)/(w.x-b.x)*(w.y-b.y))._round():w.x>=a&&(w=new ce(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 ce(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round():w.y>=l&&(w=new ce(b.x+(l-b.y)/(w.y-b.y)*(w.x-b.x),l)._round()),g&&b.equals(g[g.length-1])||(g=[b],u.push(g)),g.push(w)))))}}return u}Me("FeatureIndex",iu,{omit:["rawTileData","sourceLayerCoder"]});class Kn extends ce{constructor(e,r,a,l){super(e,r),this.angle=a,l!==void 0&&(this.segment=l)}clone(){return new Kn(this.x,this.y,this.angle,this.segment)}}function su(i,e,r,a,l){if(e.segment===void 0||r===0)return!0;let u=e,d=e.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 g=[];let x=0;for(;fa;)x-=g.shift().angleDelta;if(x>l)return!1;d++,f+=b.dist(w)}return!0}function ou(i){let e=0;for(let r=0;rx){const M=(x-g)/C,B=wi.number(w.x,k.x,M),U=wi.number(w.y,k.y,M),q=new Kn(B,U,k.angleTo(w),b);return q._round(),!d||su(i,q,f,d,e)?q:void 0}g+=C}}function pp(i,e,r,a,l,u,d,f,g){const x=lu(a,u,d),b=cu(a,l),w=b*d,k=i[0].x===0||i[0].x===g||i[0].y===0||i[0].y===g;return e-w=0&&Y=0&&ue=0&&k+x<=b){const fe=new Kn(Y,ue,te,M);fe._round(),a&&!su(i,fe,u,a,l)||C.push(fe)}}w+=q}return f||C.length||d||(C=hu(i,w/2,r,a,l,u,d,!0,g)),C}Me("Anchor",Kn);const ws=Yi;function uu(i,e,r,a){const l=[],u=i.image,d=u.pixelRatio,f=u.paddedRect.w-2*ws,g=u.paddedRect.h-2*ws,x=i.right-i.left,b=i.bottom-i.top,w=u.stretchX||[[0,f]],k=u.stretchY||[[0,g]],C=(we,De)=>we+De[1]-De[0],M=w.reduce(C,0),B=k.reduce(C,0),U=f-M,q=g-B;let te=0,Z=M,Y=0,ue=B,fe=0,Ee=U,Le=0,Ce=q;if(u.content&&a){const we=u.content;te=Ml(w,0,we[0]),Y=Ml(k,0,we[1]),Z=Ml(w,we[0],we[2]),ue=Ml(k,we[1],we[3]),fe=we[0]-te,Le=we[1]-Y,Ee=we[2]-we[0]-Z,Ce=we[3]-we[1]-ue}const Ae=(we,De,Ie,xe)=>{const Ve=Pl(we.stretch-te,Z,x,i.left),Re=Dl(we.fixed-fe,Ee,we.stretch,M),tt=Pl(De.stretch-Y,ue,b,i.top),yt=Dl(De.fixed-Le,Ce,De.stretch,B),St=Pl(Ie.stretch-te,Z,x,i.left),ti=Dl(Ie.fixed-fe,Ee,Ie.stretch,M),or=Pl(xe.stretch-Y,ue,b,i.top),Oi=Dl(xe.fixed-Le,Ce,xe.stretch,B),Wt=new ce(Ve,tt),pi=new ce(St,tt),gi=new ce(St,or),Vi=new ce(Ve,or),Ui=new ce(Re/d,yt/d),ii=new ce(ti/d,Oi/d),ri=e*Math.PI/180;if(ri){const Ii=Math.sin(ri),Ji=Math.cos(ri),Qi=[Ji,-Ii,Ii,Ji];Wt._matMult(Qi),pi._matMult(Qi),Vi._matMult(Qi),gi._matMult(Qi)}const Si=we.stretch+we.fixed,Ni=De.stretch+De.fixed;return{tl:Wt,tr:pi,bl:Vi,br:gi,tex:{x:u.paddedRect.x+ws+Si,y:u.paddedRect.y+ws+Ni,w:Ie.stretch+Ie.fixed-Si,h:xe.stretch+xe.fixed-Ni},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ui,pixelOffsetBR:ii,minFontScaleX:Ee/d/x,minFontScaleY:Ce/d/b,isSDF:r}};if(a&&(u.stretchX||u.stretchY)){const we=du(w,U,M),De=du(k,q,B);for(let Ie=0;Ie0&&(M=Math.max(10,M),this.circleDiameter=M)}else{let w=d.top*f-g[0],k=d.bottom*f+g[2],C=d.left*f-g[3],M=d.right*f+g[1];const B=d.collisionPadding;if(B&&(C-=B[0]*f,w-=B[1]*f,M+=B[2]*f,k+=B[3]*f),b){const U=new ce(C,w),q=new ce(M,w),te=new ce(C,k),Z=new ce(M,k),Y=b*Math.PI/180;U._rotate(Y),q._rotate(Y),te._rotate(Y),Z._rotate(Y),C=Math.min(U.x,q.x,te.x,Z.x),M=Math.max(U.x,q.x,te.x,Z.x),w=Math.min(U.y,q.y,te.y,Z.y),k=Math.max(U.y,q.y,te.y,Z.y)}e.emplaceBack(r.x,r.y,C,w,M,k,a,l,u)}this.boxEndIndex=e.length}}class fp{constructor(e=[],r=mp){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,l=r[e];for(;e>0;){const u=e-1>>1,d=r[u];if(a(l,d)>=0)break;r[e]=d,e=u}r[e]=l}_down(e){const{data:r,compare:a}=this,l=this.length>>1,u=r[e];for(;e=0)break;r[e]=f,e=d}r[e]=u}}function mp(i,e){return ie?1:0}function _p(i,e=1,r=!1){let a=1/0,l=1/0,u=-1/0,d=-1/0;const f=i[0];for(let C=0;Cu)&&(u=M.x),(!C||M.y>d)&&(d=M.y)}const g=Math.min(u-a,d-l);let x=g/2;const b=new fp([],gp);if(g===0)return new ce(a,l);for(let C=a;Cw.d||!w.d)&&(w=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,k)),C.max-w.d<=e||(x=C.h/2,b.push(new Ts(C.p.x-x,C.p.y-x,x,i)),b.push(new Ts(C.p.x+x,C.p.y-x,x,i)),b.push(new Ts(C.p.x-x,C.p.y+x,x,i)),b.push(new Ts(C.p.x+x,C.p.y+x,x,i)),k+=4)}return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${w.d}`)),w.p}function gp(i,e){return e.max-i.max}function Ts(i,e,r,a){this.p=new ce(i,e),this.h=r,this.d=function(l,u){let d=!1,f=1/0;for(let g=0;gl.y!=M.y>l.y&&l.x<(M.x-C.x)*(l.y-C.y)/(M.y-C.y)+C.x&&(d=!d),f=Math.min(f,Xc(l,C,M))}}return(d?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var _i;A.ap=void 0,(_i=A.ap||(A.ap={}))[_i.center=1]="center",_i[_i.left=2]="left",_i[_i.right=3]="right",_i[_i.top=4]="top",_i[_i.bottom=5]="bottom",_i[_i["top-left"]=6]="top-left",_i[_i["top-right"]=7]="top-right",_i[_i["bottom-left"]=8]="bottom-left",_i[_i["bottom-right"]=9]="bottom-right";const Yn=7,Pc=Number.POSITIVE_INFINITY;function pu(i,e){return e[1]!==Pc?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-Yn;break;case"bottom-right":case"bottom-left":case"bottom":d=-l+Yn}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,e[0],e[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-Yn;break;case"bottom-right":case"bottom-left":u=-d+Yn;break;case"bottom":u=-a+Yn;break;case"top":u=a-Yn}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,e[0])}function fu(i,e,r){var a;const l=i.layout,u=(a=l.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(u){const f=u.values,g=[];for(let x=0;xk*ei);b.startsWith("top")?w[1]-=Yn:b.startsWith("bottom")&&(w[1]+=Yn),g[x+1]=w}return new rr(g)}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(e,{},r)*ei,Pc]:l.get("text-offset").evaluate(e,{},r).map(x=>x*ei);const g=[];for(const x of d)g.push(x,pu(x,f));return new rr(g)}return null}function Dc(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 yp(i,e,r,a,l,u,d,f,g,x,b){let w=u.textMaxSize.evaluate(e,{});w===void 0&&(w=d);const k=i.layers[0].layout,C=k.get("icon-offset").evaluate(e,{},b),M=_u(r.horizontal),B=d/24,U=i.tilePixelRatio*B,q=i.tilePixelRatio*w/24,te=i.tilePixelRatio*f,Z=i.tilePixelRatio*k.get("symbol-spacing"),Y=k.get("text-padding")*i.tilePixelRatio,ue=function(xe,Ve,Re,tt=1){const yt=xe.get("icon-padding").evaluate(Ve,{},Re),St=yt&&yt.values;return[St[0]*tt,St[1]*tt,St[2]*tt,St[3]*tt]}(k,e,b,i.tilePixelRatio),fe=k.get("text-max-angle")/180*Math.PI,Ee=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point",Le=k.get("icon-rotation-alignment")==="map"&&k.get("symbol-placement")!=="point",Ce=k.get("symbol-placement"),Ae=Z/2,we=k.get("icon-text-fit");let De;a&&we!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(De=Vh(a,r.vertical,we,k.get("icon-text-fit-padding"),C,B)),M&&(a=Vh(a,M,we,k.get("icon-text-fit-padding"),C,B)));const Ie=(xe,Ve)=>{Ve.x<0||Ve.x>=Bt||Ve.y<0||Ve.y>=Bt||function(Re,tt,yt,St,ti,or,Oi,Wt,pi,gi,Vi,Ui,ii,ri,Si,Ni,Ii,Ji,Qi,ni,rt,ki,yi,ai,Dr){const Or=Re.addToLineVertexArray(tt,yt);let Vr,Tn,Lr,xr,er=0,Sn=0,Ao=0,vu=0,Nc=-1,jc=-1;const In={};let bu=Dt("");if(Re.allowVerticalPlacement&&St.vertical){const Ai=Wt.layout.get("text-rotate").evaluate(rt,{},ai)+90;Lr=new Ll(pi,tt,gi,Vi,Ui,St.vertical,ii,ri,Si,Ai),Oi&&(xr=new Ll(pi,tt,gi,Vi,Ui,Oi,Ii,Ji,Si,Ai))}if(ti){const Ai=Wt.layout.get("icon-rotate").evaluate(rt,{}),vr=Wt.layout.get("icon-text-fit")!=="none",Sa=uu(ti,Ai,yi,vr),Nr=Oi?uu(Oi,Ai,yi,vr):void 0;Tn=new Ll(pi,tt,gi,Vi,Ui,ti,Ii,Ji,!1,Ai),er=4*Sa.length;const Ia=Re.iconSizeData;let an=null;Ia.kind==="source"?(an=[nn*Wt.layout.get("icon-size").evaluate(rt,{})],an[0]>Wn&&si(`${Re.layerIds[0]}: Value for "icon-size" is >= ${To}. Reduce your "icon-size".`)):Ia.kind==="composite"&&(an=[nn*ki.compositeIconSizes[0].evaluate(rt,{},ai),nn*ki.compositeIconSizes[1].evaluate(rt,{},ai)],(an[0]>Wn||an[1]>Wn)&&si(`${Re.layerIds[0]}: Value for "icon-size" is >= ${To}. Reduce your "icon-size".`)),Re.addSymbols(Re.icon,Sa,an,ni,Qi,rt,A.ah.none,tt,Or.lineStartIndex,Or.lineLength,-1,ai),Nc=Re.icon.placedSymbolArray.length-1,Nr&&(Sn=4*Nr.length,Re.addSymbols(Re.icon,Nr,an,ni,Qi,rt,A.ah.vertical,tt,Or.lineStartIndex,Or.lineLength,-1,ai),jc=Re.icon.placedSymbolArray.length-1)}const wu=Object.keys(St.horizontal);for(const Ai of wu){const vr=St.horizontal[Ai];if(!Vr){bu=Dt(vr.text);const Nr=Wt.layout.get("text-rotate").evaluate(rt,{},ai);Vr=new Ll(pi,tt,gi,Vi,Ui,vr,ii,ri,Si,Nr)}const Sa=vr.positionedLines.length===1;if(Ao+=mu(Re,tt,vr,or,Wt,Si,rt,Ni,Or,St.vertical?A.ah.horizontal:A.ah.horizontalOnly,Sa?wu:[Ai],In,Nc,ki,ai),Sa)break}St.vertical&&(vu+=mu(Re,tt,St.vertical,or,Wt,Si,rt,Ni,Or,A.ah.vertical,["vertical"],In,jc,ki,ai));const bp=Vr?Vr.boxStartIndex:Re.collisionBoxArray.length,wp=Vr?Vr.boxEndIndex:Re.collisionBoxArray.length,Tp=Lr?Lr.boxStartIndex:Re.collisionBoxArray.length,Sp=Lr?Lr.boxEndIndex:Re.collisionBoxArray.length,Ip=Tn?Tn.boxStartIndex:Re.collisionBoxArray.length,kp=Tn?Tn.boxEndIndex:Re.collisionBoxArray.length,Ap=xr?xr.boxStartIndex:Re.collisionBoxArray.length,zp=xr?xr.boxEndIndex:Re.collisionBoxArray.length;let Ur=-1;const Bl=(Ai,vr)=>Ai&&Ai.circleDiameter?Math.max(Ai.circleDiameter,vr):vr;Ur=Bl(Vr,Ur),Ur=Bl(Lr,Ur),Ur=Bl(Tn,Ur),Ur=Bl(xr,Ur);const Tu=Ur>-1?1:0;Tu&&(Ur*=Dr/ei),Re.glyphOffsetArray.length>=bs.MAX_GLYPHS&&si("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),rt.sortKey!==void 0&&Re.addToSortKeyRanges(Re.symbolInstances.length,rt.sortKey);const Cp=fu(Wt,rt,ai),[Ep,Mp]=function(Ai,vr){const Sa=Ai.length,Nr=vr==null?void 0:vr.values;if((Nr==null?void 0:Nr.length)>0)for(let Ia=0;Ia=0?In.right:-1,In.center>=0?In.center:-1,In.left>=0?In.left:-1,In.vertical||-1,Nc,jc,bu,bp,wp,Tp,Sp,Ip,kp,Ap,zp,gi,Ao,vu,er,Sn,Tu,0,ii,Ur,Ep,Mp)}(i,Ve,xe,r,a,l,De,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,U,[Y,Y,Y,Y],Ee,g,te,ue,Le,C,e,u,x,b,d)};if(Ce==="line")for(const xe of au(e.geometry,0,0,Bt,Bt)){const Ve=pp(xe,Z,fe,r.vertical||M,a,24,q,i.overscaling,Bt);for(const Re of Ve)M&&xp(i,M.text,Ae,Re)||Ie(xe,Re)}else if(Ce==="line-center"){for(const xe of e.geometry)if(xe.length>1){const Ve=dp(xe,fe,r.vertical||M,a,24,q);Ve&&Ie(xe,Ve)}}else if(e.type==="Polygon")for(const xe of uc(e.geometry,0)){const Ve=_p(xe,16);Ie(xe[0],new Kn(Ve.x,Ve.y,0))}else if(e.type==="LineString")for(const xe of e.geometry)Ie(xe,new Kn(xe[0].x,xe[0].y,0));else if(e.type==="Point")for(const xe of e.geometry)for(const Ve of xe)Ie([Ve],new Kn(Ve.x,Ve.y,0))}function mu(i,e,r,a,l,u,d,f,g,x,b,w,k,C,M){const B=function(te,Z,Y,ue,fe,Ee,Le,Ce){const Ae=ue.layout.get("text-rotate").evaluate(Ee,{})*Math.PI/180,we=[];for(const De of Z.positionedLines)for(const Ie of De.positionedGlyphs){if(!Ie.rect)continue;const xe=Ie.rect||{};let Ve=Ph+1,Re=!0,tt=1,yt=0;const St=(fe||Ce)&&Ie.vertical,ti=Ie.metrics.advance*Ie.scale/2;if(Ce&&Z.verticalizable&&(yt=De.lineOffset/2-(Ie.imageName?-(ei-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*ei)),Ie.imageName){const ni=Le[Ie.imageName];Re=ni.sdf,tt=ni.pixelRatio,Ve=Yi/tt}const or=fe?[Ie.x+ti,Ie.y]:[0,0];let Oi=fe?[0,0]:[Ie.x+ti+Y[0],Ie.y+Y[1]-yt],Wt=[0,0];St&&(Wt=Oi,Oi=[0,0]);const pi=Ie.metrics.isDoubleResolution?2:1,gi=(Ie.metrics.left-Ve)*Ie.scale-ti+Oi[0],Vi=(-Ie.metrics.top-Ve)*Ie.scale+Oi[1],Ui=gi+xe.w/pi*Ie.scale/tt,ii=Vi+xe.h/pi*Ie.scale/tt,ri=new ce(gi,Vi),Si=new ce(Ui,Vi),Ni=new ce(gi,ii),Ii=new ce(Ui,ii);if(St){const ni=new ce(-ti,ti-bo),rt=-Math.PI/2,ki=ei/2-ti,yi=new ce(5-bo-ki,-(Ie.imageName?ki:0)),ai=new ce(...Wt);ri._rotateAround(rt,ni)._add(yi)._add(ai),Si._rotateAround(rt,ni)._add(yi)._add(ai),Ni._rotateAround(rt,ni)._add(yi)._add(ai),Ii._rotateAround(rt,ni)._add(yi)._add(ai)}if(Ae){const ni=Math.sin(Ae),rt=Math.cos(Ae),ki=[rt,-ni,ni,rt];ri._matMult(ki),Si._matMult(ki),Ni._matMult(ki),Ii._matMult(ki)}const Ji=new ce(0,0),Qi=new ce(0,0);we.push({tl:ri,tr:Si,bl:Ni,br:Ii,tex:xe,writingMode:Z.writingMode,glyphOffset:or,sectionIndex:Ie.sectionIndex,isSDF:Re,pixelOffsetTL:Ji,pixelOffsetBR:Qi,minFontScaleX:0,minFontScaleY:0})}return we}(0,r,f,l,u,d,a,i.allowVerticalPlacement),U=i.textSizeData;let q=null;U.kind==="source"?(q=[nn*l.layout.get("text-size").evaluate(d,{})],q[0]>Wn&&si(`${i.layerIds[0]}: Value for "text-size" is >= ${To}. Reduce your "text-size".`)):U.kind==="composite"&&(q=[nn*C.compositeTextSizes[0].evaluate(d,{},M),nn*C.compositeTextSizes[1].evaluate(d,{},M)],(q[0]>Wn||q[1]>Wn)&&si(`${i.layerIds[0]}: Value for "text-size" is >= ${To}. Reduce your "text-size".`)),i.addSymbols(i.text,B,q,f,u,d,x,e,g.lineStartIndex,g.lineLength,k,M);for(const te of b)w[te]=i.text.placedSymbolArray.length-1;return 4*B.length}function _u(i){for(const e in i)return i[e];return null}function xp(i,e,r,a){const l=i.compareText;if(e in l){const u=l[e];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=gu[15&a];if(!u)throw new Error("Unrecognized array type.");const[d]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new Lc(f,d,u,e)}constructor(e,r=64,a=Float64Array,l){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const u=gu.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(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,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+f+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),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]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Rc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:d,nodeSize:f}=this,g=[0,u.length-1,0],x=[];for(;g.length;){const b=g.pop()||0,w=g.pop()||0,k=g.pop()||0;if(w-k<=f){for(let U=k;U<=w;U++){const q=d[2*U],te=d[2*U+1];q>=e&&q<=a&&te>=r&&te<=l&&x.push(u[U])}continue}const C=k+w>>1,M=d[2*C],B=d[2*C+1];M>=e&&M<=a&&B>=r&&B<=l&&x.push(u[C]),(b===0?e<=M:r<=B)&&(g.push(k),g.push(C-1),g.push(1-b)),(b===0?a>=M:l>=B)&&(g.push(C+1),g.push(w),g.push(1-b))}return x}within(e,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],g=[],x=a*a;for(;f.length;){const b=f.pop()||0,w=f.pop()||0,k=f.pop()||0;if(w-k<=d){for(let U=k;U<=w;U++)xu(u[2*U],u[2*U+1],e,r)<=x&&g.push(l[U]);continue}const C=k+w>>1,M=u[2*C],B=u[2*C+1];xu(M,B,e,r)<=x&&g.push(l[C]),(b===0?e-a<=M:r-a<=B)&&(f.push(k),f.push(C-1),f.push(1-b)),(b===0?e+a>=M:r+a>=B)&&(f.push(C+1),f.push(w),f.push(1-b))}return g}}function Rc(i,e,r,a,l,u){if(l-a<=r)return;const d=a+l>>1;yu(i,e,d,a,l,u),Rc(i,e,r,a,d-1,1-u),Rc(i,e,r,d+1,l,1-u)}function yu(i,e,r,a,l,u){for(;l>a;){if(l-a>600){const x=l-a+1,b=r-a+1,w=Math.log(x),k=.5*Math.exp(2*w/3),C=.5*Math.sqrt(w*k*(x-k)/x)*(b-x/2<0?-1:1);yu(i,e,r,Math.max(a,Math.floor(r-b*k/x+C)),Math.min(l,Math.floor(r+(x-b)*k/x+C)),u)}const d=e[2*r+u];let f=a,g=l;for(Io(i,e,a,r),e[2*l+u]>d&&Io(i,e,a,l);fd;)g--}e[2*a+u]===d?Io(i,e,a,g):(g++,Io(i,e,g,l)),g<=r&&(a=g+1),r<=g&&(l=g-1)}}function Io(i,e,r,a){Bc(i,r,a),Bc(e,2*r,2*a),Bc(e,2*r+1,2*a+1)}function Bc(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function xu(i,e,r,a){const l=i-r,u=e-a;return l*l+u*u}var Fc;A.bd=void 0,(Fc=A.bd||(A.bd={})).create="create",Fc.load="load",Fc.fullLoad="fullLoad";let Rl=null,ko=[];const Oc=1e3/60,Vc="loadTime",Uc="fullLoadTime",vp={mark(i){performance.mark(i)},frame(i){const e=i;Rl!=null&&ko.push(e-Rl),Rl=e},clearMetrics(){Rl=null,ko=[],performance.clearMeasures(Vc),performance.clearMeasures(Uc);for(const i in A.bd)performance.clearMarks(A.bd[i])},getPerformanceMetrics(){performance.measure(Vc,A.bd.create,A.bd.load),performance.measure(Uc,A.bd.create,A.bd.fullLoad);const i=performance.getEntriesByName(Vc)[0].duration,e=performance.getEntriesByName(Uc)[0].duration,r=ko.length,a=1/(ko.reduce((u,d)=>u+d,0)/r/1e3),l=ko.filter(u=>u>Oc).reduce((u,d)=>u+(d-Oc)/Oc,0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:l/(r+l)*100,totalFrames:r}}};A.$=Te,A.A=ms,A.B=function(i){if(ji==null){const e=i.navigator?i.navigator.userAgent:null;ji=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return ji},A.C=class{constructor(i,e){this.target=i,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new hp(()=>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=Mi(self)?i:window}registerMessageHandler(i,e){this.messageHandlers[i]=e}sendAsync(i,e){return new Promise((r,a)=>{const l=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[l]={resolve:r,reject:a},e&&e.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:jn(i.data,u)});this.target.postMessage(d,{transfer:u})})}receive(i){const e=i.data,r=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];const a=this.abortControllers[r];return delete this.abortControllers[r],void(a&&a.abort())}if(Mi(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){return p(this,void 0,void 0,function*(){if(e.type===""){const l=this.resolveRejects[i];return delete this.resolveRejects[i],l?void(e.error?l.reject($n(e.error)):l.resolve($n(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=$n(e.data),a=new AbortController;this.abortControllers[i]=a;try{const l=yield this.messageHandlers[e.type](e.sourceMapId,r,a);this.completeTask(i,null,l)}catch(l){this.completeTask(i,l)}})}completeTask(i,e,r){const a=[];delete this.abortControllers[i];const l={id:i,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?jn(e):null,data:jn(r,a)};this.target.postMessage(l,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},A.D=Be,A.E=cn,A.F=function(){var i=new ms(16);return ms!=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},A.G=Pi,A.H=function(i,e,r){var a,l,u,d,f,g,x,b,w,k,C,M,B=r[0],U=r[1],q=r[2];return e===i?(i[12]=e[0]*B+e[4]*U+e[8]*q+e[12],i[13]=e[1]*B+e[5]*U+e[9]*q+e[13],i[14]=e[2]*B+e[6]*U+e[10]*q+e[14],i[15]=e[3]*B+e[7]*U+e[11]*q+e[15]):(l=e[1],u=e[2],d=e[3],f=e[4],g=e[5],x=e[6],b=e[7],w=e[8],k=e[9],C=e[10],M=e[11],i[0]=a=e[0],i[1]=l,i[2]=u,i[3]=d,i[4]=f,i[5]=g,i[6]=x,i[7]=b,i[8]=w,i[9]=k,i[10]=C,i[11]=M,i[12]=a*B+f*U+w*q+e[12],i[13]=l*B+g*U+k*q+e[13],i[14]=u*B+x*U+C*q+e[14],i[15]=d*B+b*U+M*q+e[15]),i},A.I=bc,A.J=function(i,e,r){var a=r[0],l=r[1],u=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*l,i[5]=e[5]*l,i[6]=e[6]*l,i[7]=e[7]*l,i[8]=e[8]*u,i[9]=e[9]*u,i[10]=e[10]*u,i[11]=e[11]*u,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},A.K=Qc,A.L=function(i,e){const r={};for(let a=0;a{const e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(const a of i){const l=window.document.createElement("source");on(a)||(e.crossOrigin="Anonymous"),l.src=a,e.appendChild(l)}})},A.a3=function(){return cr++},A.a4=c,A.a5=bs,A.a6=Wa,A.a7=bn,A.a8=wt,A.a9=tu,A.aA=ct,A.aB=function(i,e){if(!i)return[{command:"setStyle",args:[e]}];let r=[];try{if(!it(i.version,e.version))return[{command:"setStyle",args:[e]}];it(i.center,e.center)||r.push({command:"setCenter",args:[e.center]}),it(i.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),it(i.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),it(i.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),it(i.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),it(i.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),it(i.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),it(i.light,e.light)||r.push({command:"setLight",args:[e.light]}),it(i.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),it(i.sky,e.sky)||r.push({command:"setSky",args:[e.sky]});const a={},l=[];(function(d,f,g,x){let b;for(b in f=f||{},d=d||{})Object.prototype.hasOwnProperty.call(d,b)&&(Object.prototype.hasOwnProperty.call(f,b)||En(b,g,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(d,b)?it(d[b],f[b])||(d[b].type==="geojson"&&f[b].type==="geojson"&&Pn(d,f,b)?Xt(g,{command:"setGeoJSONSourceData",args:[b,f[b].data]}):Mn(b,f,g,x)):Cn(b,f,g))})(i.sources,e.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,g){f=f||[];const x=(d=d||[]).map(ka),b=f.map(ka),w=d.reduce(hn,{}),k=f.reduce(hn,{}),C=x.slice(),M=Object.create(null);let B,U,q,te,Z;for(let Y=0,ue=0;Y@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,l,u)=>{const d=l||u;return e[a]=!d||d.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},A.ab=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},A.ac=Ei,A.ad=function(i,e,r){var a=Math.sin(r),l=Math.cos(r),u=e[0],d=e[1],f=e[2],g=e[3],x=e[4],b=e[5],w=e[6],k=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=u*l+x*a,i[1]=d*l+b*a,i[2]=f*l+w*a,i[3]=g*l+k*a,i[4]=x*l-u*a,i[5]=b*l-d*a,i[6]=w*l-f*a,i[7]=k*l-g*a,i},A.ae=function(i){var e=new ms(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},A.af=xl,A.ag=function(i,e){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?Ei(mi.interpolationFactor(l,e,u,d),0,1):0;i.kind==="camera"?a=wi.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:a}},A.ai=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:l}){return i.kind==="source"?a/nn:i.kind==="composite"?wi.number(a/nn,l/nn,r):e},A.aj=Ic,A.ak=function(i,e,r,a){const l=e.y-i.y,u=e.x-i.x,d=a.y-r.y,f=a.x-r.x,g=d*u-f*l;if(g===0)return null;const x=(f*(i.y-r.y)-d*(i.x-r.x))/g;return new ce(i.x+x*u,i.y+x*l)},A.al=au,A.am=so,A.an=nc,A.ao=ei,A.aq=Sc,A.ar=function(i,e){var r=e[0],a=e[1],l=e[2],u=e[3],d=e[4],f=e[5],g=e[6],x=e[7],b=e[8],w=e[9],k=e[10],C=e[11],M=e[12],B=e[13],U=e[14],q=e[15],te=r*f-a*d,Z=r*g-l*d,Y=r*x-u*d,ue=a*g-l*f,fe=a*x-u*f,Ee=l*x-u*g,Le=b*B-w*M,Ce=b*U-k*M,Ae=b*q-C*M,we=w*U-k*B,De=w*q-C*B,Ie=k*q-C*U,xe=te*Ie-Z*De+Y*we+ue*Ae-fe*Ce+Ee*Le;return xe?(i[0]=(f*Ie-g*De+x*we)*(xe=1/xe),i[1]=(l*De-a*Ie-u*we)*xe,i[2]=(B*Ee-U*fe+q*ue)*xe,i[3]=(k*fe-w*Ee-C*ue)*xe,i[4]=(g*Ae-d*Ie-x*Ce)*xe,i[5]=(r*Ie-l*Ae+u*Ce)*xe,i[6]=(U*Y-M*Ee-q*Z)*xe,i[7]=(b*Ee-k*Y+C*Z)*xe,i[8]=(d*De-f*Ae+x*Le)*xe,i[9]=(a*Ae-r*De-u*Le)*xe,i[10]=(M*fe-B*Y+q*te)*xe,i[11]=(w*Y-b*fe-C*te)*xe,i[12]=(f*Ce-d*we-g*Le)*xe,i[13]=(r*we-a*Ce+l*Le)*xe,i[14]=(B*Z-M*ue-U*te)*xe,i[15]=(b*ue-w*Z+k*te)*xe,i):null},A.as=Dc,A.at=Tc,A.au=Lc,A.av=function(){const i={},e=he.$version;for(const r in he.$root){const a=he.$root[r];if(a.required){let l=null;l=r==="version"?e:a.type==="array"?[]:{},l!=null&&(i[r]=l)}}return i},A.aw=al,A.ax=Zr,A.ay=function(i){i=i.slice();const e=Object.create(null);for(let r=0;rxe*ei)}let Ce=d?"center":r.get("text-justify").evaluate(x,{},i.canonical);const Ae=r.get("symbol-placement"),we=Ae==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*ei:0,De=()=>{i.bucket.allowVerticalPlacement&&qn(Y)&&(M.vertical=kl(B,i.glyphMap,i.glyphPositions,i.imagePositions,b,we,u,Ee,"left",fe,q,A.ah.vertical,!0,Ae,k,w))};if(!d&&Le){const Ie=new Set;if(Ce==="auto")for(let Ve=0;Vep(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),A.e=ui,A.f=i=>new Promise((e,r)=>{const a=new Image;a.onload=()=>{e(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame(()=>{a.src=Rr})},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):Rr}),A.g=tr,A.h=(i,e)=>Tr(ui(i,{type:"json"}),e),A.i=Mi,A.j=ln,A.k=Nt,A.l=(i,e)=>Tr(ui(i,{type:"arrayBuffer"}),e),A.m=Tr,A.n=function(i){return new xc(i).readFields(Xd,[])},A.o=po,A.p=Dh,A.q=Bi,A.r=ec,A.s=on,A.t=Nn,A.u=ze,A.v=he,A.w=si,A.x=gn,A.y=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}},A.z=wi}),oe("worker",["./shared"],function(A){class p{constructor(I){this.keyCache={},I&&this.replace(I)}replace(I){this._layerConfigs={},this._layers={},this.update(I,[])}update(I,z){for(const F of I){this._layerConfigs[F.id]=F;const X=this._layers[F.id]=A.az(F);X._featureFilter=A.a6(X.filter),this.keyCache[F.id]&&delete this.keyCache[F.id]}for(const F of z)delete this.keyCache[F],delete this._layerConfigs[F],delete this._layers[F];this.familiesBySource={};const P=A.bh(Object.values(this._layerConfigs),this.keyCache);for(const F of P){const X=F.map(de=>this._layers[de.id]),K=X[0];if(K.visibility==="none")continue;const ee=K.source||"";let G=this.familiesBySource[ee];G||(G=this.familiesBySource[ee]={});const ie=K.sourceLayer||"_geojsonTileLayer";let me=G[ie];me||(me=G[ie]=[]),me.push(X)}}}class Oe{constructor(I){const z={},P=[];for(const ee in I){const G=I[ee],ie=z[ee]={};for(const me in G){const de=G[+me];if(!de||de.bitmap.width===0||de.bitmap.height===0)continue;const pe={x:0,y:0,w:de.bitmap.width+2,h:de.bitmap.height+2};P.push(pe),ie[me]={rect:pe,metrics:de.metrics}}}const{w:F,h:X}=A.p(P),K=new A.o({width:F||1,height:X||1});for(const ee in I){const G=I[ee];for(const ie in G){const me=G[+ie];if(!me||me.bitmap.width===0||me.bitmap.height===0)continue;const de=z[ee][ie].rect;A.o.copy(me.bitmap,K,{x:0,y:0},{x:de.x+1,y:de.y+1},me.bitmap)}}this.image=K,this.positions=z}}A.bi("GlyphAtlas",Oe);class je{constructor(I){this.tileID=new A.Q(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId,this.inFlightDependencies=[]}parse(I,z,P,F){return A._(this,void 0,void 0,function*(){this.status="parsing",this.data=I,this.collisionBoxArray=new A.a4;const X=new A.bj(Object.keys(I.layers).sort()),K=new A.bk(this.tileID,this.promoteId);K.bucketLayerIDs=[];const ee={},G={featureIndex:K,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:P},ie=z.familiesBySource[this.source];for(const Ye in ie){const Et=I.layers[Ye];if(!Et)continue;Et.version===1&&A.w(`Vector tile source "${this.source}" layer "${Ye}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Yt=X.encode(Ye),bi=[];for(let Di=0;Di=ci.maxzoom||ci.visibility!=="none"&&(Pe(Di,this.zoom,P),(ee[ci.id]=ci.createBucket({index:K.bucketLayerIDs.length,layers:Di,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Yt,sourceID:this.source})).populate(bi,G,this.tileID.canonical),K.bucketLayerIDs.push(Di.map(kr=>kr.id)))}}const me=A.aE(G.glyphDependencies,Ye=>Object.keys(Ye).map(Number));this.inFlightDependencies.forEach(Ye=>Ye==null?void 0:Ye.abort()),this.inFlightDependencies=[];let de=Promise.resolve({});if(Object.keys(me).length){const Ye=new AbortController;this.inFlightDependencies.push(Ye),de=F.sendAsync({type:"GG",data:{stacks:me,source:this.source,tileID:this.tileID,type:"glyphs"}},Ye)}const pe=Object.keys(G.iconDependencies);let Fe=Promise.resolve({});if(pe.length){const Ye=new AbortController;this.inFlightDependencies.push(Ye),Fe=F.sendAsync({type:"GI",data:{icons:pe,source:this.source,tileID:this.tileID,type:"icons"}},Ye)}const Ue=Object.keys(G.patternDependencies);let He=Promise.resolve({});if(Ue.length){const Ye=new AbortController;this.inFlightDependencies.push(Ye),He=F.sendAsync({type:"GI",data:{icons:Ue,source:this.source,tileID:this.tileID,type:"patterns"}},Ye)}const[Ze,nt,pt]=yield Promise.all([de,Fe,He]),bt=new Oe(Ze),$t=new A.bl(nt,pt);for(const Ye in ee){const Et=ee[Ye];Et instanceof A.a5?(Pe(Et.layers,this.zoom,P),A.bm({bucket:Et,glyphMap:Ze,glyphPositions:bt.positions,imageMap:nt,imagePositions:$t.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Et.hasPattern&&(Et instanceof A.bn||Et instanceof A.bo||Et instanceof A.bp)&&(Pe(Et.layers,this.zoom,P),Et.addFeatures(G,this.tileID.canonical,$t.patternPositions))}return this.status="done",{buckets:Object.values(ee).filter(Ye=>!Ye.isEmpty()),featureIndex:K,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bt.image,imageAtlas:$t,glyphMap:this.returnDependencies?Ze:null,iconMap:this.returnDependencies?nt:null,glyphPositions:this.returnDependencies?bt.positions:null}})}}function Pe(N,I,z){const P=new A.a8(I);for(const F of N)F.recalculate(P,z)}class ce{constructor(I,z,P){this.actor=I,this.layerIndex=z,this.availableImages=P,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(I,z){return A._(this,void 0,void 0,function*(){const P=yield A.l(I.request,z);try{return{vectorTile:new A.bq.VectorTile(new A.br(P.data)),rawData:P.data,cacheControl:P.cacheControl,expires:P.expires}}catch(F){const X=new Uint8Array(P.data);let K=`Unable to parse the tile at ${I.request.url}, `;throw K+=X[0]===31&&X[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${F.messge}`,new Error(K)}})}loadTile(I){return A._(this,void 0,void 0,function*(){const z=I.uid,P=!!(I&&I.request&&I.request.collectResourceTiming)&&new A.bs(I.request),F=new je(I);this.loading[z]=F;const X=new AbortController;F.abort=X;try{const K=yield this.loadVectorTile(I,X);if(delete this.loading[z],!K)return null;const ee=K.rawData,G={};K.expires&&(G.expires=K.expires),K.cacheControl&&(G.cacheControl=K.cacheControl);const ie={};if(P){const de=P.finish();de&&(ie.resourceTiming=JSON.parse(JSON.stringify(de)))}F.vectorTile=K.vectorTile;const me=F.parse(K.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[z]=F,this.fetching[z]={rawTileData:ee,cacheControl:G,resourceTiming:ie};try{const de=yield me;return A.e({rawTileData:ee.slice(0)},de,G,ie)}finally{delete this.fetching[z]}}catch(K){throw delete this.loading[z],F.status="done",this.loaded[z]=F,K}})}reloadTile(I){return A._(this,void 0,void 0,function*(){const z=I.uid;if(!this.loaded||!this.loaded[z])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const P=this.loaded[z];if(P.showCollisionBoxes=I.showCollisionBoxes,P.status==="parsing"){const F=yield P.parse(P.vectorTile,this.layerIndex,this.availableImages,this.actor);let X;if(this.fetching[z]){const{rawTileData:K,cacheControl:ee,resourceTiming:G}=this.fetching[z];delete this.fetching[z],X=A.e({rawTileData:K.slice(0)},F,ee,G)}else X=F;return X}if(P.status==="done"&&P.vectorTile)return P.parse(P.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(I){return A._(this,void 0,void 0,function*(){const z=this.loading,P=I.uid;z&&z[P]&&z[P].abort&&(z[P].abort.abort(),delete z[P])})}removeTile(I){return A._(this,void 0,void 0,function*(){this.loaded&&this.loaded[I.uid]&&delete this.loaded[I.uid]})}}class re{constructor(){this.loaded={}}loadTile(I){return A._(this,void 0,void 0,function*(){const{uid:z,encoding:P,rawImageData:F,redFactor:X,greenFactor:K,blueFactor:ee,baseShift:G}=I,ie=F.width+2,me=F.height+2,de=A.b(F)?new A.R({width:ie,height:me},yield A.bt(F,-1,-1,ie,me)):F,pe=new A.bu(z,de,P,X,K,ee,G);return this.loaded=this.loaded||{},this.loaded[z]=pe,pe})}removeTile(I){const z=this.loaded,P=I.uid;z&&z[P]&&delete z[P]}}function xt(N,I){if(N.length!==0){Lt(N[0],I);for(var z=1;z=Math.abs(ee)?z-G+ee:ee-G+z,z=G}z+P>=0!=!!I&&N.reverse()}var Rt=A.bv(function N(I,z){var P,F=I&&I.type;if(F==="FeatureCollection")for(P=0;P>31}function ur(N,I){for(var z=N.loadGeometry(),P=N.type,F=0,X=0,K=z.length,ee=0;eeN},Rr=Math.fround||(qr=new Float32Array(1),N=>(qr[0]=+N,qr[0]));var qr;const li=3,Ct=5,$i=6;class dr{constructor(I){this.options=Object.assign(Object.create(di),I),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(I){const{log:z,minZoom:P,maxZoom:F}=this.options;z&&console.time("total time");const X=`prepare ${I.length} points`;z&&console.time(X),this.points=I;const K=[];for(let G=0;G=P;G--){const ie=+Date.now();ee=this.trees[G]=this._createTree(this._cluster(ee,G)),z&&console.log("z%d: %d clusters in %dms",G,ee.numItems,+Date.now()-ie)}return z&&console.timeEnd("total time"),this}getClusters(I,z){let P=((I[0]+180)%360+360)%360-180;const F=Math.max(-90,Math.min(90,I[1]));let X=I[2]===180?180:((I[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)P=-180,X=180;else if(P>X){const de=this.getClusters([P,F,180,K],z),pe=this.getClusters([-180,F,X,K],z);return de.concat(pe)}const ee=this.trees[this._limitZoom(z)],G=ee.range(Pi(P),qi(K),Pi(X),qi(F)),ie=ee.data,me=[];for(const de of G){const pe=this.stride*de;me.push(ie[pe+Ct]>1?vi(ie,pe,this.clusterProps):this.points[ie[pe+li]])}return me}getChildren(I){const z=this._getOriginId(I),P=this._getOriginZoom(I),F="No cluster with the specified id.",X=this.trees[P];if(!X)throw new Error(F);const K=X.data;if(z*this.stride>=K.length)throw new Error(F);const ee=this.options.radius/(this.options.extent*Math.pow(2,P-1)),G=X.within(K[z*this.stride],K[z*this.stride+1],ee),ie=[];for(const me of G){const de=me*this.stride;K[de+4]===I&&ie.push(K[de+Ct]>1?vi(K,de,this.clusterProps):this.points[K[de+li]])}if(ie.length===0)throw new Error(F);return ie}getLeaves(I,z,P){const F=[];return this._appendLeaves(F,I,z=z||10,P=P||0,0),F}getTile(I,z,P){const F=this.trees[this._limitZoom(I)],X=Math.pow(2,I),{extent:K,radius:ee}=this.options,G=ee/K,ie=(P-G)/X,me=(P+1+G)/X,de={features:[]};return this._addTileFeatures(F.range((z-G)/X,ie,(z+1+G)/X,me),F.data,z,P,X,de),z===0&&this._addTileFeatures(F.range(1-G/X,ie,1,me),F.data,X,P,X,de),z===X-1&&this._addTileFeatures(F.range(0,ie,G/X,me),F.data,-1,P,X,de),de.features.length?de:null}getClusterExpansionZoom(I){let z=this._getOriginZoom(I)-1;for(;z<=this.options.maxZoom;){const P=this.getChildren(I);if(z++,P.length!==1)break;I=P[0].properties.cluster_id}return z}_appendLeaves(I,z,P,F,X){const K=this.getChildren(z);for(const ee of K){const G=ee.properties;if(G&&G.cluster?X+G.point_count<=F?X+=G.point_count:X=this._appendLeaves(I,G.cluster_id,P,F,X):X1;let me,de,pe;if(ie)me=tr(z,G,this.clusterProps),de=z[G],pe=z[G+1];else{const He=this.points[z[G+li]];me=He.properties;const[Ze,nt]=He.geometry.coordinates;de=Pi(Ze),pe=qi(nt)}const Fe={type:1,geometry:[[Math.round(this.options.extent*(de*X-P)),Math.round(this.options.extent*(pe*X-F))]],tags:me};let Ue;Ue=ie||this.options.generateId?z[G+li]:this.points[z[G+li]].id,Ue!==void 0&&(Fe.id=Ue),K.features.push(Fe)}}_limitZoom(I){return Math.max(this.options.minZoom,Math.min(Math.floor(+I),this.options.maxZoom+1))}_cluster(I,z){const{radius:P,extent:F,reduce:X,minPoints:K}=this.options,ee=P/(F*Math.pow(2,z)),G=I.data,ie=[],me=this.stride;for(let de=0;dez&&(Ze+=G[pt+Ct])}if(Ze>He&&Ze>=K){let nt,pt=pe*He,bt=Fe*He,$t=-1;const Ye=((de/me|0)<<5)+(z+1)+this.points.length;for(const Et of Ue){const Yt=Et*me;if(G[Yt+2]<=z)continue;G[Yt+2]=z;const bi=G[Yt+Ct];pt+=G[Yt]*bi,bt+=G[Yt+1]*bi,G[Yt+4]=Ye,X&&(nt||(nt=this._map(G,de,!0),$t=this.clusterProps.length,this.clusterProps.push(nt)),X(nt,this._map(G,Yt)))}G[de+4]=Ye,ie.push(pt/Ze,bt/Ze,1/0,Ye,-1,Ze),X&&ie.push($t)}else{for(let nt=0;nt1)for(const nt of Ue){const pt=nt*me;if(!(G[pt+2]<=z)){G[pt+2]=z;for(let bt=0;bt>5}_getOriginZoom(I){return(I-this.points.length)%32}_map(I,z,P){if(I[z+Ct]>1){const K=this.clusterProps[I[z+$i]];return P?Object.assign({},K):K}const F=this.points[I[z+li]].properties,X=this.options.map(F);return P&&X===F?Object.assign({},X):X}}function vi(N,I,z){return{type:"Feature",id:N[I+li],properties:tr(N,I,z),geometry:{type:"Point",coordinates:[(P=N[I],360*(P-.5)),Zr(N[I+1])]}};var P}function tr(N,I,z){const P=N[I+Ct],F=P>=1e4?`${Math.round(P/1e3)}k`:P>=1e3?Math.round(P/100)/10+"k":P,X=N[I+$i],K=X===-1?{}:Object.assign({},z[X]);return Object.assign(K,{cluster:!0,cluster_id:N[I+li],point_count:P,point_count_abbreviated:F})}function Pi(N){return N/360+.5}function qi(N){const I=Math.sin(N*Math.PI/180),z=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return z<0?0:z>1?1:z}function Zr(N){const I=(180-360*N)*Math.PI/180;return 360*Math.atan(Math.exp(I))/Math.PI-90}function Tr(N,I,z,P){for(var F,X=P,K=z-I>>1,ee=z-I,G=N[I],ie=N[I+1],me=N[z],de=N[z+1],pe=I+3;peX)F=pe,X=Fe;else if(Fe===X){var Ue=Math.abs(pe-K);UeP&&(F-I>3&&Tr(N,I,F,P),N[F+2]=X,z-F>3&&Tr(N,F,z,P))}function on(N,I,z,P,F,X){var K=F-z,ee=X-P;if(K!==0||ee!==0){var G=((N-z)*K+(I-P)*ee)/(K*K+ee*ee);G>1?(z=F,P=X):G>0&&(z+=K*G,P+=ee*G)}return(K=N-z)*K+(ee=I-P)*ee}function ir(N,I,z,P){var F={id:N===void 0?null:N,type:I,geometry:z,tags:P,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(X){var K=X.geometry,ee=X.type;if(ee==="Point"||ee==="MultiPoint"||ee==="LineString")Gr(X,K);else if(ee==="Polygon"||ee==="MultiLineString")for(var G=0;G0&&(K+=P?(F*ie-G*X)/2:Math.sqrt(Math.pow(G-F,2)+Math.pow(ie-X,2))),F=G,X=ie}var me=I.length-3;I[2]=1,Tr(I,0,me,z),I[me+2]=1,I.size=Math.abs(K),I.start=0,I.end=I.size}function he(N,I,z,P){for(var F=0;F1?1:z}function it(N,I,z,P,F,X,K,ee){if(P/=I,X>=(z/=I)&&K=P)return null;for(var G=[],ie=0;ie=z&&Ue=P)){var He=[];if(pe==="Point"||pe==="MultiPoint")Xt(de,He,z,P,F);else if(pe==="LineString")Cn(de,He,z,P,F,!1,ee.lineMetrics);else if(pe==="MultiLineString")Mn(de,He,z,P,F,!1);else if(pe==="Polygon")Mn(de,He,z,P,F,!0);else if(pe==="MultiPolygon")for(var Ze=0;Ze=z&&K<=P&&(I.push(N[X]),I.push(N[X+1]),I.push(N[X+2]))}}function Cn(N,I,z,P,F,X,K){for(var ee,G,ie=En(N),me=F===0?Hr:ka,de=N.start,pe=0;pez&&(G=me(ie,Fe,Ue,Ze,nt,z),K&&(ie.start=de+ee*G)):pt>P?bt=z&&(G=me(ie,Fe,Ue,Ze,nt,z),$t=!0),bt>P&&pt<=P&&(G=me(ie,Fe,Ue,Ze,nt,P),$t=!0),!X&&$t&&(K&&(ie.end=de+ee*G),I.push(ie),ie=En(N)),K&&(de+=ee)}var Ye=N.length-3;Fe=N[Ye],Ue=N[Ye+1],He=N[Ye+2],(pt=F===0?Fe:Ue)>=z&&pt<=P&&Pn(ie,Fe,Ue,He),Ye=ie.length-3,X&&Ye>=3&&(ie[Ye]!==ie[0]||ie[Ye+1]!==ie[1])&&Pn(ie,ie[0],ie[1],ie[2]),ie.length&&I.push(ie)}function En(N){var I=[];return I.size=N.size,I.start=N.start,I.end=N.end,I}function Mn(N,I,z,P,F,X){for(var K=0;KK.maxX&&(K.maxX=me),de>K.maxY&&(K.maxY=de)}return K}function fi(N,I,z,P){var F=I.geometry,X=I.type,K=[];if(X==="Point"||X==="MultiPoint")for(var ee=0;ee0&&I.size<(F?K:P))z.numPoints+=I.length/3;else{for(var ee=[],G=0;GK)&&(z.numSimplified++,ee.push(I[G]),ee.push(I[G+1])),z.numPoints++;F&&function(ie,me){for(var de=0,pe=0,Fe=ie.length,Ue=Fe-2;pe0===me)for(pe=0,Fe=ie.length;pe24)throw new Error("maxZoom should be in the 0-24 range");if(I.promoteId&&I.generateId)throw new Error("promoteId and generateId cannot be used together.");var P=function(F,X){var K=[];if(F.type==="FeatureCollection")for(var ee=0;ee1&&console.time("creation"),pe=this.tiles[de]=Qn(N,I,z,P,G),this.tileCoords.push({z:I,x:z,y:P}),ie)){ie>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",I,z,P,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var Fe="z"+I;this.stats[Fe]=(this.stats[Fe]||0)+1,this.total++}if(pe.source=N,F){if(I===G.maxZoom||I===F)continue;var Ue=1<1&&console.time("clipping");var He,Ze,nt,pt,bt,$t,Ye=.5*G.buffer/G.extent,Et=.5-Ye,Yt=.5+Ye,bi=1+Ye;He=Ze=nt=pt=null,bt=it(N,me,z-Ye,z+Yt,0,pe.minX,pe.maxX,G),$t=it(N,me,z+Et,z+bi,0,pe.minX,pe.maxX,G),N=null,bt&&(He=it(bt,me,P-Ye,P+Yt,1,pe.minY,pe.maxY,G),Ze=it(bt,me,P+Et,P+bi,1,pe.minY,pe.maxY,G),bt=null),$t&&(nt=it($t,me,P-Ye,P+Yt,1,pe.minY,pe.maxY,G),pt=it($t,me,P+Et,P+bi,1,pe.minY,pe.maxY,G),$t=null),ie>1&&console.timeEnd("clipping"),ee.push(He||[],I+1,2*z,2*P),ee.push(Ze||[],I+1,2*z,2*P+1),ee.push(nt||[],I+1,2*z+1,2*P),ee.push(pt||[],I+1,2*z+1,2*P+1)}}},Qe.prototype.getTile=function(N,I,z){var P=this.options,F=P.extent,X=P.debug;if(N<0||N>24)return null;var K=1<1&&console.log("drilling down to z%d-%d-%d",N,I,z);for(var G,ie=N,me=I,de=z;!G&&ie>0;)ie--,me=Math.floor(me/2),de=Math.floor(de/2),G=this.tiles[Ke(ie,me,de)];return G&&G.source?(X>1&&console.log("found parent tile z%d-%d-%d",ie,me,de),X>1&&console.time("drilling down"),this.splitTile(G.source,ie,me,de,N,I,z),X>1&&console.timeEnd("drilling down"),this.tiles[ee]?Sr(this.tiles[ee],F):null):null};class un extends ce{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(I,z){return A._(this,void 0,void 0,function*(){const P=I.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const F=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!F)return null;const X=new class{constructor(ee){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=A.W,this.length=ee.length,this._features=ee}feature(ee){return new class{constructor(G){this._feature=G,this.extent=A.W,this.type=G.type,this.properties=G.tags,"id"in G&&!isNaN(G.id)&&(this.id=parseInt(G.id,10))}loadGeometry(){if(this._feature.type===1){const G=[];for(const ie of this._feature.geometry)G.push([new A.P(ie[0],ie[1])]);return G}{const G=[];for(const ie of this._feature.geometry){const me=[];for(const de of ie)me.push(new A.P(de[0],de[1]));G.push(me)}return G}}toGeoJSON(G,ie,me){return xi.call(this,G,ie,me)}}(this._features[ee])}}(F.features);let K=ji(X);return K.byteOffset===0&&K.byteLength===K.buffer.byteLength||(K=new Uint8Array(K)),{vectorTile:X,rawData:K.buffer}})}loadData(I){return A._(this,void 0,void 0,function*(){var z;(z=this._pendingRequest)===null||z===void 0||z.abort();const P=!!(I&&I.request&&I.request.collectResourceTiming)&&new A.bs(I.request);this._pendingRequest=new AbortController;try{let F=yield this.loadGeoJSON(I,this._pendingRequest);if(delete this._pendingRequest,typeof F!="object")throw new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`);if(Rt(F,!0),I.filter){const K=A.by(I.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(K.result==="error")throw new Error(K.value.map(G=>`${G.key}: ${G.message}`).join(", "));F={type:"FeatureCollection",features:F.features.filter(G=>K.value.evaluate({zoom:0},G))}}this._geoJSONIndex=I.cluster?new dr(function({superclusterOptions:K,clusterProperties:ee}){if(!ee||!K)return K;const G={},ie={},me={accumulated:null,zoom:0},de={properties:null},pe=Object.keys(ee);for(const Fe of pe){const[Ue,He]=ee[Fe],Ze=A.by(He),nt=A.by(typeof Ue=="string"?[Ue,["accumulated"],["get",Fe]]:Ue);G[Fe]=Ze.value,ie[Fe]=nt.value}return K.map=Fe=>{de.properties=Fe;const Ue={};for(const He of pe)Ue[He]=G[He].evaluate(me,de);return Ue},K.reduce=(Fe,Ue)=>{de.properties=Ue;for(const He of pe)me.accumulated=Fe[He],Fe[He]=ie[He].evaluate(me,de)},K}(I)).load(F.features):function(K,ee){return new Qe(K,ee)}(F,I.geojsonVtOptions),this.loaded={};const X={};if(P){const K=P.finish();K&&(X.resourceTiming={},X.resourceTiming[I.source]=JSON.parse(JSON.stringify(K)))}return X}catch(F){if(delete this._pendingRequest,A.bz(F))return{abandoned:!0};throw F}})}reloadTile(I){const z=this.loaded;return z&&z[I.uid]?super.reloadTile(I):this.loadTile(I)}loadGeoJSON(I,z){return A._(this,void 0,void 0,function*(){const{promoteId:P}=I;if(I.request){const F=yield A.h(I.request,z);return this._dataUpdateable=Ir(F.data,P)?Ge(F.data,P):void 0,F.data}if(typeof I.data=="string")try{const F=JSON.parse(I.data);return this._dataUpdateable=Ir(F,P)?Ge(F,P):void 0,F}catch{throw new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`)}if(!I.dataDiff)throw new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${I.source}`);return function(F,X,K){var ee,G,ie,me;if(X.removeAll&&F.clear(),X.remove)for(const de of X.remove)F.delete(de);if(X.add)for(const de of X.add){const pe=jt(de,K);pe!=null&&F.set(pe,de)}if(X.update)for(const de of X.update){let pe=F.get(de.id);if(pe==null)continue;const Fe=!de.removeAllProperties&&(((ee=de.removeProperties)===null||ee===void 0?void 0:ee.length)>0||((G=de.addOrUpdateProperties)===null||G===void 0?void 0:G.length)>0);if((de.newGeometry||de.removeAllProperties||Fe)&&(pe=Object.assign({},pe),F.set(de.id,pe),Fe&&(pe.properties=Object.assign({},pe.properties))),de.newGeometry&&(pe.geometry=de.newGeometry),de.removeAllProperties)pe.properties={};else if(((ie=de.removeProperties)===null||ie===void 0?void 0:ie.length)>0)for(const Ue of de.removeProperties)Object.prototype.hasOwnProperty.call(pe.properties,Ue)&&delete pe.properties[Ue];if(((me=de.addOrUpdateProperties)===null||me===void 0?void 0:me.length)>0)for(const{key:Ue,value:He}of de.addOrUpdateProperties)pe.properties[Ue]=He}}(this._dataUpdateable,I.dataDiff,P),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(I){return A._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(I){return this._geoJSONIndex.getClusterExpansionZoom(I.clusterId)}getClusterChildren(I){return this._geoJSONIndex.getChildren(I.clusterId)}getClusterLeaves(I){return this._geoJSONIndex.getLeaves(I.clusterId,I.limit,I.offset)}}class Kt{constructor(I){this.self=I,this.actor=new A.C(I),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(z,P)=>{if(this.externalWorkerSourceTypes[z])throw new Error(`Worker source with name "${z}" already registered.`);this.externalWorkerSourceTypes[z]=P},this.self.addProtocol=A.bf,this.self.removeProtocol=A.bg,this.self.registerRTLTextPlugin=z=>{if(A.bA.isParsed())throw new Error("RTL text plugin already registered.");A.bA.setMethods(z)},this.actor.registerMessageHandler("LDT",(z,P)=>this._getDEMWorkerSource(z,P.source).loadTile(P)),this.actor.registerMessageHandler("RDT",(z,P)=>A._(this,void 0,void 0,function*(){this._getDEMWorkerSource(z,P.source).removeTile(P)})),this.actor.registerMessageHandler("GCEZ",(z,P)=>A._(this,void 0,void 0,function*(){return this._getWorkerSource(z,P.type,P.source).getClusterExpansionZoom(P)})),this.actor.registerMessageHandler("GCC",(z,P)=>A._(this,void 0,void 0,function*(){return this._getWorkerSource(z,P.type,P.source).getClusterChildren(P)})),this.actor.registerMessageHandler("GCL",(z,P)=>A._(this,void 0,void 0,function*(){return this._getWorkerSource(z,P.type,P.source).getClusterLeaves(P)})),this.actor.registerMessageHandler("LD",(z,P)=>this._getWorkerSource(z,P.type,P.source).loadData(P)),this.actor.registerMessageHandler("LT",(z,P)=>this._getWorkerSource(z,P.type,P.source).loadTile(P)),this.actor.registerMessageHandler("RT",(z,P)=>this._getWorkerSource(z,P.type,P.source).reloadTile(P)),this.actor.registerMessageHandler("AT",(z,P)=>this._getWorkerSource(z,P.type,P.source).abortTile(P)),this.actor.registerMessageHandler("RMT",(z,P)=>this._getWorkerSource(z,P.type,P.source).removeTile(P)),this.actor.registerMessageHandler("RS",(z,P)=>A._(this,void 0,void 0,function*(){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const F=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],F.removeSource!==void 0&&F.removeSource(P)})),this.actor.registerMessageHandler("RM",z=>A._(this,void 0,void 0,function*(){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z]})),this.actor.registerMessageHandler("SR",(z,P)=>A._(this,void 0,void 0,function*(){this.referrer=P})),this.actor.registerMessageHandler("SRPS",(z,P)=>this._syncRTLPluginState(z,P)),this.actor.registerMessageHandler("IS",(z,P)=>A._(this,void 0,void 0,function*(){this.self.importScripts(P)})),this.actor.registerMessageHandler("SI",(z,P)=>this._setImages(z,P)),this.actor.registerMessageHandler("UL",(z,P)=>A._(this,void 0,void 0,function*(){this._getLayerIndex(z).update(P.layers,P.removedIds)})),this.actor.registerMessageHandler("SL",(z,P)=>A._(this,void 0,void 0,function*(){this._getLayerIndex(z).replace(P)}))}_setImages(I,z){return A._(this,void 0,void 0,function*(){this.availableImages[I]=z;for(const P in this.workerSources[I]){const F=this.workerSources[I][P];for(const X in F)F[X].availableImages=z}})}_syncRTLPluginState(I,z){return A._(this,void 0,void 0,function*(){if(A.bA.isParsed())return A.bA.getState();if(z.pluginStatus!=="loading")return A.bA.setState(z),z;const P=z.pluginURL;if(this.self.importScripts(P),A.bA.isParsed()){const F={pluginStatus:"loaded",pluginURL:P};return A.bA.setState(F),F}throw A.bA.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${P}`)})}_getAvailableImages(I){let z=this.availableImages[I];return z||(z=[]),z}_getLayerIndex(I){let z=this.layerIndexes[I];return z||(z=this.layerIndexes[I]=new p),z}_getWorkerSource(I,z,P){if(this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][z]||(this.workerSources[I][z]={}),!this.workerSources[I][z][P]){const F={sendAsync:(X,K)=>(X.targetMapId=I,this.actor.sendAsync(X,K))};switch(z){case"vector":this.workerSources[I][z][P]=new ce(F,this._getLayerIndex(I),this._getAvailableImages(I));break;case"geojson":this.workerSources[I][z][P]=new un(F,this._getLayerIndex(I),this._getAvailableImages(I));break;default:this.workerSources[I][z][P]=new this.externalWorkerSourceTypes[z](F,this._getLayerIndex(I),this._getAvailableImages(I))}}return this.workerSources[I][z][P]}_getDEMWorkerSource(I,z){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][z]||(this.demWorkerSources[I][z]=new re),this.demWorkerSources[I][z]}}return A.i(self)&&(self.worker=new Kt(self)),Kt}),oe("index",["exports","./shared"],function(A,p){var Oe="4.1.3";let je,Pe;const ce={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:c=>new Promise((t,n)=>{const s=requestAnimationFrame(t);c.signal.addEventListener("abort",()=>{cancelAnimationFrame(s),n(p.c())})}),getImageData(c,t=0){return this.getImageCanvasContext(c).getImageData(-t,-t,c.width+2*t,c.height+2*t)},getImageCanvasContext(c){const t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return t.width=c.width,t.height=c.height,n.drawImage(c,0,0,c.width,c.height),n},resolveURL:c=>(je||(je=document.createElement("a")),je.href=c,je.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Pe==null&&(Pe=matchMedia("(prefers-reduced-motion: reduce)")),Pe.matches)}};class re{static testProp(t){if(!re.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",re.suppressClickInternal,!0)},0)}static getScale(t){const n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,n,s){const o=n.boundingClientRect;return new p.P((s.clientX-o.left)/n.x-t.clientLeft,(s.clientY-o.top)/n.y-t.clientTop)}static mousePos(t,n){const s=re.getScale(t);return re.getPoint(t,s,n)}static touchPos(t,n){const s=[],o=re.getScale(t);for(let h=0;h{t=[],n=0,s=0,o={}},c.addThrottleControl=y=>{const v=s++;return o[v]=y,v},c.removeThrottleControl=y=>{delete o[y],m()},c.getImage=(y,v,T=!0)=>new Promise((S,E)=>{xt.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),p.e(y,{type:"image"}),t.push({abortController:v,requestParameters:y,supportImageRefresh:T,state:"queued",onError:V=>{E(V)},onSuccess:V=>{S(V)}}),m()});const h=y=>p._(this,void 0,void 0,function*(){y.state="running";const{requestParameters:v,supportImageRefresh:T,onError:S,onSuccess:E,abortController:V}=y,O=T===!1&&!p.i(self)&&!p.g(v.url)&&(!v.headers||Object.keys(v.headers).reduce((W,ne)=>W&&ne==="accept",!0));n++;const j=O?_(v,V):p.m(v,V);try{const W=yield j;delete y.abortController,y.state="completed",W.data instanceof HTMLImageElement||p.b(W.data)?E(W):W.data&&E({data:yield(R=W.data,typeof createImageBitmap=="function"?p.d(R):p.f(R)),cacheControl:W.cacheControl,expires:W.expires})}catch(W){delete y.abortController,S(W)}finally{n--,m()}var R}),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 T=t.shift();T.abortController.signal.aborted?v--:h(T)}},_=(y,v)=>new Promise((T,S)=>{const E=new Image,V=y.url,O=y.credentials;O&&O==="include"?E.crossOrigin="use-credentials":(O&&O==="same-origin"||!p.s(V))&&(E.crossOrigin="anonymous"),v.signal.addEventListener("abort",()=>{E.src="",S(p.c())}),E.fetchPriority="high",E.onload=()=>{E.onerror=E.onload=null,T({data:E})},E.onerror=()=>{E.onerror=E.onload=null,v.signal.aborted||S(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."))},E.src=V})}(hi||(hi={})),hi.resetRequestQueue();class sn{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const o=function(h){const m=h.match(Ei);if(!m)throw new Error(`Unable to parse URL "${h}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return o.path+=`${n}${s}`,function(h){const m=h.params.length?`?${h.params.join("&")}`:"";return`${h.protocol}://${h.authority}${h.path}${m}`}(o)}setTransformRequest(t){this._transformRequestFn=t}}const Ei=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function lr(c){var t=new p.A(3);return t[0]=c[0],t[1]=c[1],t[2]=c[2],t}var ui,cr=function(c,t,n){return c[0]=t[0]-n[0],c[1]=t[1]-n[1],c[2]=t[2]-n[2],c};ui=new p.A(3),p.A!=Float32Array&&(ui[0]=0,ui[1]=0,ui[2]=0);var hr=function(c){var t=c[0],n=c[1];return t*t+n*n};function Ut(c){const t=[];if(typeof c=="string")t.push({id:"default",url:c});else if(c&&c.length>0){const n=[];for(const{id:s,url:o}of c){const h=`${s}${o}`;n.indexOf(h)===-1&&(n.push(h),t.push({id:s,url:o}))}}return t}(function(){var c=new p.A(2);p.A!=Float32Array&&(c[0]=0,c[1]=0)})();class ct{constructor(t,n,s,o){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,o)}update(t,n,s){const{width:o,height:h}=t,m=!(this.size&&this.size[0]===o&&this.size[1]===h||s),{context:_}=this,{gl:y}=_;if(this.useMipmap=!!(n&&n.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!n||n.premultiply!==!1)),m)this.size=[o,h],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||p.b(t)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,t):y.texImage2D(y.TEXTURE_2D,0,this.format,o,h,0,this.format,y.UNSIGNED_BYTE,t.data);else{const{x:v,y:T}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||p.b(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,T,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,T,o,h,y.RGBA,y.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(t,n,s){const{context:o}=this,{gl:h}=o;h.bindTexture(h.TEXTURE_2D,this.texture),s!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=h.LINEAR),t!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,n),h.texParameteri(h.TEXTURE_2D,h.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:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function An(c){const{userImage:t}=c;return!!(t&&t.render&&t.render())&&(c.data.replace(new Uint8Array(t.data.buffer)),!0)}class si 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(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,promiseResolve:s}of this.requestors)s(this._getImagesForIds(n));this.requestors=[]}}getImage(t){const n=this.images[t];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(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0;const o=n.data||n.spriteData;return this._validateStretch(n.stretchX,o&&o.width)||(this.fire(new p.j(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,o&&o.height)||(this.fire(new p.j(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new p.j(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(const o of t){if(o[0]{let o=!0;if(!this.isLoaded())for(const h of t)this.images[h]||(o=!1);this.isLoaded()||o?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})})}_getImagesForIds(t){const n={};for(const s of t){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,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:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],s=this.getImage(t);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},h=new p.I(o,s);this.patterns[t]={bin:o,position:h}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ct(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const h in this.patterns)t.push(this.patterns[h].bin);const{w:n,h:s}=p.p(t),o=this.atlasImage;o.resize({width:n||1,height:s||1});for(const h in this.patterns){const{bin:m}=this.patterns[h],_=m.x+1,y=m.y+1,v=this.getImage(h).data,T=v.width,S=v.height;p.R.copy(v,o,{x:0,y:0},{x:_,y},{width:T,height:S}),p.R.copy(v,o,{x:0,y:S-1},{x:_,y:y-1},{width:T,height:1}),p.R.copy(v,o,{x:0,y:0},{x:_,y:y+S},{width:T,height:1}),p.R.copy(v,o,{x:T-1,y:0},{x:_-1,y},{width:1,height:S}),p.R.copy(v,o,{x:0,y:0},{x:_+T,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.getImage(n);s||p.w(`Image with ID: "${n}" was not found`),An(s)&&this.updateImage(n,s)}}}const oi=1e20;function ur(c,t,n,s,o,h,m,_,y){for(let v=t;v-1);y++,h[y]=_,m[y]=v,m[y+1]=oi}for(let _=0,y=0;_65535)throw new Error("glyphs > 65535 not supported");if(s.ranges[h])return{stack:t,id:n,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!s.requests[h]){const _=ji.loadGlyphRange(t,h,this.url,this.requestManager);s.requests[h]=_}const m=yield s.requests[h];for(const _ in m)this._doesCharSupportLocalGlyph(+_)||(s.glyphs[+_]=m[+_]);return s.ranges[h]=!0,{stack:t,id:n,glyph:m[n]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(p.u["CJK Unified Ideographs"](t)||p.u["Hangul Syllables"](t)||p.u.Hiragana(t)||p.u.Katakana(t))}_tinySDF(t,n,s){const o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(s))return;let h=t.tinySDF;if(!h){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),h=t.tinySDF=new ji.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:_})}const m=h.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}}}}ji.loadGlyphRange=function(c,t,n,s){return p._(this,void 0,void 0,function*(){const o=256*t,h=o+255,m=s.transformRequest(n.replace("{fontstack}",c).replace("{range}",`${o}-${h}`),"Glyphs"),_=yield p.l(m,new AbortController);if(!_||!_.data)throw new Error(`Could not load glyph range. range: ${t}, ${o}-${h}`);const y={};for(const v of p.n(_.data))y[v.id]=v;return y})},ji.TinySDF=class{constructor({fontSize:c=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:o="sans-serif",fontWeight:h="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=c+4*t,y=this._createCanvas(_),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${h} ${c}px ${o}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(c){const t=document.createElement("canvas");return t.width=t.height=c,t}draw(c){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:o,actualBoundingBoxRight:h}=this.ctx.measureText(c),m=Math.ceil(n),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(h-o))),y=Math.min(this.size-this.buffer,m+Math.ceil(s)),v=_+2*this.buffer,T=y+2*this.buffer,S=Math.max(v*T,0),E=new Uint8ClampedArray(S),V={data:E,width:v,height:T,glyphWidth:_,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(_===0||y===0)return V;const{ctx:O,buffer:j,gridInner:R,gridOuter:W}=this;O.clearRect(j,j,_,y),O.fillText(c,j,j+m);const ne=O.getImageData(j,j,_,y);W.fill(oi,0,S),R.fill(0,0,S);for(let $=0;$0?le*le:0,R[se]=le<0?le*le:0}}ur(W,0,0,v,T,v,this.f,this.v,this.z),ur(R,j,j,_,y,v,this.f,this.v,this.z);for(let $=0;$1&&(y=t[++_]);const T=Math.abs(v-y.left),S=Math.abs(v-y.right),E=Math.min(T,S);let V;const O=h/s*(o+1);if(y.isDash){const j=o-Math.abs(O);V=Math.sqrt(E*E+j*j)}else V=o-Math.sqrt(E*E+O*O);this.data[m+v]=Math.max(0,Math.min(255,V+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const y=t[_],v=t[_+1];y.zeroLength?t.splice(_,1):v&&v.isDash===y.isDash&&(v.left=y.left,t.splice(_,1))}const n=t[0],s=t[t.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 h=0,m=t[h];for(let _=0;_1&&(m=t[++h]);const y=Math.abs(_-m.left),v=Math.abs(_-m.right),T=Math.min(y,v);this.data[o+_]=Math.max(0,Math.min(255,(m.isDash?T:-T)+128))}}addDash(t,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 h=0;for(let _=0;_{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ct]}numActive(){return Object.keys(this.active).length}}const dr=Math.floor(ce.hardwareConcurrency/2);let vi,tr;function Pi(){return vi||(vi=new $i),vi}$i.workerCount=p.B(globalThis)?Math.max(Math.min(dr,3),1):1;class qi{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const s=this.workerPool.acquire(n);for(let o=0;o{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(const s of this.actors)s.registerMessageHandler(t,n)}}function Zr(){return tr||(tr=new qi(Pi(),p.G),tr.registerMessageHandler("GR",(c,t,n)=>p.m(t,n))),tr}function Tr(c,t){const n=p.F();return p.H(n,n,[1,1,0]),p.J(n,n,[.5*c.width,.5*c.height,1]),p.K(n,n,c.calculatePosMatrix(t.toUnwrapped()))}function on(c,t,n,s,o,h){const m=function(S,E,V){if(S)for(const O of S){const j=E[O];if(j&&j.source===V&&j.type==="fill-extrusion")return!0}else for(const O in E){const j=E[O];if(j.source===V&&j.type==="fill-extrusion")return!0}return!1}(o&&o.layers,t,c.id),_=h.maxPitchScaleFactor(),y=c.tilesIn(s,_,m);y.sort(ir);const v=[];for(const S of y)v.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(t,n,c._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,o,h,_,Tr(c.transform,S.tileID))});const T=function(S){const E={},V={};for(const O of S){const j=O.queryResults,R=O.wrappedTileID,W=V[R]=V[R]||{};for(const ne in j){const $=j[ne],J=W[ne]=W[ne]||{},ae=E[ne]=E[ne]||[];for(const se of $)J[se.featureIndex]||(J[se.featureIndex]=!0,ae.push(se))}}return E}(v);for(const S in T)T[S].forEach(E=>{const V=E.feature,O=c.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=O});return T}function ir(c,t){const n=c.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}function Gr(c,t,n){return p._(this,void 0,void 0,function*(){let s=c;if(c.url?s=(yield p.h(t.transformRequest(c.url,"Source"),n)).data:yield ce.frameAsync(n),!s)return null;const o=p.L(p.e(s,c),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(o.vectorLayerIds=s.vector_layers.map(h=>h.id)),o})}class Nt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof p.M?new p.M(t.lng,t.lat):p.M.convert(t),this}setSouthWest(t){return this._sw=t instanceof p.M?new p.M(t.lng,t.lat):p.M.convert(t),this}extend(t){const n=this._sw,s=this._ne;let o,h;if(t instanceof p.M)o=t,h=t;else{if(!(t instanceof Nt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Nt.convert(t)):this.extend(p.M.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(p.M.convert(t)):this;if(o=t._sw,h=t._ne,!o||!h)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(h.lng,s.lng),s.lat=Math.max(h.lat,s.lat)):(this._sw=new p.M(o.lng,o.lat),this._ne=new p.M(h.lng,h.lat)),this}getCenter(){return new p.M((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.M(this.getWest(),this.getNorth())}getSouthEast(){return new p.M(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:n,lat:s}=p.M.convert(t);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(t){return t instanceof Nt?t:t&&new Nt(t)}static fromLngLat(t,n=0){const s=360*n/40075017,o=s/Math.cos(Math.PI/180*t.lat);return new Nt(new p.M(t.lng-o,t.lat-s),new p.M(t.lng+o,t.lat+s))}}class ln{constructor(t,n,s){this.bounds=Nt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),s=Math.floor(p.N(this.bounds.getWest())*n),o=Math.floor(p.O(this.bounds.getNorth())*n),h=Math.ceil(p.N(this.bounds.getEast())*n),m=Math.ceil(p.O(this.bounds.getSouth())*n);return t.x>=s&&t.x=o&&t.y{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return p.e({},this._options)}loadTile(t){return p._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise((h,m)=>{t.reloadPromise={resolve:h,reject:m}})}else t.actor=this.dispatcher.getActor(),o="LT";t.abortController=new AbortController;try{const h=yield t.actor.sendAsync({type:o,data:s},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,h)}catch(h){if(delete t.abortController,t.aborted)return;if(h&&h.status!==404)throw h;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){const s=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(s.resolve).catch(s.reject)}}abortTile(t){return p._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return p._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class he extends p.E{constructor(t,n,s,o){super(),this.id=t,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.L(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 t=yield Gr(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(p.e(this,t),t.bounds&&(this.tileBounds=new ln(t.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(t){this._tileJSONRequest=null,this.fire(new p.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return p.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return p._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const s=yield hi.getImage(this.map._requestManager.transformRequest(n,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(s&&s.data){this.map._refreshExpiredTiles&&s.cacheControl&&s.expires&&t.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});const o=this.map.painter.context,h=o.gl,m=s.data;t.texture=this.map.painter.getTileTexture(m.width),t.texture?t.texture.update(m,{useMipmap:!0}):(t.texture=new ct(o,m,h.RGBA,{useMipmap:!0}),t.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&h.texParameterf(h.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded"}}catch(s){if(delete t.abortController,t.aborted)t.state="unloaded";else if(s)throw t.state="errored",s}})}abortTile(t){return p._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return p._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class zn extends he{constructor(t,n,s,o){super(t,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(t){return p._(this,void 0,void 0,function*(){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=this.map._requestManager.transformRequest(n,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const o=yield hi.getImage(s,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(o&&o.data){const h=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&t.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const m=p.b(h)&&p.S()?h:yield this.readImageNow(h),_={type:this.type,uid:t.uid,source:this.id,rawImageData:m,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const y=yield t.actor.sendAsync({type:"LDT",data:_});t.dem=y,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(o){if(delete t.abortController,t.aborted)t.state="unloaded";else if(o)throw t.state="errored",o}})}readImageNow(t){return p._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&p.U()){const n=t.width+2,s=t.height+2;try{return new p.R({width:n,height:s},yield p.V(t,-1,-1,n,s))}catch{}}return ce.getImageData(t,1)})}_getNeighboringTiles(t){const n=t.canonical,s=Math.pow(2,n.z),o=(n.x-1+s)%s,h=n.x===0?t.wrap-1:t.wrap,m=(n.x+1+s)%s,_=n.x+1===s?t.wrap+1:t.wrap,y={};return y[new p.Q(t.overscaledZ,h,n.z,o,n.y).key]={backfilled:!1},y[new p.Q(t.overscaledZ,_,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(y[new p.Q(t.overscaledZ,h,n.z,o,n.y-1).key]={backfilled:!1},y[new p.Q(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new p.Q(t.overscaledZ,_,n.z,m,n.y-1).key]={backfilled:!1}),n.y+10&&p.e(h,{resourceTiming:o}),this.fire(new p.k("data",Object.assign(Object.assign({},h),{sourceDataType:"metadata"}))),this.fire(new p.k("data",Object.assign(Object.assign({},h),{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(t){return p._(this,void 0,void 0,function*(){const n=t.actor?"RT":"LT";t.actor=this.actor;const s={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const o=yield this.actor.sendAsync({type:n,data:s},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(o,this.map.painter,n==="RT")})}abortTile(t){return p._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return p._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return p.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var it=p.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Xt extends p.E{constructor(t,n,s,o){super(),this.id=t,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(t){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 hi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new p.j(n))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new p.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(p.Y.fromLngLat);this.tileID=function(o){let h=1/0,m=1/0,_=-1/0,y=-1/0;for(const E of o)h=Math.min(h,E.x),m=Math.min(m,E.y),_=Math.max(_,E.x),y=Math.max(y,E.y);const v=Math.max(_-h,y-m),T=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),S=Math.pow(2,T);return new p.a0(T,Math.floor((h+_)/2*S),Math.floor((m+y)/2*S))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new p.Z,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,p.W,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,p.W),this._boundsArray.emplaceBack(s[2].x,s[2].y,p.W,p.W),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 t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=p.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ct(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const h=this.tiles[o];h.state!=="loaded"&&(h.state="loaded",h.texture=this.texture,s=!0)}s&&this.fire(new p.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return p._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Cn extends Xt{constructor(t,n,s,o){super(t,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 t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield p.a2(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(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new p.j(new p.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=p.$.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 ct(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const h=this.tiles[o];h.state!=="loaded"&&(h.state="loaded",h.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 En extends Xt{constructor(t,n,s,o){super(t,n,s,o),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(h=>!Array.isArray(h)||h.length!==2||h.some(m=>typeof m!="number"))||this.fire(new p.j(new p.a1(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new p.j(new p.a1(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new p.j(new p.a1(`sources.${t}`,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.a1(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new p.j(new p.a1(`sources.${t}`,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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,s=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=p.$.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ct(n,this.canvas,s.RGBA,{premultiply:!0});let o=!1;for(const h in this.tiles){const m=this.tiles[h];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 t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Mn={},Pn=c=>{switch(c){case"geojson":return Jn;case"image":return Xt;case"raster":return he;case"raster-dem":return zn;case"vector":return cn;case"video":return Cn;case"canvas":return En}return Mn[c]},Hr="RTLPluginLoaded";class ka extends p.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Zr()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return p._(this,arguments,void 0,function*(n,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=ce.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(Hr))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let hn=null;function be(){return hn||(hn=new ka),hn}class Sr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=p.a3(),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(t){const n=t+this.timeAdded;nh.getLayer(v)).filter(Boolean);if(y.length!==0){_.layers=y,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(v=>y.filter(T=>T.id===v)[0]));for(const v of y)m[v.id]=_}}return m}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const o in this.buckets){const h=this.buckets[o];if(h instanceof p.a5){if(this.hasSymbolBuckets=!0,!s)break;h.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const o in this.buckets){const h=this.buckets[o];if(h instanceof p.a5&&h.hasRTLText){this.hasRTLText=!0,be().lazyLoad();break}}this.queryPadding=0;for(const o in this.buckets){const h=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(o).queryRadius(h))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new p.a4}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const s in this.buckets){const o=this.buckets[s];o.uploadPending()&&o.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ct(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ct(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,o,h,m,_,y,v,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:h,scale:m,tileSize:this.tileSize,pixelPosMatrix:T,transform:y,params:_,queryPadding:this.queryPadding*v},t,n,s):{}}querySourceFeatures(t,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const o=s.loadVTLayers(),h=n&&n.sourceLayer?n.sourceLayer:"",m=o._geojsonTileLayer||o[h];if(!m)return;const _=p.a6(n&&n.filter),{z:y,x:v,y:T}=this.tileID.canonical,S={z:y,x:v,y:T};for(let E=0;Es)o=!1;else if(n)if(this.expirationTime{this.remove(t,h)},s)),this.data[o].push(h),this.order.push(o),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const s=t.wrapped().key,o=n===void 0?0:this.data[s].indexOf(n),h=this.data[s][o];return this.data[s].splice(o,1),h.timeout&&clearTimeout(h.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(h.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const s in this.data)for(const o of this.data[s])t(o.value)||n.push(o);for(const s of n)this.remove(s.value.tileID,s)}}class Qn{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){const o=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][o]=this.stateChanges[t][o]||{},p.e(this.stateChanges[t][o],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(const h in this.state[t])h!==o&&(this.deletedStates[t][h]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][o]===null){this.deletedStates[t][o]={};for(const h in this.state[t][o])s[h]||(this.deletedStates[t][o][h]=null)}else for(const h in s)this.deletedStates[t]&&this.deletedStates[t][o]&&this.deletedStates[t][o][h]===null&&delete this.deletedStates[t][o][h]}removeFeatureState(t,n,s){if(this.deletedStates[t]===null)return;const o=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&n!==void 0)this.deletedStates[t][o]!==null&&(this.deletedStates[t][o]=this.deletedStates[t][o]||{},this.deletedStates[t][o][s]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][o])for(s in this.deletedStates[t][o]={},this.stateChanges[t][o])this.deletedStates[t][o][s]=null;else this.deletedStates[t][o]=null;else this.deletedStates[t]=null}getState(t,n){const s=String(n),o=p.e({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const h=this.deletedStates[t][n];if(h===null)return{};for(const m in h)delete o[m]}return o}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const s={};for(const o in this.stateChanges){this.state[o]=this.state[o]||{};const h={};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]),h[m]=this.state[o][m];s[o]=h}for(const o in this.deletedStates){this.state[o]=this.state[o]||{};const h={};if(this.deletedStates[o]===null)for(const m in this.state[o])h[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 _ of Object.keys(this.deletedStates[o][m]))delete this.state[o][m][_];h[m]=this.state[o][m]}s[o]=s[o]||{},p.e(s[o],h)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const o in t)t[o].setFeatureState(s,n)}}class fi extends p.E{constructor(t,n,s){super(),this.id=t,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,h,m,_)=>{const y=new(Pn(h.type))(o,h,m,_);if(y.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${y.id}`);return y})(t,n,s,this),this._tiles={},this._cache=new Zi(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Qn,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];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 t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n,s){return p._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,n,s)}catch(o){t.state="errored",o.status!==404?this._source.fire(new p.j(o,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new p.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(ke).map(t=>t.key)}getRenderableIds(t){const n=[];for(const s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort((s,o)=>{const h=s.tileID,m=o.tileID,_=new p.P(h.canonical.x,h.canonical.y)._rotate(this.transform.angle),y=new p.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return h.overscaledZ-m.overscaledZ||y.y-_.y||y.x-_.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(ke).map(s=>s.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){return p._(this,void 0,void 0,function*(){const s=this._tiles[t];s&&(s.state!=="loading"&&(s.state=n),yield this._loadTile(s,t,n))})}_tileLoaded(t,n,s){t.timeAdded=ce.now(),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new p.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){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)),h.dem&&o.dem&&(o.dem.backfillBorder(h.dem,m,_),o.neighboringTiles&&o.neighboringTiles[v]&&(o.neighboringTiles[v].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,o){for(const h in this._tiles){let m=this._tiles[h];if(o[h]||!m.hasData()||m.tileID.overscaledZ<=n||m.tileID.overscaledZ>s)continue;let _=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()&&(_=v)}let y=_;for(;y.overscaledZ>n;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){o[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){const o=t.scaledTo(s),h=this._getLoadedTile(o);if(h)return h}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,o=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?p.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),h=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(h)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const o in this._tiles){const h=this._tiles[o];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+n),s[h.tileID.key]=h}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])}}update(t,n){if(!this._sourceLoaded||this._paused)return;let s;this.transform=t,this.terrain=n,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new p.Q(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(s=t.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(T=>this._source.hasTile(T)))):s=[];const o=t.coveringZoomLevel(this._source),h=Math.max(o-fi.maxOverzooming,this._source.minzoom),m=Math.max(o+fi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const S of s)if(S.canonical.z>this._source.minzoom){const E=S.scaledTo(S.canonical.z-1);T[E.key]=E;const V=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));T[V.key]=V}s=s.concat(Object.values(T))}const _=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,_&&this.fire(new p.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(s,o);if(Qe(this._source.type)){const T={},S={},E=Object.keys(y),V=ce.now();for(const O of E){const j=y[O],R=this._tiles[O];if(!R||R.fadeEndTime!==0&&R.fadeEndTime<=V)continue;const W=this.findLoadedParent(j,h);W&&(this._addTile(W.tileID),T[W.tileID.key]=W.tileID),S[O]=j}this._retainLoadedChildren(S,o,m,y);for(const O in T)y[O]||(this._coveredTiles[O]=!0,y[O]=T[O]);if(n){const O={},j={};for(const R of s)this._tiles[R.key].hasData()?O[R.key]=R:j[R.key]=R;for(const R in j){const W=j[R].children(this._source.maxzoom);this._tiles[W[0].key]&&this._tiles[W[1].key]&&this._tiles[W[2].key]&&this._tiles[W[3].key]&&(O[W[0].key]=y[W[0].key]=W[0],O[W[1].key]=y[W[1].key]=W[1],O[W[2].key]=y[W[2].key]=W[2],O[W[3].key]=y[W[3].key]=W[3],delete j[R])}for(const R in j){const W=this.findLoadedParent(j[R],this._source.minzoom);if(W){O[W.tileID.key]=y[W.tileID.key]=W.tileID;for(const ne in O)O[ne].isChildOf(W.tileID)&&delete O[ne]}}for(const R in this._tiles)O[R]||(this._coveredTiles[R]=!0)}}for(const T in y)this._tiles[T].clearFadeHold();const v=p.ab(this._tiles,y);for(const T of v){const S=this._tiles[T];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const s={},o={},h=Math.max(n-fi.maxOverzooming,this._source.minzoom),m=Math.max(n+fi.maxUnderzooming,this._source.minzoom),_={};for(const y of t){const v=this._addTile(y);s[y.key]=y,v.hasData()||nthis._source.maxzoom){const S=y.children(this._source.maxzoom)[0],E=this.getTile(S);if(E&&E.hasData()){s[S.key]=S;continue}}else{const S=y.children(this._source.maxzoom);if(s[S[0].key]&&s[S[1].key]&&s[S[2].key]&&s[S[3].key])continue}let T=v.wasRequested();for(let S=y.overscaledZ-1;S>=h;--S){const E=y.scaledTo(S);if(o[E.key])break;if(o[E.key]=!0,v=this.getTile(E),!v&&T&&(v=this._addTile(E)),v){const V=v.hasData();if((T||V)&&(s[E.key]=E),T=v.wasRequested(),V)break}}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let s,o=this._tiles[t].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){s=this._loadedParentTiles[o.key];break}n.push(o.key);const h=o.scaledTo(o.overscaledZ-1);if(s=this._getLoadedTile(h),s)break;o=h}for(const h of n)this._loadedParentTiles[h]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const s=n;return n||(n=new Sr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new p.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},s))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),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(t){const n=t.sourceDataType;t.dataType==="source"&&n==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&t.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 t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){const o=[],h=this.transform;if(!h)return o;const m=s?h.getCameraQueryGeometry(t):t,_=t.map(O=>h.pointCoordinate(O,this.terrain)),y=m.map(O=>h.pointCoordinate(O,this.terrain)),v=this.getIds();let T=1/0,S=1/0,E=-1/0,V=-1/0;for(const O of y)T=Math.min(T,O.x),S=Math.min(S,O.y),E=Math.max(E,O.x),V=Math.max(V,O.y);for(let O=0;O=0&&$[1].y+ne>=0){const J=_.map(se=>R.getTilePoint(se)),ae=y.map(se=>R.getTilePoint(se));o.push({tile:j,tileID:R,queryGeometry:J,cameraQueryGeometry:ae,scale:W})}}return o}getVisibleCoordinates(t){const n=this.getRenderableIds(t).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(Qe(this._source.type)){const t=ce.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){const o=this._tiles[t];o&&o.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(const s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(t,n))}}function ke(c,t){const n=Math.abs(2*c.wrap)-+(c.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return c.overscaledZ-t.overscaledZ||s-n||t.canonical.y-c.canonical.y||t.canonical.x-c.canonical.x}function Qe(c){return c==="raster"||c==="image"||c==="video"}fi.maxOverzooming=10,fi.maxUnderzooming=3;class Ke{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s0?(o-m)/_:0;return this.points[h].mult(1-y).add(this.points[n].mult(y))}}function jt(c,t){let n=!0;return c==="always"||c!=="never"&&t!=="never"||(n=!1),n}class Ir{constructor(t,n,s){const o=this.boxCells=[],h=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let m=0;mthis.width||o<0||n>this.height)return[];const y=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=o){if(h)return[{key:null,x1:t,y1:n,x2:s,y2:o}];for(let v=0;v0}hitTestCircle(t,n,s,o,h){const m=t-s,_=t+s,y=n-s,v=n+s;if(_<0||m>this.width||v<0||y>this.height)return!1;const T=[];return this._forEachCell(m,y,_,v,this._queryCellCircle,T,{hitTest:!0,overlapMode:o,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},h),T.length>0}_queryCell(t,n,s,o,h,m,_,y){const{seenUids:v,hitTest:T,overlapMode:S}=_,E=this.boxCells[h];if(E!==null){const O=this.bboxes;for(const j of E)if(!v.box[j]){v.box[j]=!0;const R=4*j,W=this.boxKeys[j];if(t<=O[R+2]&&n<=O[R+3]&&s>=O[R+0]&&o>=O[R+1]&&(!y||y(W))&&(!T||!jt(S,W.overlapMode))&&(m.push({key:W,x1:O[R],y1:O[R+1],x2:O[R+2],y2:O[R+3]}),T))return!0}}const V=this.circleCells[h];if(V!==null){const O=this.circles;for(const j of V)if(!v.circle[j]){v.circle[j]=!0;const R=3*j,W=this.circleKeys[j];if(this._circleAndRectCollide(O[R],O[R+1],O[R+2],t,n,s,o)&&(!y||y(W))&&(!T||!jt(S,W.overlapMode))){const ne=O[R],$=O[R+1],J=O[R+2];if(m.push({key:W,x1:ne-J,y1:$-J,x2:ne+J,y2:$+J}),T)return!0}}}return!1}_queryCellCircle(t,n,s,o,h,m,_,y){const{circle:v,seenUids:T,overlapMode:S}=_,E=this.boxCells[h];if(E!==null){const O=this.bboxes;for(const j of E)if(!T.box[j]){T.box[j]=!0;const R=4*j,W=this.boxKeys[j];if(this._circleAndRectCollide(v.x,v.y,v.radius,O[R+0],O[R+1],O[R+2],O[R+3])&&(!y||y(W))&&!jt(S,W.overlapMode))return m.push(!0),!0}}const V=this.circleCells[h];if(V!==null){const O=this.circles;for(const j of V)if(!T.circle[j]){T.circle[j]=!0;const R=3*j,W=this.circleKeys[j];if(this._circlesCollide(O[R],O[R+1],O[R+2],v.x,v.y,v.radius)&&(!y||y(W))&&!jt(S,W.overlapMode))return m.push(!0),!0}}}_forEachCell(t,n,s,o,h,m,_,y){const v=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),S=this._convertToXCellCoord(s),E=this._convertToYCellCoord(o);for(let V=v;V<=S;V++)for(let O=T;O<=E;O++)if(h.call(this,t,n,s,o,this.xCellCount*O+V,m,_,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,s,o,h,m){const _=o-t,y=h-n,v=s+m;return v*v>_*_+y*y}_circleAndRectCollide(t,n,s,o,h,m,_){const y=(m-o)/2,v=Math.abs(t-(o+y));if(v>y+s)return!1;const T=(_-h)/2,S=Math.abs(n-(h+T));if(S>T+s)return!1;if(v<=y||S<=T)return!0;const E=v-y,V=S-T;return E*E+V*V<=s*s}}function Ge(c,t,n,s,o){const h=p.F();return t?(p.J(h,h,[1/o,1/o,1]),n||p.ad(h,h,s.angle)):p.K(h,s.labelPlaneMatrix,c),h}function un(c,t,n,s,o){if(t){const h=p.ae(c);return p.J(h,h,[o,o,1]),n||p.ad(h,h,-s.angle),h}return s.glCoordMatrix}function Kt(c,t,n){let s;n?(s=[c.x,c.y,n(c.x,c.y),1],p.af(s,s,t)):(s=[c.x,c.y,0,1],Fe(s,s,t));const o=s[3];return{point:new p.P(s[0]/o,s[1]/o),signedDistanceFromCamera:o}}function N(c,t){return .5+c/t*.5}function I(c,t){const n=c[0]/c[3],s=c[1]/c[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function z(c,t,n,s,o,h,m,_,y,v){const T=s?c.textSizeData:c.iconSizeData,S=p.ag(T,n.transform.zoom),E=[256/n.width*2+1,256/n.height*2+1],V=s?c.text.dynamicLayoutVertexArray:c.icon.dynamicLayoutVertexArray;V.clear();const O=c.lineVertexArray,j=s?c.text.placedSymbolArray:c.icon.placedSymbolArray,R=n.transform.width/n.transform.height;let W=!1;for(let ne=0;neMath.abs(n.x-t.x)*s?{useVertical:!0}:(c===p.ah.vertical?t.yn.x)?{needsFlipping:!0}:null}function X(c,t,n,s,o,h,m,_,y,v,T,S,E,V,O,j){const R=t/24,W=c.lineOffsetX*R,ne=c.lineOffsetY*R;let $;if(c.numGlyphs>1){const J=c.glyphStartIndex+c.numGlyphs,ae=c.lineStartIndex,se=c.lineStartIndex+c.lineLength,le=P(R,_,W,ne,n,T,S,c,y,h,E,O,j);if(!le)return{notEnoughRoom:!0};const ge=Kt(le.first.point,m,j).point,_e=Kt(le.last.point,m,j).point;if(s&&!n){const ve=F(c.writingMode,ge,_e,V);if(ve)return ve}$=[le.first];for(let ve=c.glyphStartIndex+1;ve0?ge.point:K(S,le,ae,1,o,j),ve=F(c.writingMode,ae,_e,V);if(ve)return ve}const J=me(R*_.getoffsetX(c.glyphStartIndex),W,ne,n,T,S,c.segment,c.lineStartIndex,c.lineStartIndex+c.lineLength,y,h,E,O,j);if(!J)return{notEnoughRoom:!0};$=[J]}for(const J of $)p.aj(v,J.point,J.angle);return{}}function K(c,t,n,s,o,h){const m=Kt(c.add(c.sub(t)._unit()),o,h).point,_=n.sub(m);return n.add(_._mult(s/_.mag()))}function ee(c,t){const{projectionCache:n,lineVertexArray:s,labelPlaneMatrix:o,tileAnchorPoint:h,distanceFromAnchor:m,getElevation:_,previousVertex:y,direction:v,absOffsetX:T}=t;if(n.projections[c])return n.projections[c];const S=new p.P(s.getx(c),s.gety(c)),E=Kt(S,o,_);if(E.signedDistanceFromCamera>0)return n.projections[c]=E.point,E.point;const V=c-v;return K(m===0?h:new p.P(s.getx(V),s.gety(V)),S,y,T-m+1,o,_)}function G(c,t,n){return c._unit()._perp()._mult(t*n)}function ie(c,t,n,s,o,h,m,_){const{projectionCache:y,direction:v}=_;if(y.offsets[c])return y.offsets[c];const T=n.add(t);if(c+v=o)return y.offsets[c]=T,T;const S=ee(c+v,_),E=G(S.sub(n),m,v),V=n.add(E),O=S.add(E);return y.offsets[c]=p.ak(h,T,V,O)||T,y.offsets[c]}function me(c,t,n,s,o,h,m,_,y,v,T,S,E,V){const O=s?c-t:c+t;let j=O>0?1:-1,R=0;s&&(j*=-1,R=Math.PI),j<0&&(R+=Math.PI);let W,ne,$=j>0?_+m:_+m+1,J=o,ae=o,se=0,le=0;const ge=Math.abs(O),_e=[];let ve;for(;se+le<=ge;){if($+=j,$<_||$>=y)return null;se+=le,ae=J,ne=W;const Se={projectionCache:S,lineVertexArray:v,labelPlaneMatrix:T,tileAnchorPoint:h,distanceFromAnchor:se,getElevation:V,previousVertex:ae,direction:j,absOffsetX:ge};if(J=ee($,Se),n===0)_e.push(ae),ve=J.sub(ae);else{let $e;const Xe=J.sub(ae);$e=Xe.mag()===0?G(ee($+j,Se).sub(J),n,j):G(Xe,n,j),ne||(ne=ae.add($e)),W=ie($,$e,J,_,y,ne,n,Se),_e.push(ne),ve=W.sub(ne)}le=ve.mag()}const Te=ve._mult((ge-se)/le)._add(ne||ae),We=R+Math.atan2(J.y-ae.y,J.x-ae.x);return _e.push(Te),{point:Te,angle:E?We:0,path:_e}}const de=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pe(c,t){for(let n=0;n=1;Je--)Xe.push(Se.path[Je]);for(let Je=1;Je<$e.path.length;Je++)Xe.push($e.path[Je]);const st=2.5*_e;if(y){const Je=Xe.map(et=>Kt(et,y,O));Xe=Je.some(et=>et.signedDistanceFromCamera<=0)?[]:Je.map(et=>et.point)}let qe=[];if(Xe.length>0){const Je=Xe[0].clone(),et=Xe[0].clone();for(let Dt=1;Dt=ve.x&&et.x<=Te.x&&Je.y>=ve.y&&et.y<=Te.y?[Xe]:et.xTe.x||et.yTe.y?[]:p.al([Xe],ve.x,ve.y,Te.x,Te.y)}for(const Je of qe){We.reset(Je,.25*_e);let et=0;et=We.length<=.5*_e?1:Math.ceil(We.paddedLength/st)+1;for(let Dt=0;Dt=this.screenRightBoundary||othis.screenBottomBoundary}isInsideGrid(t,n,s,o){return s>=0&&t=0&&ns.collisionGroupID===n}}return this.collisionGroups[t]}}function Yt(c,t,n,s,o){const{horizontalAlign:h,verticalAlign:m}=p.at(c);return new p.P(-(h-.5)*t+s[0]*o,-(m-.5)*n+s[1]*o)}function bi(c,t,n,s,o,h){const{x1:m,x2:_,y1:y,y2:v,anchorPointX:T,anchorPointY:S}=c,E=new p.P(t,n);return s&&E._rotate(o?h:-h),{x1:m+E.x,y1:y+E.y,x2:_+E.x,y2:v+E.y,anchorPointX:T,anchorPointY:S}}class Di{constructor(t,n,s,o,h){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new He(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new Et(o),this.collisionCircleArrays={},this.prevPlacement=h,h&&(h.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,o){const h=s.getBucket(n),m=s.latestFeatureIndex;if(!h||!m||n.id!==h.layerIds[0])return;const _=s.collisionBoxArray,y=h.layers[0].layout,v=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),T=s.tileSize/p.W,S=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),E=y.get("text-pitch-alignment")==="map",V=y.get("text-rotation-alignment")==="map",O=Ze(s,1,this.transform.zoom),j=Ge(S,E,V,this.transform,O);let R=null;if(E){const ne=un(S,E,V,this.transform,O);R=p.K([],this.transform.labelPlaneMatrix,ne)}this.retainedQueryData[h.bucketInstanceId]=new Ye(h.bucketInstanceId,m,h.sourceLayerIndex,h.index,s.tileID);const W={bucket:h,layout:y,posMatrix:S,textLabelPlaneMatrix:j,labelToScreenMatrix:R,scale:v,textPixelRatio:T,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:p.ag(h.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(h.sourceID)};if(o)for(const ne of h.sortKeyRanges){const{sortKey:$,symbolInstanceStart:J,symbolInstanceEnd:ae}=ne;t.push({sortKey:$,symbolInstanceStart:J,symbolInstanceEnd:ae,parameters:W})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:h.symbolInstances.length,parameters:W})}attemptAnchorPlacement(t,n,s,o,h,m,_,y,v,T,S,E,V,O,j,R){const W=p.ap[t.textAnchor],ne=[t.textOffset0,t.textOffset1],$=Yt(W,s,o,ne,h),J=this.collisionIndex.placeCollisionBox(bi(n,$.x,$.y,m,_,this.transform.angle),S,y,v,T.predicate,R);if((!j||this.collisionIndex.placeCollisionBox(bi(j,$.x,$.y,m,_,this.transform.angle),S,y,v,T.predicate,R).box.length!==0)&&J.box.length>0){let ae;if(this.prevPlacement&&this.prevPlacement.variableOffsets[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID]&&this.prevPlacement.placements[E.crossTileID].text&&(ae=this.prevPlacement.variableOffsets[E.crossTileID].anchor),E.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[E.crossTileID]={textOffset:ne,width:s,height:o,anchor:W,textBoxScale:h,prevAnchor:ae},this.markUsedJustification(V,W,E,O),V.allowVerticalPlacement&&(this.markUsedOrientation(V,O,E),this.placedOrientations[E.crossTileID]=O),{shift:$,placedGlyphBoxes:J}}}placeLayerBucketPart(t,n,s){const{bucket:o,layout:h,posMatrix:m,textLabelPlaneMatrix:_,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:T,collisionBoxArray:S,partiallyEvaluatedTextSize:E,collisionGroup:V}=t.parameters,O=h.get("text-optional"),j=h.get("icon-optional"),R=p.aq(h,"text-overlap","text-allow-overlap"),W=R==="always",ne=p.aq(h,"icon-overlap","icon-allow-overlap"),$=ne==="always",J=h.get("text-rotation-alignment")==="map",ae=h.get("text-pitch-alignment")==="map",se=h.get("icon-text-fit")!=="none",le=h.get("symbol-z-order")==="viewport-y",ge=W&&($||!o.hasIconData()||j),_e=$&&(W||!o.hasTextData()||O);!o.collisionArrays&&S&&o.deserializeCollisionBoxes(S);const ve=this.retainedQueryData[o.bucketInstanceId].tileID,Te=this.terrain?(Se,$e)=>this.terrain.getElevation(ve,Se,$e):null,We=(Se,$e)=>{var Xe,st;if(n[Se.crossTileID])return;if(T)return void(this.placements[Se.crossTileID]=new bt(!1,!1,!1));let qe=!1,Je=!1,et=!0,Dt=null,dt={box:null,offscreen:null},Xi={box:null,offscreen:null},Jt=null,kt=null,Qt=null,Ki=0,Mr=0,en=0;$e.textFeatureIndex?Ki=$e.textFeatureIndex:Se.useRuntimeCollisionCircles&&(Ki=Se.featureIndex),$e.verticalTextFeatureIndex&&(Mr=$e.verticalTextFeatureIndex);const wa=$e.textBox;if(wa){const Zt=Gt=>{let zt=p.ah.horizontal;if(o.allowVerticalPlacement&&!Gt&&this.prevPlacement){const sr=this.prevPlacement.placedOrientations[Se.crossTileID];sr&&(this.placedOrientations[Se.crossTileID]=sr,zt=sr,this.markUsedOrientation(o,zt,Se))}return zt},At=(Gt,zt)=>{if(o.allowVerticalPlacement&&Se.numVerticalGlyphVertices>0&&$e.verticalTextBox){for(const sr of o.writingModes)if(sr===p.ah.vertical?(dt=zt(),Xi=dt):dt=Gt(),dt&&dt.box&&dt.box.length)break}else dt=Gt()},Tt=Se.textAnchorOffsetStartIndex,ar=Se.textAnchorOffsetEndIndex;if(ar===Tt){const Gt=(zt,sr)=>{const Ht=this.collisionIndex.placeCollisionBox(zt,R,v,m,V.predicate,Te);return Ht&&Ht.box&&Ht.box.length&&(this.markUsedOrientation(o,sr,Se),this.placedOrientations[Se.crossTileID]=sr),Ht};At(()=>Gt(wa,p.ah.horizontal),()=>{const zt=$e.verticalTextBox;return o.allowVerticalPlacement&&Se.numVerticalGlyphVertices>0&&zt?Gt(zt,p.ah.vertical):{box:null,offscreen:null}}),Zt(dt&&dt.box&&dt.box.length)}else{let Gt=p.ap[(st=(Xe=this.prevPlacement)===null||Xe===void 0?void 0:Xe.variableOffsets[Se.crossTileID])===null||st===void 0?void 0:st.anchor];const zt=(Ht,Bt,ao)=>{const ml=Ht.x2-Ht.x1,vn=Ht.y2-Ht.y1,bn=Se.textBoxScale,ds=se&&ne==="never"?Bt:null;let rn={box:[],offscreen:!1},so=R==="never"?1:2,_l="never";Gt&&so++;for(let oo=0;oozt(wa,$e.iconBox,p.ah.horizontal),()=>{const Ht=$e.verticalTextBox;return o.allowVerticalPlacement&&!(dt&&dt.box&&dt.box.length)&&Se.numVerticalGlyphVertices>0&&Ht?zt(Ht,$e.verticalIconBox,p.ah.vertical):{box:null,offscreen:null}}),dt&&(qe=dt.box,et=dt.offscreen);const sr=Zt(dt&&dt.box);if(!qe&&this.prevPlacement){const Ht=this.prevPlacement.variableOffsets[Se.crossTileID];Ht&&(this.variableOffsets[Se.crossTileID]=Ht,this.markUsedJustification(o,Ht.anchor,Se,sr))}}}if(Jt=dt,qe=Jt&&Jt.box&&Jt.box.length>0,et=Jt&&Jt.offscreen,Se.useRuntimeCollisionCircles){const Zt=o.text.placedSymbolArray.get(Se.centerJustifiedTextSymbolIndex),At=p.ai(o.textSizeData,E,Zt),Tt=h.get("text-padding");kt=this.collisionIndex.placeCollisionCircles(R,Zt,o.lineVertexArray,o.glyphOffsetArray,At,m,_,y,s,ae,V.predicate,Se.collisionCircleDiameter,Tt,Te),kt.circles.length&&kt.collisionDetected&&!s&&p.w("Collisions detected, but collision boxes are not shown"),qe=W||kt.circles.length>0&&!kt.collisionDetected,et=et&&kt.offscreen}if($e.iconFeatureIndex&&(en=$e.iconFeatureIndex),$e.iconBox){const Zt=At=>{const Tt=se&&Dt?bi(At,Dt.x,Dt.y,J,ae,this.transform.angle):At;return this.collisionIndex.placeCollisionBox(Tt,ne,v,m,V.predicate,Te)};Xi&&Xi.box&&Xi.box.length&&$e.verticalIconBox?(Qt=Zt($e.verticalIconBox),Je=Qt.box.length>0):(Qt=Zt($e.iconBox),Je=Qt.box.length>0),et=et&&Qt.offscreen}const tn=O||Se.numHorizontalGlyphVertices===0&&Se.numVerticalGlyphVertices===0,Pr=j||Se.numIconVertices===0;if(tn||Pr?Pr?tn||(Je=Je&&qe):qe=Je&&qe:Je=qe=Je&&qe,qe&&Jt&&Jt.box&&this.collisionIndex.insertCollisionBox(Jt.box,R,h.get("text-ignore-placement"),o.bucketInstanceId,Xi&&Xi.box&&Mr?Mr:Ki,V.ID),Je&&Qt&&this.collisionIndex.insertCollisionBox(Qt.box,ne,h.get("icon-ignore-placement"),o.bucketInstanceId,en,V.ID),kt&&(qe&&this.collisionIndex.insertCollisionCircles(kt.circles,R,h.get("text-ignore-placement"),o.bucketInstanceId,Ki,V.ID),s)){const Zt=o.bucketInstanceId;let At=this.collisionCircleArrays[Zt];At===void 0&&(At=this.collisionCircleArrays[Zt]=new $t);for(let Tt=0;Tt=0;--$e){const Xe=Se[$e];We(o.symbolInstances.get(Xe),o.collisionArrays[Xe])}}else for(let Se=t.symbolInstanceStart;Se=0&&(t.text.placedSymbolArray.get(_).crossTileID=h>=0&&_!==h?0:s.crossTileID)}markUsedOrientation(t,n,s){const o=n===p.ah.horizontal||n===p.ah.horizontalOnly?n:0,h=n===p.ah.vertical?n:0,m=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const _ of m)t.text.placedSymbolArray.get(_).placedOrientation=o;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=h)}commit(t){this.commitTime=t,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(t):1,h=n?n.opacities:{},m=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],T=h[y];T?(this.opacities[y]=new pt(T,o,v.text,v.icon),s=s||v.text!==T.text.placed||v.icon!==T.icon.placed):(this.opacities[y]=new pt(null,o,v.text,v.icon,v.skipFade),s=s||v.text||v.icon)}for(const y in h){const v=h[y];if(!this.opacities[y]){const T=new pt(v,o,!1,!1);T.isHidden()||(this.opacities[y]=T,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 _)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=_[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const s={};for(const o of n){const h=o.getBucket(t);h&&o.latestFeatureIndex&&t.id===h.layerIds[0]&&this.updateBucketOpacities(h,s,o.collisionBoxArray)}}updateBucketOpacities(t,n,s){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const o=t.layers[0],h=o.layout,m=new pt(null,0,!1,!1,!0),_=h.get("text-allow-overlap"),y=h.get("icon-allow-overlap"),v=o._unevaluatedLayout.hasValue("text-variable-anchor")||o._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=h.get("text-rotation-alignment")==="map",S=h.get("text-pitch-alignment")==="map",E=h.get("icon-text-fit")!=="none",V=new pt(null,0,_&&(y||!t.hasIconData()||h.get("icon-optional")),y&&(_||!t.hasTextData()||h.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const O=(j,R,W)=>{for(let ne=0;ne0,se=this.placedOrientations[R.crossTileID],le=se===p.ah.vertical,ge=se===p.ah.horizontal||se===p.ah.horizontalOnly;if(W>0||ne>0){const _e=Li(J.text);O(t.text,W,le?ea:_e),O(t.text,ne,ge?ea:_e);const ve=J.text.isHidden();[R.rightJustifiedTextSymbolIndex,R.centerJustifiedTextSymbolIndex,R.leftJustifiedTextSymbolIndex].forEach(Se=>{Se>=0&&(t.text.placedSymbolArray.get(Se).hidden=ve||le?1:0)}),R.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(R.verticalPlacedTextSymbolIndex).hidden=ve||ge?1:0);const Te=this.variableOffsets[R.crossTileID];Te&&this.markUsedJustification(t,Te.anchor,R,se);const We=this.placedOrientations[R.crossTileID];We&&(this.markUsedJustification(t,"left",R,We),this.markUsedOrientation(t,We,R))}if(ae){const _e=Li(J.icon),ve=!(E&&R.verticalPlacedIconSymbolIndex&&le);R.placedIconSymbolIndex>=0&&(O(t.icon,R.numIconVertices,ve?_e:ea),t.icon.placedSymbolArray.get(R.placedIconSymbolIndex).hidden=J.icon.isHidden()),R.verticalPlacedIconSymbolIndex>=0&&(O(t.icon,R.numVerticalIconVertices,ve?ea:_e),t.icon.placedSymbolArray.get(R.verticalPlacedIconSymbolIndex).hidden=J.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const _e=t.collisionArrays[j];if(_e){let ve=new p.P(0,0);if(_e.textBox||_e.verticalTextBox){let We=!0;if(v){const Se=this.variableOffsets[$];Se?(ve=Yt(Se.anchor,Se.width,Se.height,Se.textOffset,Se.textBoxScale),T&&ve._rotate(S?this.transform.angle:-this.transform.angle)):We=!1}_e.textBox&&ci(t.textCollisionBox.collisionVertexArray,J.text.placed,!We||le,ve.x,ve.y),_e.verticalTextBox&&ci(t.textCollisionBox.collisionVertexArray,J.text.placed,!We||ge,ve.x,ve.y)}const Te=!!(!ge&&_e.verticalIconBox);_e.iconBox&&ci(t.iconCollisionBox.collisionVertexArray,J.icon.placed,Te,E?ve.x:0,E?ve.y:0),_e.verticalIconBox&&ci(t.iconCollisionBox.collisionVertexArray,J.icon.placed,!Te,E?ve.x:0,E?ve.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const j=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=j.invProjMatrix,t.placementViewportMatrix=j.viewportMatrix,t.collisionCircleArray=j.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function ci(c,t,n,s,o){c.emplaceBack(t?1:0,n?1:0,s||0,o||0),c.emplaceBack(t?1:0,n?1:0,s||0,o||0),c.emplaceBack(t?1:0,n?1:0,s||0,o||0),c.emplaceBack(t?1:0,n?1:0,s||0,o||0)}const kr=Math.pow(2,25),Po=Math.pow(2,24),Ol=Math.pow(2,17),ht=Math.pow(2,16),As=Math.pow(2,9),zs=Math.pow(2,8),Gi=Math.pow(2,1);function Li(c){if(c.opacity===0&&!c.placed)return 0;if(c.opacity===1&&c.placed)return 4294967295;const t=c.placed?1:0,n=Math.floor(127*c.opacity);return n*kr+t*Po+n*Ol+t*ht+n*As+t*zs+n*Gi+t}const ea=0;class rr{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,s,o,h){const m=this._bucketParts;for(;this._currentTileIndex_.sortKey-y.sortKey));this._currentPartIndex!this._forceFullPlacement&&ce.now()-o>2;for(;this._currentPlacementIndex>=0;){const m=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=_)&&(!m.maxzoom||m.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new rr(m)),this._inProgressLayer.continuePlacement(s[m.source],this.placement,this._showCollisionBoxes,m,h))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Dn=512/p.W/2;class Aa{constructor(t,n,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};const o=new Map;for(let h=0;h({x:Math.floor(y.anchorX*Dn),y:Math.floor(y.anchorY*Dn)})),crossTileIDs:m.map(y=>y.crossTileID)};if(_.positions.length>128){const y=new p.au(_.positions.length,16,Uint16Array);for(const{x:v,y:T}of _.positions)y.add(v,T);y.finish(),delete _.positions,_.index=y}this._symbolsByKey[h]=_}}getScaledCoordinates(t,n){const{x:s,y:o,z:h}=this.tileID.canonical,{x:m,y:_,z:y}=n.canonical,v=Dn/Math.pow(2,y-h),T=(_*p.W+t.anchorY)*v,S=o*p.W*Dn;return{x:Math.floor((m*p.W+t.anchorX)*v-s*p.W*Dn),y:Math.floor(T-S)}}findMatches(t,n,s){const o=this.tileID.canonical.zt)}}class qt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ta{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const s in this.indexes){const o=this.indexes[s],h={};for(const m in o){const _=o[m];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),h[_.tileID.key]=_}this.indexes[s]=h}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let h=0;ht.overscaledZ)for(const _ in m){const y=m[_];y.tileID.isChildOf(t)&&y.findMatches(n.symbolInstances,t,o)}else{const _=m[t.scaledTo(Number(h)).key];_&&_.findMatches(n.symbolInstances,t,o)}}for(let h=0;h{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const It=(c,t)=>p.t(c,t&&t.filter(n=>n.identifier!=="source.canvas")),za=p.av();class Hi extends p.E{constructor(t,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=t,this.dispatcher=new qi(Pi(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(s,o)=>this.getGlyphs(s,o)),this.dispatcher.registerMessageHandler("GI",(s,o)=>this.getImages(s,o)),this.imageManager=new si,this.imageManager.setEventedParent(this),this.glyphManager=new ji(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new li(256,512),this.crossTileSymbolIndex=new Wr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new p.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",p.ax()),be().on(Hr,this._rtlPluginLoaded),this.on("data",s=>{if(s.dataType!=="source"||s.sourceDataType!=="metadata")return;const o=this.sourceCaches[s.sourceId];if(!o)return;const h=o.getSource();if(h&&h.vectorLayerIds)for(const m in this._layers){const _=this._layers[m];_.source===h.id&&this._validateLayer(_)}})}loadURL(t,n={},s){this.fire(new p.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const o=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController,p.h(o,this._loadStyleRequest).then(h=>{this._loadStyleRequest=null,this._load(h.data,n,s)}).catch(h=>{this._loadStyleRequest=null,h&&this.fire(new p.j(h))})}loadJSON(t,n={},s){this.fire(new p.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,ce.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,s)}).catch(()=>{})}loadEmpty(){this.fire(new p.k("dataloading",{dataType:"style"})),this._load(za,{validate:!1})}_load(t,n,s){var o;const h=n.transformStyle?n.transformStyle(s,t):t;if(!n.validate||!It(this,p.x(h))){this._loaded=!0,this.stylesheet=h;for(const m in h.sources)this.addSource(m,h.sources[m],{validate:!1});h.sprite?this._loadSprite(h.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(h.glyphs),this._createLayers(),this.light=new qr(this.stylesheet.light),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 t=p.ay(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const s=p.az(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(t,n=!1,s=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(h,m,_,y){return p._(this,void 0,void 0,function*(){const v=Ut(h),T=_>1?"@2x":"",S={},E={};for(const{id:V,url:O}of v){const j=m.transformRequest(m.normalizeSpriteURL(O,T,".json"),"SpriteJSON");S[V]=p.h(j,y);const R=m.transformRequest(m.normalizeSpriteURL(O,T,".png"),"SpriteImage");E[V]=hi.getImage(R,y)}return yield Promise.all([...Object.values(S),...Object.values(E)]),function(V,O){return p._(this,void 0,void 0,function*(){const j={};for(const R in V){j[R]={};const W=ce.getImageCanvasContext((yield O[R]).data),ne=(yield V[R]).data;for(const $ in ne){const{width:J,height:ae,x:se,y:le,sdf:ge,pixelRatio:_e,stretchX:ve,stretchY:Te,content:We}=ne[$];j[R][$]={data:null,pixelRatio:_e,sdf:ge,stretchX:ve,stretchY:Te,content:We,spriteData:{width:J,height:ae,x:se,y:le,context:W}}}}return j})}(S,E)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(h=>{if(this._spriteRequest=null,h)for(const m in h){this._spritesImagesIds[m]=[];const _=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in h)):[];for(const y of _)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in h[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,h[m][y],!1):this.imageManager.addImage(v,h[m][y]),n&&(this._changedImages[v]=!0)}}}).catch(h=>{this._spriteRequest=null,o=h,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 t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const s=t.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 "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const s=[];for(const o of t)n[o]&&s.push(n[o]);return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const o=this._layers[s];o.type!=="custom"&&(t[s]=o.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(n){const o=Object.keys(this._updatedLayers),h=Object.keys(this._removedLayers);(o.length||h.length)&&this._updateWorkerLayers(o,h);for(const m in this._updatedSources){const _=this._updatedSources[m];if(_==="reload")this._reloadSource(m);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const s={};for(const o in this.sourceCaches){const h=this.sourceCaches[o];s[o]=h.used,h.used=!1}for(const o of this._order){const h=this._layers[o];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(const o in s){const h=this.sourceCaches[o];!!s[o]!=!!h.used&&h.fire(new p.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new p.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){var s;this._checkLoaded();const o=this.serialize();if(t=n.transformStyle?n.transformStyle(o,t):t,((s=n.validate)===null||s===void 0||s)&&It(this,p.x(t)))return!1;(t=p.aA(t)).layers=p.ay(t.layers);const h=p.aB(o,t),m=this._getOperationsToPerform(h);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(const _ of m.operations)_();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const n=[],s=[];for(const o of t)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"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(t,n){if(this.getImage(t))return this.fire(new p.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new p.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(p.x.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const o=this.sourceCaches[t]=new fi(t,n,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t})),o.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===t)return this.fire(new p.j(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new p.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const s=this.sourceCaches[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();const o=t.id;if(this.getLayer(o))return void this.fire(new p.j(new Error(`Layer "${o}" already exists on this map.`)));let h;if(t.type==="custom"){if(It(this,p.aC(t)))return;h=p.az(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(o,t.source),t=p.aA(t),t=p.e(t,{source:o})),this._validate(p.x.layer,`layers.${o}`,t,{arrayIndex:-1},s))return;h=p.az(t),this._validateLayer(h),h.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]=h,this._removedLayers[o]&&h.source&&h.type!=="custom"){const _=this._removedLayers[o];delete this._removedLayers[o],_.type!==h.type?this._updatedSources[h.source]="clear":(this._updatedSources[h.source]="reload",this.sourceCaches[h.source].pause())}this._updateLayer(h),h.onAdd&&h.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new p.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const s=this._order.indexOf(t);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 "${t}" before non-existing layer "${n}".`))):(this._order.splice(o,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new p.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();const o=this.getLayer(t);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 "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();const o=this.getLayer(t);if(o){if(!p.aD(o.filter,n))return n==null?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(p.x.filter,`layers.${o.id}.filter`,n,null,s)||(o.filter=p.aA(n),this._updateLayer(o)))}else this.fire(new p.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return p.aA(this.getLayer(t).filter)}setLayoutProperty(t,n,s,o={}){this._checkLoaded();const h=this.getLayer(t);h?p.aD(h.getLayoutProperty(n),s)||(h.setLayoutProperty(n,s,o),this._updateLayer(h)):this.fire(new p.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new p.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,o={}){this._checkLoaded();const h=this.getLayer(t);h?p.aD(h.getPaintProperty(n),s)||(h.setPaintProperty(n,s,o)&&this._updateLayer(h),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new p.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const s=t.source,o=t.sourceLayer,h=this.sourceCaches[s];if(h===void 0)return void this.fire(new p.j(new Error(`The source '${s}' does not exist in the map's style.`)));const m=h.getSource().type;m==="geojson"&&o?this.fire(new p.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||o?(t.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),h.setFeatureState(o,t.id,n)):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const s=t.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 h=o.getSource().type,m=h==="vector"?t.sourceLayer:void 0;h!=="vector"||m?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new p.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(m,t.id,n):this.fire(new p.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,s=t.sourceLayer,o=this.sourceCaches[n];if(o!==void 0)return o.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new p.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(s,t.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 t=p.aE(this.sourceCaches,h=>h.serialize()),n=this._serializeByIds(this._order),s=this.map.getTerrain()||void 0,o=this.stylesheet;return p.aF({version:o.version,name:o.name,metadata:o.metadata,light:o.light,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:t,layers:n,terrain:s},h=>h!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=m=>this._layers[m].type==="fill-extrusion",s={},o=[];for(let m=this._order.length-1;m>=0;m--){const _=this._order[m];if(n(_)){s[_]=m;for(const y of t){const v=y[_];if(v)for(const T of v)o.push(T)}}}o.sort((m,_)=>_.intersectionZ-m.intersectionZ);const h=[];for(let m=this._order.length-1;m>=0;m--){const _=this._order[m];if(n(_))for(let y=o.length-1;y>=0;y--){const v=o[y].feature;if(s[v.layer.id]{const ge=W.featureSortOrder;if(ge){const _e=ge.indexOf(se.featureIndex);return ge.indexOf(le.featureIndex)-_e}return le.featureIndex-se.featureIndex});for(const se of ae)J.push(se)}}for(const W in O)O[W].forEach(ne=>{const $=ne.feature,J=v[_[W].source].getFeatureState($.layer["source-layer"],$.id);$.source=$.layer.source,$.layer["source-layer"]&&($.sourceLayer=$.layer["source-layer"]),$.state=J});return O}(this._layers,m,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(h)}querySourceFeatures(t,n){n&&n.filter&&this._validate(p.x.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?function(o,h){const m=o.getRenderableIds().map(v=>o.getTileByID(v)),_=[],y={};for(let v=0;vE.getTileByID(V)).sort((V,O)=>O.tileID.overscaledZ-V.tileID.overscaledZ||(V.tileID.isLessThan(O.tileID)?-1:1))}const S=this.crossTileSymbolIndex.addLayer(T,y[T.source],t.center.lng);m=m||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((h=h||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(ce.now(),t.zoom))&&(this.pauseablePlacement=new nr(t,this.map.terrain,this._order,h,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(ce.now()),_=!0),m&&this.pauseablePlacement.placement.setStale()),_||m)for(const v of this._order){const T=this._layers[v];T.type==="symbol"&&this.placement.updateLayerOpacities(T,y[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(ce.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,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(t,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(t,n={}){this._checkLoaded(),t&&this._validate(p.x.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,s={},o){this._checkLoaded();const h=[{id:t,url:n}],m=[...Ut(this.stylesheet.sprite),...h];this._validate(p.x.sprite,"sprite",m,null,s)||(this.stylesheet.sprite=m,this._loadSprite(h,!0,o))}removeSprite(t){this._checkLoaded();const n=Ut(this.stylesheet.sprite);if(n.find(s=>s.id===t)){if(this._spritesImagesIds[t])for(const s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex(s=>s.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new p.k("data",{dataType:"style"}))}else this.fire(new p.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Ut(this.stylesheet.sprite)}setSprite(t,n={},s){this._checkLoaded(),t&&this._validate(p.x.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(null)))}}var Ca=p.X([{name:"a_pos",type:"Int16",components:2}]),Ar="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const ia={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);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);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,0,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_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;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 +}`,`const float PI=3.141592653589793;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;varying vec2 v_tex;varying float v_fade_opacity; +#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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);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=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);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 +}`,`const float PI=3.141592653589793;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 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;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 +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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);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=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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 +}`,`const float PI=3.141592653589793;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;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 +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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);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=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ar),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);}",Ar),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);}",Ar)};function ut(c,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),o=c.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=h?h.concat(o):o,_={};return{fragmentSource:c=c.replace(n,(y,v,T,S,E)=>(_[E]=!0,v==="define"?` +#ifndef HAS_UNIFORM_u_${E} +varying ${T} ${S} ${E}; +#else +uniform ${T} ${S} u_${E}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${E} + ${T} ${S} ${E} = u_${E}; +#endif +`)),vertexSource:t=t.replace(n,(y,v,T,S,E)=>{const V=S==="float"?"vec2":"vec4",O=E.match(/color/)?"color":V;return _[E]?v==="define"?` +#ifndef HAS_UNIFORM_u_${E} +uniform lowp float u_${E}_t; +attribute ${T} ${V} a_${E}; +varying ${T} ${S} ${E}; +#else +uniform ${T} ${S} u_${E}; +#endif +`:O==="vec4"?` +#ifndef HAS_UNIFORM_u_${E} + ${E} = a_${E}; +#else + ${T} ${S} ${E} = u_${E}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${E} + ${E} = unpack_mix_${O}(a_${E}, u_${E}_t); +#else + ${T} ${S} ${E} = u_${E}; +#endif +`:v==="define"?` +#ifndef HAS_UNIFORM_u_${E} +uniform lowp float u_${E}_t; +attribute ${T} ${V} a_${E}; +#else +uniform ${T} ${S} u_${E}; +#endif +`:O==="vec4"?` +#ifndef HAS_UNIFORM_u_${E} + ${T} ${S} ${E} = a_${E}; +#else + ${T} ${S} ${E} = u_${E}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${E} + ${T} ${S} ${E} = unpack_mix_${O}(a_${E}, u_${E}_t); +#else + ${T} ${S} ${E} = u_${E}; +#endif +`}),staticAttributes:s,staticUniforms:m}}class Ea{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,o,h,m,_,y,v){this.context=t;let T=this.boundPaintVertexBuffers.length!==o.length;for(let S=0;!T&&S({u_depth:new p.aG(se,le.u_depth),u_terrain:new p.aG(se,le.u_terrain),u_terrain_dim:new p.aH(se,le.u_terrain_dim),u_terrain_matrix:new p.aI(se,le.u_terrain_matrix),u_terrain_unpack:new p.aJ(se,le.u_terrain_unpack),u_terrain_exaggeration:new p.aH(se,le.u_terrain_exaggeration)}))(t,ae),this.binderUniforms=s?s.getUniforms(t,ae):[]}draw(t,n,s,o,h,m,_,y,v,T,S,E,V,O,j,R,W,ne){const $=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(o),t.setColorMode(h),t.setCullFace(m),y){t.activeTexture.set($.TEXTURE2),$.bindTexture($.TEXTURE_2D,y.depthTexture),t.activeTexture.set($.TEXTURE3),$.bindTexture($.TEXTURE_2D,y.texture);for(const ae in this.terrainUniforms)this.terrainUniforms[ae].set(y[ae])}for(const ae in this.fixedUniforms)this.fixedUniforms[ae].set(_[ae]);j&&j.setUniforms(t,this.binderUniforms,V,{zoom:O});let J=0;switch(n){case $.LINES:J=2;break;case $.TRIANGLES:J=3;break;case $.LINE_STRIP:J=1}for(const ae of E.get()){const se=ae.vaos||(ae.vaos={});(se[v]||(se[v]=new Ea)).bind(t,this,T,j?j.getPaintVertexBuffers():[],S,ae.vertexOffset,R,W,ne),$.drawElements(n,ae.primitiveLength*J,$.UNSIGNED_SHORT,ae.primitiveOffset*J*2)}}}function Ma(c,t,n){const s=1/Ze(n,1,t.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/o,m=h*(n.tileID.canonical.x+n.tileID.wrap*o),_=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,c.fromScale,c.toScale],u_fade:c.t,u_pixel_coord_upper:[m>>16,_>>16],u_pixel_coord_lower:[65535&m,65535&_]}}const ra=(c,t,n,s)=>{const o=t.style.light,h=o.properties.get("position"),m=[h.x,h.y,h.z],_=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,T){var S=Math.sin(T),E=Math.cos(T);v[0]=E,v[1]=S,v[2]=0,v[3]=-S,v[4]=E,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(_,-t.transform.angle),function(v,T,S){var E=T[0],V=T[1],O=T[2];v[0]=E*S[0]+V*S[3]+O*S[6],v[1]=E*S[1]+V*S[4]+O*S[7],v[2]=E*S[2]+V*S[5]+O*S[8]}(m,m,_);const y=o.properties.get("color");return{u_matrix:c,u_lightpos:m,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+n,u_opacity:s}},Vl=(c,t,n,s,o,h,m)=>p.e(ra(c,t,n,s),Ma(h,t,m),{u_height_factor:-Math.pow(2,o.overscaledZ)/m.tileSize/8}),Do=c=>({u_matrix:c}),Pa=(c,t,n,s)=>p.e(Do(c),Ma(n,t,s)),Ul=(c,t)=>({u_matrix:c,u_world:t}),Lo=(c,t,n,s,o)=>p.e(Pa(c,t,n,s),{u_world:o}),Nl=(c,t,n,s)=>{const o=c.transform;let h,m;if(s.paint.get("circle-pitch-alignment")==="map"){const _=Ze(n,1,o.zoom);h=!0,m=[_,_]}else h=!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:c.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:c.pixelRatio,u_extrude_scale:m}},Ro=(c,t,n)=>{const s=Ze(n,1,t.zoom),o=Math.pow(2,t.zoom-n.tileID.overscaledZ),h=n.tileID.overscaleFactor();return{u_matrix:c,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[t.pixelsToGLUnits[0]/(s*o),t.pixelsToGLUnits[1]/(s*o)],u_overscale_factor:h}},Bo=(c,t,n=1)=>({u_matrix:c,u_color:t,u_overlay:0,u_overlay_scale:n}),Da=c=>({u_matrix:c}),Fo=(c,t,n,s)=>({u_matrix:c,u_extrude_scale:Ze(t,1,n),u_intensity:s});function Oo(c,t){const n=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new p.Y(0,s/n).toLngLat().lat,new p.Y(0,(s+1)/n).toLngLat().lat]}const La=(c,t,n,s)=>{const o=c.transform;return{u_matrix:na(c,t,n,s),u_ratio:1/Ze(t,1,o.zoom),u_device_pixel_ratio:c.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Vo=(c,t,n,s,o)=>p.e(La(c,t,n,o),{u_image:0,u_image_height:s}),dn=(c,t,n,s,o)=>{const h=c.transform,m=Wi(t,h);return{u_matrix:na(c,t,n,o),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Ze(t,1,h.zoom),u_device_pixel_ratio:c.pixelRatio,u_image:0,u_scale:[m,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},Ra=(c,t,n,s,o,h)=>{const m=c.lineAtlas,_=Wi(t,c.transform),y=n.layout.get("line-cap")==="round",v=m.getDash(s.from,y),T=m.getDash(s.to,y),S=v.width*o.fromScale,E=T.width*o.toScale;return p.e(La(c,t,n,h),{u_patternscale_a:[_/S,-v.height/2],u_patternscale_b:[_/E,-T.height/2],u_sdfgamma:m.width/(256*Math.min(S,E)*c.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:T.y,u_mix:o.t})};function Wi(c,t){return 1/Ze(c,1,t.tileZoom)}function na(c,t,n,s){return c.translatePosMatrix(s?s.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Ba=(c,t,n,s,o)=>{return{u_matrix:c,u_tl_parent:t,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:(h=o.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:aa(o.paint.get("raster-hue-rotate"))};var h,m};function aa(c){c*=Math.PI/180;const t=Math.sin(c),n=Math.cos(c);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const sa=(c,t,n,s,o,h,m,_,y,v)=>{const T=o.transform;return{u_is_size_zoom_constant:+(c==="constant"||c==="source"),u_is_size_feature_constant:+(c==="constant"||c==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:h,u_label_plane_matrix:m,u_coord_matrix:_,u_is_text:+y,u_pitch_with_map:+s,u_texsize:v,u_texture:0}},oa=(c,t,n,s,o,h,m,_,y,v,T)=>{const S=o.transform;return p.e(sa(c,t,n,s,o,h,m,_,y,v),{u_gamma_scale:s?Math.cos(S._pitch)*S.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+T})},la=(c,t,n,s,o,h,m,_,y,v)=>p.e(oa(c,t,n,s,o,h,m,_,!0,y,!0),{u_texsize_icon:v,u_texture_icon:1}),jl=(c,t,n)=>({u_matrix:c,u_opacity:t,u_color:n}),$l=(c,t,n,s,o,h)=>p.e(function(m,_,y,v){const T=y.imageManager.getPattern(m.from.toString()),S=y.imageManager.getPattern(m.to.toString()),{width:E,height:V}=y.imageManager.getPixelSize(),O=Math.pow(2,v.tileID.overscaledZ),j=v.tileSize*Math.pow(2,y.transform.tileZoom)/O,R=j*(v.tileID.canonical.x+v.tileID.wrap*O),W=j*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:S.tl,u_pattern_br_b:S.br,u_texsize:[E,V],u_mix:_.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:S.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/Ze(v,1,y.transform.tileZoom),u_pixel_coord_upper:[R>>16,W>>16],u_pixel_coord_lower:[65535&R,65535&W]}}(s,h,n,o),{u_matrix:c,u_opacity:t}),Uo={fillExtrusion:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_lightpos:new p.aK(c,t.u_lightpos),u_lightintensity:new p.aH(c,t.u_lightintensity),u_lightcolor:new p.aK(c,t.u_lightcolor),u_vertical_gradient:new p.aH(c,t.u_vertical_gradient),u_opacity:new p.aH(c,t.u_opacity)}),fillExtrusionPattern:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_lightpos:new p.aK(c,t.u_lightpos),u_lightintensity:new p.aH(c,t.u_lightintensity),u_lightcolor:new p.aK(c,t.u_lightcolor),u_vertical_gradient:new p.aH(c,t.u_vertical_gradient),u_height_factor:new p.aH(c,t.u_height_factor),u_image:new p.aG(c,t.u_image),u_texsize:new p.aL(c,t.u_texsize),u_pixel_coord_upper:new p.aL(c,t.u_pixel_coord_upper),u_pixel_coord_lower:new p.aL(c,t.u_pixel_coord_lower),u_scale:new p.aK(c,t.u_scale),u_fade:new p.aH(c,t.u_fade),u_opacity:new p.aH(c,t.u_opacity)}),fill:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix)}),fillPattern:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_image:new p.aG(c,t.u_image),u_texsize:new p.aL(c,t.u_texsize),u_pixel_coord_upper:new p.aL(c,t.u_pixel_coord_upper),u_pixel_coord_lower:new p.aL(c,t.u_pixel_coord_lower),u_scale:new p.aK(c,t.u_scale),u_fade:new p.aH(c,t.u_fade)}),fillOutline:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_world:new p.aL(c,t.u_world)}),fillOutlinePattern:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_world:new p.aL(c,t.u_world),u_image:new p.aG(c,t.u_image),u_texsize:new p.aL(c,t.u_texsize),u_pixel_coord_upper:new p.aL(c,t.u_pixel_coord_upper),u_pixel_coord_lower:new p.aL(c,t.u_pixel_coord_lower),u_scale:new p.aK(c,t.u_scale),u_fade:new p.aH(c,t.u_fade)}),circle:(c,t)=>({u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_scale_with_map:new p.aG(c,t.u_scale_with_map),u_pitch_with_map:new p.aG(c,t.u_pitch_with_map),u_extrude_scale:new p.aL(c,t.u_extrude_scale),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_matrix:new p.aI(c,t.u_matrix)}),collisionBox:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_pixels_to_tile_units:new p.aH(c,t.u_pixels_to_tile_units),u_extrude_scale:new p.aL(c,t.u_extrude_scale),u_overscale_factor:new p.aH(c,t.u_overscale_factor)}),collisionCircle:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_inv_matrix:new p.aI(c,t.u_inv_matrix),u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_viewport_size:new p.aL(c,t.u_viewport_size)}),debug:(c,t)=>({u_color:new p.aM(c,t.u_color),u_matrix:new p.aI(c,t.u_matrix),u_overlay:new p.aG(c,t.u_overlay),u_overlay_scale:new p.aH(c,t.u_overlay_scale)}),clippingMask:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix)}),heatmap:(c,t)=>({u_extrude_scale:new p.aH(c,t.u_extrude_scale),u_intensity:new p.aH(c,t.u_intensity),u_matrix:new p.aI(c,t.u_matrix)}),heatmapTexture:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_world:new p.aL(c,t.u_world),u_image:new p.aG(c,t.u_image),u_color_ramp:new p.aG(c,t.u_color_ramp),u_opacity:new p.aH(c,t.u_opacity)}),hillshade:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_image:new p.aG(c,t.u_image),u_latrange:new p.aL(c,t.u_latrange),u_light:new p.aL(c,t.u_light),u_shadow:new p.aM(c,t.u_shadow),u_highlight:new p.aM(c,t.u_highlight),u_accent:new p.aM(c,t.u_accent)}),hillshadePrepare:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_image:new p.aG(c,t.u_image),u_dimension:new p.aL(c,t.u_dimension),u_zoom:new p.aH(c,t.u_zoom),u_unpack:new p.aJ(c,t.u_unpack)}),line:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_ratio:new p.aH(c,t.u_ratio),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_units_to_pixels:new p.aL(c,t.u_units_to_pixels)}),lineGradient:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_ratio:new p.aH(c,t.u_ratio),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_units_to_pixels:new p.aL(c,t.u_units_to_pixels),u_image:new p.aG(c,t.u_image),u_image_height:new p.aH(c,t.u_image_height)}),linePattern:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_texsize:new p.aL(c,t.u_texsize),u_ratio:new p.aH(c,t.u_ratio),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_image:new p.aG(c,t.u_image),u_units_to_pixels:new p.aL(c,t.u_units_to_pixels),u_scale:new p.aK(c,t.u_scale),u_fade:new p.aH(c,t.u_fade)}),lineSDF:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_ratio:new p.aH(c,t.u_ratio),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_units_to_pixels:new p.aL(c,t.u_units_to_pixels),u_patternscale_a:new p.aL(c,t.u_patternscale_a),u_patternscale_b:new p.aL(c,t.u_patternscale_b),u_sdfgamma:new p.aH(c,t.u_sdfgamma),u_image:new p.aG(c,t.u_image),u_tex_y_a:new p.aH(c,t.u_tex_y_a),u_tex_y_b:new p.aH(c,t.u_tex_y_b),u_mix:new p.aH(c,t.u_mix)}),raster:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_tl_parent:new p.aL(c,t.u_tl_parent),u_scale_parent:new p.aH(c,t.u_scale_parent),u_buffer_scale:new p.aH(c,t.u_buffer_scale),u_fade_t:new p.aH(c,t.u_fade_t),u_opacity:new p.aH(c,t.u_opacity),u_image0:new p.aG(c,t.u_image0),u_image1:new p.aG(c,t.u_image1),u_brightness_low:new p.aH(c,t.u_brightness_low),u_brightness_high:new p.aH(c,t.u_brightness_high),u_saturation_factor:new p.aH(c,t.u_saturation_factor),u_contrast_factor:new p.aH(c,t.u_contrast_factor),u_spin_weights:new p.aK(c,t.u_spin_weights)}),symbolIcon:(c,t)=>({u_is_size_zoom_constant:new p.aG(c,t.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aG(c,t.u_is_size_feature_constant),u_size_t:new p.aH(c,t.u_size_t),u_size:new p.aH(c,t.u_size),u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_pitch:new p.aH(c,t.u_pitch),u_rotate_symbol:new p.aG(c,t.u_rotate_symbol),u_aspect_ratio:new p.aH(c,t.u_aspect_ratio),u_fade_change:new p.aH(c,t.u_fade_change),u_matrix:new p.aI(c,t.u_matrix),u_label_plane_matrix:new p.aI(c,t.u_label_plane_matrix),u_coord_matrix:new p.aI(c,t.u_coord_matrix),u_is_text:new p.aG(c,t.u_is_text),u_pitch_with_map:new p.aG(c,t.u_pitch_with_map),u_texsize:new p.aL(c,t.u_texsize),u_texture:new p.aG(c,t.u_texture)}),symbolSDF:(c,t)=>({u_is_size_zoom_constant:new p.aG(c,t.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aG(c,t.u_is_size_feature_constant),u_size_t:new p.aH(c,t.u_size_t),u_size:new p.aH(c,t.u_size),u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_pitch:new p.aH(c,t.u_pitch),u_rotate_symbol:new p.aG(c,t.u_rotate_symbol),u_aspect_ratio:new p.aH(c,t.u_aspect_ratio),u_fade_change:new p.aH(c,t.u_fade_change),u_matrix:new p.aI(c,t.u_matrix),u_label_plane_matrix:new p.aI(c,t.u_label_plane_matrix),u_coord_matrix:new p.aI(c,t.u_coord_matrix),u_is_text:new p.aG(c,t.u_is_text),u_pitch_with_map:new p.aG(c,t.u_pitch_with_map),u_texsize:new p.aL(c,t.u_texsize),u_texture:new p.aG(c,t.u_texture),u_gamma_scale:new p.aH(c,t.u_gamma_scale),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_is_halo:new p.aG(c,t.u_is_halo)}),symbolTextAndIcon:(c,t)=>({u_is_size_zoom_constant:new p.aG(c,t.u_is_size_zoom_constant),u_is_size_feature_constant:new p.aG(c,t.u_is_size_feature_constant),u_size_t:new p.aH(c,t.u_size_t),u_size:new p.aH(c,t.u_size),u_camera_to_center_distance:new p.aH(c,t.u_camera_to_center_distance),u_pitch:new p.aH(c,t.u_pitch),u_rotate_symbol:new p.aG(c,t.u_rotate_symbol),u_aspect_ratio:new p.aH(c,t.u_aspect_ratio),u_fade_change:new p.aH(c,t.u_fade_change),u_matrix:new p.aI(c,t.u_matrix),u_label_plane_matrix:new p.aI(c,t.u_label_plane_matrix),u_coord_matrix:new p.aI(c,t.u_coord_matrix),u_is_text:new p.aG(c,t.u_is_text),u_pitch_with_map:new p.aG(c,t.u_pitch_with_map),u_texsize:new p.aL(c,t.u_texsize),u_texsize_icon:new p.aL(c,t.u_texsize_icon),u_texture:new p.aG(c,t.u_texture),u_texture_icon:new p.aG(c,t.u_texture_icon),u_gamma_scale:new p.aH(c,t.u_gamma_scale),u_device_pixel_ratio:new p.aH(c,t.u_device_pixel_ratio),u_is_halo:new p.aG(c,t.u_is_halo)}),background:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_opacity:new p.aH(c,t.u_opacity),u_color:new p.aM(c,t.u_color)}),backgroundPattern:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_opacity:new p.aH(c,t.u_opacity),u_image:new p.aG(c,t.u_image),u_pattern_tl_a:new p.aL(c,t.u_pattern_tl_a),u_pattern_br_a:new p.aL(c,t.u_pattern_br_a),u_pattern_tl_b:new p.aL(c,t.u_pattern_tl_b),u_pattern_br_b:new p.aL(c,t.u_pattern_br_b),u_texsize:new p.aL(c,t.u_texsize),u_mix:new p.aH(c,t.u_mix),u_pattern_size_a:new p.aL(c,t.u_pattern_size_a),u_pattern_size_b:new p.aL(c,t.u_pattern_size_b),u_scale_a:new p.aH(c,t.u_scale_a),u_scale_b:new p.aH(c,t.u_scale_b),u_pixel_coord_upper:new p.aL(c,t.u_pixel_coord_upper),u_pixel_coord_lower:new p.aL(c,t.u_pixel_coord_lower),u_tile_units_to_pixels:new p.aH(c,t.u_tile_units_to_pixels)}),terrain:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_texture:new p.aG(c,t.u_texture),u_ele_delta:new p.aH(c,t.u_ele_delta)}),terrainDepth:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_ele_delta:new p.aH(c,t.u_ele_delta)}),terrainCoords:(c,t)=>({u_matrix:new p.aI(c,t.u_matrix),u_texture:new p.aG(c,t.u_texture),u_terrain_coords_id:new p.aH(c,t.u_terrain_coords_id),u_ele_delta:new p.aH(c,t.u_ele_delta)})};class ql{constructor(t,n,s){this.context=t;const o=t.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.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(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const pn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Fa{constructor(t,n,s,o){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=o,this.context=t;const h=t.gl;this.buffer=h.createBuffer(),t.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let s=0;s0){const ve=p.F(),Te=le;p.aP(ve,se.placementInvProjMatrix,c.transform.glCoordMatrix),p.aP(ve,ve,se.placementViewportMatrix),T.push({circleArray:_e,circleOffset:E,transform:Te,invTransform:ve,coord:J}),S+=_e.length/4,E=S}ge&&v.draw(_,y.LINES,at.disabled,gt.disabled,c.colorModeForRenderPass(),_t.disabled,Ro(le,c.transform,ae),c.style.map.terrain&&c.style.map.terrain.getTerrainData(J),n.id,ge.layoutVertexBuffer,ge.indexBuffer,ge.segments,null,c.transform.zoom,null,null,ge.collisionVertexBuffer)}if(!m||!T.length)return;const V=c.useProgram("collisionCircle"),O=new p.aQ;O.resize(4*S),O._trim();let j=0;for(const $ of T)for(let J=0;J<$.circleArray.length/4;J++){const ae=4*J,se=$.circleArray[ae+0],le=$.circleArray[ae+1],ge=$.circleArray[ae+2],_e=$.circleArray[ae+3];O.emplace(j++,se,le,ge,_e,0),O.emplace(j++,se,le,ge,_e,1),O.emplace(j++,se,le,ge,_e,2),O.emplace(j++,se,le,ge,_e,3)}(!mn||mn.length<2*S)&&(mn=function($){const J=2*$,ae=new p.aS;ae.resize(J),ae._trim();for(let se=0;se=0&&(O[R.associatedIconIndex]={shiftedAnchor:We,angle:Se})}else pe(R.numGlyphs,E)}if(v){V.clear();const j=c.icon.placedSymbolArray;for(let R=0;Rc.style.map.terrain.getElevation(ge,sr,Ht):null,zt=n.layout.get("text-rotation-alignment")==="map";z(ve,ge.posMatrix,c,o,Ki,Mr,R,v,zt,Gt)}const tn=c.translatePosMatrix(ge.posMatrix,_e,h,m),Pr=W||o&&se||wa?Vs:Ki,Zt=c.translatePosMatrix(Mr,_e,h,m,!0),At=Se&&n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Tt;Tt=Se?ve.iconsInText?la($e.kind,qe,ne,R,c,tn,Pr,Zt,et,Jt):oa($e.kind,qe,ne,R,c,tn,Pr,Zt,o,et,!0):sa($e.kind,qe,ne,R,c,tn,Pr,Zt,o,et);const ar={program:st,buffers:Te,uniformValues:Tt,atlasTexture:Dt,atlasTextureIcon:kt,atlasInterpolation:dt,atlasInterpolationIcon:Xi,isSDF:Se,hasHalo:At};if($&&ve.canOverlap){J=!0;const Gt=Te.segments.get();for(const zt of Gt)le.push({segments:new p.$([zt]),sortKey:zt.sortKey,state:ar,terrainData:Je})}else le.push({segments:Te.segments,sortKey:0,state:ar,terrainData:Je})}J&&le.sort((ge,_e)=>ge.sortKey-_e.sortKey);for(const ge of le){const _e=ge.state;if(E.activeTexture.set(V.TEXTURE0),_e.atlasTexture.bind(_e.atlasInterpolation,V.CLAMP_TO_EDGE),_e.atlasTextureIcon&&(E.activeTexture.set(V.TEXTURE1),_e.atlasTextureIcon&&_e.atlasTextureIcon.bind(_e.atlasInterpolationIcon,V.CLAMP_TO_EDGE)),_e.isSDF){const ve=_e.uniformValues;_e.hasHalo&&(ve.u_is_halo=1,Xo(_e.buffers,ge.segments,n,c,_e.program,ae,T,S,ve,ge.terrainData)),ve.u_is_halo=0}Xo(_e.buffers,ge.segments,n,c,_e.program,ae,T,S,_e.uniformValues,ge.terrainData)}}function Xo(c,t,n,s,o,h,m,_,y,v){const T=s.context;o.draw(T,T.gl.TRIANGLES,h,m,_,_t.disabled,y,v,n.id,c.layoutVertexBuffer,c.indexBuffer,t,n.paint,s.transform.zoom,c.programConfigurations.get(n.id),c.dynamicLayoutVertexBuffer,c.opacityVertexBuffer)}function Wa(c,t,n,s,o){if(!n||!s||!s.imageAtlas)return;const h=s.imageAtlas.patternPositions;let m=h[n.to.toString()],_=h[n.from.toString()];if(!m&&_&&(m=_),!_&&m&&(_=m),!m||!_){const y=o.getPaintProperty(t);m=h[y],_=h[y]}m&&_&&c.setConstantPatternPositions(m,_)}function Ko(c,t,n,s,o,h,m){const _=c.context.gl,y="fill-pattern",v=n.paint.get(y),T=v&&v.constantOr(1),S=n.getCrossfadeParameters();let E,V,O,j,R;m?(V=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",E=_.LINES):(V=T?"fillPattern":"fill",E=_.TRIANGLES);const W=v.constantOr(null);for(const ne of s){const $=t.getTile(ne);if(T&&!$.patternsLoaded())continue;const J=$.getBucket(n);if(!J)continue;const ae=J.programConfigurations.get(n.id),se=c.useProgram(V,ae),le=c.style.map.terrain&&c.style.map.terrain.getTerrainData(ne);T&&(c.context.activeTexture.set(_.TEXTURE0),$.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),ae.updatePaintBuffers(S)),Wa(ae,y,W,$,n);const ge=le?ne:null,_e=c.translatePosMatrix(ge?ge.posMatrix:ne.posMatrix,$,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(m){j=J.indexBuffer2,R=J.segments2;const ve=[_.drawingBufferWidth,_.drawingBufferHeight];O=V==="fillOutlinePattern"&&T?Lo(_e,c,S,$,ve):Ul(_e,ve)}else j=J.indexBuffer,R=J.segments,O=T?Pa(_e,c,S,$):Do(_e);se.draw(c.context,E,o,c.stencilModeForClipping(ne),h,_t.disabled,O,le,n.id,J.layoutVertexBuffer,j,R,n.paint,c.transform.zoom,ae)}}function Xa(c,t,n,s,o,h,m){const _=c.context,y=_.gl,v="fill-extrusion-pattern",T=n.paint.get(v),S=T.constantOr(1),E=n.getCrossfadeParameters(),V=n.paint.get("fill-extrusion-opacity"),O=T.constantOr(null);for(const j of s){const R=t.getTile(j),W=R.getBucket(n);if(!W)continue;const ne=c.style.map.terrain&&c.style.map.terrain.getTerrainData(j),$=W.programConfigurations.get(n.id),J=c.useProgram(S?"fillExtrusionPattern":"fillExtrusion",$);S&&(c.context.activeTexture.set(y.TEXTURE0),R.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),$.updatePaintBuffers(E)),Wa($,v,O,R,n);const ae=c.translatePosMatrix(j.posMatrix,R,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),se=n.paint.get("fill-extrusion-vertical-gradient"),le=S?Vl(ae,c,se,V,j,E,R):ra(ae,c,se,V);J.draw(_,_.gl.TRIANGLES,o,h,m,_t.backCCW,le,ne,n.id,W.layoutVertexBuffer,W.indexBuffer,W.segments,n.paint,c.transform.zoom,$,c.style.map.terrain&&W.centroidVertexBuffer)}}function Ka(c,t,n,s,o,h,m){const _=c.context,y=_.gl,v=n.fbo;if(!v)return;const T=c.useProgram("hillshade"),S=c.style.map.terrain&&c.style.map.terrain.getTerrainData(t);_.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),T.draw(_,y.TRIANGLES,o,h,m,_t.disabled,((E,V,O,j)=>{const R=O.paint.get("hillshade-shadow-color"),W=O.paint.get("hillshade-highlight-color"),ne=O.paint.get("hillshade-accent-color");let $=O.paint.get("hillshade-illumination-direction")*(Math.PI/180);O.paint.get("hillshade-illumination-anchor")==="viewport"&&($-=E.transform.angle);const J=!E.options.moving;return{u_matrix:j?j.posMatrix:E.transform.calculatePosMatrix(V.tileID.toUnwrapped(),J),u_image:0,u_latrange:Oo(0,V.tileID),u_light:[O.paint.get("hillshade-exaggeration"),$],u_shadow:R,u_highlight:W,u_accent:ne}})(c,n,s,S?t:null),S,s.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments)}function Us(c,t,n,s,o,h){const m=c.context,_=m.gl,y=t.dem;if(y&&y.data){const v=y.dim,T=y.stride,S=y.getPixels();if(m.activeTexture.set(_.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||c.getTileTexture(T),t.demTexture){const V=t.demTexture;V.update(S,{premultiply:!1}),V.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else t.demTexture=new ct(m,S,_.RGBA,{premultiply:!1}),t.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);m.activeTexture.set(_.TEXTURE0);let E=t.fbo;if(!E){const V=new ct(m,{width:v,height:v,data:null},_.RGBA);V.bind(_.LINEAR,_.CLAMP_TO_EDGE),E=t.fbo=m.createFramebuffer(v,v,!0,!1),E.colorAttachment.set(V.texture)}m.bindFramebuffer.set(E.framebuffer),m.viewport.set([0,0,v,v]),c.useProgram("hillshadePrepare").draw(m,_.TRIANGLES,s,o,h,_t.disabled,((V,O)=>{const j=O.stride,R=p.F();return p.aN(R,0,p.W,-p.W,0,0,1),p.H(R,R,[0,-p.W,0]),{u_matrix:R,u_image:1,u_dimension:[j,j],u_zoom:V.overscaledZ,u_unpack:O.getUnpackVector()}})(t.tileID,y),null,n.id,c.rasterBoundsBuffer,c.quadTriangleIndexBuffer,c.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Yo(c,t,n,s,o,h){const m=s.paint.get("raster-fade-duration");if(!h&&m>0){const _=ce.now(),y=(_-c.timeAdded)/m,v=t?(_-t.timeAdded)/m:-1,T=n.getSource(),S=o.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),E=!t||Math.abs(t.tileID.overscaledZ-S)>Math.abs(c.tileID.overscaledZ-S),V=E&&c.refreshedUponExpiration?1:p.ac(E?y:1-v,0,1);return c.refreshedUponExpiration&&y>=1&&(c.refreshedUponExpiration=!1),t?{opacity:1,mix:1-V}:{opacity:V,mix:0}}return{opacity:1,mix:0}}const Jo=new p.aO(1,0,0,1),Ya=new p.aO(0,1,0,1),Ns=new p.aO(0,0,1,1),Ql=new p.aO(1,0,1,1),Qo=new p.aO(0,1,1,1);function Mt(c,t,n,s){Ti(c,0,t+n/2,c.transform.width,n,s)}function Kr(c,t,n,s){Ti(c,t-n/2,0,n,c.transform.height,s)}function Ti(c,t,n,s,o,h){const m=c.context,_=m.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*c.pixelRatio,n*c.pixelRatio,s*c.pixelRatio,o*c.pixelRatio),m.clear({color:h}),_.disable(_.SCISSOR_TEST)}function js(c,t,n){const s=c.context,o=s.gl,h=n.posMatrix,m=c.useProgram("debug"),_=at.disabled,y=gt.disabled,v=c.colorModeForRenderPass(),T="$debug",S=c.style.map.terrain&&c.style.map.terrain.getTerrainData(n);s.activeTexture.set(o.TEXTURE0);const E=t.getTileByID(n.key).latestRawTileData,V=Math.floor((E&&E.byteLength||0)/1024),O=t.getTile(n).tileSize,j=512/Math.min(O,512)*(n.overscaledZ/c.transform.zoom)*.5;let R=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(R+=` => ${n.overscaledZ}`),function(W,ne){W.initDebugOverlayCanvas();const $=W.debugOverlayCanvas,J=W.context.gl,ae=W.debugOverlayCanvas.getContext("2d");ae.clearRect(0,0,$.width,$.height),ae.shadowColor="white",ae.shadowBlur=2,ae.lineWidth=1.5,ae.strokeStyle="white",ae.textBaseline="top",ae.font="bold 36px Open Sans, sans-serif",ae.fillText(ne,5,5),ae.strokeText(ne,5,5),W.debugOverlayTexture.update($),W.debugOverlayTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE)}(c,`${R} ${V}kB`),m.draw(s,o.TRIANGLES,_,y,Ft.alphaBlended,_t.disabled,Bo(h,p.aO.transparent,j),null,T,c.debugBuffer,c.quadTriangleIndexBuffer,c.debugSegments),m.draw(s,o.LINE_STRIP,_,y,v,_t.disabled,Bo(h,p.aO.red),S,T,c.debugBuffer,c.tileBorderIndexBuffer,c.debugSegments)}function Ja(c,t,n){const s=c.context,o=s.gl,h=c.colorModeForRenderPass(),m=new at(o.LEQUAL,at.ReadWrite,c.depthRangeFor3D),_=c.useProgram("terrain"),y=t.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,c.width,c.height]);for(const v of n){const T=c.renderToTexture.getTexture(v),S=t.getTerrainData(v.tileID);s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,T.texture);const E={u_matrix:c.transform.calculatePosMatrix(v.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(c.transform.zoom)};_.draw(s,o.TRIANGLES,m,gt.disabled,h,_t.backCCW,E,S,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class el{constructor(t,n){this.context=new Jl(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:p.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=fi.maxUnderzooming+fi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Wr}resize(t,n,s){if(this.width=Math.floor(t*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 t=this.context,n=new p.aV;n.emplaceBack(0,0),n.emplaceBack(p.W,0),n.emplaceBack(0,p.W),n.emplaceBack(p.W,p.W),this.tileExtentBuffer=t.createVertexBuffer(n,Ca.members),this.tileExtentSegments=p.$.simpleSegment(0,0,4,2);const s=new p.aV;s.emplaceBack(0,0),s.emplaceBack(p.W,0),s.emplaceBack(0,p.W),s.emplaceBack(p.W,p.W),this.debugBuffer=t.createVertexBuffer(s,Ca.members),this.debugSegments=p.$.simpleSegment(0,0,4,5);const o=new p.Z;o.emplaceBack(0,0,0,0),o.emplaceBack(p.W,0,p.W,0),o.emplaceBack(0,p.W,0,p.W),o.emplaceBack(p.W,p.W,p.W,p.W),this.rasterBoundsBuffer=t.createVertexBuffer(o,it.members),this.rasterBoundsSegments=p.$.simpleSegment(0,0,4,2);const h=new p.aV;h.emplaceBack(0,0),h.emplaceBack(1,0),h.emplaceBack(0,1),h.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(h,Ca.members),this.viewportSegments=p.$.simpleSegment(0,0,4,2);const m=new p.aW;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(m);const _=new p.aX;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(_);const y=this.context.gl;this.stencilClearMode=new gt({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=p.F();p.aN(s,0,this.width,this.height,0,0,1),p.J(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,at.disabled,this.stencilClearMode,Ft.disabled,_t.disabled,Da(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const s=this.context,o=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Ft.disabled),s.setDepthMode(at.disabled);const h=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of n){const _=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);h.draw(s,o.TRIANGLES,at.disabled,new gt({func:o.ALWAYS,mask:0},_,255,o.KEEP,o.KEEP,o.REPLACE),Ft.disabled,_t.disabled,Da(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new gt({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new gt({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,s=t.sort((m,_)=>_.overscaledZ-m.overscaledZ),o=s[s.length-1].overscaledZ,h=s[0].overscaledZ-o+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const m={};for(let _=0;_=0;this.currentLayer--){const y=this.style._layers[s[this.currentLayer]],v=o[y.source],T=h[y.source];this._renderTileClippingMasks(y,T),this.renderLayer(this,v,y,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerR.source&&!R.isHidden(T)?[v.sourceCaches[R.source]]:[]),V=E.filter(R=>R.getSource().type==="vector"),O=E.filter(R=>R.getSource().type!=="vector"),j=R=>{(!S||S.getSource().maxzoomj(R)),S||O.forEach(R=>j(R)),S}(this.style,this.transform.zoom);y&&function(v,T,S){for(let E=0;E0),o&&(p.a_(n,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(h,m){const _=h.context,y=_.gl,v=Ft.unblended,T=new at(y.LEQUAL,at.ReadWrite,[0,1]),S=m.getTerrainMesh(),E=m.sourceCache.getRenderableTiles(),V=h.useProgram("terrainDepth");_.bindFramebuffer.set(m.getFramebuffer("depth").framebuffer),_.viewport.set([0,0,h.width/devicePixelRatio,h.height/devicePixelRatio]),_.clear({color:p.aO.transparent,depth:1});for(const O of E){const j=m.getTerrainData(O.tileID),R={u_matrix:h.transform.calculatePosMatrix(O.tileID.toUnwrapped()),u_ele_delta:m.getMeshFrameDelta(h.transform.zoom)};V.draw(_,y.TRIANGLES,T,gt.disabled,v,_t.backCCW,R,j,"terrain",S.vertexBuffer,S.indexBuffer,S.segments)}_.bindFramebuffer.set(null),_.viewport.set([0,0,h.width,h.height])}(this,this.style.map.terrain),function(h,m){const _=h.context,y=_.gl,v=Ft.unblended,T=new at(y.LEQUAL,at.ReadWrite,[0,1]),S=m.getTerrainMesh(),E=m.getCoordsTexture(),V=m.sourceCache.getRenderableTiles(),O=h.useProgram("terrainCoords");_.bindFramebuffer.set(m.getFramebuffer("coords").framebuffer),_.viewport.set([0,0,h.width/devicePixelRatio,h.height/devicePixelRatio]),_.clear({color:p.aO.transparent,depth:1}),m.coordsIndex=[];for(const j of V){const R=m.getTerrainData(j.tileID);_.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,E.texture);const W={u_matrix:h.transform.calculatePosMatrix(j.tileID.toUnwrapped()),u_terrain_coords_id:(255-m.coordsIndex.length)/255,u_texture:0,u_ele_delta:m.getMeshFrameDelta(h.transform.zoom)};O.draw(_,y.TRIANGLES,T,gt.disabled,v,_t.backCCW,W,R,"terrain",S.vertexBuffer,S.indexBuffer,S.segments),m.coordsIndex.push(j.tileID.key)}_.bindFramebuffer.set(null),_.viewport.set([0,0,h.width,h.height])}(this,this.style.map.terrain))}renderLayer(t,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(h,m,_,y,v){if(h.renderPass!=="translucent")return;const T=gt.disabled,S=h.colorModeForRenderPass();(_._unevaluatedLayout.hasValue("text-variable-anchor")||_._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(E,V,O,j,R,W,ne){const $=V.transform,J=R==="map",ae=W==="map";for(const se of E){const le=j.getTile(se),ge=le.getBucket(O);if(!ge||!ge.text||!ge.text.segments.get().length)continue;const _e=p.ag(ge.textSizeData,$.zoom),ve=Ze(le,1,V.transform.zoom),Te=Ge(se.posMatrix,ae,J,V.transform,ve),We=O.layout.get("icon-text-fit")!=="none"&&ge.hasIconData();if(_e){const Se=Math.pow(2,$.zoom-le.tileID.overscaledZ);Za(ge,J,ae,ne,$,Te,se.posMatrix,Se,_e,We,V.style.map.terrain?($e,Xe)=>V.style.map.terrain.getElevation(se,$e,Xe):null)}}}(y,h,_,m,_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),v),_.paint.get("icon-opacity").constantOr(1)!==0&&Ha(h,m,_,y,!1,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),_.layout.get("icon-rotation-alignment"),_.layout.get("icon-pitch-alignment"),_.layout.get("icon-keep-upright"),T,S),_.paint.get("text-opacity").constantOr(1)!==0&&Ha(h,m,_,y,!0,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.layout.get("text-keep-upright"),T,S),m.map.showCollisionBoxes&&(qa(h,m,_,y,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),!0),qa(h,m,_,y,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),!1))})(t,n,s,o,this.style.placement.variableOffsets);break;case"circle":(function(h,m,_,y){if(h.renderPass!=="translucent")return;const v=_.paint.get("circle-opacity"),T=_.paint.get("circle-stroke-width"),S=_.paint.get("circle-stroke-opacity"),E=!_.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(T.constantOr(1)===0||S.constantOr(1)===0))return;const V=h.context,O=V.gl,j=h.depthModeForSublayer(0,at.ReadOnly),R=gt.disabled,W=h.colorModeForRenderPass(),ne=[];for(let $=0;$$.sortKey-J.sortKey);for(const $ of ne){const{programConfiguration:J,program:ae,layoutVertexBuffer:se,indexBuffer:le,uniformValues:ge,terrainData:_e}=$.state;ae.draw(V,O.TRIANGLES,j,R,W,_t.disabled,ge,_e,_.id,se,le,$.segments,_.paint,h.transform.zoom,J)}})(t,n,s,o);break;case"heatmap":(function(h,m,_,y){if(_.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){const v=h.context,T=v.gl,S=gt.disabled,E=new Ft([T.ONE,T.ONE],p.aO.transparent,[!0,!0,!0,!0]);(function(V,O,j){const R=V.gl;V.activeTexture.set(R.TEXTURE1),V.viewport.set([0,0,O.width/4,O.height/4]);let W=j.heatmapFbo;if(W)R.bindTexture(R.TEXTURE_2D,W.colorAttachment.get()),V.bindFramebuffer.set(W.framebuffer);else{const ne=R.createTexture();R.bindTexture(R.TEXTURE_2D,ne),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MAG_FILTER,R.LINEAR),W=j.heatmapFbo=V.createFramebuffer(O.width/4,O.height/4,!1,!1),function($,J,ae,se){var le,ge;const _e=$.gl,ve=(le=$.HALF_FLOAT)!==null&&le!==void 0?le:_e.UNSIGNED_BYTE,Te=(ge=$.RGBA16F)!==null&&ge!==void 0?ge:_e.RGBA;_e.texImage2D(_e.TEXTURE_2D,0,Te,J.width/4,J.height/4,0,_e.RGBA,ve,null),se.colorAttachment.set(ae)}(V,O,ne,W)}})(v,h,_),v.clear({color:p.aO.transparent});for(let V=0;V{const $=p.F();p.aN($,0,j.width,j.height,0,0,1);const J=j.context.gl;return{u_matrix:$,u_world:[J.drawingBufferWidth,J.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:R.paint.get("heatmap-opacity")}})(v,T),null,T.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,T.paint,v.transform.zoom)}(h,_))})(t,n,s,o);break;case"line":(function(h,m,_,y){if(h.renderPass!=="translucent")return;const v=_.paint.get("line-opacity"),T=_.paint.get("line-width");if(v.constantOr(1)===0||T.constantOr(1)===0)return;const S=h.depthModeForSublayer(0,at.ReadOnly),E=h.colorModeForRenderPass(),V=_.paint.get("line-dasharray"),O=_.paint.get("line-pattern"),j=O.constantOr(1),R=_.paint.get("line-gradient"),W=_.getCrossfadeParameters(),ne=j?"linePattern":V?"lineSDF":R?"lineGradient":"line",$=h.context,J=$.gl;let ae=!0;for(const se of y){const le=m.getTile(se);if(j&&!le.patternsLoaded())continue;const ge=le.getBucket(_);if(!ge)continue;const _e=ge.programConfigurations.get(_.id),ve=h.context.program.get(),Te=h.useProgram(ne,_e),We=ae||Te.program!==ve,Se=h.style.map.terrain&&h.style.map.terrain.getTerrainData(se),$e=O.constantOr(null);if($e&&le.imageAtlas){const qe=le.imageAtlas,Je=qe.patternPositions[$e.to.toString()],et=qe.patternPositions[$e.from.toString()];Je&&et&&_e.setConstantPatternPositions(Je,et)}const Xe=Se?se:null,st=j?dn(h,le,_,W,Xe):V?Ra(h,le,_,V,W,Xe):R?Vo(h,le,_,ge.lineClipsArray.length,Xe):La(h,le,_,Xe);if(j)$.activeTexture.set(J.TEXTURE0),le.imageAtlasTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE),_e.updatePaintBuffers(W);else if(V&&(We||h.lineAtlas.dirty))$.activeTexture.set(J.TEXTURE0),h.lineAtlas.bind($);else if(R){const qe=ge.gradients[_.id];let Je=qe.texture;if(_.gradientVersion!==qe.version){let et=256;if(_.stepInterpolant){const Dt=m.getSource().maxzoom,dt=se.canonical.z===Dt?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!n||!s}useProgram(t,n){this.cache=this.cache||{};const s=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new Xr(this.context,ia[t],n,Uo[t],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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ct(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class Yr{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,s){const o=Math.pow(2,s),h=[[-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(_=>{const y=1/(_=p.af([],_,t))[3]/n*o;return p.a$(_,_,[y,y,1/_[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(_=>{const y=function(E,V){var O=V[0],j=V[1],R=V[2],W=O*O+j*j+R*R;return W>0&&(W=1/Math.sqrt(W)),E[0]=V[0]*W,E[1]=V[1]*W,E[2]=V[2]*W,E}([],function(E,V,O){var j=V[0],R=V[1],W=V[2],ne=O[0],$=O[1],J=O[2];return E[0]=R*J-W*$,E[1]=W*ne-j*J,E[2]=j*$-R*ne,E}([],cr([],h[_[0]],h[_[1]]),cr([],h[_[2]],h[_[1]]))),v=-((T=y)[0]*(S=h[_[1]])[0]+T[1]*S[1]+T[2]*S[2]);var T,S;return y.concat(v)});return new Yr(h,m)}}class Jr{constructor(t,n){this.min=t,this.max=n,this.center=function(s,o,h){return s[0]=.5*o[0],s[1]=.5*o[1],s[2]=.5*o[2],s}([],function(s,o,h){return s[0]=o[0]+h[0],s[1]=o[1]+h[1],s[2]=o[2]+h[2],s}([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],s=lr(this.min),o=lr(this.max);for(let h=0;h=0&&m++;if(m===0)return 0;m!==n.length&&(s=!1)}if(s)return 2;for(let o=0;o<3;o++){let h=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let _=0;_this.max[o]-this.min[o])return 0}return 1}}class Vn{constructor(t=0,n=0,s=0,o=0){if(isNaN(t)||t<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=t,this.bottom=n,this.left=s,this.right=o}interpolate(t,n,s){return n.top!=null&&t.top!=null&&(this.top=p.z.number(t.top,n.top,s)),n.bottom!=null&&t.bottom!=null&&(this.bottom=p.z.number(t.bottom,n.bottom,s)),n.left!=null&&t.left!=null&&(this.left=p.z.number(t.left,n.left,s)),n.right!=null&&t.right!=null&&(this.right=p.z.number(t.right,n.right,s)),this}getCenter(t,n){const s=p.ac((this.left+t-this.right)/2,0,t),o=p.ac((this.top+n-this.bottom)/2,0,n);return new p.P(s,o)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Vn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const $s=85.051129;class Qa{constructor(t,n,s,o,h){this.tileSize=512,this._renderWorldCopies=h===void 0||!!h,this._minZoom=t||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.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Vn,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new Qa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}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(t){const n=-p.b1(t,-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,h){var m=o[0],_=o[1],y=o[2],v=o[3],T=Math.sin(h),S=Math.cos(h);s[0]=m*S+y*T,s[1]=_*S+v*T,s[2]=m*-T+y*S,s[3]=_*-T+v*S}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=p.ac(t,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(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,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(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,s){this._unmodified=!1,this._edgeInsets.interpolate(t,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new p.b2(0,t)];if(this._renderWorldCopies){const s=this.pointCoordinate(new p.P(0,0)),o=this.pointCoordinate(new p.P(this.width,0)),h=this.pointCoordinate(new p.P(this.width,this.height)),m=this.pointCoordinate(new p.P(0,this.height)),_=Math.floor(Math.min(s.x,o.x,h.x,m.x)),y=Math.floor(Math.max(s.x,o.x,h.x,m.x)),v=1;for(let T=_-v;T<=y+v;T++)T!==0&&n.push(new p.b2(T,t))}return n}coveringTiles(t){var n,s;let o=this.coveringZoomLevel(t);const h=o;if(t.minzoom!==void 0&&ot.maxzoom&&(o=t.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),_=p.Y.fromLngLat(this.center),y=Math.pow(2,o),v=[y*m.x,y*m.y,0],T=[y*_.x,y*_.y,0],S=Yr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o);let E=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(E=o);const V=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,O=$=>({aabb:new Jr([$*y,0,0],[($+1)*y,y,0]),zoom:0,x:0,y:0,wrap:$,fullyVisible:!1}),j=[],R=[],W=o,ne=t.reparseOverscaled?h:o;if(this._renderWorldCopies)for(let $=1;$<=3;$++)j.push(O(-$)),j.push(O($));for(j.push(O(0));j.length>0;){const $=j.pop(),J=$.x,ae=$.y;let se=$.fullyVisible;if(!se){const Te=$.aabb.intersects(S);if(Te===0)continue;se=Te===2}const le=t.terrain?v:T,ge=$.aabb.distanceX(le),_e=$.aabb.distanceY(le),ve=Math.max(Math.abs(ge),Math.abs(_e));if($.zoom===W||ve>V+(1<=E){const Te=W-$.zoom,We=v[0]-.5-(J<>1),$e=$.zoom+1;let Xe=$.aabb.quadrant(Te);if(t.terrain){const st=new p.Q($e,$.wrap,$e,We,Se),qe=t.terrain.getMinMaxElevation(st),Je=(n=qe.minElevation)!==null&&n!==void 0?n:this.elevation,et=(s=qe.maxElevation)!==null&&s!==void 0?s:this.elevation;Xe=new Jr([Xe.min[0],Xe.min[1],Je],[Xe.max[0],Xe.max[1],et])}j.push({aabb:Xe,zoom:$e,x:We,y:Se,wrap:$.wrap,fullyVisible:se})}}return R.sort(($,J)=>$.distanceSq-J.distanceSq).map($=>$.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const n=p.ac(t.lat,-85.051129,$s);return new p.P(p.N(t.lng)*this.worldSize,p.O(n)*this.worldSize)}unproject(t){return new p.Y(t.x/this.worldSize,t.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(t){const n=this.elevation,s=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,t),h=t.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-h))return;const m=s+n-h,_=Math.cos(this._pitch)*this.cameraToCenterDistance/m/p.b3(1,o.lat),y=this.scaleZoom(_/this.tileSize);this._elevation=h,this._center=o,this.zoom=y}setLocationAtPoint(t,n){const s=this.pointCoordinate(n),o=this.pointCoordinate(this.centerPoint),h=this.locationCoordinate(t),m=new p.Y(h.x-(s.x-o.x),h.y-(s.y-o.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return p.Y.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const E=n.pointCoordinate(t);if(E!=null)return E}const s=[t.x,t.y,0,1],o=[t.x,t.y,1,1];p.af(s,s,this.pixelMatrixInverse),p.af(o,o,this.pixelMatrixInverse);const h=s[3],m=o[3],_=s[1]/h,y=o[1]/m,v=s[2]/h,T=o[2]/m,S=v===T?0:(0-v)/(T-v);return new p.Y(p.z.number(s[0]/h,o[0]/m,S)/this.worldSize,p.z.number(_,y,S)/this.worldSize)}coordinatePoint(t,n=0,s=this.pixelMatrix){const o=[t.x*this.worldSize,t.y*this.worldSize,n,1];return p.af(o,o,s),new p.P(o[0]/o[3],o[1]/o[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new Nt().extend(this.pointLocation(new p.P(0,t))).extend(this.pointLocation(new p.P(this.width,t))).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 Nt([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(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,$s])}calculatePosMatrix(t,n=!1){const s=t.key,o=n?this._alignedPosMatrixCache:this._posMatrixCache;if(o[s])return o[s];const h=t.canonical,m=this.worldSize/this.zoomScale(h.z),_=h.x+Math.pow(2,h.z)*t.wrap,y=p.an(new Float64Array(16));return p.H(y,y,[_*m,h.y*m,0]),p.J(y,y,[m/p.W,m/p.W,1]),p.K(y,n?this.alignedProjMatrix:this.projMatrix,y),o[s]=new Float32Array(y),o[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,n){n=p.ac(+n,this.minZoom,this.maxZoom);const s={center:new p.M(t.lng,t.lat),zoom:n};let o=this.lngRange;if(!this._renderWorldCopies&&o===null){const $=179.9999999999;o=[-$,$]}const h=this.tileSize*this.zoomScale(s.zoom);let m=0,_=h,y=0,v=h,T=0,S=0;const{x:E,y:V}=this.size;if(this.latRange){const $=this.latRange;m=p.O($[1])*h,_=p.O($[0])*h,_-m_&&(W=_-$)}if(o){const $=(y+v)/2;let J=O;this._renderWorldCopies&&(J=p.b1(O,$-h/2,$+h/2));const ae=E/2;J-aev&&(R=v-ae)}if(R!==void 0||W!==void 0){const $=new p.P(R??O,W??j);s.center=this.unproject.call({worldSize:h},$).wrap()}return s}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:n,zoom:s}=this.getConstrained(this.center,this.zoom);this.center=n,this.zoom=s,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=p.b3(1,this.center.lat)*this.worldSize;let o=p.an(new Float64Array(16));p.J(o,o,[this.width/2,-this.height/2,1]),p.H(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=p.an(new Float64Array(16)),p.J(o,o,[1,-1,1]),p.H(o,o,[-1,-1,0]),p.J(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;const h=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this.minElevationForCurrentTile),_=h-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?_:h,v=Math.PI/2+this._pitch,T=this._fov*(.5+t.y/this.height),S=Math.sin(T)*y/Math.sin(p.ac(Math.PI-v-T,.01,Math.PI-.01)),E=this.getHorizon(),V=2*Math.atan(E/this.cameraToCenterDistance)*(.5+t.y/(2*E)),O=Math.sin(V)*y/Math.sin(p.ac(Math.PI-v-V,.01,Math.PI-.01)),j=Math.min(S,O),R=1.01*(Math.cos(Math.PI/2-this._pitch)*j+y),W=this.height/50;o=new Float64Array(16),p.b4(o,this._fov,this.width/this.height,W,R),o[8]=2*-t.x/this.width,o[9]=2*t.y/this.height,p.J(o,o,[1,-1,1]),p.H(o,o,[0,0,-this.cameraToCenterDistance]),p.b5(o,o,this._pitch),p.ad(o,o,this.angle),p.H(o,o,[-n,-s,0]),this.mercatorMatrix=p.J([],o,[this.worldSize,this.worldSize,this.worldSize]),p.J(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=p.K(new Float64Array(16),this.labelPlaneMatrix,o),p.H(o,o,[0,0,-this.elevation]),this.projMatrix=o,this.invProjMatrix=p.ar([],o),this.pixelMatrix3D=p.K(new Float64Array(16),this.labelPlaneMatrix,o);const ne=this.width%2/2,$=this.height%2/2,J=Math.cos(this.angle),ae=Math.sin(this.angle),se=n-Math.round(n)+J*ne+ae*$,le=s-Math.round(s)+J*$+ae*ne,ge=new Float64Array(o);if(p.H(ge,ge,[se>.5?se-1:se,le>.5?le-1:le,0]),this.alignedProjMatrix=ge,o=p.ar(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new p.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return p.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new p.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let s=n.x,o=n.y,h=n.x,m=n.y;for(const _ of t)s=Math.min(s,_.x),o=Math.min(o,_.y),h=Math.max(h,_.x),m=Math.max(m,_.y);return[new p.P(s,o),new p.P(h,o),new p.P(h,m),new p.P(s,m),new p.P(s,o)]}}lngLatToCameraDepth(t,n){const s=this.locationCoordinate(t),o=[s.x*this.worldSize,s.y*this.worldSize,n,1];return p.af(o,o,this.projMatrix),o[2]/o[3]}}function qs(c,t){let n,s=!1,o=null,h=null;const m=()=>{o=null,s&&(c.apply(h,n),o=setTimeout(m,t),s=!1)};return(..._)=>(s=!0,h=this,n=_,o||m(),o)}class Zs{constructor(t){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());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=qs(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){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),h=Math.pow(10,o),m=Math.round(n.lng*h)/h,_=Math.round(n.lat*h)/h,y=this._map.getBearing(),v=this._map.getPitch();let T="";if(T+=t?`/${m}/${_}/${s}`:`${s}/${_}/${m}`,(y||v)&&(T+="/"+Math.round(10*y)/10),v&&(T+=`/${Math.round(v)}`),this._hashName){const S=this._hashName;let E=!1;const V=window.location.hash.slice(1).split("&").map(O=>{const j=O.split("=")[0];return j===S?(E=!0,`${j}=${T}`):O}).filter(O=>O);return E||V.push(`${S}=${T}`),`#${V.join("&")}`}return`#${T}`}}const ha={linearity:.3,easing:p.b6(0,0,.3,1)},_n=p.e({deceleration:2500,maxSpeed:1400},ha),tl=p.e({deceleration:20,maxSpeed:1400},ha),il=p.e({deceleration:1e3,maxSpeed:360},ha),rl=p.e({deceleration:1e3,maxSpeed:90},ha);class nl{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:ce.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=ce.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new p.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)n.zoom+=h.zoomDelta||0,n.bearing+=h.bearingDelta||0,n.pitch+=h.pitchDelta||0,h.panDelta&&n.pan._add(h.panDelta),h.around&&(n.around=h.around),h.pinchAround&&(n.pinchAround=h.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){const h=da(n.pan.mag(),s,p.e({},_n,t||{}));o.offset=n.pan.mult(h.amount/n.pan.mag()),o.center=this._map.transform.center,ua(o,h)}if(n.zoom){const h=da(n.zoom,s,tl);o.zoom=this._map.transform.zoom+h.amount,ua(o,h)}if(n.bearing){const h=da(n.bearing,s,il);o.bearing=this._map.transform.bearing+p.ac(h.amount,-179,179),ua(o,h)}if(n.pitch){const h=da(n.pitch,s,rl);o.pitch=this._map.transform.pitch+h.amount,ua(o,h)}if(o.zoom||o.bearing){const h=n.pinchAround===void 0?n.around:n.pinchAround;o.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),p.e(o,{noMoveStart:!0})}}function ua(c,t){(!c.duration||c.durationn.unproject(y)),_=h.reduce((y,v,T,S)=>y.add(v.div(S.length)),new p.P(0,0));super(t,{points:h,point:_,lngLats:m,lngLat:n.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class Gs extends p.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class pr{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Gs(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ri(t.type,this._map,t))}mouseup(t){this._map.fire(new Ri(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ri(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ri(t.type,this._map,t))}mouseover(t){this._map.fire(new Ri(t.type,this._map,t))}mouseout(t){this._map.fire(new Ri(t.type,this._map,t))}touchstart(t){return this._firePreventable(new zr(t.type,this._map,t))}touchmove(t){this._map.fire(new zr(t.type,this._map,t))}touchend(t){this._map.fire(new zr(t.type,this._map,t))}touchcancel(t){this._map.fire(new zr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Cr{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ri(t.type,this._map,t))}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(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ri(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(p.P.convert(t),this._map.terrain)}}class fr{constructor(t,n){this._map=t,this._tr=new Un(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(re.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)h.fitScreenCoordinates(s,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(re.remove(this._box),this._box=null),re.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new p.k(t,{originalEvent:n}))}}function gn(c,t){if(c.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${c.length}, points ${t.length}`);const n={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=function(o){const h=new p.P(0,0);for(const m of o)h._add(m);return h.div(o.length)}(n),this.touches=gn(s,n)))}touchmove(t,n,s){if(this.aborted||!this.centroid)return;const o=gn(s,n);for(const h in this.touches){const m=o[h];(!m||m.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(t,n,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class Hs{constructor(t){this.singleTap=new ec(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,s){this.singleTap.touchstart(t,n,s)}touchmove(t,n,s){this.singleTap.touchmove(t,n,s)}touchend(t,n,s){const o=this.singleTap.touchend(t,n,s);if(o){const h=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(o)<30;if(h&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class tc{constructor(t){this._tr=new Un(t),this._zoomIn=new Hs({numTouches:1,numTaps:2}),this._zoomOut=new Hs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,s){this._zoomIn.touchstart(t,n,s),this._zoomOut.touchstart(t,n,s)}touchmove(t,n,s){this._zoomIn.touchmove(t,n,s),this._zoomOut.touchmove(t,n,s)}touchend(t,n,s){const o=this._zoomIn.touchend(t,n,s),h=this._zoomOut.touchend(t,n,s),m=this._tr;return o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(o)},{originalEvent:t})}):h?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(h)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Nn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const o=n.length?n[0]:n;return!this._moved&&o.dist(s){c.mousedown=c.dragStart,c.mousemoveWindow=c.dragMove,c.mouseup=c.dragEnd,c.contextmenu=function(t){t.preventDefault()}},jn=({enable:c,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const s=new Er({checkCorrectEvent:o=>re.mouseButton(o)===0&&o.ctrlKey||re.mouseButton(o)===2});return new Nn({clickTolerance:t,move:(o,h)=>({bearingDelta:(h.x-o.x)*n}),moveStateManager:s,enable:c,assignEvents:es})},$n=({enable:c,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new Er({checkCorrectEvent:o=>re.mouseButton(o)===0&&o.ctrlKey||re.mouseButton(o)===2});return new Nn({clickTolerance:t,move:(o,h)=>({pitchDelta:(h.y-o.y)*n}),moveStateManager:s,enable:c,assignEvents:es})};class al{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new p.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(t,n,s){return this._calculateTransform(t,n,s)}touchmove(t,n,s){if(this._active&&!(s.length0&&(this._active=!0);const o=gn(s,n),h=new p.P(0,0),m=new p.P(0,0);let _=0;for(const v in o){const T=o[v],S=this._touches[v];S&&(h._add(T),m._add(T.sub(S)),_++,o[v]=T)}if(this._touches=o,_Math.abs(c.x)}class ll extends ze{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,s){super.touchstart(t,n,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,is(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const o=t[0].sub(this._lastPoints[0]),h=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,h,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,s){if(this._valid!==void 0)return this._valid;const o=t.mag()>=2,h=n.mag()>=2;if(!o&&!h)return;if(!o||!h)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const m=t.y>0==n.y>0;return is(t)&&is(n)&&m}}const ic={panStep:100,bearingStep:15,pitchStep:10};class Qr{constructor(t){this._tr=new Un(t);const n=ic;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,s=0,o=0,h=0,m=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),h=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),h=1);break;case 38:t.shiftKey?o=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?o=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(s=0,o=0),{cameraAnimation:_=>{const y=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:wt,zoom:n?Math.round(y.zoom)+n*(t.shiftKey?2:1):y.zoom,bearing:y.bearing+s*this._bearingStep,pitch:y.pitch+o*this._pitchStep,offset:[-h*this._panStep,-m*this._panStep],center:y.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function wt(c){return c*(2-c)}const fa=4.000244140625;class rs{constructor(t,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new Un(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!t[this._map.cooperativeGestures._bypassKey])return;let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const s=ce.now(),o=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%fa==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,t)):this._type||(this._type=Math.abs(o*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=re.mousePos(this._map.getCanvas(),t),s=this._tr;this._around=n.y>s.transform.height/2-s.transform.getHorizon()?p.M.convert(this._aroundCenter?s.center:s.unproject(n)):p.M.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 t=this._tr.transform;if(this._delta!==0){const _=this._type==="wheel"&&Math.abs(this._delta)>fa?this._wheelZoomRate:this._defaultZoomRate;let y=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&y!==0&&(y=1/y);const v=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(v*y))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,s=this._startZoom,o=this._easing;let h,m=!1;if(this._type==="wheel"&&s&&o){const _=Math.min((ce.now()-this._lastWheelEventTime)/200,1),y=o(_);h=p.z.number(s,n,y),_<1?this._frameId||(this._frameId=!0):m=!0}else h=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:h-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=p.b7;if(this._prevEase){const s=this._prevEase,o=(ce.now()-s.start)/s.duration,h=s.easing(o+.01)-s.easing(o),m=.27/Math.sqrt(h*h+1e-4)*.01,_=Math.sqrt(.0729-m*m);n=p.b6(m,_,.25,1)}return this._prevEase={start:ce.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Xs{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class cl{constructor(t){this._tr=new Un(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hl{constructor(){this._tap=new Hs({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,s){if(!this._swipePoint)if(this._tapTime){const o=n[0],h=t.timeStamp-this._tapTime<500,m=this._tapPoint.dist(o)<30;h&&m?s.length>0&&(this._swipePoint=o,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,n,s)}touchmove(t,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const o=n[0],h=o.y-this._swipePoint.y;return this._swipePoint=o,t.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(t,n,s)}touchend(t,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const o=this._tap.touchend(t,n,s);o&&(this._tapTime=t.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 ul{constructor(t,n,s){this._el=t,this._mousePan=n,this._touchPan=s}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class mr{constructor(t,n,s){this._pitchWithRotate=t.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 ma{constructor(t,n,s,o){this._el=t,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Be{constructor(t,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=re.create("div","maplibregl-cooperative-gesture-screen",t);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 h=document.createElement("div");h.className="maplibregl-mobile-message",h.textContent=s,this._container.appendChild(h),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(re.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._destoryUI()}isEnabled(){return this._enabled}touchmove(t){this._onCooperativeGesture(t.touches.length===1)}wheel(t){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!t[this._bypassKey])}_onCooperativeGesture(t){this._enabled&&t&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ne=c=>c.zoom||c.drag||c.pitch||c.rotate;class ns extends p.k{}function _a(c){return c.panDelta&&c.panDelta.mag()||c.zoomDelta||c.bearingDelta||c.pitchDelta}class Ks{constructor(t,n){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,h)=>{if(o.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=o.type==="renderFrame"?void 0:o,_={needsRenderFrame:!1},y={},v={},T=o.touches,S=T?this._getMapTouches(T):void 0,E=S?re.touchPos(this._map.getCanvas(),S):re.mousePos(this._map.getCanvas(),o);for(const{handlerName:j,handler:R,allowed:W}of this._handlers){if(!R.isEnabled())continue;let ne;this._blockedByActive(v,W,j)?R.reset():R[h||o.type]&&(ne=R[h||o.type](o,E,S),this.mergeHandlerResult(_,y,ne,j,m),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()),(ne||R.isActive())&&(v[j]=R)}const V={};for(const j in this._previousActiveHandlers)v[j]||(V[j]=m);this._previousActiveHandlers=v,(Object.keys(V).length||_a(_))&&(this._changes.push([_,y,V]),this._triggerRenderFrame()),(Object.keys(v).length||_a(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=_;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nl(t),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,h,m]of this._listeners)re.addEventListener(o,h,o===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[t,n,s]of this._listeners)re.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new pr(n,t));const o=n.boxZoom=new fr(n,t);this._add("boxZoom",o),t.interactive&&t.boxZoom&&o.enable();const h=n.cooperativeGestures=new Be(n,t.cooperativeGestures);this._add("cooperativeGestures",h),t.cooperativeGestures&&h.enable();const m=new tc(n),_=new cl(n);n.doubleClickZoom=new Xs(_,m),this._add("tapZoom",m),this._add("clickZoom",_),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const y=new hl;this._add("tapDragZoom",y);const v=n.touchPitch=new ll(n);this._add("touchPitch",v),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const T=jn(t),S=$n(t);n.dragRotate=new mr(t,T,S),this._add("mouseRotate",T,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const E=(({enable:ne,clickTolerance:$})=>{const J=new Er({checkCorrectEvent:ae=>re.mouseButton(ae)===0&&!ae.ctrlKey});return new Nn({clickTolerance:$,move:(ae,se)=>({around:se,panDelta:se.sub(ae)}),activateOnStart:!0,moveStateManager:J,enable:ne,assignEvents:es})})(t),V=new al(t,n);n.dragPan=new ul(s,E,V),this._add("mousePan",E),this._add("touchPan",V,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const O=new Ws,j=new ol;n.touchZoomRotate=new ma(s,j,O,y),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",j,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const R=n.scrollZoom=new rs(n,()=>this._triggerRenderFrame());this._add("scrollZoom",R,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const W=n.keyboard=new Qr(n);this._add("keyboard",W),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new Cr(n))}_add(t,n,s){this._handlers.push({handlerName:t,handler:n,allowed:s}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ne(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,s){for(const o in t)if(o!==s&&(!n||n.indexOf(o)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const s of t)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(t,n,s,o,h){if(!s)return;p.e(t,s);const m={handlerName:o,originalEvent:s.originalEvent||h};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 t={},n={},s={};for(const[o,h,m]of this._changes)o.panDelta&&(t.panDelta=(t.panDelta||new p.P(0,0))._add(o.panDelta)),o.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+o.pitchDelta),o.around!==void 0&&(t.around=o.around),o.pinchAround!==void 0&&(t.pinchAround=o.pinchAround),o.noInertia&&(t.noInertia=o.noInertia),p.e(n,h),p.e(s,m);this._updateMapTransform(t,n,s),this._changes=[]}_updateMapTransform(t,n,s){const o=this._map,h=o._getTransformForUpdate(),m=o.terrain;if(!(_a(t)||m&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:_,zoomDelta:y,bearingDelta:v,pitchDelta:T,around:S,pinchAround:E}=t;E!==void 0&&(S=E),o._stop(!0),S=S||o.transform.centerPoint;const V=h.pointLocation(_?S.sub(_):S);v&&(h.bearing+=v),T&&(h.pitch+=T),y&&(h.zoom+=y),m?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?h.center=h.pointLocation(h.centerPoint.sub(_)):h.setLocationAtPoint(V,S):(this._terrainMovement=!0,this._map._elevationFreeze=!0,h.setLocationAtPoint(V,S),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,h.recalculateZoom(o.terrain)})):h.setLocationAtPoint(V,S),o._applyUpdatedTransform(h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,s,!0)}_fireEvents(t,n,s){const o=Ne(this._eventsInProgress),h=Ne(t),m={};for(const T in t){const{originalEvent:S}=t[T];this._eventsInProgress[T]||(m[`${T}start`]=S),this._eventsInProgress[T]=t[T]}!o&&h&&this._fireEvent("movestart",h.originalEvent);for(const T in m)this._fireEvent(T,m[T]);h&&this._fireEvent("move",h.originalEvent);for(const T in t){const{originalEvent:S}=t[T];this._fireEvent(T,S)}const _={};let y;for(const T in this._eventsInProgress){const{handlerName:S,originalEvent:E}=this._eventsInProgress[T];this._handlersById[S].isActive()||(delete this._eventsInProgress[T],y=n[S]||E,_[`${T}end`]=y)}for(const T in _)this._fireEvent(T,_[T]);const v=Ne(this._eventsInProgress);if(s&&(o||h)&&!v){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),S=E=>E!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ns("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Bi extends p.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const s=Math.min((ce.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=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new p.M(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,s){return t=p.P.convert(t).mult(-1),this.panTo(this.transform.center,p.e({offset:t},n),s)}panTo(t,n,s){return this.easeTo(p.e({center:t},n),s)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,s){return this.easeTo(p.e({zoom:t},n),s)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,s){return this.easeTo(p.e({bearing:t},n),s)}resetNorth(t,n){return this.rotateTo(0,p.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(p.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=p.z.number(h,R,le)),this._rotating&&(o.bearing=p.z.number(m,v,le)),this._pitching&&(o.pitch=p.z.number(_,T,le)),this._padding&&(o.interpolatePadding(y,S,le),V=o.centerPoint.add(E)),this.terrain&&!t.freezeElevation&&this._updateElevation(le),J)o.setLocationAtPoint(J,ae);else{const ge=o.zoomScale(o.zoom-h),_e=R>h?Math.min(2,$):Math.max(.5,$),ve=Math.pow(_e,1-le),Te=o.unproject(W.add(ne.mult(le*ve)).mult(ge));o.setLocationAtPoint(o.renderWorldCopies?Te.wrap():Te,V)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},le=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,le)},t),this}_prepareEase(t,n,s={}){this._moving=!0,n||s.moving||this.fire(new p.k("movestart",t)),this._zooming&&!s.zooming&&this.fire(new p.k("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new p.k("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new p.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(n-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=p.z.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:s,zoom:o,pitch:h,bearing:m,elevation:_}=this.transformCameraUpdate(n);s&&(n.center=s),o!==void 0&&(n.zoom=o),h!==void 0&&(n.pitch=h),m!==void 0&&(n.bearing=m),_!==void 0&&(n.elevation=_),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new p.k("move",t)),this._zooming&&this.fire(new p.k("zoom",t)),this._rotating&&this.fire(new p.k("rotate",t)),this._pitching&&this.fire(new p.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,o=this._rotating,h=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new p.k("zoomend",t)),o&&this.fire(new p.k("rotateend",t)),h&&this.fire(new p.k("pitchend",t)),this.fire(new p.k("moveend",t))}flyTo(t,n){var s;if(!t.essential&&ce.prefersReducedMotion){const st=p.L(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(st,n)}this.stop(),t=p.e({offset:[0,0],speed:1.2,curve:1.42,easing:p.b7},t);const o=this._getTransformForUpdate(),h=this.getZoom(),m=this.getBearing(),_=this.getPitch(),y=this.getPadding(),v="bearing"in t?this._normalizeBearing(t.bearing,m):m,T="pitch"in t?+t.pitch:_,S="padding"in t?t.padding:o.padding,E=p.P.convert(t.offset);let V=o.centerPoint.add(E);const O=o.pointLocation(V),{center:j,zoom:R}=o.getConstrained(p.M.convert(t.center||O),(s=t.zoom)!==null&&s!==void 0?s:h);this._normalizeCenter(j);const W=o.zoomScale(R-h),ne=o.project(O),$=o.project(j).sub(ne);let J=t.curve;const ae=Math.max(o.width,o.height),se=ae/W,le=$.mag();if("minZoom"in t){const st=p.ac(Math.min(t.minZoom,h,R),o.minZoom,o.maxZoom),qe=ae/o.zoomScale(st-h);J=Math.sqrt(qe/le*2)}const ge=J*J;function _e(st){const qe=(se*se-ae*ae+(st?-1:1)*ge*ge*le*le)/(2*(st?se:ae)*ge*le);return Math.log(Math.sqrt(qe*qe+1)-qe)}function ve(st){return(Math.exp(st)-Math.exp(-st))/2}function Te(st){return(Math.exp(st)+Math.exp(-st))/2}const We=_e(!1);let Se=function(st){return Te(We)/Te(We+J*st)},$e=function(st){return ae*((Te(We)*(ve(qe=We+J*st)/Te(qe))-ve(We))/ge)/le;var qe},Xe=(_e(!0)-We)/J;if(Math.abs(le)<1e-6||!isFinite(Xe)){if(Math.abs(ae-se)<1e-6)return this.easeTo(t,n);const st=set.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=m!==v,this._pitching=T!==_,this._padding=!o.isPaddingEqual(S),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(j),this._ease(st=>{const qe=st*Xe,Je=1/Se(qe);o.zoom=st===1?R:h+o.scaleZoom(Je),this._rotating&&(o.bearing=p.z.number(m,v,st)),this._pitching&&(o.pitch=p.z.number(_,T,st)),this._padding&&(o.interpolatePadding(y,S,st),V=o.centerPoint.add(E)),this.terrain&&!t.freezeElevation&&this._updateElevation(st);const et=st===1?j:o.unproject(ne.add($.mult($e(qe))).mult(Je));o.setLocationAtPoint(o.renderWorldCopies?et.wrap():et,V),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const s=this._onEaseEnd;delete this._onEaseEnd,s.call(this,n)}if(!t){const s=this.handlers;s&&s.stop(!1)}return this}_ease(t,n,s){s.animate===!1||s.duration===0?(t(1),n()):(this._easeStart=ce.now(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=p.b1(t,-180,180);const s=Math.abs(t-n);return Math.abs(t-360-n)180?-360:s<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(p.M.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Ys={compact:!0,customAttribution:'MapLibre'};class _r{constructor(t=Ys){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=re.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=re.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=re.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(){re.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const s=this._map._getUIString(`AttributionControl.${n}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(o=>typeof o!="string"?"":o)):typeof this.options.customAttribution=="string"&&t.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 h=n[o];if(h.used||h.usedForTerrain){const m=h.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(o=>String(o).trim()),t.sort((o,h)=>o.length-h.length),t=t.filter((o,h)=>{for(let m=h+1;m=0)return!1;return!0});const s=t.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.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 dl{constructor(t={}){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=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=re.create("div","maplibregl-ctrl");const n=re.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(){re.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ga{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const o of s)if(o.id===t)return void(o.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Pt=p.X([{name:"a_pos3d",type:"Int16",components:3}]);class Ot extends p.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const s={};for(const o of t.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.aN(o.posMatrix,0,p.W,0,p.W,0,1),this._tiles[o.key]=new Sr(o,this.tileSize));for(const o in this._tiles)s[o]||delete this._tiles[o]}freeRtt(t){for(const n in this._tiles){const s=this._tiles[n];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const s of this._renderableTilesKeys){const o=this._tiles[s].tileID;if(o.canonical.equals(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16),p.aN(h.posMatrix,0,p.W,0,p.W,0,1),n[s]=h}else if(o.canonical.isChildOf(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const m=o.canonical.z-t.canonical.z,_=o.canonical.x-(o.canonical.x>>m<>m<>m;p.aN(h.posMatrix,0,v,0,v,0,1),p.H(h.posMatrix,h.posMatrix,[-_*v,-y*v,0]),n[s]=h}else if(t.canonical.isChildOf(o.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const m=t.canonical.z-o.canonical.z,_=t.canonical.x-(t.canonical.x>>m<>m<>m;p.aN(h.posMatrix,0,p.W,0,p.W,0,1),p.H(h.posMatrix,h.posMatrix,[_*v,y*v,0]),p.J(h.posMatrix,h.posMatrix,[1/2**m,1/2**m,0]),n[s]=h}}return n}getSourceTile(t,n){const s=this.sourceCache._source;let o=t.overscaledZ-this.deltaZoom;if(o>s.maxzoom&&(o=s.maxzoom),o=s.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(t.scaledTo(o--).key);return h}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class pl{constructor(t,n,s){this.painter=t,this.sourceCache=new Ot(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(t,n,s,o=p.W){var h;if(!(n>=0&&n=0&&st.canonical.z&&(t.canonical.z>=o?h=t.canonical.z-o:p.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=t.canonical.x-(t.canonical.x>>h<>h<>8<<4|h>>8,n[m+3]=0;const s=new p.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),o=new ct(t,s,t.gl.RGBA,{premultiply:!1});return o.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),s=this.painter.context,o=s.gl,h=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),m=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),_=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(h,_-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),T=this.coordsIndex[255-n[3]],S=T&&this.sourceCache.getTileByID(T);if(!S)return null;const E=this._coordsTextureSize,V=(1<t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const Br={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Js{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new ya(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(s=>!t._layers[s].isHidden(n)),this._coordsDescendingInv={};for(const s in t.sourceCaches){this._coordsDescendingInv[s]={};const o=t.sourceCaches[s].getVisibleCoordinates();for(const h of o){const m=this.terrain.sourceCache.getTerrainCoords(h);for(const _ in m)this._coordsDescendingInv[s][_]||(this._coordsDescendingInv[s][_]=[]),this._coordsDescendingInv[s][_].push(m[_])}}this._coordsDescendingInvStr={};for(const s of t._order){const o=t._layers[s],h=o.source;if(Br[o.type]&&!this._coordsDescendingInvStr[h]){this._coordsDescendingInvStr[h]={};for(const m in this._coordsDescendingInv[h])this._coordsDescendingInvStr[h][m]=this._coordsDescendingInv[h][m].map(_=>_.key).sort().join()}}for(const s of this._renderableTiles)for(const o in this._coordsDescendingInvStr){const h=this._coordsDescendingInvStr[o][s.tileID.key];h&&h!==s.rttCoords[o]&&(s.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,s=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Br[n]&&(this._prevType&&Br[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!o))return!0;if(Br[this._prevType]||Br[n]&&o){this._prevType=n;const h=this._stacks.length-1,m=this._stacks[h]||[];for(const _ of this._renderableTiles){if(this.pool.isFull()&&(Ja(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_),_.rtt[h]){const v=this.pool.getObjectForId(_.rtt[h].id);if(v.stamp===_.rtt[h].stamp){this.pool.useObject(v);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),_.rtt[h]={id:y.id,stamp:y.stamp},s.context.bindFramebuffer.set(y.fbo.framebuffer),s.context.clear({color:p.aO.transparent,stencil:0}),s.currentStencilSource=void 0;for(let v=0;v{c.touchstart=c.dragStart,c.touchmoveWindow=c.dragMove,c.touchend=c.dragEnd},to={showCompass:!0,showZoom:!0,visualizePitch:!1};class io{constructor(t,n,s=!1){this.mousedown=m=>{this.startMouse(p.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),re.mousePos(this.element,m)),re.addEventListener(window,"mousemove",this.mousemove),re.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,re.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=re.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),re.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),re.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=re.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=t.dragRotate._mouseRotate.getClickTolerance(),h=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=jn({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:_,bearingDegreesPerPixelMoved:y=.8})=>{const v=new Me;return new Nn({clickTolerance:_,move:(T,S)=>({bearingDelta:(S.x-T.x)*y}),moveStateManager:v,enable:m,assignEvents:as})})({clickTolerance:o,enable:!0}),this.map=t,s&&(this.mousePitch=$n({clickTolerance:h,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:_,pitchDegreesPerPixelMoved:y=-.5})=>{const v=new Me;return new Nn({clickTolerance:_,move:(T,S)=>({pitchDelta:(S.y-T.y)*y}),moveStateManager:v,enable:m,assignEvents:as})})({clickTolerance:h,enable:!0})),re.addEventListener(n,"mousedown",this.mousedown),re.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),re.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),re.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),re.disableDrag()}moveMouse(t,n){const s=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(t,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.mousePitch){const{pitchDelta:h}=this.mousePitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}moveTouch(t,n){const s=this.map,{bearingDelta:o}=this.touchRotate.dragMove(t,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.touchPitch){const{pitchDelta:h}=this.touchPitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}off(){const t=this.element;re.removeEventListener(t,"mousedown",this.mousedown),re.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),re.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),re.removeEventListener(window,"touchend",this.touchend),re.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){re.enableDrag(),re.removeEventListener(window,"mousemove",this.mousemove),re.removeEventListener(window,"mouseup",this.mouseup),re.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),re.removeEventListener(window,"touchend",this.touchend)}}let Fr;function ss(c,t,n){const s=new p.M(c.lng,c.lat);if(c=new p.M(c.lng,c.lat),t){const o=new p.M(c.lng-360,c.lat),h=new p.M(c.lng+360,c.lat),m=n.locationPoint(c).distSqr(t);n.locationPoint(o).distSqr(t)180;){const o=n.locationPoint(c);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;c.lng>n.center.lng?c.lng-=360:c.lng+=360}return c.lng!==s.lng&&n.locationPoint(c).y>n.height/2-n.getHorizon()?c:s}const va={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 os(c,t,n){const s=c.classList;for(const o in va)s.remove(`maplibregl-${n}-anchor-${o}`);s.add(`maplibregl-${n}-anchor-${t}`)}class ba extends p.E{constructor(t){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?ss(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 h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`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)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),re.setTransform(this._element,`${va[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),ce.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=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(t==null?void 0:t.opacity,t==null?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=p.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=re.create("div"),this._element.setAttribute("aria-label","Map marker");const n=re.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 h=re.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const m=re.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const _=re.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.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 W of y){const ne=re.createNS("http://www.w3.org/2000/svg","ellipse");ne.setAttributeNS(null,"opacity","0.04"),ne.setAttributeNS(null,"cx","10.5"),ne.setAttributeNS(null,"cy","5.80029008"),ne.setAttributeNS(null,"rx",W.rx),ne.setAttributeNS(null,"ry",W.ry),_.appendChild(ne)}const v=re.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);const T=re.createNS("http://www.w3.org/2000/svg","path");T.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(T);const S=re.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");const E=re.createNS("http://www.w3.org/2000/svg","path");E.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"),S.appendChild(E);const V=re.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");const O=re.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(8.0, 8.0)");const j=re.createNS("http://www.w3.org/2000/svg","circle");j.setAttributeNS(null,"fill","#000000"),j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"cx","5.5"),j.setAttributeNS(null,"cy","5.5"),j.setAttributeNS(null,"r","5.4999962");const R=re.createNS("http://www.w3.org/2000/svg","circle");R.setAttributeNS(null,"fill","#FFFFFF"),R.setAttributeNS(null,"cx","5.5"),R.setAttributeNS(null,"cy","5.5"),R.setAttributeNS(null,"r","5.4999962"),O.appendChild(j),O.appendChild(R),m.appendChild(_),m.appendChild(v),m.appendChild(S),m.appendChild(V),m.appendChild(O),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(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),os(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.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("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),re.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=p.M.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const o=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[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=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var n,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(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,h=o.terrain.depthAtPoint(this._pos),m=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,m)-h<.006)return void(this._element.style.opacity=this._opacity);const _=-this._offset.y/o.transform._pixelPerMeter,y=Math.sin(o.getPitch()*Math.PI/180)*_,v=o.terrain.depthAtPoint(new p.P(this._pos.x,this._pos.y-this._offset.y)),T=o.transform.lngLatToCameraDepth(this._lngLat,m+y)-v>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&T&&this._popup.remove(),this._element.style.opacity=T?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=p.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return t===void 0&&n===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const ls={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Zn=0,yn=!1;const cs={maxWidth:100,unit:"metric"};function hs(c,t,n){const s=n&&n.maxWidth||100,o=c._container.clientHeight/2,h=c.unproject([0,o]),m=c.unproject([s,o]),_=h.distanceTo(m);if(n&&n.unit==="imperial"){const y=3.2808*_;y>5280?xn(t,s,y/5280,c._getUIString("ScaleControl.Miles")):xn(t,s,y,c._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?xn(t,s,_/1852,c._getUIString("ScaleControl.NauticalMiles")):_>=1e3?xn(t,s,_/1e3,c._getUIString("ScaleControl.Kilometers")):xn(t,s,_,c._getUIString("ScaleControl.Meters"))}function xn(c,t,n,s){const o=function(h){const m=Math.pow(10,`${Math.floor(h)}`.length-1);let _=h/m;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(y){const v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(_),m*_}(n);c.style.width=t*(o/n)+"px",c.innerHTML=`${o} ${s}`}const ro={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},no=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function us(c){if(c){if(typeof c=="number"){const t=Math.round(Math.abs(c)/Math.SQRT2);return{center:new p.P(0,0),top:new p.P(0,c),"top-left":new p.P(t,t),"top-right":new p.P(-t,t),bottom:new p.P(0,-c),"bottom-left":new p.P(t,-t),"bottom-right":new p.P(-t,-t),left:new p.P(c,0),right:new p.P(-c,0)}}if(c instanceof p.P||Array.isArray(c)){const t=p.P.convert(c);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:p.P.convert(c.center||[0,0]),top:p.P.convert(c.top||[0,0]),"top-left":p.P.convert(c["top-left"]||[0,0]),"top-right":p.P.convert(c["top-right"]||[0,0]),bottom:p.P.convert(c.bottom||[0,0]),"bottom-left":p.P.convert(c["bottom-left"]||[0,0]),"bottom-right":p.P.convert(c["bottom-right"]||[0,0]),left:p.P.convert(c.left||[0,0]),right:p.P.convert(c.right||[0,0])}}return us(new p.P(0,0))}const fl=Oe;A.AJAXError=p.be,A.Evented=p.E,A.LngLat=p.M,A.MercatorCoordinate=p.Y,A.Point=p.P,A.addProtocol=p.bf,A.config=p.a,A.removeProtocol=p.bg,A.AttributionControl=_r,A.BoxZoomHandler=fr,A.CanvasSource=En,A.CooperativeGesturesHandler=Be,A.DoubleClickZoomHandler=Xs,A.DragPanHandler=ul,A.DragRotateHandler=mr,A.EdgeInsets=Vn,A.FullscreenControl=class extends p.E{constructor(c={}){super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((t=n==null?void 0:n.shadowRoot)===null||t===void 0)&&t.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,c&&c.container&&(c.container instanceof HTMLElement?this._container=c.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(c){return this._map=c,this._container||(this._container=this._map.getContainer()),this._controlContainer=re.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){re.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const c=this._fullscreenButton=re.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);re.create("span","maplibregl-ctrl-icon",c).setAttribute("aria-hidden","true"),c.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const c=this._getTitle();this._fullscreenButton.setAttribute("aria-label",c),this._fullscreenButton.title=c}_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()}},A.GeoJSONSource=Jn,A.GeolocateControl=class extends p.E{constructor(c){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new p.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new p.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new p.M(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,o=this._map.getBearing(),h=p.e({bearing:o},this.options.fitBoundsOptions),m=Nt.fromLngLat(n,s);this._map.fitBounds(m,h,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new p.M(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.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=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&yn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new p.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=re.create("button","maplibregl-ctrl-geolocate",this._container),re.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!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.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=re.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ba({element:this._dotElement}),this._circleElement=re.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ba({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.options=p.e({},ls,c)}onAdd(c){return this._map=c,this._container=re.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return p._(this,arguments,void 0,function*(t=!1){if(Fr!==void 0&&!t)return Fr;if(window.navigator.permissions===void 0)return Fr=!!window.navigator.geolocation,Fr;try{Fr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Fr=!!window.navigator.geolocation}return Fr})}().then(t=>this._setupUI(t)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),re.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Zn=0,yn=!1}_isOutOfMapMaxBounds(c){const t=this._map.getMaxBounds(),n=c.coords;return t&&(n.longitudet.getEast()||n.latitudet.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 c=this._map.getBounds(),t=c.getSouthEast(),n=c.getNorthEast(),s=t.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":Zn--,yn=!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"));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 c;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Zn++,Zn>1?(c={maximumAge:6e5,timeout:0},yn=!0):(c=this.options.positionOptions,yn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,c)}}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)}},A.Hash=Zs,A.ImageSource=Xt,A.KeyboardHandler=Qr,A.LngLatBounds=Nt,A.LogoControl=dl,A.Map=class extends Bi{constructor(c){if(p.bc.mark(p.bd.create),(c=p.e({},xa,c)).minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Qa(c.minZoom,c.maxZoom,c.minPitch,c.maxPitch,c.renderWorldCopies),{bearingSnap:c.bearingSnap}),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new p.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new p.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=c.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=c.preserveDrawingBuffer,this._antialias=c.antialias,this._trackResize=c.trackResize,this._bearingSnap=c.bearingSnap,this._refreshExpiredTiles=c.refreshExpiredTiles,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=c.collectResourceTiming,this._renderTaskQueue=new ga,this._controls=[],this._mapId=p.a3(),this._locale=p.e({},Qs,c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this.transformCameraUpdate=c.transformCameraUpdate,this._imageQueueHandle=hi.addThrottleControl(()=>this.isMoving()),this._requestManager=new sn(c.transformRequest),typeof c.container=="string"){if(this._container=document.getElementById(c.container),!this._container)throw new Error(`Container '${c.container}' not found.`)}else{if(!(c.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=c.container}if(c.maxBounds&&this.setMaxBounds(c.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const n=qs(s=>{this._trackResize&&!this._removed&&this.resize(s)._update()},50);this._resizeObserver=new ResizeObserver(s=>{t?n(s):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ks(this,c),this._hash=c.hash&&new Zs(typeof c.hash=="string"&&c.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,p.e({},c.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new _r(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new dl,c.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new p.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new p.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new p.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(c,t){if(t===void 0&&(t=c.getDefaultPosition?c.getDefaultPosition():"top-right"),!c||!c.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=c.onAdd(this);this._controls.push(c);const s=this._controlPositions[t];return t.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(c){if(!c||!c.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 t=this._controls.indexOf(c);return t>-1&&this._controls.splice(t,1),c.onRemove(this),this}hasControl(c){return this._controls.indexOf(c)>-1}calculateCameraOptionsFromTo(c,t,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(c,t,n,s)}resize(c){var t;const n=this._containerDimensions(),s=n[0],o=n[1],h=this._getClampedPixelRatio(s,o);if(this._resizeCanvas(s,o,h),this.painter.resize(s,o,h),this.painter.overLimit()){const _=this.painter.context.gl;this._maxCanvasSize=[_.drawingBufferWidth,_.drawingBufferHeight];const y=this._getClampedPixelRatio(s,o);this._resizeCanvas(s,o,y),this.painter.resize(s,o,y)}this.transform.resize(s,o),(t=this._requestedCameraState)===null||t===void 0||t.resize(s,o);const m=!this._moving;return m&&(this.stop(),this.fire(new p.k("movestart",c)).fire(new p.k("move",c))),this.fire(new p.k("resize",c)),m&&this.fire(new p.k("moveend",c)),this}_getClampedPixelRatio(c,t){const{0:n,1:s}=this._maxCanvasSize,o=this.getPixelRatio(),h=c*o,m=t*o;return Math.min(h>n?n/h:1,m>s?s/m:1)*o}getPixelRatio(){var c;return(c=this._overridePixelRatio)!==null&&c!==void 0?c:devicePixelRatio}setPixelRatio(c){this._overridePixelRatio=c,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(c){return this.transform.setMaxBounds(Nt.convert(c)),this._update()}setMinZoom(c){if((c=c??-2)>=-2&&c<=this.transform.maxZoom)return this.transform.minZoom=c,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=c,this._update(),this.getZoom()>c&&this.setZoom(c),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(c){if((c=c??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(c>=0&&c<=this.transform.maxPitch)return this.transform.minPitch=c,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(c>=this.transform.minPitch)return this.transform.maxPitch=c,this._update(),this.getPitch()>c&&this.setPitch(c),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(c){return this.transform.renderWorldCopies=c,this._update()}project(c){return this.transform.locationPoint(p.M.convert(c),this.style&&this.terrain)}unproject(c){return this.transform.pointLocation(p.P.convert(c),this.terrain)}isMoving(){var c;return this._moving||((c=this.handlers)===null||c===void 0?void 0:c.isMoving())}isZooming(){var c;return this._zooming||((c=this.handlers)===null||c===void 0?void 0:c.isZooming())}isRotating(){var c;return this._rotating||((c=this.handlers)===null||c===void 0?void 0:c.isRotating())}_createDelegatedListener(c,t,n){if(c==="mouseenter"||c==="mouseover"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:h=>{const m=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];m.length?s||(s=!0,n.call(this,new Ri(c,this,h.originalEvent,{features:m}))):s=!1},mouseout:()=>{s=!1}}}}if(c==="mouseleave"||c==="mouseout"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:m=>{(this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,n.call(this,new Ri(c,this,m.originalEvent)))},mouseout:m=>{s&&(s=!1,n.call(this,new Ri(c,this,m.originalEvent)))}}}}{const s=o=>{const h=this.getLayer(t)?this.queryRenderedFeatures(o.point,{layers:[t]}):[];h.length&&(o.features=h,n.call(this,o),delete o.features)};return{layer:t,listener:n,delegates:{[c]:s}}}}on(c,t,n){if(n===void 0)return super.on(c,t);const s=this._createDelegatedListener(c,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[c]=this._delegatedListeners[c]||[],this._delegatedListeners[c].push(s);for(const o in s.delegates)this.on(o,s.delegates[o]);return this}once(c,t,n){if(n===void 0)return super.once(c,t);const s=this._createDelegatedListener(c,t,n);for(const o in s.delegates)this.once(o,s.delegates[o]);return this}off(c,t,n){return n===void 0?super.off(c,t):(this._delegatedListeners&&this._delegatedListeners[c]&&(s=>{const o=this._delegatedListeners[c];for(let h=0;hthis._updateStyle(c,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!c)),c?(this.style=new Hi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof c=="string"?this.style.loadURL(c,t,n):this.style.loadJSON(c,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Hi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(c,t){if(typeof c=="string"){const n=this._requestManager.transformRequest(c,"Style");p.h(n,new AbortController).then(s=>{this._updateDiff(s.data,t)}).catch(s=>{s&&this.fire(new p.j(s))})}else typeof c=="object"&&this._updateDiff(c,t)}_updateDiff(c,t){try{this.style.setState(c,t)&&this._update(!0)}catch(n){p.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(c,t)}}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(c,t){return this._lazyInitEmptyStyle(),this.style.addSource(c,t),this._update(!0)}isSourceLoaded(c){const t=this.style&&this.style.sourceCaches[c];if(t!==void 0)return t.loaded();this.fire(new p.j(new Error(`There is no source with ID '${c}'`)))}setTerrain(c){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),c){const t=this.style.sourceCaches[c.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${c.source}`);this.terrain===null&&t.reload();for(const n in this.style._layers){const s=this.style._layers[n];s.type==="hillshade"&&s.source===c.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 pl(this.painter,t,c),this.painter.renderToTexture=new Js(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!==c.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:c})),this}getTerrain(){var c,t;return(t=(c=this.terrain)===null||c===void 0?void 0:c.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const c=this.style&&this.style.sourceCaches;for(const t in c){const n=c[t]._tiles;for(const s in n){const o=n[s];if(o.state!=="loaded"&&o.state!=="errored")return!1}}return!0}removeSource(c){return this.style.removeSource(c),this._update(!0)}getSource(c){return this.style.getSource(c)}addImage(c,t,n={}){const{pixelRatio:s=1,sdf:o=!1,stretchX:h,stretchY:m,content:_}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||p.b(t))){if(t.width===void 0||t.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:y,height:v,data:T}=t,S=t;return this.style.addImage(c,{data:new p.R({width:y,height:v},new Uint8Array(T)),pixelRatio:s,stretchX:h,stretchY:m,content:_,sdf:o,version:0,userImage:S}),S.onAdd&&S.onAdd(this,c),this}}{const{width:y,height:v,data:T}=ce.getImageData(t);this.style.addImage(c,{data:new p.R({width:y,height:v},T),pixelRatio:s,stretchX:h,stretchY:m,content:_,sdf:o,version:0})}}updateImage(c,t){const n=this.style.getImage(c);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=t instanceof HTMLImageElement||p.b(t)?ce.getImageData(t):t,{width:o,height:h,data:m}=s;if(o===void 0||h===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||h!==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 _=!(t instanceof HTMLImageElement||p.b(t));return n.data.replace(m,_),this.style.updateImage(c,n),this}getImage(c){return this.style.getImage(c)}hasImage(c){return c?!!this.style.getImage(c):(this.fire(new p.j(new Error("Missing required image id"))),!1)}removeImage(c){this.style.removeImage(c)}loadImage(c){return hi.getImage(this._requestManager.transformRequest(c,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(c,t){return this._lazyInitEmptyStyle(),this.style.addLayer(c,t),this._update(!0)}moveLayer(c,t){return this.style.moveLayer(c,t),this._update(!0)}removeLayer(c){return this.style.removeLayer(c),this._update(!0)}getLayer(c){return this.style.getLayer(c)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(c,t,n){return this.style.setLayerZoomRange(c,t,n),this._update(!0)}setFilter(c,t,n={}){return this.style.setFilter(c,t,n),this._update(!0)}getFilter(c){return this.style.getFilter(c)}setPaintProperty(c,t,n,s={}){return this.style.setPaintProperty(c,t,n,s),this._update(!0)}getPaintProperty(c,t){return this.style.getPaintProperty(c,t)}setLayoutProperty(c,t,n,s={}){return this.style.setLayoutProperty(c,t,n,s),this._update(!0)}getLayoutProperty(c,t){return this.style.getLayoutProperty(c,t)}setGlyphs(c,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(c,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(c,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(c,t,n,s=>{s||this._update(!0)}),this}removeSprite(c){return this._lazyInitEmptyStyle(),this.style.removeSprite(c),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(c,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(c,t,n=>{n||this._update(!0)}),this}setLight(c,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(c,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(c,t){return this.style.setFeatureState(c,t),this._update()}removeFeatureState(c,t){return this.style.removeFeatureState(c,t),this._update()}getFeatureState(c){return this.style.getFeatureState(c)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let c=0,t=0;return this._container&&(c=this._container.clientWidth||400,t=this._container.clientHeight||300),[c,t]}_setupContainer(){const c=this._container;c.classList.add("maplibregl-map");const t=this._canvasContainer=re.create("div","maplibregl-canvas-container",c);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=re.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),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=re.create("div","maplibregl-control-container",c),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{h[m]=re.create("div",`maplibregl-ctrl-${m} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(c,t,n){this._canvas.width=Math.floor(n*c),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${c}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const c={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{t={requestedAttributes:c},s&&(t.statusMessage=s.statusMessage,t.type=s.type)},{once:!0});const n=this._canvas.getContext("webgl2",c)||this._canvas.getContext("webgl",c);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new el(n,this.transform),xt.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(c){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||c,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(c){return this._update(),this._renderTaskQueue.add(c)}_cancelRenderFrame(c){this._renderTaskQueue.remove(c)}_render(c){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(c),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const o=this.transform.zoom,h=ce.now();this.style.zoomHistory.update(o,h);const m=new p.a8(o,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=m.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),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,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new p.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,p.bc.mark(p.bd.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.bc.mark(p.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var c;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),hi.removeThrottleControl(this._imageQueueHandle),(c=this._resizeObserver)===null||c===void 0||c.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),re.remove(this._canvasContainer),re.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),p.bc.clearMetrics(),this._removed=!0,this.fire(new p.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,ce.frameAsync(this._frameRequest).then(c=>{p.bc.frame(c),this._frameRequest=null,this._render(c)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(c){this._showTileBoundaries!==c&&(this._showTileBoundaries=c,this._update())}get showPadding(){return!!this._showPadding}set showPadding(c){this._showPadding!==c&&(this._showPadding=c,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(c){this._showCollisionBoxes!==c&&(this._showCollisionBoxes=c,c?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(c){this._showOverdrawInspector!==c&&(this._showOverdrawInspector=c,this._update())}get repaint(){return!!this._repaint}set repaint(c){this._repaint!==c&&(this._repaint=c,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(c){this._vertices=c,this._update()}get version(){return eo}getCameraTargetElevation(){return this.transform.elevation}},A.MapMouseEvent=Ri,A.MapTouchEvent=zr,A.MapWheelEvent=Gs,A.Marker=ba,A.NavigationControl=class{constructor(c){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),s=t===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 t=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=t},this._setButtonTitle=(t,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);t.title=s,t.setAttribute("aria-label",s)},this.options=p.e({},to,c),this._container=re.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),re.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),re.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=re.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(c){return this._map=c,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 io(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){re.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(c,t){const n=re.create("button",c,this._container);return n.type="button",n.addEventListener("click",t),n}},A.Popup=class extends p.E{constructor(c){super(),this.remove=()=>(this._content&&re.remove(this._content),this._container&&(re.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=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=re.create("div","maplibregl-popup",this._map.getContainer()),this._tip=re.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const _ of this.options.className.split(" "))this._container.classList.add(_);this._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?ss(this._lngLat,this._flatPos,this._map.transform):(n=this._lngLat)===null||n===void 0?void 0:n.wrap(),this._trackPointer&&!t)return;const s=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor;const h=us(this.options.offset);if(!o){const _=this._container.offsetWidth,y=this._container.offsetHeight;let v;v=s.y+h.bottom.ythis._map.transform.height-y?["bottom"]:[],s.x<_/2?v.push("left"):s.x>this._map.transform.width-_/2&&v.push("right"),o=v.length===0?"bottom":v.join("-")}let m=s.add(h[o]);this.options.subpixelPositioning||(m=m.round()),re.setTransform(this._container,`${va[o]} translate(${m.x}px,${m.y}px)`),os(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=p.e(Object.create(ro),c)}addTo(c){return this._map&&this.remove(),this._map=c,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(c){return this._lngLat=p.M.convert(c),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(c){return this.setDOMContent(document.createTextNode(c))}setHTML(c){const t=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=c;s=n.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var c;return(c=this._container)===null||c===void 0?void 0:c.style.maxWidth}setMaxWidth(c){return this.options.maxWidth=c,this._update(),this}setDOMContent(c){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=re.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(c),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(c){this._container&&this._container.classList.add(c)}removeClassName(c){this._container&&this._container.classList.remove(c)}setOffset(c){return this.options.offset=c,this._update(),this}toggleClassName(c){if(this._container)return this._container.classList.toggle(c)}setSubpixelPositioning(c){this.options.subpixelPositioning=c}_createCloseButton(){this.options.closeButton&&(this._closeButton=re.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const c=this._container.querySelector(no);c&&c.focus()}},A.RasterDEMTileSource=zn,A.RasterTileSource=he,A.ScaleControl=class{constructor(c){this._onMove=()=>{hs(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,hs(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},cs),c)}getDefaultPosition(){return"bottom-left"}onAdd(c){return this._map=c,this._container=re.create("div","maplibregl-ctrl maplibregl-ctrl-scale",c.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){re.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},A.ScrollZoomHandler=rs,A.Style=Hi,A.TerrainControl=class{constructor(c){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=c}onAdd(c){return this._map=c,this._container=re.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=re.create("button","maplibregl-ctrl-terrain",this._container),re.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(){re.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},A.TwoFingersTouchPitchHandler=ll,A.TwoFingersTouchRotateHandler=Ws,A.TwoFingersTouchZoomHandler=ol,A.TwoFingersTouchZoomRotateHandler=ma,A.VectorTileSource=cn,A.VideoSource=Cn,A.addSourceType=(c,t)=>p._(void 0,void 0,void 0,function*(){if(Pn(c))throw new Error(`A source type called "${c}" already exists.`);((n,s)=>{Mn[n]=s})(c,t)}),A.clearPrewarmedResources=function(){const c=vi;c&&(c.isPreloaded()&&c.numActive()===1?(c.release(Ct),vi=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()"))},A.getMaxParallelImageRequests=function(){return p.a.MAX_PARALLEL_IMAGE_REQUESTS},A.getRTLTextPluginStatus=function(){return be().getRTLTextPluginStatus()},A.getVersion=function(){return fl},A.getWorkerCount=function(){return $i.workerCount},A.getWorkerUrl=function(){return p.a.WORKER_URL},A.importScriptInWorkers=function(c){return Zr().broadcast("IS",c)},A.prewarm=function(){Pi().acquire(Ct)},A.setMaxParallelImageRequests=function(c){p.a.MAX_PARALLEL_IMAGE_REQUESTS=c},A.setRTLTextPlugin=function(c,t){return be().setRTLTextPlugin(c,t)},A.setWorkerCount=function(c){$i.workerCount=c},A.setWorkerUrl=function(c){p.a.WORKER_URL=c}});var ye=H;return ye})})(Au);var Lp=Au.exports;const Mf=Dp(Lp);var ks=Math.pow,zi=(D,L,H)=>new Promise((Q,oe)=>{var ye=Oe=>{try{p(H.next(Oe))}catch(je){oe(je)}},A=Oe=>{try{p(H.throw(Oe))}catch(je){oe(je)}},p=Oe=>Oe.done?Q(Oe.value):Promise.resolve(Oe.value).then(ye,A);p((H=H.apply(D,L)).next())}),wr=Uint8Array,Is=Uint16Array,Rp=Int32Array,Cu=new wr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Eu=new wr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bp=new wr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mu=function(D,L){for(var H=new Is(31),Q=0;Q<31;++Q)H[Q]=L+=1<>1|(mt&21845)<<1,kn=(kn&52428)>>2|(kn&13107)<<2,kn=(kn&61680)>>4|(kn&3855)<<4,Zc[mt]=((kn&65280)>>8|(kn&255)<<8)>>1;var kn,mt,Eo=function(D,L,H){for(var Q=D.length,oe=0,ye=new Is(L);oe>Oe]=je}else for(p=new Is(Q),oe=0;oe>15-D[oe]);return p},Mo=new wr(288);for(mt=0;mt<144;++mt)Mo[mt]=8;var mt;for(mt=144;mt<256;++mt)Mo[mt]=9;var mt;for(mt=256;mt<280;++mt)Mo[mt]=7;var mt;for(mt=280;mt<288;++mt)Mo[mt]=8;var mt,Lu=new wr(32);for(mt=0;mt<32;++mt)Lu[mt]=5;var mt,Up=Eo(Mo,9,1),Np=Eo(Lu,5,1),$c=function(D){for(var L=D[0],H=1;HL&&(L=D[H]);return L},jr=function(D,L,H){var Q=L/8|0;return(D[Q]|D[Q+1]<<8)>>(L&7)&H},qc=function(D,L){var H=L/8|0;return(D[H]|D[H+1]<<8|D[H+2]<<16)>>(L&7)},jp=function(D){return(D+7)/8|0},$p=function(D,L,H){(L==null||L<0)&&(L=0),(H==null||H>D.length)&&(H=D.length);var Q=new wr(H-L);return Q.set(D.subarray(L,H)),Q},qp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],br=function(D,L,H){var Q=new Error(L||qp[D]);if(Q.code=D,Error.captureStackTrace&&Error.captureStackTrace(Q,br),!H)throw Q;return Q},Wc=function(D,L,H,Q){var oe=D.length,ye=Q?Q.length:0;if(!oe||L.f&&!L.l)return H||new wr(0);var A=!H||L.i!=2,p=L.i;H||(H=new wr(oe*3));var Oe=function(Tr){var on=H.length;if(Tr>on){var ir=new wr(Math.max(on*2,Tr));ir.set(H),H=ir}},je=L.f||0,Pe=L.p||0,ce=L.b||0,re=L.l,xt=L.d,Lt=L.m,Rt=L.n,xi=oe*8;do{if(!re){je=jr(D,Pe,1);var Ci=jr(D,Pe+1,3);if(Pe+=3,Ci)if(Ci==1)re=Up,xt=Np,Lt=9,Rt=5;else if(Ci==2){var Ei=jr(D,Pe,31)+257,lr=jr(D,Pe+10,15)+4,ui=Ei+jr(D,Pe+5,31)+1;Pe+=14;for(var cr=new wr(ui),hr=new wr(19),Ut=0;Ut>4;if(vt<16)cr[Ut++]=vt;else{var ur=0,Mi=0;for(vt==16?(Mi=3+jr(D,Pe,3),Pe+=2,ur=cr[Ut-1]):vt==17?(Mi=3+jr(D,Pe,7),Pe+=3):vt==18&&(Mi=11+jr(D,Pe,127),Pe+=7);Mi--;)cr[Ut++]=ur}}var ji=cr.subarray(0,Ei),di=cr.subarray(Ei);Lt=$c(ji),Rt=$c(di),re=Eo(ji,Lt,1),xt=Eo(di,Rt,1)}else br(1);else{var vt=jp(Pe)+4,hi=D[vt-4]|D[vt-3]<<8,sn=vt+hi;if(sn>oe){p&&br(0);break}A&&Oe(ce+hi),H.set(D.subarray(vt,sn),ce),L.b=ce+=hi,L.p=Pe=sn*8,L.f=je;continue}if(Pe>xi){p&&br(0);break}}A&&Oe(ce+131072);for(var Rr=(1<>4;if(Pe+=ur&15,Pe>xi){p&&br(0);break}if(ur||br(2),Ct<256)H[ce++]=Ct;else if(Ct==256){li=Pe,re=null;break}else{var $i=Ct-254;if(Ct>264){var Ut=Ct-257,dr=Cu[Ut];$i=jr(D,Pe,(1<>4;vi||br(3),Pe+=vi&15;var di=Vp[tr];if(tr>3){var dr=Eu[tr];di+=qc(D,Pe)&(1<xi){p&&br(0);break}A&&Oe(ce+131072);var Pi=ce+$i;if(ce>3&1)+(L>>4&1);Q>0;Q-=!D[H++]);return H+(L&2)},Hp=function(D){var L=D.length;return(D[L-4]|D[L-3]<<8|D[L-2]<<16|D[L-1]<<24)>>>0},Wp=function(D,L){return((D[0]&15)!=8||D[0]>>4>7||(D[0]<<8|D[1])%31)&&br(6,"invalid zlib data"),(D[1]>>5&1)==+!L&&br(6,"invalid zlib data: "+(D[1]&32?"need":"unexpected")+" dictionary"),(D[1]>>3&4)+2};function Xp(D,L){return Wc(D,{i:2},L&&L.out,L&&L.dictionary)}function Kp(D,L){var H=Gp(D);return H+8>D.length&&br(6,"invalid gzip data"),Wc(D.subarray(H,-8),{i:2},L&&L.out||new wr(Hp(D)),L&&L.dictionary)}function Yp(D,L){return Wc(D.subarray(Wp(D,L&&L.dictionary),-4),{i:2},L&&L.out,L&&L.dictionary)}function Gc(D,L){return D[0]==31&&D[1]==139&&D[2]==8?Kp(D,L):(D[0]&15)!=8||D[0]>>4>7||(D[0]<<8|D[1])%31?Xp(D,L):Yp(D,L)}var Jp=typeof TextDecoder<"u"&&new TextDecoder,Qp=0;try{Jp.decode(Zp,{stream:!0}),Qp=1}catch{}var Ru=(D,L)=>D*ks(2,L),zo=(D,L)=>Math.floor(D/ks(2,L)),Fl=(D,L)=>Ru(D.getUint16(L+1,!0),8)+D.getUint8(L),Bu=(D,L)=>Ru(D.getUint32(L+2,!0),16)+D.getUint16(L,!0),ef=(D,L,H,Q,oe)=>{if(D!==Q.getUint8(oe))return D-Q.getUint8(oe);const ye=Fl(Q,oe+1);if(L!==ye)return L-ye;const A=Fl(Q,oe+4);return H!==A?H-A:0},tf=(D,L,H,Q)=>{const oe=Fu(D,L|128,H,Q);return oe?{z:L,x:H,y:Q,offset:oe[0],length:oe[1],isDir:!0}:null},Su=(D,L,H,Q)=>{const oe=Fu(D,L,H,Q);return oe?{z:L,x:H,y:Q,offset:oe[0],length:oe[1],isDir:!1}:null},Fu=(D,L,H,Q)=>{let oe=0,ye=D.byteLength/17-1;for(;oe<=ye;){const A=ye+oe>>1,p=ef(L,H,Q,D,A*17);if(p>0)oe=A+1;else if(p<0)ye=A-1;else return[Bu(D,A*17+7),D.getUint32(A*17+13,!0)]}return null},rf=(D,L)=>D.isDir&&!L.isDir?1:!D.isDir&&L.isDir?-1:D.z!==L.z?D.z-L.z:D.x!==L.x?D.x-L.x:D.y-L.y,Ou=(D,L)=>{const H=D.getUint8(L*17);return{z:H&127,x:Fl(D,L*17+1),y:Fl(D,L*17+4),offset:Bu(D,L*17+7),length:D.getUint32(L*17+13,!0),isDir:H>>7===1}},Iu=D=>{const L=[],H=new DataView(D);for(let Q=0;Q{D.sort(rf);const L=new ArrayBuffer(17*D.length),H=new Uint8Array(L);for(let Q=0;Q>8&255,H[Q*17+3]=oe.x>>16&255,H[Q*17+4]=oe.y&255,H[Q*17+5]=oe.y>>8&255,H[Q*17+6]=oe.y>>16&255,H[Q*17+7]=oe.offset&255,H[Q*17+8]=zo(oe.offset,8)&255,H[Q*17+9]=zo(oe.offset,16)&255,H[Q*17+10]=zo(oe.offset,24)&255,H[Q*17+11]=zo(oe.offset,32)&255,H[Q*17+12]=zo(oe.offset,48)&255,H[Q*17+13]=oe.length&255,H[Q*17+14]=oe.length>>8&255,H[Q*17+15]=oe.length>>16&255,H[Q*17+16]=oe.length>>24&255}return L},af=(D,L)=>{if(D.byteLength<17)return null;const H=D.byteLength/17,Q=Ou(D,H-1);if(Q.isDir){const oe=Q.z,ye=L.z-oe,A=Math.trunc(L.x/(1<(L,H)=>{if(H instanceof AbortController)return D(L,H);const Q=new AbortController;return D(L,Q).then(oe=>H(void 0,oe.data,oe.cacheControl||"",oe.expires||""),oe=>H(oe)).catch(oe=>H(oe)),{cancel:()=>Q.abort()}},Pf=class{constructor(){this.tilev4=(D,L)=>zi(this,null,function*(){if(D.type==="json"){const ce=D.url.substr(10);let re=this.tiles.get(ce);re||(re=new ku(ce),this.tiles.set(ce,re));const xt=yield re.getHeader();return{data:{tiles:[`${D.url}/{z}/{x}/{y}`],minzoom:xt.minZoom,maxzoom:xt.maxZoom,bounds:[xt.minLon,xt.minLat,xt.maxLon,xt.maxLat]}}}const H=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),Q=D.url.match(H);if(!Q)throw new Error("Invalid PMTiles protocol URL");const oe=Q[1];let ye=this.tiles.get(oe);ye||(ye=new ku(oe),this.tiles.set(oe,ye));const A=Q[2],p=Q[3],Oe=Q[4],je=yield ye.getHeader(),Pe=yield ye==null?void 0:ye.getZxy(+A,+p,+Oe,L.signal);return Pe?{data:new Uint8Array(Pe.data),cacheControl:Pe.cacheControl,expires:Pe.expires}:je.tileType===1?{data:new Uint8Array}:{data:null}}),this.tile=lf(this.tilev4),this.tiles=new Map}add(D){this.tiles.set(D.source.getKey(),D)}get(D){return this.tiles.get(D)}};function Ss(D,L){return(L>>>0)*4294967296+(D>>>0)}function cf(D,L){const H=L.buf;let Q=H[L.pos++],oe=(Q&112)>>4;if(Q<128||(Q=H[L.pos++],oe|=(Q&127)<<3,Q<128)||(Q=H[L.pos++],oe|=(Q&127)<<10,Q<128)||(Q=H[L.pos++],oe|=(Q&127)<<17,Q<128)||(Q=H[L.pos++],oe|=(Q&127)<<24,Q<128)||(Q=H[L.pos++],oe|=(Q&1)<<31,Q<128))return Ss(D,oe);throw new Error("Expected varint not more than 10 bytes")}function Co(D){const L=D.buf;let H=L[D.pos++],Q=H&127;return H<128||(H=L[D.pos++],Q|=(H&127)<<7,H<128)||(H=L[D.pos++],Q|=(H&127)<<14,H<128)||(H=L[D.pos++],Q|=(H&127)<<21,H<128)?Q:(H=L[D.pos],Q|=(H&15)<<28,cf(Q,D))}function hf(D,L,H,Q){if(Q===0){H===1&&(L[0]=D-1-L[0],L[1]=D-1-L[1]);const oe=L[0];L[0]=L[1],L[1]=oe}}var uf=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function df(D,L,H){if(D>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(L>ks(2,D)-1||H>ks(2,D)-1)throw Error("tile x/y outside zoom level bounds");const Q=uf[D],oe=ks(2,D);let ye=0,A=0,p=0;const Oe=[L,H];let je=oe/2;for(;je>0;)ye=(Oe[0]&je)>0?1:0,A=(Oe[1]&je)>0?1:0,p+=je*je*(3*ye^A),hf(je,Oe,ye,A),je=je/2;return Q+p}function Uu(D,L){return zi(this,null,function*(){if(L===1||L===0)return D;if(L===2){if(typeof globalThis.DecompressionStream>"u")return Gc(new Uint8Array(D));const H=new Response(D).body;if(!H)throw Error("Failed to read response stream");const Q=H.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(Q).arrayBuffer()}throw Error("Compression method not supported")})}var pf=127;function ff(D,L){let H=0,Q=D.length-1;for(;H<=Q;){const oe=Q+H>>1,ye=L-D[oe].tileId;if(ye>0)H=oe+1;else if(ye<0)Q=oe-1;else return D[oe]}return Q>=0&&(D[Q].runLength===0||L-D[Q].tileId=300)throw Error(`Bad response code: ${Oe.status}`);const Pe=Oe.headers.get("Content-Length");if(Oe.status===200&&(!Pe||+Pe>L))throw oe&&oe.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield Oe.arrayBuffer(),etag:je||void 0,cacheControl:Oe.headers.get("Cache-Control")||void 0,expires:Oe.headers.get("Expires")||void 0}})}};function $r(D,L){const H=D.getUint32(L+4,!0),Q=D.getUint32(L+0,!0);return H*ks(2,32)+Q}function _f(D,L){const H=new DataView(D),Q=H.getUint8(7);if(Q>3)throw Error(`Archive is spec version ${Q} but this library supports up to spec version 3`);return{specVersion:Q,rootDirectoryOffset:$r(H,8),rootDirectoryLength:$r(H,16),jsonMetadataOffset:$r(H,24),jsonMetadataLength:$r(H,32),leafDirectoryOffset:$r(H,40),leafDirectoryLength:$r(H,48),tileDataOffset:$r(H,56),tileDataLength:$r(H,64),numAddressedTiles:$r(H,72),numTileEntries:$r(H,80),numTileContents:$r(H,88),clustered:H.getUint8(96)===1,internalCompression:H.getUint8(97),tileCompression:H.getUint8(98),tileType:H.getUint8(99),minZoom:H.getUint8(100),maxZoom:H.getUint8(101),minLon:H.getInt32(102,!0)/1e7,minLat:H.getInt32(106,!0)/1e7,maxLon:H.getInt32(110,!0)/1e7,maxLat:H.getInt32(114,!0)/1e7,centerZoom:H.getUint8(118),centerLon:H.getInt32(119,!0)/1e7,centerLat:H.getInt32(123,!0)/1e7,etag:L}}function Nu(D){const L={buf:new Uint8Array(D),pos:0},H=Co(L),Q=[];let oe=0;for(let ye=0;ye0?Q[ye].offset=Q[ye-1].offset+Q[ye-1].length:Q[ye].offset=A-1}return Q}function gf(D){const L=new DataView(D);return L.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):L.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var Hc=class extends Error{};function yf(D,L){return zi(this,null,function*(){const H=yield D.getBytes(0,16384);if(new DataView(H.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(gf(H.data)<3)return[yield Vu.getHeader(D)];const oe=H.data.slice(0,pf),ye=_f(oe,H.etag),A=H.data.slice(ye.rootDirectoryOffset,ye.rootDirectoryOffset+ye.rootDirectoryLength),p=`${D.getKey()}|${ye.etag||""}|${ye.rootDirectoryOffset}|${ye.rootDirectoryLength}`,Oe=Nu(yield L(A,ye.internalCompression));return[ye,[p,Oe.length,Oe]]})}function xf(D,L,H,Q,oe){return zi(this,null,function*(){const ye=yield D.getBytes(H,Q,void 0,oe.etag),A=yield L(ye.data,oe.internalCompression),p=Nu(A);if(p.length===0)throw new Error("Empty directory is invalid");return p})}var vf=class{constructor(D=100,L=!0,H=Uu){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=D,this.counter=1,this.decompress=H}getHeader(D){return zi(this,null,function*(){const L=D.getKey(),H=this.cache.get(L);if(H)return H.lastUsed=this.counter++,yield H.data;const Q=new Promise((oe,ye)=>{yf(D,this.decompress).then(A=>{A[1]&&this.cache.set(A[1][0],{lastUsed:this.counter++,data:Promise.resolve(A[1][2])}),oe(A[0]),this.prune()}).catch(A=>{ye(A)})});return this.cache.set(L,{lastUsed:this.counter++,data:Q}),Q})}getDirectory(D,L,H,Q){return zi(this,null,function*(){const oe=`${D.getKey()}|${Q.etag||""}|${L}|${H}`,ye=this.cache.get(oe);if(ye)return ye.lastUsed=this.counter++,yield ye.data;const A=new Promise((p,Oe)=>{xf(D,this.decompress,L,H,Q).then(je=>{p(je),this.prune()}).catch(je=>{Oe(je)})});return this.cache.set(oe,{lastUsed:this.counter++,data:A}),A})}getArrayBuffer(D,L,H,Q){return zi(this,null,function*(){const oe=`${D.getKey()}|${Q.etag||""}|${L}|${H}`,ye=this.cache.get(oe);if(ye)return ye.lastUsed=this.counter++,yield ye.data;const A=new Promise((p,Oe)=>{D.getBytes(L,H,void 0,Q.etag).then(je=>{p(je.data),this.cache.has(oe),this.prune()}).catch(je=>{Oe(je)})});return this.cache.set(oe,{lastUsed:this.counter++,data:A}),A})}prune(){if(this.cache.size>=this.maxCacheEntries){let D=1/0,L;this.cache.forEach((H,Q)=>{H.lastUsed{this.getHeader(D).then(ye=>{Q(),this.invalidations.delete(L)}).catch(ye=>{oe(ye)})});this.invalidations.set(L,H)})}},ku=class{constructor(D,L,H){typeof D=="string"?this.source=new mf(D):this.source=D,H?this.decompress=H:this.decompress=Uu,L?this.cache=L:this.cache=new vf}getHeader(){return zi(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(D,L,H,Q){return zi(this,null,function*(){const oe=df(D,L,H),ye=yield this.cache.getHeader(this.source);if(ye.specVersion<3)return Vu.getZxy(ye,this.source,this.cache,D,L,H,Q);if(Dye.maxZoom)return;let A=ye.rootDirectoryOffset,p=ye.rootDirectoryLength;for(let Oe=0;Oe<=3;Oe++){const je=yield this.cache.getDirectory(this.source,A,p,ye),Pe=ff(je,oe);if(Pe){if(Pe.runLength>0){const ce=yield this.source.getBytes(ye.tileDataOffset+Pe.offset,Pe.length,Q,ye.etag);return{data:yield this.decompress(ce.data,ye.tileCompression),cacheControl:ce.cacheControl,expires:ce.expires}}A=ye.leafDirectoryOffset+Pe.offset,p=Pe.length}else return}throw Error("Maximum directory depth exceeded")})}getZxy(D,L,H,Q){return zi(this,null,function*(){try{return yield this.getZxyAttempt(D,L,H,Q)}catch(oe){if(oe instanceof Hc)return this.cache.invalidate(this.source),yield this.getZxyAttempt(D,L,H,Q);throw oe}})}getMetadataAttempt(){return zi(this,null,function*(){const D=yield this.cache.getHeader(this.source),L=yield this.source.getBytes(D.jsonMetadataOffset,D.jsonMetadataLength,void 0,D.etag),H=yield this.decompress(L.data,D.internalCompression),Q=new TextDecoder("utf-8");return JSON.parse(Q.decode(H))})}getMetadata(){return zi(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(D){if(D instanceof Hc)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw D}})}};function bf(D,L){return[{id:"background",type:"background",paint:{"background-color":L.background}},{id:"earth",type:"fill",source:D,"source-layer":"earth",paint:{"fill-color":L.earth}},{id:"landuse_park",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course"]],paint:{"fill-color":["interpolate",["linear"],["zoom"],0,L.park_a,12,L.park_b]}},{id:"landuse_urban_green",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","allotments","village_green","playground"]],paint:{"fill-color":L.park_b,"fill-opacity":.7}},{id:"landuse_hospital",type:"fill",source:D,"source-layer":"landuse",filter:["any",["==","pmap:kind","hospital"]],paint:{"fill-color":L.hospital}},{id:"landuse_industrial",type:"fill",source:D,"source-layer":"landuse",filter:["any",["==","pmap:kind","industrial"]],paint:{"fill-color":L.industrial}},{id:"landuse_school",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","school","university","college"]],paint:{"fill-color":L.school}},{id:"landuse_beach",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","beach"]],paint:{"fill-color":L.beach}},{id:"landuse_zoo",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","zoo"]],paint:{"fill-color":L.zoo}},{id:"landuse_military",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","military","naval_base","airfield"]],paint:{"fill-color":L.zoo}},{id:"natural_wood",type:"fill",source:D,"source-layer":"natural",filter:["any",["in","pmap:kind","wood","nature_reserve","forest"]],paint:{"fill-color":["interpolate",["linear"],["zoom"],0,L.wood_a,12,L.wood_b]}},{id:"natural_scrub",type:"fill",source:D,"source-layer":"natural",filter:["in","pmap:kind","scrub","grassland","grass"],paint:{"fill-color":["interpolate",["linear"],["zoom"],0,L.scrub_a,12,L.scrub_b]}},{id:"natural_glacier",type:"fill",source:D,"source-layer":"natural",filter:["==","pmap:kind","glacier"],paint:{"fill-color":L.glacier}},{id:"natural_sand",type:"fill",source:D,"source-layer":"natural",filter:["==","pmap:kind","sand"],paint:{"fill-color":L.sand}},{id:"landuse_aerodrome",type:"fill",source:D,"source-layer":"landuse",filter:["any",["in","pmap:kind","aerodrome"]],paint:{"fill-color":L.aerodrome}},{id:"transit_runway",type:"line",source:D,"source-layer":"transit",filter:["any",["in","pmap:kind_detail","runway"]],paint:{"line-color":L.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,12,4,18,30]}},{id:"transit_taxiway",type:"line",source:D,"source-layer":"transit",minzoom:13,filter:["any",["in","pmap:kind_detail","taxiway"]],paint:{"line-color":L.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,15,6]}},{id:"water",type:"fill",source:D,"source-layer":"water",paint:{"fill-color":L.water}},{id:"physical_line_stream",type:"line",source:D,"source-layer":"physical_line",minzoom:14,filter:["all",["in","pmap:kind","stream"]],paint:{"line-color":L.water,"line-width":.5}},{id:"physical_line_river",type:"line",source:D,"source-layer":"physical_line",minzoom:9,filter:["all",["in","pmap:kind","river"]],paint:{"line-color":L.water,"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1,18,12]}},{id:"landuse_pedestrian",type:"fill",source:D,"source-layer":"landuse",filter:["any",["==","pmap:kind","pedestrian"]],paint:{"fill-color":L.pedestrian}},{id:"landuse_pier",type:"fill",source:D,"source-layer":"landuse",filter:["any",["==","pmap:kind","pier"]],paint:{"fill-color":L.pier}},{id:"roads_tunnels_other_casing",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["in","pmap:kind","other","path"]],paint:{"line-color":L.tunnel_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor_casing",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:link",1]],paint:{"line-color":L.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_medium_casing",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.tunnel_medium_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"],10,0,10.5,1]}},{id:"roads_tunnels_major_casing",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["in","pmap:kind","other","path"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:link",1]],paint:{"line-color":L.tunnel_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_tunnels_medium",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.tunnel_medium,"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,12,1.2,15,3,18,13]}},{id:"roads_tunnels_major",type:"line",source:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["<","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"buildings",paint:{"fill-color":L.buildings,"fill-opacity":.5}},{id:"transit_pier",type:"line",source:D,"source-layer":"transit",filter:["any",["==","pmap:kind","pier"]],paint:{"line-color":L.transit_pier,"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,16]}},{id:"roads_minor_service_casing",type:"line",source:D,"source-layer":"roads",minzoom:13,filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"],["==","pmap:kind_detail","service"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"],["!=","pmap:kind_detail","service"]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:13,filter:["all",["==","pmap:link",1]],paint:{"line-color":L.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_medium_casing",type:"line",source:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.medium_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,12,1.2,15,3,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,10.5,1.5]}},{id:"roads_major_casing_late",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",["==","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:12,filter:["all",["==","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["in","pmap:kind","other","path"]],paint:{"line-color":L.other,"line-dasharray":[3,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_link",type:"line",source:D,"source-layer":"roads",filter:["all",["==","pmap:link",1]],paint:{"line-color":L.link,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_minor_service",type:"line",source:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"],["==","pmap:kind_detail","service"]],paint:{"line-color":L.minor_service,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8]}},{id:"roads_minor",type:"line",source:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","minor_road"],["!=","pmap:kind_detail","service"]],paint:{"line-color":["interpolate",["exponential",1.6],["zoom"],11,L.minor_a,16,L.minor_b],"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_medium",type:"line",source:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.medium,"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,12,1.2,15,3,18,13]}},{id:"roads_major_casing_early",type:"line",source:D,"source-layer":"roads",maxzoom:12,filter:["all",["==","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",maxzoom:12,filter:["all",["==","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",["==","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"transit_railway",type:"line",source:D,"source-layer":"transit",filter:["all",["==","pmap:kind","rail"]],paint:{"line-dasharray":[.3,.75],"line-opacity":.5,"line-color":L.railway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,.15,18,9]}},{id:"boundaries_country",type:"line",source:D,"source-layer":"boundaries",filter:["<=","pmap:min_admin_level",2],paint:{"line-color":L.boundaries,"line-width":1,"line-dasharray":[3,2]}},{id:"boundaries",type:"line",source:D,"source-layer":"boundaries",filter:[">","pmap:min_admin_level",2],paint:{"line-color":L.boundaries,"line-width":.5,"line-dasharray":[3,2]}},{id:"roads_bridges_other_casing",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["in","pmap:kind","other","path"]],paint:{"line-color":L.bridges_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_link_casing",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":L.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_medium_casing",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.bridges_medium_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,12,1.2,15,3,18,13],"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,10.5,1.5]}},{id:"roads_bridges_major_casing",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["in","pmap:kind","other","path"]],paint:{"line-color":L.bridges_other,"line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_minor",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","minor_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:link",1]],paint:{"line-color":L.bridges_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_bridges_medium",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","medium_road"]],paint:{"line-color":L.bridges_medium,"line-width":["interpolate",["exponential",1.6],["zoom"],7,0,12,1.2,15,3,18,13]}},{id:"roads_bridges_major",type:"line",source:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","major_road"]],paint:{"line-color":L.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:D,"source-layer":"roads",minzoom:12,filter:["all",[">","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.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:D,"source-layer":"roads",filter:["all",[">","pmap:level",0],["==","pmap:kind","highway"],["!=","pmap:link",1]],paint:{"line-color":L.bridges_highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}}]}function wf(D,L){return[{id:"physical_line_waterway_label",type:"symbol",source:D,"source-layer":"physical_line",minzoom:13,filter:["all",["in","pmap:kind","river","stream"]],layout:{"symbol-placement":"line","text-font":["Noto Sans Regular"],"text-field":["get","name"],"text-size":12,"text-letter-spacing":.3},paint:{"text-color":L.waterway_label}},{id:"physical_point_peak",type:"symbol",source:D,"source-layer":"physical_point",filter:["any",["==","pmap:kind","peak"]],layout:{"text-font":["Noto Sans Italic"],"text-field":["get","name"],"text-size":["interpolate",["linear"],["zoom"],10,8,16,12],"text-letter-spacing":.1,"text-max-width":9},paint:{"text-color":L.peak_label,"text-halo-width":1.5}},{id:"roads_labels_minor",type:"symbol",source:D,"source-layer":"roads",minzoom:15,filter:["any",["in","pmap:kind","minor_road","other","path"]],layout:{"symbol-sort-key":["get","pmap:min_zoom"],"symbol-placement":"line","text-font":["Noto Sans Regular"],"text-field":["get","name"],"text-size":12},paint:{"text-color":L.roads_label_minor,"text-halo-color":L.roads_label_minor_halo,"text-halo-width":2}},{id:"physical_point_ocean",type:"symbol",source:D,"source-layer":"physical_point",filter:["any",["in","pmap:kind","sea","ocean","lake","water","bay","strait","fjord"]],layout:{"text-font":["Noto Sans Medium"],"text-field":["get","name"],"text-size":["interpolate",["linear"],["zoom"],3,10,10,12],"text-letter-spacing":.1,"text-max-width":9,"text-transform":"uppercase"},paint:{"text-color":L.ocean_label}},{id:"physical_point_lakes",type:"symbol",source:D,"source-layer":"physical_point",filter:["any",["in","pmap:kind","lake","water"]],layout:{"text-font":["Noto Sans Medium"],"text-field":["get","name"],"text-size":["interpolate",["linear"],["zoom"],3,0,6,12,10,12],"text-letter-spacing":.1,"text-max-width":9},paint:{"text-color":L.ocean_label}},{id:"roads_labels_major",type:"symbol",source:D,"source-layer":"roads",minzoom:11,filter:["any",["in","pmap:kind","highway","major_road","medium_road"]],layout:{"symbol-sort-key":["get","pmap:min_zoom"],"symbol-placement":"line","text-font":["Noto Sans Regular"],"text-field":["get","name"],"text-size":12},paint:{"text-color":L.roads_label_major,"text-halo-color":L.roads_label_major_halo,"text-halo-width":2}},{id:"places_subplace",type:"symbol",source:D,"source-layer":"places",filter:["==","pmap:kind","neighbourhood"],layout:{"symbol-sort-key":["get","pmap:min_zoom"],"text-field":"{name}","text-font":["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":L.subplace_label,"text-halo-color":L.subplace_label_halo,"text-halo-width":1.5}},{id:"places_locality",type:"symbol",source:D,"source-layer":"places",filter:["==","pmap:kind","locality"],layout:{"icon-image":["step",["zoom"],"townspot",8,""],"icon-size":.7,"text-field":"{name}","text-font":["case",["<=",["get","pmap:min_zoom"],5],["literal",["Noto Sans Medium"]],["literal",["Noto Sans Regular"]]],"text-padding":["interpolate",["linear"],["zoom"],5,3,8,7,12,11],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","pmap:population_rank"],13],8,[">=",["get","pmap:population_rank"],13],13,0],4,["case",["<",["get","pmap:population_rank"],13],10,[">=",["get","pmap:population_rank"],13],15,0],6,["case",["<",["get","pmap:population_rank"],12],11,[">=",["get","pmap:population_rank"],12],17,0],8,["case",["<",["get","pmap:population_rank"],11],11,[">=",["get","pmap:population_rank"],11],18,0],10,["case",["<",["get","pmap:population_rank"],9],12,[">=",["get","pmap:population_rank"],9],20,0],15,["case",["<",["get","pmap:population_rank"],8],12,[">=",["get","pmap:population_rank"],8],22,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,0,8,4,10,8,12,6,22,2],"text-anchor":["step",["zoom"],"left",8,"center"],"text-radial-offset":.4},paint:{"text-color":L.city_label,"text-halo-color":L.city_label_halo,"text-halo-width":1}},{id:"places_region",type:"symbol",source:D,"source-layer":"places",filter:["==","pmap:kind","region"],layout:{"symbol-sort-key":["get","pmap:min_zoom"],"text-field":["step",["zoom"],["get","name:short"],6,["get","name"]],"text-font":["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":L.state_label,"text-halo-color":L.state_label_halo,"text-halo-width":2}},{id:"places_country",type:"symbol",source:D,"source-layer":"places",filter:["==","pmap:kind","country"],layout:{"symbol-sort-key":["get","pmap:min_zoom"],"text-field":"{name}","text-font":["Noto Sans Medium"],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","pmap:population_rank"],10],8,[">=",["get","pmap:population_rank"],10],12,0],6,["case",["<",["get","pmap:population_rank"],8],10,[">=",["get","pmap:population_rank"],8],18,0],8,["case",["<",["get","pmap:population_rank"],7],11,[">=",["get","pmap: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":L.country_label}}]}const Tf={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",pier:"#ededed",zoo:"#ebe6ed",military:"#ebe6ed",tunnel_other_casing:"#ffffff",tunnel_minor_casing:"#e2e2e2",tunnel_link_casing:"#e2e2e2",tunnel_medium_casing:"#e1e1e1",tunnel_major_casing:"#e3cfd3",tunnel_highway_casing:"#ebcea2",tunnel_other:"#f7f7f7",tunnel_minor:"#ebebeb",tunnel_link:"#ebebeb",tunnel_medium:"#ebebeb",tunnel_major:"#ebebeb",tunnel_highway:"#ebebeb",transit_pier:"#ededed",buildings:"#cbcece",minor_service_casing:"#e2e2e2",minor_casing:"#e2e2e2",link_casing:"#e2e2e2",medium_casing:"#e1e1e1",major_casing_late:"#e3cfd3",highway_casing_late:"#ebcea2",other:"#ffffff",minor_service:"#ffffff",minor_a:"#fff2bb",minor_b:"#fff2bb",link:"#fff2bb",medium:"#ffea94",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_medium_casing:"#e1e1e1",bridges_major_casing:"#e3cfd3",bridges_highway_casing:"#ebcea2",bridges_other:"#ffffff",bridges_minor:"#ffffff",bridges_link:"#e1e1e1",bridges_medium:"#ffffff",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"},Sf={background:"#cccccc",earth:"#e0e0e0",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",pier:"#e0e0e0",zoo:"#c6dcdc",military:"#dcdcdc",tunnel_other_casing:"#e0e0e0",tunnel_minor_casing:"#e0e0e0",tunnel_link_casing:"#e0e0e0",tunnel_medium_casing:"#e0e0e0",tunnel_major_casing:"#e0e0e0",tunnel_highway_casing:"#e0e0e0",tunnel_other:"#d5d5d5",tunnel_minor:"#d5d5d5",tunnel_link:"#d5d5d5",tunnel_medium:"#d5d5d5",tunnel_major:"#d5d5d5",tunnel_highway:"#d5d5d5",transit_pier:"#e0e0e0",buildings:"#cccccc",minor_service_casing:"#e0e0e0",minor_casing:"#e0e0e0",link_casing:"#e0e0e0",medium_casing:"#e0e0e0",major_casing_late:"#e0e0e0",highway_casing_late:"#e0e0e0",other:"#ebebeb",minor_service:"#ebebeb",minor_a:"#ebebeb",minor_b:"#ffffff",link:"#ffffff",medium:"#f5f5f5",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_medium_casing:"#e0e0e0",bridges_major_casing:"#e0e0e0",bridges_highway_casing:"#e0e0e0",bridges_other:"#ebebeb",bridges_minor:"#ffffff",bridges_link:"#ffffff",bridges_medium:"#f0eded",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:"#ffffff",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"},If={background:"#34373d",earth:"#1f1f1f",park_a:"#232325",park_b:"#232325",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:"#34373d",pier:"#222222",zoo:"#222323",military:"#242323",tunnel_other_casing:"#141414",tunnel_minor_casing:"#141414",tunnel_link_casing:"#141414",tunnel_medium_casing:"#141414",tunnel_major_casing:"#141414",tunnel_highway_casing:"#141414",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_medium:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",transit_pier:"#333333",buildings:"#111111",minor_service_casing:"#1f1f1f",minor_casing:"#1f1f1f",link_casing:"#1f1f1f",medium_casing:"#1f1f1f",major_casing_late:"#1f1f1f",highway_casing_late:"#1f1f1f",other:"#333333",minor_service:"#333333",minor_a:"#3d3d3d",minor_b:"#333333",link:"#3d3d3d",medium:"#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_medium_casing:"#1f1f1f",bridges_major_casing:"#1f1f1f",bridges_highway_casing:"#1f1f1f",bridges_other:"#333333",bridges_minor:"#333333",bridges_link:"#3d3d3d",bridges_medium:"#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"},kf={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",pier:"#f5f5f5",zoo:"#f7f7f7",military:"#fcfcfc",tunnel_other_casing:"#d6d6d6",tunnel_minor_casing:"#fcfcfc",tunnel_link_casing:"#fcfcfc",tunnel_medium_casing:"#fcfcfc",tunnel_major_casing:"#fcfcfc",tunnel_highway_casing:"#fcfcfc",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_medium:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",transit_pier:"#efefef",buildings:"#efefef",minor_service_casing:"#ffffff",minor_casing:"#ffffff",link_casing:"#ffffff",medium_casing:"#ffffff",major_casing_late:"#ffffff",highway_casing_late:"#ffffff",other:"#f5f5f5",minor_service:"#f5f5f5",minor_a:"#ebebeb",minor_b:"#f5f5f5",link:"#ebebeb",medium:"#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_medium_casing:"#ffffff",bridges_major_casing:"#ffffff",bridges_highway_casing:"#ffffff",bridges_other:"#f5f5f5",bridges_minor:"#f5f5f5",bridges_link:"#ebebeb",bridges_medium:"#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"},Af={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",pier:"#b8b8b8",zoo:"#c7c7c7",military:"#bfbfbf",tunnel_other_casing:"#b8b8b8",tunnel_minor_casing:"#b8b8b8",tunnel_link_casing:"#b8b8b8",tunnel_medium_casing:"#b8b8b8",tunnel_major_casing:"#b8b8b8",tunnel_highway_casing:"#b8b8b8",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_medium:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",transit_pier:"#b8b8b8",buildings:"#e0e0e0",minor_service_casing:"#cccccc",minor_casing:"#cccccc",link_casing:"#cccccc",medium_casing:"#cccccc",major_casing_late:"#cccccc",highway_casing_late:"#cccccc",other:"#e0e0e0",minor_service:"#e0e0e0",minor_a:"#ebebeb",minor_b:"#e0e0e0",link:"#ebebeb",medium:"#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_medium_casing:"#cccccc",bridges_major_casing:"#cccccc",bridges_highway_casing:"#cccccc",bridges_other:"#e0e0e0",bridges_minor:"#e0e0e0",bridges_link:"#ebebeb",bridges_medium:"#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"},zf={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",pier:"#0a0a0a",zoo:"#191919",military:"#121212",tunnel_other_casing:"#101010",tunnel_minor_casing:"#101010",tunnel_link_casing:"#101010",tunnel_medium_casing:"#101010",tunnel_major_casing:"#101010",tunnel_highway_casing:"#101010",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_medium:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",transit_pier:"#0a0a0a",buildings:"#0a0a0a",minor_service_casing:"#141414",minor_casing:"#141414",link_casing:"#141414",medium_casing:"#141414",major_casing_late:"#141414",highway_casing_late:"#141414",other:"#1f1f1f",minor_service:"#1f1f1f",minor_a:"#292929",minor_b:"#1f1f1f",link:"#1f1f1f",medium:"#292929",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_medium_casing:"#141414",bridges_major_casing:"#141414",bridges_highway_casing:"#141414",bridges_other:"#1f1f1f",bridges_minor:"#1f1f1f",bridges_link:"#292929",bridges_medium:"#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"},Cf={light:Sf,dark:If,white:kf,grayscale:Af,black:zf,contrast:Tf};function Lf(D,L){const H=Cf[L];return bf(D,H).concat(wf(D,H))}export{Df as F,ku as P,Pf as a,Lf as l,Mf as m}; diff --git a/assets/index-81f15401.js b/assets/index-81f15401.js new file mode 100644 index 00000000..1d290d48 --- /dev/null +++ b/assets/index-81f15401.js @@ -0,0 +1,40 @@ +(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const o of u.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=t(l);fetch(l.href,u)}})();var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bi={exports:{}},qr={},Hi={exports:{}},L={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kt=Symbol.for("react.element"),rc=Symbol.for("react.portal"),lc=Symbol.for("react.fragment"),uc=Symbol.for("react.strict_mode"),oc=Symbol.for("react.profiler"),ic=Symbol.for("react.provider"),sc=Symbol.for("react.context"),ac=Symbol.for("react.forward_ref"),cc=Symbol.for("react.suspense"),fc=Symbol.for("react.memo"),dc=Symbol.for("react.lazy"),Oo=Symbol.iterator;function pc(e){return e===null||typeof e!="object"?null:(e=Oo&&e[Oo]||e["@@iterator"],typeof e=="function"?e:null)}var Wi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qi=Object.assign,Ki={};function rt(e,n,t){this.props=e,this.context=n,this.refs=Ki,this.updater=t||Wi}rt.prototype.isReactComponent={};rt.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};rt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yi(){}Yi.prototype=rt.prototype;function Iu(e,n,t){this.props=e,this.context=n,this.refs=Ki,this.updater=t||Wi}var Fu=Iu.prototype=new Yi;Fu.constructor=Iu;Qi(Fu,rt.prototype);Fu.isPureReactComponent=!0;var Mo=Array.isArray,Xi=Object.prototype.hasOwnProperty,ju={current:null},Gi={key:!0,ref:!0,__self:!0,__source:!0};function Zi(e,n,t){var r,l={},u=null,o=null;if(n!=null)for(r in n.ref!==void 0&&(o=n.ref),n.key!==void 0&&(u=""+n.key),n)Xi.call(n,r)&&!Gi.hasOwnProperty(r)&&(l[r]=n[r]);var i=arguments.length-2;if(i===1)l.children=t;else if(1>>1,X=C[H];if(0>>1;Hl(hl,z))hnl(qt,hl)?(C[H]=qt,C[hn]=z,H=hn):(C[H]=hl,C[vn]=z,H=vn);else if(hnl(qt,z))C[H]=qt,C[hn]=z,H=hn;else break e}}return N}function l(C,N){var z=C.sortIndex-N.sortIndex;return z!==0?z:C.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var s=[],c=[],v=1,m=null,p=3,g=!1,w=!1,S=!1,F=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(C){for(var N=t(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=C)r(c),N.sortIndex=N.expirationTime,n(s,N);else break;N=t(c)}}function h(C){if(S=!1,d(C),!w)if(t(s)!==null)w=!0,ml(E);else{var N=t(c);N!==null&&vl(h,N.startTime-C)}}function E(C,N){w=!1,S&&(S=!1,f(P),P=-1),g=!0;var z=p;try{for(d(N),m=t(s);m!==null&&(!(m.expirationTime>N)||C&&!xe());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?m.callback=X:m===t(s)&&r(s),d(N)}else r(s);m=t(s)}if(m!==null)var Jt=!0;else{var vn=t(c);vn!==null&&vl(h,vn.startTime-N),Jt=!1}return Jt}finally{m=null,p=z,g=!1}}var _=!1,x=null,P=-1,B=5,T=-1;function xe(){return!(e.unstable_now()-TC||125H?(C.sortIndex=z,n(c,C),t(s)===null&&C===t(c)&&(S?(f(P),P=-1):S=!0,vl(h,z-H))):(C.sortIndex=X,n(s,C),w||g||(w=!0,ml(E))),C},e.unstable_shouldYield=xe,e.unstable_wrapCallback=function(C){var N=p;return function(){var z=p;p=N;try{return C.apply(this,arguments)}finally{p=z}}}})(es);bi.exports=es;var _c=bi.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ns=$u,he=_c;function y(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=Object.prototype.hasOwnProperty,xc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fo={},jo={};function Pc(e){return Hl.call(jo,e)?!0:Hl.call(Fo,e)?!1:xc.test(e)?jo[e]=!0:(Fo[e]=!0,!1)}function Nc(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zc(e,n,t,r){if(n===null||typeof n>"u"||Nc(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function ie(e,n,t,r,l,u,o){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=u,this.removeEmptyString=o}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];b[n]=new ie(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new ie(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){b[e]=new ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){b[e]=new ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){b[e]=new ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){b[e]=new ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Vu=/[\-:]([a-z])/g;function Au(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Vu,Au);b[n]=new ie(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Vu,Au);b[n]=new ie(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Vu,Au);b[n]=new ie(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!1,!1)});b.xlinkHref=new ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bu(e,n,t,r){var l=b.hasOwnProperty(n)?b[n]:null;(l!==null?l.type!==0:r||!(2i||l[o]!==u[i]){var s=` +`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{wl=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?ht(e):""}function Lc(e){switch(e.tag){case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return ht("Suspense");case 19:return ht("SuspenseList");case 0:case 2:case 15:return e=Sl(e.type,!1),e;case 11:return e=Sl(e.type.render,!1),e;case 1:return e=Sl(e.type,!0),e;default:return""}}function Yl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Mn:return"Fragment";case On:return"Portal";case Wl:return"Profiler";case Hu:return"StrictMode";case Ql:return"Suspense";case Kl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ls:return(e.displayName||"Context")+".Consumer";case rs:return(e._context.displayName||"Context")+".Provider";case Wu:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qu:return n=e.displayName||null,n!==null?n:Yl(e.type)||"Memo";case Ge:n=e._payload,e=e._init;try{return Yl(e(n))}catch{}}return null}function Tc(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yl(n);case 8:return n===Hu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function cn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function os(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Rc(e){var n=os(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var l=t.get,u=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function nr(e){e._valueTracker||(e._valueTracker=Rc(e))}function is(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=os(e)?e.checked?"true":"false":e.value),e=r,e!==t?(n.setValue(e),!0):!1}function zr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xl(e,n){var t=n.checked;return V({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??e._wrapperState.initialChecked})}function $o(e,n){var t=n.defaultValue==null?"":n.defaultValue,r=n.checked!=null?n.checked:n.defaultChecked;t=cn(n.value!=null?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ss(e,n){n=n.checked,n!=null&&Bu(e,"checked",n,!1)}function Gl(e,n){ss(e,n);var t=cn(n.value),r=n.type;if(t!=null)r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Zl(e,n.type,t):n.hasOwnProperty("defaultValue")&&Zl(e,n.type,cn(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Vo(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!(r!=="submit"&&r!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}t=e.name,t!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,t!==""&&(e.name=t)}function Zl(e,n,t){(n!=="number"||zr(e.ownerDocument)!==e)&&(t==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var yt=Array.isArray;function Wn(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=tr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Tt(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&t.nodeType===3){t.nodeValue=n;return}}e.textContent=n}var St={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oc=["Webkit","ms","Moz","O"];Object.keys(St).forEach(function(e){Oc.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),St[n]=St[e]})});function ds(e,n,t){return n==null||typeof n=="boolean"||n===""?"":t||typeof n!="number"||n===0||St.hasOwnProperty(e)&&St[e]?(""+n).trim():n+"px"}function ps(e,n){e=e.style;for(var t in n)if(n.hasOwnProperty(t)){var r=t.indexOf("--")===0,l=ds(t,n[t],r);t==="float"&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}var Mc=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bl(e,n){if(n){if(Mc[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(y(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(y(61))}if(n.style!=null&&typeof n.style!="object")throw Error(y(62))}}function eu(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nu=null;function Ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tu=null,Qn=null,Kn=null;function Ho(e){if(e=Gt(e)){if(typeof tu!="function")throw Error(y(280));var n=e.stateNode;n&&(n=rl(n),tu(e.stateNode,e.type,n))}}function ms(e){Qn?Kn?Kn.push(e):Kn=[e]:Qn=e}function vs(){if(Qn){var e=Qn,n=Kn;if(Kn=Qn=null,Ho(e),n)for(e=0;e>>=0,e===0?32:31-(Wc(e)/Qc|0)|0}var rr=64,lr=4194304;function gt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Or(e,n){var t=e.pendingLanes;if(t===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=t&268435455;if(o!==0){var i=o&~l;i!==0?r=gt(i):(u&=o,u!==0&&(r=gt(u)))}else o=t&~l,o!==0?r=gt(o):u!==0&&(r=gt(u));if(r===0)return 0;if(n!==0&&n!==r&&!(n&l)&&(l=r&-r,u=n&-n,l>=u||l===16&&(u&4194240)!==0))return n;if(r&4&&(r|=t&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function Yt(e,n,t){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Te(n),e[n]=t}function Gc(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Et),qo=String.fromCharCode(32),bo=!1;function Is(e,n){switch(e){case"keyup":return _f.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dn=!1;function Pf(e,n){switch(e){case"compositionend":return Fs(n);case"keypress":return n.which!==32?null:(bo=!0,qo);case"textInput":return e=n.data,e===qo&&bo?null:e;default:return null}}function Nf(e,n){if(Dn)return e==="compositionend"||!eo&&Is(e,n)?(e=Ms(),wr=Ju=be=null,Dn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:t,offset:n-e};e=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=ri(t)}}function Vs(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Vs(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function As(){for(var e=window,n=zr();n instanceof e.HTMLIFrameElement;){try{var t=typeof n.contentWindow.location.href=="string"}catch{t=!1}if(t)e=n.contentWindow;else break;n=zr(e.document)}return n}function no(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function Ff(e){var n=As(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Vs(t.ownerDocument.documentElement,t)){if(r!==null&&no(t)){if(n=r.start,e=r.end,e===void 0&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if(e=(n=t.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var l=t.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=li(t,u);var o=li(t,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(n=n.createRange(),n.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(n),e.extend(o.node,o.offset)):(n.setEnd(o.node,o.offset),e.addRange(n)))}}for(n=[],e=t;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,In=null,su=null,_t=null,au=!1;function ui(e,n,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;au||In==null||In!==zr(r)||(r=In,"selectionStart"in r&&no(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_t&&Ft(_t,r)||(_t=r,r=Ir(su,"onSelect"),0Un||(e.current=vu[Un],vu[Un]=null,Un--)}function M(e,n){Un++,vu[Un]=e.current,e.current=n}var fn={},re=pn(fn),ce=pn(!1),_n=fn;function Jn(e,n){var t=e.type.contextTypes;if(!t)return fn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in t)l[u]=n[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l),l}function fe(e){return e=e.childContextTypes,e!=null}function jr(){I(ce),I(re)}function di(e,n,t){if(re.current!==fn)throw Error(y(168));M(re,n),M(ce,t)}function Zs(e,n,t){var r=e.stateNode;if(n=n.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(y(108,Tc(e)||"Unknown",l));return V({},t,r)}function Ur(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,_n=re.current,M(re,e),M(ce,ce.current),!0}function pi(e,n,t){var r=e.stateNode;if(!r)throw Error(y(169));t?(e=Zs(e,n,_n),r.__reactInternalMemoizedMergedChildContext=e,I(ce),I(re),M(re,e)):I(ce),M(ce,t)}var $e=null,ll=!1,Dl=!1;function Js(e){$e===null?$e=[e]:$e.push(e)}function Xf(e){ll=!0,Js(e)}function mn(){if(!Dl&&$e!==null){Dl=!0;var e=0,n=O;try{var t=$e;for(O=1;e>=o,l-=o,Ve=1<<32-Te(n)+l|t<P?(B=x,x=null):B=x.sibling;var T=p(f,x,d[P],h);if(T===null){x===null&&(x=B);break}e&&x&&T.alternate===null&&n(f,x),a=u(T,a,P),_===null?E=T:_.sibling=T,_=T,x=B}if(P===d.length)return t(f,x),j&&yn(f,P),E;if(x===null){for(;PP?(B=x,x=null):B=x.sibling;var xe=p(f,x,T.value,h);if(xe===null){x===null&&(x=B);break}e&&x&&xe.alternate===null&&n(f,x),a=u(xe,a,P),_===null?E=xe:_.sibling=xe,_=xe,x=B}if(T.done)return t(f,x),j&&yn(f,P),E;if(x===null){for(;!T.done;P++,T=d.next())T=m(f,T.value,h),T!==null&&(a=u(T,a,P),_===null?E=T:_.sibling=T,_=T);return j&&yn(f,P),E}for(x=r(f,x);!T.done;P++,T=d.next())T=g(x,f,P,T.value,h),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?P:T.key),a=u(T,a,P),_===null?E=T:_.sibling=T,_=T);return e&&x.forEach(function(ot){return n(f,ot)}),j&&yn(f,P),E}function F(f,a,d,h){if(typeof d=="object"&&d!==null&&d.type===Mn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case er:e:{for(var E=d.key,_=a;_!==null;){if(_.key===E){if(E=d.type,E===Mn){if(_.tag===7){t(f,_.sibling),a=l(_,d.props.children),a.return=f,f=a;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ge&&Si(E)===_.type){t(f,_.sibling),a=l(_,d.props),a.ref=pt(f,_,d),a.return=f,f=a;break e}t(f,_);break}else n(f,_);_=_.sibling}d.type===Mn?(a=Cn(d.props.children,f.mode,h,d.key),a.return=f,f=a):(h=Nr(d.type,d.key,d.props,null,f.mode,h),h.ref=pt(f,a,d),h.return=f,f=h)}return o(f);case On:e:{for(_=d.key;a!==null;){if(a.key===_)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){t(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{t(f,a);break}else n(f,a);a=a.sibling}a=Bl(d,f.mode,h),a.return=f,f=a}return o(f);case Ge:return _=d._init,F(f,a,_(d._payload),h)}if(yt(d))return w(f,a,d,h);if(st(d))return S(f,a,d,h);fr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(t(f,a.sibling),a=l(a,d),a.return=f,f=a):(t(f,a),a=Al(d,f.mode,h),a.return=f,f=a),o(f)):t(f,a)}return F}var bn=ua(!0),oa=ua(!1),Zt={},je=pn(Zt),Vt=pn(Zt),At=pn(Zt);function kn(e){if(e===Zt)throw Error(y(174));return e}function co(e,n){switch(M(At,n),M(Vt,e),M(je,Zt),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ql(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=ql(n,e)}I(je),M(je,n)}function et(){I(je),I(Vt),I(At)}function ia(e){kn(At.current);var n=kn(je.current),t=ql(n,e.type);n!==t&&(M(Vt,e),M(je,t))}function fo(e){Vt.current===e&&(I(je),I(Vt))}var U=pn(0);function Wr(e){for(var n=e;n!==null;){if(n.tag===13){var t=n.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if(n.flags&128)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Il=[];function po(){for(var e=0;et?t:4,e(!0);var r=Fl.transition;Fl.transition={};try{e(!1),n()}finally{O=t,Fl.transition=r}}function Ca(){return _e().memoizedState}function qf(e,n,t){var r=sn(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},_a(e))xa(n,t);else if(t=na(e,n,t,r),t!==null){var l=ue();Re(t,e,r,l),Pa(t,n,r)}}function bf(e,n,t){var r=sn(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(_a(e))xa(n,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=n.lastRenderedReducer,u!==null))try{var o=n.lastRenderedState,i=u(o,t);if(l.hasEagerState=!0,l.eagerState=i,Oe(i,o)){var s=n.interleaved;s===null?(l.next=l,so(n)):(l.next=s.next,s.next=l),n.interleaved=l;return}}catch{}finally{}t=na(e,n,l,r),t!==null&&(l=ue(),Re(t,e,r,l),Pa(t,n,r))}}function _a(e){var n=e.alternate;return e===$||n!==null&&n===$}function xa(e,n){xt=Qr=!0;var t=e.pending;t===null?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function Pa(e,n,t){if(t&4194240){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,Xu(e,t)}}var Kr={readContext:Ce,useCallback:ee,useContext:ee,useEffect:ee,useImperativeHandle:ee,useInsertionEffect:ee,useLayoutEffect:ee,useMemo:ee,useReducer:ee,useRef:ee,useState:ee,useDebugValue:ee,useDeferredValue:ee,useTransition:ee,useMutableSource:ee,useSyncExternalStore:ee,useId:ee,unstable_isNewReconciler:!1},ed={readContext:Ce,useCallback:function(e,n){return De().memoizedState=[e,n===void 0?null:n],e},useContext:Ce,useEffect:Ei,useImperativeHandle:function(e,n,t){return t=t!=null?t.concat([e]):null,Cr(4194308,4,ga.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Cr(4194308,4,e,n)},useInsertionEffect:function(e,n){return Cr(4,2,e,n)},useMemo:function(e,n){var t=De();return n=n===void 0?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=De();return n=t!==void 0?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=qf.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var n=De();return e={current:e},n.memoizedState=e},useState:ki,useDebugValue:go,useDeferredValue:function(e){return De().memoizedState=e},useTransition:function(){var e=ki(!1),n=e[0];return e=Jf.bind(null,e[1]),De().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,t){var r=$,l=De();if(j){if(t===void 0)throw Error(y(407));t=t()}else{if(t=n(),Z===null)throw Error(y(349));Pn&30||ca(r,n,t)}l.memoizedState=t;var u={value:t,getSnapshot:n};return l.queue=u,Ei(da.bind(null,r,u,e),[e]),r.flags|=2048,Wt(9,fa.bind(null,r,u,t,n),void 0,null),t},useId:function(){var e=De(),n=Z.identifierPrefix;if(j){var t=Ae,r=Ve;t=(r&~(1<<32-Te(r)-1)).toString(32)+t,n=":"+n+"R"+t,t=Bt++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(t,{is:r.is}):(e=o.createElement(t),t==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,t),e[Ie]=n,e[$t]=r,Ia(e,n,!1,!1),n.stateNode=e;e:{switch(o=eu(t,r),t){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;ltt&&(n.flags|=128,r=!0,mt(u,!1),n.lanes=4194304)}else{if(!r)if(e=Wr(o),e!==null){if(n.flags|=128,r=!0,t=e.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),mt(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!j)return ne(n),null}else 2*W()-u.renderingStartTime>tt&&t!==1073741824&&(n.flags|=128,r=!0,mt(u,!1),n.lanes=4194304);u.isBackwards?(o.sibling=n.child,n.child=o):(t=u.last,t!==null?t.sibling=o:n.child=o,u.last=o)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=W(),n.sibling=null,t=U.current,M(U,r?t&1|2:t&1),n):(ne(n),null);case 22:case 23:return _o(),r=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(n.flags|=8192),r&&n.mode&1?pe&1073741824&&(ne(n),n.subtreeFlags&6&&(n.flags|=8192)):ne(n),null;case 24:return null;case 25:return null}throw Error(y(156,n.tag))}function sd(e,n){switch(ro(n),n.tag){case 1:return fe(n.type)&&jr(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return et(),I(ce),I(re),po(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return fo(n),null;case 13:if(I(U),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(y(340));qn()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return I(U),null;case 4:return et(),null;case 10:return io(n.type._context),null;case 22:case 23:return _o(),null;case 24:return null;default:return null}}var pr=!1,te=!1,ad=typeof WeakSet=="function"?WeakSet:Set,k=null;function Bn(e,n){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){A(e,n,r)}else t.current=null}function Nu(e,n,t){try{t()}catch(r){A(e,n,r)}}var Ri=!1;function cd(e,n){if(cu=Mr,e=As(),no(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{t.nodeType,u.nodeType}catch{t=null;break e}var o=0,i=-1,s=-1,c=0,v=0,m=e,p=null;n:for(;;){for(var g;m!==t||l!==0&&m.nodeType!==3||(i=o+l),m!==u||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break n;if(p===t&&++c===l&&(i=o),p===u&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}t=i===-1||s===-1?null:{start:i,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;for(fu={focusedElem:e,selectionRange:t},Mr=!1,k=n;k!==null;)if(n=k,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,k=e;else for(;k!==null;){n=k;try{var w=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,F=w.memoizedState,f=n.stateNode,a=f.getSnapshotBeforeUpdate(n.elementType===n.type?S:Ne(n.type,S),F);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=n.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(h){A(n,n.return,h)}if(e=n.sibling,e!==null){e.return=n.return,k=e;break}k=n.return}return w=Ri,Ri=!1,w}function Pt(e,n,t){var r=n.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&Nu(n,t,u)}l=l.next}while(l!==r)}}function il(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function zu(e){var n=e.ref;if(n!==null){var t=e.stateNode;switch(e.tag){case 5:e=t;break;default:e=t}typeof n=="function"?n(e):n.current=e}}function Ua(e){var n=e.alternate;n!==null&&(e.alternate=null,Ua(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ie],delete n[$t],delete n[mu],delete n[Kf],delete n[Yf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $a(e){return e.tag===5||e.tag===3||e.tag===4}function Oi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$a(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.nodeType===8?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(t.nodeType===8?(n=t.parentNode,n.insertBefore(e,t)):(n=t,n.appendChild(e)),t=t._reactRootContainer,t!=null||n.onclick!==null||(n.onclick=Fr));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,n,t),e=e.sibling;e!==null;)Lu(e,n,t),e=e.sibling}function Tu(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Tu(e,n,t),e=e.sibling;e!==null;)Tu(e,n,t),e=e.sibling}var J=null,ze=!1;function Xe(e,n,t){for(t=t.child;t!==null;)Va(e,n,t),t=t.sibling}function Va(e,n,t){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(br,t)}catch{}switch(t.tag){case 5:te||Bn(t,n);case 6:var r=J,l=ze;J=null,Xe(e,n,t),J=r,ze=l,J!==null&&(ze?(e=J,t=t.stateNode,e.nodeType===8?e.parentNode.removeChild(t):e.removeChild(t)):J.removeChild(t.stateNode));break;case 18:J!==null&&(ze?(e=J,t=t.stateNode,e.nodeType===8?Ml(e.parentNode,t):e.nodeType===1&&Ml(e,t),Dt(e)):Ml(J,t.stateNode));break;case 4:r=J,l=ze,J=t.stateNode.containerInfo,ze=!0,Xe(e,n,t),J=r,ze=l;break;case 0:case 11:case 14:case 15:if(!te&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&(u&2||u&4)&&Nu(t,n,o),l=l.next}while(l!==r)}Xe(e,n,t);break;case 1:if(!te&&(Bn(t,n),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(i){A(t,n,i)}Xe(e,n,t);break;case 21:Xe(e,n,t);break;case 22:t.mode&1?(te=(r=te)||t.memoizedState!==null,Xe(e,n,t),te=r):Xe(e,n,t);break;default:Xe(e,n,t)}}function Mi(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var t=e.stateNode;t===null&&(t=e.stateNode=new ad),n.forEach(function(r){var l=wd.bind(null,e,r);t.has(r)||(t.add(r),r.then(l,l))})}}function Pe(e,n){var t=n.deletions;if(t!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=W()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dd(r/1960))-r,10e?16:e,en===null)var r=!1;else{if(e=en,en=null,Gr=0,R&6)throw Error(y(331));var l=R;for(R|=4,k=e.current;k!==null;){var u=k,o=u.child;if(k.flags&16){var i=u.deletions;if(i!==null){for(var s=0;sW()-Eo?En(e,0):ko|=t),de(e,n)}function Xa(e,n){n===0&&(e.mode&1?(n=lr,lr<<=1,!(lr&130023424)&&(lr=4194304)):n=1);var t=ue();e=Qe(e,n),e!==null&&(Yt(e,n,t),de(e,t))}function gd(e){var n=e.memoizedState,t=0;n!==null&&(t=n.retryLane),Xa(e,t)}function wd(e,n){var t=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(t=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(n),Xa(e,t)}var Ga;Ga=function(e,n,t){if(e!==null)if(e.memoizedProps!==n.pendingProps||ce.current)ae=!0;else{if(!(e.lanes&t)&&!(n.flags&128))return ae=!1,od(e,n,t);ae=!!(e.flags&131072)}else ae=!1,j&&n.flags&1048576&&qs(n,Vr,n.index);switch(n.lanes=0,n.tag){case 2:var r=n.type;_r(e,n),e=n.pendingProps;var l=Jn(n,re.current);Xn(n,t),l=vo(null,n,r,e,l,t);var u=ho();return n.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,fe(r)?(u=!0,Ur(n)):u=!1,n.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ao(n),l.updater=ul,n.stateNode=l,l._reactInternals=n,Su(n,r,e,t),n=Cu(null,n,r,!0,u,t)):(n.tag=0,j&&u&&to(n),le(null,n,l,t),n=n.child),n;case 16:r=n.elementType;e:{switch(_r(e,n),e=n.pendingProps,l=r._init,r=l(r._payload),n.type=r,l=n.tag=kd(r),e=Ne(r,e),l){case 0:n=Eu(null,n,r,e,t);break e;case 1:n=zi(null,n,r,e,t);break e;case 11:n=Pi(null,n,r,e,t);break e;case 14:n=Ni(null,n,r,Ne(r.type,e),t);break e}throw Error(y(306,r,""))}return n;case 0:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),Eu(e,n,r,l,t);case 1:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),zi(e,n,r,l,t);case 3:e:{if(Oa(n),e===null)throw Error(y(387));r=n.pendingProps,u=n.memoizedState,l=u.element,ta(e,n),Hr(n,r,null,t);var o=n.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},n.updateQueue.baseState=u,n.memoizedState=u,n.flags&256){l=nt(Error(y(423)),n),n=Li(e,n,r,t,l);break e}else if(r!==l){l=nt(Error(y(424)),n),n=Li(e,n,r,t,l);break e}else for(me=ln(n.stateNode.containerInfo.firstChild),ve=n,j=!0,Le=null,t=oa(n,null,r,t),n.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(qn(),r===l){n=Ke(e,n,t);break e}le(e,n,r,t)}n=n.child}return n;case 5:return ia(n),e===null&&yu(n),r=n.type,l=n.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,du(r,l)?o=null:u!==null&&du(r,u)&&(n.flags|=32),Ra(e,n),le(e,n,o,t),n.child;case 6:return e===null&&yu(n),null;case 13:return Ma(e,n,t);case 4:return co(n,n.stateNode.containerInfo),r=n.pendingProps,e===null?n.child=bn(n,null,r,t):le(e,n,r,t),n.child;case 11:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),Pi(e,n,r,l,t);case 7:return le(e,n,n.pendingProps,t),n.child;case 8:return le(e,n,n.pendingProps.children,t),n.child;case 12:return le(e,n,n.pendingProps.children,t),n.child;case 10:e:{if(r=n.type._context,l=n.pendingProps,u=n.memoizedProps,o=l.value,M(Ar,r._currentValue),r._currentValue=o,u!==null)if(Oe(u.value,o)){if(u.children===l.children&&!ce.current){n=Ke(e,n,t);break e}}else for(u=n.child,u!==null&&(u.return=n);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Be(-1,t&-t),s.tag=2;var c=u.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}u.lanes|=t,s=u.alternate,s!==null&&(s.lanes|=t),gu(u.return,t,n),i.lanes|=t;break}s=s.next}}else if(u.tag===10)o=u.type===n.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(y(341));o.lanes|=t,i=o.alternate,i!==null&&(i.lanes|=t),gu(o,t,n),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===n){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}le(e,n,l.children,t),n=n.child}return n;case 9:return l=n.type,r=n.pendingProps.children,Xn(n,t),l=Ce(l),r=r(l),n.flags|=1,le(e,n,r,t),n.child;case 14:return r=n.type,l=Ne(r,n.pendingProps),l=Ne(r.type,l),Ni(e,n,r,l,t);case 15:return La(e,n,n.type,n.pendingProps,t);case 17:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),_r(e,n),n.tag=1,fe(r)?(e=!0,Ur(n)):e=!1,Xn(n,t),la(n,r,l),Su(n,r,l,t),Cu(null,n,r,!0,e,t);case 19:return Da(e,n,t);case 22:return Ta(e,n,t)}throw Error(y(156,n.tag))};function Za(e,n){return Es(e,n)}function Sd(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,n,t,r){return new Sd(e,n,t,r)}function Po(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kd(e){if(typeof e=="function")return Po(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wu)return 11;if(e===Qu)return 14}return 2}function an(e,n){var t=e.alternate;return t===null?(t=ke(e.tag,n,e.key,e.mode),t.elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=e.flags&14680064,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Nr(e,n,t,r,l,u){var o=2;if(r=e,typeof e=="function")Po(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Mn:return Cn(t.children,l,u,n);case Hu:o=8,l|=8;break;case Wl:return e=ke(12,t,n,l|2),e.elementType=Wl,e.lanes=u,e;case Ql:return e=ke(13,t,n,l),e.elementType=Ql,e.lanes=u,e;case Kl:return e=ke(19,t,n,l),e.elementType=Kl,e.lanes=u,e;case us:return al(t,l,u,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rs:o=10;break e;case ls:o=9;break e;case Wu:o=11;break e;case Qu:o=14;break e;case Ge:o=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return n=ke(o,t,n,l),n.elementType=e,n.type=r,n.lanes=u,n}function Cn(e,n,t,r){return e=ke(7,e,r,n),e.lanes=t,e}function al(e,n,t,r){return e=ke(22,e,r,n),e.elementType=us,e.lanes=t,e.stateNode={isHidden:!1},e}function Al(e,n,t){return e=ke(6,e,null,n),e.lanes=t,e}function Bl(e,n,t){return n=ke(4,e.children!==null?e.children:[],e.key,n),n.lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ed(e,n,t,r,l){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function No(e,n,t,r,l,u,o,i,s){return e=new Ed(e,n,t,i,s),n===1?(n=1,u===!0&&(n|=8)):n=0,u=ke(3,null,null,n),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},ao(u),e}function Cd(e,n,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ec)}catch(e){console.error(e)}}ec(),qi.exports=ye;var zd=qi.exports,Ai=zd;Io.createRoot=Ai.createRoot,Io.hydrateRoot=Ai.hydrateRoot;export{Td as R,Ld as a,Io as c,tc as g,Rd as j,$u as r}; diff --git a/assets/index-d02d2a94.css b/assets/index-d02d2a94.css new file mode 100644 index 00000000..6a6a99c9 --- /dev/null +++ b/assets/index-d02d2a94.css @@ -0,0 +1 @@ +.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;-moz-user-select:none;-webkit-user-select:none;-ms-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 (-ms-high-contrast: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 (-ms-high-contrast: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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){.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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){.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 (-ms-high-contrast: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='%23999' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){.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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){.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;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:rgba(0,0,0,.4);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} diff --git a/assets/index-e407fa79.css b/assets/index-e407fa79.css new file mode 100644 index 00000000..070484c7 --- /dev/null +++ b/assets/index-e407fa79.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;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}body{padding:0;margin:0;color:#fff}a{color:#fff}.map-container{display:flex;flex-direction:column;width:100%;height:100vh}#map{width:100%;height:100%}.split{height:100%;display:flex}.stylePane{width:50%;height:100%;overflow-y:scroll}.visual-tests{margin-left:auto;margin-right:auto;width:1512px;margin-top:100px;color:#fff;font-family:monospace}.visual-tests .map,.visual-tests canvas,.visual-tests img{width:500px;height:500px}.visual-tests .example{margin-top:2rem}.visual-tests span,.visual-tests a{margin-right:.5rem}.builds{font-family:monospace;padding:3rem}.builds td{padding:10px}.builds a{color:#fff}.maplibregl-popup,.maplibregl-popup-close-button{color:#000}.features-properties{max-height:45vh;overflow-y:scroll} diff --git a/assets/mapview-1b8433a7.js b/assets/mapview-1b8433a7.js new file mode 100644 index 00000000..531e0484 --- /dev/null +++ b/assets/mapview-1b8433a7.js @@ -0,0 +1,31 @@ +import{r as g,g as Si,R as to,j as y,c as wi}from"./index-81f15401.js";import{P as ki,F as Ei,m as le,l as Ci,a as bi}from"./index-24ba74c6.js";var De={};/** + * @license React + * react-dom-server-legacy.browser.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ro=g;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r