vendor: 16,601 bytes, lines 1-5
1/*! 2 * Copyright (c) 2026 3 * Build date (UTC+02:00): 2026/9/30 17:3:40 4 */ 5var qf=Object.defineProperty;var Wf=(J,H,pe)=>H in J?qf(J,H,{enumerable:!0,configurable:!0,writable:!0,value:pe}):J[H]=pe;var pt=(J,H,pe)=>Wf(J,typeof H!="symbol"?H+"":H,pe);import{i as Hf,d as Xf,A as Yf}from"./index-Cgv83Hyx.js";var qc={exports:{}};var Kf=qc.exports,Vd;function Jf(){return Vd||(Vd=1,(function(J,H){(function(pe,ye){J.exports=ye()})(Kf,(function(){var pe={},ye={};function Be(z,c,Ee){if(ye[z]=Ee,z==="index"){var Bt="var sharedModule = {}; ("+ye.shared+")(sharedModule); ("+ye.worker+")(sharedModule);",wt={};return ye.shared(wt),ye.index(pe,wt),typeof window<"u"&&pe.setWorkerUrl(window.URL.createObjectURL(new Blob([Bt],{type:"text/javascript"}))),pe}}Be("shared",["exports"],(function(z){function c(r,t,i,a){return new(i||(i=Promise))((function(o,u){function p(x){try{_(a.next(x))}catch(v){u(v)}}function m(x){try{_(a.throw(x))}catch(v){u(v)}}function _(x){var v;x.done?o(x.value):(v=x.value,v instanceof i?v:new i((function(T){T(v)}))).then(p,m)}_((a=a.apply(r,t||[])).next())}))}function Ee(r,t){this.x=r,this.y=t}function Bt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var wt,Tt;typeof SuppressedError=="function"&&SuppressedError,Ee.prototype={clone(){return new Ee(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,t){return this.clone()._rotateAround(r,t)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){const t=r.x-this.x,i=r.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult(r){const t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){const r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){const t=Math.cos(r),i=Math.sin(r),a=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=a,this},_rotateAround(r,t){const i=Math.cos(r),a=Math.sin(r),o=t.y+a*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-a*(this.y-t.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Ee},Ee.convert=function(r){if(r instanceof Ee)return r;if(Array.isArray(r))return new Ee(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new Ee(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var Ze=(function(){if(Tt)return wt;function r(t,i,a,o){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=a,this.p2y=o}return Tt=1,wt=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,o=0;o<8;o++){var u=this.sampleCurveX(a)-t;if(Math.abs(u)<i)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=u/p}var m=0,_=1;for(a=t,o=0;o<20&&(u=this.sampleCurveX(a),!(Math.abs(u-t)<i));o++)t>u?m=a:_=a,a=.5*(_-m)+m;return a},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},wt})(),ue=Bt(Ze);let ar,Di;function Hi(){return ar==null&&(ar=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ar}function Ar(){if(Di==null&&(Di=!1,Hi())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let a=0;a<25;a++){const o=4*a;t.fillStyle="rgb(".concat(o,",").concat(o+1,",").concat(o+2,")"),t.fillRect(a%5,Math.floor(a/5),1,1)}const i=t.getImageData(0,0,5,5).data;for(let a=0;a<100;a++)if(a%4!=3&&i[a]!==a){Di=!0;break}}}return Di||!1}var zt=1e-6,Et=typeof Float32Array<"u"?Float32Array:Array;function mi(){var r=new Et(9);return Et!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function qr(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Xi(){var r=new Et(3);return Et!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function kr(r){var t=r[0],i=r[1],a=r[2];return Math.sqrt(t*t+i*i+a*a)}function pn(r,t,i){var a=new Et(3);return a[0]=r,a[1]=t,a[2]=i,a}function Wr(r,t,i){return r[0]=t[0]+i[0],r[1]=t[1]+i[1],r[2]=t[2]+i[2],r}function Mi(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r}function sr(r,t,i){var a=t[0],o=t[1],u=t[2],p=i[0],m=i[1],_=i[2];return r[0]=o*_-u*m,r[1]=u*p-a*_,r[2]=a*m-o*p,r}var Ri,or=kr;function Hr(r,t,i){var a=t[0],o=t[1],u=t[2],p=t[3];return r[0]=i[0]*a+i[4]*o+i[8]*u+i[12]*p,r[1]=i[1]*a+i[5]*o+i[9]*u+i[13]*p,r[2]=i[2]*a+i[6]*o+i[10]*u+i[14]*p,r[3]=i[3]*a+i[7]*o+i[11]*u+i[15]*p,r}function vr(){var r=new Et(4);return Et!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Ne(r,t,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",u=Math.PI/360;t*=u,a*=u,i*=u;var p=Math.sin(t),m=Math.cos(t),_=Math.sin(i),x=Math.cos(i),v=Math.sin(a),T=Math.cos(a);switch(o){case"xyz":r[0]=p*x*T+m*_*v,r[1]=m*_*T-p*x*v,r[2]=m*x*v+p*_*T,r[3]=m*x*T-p*_*v;break;case"xzy":r[0]=p*x*T-m*_*v,r[1]=m*_*T-p*x*v,r[2]=m*x*v+p*_*T,r[3]=m*x*T+p*_*v;break;case"yxz":r[0]=p*x*T+m*_*v,r[1]=m*_*T-p*x*v,r[2]=m*x*v-p*_*T,r[3]=m*x*T+p*_*v;break;case"yzx":r[0]=p*x*T+m*_*v,r[1]=m*_*T+p*x*v,r[2]=m*x*v-p*_*T,r[3]=m*x*T-p*_*v;break;case"zxy":r[0]=p*x*T-m*_*v,r[1]=m*_*T+p*x*v,r[2]=m*x*v+p*_*T,r[3]=m*x*T-p*_*v;break;case"zyx":r[0]=p*x*T-m*_*v,r[1]=m*_*T+p*x*v,r[2]=m*x*v-p*_*T,r[3]=m*x*T+p*_*v;break;default:throw new Error("Unknown angle order "+o)}return r}function fn(){var r=new Et(2);return Et!=Float32Array&&(r[0]=0,r[1]=0),r}function gs(r,t){var i=new Et(2);return i[0]=r,i[1]=t,i}Xi(),Ri=new Et(4),Et!=Float32Array&&(Ri[0]=0,Ri[1]=0,Ri[2]=0,Ri[3]=0),Xi(),pn(1,0,0),pn(0,1,0),vr(),vr(),mi(),fn();const ft=8192;function mn(r,t,i){return t*(ft/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function _i(r,t){return(r%t+t)%t}function _n(r,t,i){return r*(1-i)+t*i}function br(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,i=t*r;return 4*(r<.5?i:3*(r-t)+i-.75)}function Xr(r,t,i,a){const o=new ue(r,t,i,a);return u=>o.solve(u)}const gn=Xr(.25,.1,.25,1);function Ci(r,t,i){return Math.min(i,Math.max(t,r))}function qn(r,t,i){const a=i-t,o=((r-t)%a+a)%a+t;return o===t?i:o}function Yi(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}let lr=1;function Wn(r,t,i){const a={};for(const o in r)a[o]=t.call(this,r[o],o,r);return a}function Hn(r,t,i){const a={};for(const o in r)t.call(this,r[o],o,r)&&(a[o]=r[o]);return a}function Li(r){return Array.isArray(r)?r.map(Li):typeof r=="object"&&r?Wn(r,Li):r}const Dt={};function Ot(r){Dt[r]||(typeof console<"u"&&console.warn(r),Dt[r]=!0)}function cr(r,t,i){return(i.y-r.y)*(t.x-r.x)>(t.y-r.y)*(i.x-r.x)}function wr(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let yn=null;function xn(r){if(yn==null){const t=r.navigator?r.navigator.userAgent:null;yn=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return yn}function Fi(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const Xn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ca(r,t,i,a,o){return c(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const u=new VideoFrame(r,{timestamp:0});try{const p=u==null?void 0:u.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error("Unrecognized format ".concat(p));const m=p.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield u.copyTo(_,(function(x,v,T,M,C){const E=4*Math.max(-v,0),R=(Math.max(0,T)-T)*M*4+E,L=4*M,V=Math.max(0,v),ie=Math.max(0,T);return{rect:{x:V,y:ie,width:Math.min(x.width,v+M)-V,height:Math.min(x.height,T+C)-ie},layout:[{offset:R,stride:L}]}})(r,t,i,a,o)),m)for(let x=0;x<_.length;x+=4){const v=_[x];_[x]=_[x+2],_[x+2]=v}return _}finally{u.close()}}))}let Yr,Tr;function vn(r,t,i,a){return r.addEventListener(t,i,a),{unsubscribe:()=>{r.removeEventListener(t,i,a)}}}function Ia(r){return r*Math.PI/180}function Ki(r){return r/Math.PI*180}const Kr={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Ji={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Q="AbortError";function A(){return new Error(Q)}const k={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function F(r){return k.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const G="global-dispatcher";class X extends Error{constructor(t,i,a,o){super("AJAXError: ".concat(i," (").concat(t,"): ").concat(a)),this.status=t,this.statusText=i,this.url=a,this.body=o}}const te=()=>wr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ae=function(r,t){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){const a=F(r.url);if(a)return a(r,t);if(wr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:G},t)}if(!(/^file:/.test(i=r.url)||/^file:/.test(te())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(a,o){return c(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:te(),signal:o.signal});let p,m;a.type!=="json"||u.headers.has("Accept")||u.headers.set("Accept","application/json");try{p=yield fetch(u)}catch(x){throw new X(0,x.message,a.url,new Blob)}if(!p.ok){const x=yield p.blob();throw new X(p.status,p.statusText,a.url,x)}m=a.type==="arrayBuffer"||a.type==="image"?p.arrayBuffer():a.type==="json"?p.json():p.text();const _=yield m;if(o.signal.aborted)throw A();return{data:_,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}}))})(r,t);if(wr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:G},t)}var i;return(function(a,o){return new Promise(((u,p)=>{var m;const _=new XMLHttpRequest;_.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(_.responseType="arraybuffer");for(const x in a.headers)_.setRequestHeader(x,a.headers[x]);a.type==="json"&&(_.responseType="text",!((m=a.headers)===null||m===void 0)&&m.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials=a.credentials==="include",_.onerror=()=>{p(new Error(_.statusText))},_.onload=()=>{if(!o.signal.aborted)if((_.status>=200&&_.status<300||_.status===0)&&_.response!==null){let x=_.response;if(a.type==="json")try{x=JSON.parse(_.response)}catch(v){return void p(v)}u({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});p(new X(_.status,_.statusText,a.url,x))}},o.signal.addEventListener("abort",(()=>{_.abort(),p(A())})),_.send(a.body)}))})(r,t)};function re(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;const t=new URL(r),i=window.location;return t.protocol===i.protocol&&t.host===i.host}function fe(r,t,i){i[r]&&i[r].indexOf(t)!==-1||(i[r]=i[r]||[],i[r].push(t))}function be(r,t,i){if(i&&i[r]){const a=i[r].indexOf(t);a!==-1&&i[r].splice(a,1)}}class _e{constructor(t,i={}){Yi(this,i),this.type=t}}class De extends _e{constructor(t,i={}){super("error",Yi({error:t},i))}}class Ve{on(t,i){return this._listeners=this._listeners||{},fe(t,i,this._listeners),{unsubscribe:()=>{this.off(t,i)}}}off(t,i){return be(t,i,this._listeners),be(t,i,this._oneTimeListeners),this}once(t,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},fe(t,i,this._oneTimeListeners),this):new Promise((a=>this.once(t,a)))}fire(t,i){typeof t=="string"&&(t=new _e(t,i||{}));const a=t.type;if(this.listens(a)){t.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const m of o)m.call(this,t);const u=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const m of u)be(a,m,this._oneTimeListeners),m.call(this,t);const p=this._eventedParent;p&&(Yi(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(t))}else t instanceof De&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,i){return this._eventedParent=t,this._eventedParentData=i,this}}var ne={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"array",value:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{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}
vendor: 1,192 bytes, line 5
5,clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief
vendor: 8,509 bytes, line 5
5","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"}
vendor: 9,097 bytes, line 5
5,"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 7,577 bytes, line 5
5,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},
vendor: 20,881 bytes, line 5
5"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const st=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ct(r,t){const i={};for(const a in r)a!=="ref"&&(i[a]=r[a]);return st.forEach((a=>{a in t&&(i[a]=t[a])})),i}function Re(r,t){if(Array.isArray(r)){if(!Array.isArray(t)||r.length!==t.length)return!1;for(let i=0;i<r.length;i++)if(!Re(r[i],t[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&t!==null){if(typeof t!="object"||Object.keys(r).length!==Object.keys(t).length)return!1;for(const i in r)if(!Re(r[i],t[i]))return!1;return!0}return r===t}function ot(r,t){r.push(t)}function Gt(r,t,i){ot(i,{command:"addSource",args:[r,t[r]]})}function qt(r,t,i){ot(t,{command:"removeSource",args:[r]}),i[r]=!0}function $t(r,t,i,a){qt(r,i,a),Gt(r,t,i)}function li(r,t,i){let a;for(a in r[i])if(Object.prototype.hasOwnProperty.call(r[i],a)&&a!=="data"&&!Re(r[i][a],t[i][a]))return!1;for(a in t[i])if(Object.prototype.hasOwnProperty.call(t[i],a)&&a!=="data"&&!Re(r[i][a],t[i][a]))return!1;return!0}function gt(r,t,i,a,o,u){r=r||{},t=t||{};for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&(Re(r[p],t[p])||i.push({command:u,args:[a,p,t[p],o]}));for(const p in t)Object.prototype.hasOwnProperty.call(t,p)&&!Object.prototype.hasOwnProperty.call(r,p)&&(Re(r[p],t[p])||i.push({command:u,args:[a,p,t[p],o]}))}function Wt(r){return r.id}function ht(r,t){return r[t.id]=t,r}class ve{constructor(t,i,a,o){this.message=(t?"".concat(t,": "):"")+a,o&&(this.identifier=o),i!=null&&i.__line__&&(this.line=i.__line__)}}function Pr(r,...t){for(const i of t)for(const a in i)r[a]=i[a];return r}class Bi extends Error{constructor(t,i){super(i),this.message=i,this.key=t}}class Oi{constructor(t,i=[]){this.parent=t,this.bindings={};for(const[a,o]of i)this.bindings[a]=o}concat(t){return new Oi(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Ht={kind:"null"},Me={kind:"number"},Ke={kind:"string"},Ye={kind:"boolean"},ji={kind:"color"},Sr={kind:"projectionDefinition"},Mr={kind:"object"},He={kind:"value"},Yn={kind:"collator"},za={kind:"formatted"},bn={kind:"padding"},Ea={kind:"colorArray"},Dr={kind:"numberArray"},wn={kind:"resolvedImage"},jt={kind:"variableAnchorOffsetCollection"};function Vi(r,t){return{kind:"array",itemType:r,N:t}}function Pt(r){if(r.kind==="array"){const t=Pt(r.itemType);return typeof r.N=="number"?"array<".concat(t,", ").concat(r.N,">"):r.itemType.kind==="value"?"array":"array<".concat(t,">")}return r.kind}const Aa=[Ht,Me,Ke,Ye,ji,Sr,za,Mr,Vi(He),bn,Dr,Ea,wn,jt];function Kn(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Kn(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const i of Aa)if(!Kn(i,t))return null}}return"Expected ".concat(Pt(r)," but found ").concat(Pt(t)," instead.")}function To(r,t){return t.some((i=>i.kind===r.kind))}function Tn(r,t){return t.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function Rr(r,t){return r.kind==="array"&&t.kind==="array"?r.itemType.kind===t.itemType.kind&&typeof r.N=="number":r.kind===t.kind}const Dl=.96422,Po=.82521,Rl=4/29,Jn=6/29,Ll=3*Jn*Jn,Wc=Jn*Jn*Jn,Hc=Math.PI/180,Xc=180/Math.PI;function Fl(r){return(r%=360)<0&&(r+=360),r}function So([r,t,i,a]){let o,u;const p=Mo((.2225045*(r=Pn(r))+.7168786*(t=Pn(t))+.0606169*(i=Pn(i)))/1);r===t&&t===i?o=u=p:(o=Mo((.4360747*r+.3850649*t+.1430804*i)/Dl),u=Mo((.0139322*r+.0971045*t+.7141733*i)/Po));const m=116*p-16;return[m<0?0:m,500*(o-p),200*(p-u),a]}function Pn(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Mo(r){return r>Wc?Math.pow(r,1/3):r/Ll+Rl}function Bl([r,t,i,a]){let o=(r+16)/116,u=isNaN(t)?o:o+t/500,p=isNaN(i)?o:o-i/200;return o=1*Co(o),u=Dl*Co(u),p=Po*Co(p),[Sn(3.1338561*u-1.6168667*o-.4906146*p),Sn(-.9787684*u+1.9161415*o+.033454*p),Sn(.0719453*u-.2289914*o+1.4052427*p),a]}function Sn(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Co(r){return r>Jn?r*r*r:Ll*(r-Rl)}const Yc=Object.hasOwn||function(r,t){return Object.prototype.hasOwnProperty.call(r,t)};function ka(r,t){return Yc(r,t)?r[t]:void 0}function Da(r){return parseInt(r.padEnd(2,r),16)/255}function Io(r,t){return vi(t?r/100:r,0,1)}function vi(r,t,i){return Math.min(Math.max(t,r),i)}function nt(r){return!r.some(Number.isNaN)}const Qn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function bi(r,t,i){return r+i*(t-r)}function Mn(r,t,i){return r.map(((a,o)=>bi(a,t[o],i)))}class Qe{constructor(t,i,a,o=1,u=!0){this.r=t,this.g=i,this.b=a,this.a=o,u||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[t,i,a,o]))}static parse(t){if(t instanceof Qe)return t;if(typeof t!="string")return;const i=(function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=ka(Qn,a);if(o){const[p,m,_]=o;return[p/255,m/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const p=a.length<6?1:2;let m=1;return[Da(a.slice(m,m+=p)),Da(a.slice(m,m+=p)),Da(a.slice(m,m+=p)),Da(a.slice(m,m+p)||"ff")]}if(a.startsWith("rgb")){const p=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[m,_,x,v,T,M,C,E,R,L,V,ie]=p,q=[v||" ",C||" ",L].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const Y=[x,M,R].join(""),oe=Y==="%%%"?100:Y===""?255:0;if(oe){const de=[vi(+_/oe,0,1),vi(+T/oe,0,1),vi(+E/oe,0,1),V?Io(+V,ie):1];if(nt(de))return de}}return}}const u=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[p,m,_,x,v,T,M,C,E]=u,R=[_||" ",v||" ",M].join("");if(R===" "||R===" /"||R===",,"||R===",,,"){const L=[+m,vi(+x,0,100),vi(+T,0,100),C?Io(+C,E):1];if(nt(L))return(function([V,ie,q,Y]){function oe(de){const xe=(de+V/30)%12,ze=ie*Math.min(q,1-q);return q-ze*Math.max(-1,Math.min(xe-3,9-xe,1))}return V=Fl(V),ie/=100,q/=100,[oe(0),oe(8),oe(4),Y]})(L)}}})(t);return i?new Qe(...i,!1):void 0}get rgb(){const{r:t,g:i,b:a,a:o}=this,u=o||1/0;return this.overwriteGetter("rgb",[t/u,i/u,a/u,o])}get hcl(){return this.overwriteGetter("hcl",(function(t){const[i,a,o,u]=So(t),p=Math.sqrt(a*a+o*o);return[Math.round(1e4*p)?Fl(Math.atan2(o,a)*Xc):NaN,p,i,u]})(this.rgb))}get lab(){return this.overwriteGetter("lab",So(this.rgb))}overwriteGetter(t,i){return Object.defineProperty(this,t,{value:i}),i}toString(){const[t,i,a,o]=this.rgb;return"rgba(".concat([t,i,a].map((u=>Math.round(255*u))).join(","),",").concat(o,")")}static interpolate(t,i,a,o="rgb"){switch(o){case"rgb":{const[u,p,m,_]=Mn(t.rgb,i.rgb,a);return new Qe(u,p,m,_,!1)}case"hcl":{const[u,p,m,_]=t.hcl,[x,v,T,M]=i.hcl;let C,E;if(isNaN(u)||isNaN(x))isNaN(u)?isNaN(x)?C=NaN:(C=x,m!==1&&m!==0||(E=v)):(C=u,T!==1&&T!==0||(E=p));else{let q=x-u;x>u&&q>180?q-=360:x<u&&u-x>180&&(q+=360),C=u+a*q}const[R,L,V,ie]=(function([q,Y,oe,de]){return q=isNaN(q)?0:q*Hc,Bl([oe,Math.cos(q)*Y,Math.sin(q)*Y,de])})([C,E!=null?E:bi(p,v,a),bi(m,T,a),bi(_,M,a)]);return new Qe(R,L,V,ie,!1)}case"lab":{const[u,p,m,_]=Bl(Mn(t.lab,i.lab,a));return new Qe(u,p,m,_,!1)}}}}Qe.black=new Qe(0,0,0,1),Qe.white=new Qe(1,1,1,1),Qe.transparent=new Qe(0,0,0,0),Qe.red=new Qe(1,0,0,1);class Ra{constructor(t,i,a){this.sensitivity=t?i?"variant":"case":i?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,i){return this.collator.compare(t,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const La=["bottom","center","top"];class ea{constructor(t,i,a,o,u,p){this.text=t,this.image=i,this.scale=a,this.fontStack=o,this.textColor=u,this.verticalAlign=p}}class Ii{constructor(t){this.sections=t}static fromString(t){return new Ii([new ea(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((t=>t.text.length!==0||t.image&&t.image.name.length!==0))}static factory(t){return t instanceof Ii?t:Ii.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map((t=>t.text)).join("")}}class ci{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ci)return t;if(typeof t=="number")return new ci([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const i of t)if(typeof i!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new ci(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a){return new ci(Mn(t.values,i.values,a))}}class Qt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Qt)return t;if(typeof t=="number")return new Qt([t]);if(Array.isArray(t)){for(const i of t)if(typeof i!="number")return;return new Qt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a){return new Qt(Mn(t.values,i.values,a))}}class hi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof hi)return t;if(typeof t=="string"){const a=Qe.parse(t);return a?new hi([a]):void 0}if(!Array.isArray(t))return;const i=[];for(const a of t){if(typeof a!="string")return;const o=Qe.parse(a);if(!o)return;i.push(o)}return new hi(i)}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a,o="rgb"){const u=[];if(t.values.length!=i.values.length)throw new Error("colorArray: Arrays have mismatched length (".concat(t.values.length," vs. ").concat(i.values.length,"), cannot interpolate."));for(let p=0;p<t.values.length;p++)u.push(Qe.interpolate(t.values[p],i.values[p],a,o));return new hi(u)}}class vt extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const ta=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class wi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof wi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let i=0;i<t.length;i+=2){const a=t[i],o=t[i+1];if(typeof a!="string"||!ta.has(a)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new wi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,i,a){const o=t.values,u=i.values;if(o.length!==u.length)throw new vt("Cannot interpolate values of different length. from: ".concat(t.toString(),", to: ").concat(i.toString()));const p=[];for(let m=0;m<o.length;m+=2){if(o[m]!==u[m])throw new vt("Cannot interpolate values containing mismatched anchors. from[".concat(m,"]: ").concat(o[m],", to[").concat(m,"]: ").concat(u[m]));p.push(o[m]);const[_,x]=o[m+1],[v,T]=u[m+1];p.push([bi(_,v,a),bi(x,T,a)])}return new wi(p)}}class Ni{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Ni({name:t,available:!1}):null}}class zi{constructor(t,i,a){this.from=t,this.to=i,this.transition=a}static interpolate(t,i,a){return new zi(t,i,a)}static parse(t){return t instanceof zi?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new zi(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new zi(t.from,t.to,t.transition):typeof t=="string"?new zi(t,t,1):void 0}}function Fa(r,t,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value [".concat([r,t,i,a].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat((typeof a=="number"?[r,t,i,a]:[r,t,i]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function mt(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof zi||r instanceof Qe||r instanceof Ra||r instanceof Ii||r instanceof ci||r instanceof Qt||r instanceof hi||r instanceof wi||r instanceof Ni)return!0;if(Array.isArray(r)){for(const t of r)if(!mt(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!mt(r[t]))return!1;return!0}return!1}function At(r){if(r===null)return Ht;if(typeof r=="string")return Ke;if(typeof r=="boolean")return Ye;if(typeof r=="number")return Me;if(r instanceof Qe)return ji;if(r instanceof zi)return Sr;if(r instanceof Ra)return Yn;if(r instanceof Ii)return za;if(r instanceof ci)return bn;if(r instanceof Qt)return Dr;if(r instanceof hi)return Ea;if(r instanceof wi)return jt;if(r instanceof Ni)return wn;if(Array.isArray(r)){const t=r.length;let i;for(const a of r){const o=At(a);if(i){if(i===o)continue;i=He;break}i=o}return Vi(i||He,t)}return Mr}function it(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof Qe||r instanceof zi||r instanceof Ii||r instanceof ci||r instanceof Qt||r instanceof hi||r instanceof wi||r instanceof Ni?r.toString():JSON.stringify(r)}class qe{constructor(t,i){this.type=t,this.value=i}static parse(t,i){if(t.length!==2)return i.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!mt(t[1]))return i.error("invalid value");const a=t[1];let o=At(a);const u=i.expectedType;return o.kind!=="array"||o.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(o=u),new qe(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const ia={string:Ke,number:Me,boolean:Ye,object:Mr};class Xe{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a,o=1;const u=t[0];if(u==="array"){let m,_;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in ia)||x==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);m=ia[x],o++}else m=He;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return i.error('The length argument to "array" must be a positive integer literal',2);_=t[2],o++}a=Vi(m,_)}else{if(!ia[u])throw new Error("Types doesn't contain name = ".concat(u));a=ia[u]}const p=[];for(;o<t.length;o++){const m=i.parse(t[o],o,He);if(!m)return null;p.push(m)}return new Xe(a,p)}evaluate(t){for(let i=0;i<this.args.length;i++){const a=this.args[i].evaluate(t);if(!Kn(this.type,At(a)))return a;
5if(i===this.args.length-1)throw new vt("Expected value to be of type ".concat(Pt(this.type),", but found ").concat(Pt(At(a))," instead."))}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const ys={"to-boolean":Ye,"to-color":ji,"to-number":Me,"to-string":Ke};class gi{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[0];if(!ys[a])throw new Error("Can't parse ".concat(a," as it is not part of the known types"));if((a==="to-boolean"||a==="to-string")&&t.length!==2)return i.error("Expected one argument.");const o=ys[a],u=[];for(let p=1;p<t.length;p++){const m=i.parse(t[p],p,He);if(!m)return null;u.push(m)}return new gi(o,u)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let i,a;for(const o of this.args){if(i=o.evaluate(t),a=null,i instanceof Qe)return i;if(typeof i=="string"){const u=t.parseColor(i);if(u)return u}else if(Array.isArray(i)&&(a=i.length<3||i.length>4?"Invalid rgba value ".concat(JSON.stringify(i),": expected an array containing either three or four numeric values."):Fa(i[0],i[1],i[2],i[3]),!a))return new Qe(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new vt(a||"Could not parse color from value '".concat(typeof i=="string"?i:JSON.stringify(i),"'"))}case"padding":{let i;for(const a of this.args){i=a.evaluate(t);const o=ci.parse(i);if(o)return o}throw new vt("Could not parse padding from value '".concat(typeof i=="string"?i:JSON.stringify(i),"'"))}case"numberArray":{let i;for(const a of this.args){i=a.evaluate(t);const o=Qt.parse(i);if(o)return o}throw new vt("Could not parse numberArray from value '".concat(typeof i=="string"?i:JSON.stringify(i),"'"))}case"colorArray":{let i;for(const a of this.args){i=a.evaluate(t);const o=hi.parse(i);if(o)return o}throw new vt("Could not parse colorArray from value '".concat(typeof i=="string"?i:JSON.stringify(i),"'"))}case"variableAnchorOffsetCollection":{let i;for(const a of this.args){i=a.evaluate(t);const o=wi.parse(i);if(o)return o}throw new vt("Could not parse variableAnchorOffsetCollection from value '".concat(typeof i=="string"?i:JSON.stringify(i),"'"))}case"number":{let i=null;for(const a of this.args){if(i=a.evaluate(t),i===null)return 0;const o=Number(i);if(!isNaN(o))return o}throw new vt("Could not convert ".concat(JSON.stringify(i)," to number."))}case"formatted":return Ii.fromString(it(this.args[0].evaluate(t)));case"resolvedImage":return Ni.fromString(it(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return it(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const zo=["Unknown","Point","LineString","Polygon"];class Ba{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?zo[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let i=this._parseColorCache.get(t);return i||(i=Qe.parse(t),this._parseColorCache.set(t,i)),i}}class Oa{constructor(t,i,a=[],o,u=new Oi,p=[]){this.registry=t,this.path=a,this.key=a.map((m=>"[".concat(m,"]"))).join(""),this.scope=u,this.errors=p,this.expectedType=o,this._isConstant=i}parse(t,i,a,o,u={}){return i?this.concat(i,a,o)._parse(t,u):this._parse(t,u)}_parse(t,i){function a(o,u,p){return p==="assert"?new Xe(u,[o]):p==="coerce"?new gi(u,[o]):o}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=t[0];if(typeof o!="string")return this.error("Expression name must be a string, but found ".concat(typeof o,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;const u=this.registry[o];if(u){let p=u.parse(t,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,_=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||_.kind!=="value"){if(m.kind==="projectionDefinition"&&["string","array"].includes(_.kind)||["color","formatted","resolvedImage"].includes(m.kind)&&["value","string"].includes(_.kind)||["padding","numberArray"].includes(m.kind)&&["value","number","array"].includes(_.kind)||m.kind==="colorArray"&&["value","string","array"].includes(_.kind)||m.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(_.kind))p=a(p,m,i.typeAnnotation||"coerce");else if(this.checkSubtype(m,_))return null}else p=a(p,m,i.typeAnnotation||"assert")}if(!(p instanceof qe)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const m=new Ba;try{p=new qe(p.type,p.evaluate(m))}catch(_){return this.error(_.message),null}}return p}return this.error('Unknown expression "'.concat(o,'". If you wanted a literal array, use ["literal", [...]].'),0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found ".concat(typeof t," instead."))}concat(t,i,a){const o=typeof t=="number"?this.path.concat(t):this.path,u=a?this.scope.concat(a):this.scope;return new Oa(this.registry,this._isConstant,o,i||null,u,this.errors)}error(t,...i){const a="".concat(this.key).concat(i.map((o=>"[".concat(o,"]"))).join(""));this.errors.push(new Bi(a,t))}checkSubtype(t,i){const a=Kn(t,i);return a&&this.error(a),a}}class ra{constructor(t,i){this.type=i.type,this.bindings=[].concat(t),this.result=i}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const i of this.bindings)t(i[1]);t(this.result)}static parse(t,i){if(t.length<4)return i.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));const a=[];for(let u=1;u<t.length-1;u+=2){const p=t[u];
5if(typeof p!="string")return i.error("Expected string, but found ".concat(typeof p," instead."),u);if(/[^a-zA-Z0-9_]/.test(p))return i.error("Variable names must contain only alphanumeric characters or '_'.",u);const m=i.parse(t[u+1],u+1);if(!m)return null;a.push([p,m])}const o=i.parse(t[t.length-1],t.length-1,i.expectedType,a);return o?new ra(a,o):null}outputDefined(){return this.result.outputDefined()}}class ja{constructor(t,i){this.type=i.type,this.name=t,this.boundExpression=i}static parse(t,i){if(t.length!==2||typeof t[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const a=t[1];return i.scope.has(a)?new ja(a,i.scope.get(a)):i.error('Unknown variable "'.concat(a,'". Make sure "').concat(a,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Eo{constructor(t,i,a){this.type=t,this.index=i,this.input=a}static parse(t,i){if(t.length!==3)return i.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));const a=i.parse(t[1],1,Me),o=i.parse(t[2],2,Vi(i.expectedType||He));return a&&o?new Eo(o.type.itemType,a,o):null}evaluate(t){const i=this.index.evaluate(t),a=this.input.evaluate(t);if(i<0)throw new vt("Array index out of bounds: ".concat(i," < 0."));if(i>=a.length)throw new vt("Array index out of bounds: ".concat(i," > ").concat(a.length-1,"."));if(i!==Math.floor(i))throw new vt("Array index must be an integer, but found ".concat(i," instead."));return a[i]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class xs{constructor(t,i){this.type=Ye,this.needle=t,this.haystack=i}static parse(t,i){if(t.length!==3)return i.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));const a=i.parse(t[1],1,He),o=i.parse(t[2],2,He);return a&&o?To(a.type,[Ye,Ke,Me,Ht,He])?new xs(a,o):i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Pt(a.type)," instead")):null}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!Tn(i,["boolean","string","number","null"]))throw new vt("Expected first argument to be of type boolean, string, number or null, but found ".concat(Pt(At(i))," instead."));if(!Tn(a,["string","array"]))throw new vt("Expected second argument to be of type array or string, but found ".concat(Pt(At(a))," instead."));return a.indexOf(i)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Va{constructor(t,i,a){this.type=Me,this.needle=t,this.haystack=i,this.fromIndex=a}static parse(t,i){if(t.length<=2||t.length>=5)return i.error("Expected 2 or 3 arguments, but found ".concat(t.length-1," instead."));const a=i.parse(t[1],1,He),o=i.parse(t[2],2,He);if(!a||!o)return null;if(!To(a.type,[Ye,Ke,Me,Ht,He]))return i.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Pt(a.type)," instead"));if(t.length===4){const u=i.parse(t[3],3,Me);return u?new Va(a,o,u):null}return new Va(a,o)}evaluate(t){const i=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!Tn(i,["boolean","string","number","null"]))throw new vt("Expected first argument to be of type boolean, string, number or null, but found ".concat(Pt(At(i))," instead."));let o;if(this.fromIndex&&(o=this.fromIndex.evaluate(t)),Tn(a,["string"])){const u=a.indexOf(i,o);return u===-1?-1:[...a.slice(0,u)].length}if(Tn(a,["array"]))return a.indexOf(i,o);throw new vt("Expected second argument to be of type array or string, but found ".concat(Pt(At(a))," instead."))}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Cr{constructor(t,i,a,o,u,p){this.inputType=t,this.type=i,this.input=a,this.cases=o,this.outputs=u,this.otherwise=p}static parse(t,i){if(t.length<5)return i.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=1)return i.error("Expected an even number of arguments.");let a,o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const u={},p=[];for(let x=2;x<t.length-1;x+=2){let v=t[x];const T=t[x+1];Array.isArray(v)||(v=[v]);const M=i.concat(x);if(v.length===0)return M.error("Expected at least one branch label.");
vendor: 47,478 bytes, line 5
5for(const E of v){if(typeof E!="number"&&typeof E!="string")return M.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return M.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof E=="number"&&Math.floor(E)!==E)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,At(E)))return null}else a=At(E);if(u[String(E)]!==void 0)return M.error("Branch labels must be unique.");u[String(E)]=p.length}const C=i.parse(T,x,o);if(!C)return null;o=o||C.type,p.push(C)}const m=i.parse(t[1],1,He);if(!m)return null;const _=i.parse(t[t.length-1],t.length-1,o);return _?m.type.kind!=="value"&&i.concat(1).checkSubtype(a,m.type)?null:new Cr(a,o,m,u,p,_):null}evaluate(t){const i=this.input.evaluate(t);return(At(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class ei{constructor(t,i,a){this.type=t,this.branches=i,this.otherwise=a}static parse(t,i){if(t.length<4)return i.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return i.error("Expected an odd number of arguments.");let a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);const o=[];for(let p=1;p<t.length-1;p+=2){const m=i.parse(t[p],p,Ye);if(!m)return null;const _=i.parse(t[p+1],p+1,a);if(!_)return null;o.push([m,_]),a=a||_.type}const u=i.parse(t[t.length-1],t.length-1,a);if(!u)return null;if(!a)throw new Error("Can't infer output type");return new ei(a,o,u)}evaluate(t){for(const[i,a]of this.branches)if(i.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[i,a]of this.branches)t(i),t(a);t(this.otherwise)}outputDefined(){return this.branches.every((([t,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class Cn{constructor(t,i,a,o){this.type=t,this.input=i,this.beginIndex=a,this.endIndex=o}static parse(t,i){if(t.length<=2||t.length>=5)return i.error("Expected 2 or 3 arguments, but found ".concat(t.length-1," instead."));const a=i.parse(t[1],1,He),o=i.parse(t[2],2,Me);if(!a||!o)return null;if(!To(a.type,[Vi(He),Ke,He]))return i.error("Expected first argument to be of type array or string, but found ".concat(Pt(a.type)," instead"));if(t.length===4){const u=i.parse(t[3],3,Me);return u?new Cn(a.type,a,o,u):null}return new Cn(a.type,a,o)}evaluate(t){const i=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let o;if(this.endIndex&&(o=this.endIndex.evaluate(t)),Tn(i,["string"]))return[...i].slice(a,o).join("");if(Tn(i,["array"]))return i.slice(a,o);throw new vt("Expected first argument to be of type array or string, but found ".concat(Pt(At(i))," instead."))}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Na(r,t){const i=r.length-1;let a,o,u=0,p=i,m=0;for(;u<=p;)if(m=Math.floor((u+p)/2),a=r[m],o=r[m+1],a<=t){if(m===i||t<o)return m;u=m+1}else{if(!(a>t))throw new vt("Input is not a number.");p=m-1}return 0}class Jr{constructor(t,i,a){this.type=t,this.input=i,this.labels=[],this.outputs=[];for(const[o,u]of a)this.labels.push(o),this.outputs.push(u)}static parse(t,i){if(t.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");const a=i.parse(t[1],1,Me);if(!a)return null;const o=[];let u=null;i.expectedType&&i.expectedType.kind!=="value"&&(u=i.expectedType);for(let p=1;p<t.length;p+=2){const m=p===1?-1/0:t[p],_=t[p+1],x=p,v=p+1;if(typeof m!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(o.length&&o[o.length-1][0]>=m)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const T=i.parse(_,v,u);if(!T)return null;u=u||T.type,o.push([m,T])}return new Jr(u,a,o)}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const o=this.input.evaluate(t);if(o<=i[0])return a[0].evaluate(t);const u=i.length;return o>=i[u-1]?a[u-1].evaluate(t):a[Na(i,o)].evaluate(t)}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function ti(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var vs,bs,Ol=(function(){if(bs)return vs;function r(t,i,a,o){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=a,this.p2y=o}return bs=1,vs=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,i){if(i===void 0&&(i=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,o=0;o<8;o++){var u=this.sampleCurveX(a)-t;if(Math.abs(u)<i)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=u/p}var m=0,_=1;for(a=t,o=0;o<20&&(u=this.sampleCurveX(a),!(Math.abs(u-t)<i));o++)t>u?m=a:_=a,a=.5*(_-m)+m;return a},solve:function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))}},vs})(),Kc=ti(Ol);class Xt{constructor(t,i,a,o,u){this.type=t,this.operator=i,this.interpolation=a,this.input=o,this.labels=[],this.outputs=[];for(const[p,m]of u)this.labels.push(p),this.outputs.push(m)}static interpolationFactor(t,i,a,o){let u=0;if(t.name==="exponential")u=na(i,t.base,a,o);else if(t.name==="linear")u=na(i,1,a,o);else if(t.name==="cubic-bezier"){const p=t.controlPoints;u=new Kc(p[0],p[1],p[2],p[3]).solve(na(i,1,a,o))}return u}static parse(t,i){let[a,o,u,...p]=t;if(!Array.isArray(o)||o.length===0)return i.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const x=o[1];if(typeof x!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:x}}else{if(o[0]!=="cubic-bezier")return i.error("Unknown interpolation type ".concat(String(o[0])),1,0);{const x=o.slice(1);if(x.length!==4||x.some((v=>typeof v!="number"||v<0||v>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return i.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(u=i.parse(u,2,Me),!u)return null;const m=[];let _=null;a!=="interpolate-hcl"&&a!=="interpolate-lab"||i.expectedType==Ea?i.expectedType&&i.expectedType.kind!=="value"&&(_=i.expectedType):_=ji;for(let x=0;x<p.length;x+=2){const v=p[x],T=p[x+1],M=x+3,C=x+4;if(typeof v!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',M);if(m.length&&m[m.length-1][0]>=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const E=i.parse(T,C,_);if(!E)return null;_=_||E.type,m.push([v,E])}return Rr(_,Me)||Rr(_,Sr)||Rr(_,ji)||Rr(_,bn)||Rr(_,Dr)||Rr(_,Ea)||Rr(_,jt)||Rr(_,Vi(Me))?new Xt(_,a,o,u,m):i.error("Type ".concat(Pt(_)," is not interpolatable."))}evaluate(t){const i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(t);const o=this.input.evaluate(t);if(o<=i[0])return a[0].evaluate(t);const u=i.length;if(o>=i[u-1])return a[u-1].evaluate(t);const p=Na(i,o),m=Xt.interpolationFactor(this.interpolation,o,i[p],i[p+1]),_=a[p].evaluate(t),x=a[p+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return bi(_,x,m);case"color":return Qe.interpolate(_,x,m);case"padding":return ci.interpolate(_,x,m);case"colorArray":return hi.interpolate(_,x,m);case"numberArray":return Qt.interpolate(_,x,m);case"variableAnchorOffsetCollection":return wi.interpolate(_,x,m);case"array":return Mn(_,x,m);case"projectionDefinition":return zi.interpolate(_,x,m)}case"interpolate-hcl":switch(this.type.kind){case"color":return Qe.interpolate(_,x,m,"hcl");case"colorArray":return hi.interpolate(_,x,m,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Qe.interpolate(_,x,m,"lab");case"colorArray":return hi.interpolate(_,x,m,"lab")}}}eachChild(t){t(this.input);for(const i of this.outputs)t(i)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function na(r,t,i,a){const o=a-i,u=r-i;return o===0?0:t===1?u/o:(Math.pow(t,u)-1)/(Math.pow(t,o)-1)}const Qi={color:Qe.interpolate,number:bi,padding:ci.interpolate,numberArray:Qt.interpolate,colorArray:hi.interpolate,variableAnchorOffsetCollection:wi.interpolate,array:Mn};class ws{constructor(t,i){this.type=t,this.args=i}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");let a=null;const o=i.expectedType;o&&o.kind!=="value"&&(a=o);const u=[];for(const m of t.slice(1)){const _=i.parse(m,1+u.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,u.push(_)}if(!a)throw new Error("No output type");const p=o&&u.some((m=>Kn(o,m.type)));return new ws(p?He:a,u)}evaluate(t){let i,a=null,o=0;for(const u of this.args)if(o++,a=u.evaluate(t),a&&a instanceof Ni&&!a.available&&(i||(i=a.name),a=null,o===this.args.length&&(a=i)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ao(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Ua(r,t,i,a){return a.compare(t,i)===0}function Lr(r,t,i){const a=r!=="=="&&r!=="!=";return class $d{constructor(u,p,m){this.type=Ye,this.lhs=u,this.rhs=p,this.collator=m,this.hasUntypedArgument=u.type.kind==="value"||p.type.kind==="value"}static parse(u,p){if(u.length!==3&&u.length!==4)return p.error("Expected two or three arguments.");const m=u[0];let _=p.parse(u[1],1,He);if(!_)return null;if(!Ao(m,_.type))return p.concat(1).error('"'.concat(m,"\" comparisons are not supported for type '").concat(Pt(_.type),"'."));let x=p.parse(u[2],2,He);if(!x)return null;if(!Ao(m,x.type))return p.concat(2).error('"'.concat(m,"\" comparisons are not supported for type '").concat(Pt(x.type),"'."));if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot compare types '".concat(Pt(_.type),"' and '").concat(Pt(x.type),"'."));a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Xe(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Xe(_.type,[x])));let v=null;if(u.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(v=p.parse(u[3],3,Yn),!v)return null}return new $d(_,x,v)}evaluate(u){const p=this.lhs.evaluate(u),m=this.rhs.evaluate(u);if(a&&this.hasUntypedArgument){const _=At(p),x=At(m);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new vt('Expected arguments for "'.concat(r,'" to be (string, string) or (number, number), but found (').concat(_.kind,", ").concat(x.kind,") instead."))}if(this.collator&&!a&&this.hasUntypedArgument){const _=At(p),x=At(m);if(_.kind!=="string"||x.kind!=="string")return t(u,p,m)}return this.collator?i(u,p,m,this.collator.evaluate(u)):t(u,p,m)}eachChild(u){u(this.lhs),u(this.rhs),this.collator&&u(this.collator)}outputDefined(){return!0}}}const hr=Lr("==",(function(r,t,i){return t===i}),Ua),jl=Lr("!=",(function(r,t,i){return t!==i}),(function(r,t,i,a){return!Ua(0,t,i,a)})),Ts=Lr("<",(function(r,t,i){return t<i}),(function(r,t,i,a){return a.compare(t,i)<0})),Jc=Lr(">",(function(r,t,i){return t>i}),(function(r,t,i,a){return a.compare(t,i)>0})),ko=Lr("<=",(function(r,t,i){return t<=i}),(function(r,t,i,a){return a.compare(t,i)<=0})),Qc=Lr(">=",(function(r,t,i){return t>=i}),(function(r,t,i,a){return a.compare(t,i)>=0}));class Ps{constructor(t,i,a){this.type=Yn,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=i}static parse(t,i){if(t.length!==2)return i.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return i.error("Collator options argument must be an object.");const o=i.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ye);if(!o)return null;const u=i.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ye);if(!u)return null;let p=null;return a.locale&&(p=i.parse(a.locale,1,Ke),!p)?null:new Ps(o,u,p)}evaluate(t){return new Ra(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Do{constructor(t,i,a,o,u){this.type=Ke,this.number=t,this.locale=i,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=u}static parse(t,i){if(t.length!==3)return i.error("Expected two arguments.");const a=i.parse(t[1],1,Me);if(!a)return null;const o=t[2];if(typeof o!="object"||Array.isArray(o))return i.error("NumberFormat options argument must be an object.");let u=null;if(o.locale&&(u=i.parse(o.locale,1,Ke),!u))return null;let p=null;if(o.currency&&(p=i.parse(o.currency,1,Ke),!p))return null;let m=null;if(o["min-fraction-digits"]&&(m=i.parse(o["min-fraction-digits"],1,Me),!m))return null;let _=null;return o["max-fraction-digits"]&&(_=i.parse(o["max-fraction-digits"],1,Me),!_)?null:new Do(a,u,p,m,_)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ss{constructor(t){this.type=za,this.sections=t}static parse(t,i){if(t.length<2)return i.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");const o=[];let u=!1;for(let p=1;p<=t.length-1;++p){const m=t[p];if(u&&typeof m=="object"&&!Array.isArray(m)){u=!1;let _=null;if(m["font-scale"]&&(_=i.parse(m["font-scale"],1,Me),!_))return null;let x=null;if(m["text-font"]&&(x=i.parse(m["text-font"],1,Vi(Ke)),!x))return null;let v=null;if(m["text-color"]&&(v=i.parse(m["text-color"],1,ji),!v))return null;let T=null;if(m["vertical-align"]){if(typeof m["vertical-align"]=="string"&&!La.includes(m["vertical-align"]))return i.error("'vertical-align' must be one of: 'bottom', 'center', 'top' but found '".concat(m["vertical-align"],"' instead."));if(T=i.parse(m["vertical-align"],1,Ke),!T)return null}const M=o[o.length-1];M.scale=_,M.font=x,M.textColor=v,M.verticalAlign=T}else{const _=i.parse(t[p],1,He);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,o.push({content:_,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ss(o)}evaluate(t){return new Ii(this.sections.map((i=>{const a=i.content.evaluate(t);return At(a)===wn?new ea("",a,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(t):null):new ea(it(a),null,i.scale?i.scale.evaluate(t):null,i.font?i.font.evaluate(t).join(","):null,i.textColor?i.textColor.evaluate(t):null,i.verticalAlign?i.verticalAlign.evaluate(t):null)})))}eachChild(t){for(const i of this.sections)t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor),i.verticalAlign&&t(i.verticalAlign)}outputDefined(){return!1}}class aa{constructor(t){this.type=wn,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected two arguments.");const a=i.parse(t[1],1,Ke);return a?new aa(a):i.error("No image name provided.")}evaluate(t){const i=this.input.evaluate(t),a=Ni.fromString(i);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(i)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ro{constructor(t){this.type=Me,this.input=t}static parse(t,i){if(t.length!==2)return i.error("Expected 1 argument, but found ".concat(t.length-1," instead."));const a=i.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error("Expected argument of type string or array, but found ".concat(Pt(a.type)," instead.")):new Ro(a):null}evaluate(t){const i=this.input.evaluate(t);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new vt("Expected value to be of type string or array, but found ".concat(Pt(At(i))," instead."))}eachChild(t){t(this.input)}outputDefined(){return!1}}const ur=8192;function Vl(r,t){const i=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,o=Math.pow(2,t.z);return[Math.round(i*o*ur),Math.round(a*o*ur)]}function Lo(r,t){const i=Math.pow(2,t.z);return[(o=(r[0]/ur+t.x)/i,360*o-180),(a=(r[1]/ur+t.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,o}function sa(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function $a(r,t){return!(r[0]<=t[0]||r[2]>=t[2]||r[1]<=t[1]||r[3]>=t[3])}function eh(r,t,i){const a=r[0]-t[0],o=r[1]-t[1],u=r[0]-i[0],p=r[1]-i[1];return a*p-u*o==0&&a*u<=0&&o*p<=0}function Ms(r,t,i,a){return(o=[a[0]-i[0],a[1]-i[1]])[0]*(u=[t[0]-r[0],t[1]-r[1]])[1]-o[1]*u[0]!=0&&!(!$l(r,t,i,a)||!$l(i,a,r,t));var o,u}function th(r,t,i){for(const a of i)for(let o=0;o<a.length-1;++o)if(Ms(r,t,a[o],a[o+1]))return!0;return!1}function oa(r,t,i=!1){let a=!1;for(const m of t)for(let _=0;_<m.length-1;_++){if(eh(r,m[_],m[_+1]))return i;(u=m[_])[1]>(o=r)[1]!=(p=m[_+1])[1]>o[1]&&o[0]<(p[0]-u[0])*(o[1]-u[1])/(p[1]-u[1])+u[0]&&(a=!a)}var o,u,p;return a}function Nl(r,t){for(const i of t)if(oa(r,i))return!0;return!1}function Fo(r,t){for(const i of r)if(!oa(i,t))return!1;for(let i=0;i<r.length-1;++i)if(th(r[i],r[i+1],t))return!1;return!0}function Ul(r,t){for(const i of t)if(Fo(r,i))return!0;return!1}function $l(r,t,i,a){const o=a[0]-i[0],u=a[1]-i[1],p=(r[0]-i[0])*u-o*(r[1]-i[1]),m=(t[0]-i[0])*u-o*(t[1]-i[1]);return p>0&&m<0||p<0&&m>0}function Bo(r,t,i){const a=[];for(let o=0;o<r.length;o++){const u=[];for(let p=0;p<r[o].length;p++){const m=Vl(r[o][p],i);sa(t,m),u.push(m)}a.push(u)}return a}function Zl(r,t,i){const a=[];for(let o=0;o<r.length;o++){const u=Bo(r[o],t,i);a.push(u)}return a}function Gl(r,t,i,a){if(r[0]<i[0]||r[0]>i[2]){const o=.5*a;let u=r[0]-i[0]>o?-a:i[0]-r[0]>o?a:0;u===0&&(u=r[0]-i[2]>o?-a:i[2]-r[0]>o?a:0),r[0]+=u}sa(t,r)}function Za(r,t,i,a){const o=Math.pow(2,a.z)*ur,u=[a.x*ur,a.y*ur],p=[];for(const m of r)for(const _ of m){const x=[_.x+u[0],_.y+u[1]];Gl(x,t,i,o),p.push(x)}return p}function ql(r,t,i,a){const o=Math.pow(2,a.z)*ur,u=[a.x*ur,a.y*ur],p=[];for(const _ of r){const x=[];for(const v of _){const T=[v.x+u[0],v.y+u[1]];sa(t,T),x.push(T)}p.push(x)}if(t[2]-t[0]<=o/2){(m=t)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const _ of p)for(const x of _)Gl(x,t,i,o)}var m;return p}class In{constructor(t,i){this.type=Ye,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(mt(t[1])){const a=t[1];if(a.type==="FeatureCollection"){const o=[];for(const u of a.features){const{type:p,coordinates:m}=u.geometry;p==="Polygon"&&o.push(m),p==="MultiPolygon"&&o.push(...m)}if(o.length)return new In(a,{type:"MultiPolygon",coordinates:o})}else if(a.type==="Feature"){const o=a.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new In(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new In(a,a)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(i,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=i.canonicalID();if(a.type==="Polygon"){const m=Bo(a.coordinates,u,p),_=Za(i.geometry(),o,u,p);if(!$a(o,u))return!1;for(const x of _)if(!oa(x,m))return!1}if(a.type==="MultiPolygon"){const m=Zl(a.coordinates,u,p),_=Za(i.geometry(),o,u,p);if(!$a(o,u))return!1;for(const x of _)if(!Nl(x,m))return!1}return!0})(t,this.geometries);if(t.geometryType()==="LineString")return(function(i,a){const o=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],p=i.canonicalID();if(a.type==="Polygon"){const m=Bo(a.coordinates,u,p),_=ql(i.geometry(),o,u,p);if(!$a(o,u))return!1;for(const x of _)if(!Fo(x,m))return!1}if(a.type==="MultiPolygon"){const m=Zl(a.coordinates,u,p),_=ql(i.geometry(),o,u,p);if(!$a(o,u))return!1;for(const x of _)if(!Ul(x,m))return!1}return!0})(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Wl=class{constructor(r=[],t=(i,a)=>i<a?-1:i>a?1:0){if(this.data=r,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:t,compare:i}=this,a=t[r];for(;r>0;){const o=r-1>>1,u=t[o];if(i(a,u)>=0)break;t[r]=u,r=o}t[r]=a}_down(r){const{data:t,compare:i}=this,a=this.length>>1,o=t[r];for(;r<a;){let u=1+(r<<1);const p=u+1;if(p<this.length&&i(t[p],t[u])<0&&(u=p),i(t[u],o)>=0)break;t[r]=t[u],r=u}t[r]=o}};function Hl(r,t,i=0,a=r.length-1,o=Xl){for(;a>i;){if(a-i>600){const _=a-i+1,x=t-i+1,v=Math.log(_),T=.5*Math.exp(2*v/3),M=.5*Math.sqrt(v*T*(_-T)/_)*(x-_/2<0?-1:1);Hl(r,t,Math.max(i,Math.floor(t-x*T/_+M)),Math.min(a,Math.floor(t+(_-x)*T/_+M)),o)}const u=r[t];let p=i,m=a;for(zn(r,i,t),o(r[a],u)>0&&zn(r,i,a);p<m;){for(zn(r,p,m),p++,m--;o(r[p],u)<0;)p++;for(;o(r[m],u)>0;)m--}o(r[i],u)===0?zn(r,i,m):(m++,zn(r,m,a)),m<=t&&(i=m+1),t<=m&&(a=m-1)}}function zn(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function Xl(r,t){return r<t?-1:r>t?1:0}function Cs(r,t){if(r.length<=1)return[r];const i=[];let a,o;for(const u of r){const p=Yl(u);p!==0&&(u.area=Math.abs(p),o===void 0&&(o=p<0),o===p<0?(a&&i.push(a),a=[u]):a.push(u))}if(a&&i.push(a),t>1)for(let u=0;u<i.length;u++)i[u].length<=t||(Hl(i[u],t,1,i[u].length-1,ih),i[u]=i[u].slice(0,t));return i}function ih(r,t){return t.area-r.area}function Yl(r){let t=0;for(let i,a,o=0,u=r.length,p=u-1;o<u;p=o++)i=r[o],a=r[p],t+=(a.x-i.x)*(i.y+a.y);return t}const Oo=1/298.257223563,Kl=Oo*(2-Oo),Jl=Math.PI/180;class jo{constructor(t){const i=6378.137*Jl*1e3,a=Math.cos(t*Jl),o=1/(1-Kl*(1-a*a)),u=Math.sqrt(o);this.kx=i*u*a,this.ky=i*u*o*(1-Kl)}distance(t,i){const a=this.wrap(t[0]-i[0])*this.kx,o=(t[1]-i[1])*this.ky;return Math.sqrt(a*a+o*o)}pointOnLine(t,i){let a,o,u,p,m=1/0;for(let _=0;_<t.length-1;_++){let x=t[_][0],v=t[_][1],T=this.wrap(t[_+1][0]-x)*this.kx,M=(t[_+1][1]-v)*this.ky,C=0;T===0&&M===0||(C=(this.wrap(i[0]-x)*this.kx*T+(i[1]-v)*this.ky*M)/(T*T+M*M),C>1?(x=t[_+1][0],v=t[_+1][1]):C>0&&(x+=T/this.kx*C,v+=M/this.ky*C)),T=this.wrap(i[0]-x)*this.kx,M=(i[1]-v)*this.ky;const E=T*T+M*M;E<m&&(m=E,a=x,o=v,u=_,p=C)}return{point:[a,o],index:u,t:Math.max(0,Math.min(1,p))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Vo(r,t){return t[0]-r[0]}function Is(r){return r[1]-r[0]+1}function Fr(r,t){return r[1]>=r[0]&&r[1]<t}function No(r,t){if(r[0]>r[1])return[null,null];const i=Is(r);if(t){if(i===2)return[r,null];const o=Math.floor(i/2);return[[r[0],r[0]+o],[r[0]+o,r[1]]]}if(i===1)return[r,null];const a=Math.floor(i/2)-1;return[[r[0],r[0]+a],[r[0]+a+1,r[1]]]}function Uo(r,t){if(!Fr(t,r.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)sa(i,r[a]);return i}function lt(r){const t=[1/0,1/0,-1/0,-1/0];for(const i of r)for(const a of i)sa(t,a);return t}function Ql(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function $o(r,t,i){if(!Ql(r)||!Ql(t))return NaN;let a=0,o=0;return r[2]<t[0]&&(a=t[0]-r[2]),r[0]>t[2]&&(a=r[0]-t[2]),r[1]>t[3]&&(o=r[1]-t[3]),r[3]<t[1]&&(o=t[1]-r[3]),i.distance([0,0],[a,o])}function En(r,t,i){const a=i.pointOnLine(t,r);return i.distance(r,a.point)}function Zo(r,t,i,a,o){const u=Math.min(En(r,[i,a],o),En(t,[i,a],o)),p=Math.min(En(i,[r,t],o),En(a,[r,t],o));return Math.min(u,p)}function rh(r,t,i,a,o){if(!Fr(t,r.length)||!Fr(a,i.length))return 1/0;let u=1/0;for(let p=t[0];p<t[1];++p){const m=r[p],_=r[p+1];for(let x=a[0];x<a[1];++x){const v=i[x],T=i[x+1];if(Ms(m,_,v,T))return 0;u=Math.min(u,Zo(m,_,v,T,o))}}return u}function nh(r,t,i,a,o){if(!Fr(t,r.length)||!Fr(a,i.length))return NaN;let u=1/0;for(let p=t[0];p<=t[1];++p)for(let m=a[0];m<=a[1];++m)if(u=Math.min(u,o.distance(r[p],i[m])),u===0)return u;return u}function ah(r,t,i){if(oa(r,t,!0))return 0;let a=1/0;for(const o of t){const u=o[0],p=o[o.length-1];if(u!==p&&(a=Math.min(a,En(r,[p,u],i)),a===0))return a;const m=i.pointOnLine(o,r);if(a=Math.min(a,i.distance(r,m.point)),a===0)return a}return a}function sh(r,t,i,a){if(!Fr(t,r.length))return NaN;for(let u=t[0];u<=t[1];++u)if(oa(r[u],i,!0))return 0;let o=1/0;for(let u=t[0];u<t[1];++u){const p=r[u],m=r[u+1];for(const _ of i)for(let x=0,v=_.length,T=v-1;x<v;T=x++){const M=_[T],C=_[x];if(Ms(p,m,M,C))return 0;o=Math.min(o,Zo(p,m,M,C,a))}}return o}function ec(r,t){for(const i of r)for(const a of i)if(oa(a,t,!0))return!0;return!1}function oh(r,t,i,a=1/0){const o=lt(r),u=lt(t);if(a!==1/0&&$o(o,u,i)>=a)return a;if($a(o,u)){if(ec(r,t))return 0}else if(ec(t,r))return 0;let p=1/0;for(const m of r)for(let _=0,x=m.length,v=x-1;_<x;v=_++){const T=m[v],M=m[_];for(const C of t)for(let E=0,R=C.length,L=R-1;E<R;L=E++){const V=C[L],ie=C[E];if(Ms(T,M,V,ie))return 0;p=Math.min(p,Zo(T,M,V,ie,i))}}return p}function tc(r,t,i,a,o,u){if(!u)return;const p=$o(Uo(a,u),o,i);p<t&&r.push([p,u,[0,0]])}function zs(r,t,i,a,o,u,p){if(!u||!p)return;const m=$o(Uo(a,u),Uo(o,p),i);m<t&&r.push([m,u,p])}function Es(r,t,i,a,o=1/0){let u=Math.min(a.distance(r[0],i[0][0]),o);if(u===0)return u;const p=new Wl([[0,[0,r.length-1],[0,0]]],Vo),m=lt(i);for(;p.length>0;){const _=p.pop();if(_[0]>=u)continue;const x=_[1],v=t?50:100;if(Is(x)<=v){if(!Fr(x,r.length))return NaN;if(t){const T=sh(r,x,i,a);if(isNaN(T)||T===0)return T;u=Math.min(u,T)}else for(let T=x[0];T<=x[1];++T){const M=ah(r[T],i,a);if(u=Math.min(u,M),u===0)return 0}}else{const T=No(x,t);tc(p,u,a,r,m,T[0]),tc(p,u,a,r,m,T[1])}}return u}function As(r,t,i,a,o,u=1/0){let p=Math.min(u,o.distance(r[0],i[0]));if(p===0)return p;const m=new Wl([[0,[0,r.length-1],[0,i.length-1]]],Vo);for(;m.length>0;){const _=m.pop();if(_[0]>=p)continue;const x=_[1],v=_[2],T=t?50:100,M=a?50:100;if(Is(x)<=T&&Is(v)<=M){if(!Fr(x,r.length)&&Fr(v,i.length))return NaN;let C;if(t&&a)C=rh(r,x,i,v,o),p=Math.min(p,C);else if(t&&!a){const E=r.slice(x[0],x[1]+1);for(let R=v[0];R<=v[1];++R)if(C=En(i[R],E,o),p=Math.min(p,C),p===0)return p}else if(!t&&a){const E=i.slice(v[0],v[1]+1);for(let R=x[0];R<=x[1];++R)if(C=En(r[R],E,o),p=Math.min(p,C),p===0)return p}else C=nh(r,x,i,v,o),p=Math.min(p,C)}else{const C=No(x,t),E=No(v,a);zs(m,p,o,r,i,C[0],E[0]),zs(m,p,o,r,i,C[0],E[1]),zs(m,p,o,r,i,C[1],E[0]),zs(m,p,o,r,i,C[1],E[1])}}return p}function Go(r){return r.type==="MultiPolygon"?r.coordinates.map((t=>({type:"Polygon",coordinates:t}))):r.type==="MultiLineString"?r.coordinates.map((t=>({type:"LineString",coordinates:t}))):r.type==="MultiPoint"?r.coordinates.map((t=>({type:"Point",coordinates:t}))):[r]}class An{constructor(t,i){this.type=Me,this.geojson=t,this.geometries=i}static parse(t,i){if(t.length!==2)return i.error("'distance' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(mt(t[1])){const a=t[1];if(a.type==="FeatureCollection")return new An(a,a.features.map((o=>Go(o.geometry))).flat());if(a.type==="Feature")return new An(a,Go(a.geometry));if("type"in a&&"coordinates"in a)return new An(a,Go(a))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return(function(i,a){const o=i.geometry(),u=o.flat().map((_=>Lo([_.x,_.y],i.canonical)));if(o.length===0)return NaN;const p=new jo(u[0][1]);let m=1/0;for(const _ of a){switch(_.type){case"Point":m=Math.min(m,As(u,!1,[_.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,As(u,!1,_.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,Es(u,!1,_.coordinates,p,m))}if(m===0)return m}return m})(t,this.geometries);if(t.geometryType()==="LineString")return(function(i,a){const o=i.geometry(),u=o.flat().map((_=>Lo([_.x,_.y],i.canonical)));if(o.length===0)return NaN;const p=new jo(u[0][1]);let m=1/0;for(const _ of a){switch(_.type){case"Point":m=Math.min(m,As(u,!0,[_.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,As(u,!0,_.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,Es(u,!0,_.coordinates,p,m))}if(m===0)return m}return m})(t,this.geometries);if(t.geometryType()==="Polygon")return(function(i,a){const o=i.geometry();if(o.length===0||o[0].length===0)return NaN;const u=Cs(o,0).map((_=>_.map((x=>x.map((v=>Lo([v.x,v.y],i.canonical))))))),p=new jo(u[0][0][0][1]);let m=1/0;for(const _ of a)for(const x of u){switch(_.type){case"Point":m=Math.min(m,Es([_.coordinates],!1,x,p,m));break;case"LineString":m=Math.min(m,Es(_.coordinates,!0,x,p,m));break;case"Polygon":m=Math.min(m,oh(x,_.coordinates,p,m))}if(m===0)return m}return m})(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Ga{constructor(t){this.type=He,this.key=t}static parse(t,i){if(t.length!==2)return i.error("Expected 1 argument, but found ".concat(t.length-1," instead."));const a=t[1];return a==null?i.error("Global state property must be defined."):typeof a!="string"?i.error("Global state property must be string, but found ".concat(typeof t[1]," instead.")):new Ga(a)}evaluate(t){var i;const a=(i=t.globals)===null||i===void 0?void 0:i.globalState;return a&&Object.keys(a).length!==0?ka(a,this.key):null}eachChild(){}outputDefined(){return!1}}const la={"==":hr,"!=":jl,">":Jc,"<":Ts,">=":Qc,"<=":ko,array:Xe,at:Eo,boolean:Xe,case:ei,coalesce:ws,collator:Ps,format:Ss,image:aa,in:xs,"index-of":Va,interpolate:Xt,"interpolate-hcl":Xt,"interpolate-lab":Xt,length:Ro,let:ra,literal:qe,match:Cr,number:Xe,"number-format":Do,object:Xe,slice:Cn,step:Jr,string:Xe,"to-boolean":gi,"to-color":gi,"to-number":gi,"to-string":gi,var:ja,within:In,distance:An,"global-state":Ga};class er{constructor(t,i,a,o){this.name=t,this.type=i,this._evaluate=a,this.args=o}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,i){const a=t[0],o=er.definitions[a];if(!o)return i.error('Unknown expression "'.concat(a,'". If you wanted a literal array, use ["literal", [...]].'),0);const u=Array.isArray(o)?o[0]:o.type,p=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,m=p.filter((([x])=>!Array.isArray(x)||x.length===t.length-1));let _=null;for(const[x,v]of m){_=new Oa(i.registry,ks,i.path,null,i.scope);const T=[];let M=!1;for(let C=1;C<t.length;C++){const E=t[C],R=Array.isArray(x)?x[C-1]:x.type,L=_.parse(E,1+T.length,R);if(!L){M=!0;break}T.push(L)}if(!M)if(Array.isArray(x)&&x.length!==T.length)_.error("Expected ".concat(x.length," arguments, but found ").concat(T.length," instead."));else{for(let C=0;C<T.length;C++){const E=Array.isArray(x)?x[C]:x.type,R=T[C];_.concat(C+1).checkSubtype(E,R.type)}if(_.errors.length===0)return new er(a,u,v,T)}}if(m.length===1)i.errors.push(..._.errors);else{const x=(m.length?m:p).map((([T])=>{return M=T,Array.isArray(M)?"(".concat(M.map(Pt).join(", "),")"):"(".concat(Pt(M.type),"...)");var M})).join(" | "),v=[];for(let T=1;T<t.length;T++){const M=i.parse(t[T],1+v.length);if(!M)return null;v.push(Pt(M.type))}i.error("Expected arguments of type ".concat(x,", but found (").concat(v.join(", "),") instead."))}return null}static register(t,i){er.definitions=i;for(const a in i)t[a]=er}}function ic(r,[t,i,a,o]){t=t.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);const u=o?o.evaluate(r):1,p=Fa(t,i,a,u);if(p)throw new vt(p);return new Qe(t/255,i/255,a/255,u,!1)}function rc(r,t){return r in t}function qo(r,t){const i=t[r];return i===void 0?null:i}function kn(r){return{type:r}}function ks(r){if(r instanceof ja)return ks(r.boundExpression);if(r instanceof er&&r.name==="error"||r instanceof Ps||r instanceof In||r instanceof An||r instanceof Ga)return!1;const t=r instanceof gi||r instanceof Xe;let i=!0;return r.eachChild((a=>{i=t?i&&ks(a):i&&a instanceof qe})),!!i&&Ds(r)&&Rs(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Ds(r){if(r instanceof er&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof In||r instanceof An)return!1;let t=!0;return r.eachChild((i=>{t&&!Ds(i)&&(t=!1)})),t}function qa(r){if(r instanceof er&&r.name==="feature-state")return!1;let t=!0;return r.eachChild((i=>{t&&!qa(i)&&(t=!1)})),t}function Rs(r,t){if(r instanceof er&&t.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((a=>{i&&!Rs(a,t)&&(i=!1)})),i}function nc(r){return{result:"success",value:r}}function ca(r){return{result:"error",value:r}}function ha(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function ac(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Wa(r){return!!r.expression&&r.expression.interpolated}function et(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ls(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&At(r)===Mr}function lh(r){return r}function Wo(r,t){const i=r.stops&&typeof r.stops[0][0]=="object",a=i||!(i||r.property!==void 0),o=r.type||(Wa(t)?"exponential":"interval"),u=(function(v){switch(v.type){case"color":return Qe.parse;case"padding":return ci.parse;case"numberArray":return Qt.parse;case"colorArray":return hi.parse;default:return null}})(t);if(u&&((r=Pr({},r)).stops&&(r.stops=r.stops.map((v=>[v[0],u(v[1])]))),r.default=u(r.default?r.default:t.default)),r.colorSpace&&(p=r.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error('Unknown color space: "'.concat(r.colorSpace,'"'));var p;const m=(function(v){switch(v){case"exponential":return Ho;case"interval":return Fs;case"categorical":return ch;case"identity":return hh;default:throw new Error('Unknown function type "'.concat(v,'"'))}})(o);let _,x;if(o==="categorical"){_=Object.create(null);for(const v of r.stops)_[v[0]]=v[1];x=typeof r.stops[0][0]}if(i){const v={},T=[];for(let E=0;E<r.stops.length;E++){const R=r.stops[E],L=R[0].zoom;v[L]===void 0&&(v[L]={zoom:L,type:r.type,property:r.property,default:r.default,stops:[]},T.push(L)),v[L].stops.push([R[0].value,R[1]])}const M=[];for(const E of T)M.push([v[E].zoom,Wo(v[E],t)]);const C={name:"linear"};return{kind:"composite",interpolationType:C,interpolationFactor:Xt.interpolationFactor.bind(void 0,C),zoomStops:M.map((E=>E[0])),evaluate:({zoom:E},R)=>Ho({stops:M,base:r.base},t,E).evaluate(E,R)}}if(a){const v=o==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:Xt.interpolationFactor.bind(void 0,v),zoomStops:r.stops.map((T=>T[0])),evaluate:({zoom:T})=>m(r,t,T,_,x)}}return{kind:"source",evaluate(v,T){const M=T&&T.properties?T.properties[r.property]:void 0;return M===void 0?Ha(r.default,t.default):m(r,t,M,_,x)}}}function Ha(r,t,i){return r!==void 0?r:t!==void 0?t:i!==void 0?i:void 0}function ch(r,t,i,a,o){return Ha(typeof i===o?a[i]:void 0,r.default,t.default)}function Fs(r,t,i){if(et(i)!=="number")return Ha(r.default,t.default);const a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];const o=Na(r.stops.map((u=>u[0])),i);return r.stops[o][1]}function Ho(r,t,i){const a=r.base!==void 0?r.base:1;if(et(i)!=="number")return Ha(r.default,t.default);const o=r.stops.length;if(o===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[o-1][0])return r.stops[o-1][1];const u=Na(r.stops.map((v=>v[0])),i),p=(function(v,T,M,C){const E=C-M,R=v-M;return E===0?0:T===1?R/E:(Math.pow(T,R)-1)/(Math.pow(T,E)-1)})(i,a,r.stops[u][0],r.stops[u+1][0]),m=r.stops[u][1],_=r.stops[u+1][1],x=Qi[t.type]||lh;return typeof m.evaluate=="function"?{evaluate(...v){const T=m.evaluate.apply(void 0,v),M=_.evaluate.apply(void 0,v);if(T!==void 0&&M!==void 0)return x(T,M,p,r.colorSpace)}}:x(m,_,p,r.colorSpace)}function hh(r,t,i){switch(t.type){case"color":i=Qe.parse(i);break;case"formatted":i=Ii.fromString(i.toString());break;case"resolvedImage":i=Ni.fromString(i.toString());break;case"padding":i=ci.parse(i);break;case"colorArray":i=hi.parse(i);break;case"numberArray":i=Qt.parse(i);break;default:et(i)===t.type||t.type==="enum"&&t.values[i]||(i=void 0)}return Ha(i,r.default,t.default)}er.register(la,{error:[{kind:"error"},[Ke],(r,[t])=>{throw new vt(t.evaluate(r))}],typeof:[Ke,[He],(r,[t])=>Pt(At(t.evaluate(r)))],"to-rgba":[Vi(Me,4),[ji],(r,[t])=>{const[i,a,o,u]=t.evaluate(r).rgb;return[255*i,255*a,255*o,u]}],rgb:[ji,[Me,Me,Me],ic],rgba:[ji,[Me,Me,Me,Me],ic],has:{type:Ye,overloads:[[[Ke],(r,[t])=>rc(t.evaluate(r),r.properties())],[[Ke,Mr],(r,[t,i])=>rc(t.evaluate(r),i.evaluate(r))]]},get:{type:He,overloads:[[[Ke],(r,[t])=>qo(t.evaluate(r),r.properties())],[[Ke,Mr],(r,[t,i])=>qo(t.evaluate(r),i.evaluate(r))]]},"feature-state":[He,[Ke],(r,[t])=>qo(t.evaluate(r),r.featureState||{})],properties:[Mr,[],r=>r.properties()],"geometry-type":[Ke,[],r=>r.geometryType()],id:[He,[],r=>r.id()],zoom:[Me,[],r=>r.globals.zoom],"heatmap-density":[Me,[],r=>r.globals.heatmapDensity||0],elevation:[Me,[],r=>r.globals.elevation||0],"line-progress":[Me,[],r=>r.globals.lineProgress||0],accumulated:[He,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Me,kn(Me),(r,t)=>{let i=0;for(const a of t)i+=a.evaluate(r);return i}],"*":[Me,kn(Me),(r,t)=>{let i=1;for(const a of t)i*=a.evaluate(r);return i}],"-":{type:Me,overloads:[[[Me,Me],(r,[t,i])=>t.evaluate(r)-i.evaluate(r)],[[Me],(r,[t])=>-t.evaluate(r)]]},"/":[Me,[Me,Me],(r,[t,i])=>t.evaluate(r)/i.evaluate(r)],"%":[Me,[Me,Me],(r,[t,i])=>t.evaluate(r)%i.evaluate(r)],ln2:[Me,[],()=>Math.LN2],pi:[Me,[],()=>Math.PI],e:[Me,[],()=>Math.E],"^":[Me,[Me,Me],(r,[t,i])=>Math.pow(t.evaluate(r),i.evaluate(r))],sqrt:[Me,[Me],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[Me,[Me],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[Me,[Me],(r,[t])=>Math.log(t.evaluate(r))],log2:[Me,[Me],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[Me,[Me],(r,[t])=>Math.sin(t.evaluate(r))],cos:[Me,[Me],(r,[t])=>Math.cos(t.evaluate(r))],tan:[Me,[Me],(r,[t])=>Math.tan(t.evaluate(r))],asin:[Me,[Me],(r,[t])=>Math.asin(t.evaluate(r))],acos:[Me,[Me],(r,[t])=>Math.acos(t.evaluate(r))],atan:[Me,[Me],(r,[t])=>Math.atan(t.evaluate(r))],min:[Me,kn(Me),(r,t)=>Math.min(...t.map((i=>i.evaluate(r))))],max:[Me,kn(Me),(r,t)=>Math.max(...t.map((i=>i.evaluate(r))))],abs:[Me,[Me],(r,[t])=>Math.abs(t.evaluate(r))],round:[Me,[Me],(r,[t])=>{const i=t.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Me,[Me],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[Me,[Me],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[Ye,[Ke,He],(r,[t,i])=>r.properties()[t.value]===i.value],"filter-id-==":[Ye,[He],(r,[t])=>r.id()===t.value],"filter-type-==":[Ye,[Ke],(r,[t])=>r.geometryType()===t.value],"filter-<":[Ye,[Ke,He],(r,[t,i])=>{const a=r.properties()[t.value],o=i.value;return typeof a==typeof o&&a<o}],"filter-id-<":[Ye,[He],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<a}],"filter->":[Ye,[Ke,He],(r,[t,i])=>{const a=r.properties()[t.value],o=i.value;return typeof a==typeof o&&a>o}],"filter-id->":[Ye,[He],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>a}],"filter-<=":[Ye,[Ke,He],(r,[t,i])=>{const a=r.properties()[t.value],o=i.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Ye,[He],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i<=a}],"filter->=":[Ye,[Ke,He],(r,[t,i])=>{const a=r.properties()[t.value],o=i.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Ye,[He],(r,[t])=>{const i=r.id(),a=t.value;return typeof i==typeof a&&i>=a}],"filter-has":[Ye,[He],(r,[t])=>t.value in r.properties()],"filter-has-id":[Ye,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ye,[Vi(Ke)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ye,[Vi(He)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[Ye,[Ke,Vi(He)],(r,[t,i])=>i.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[Ye,[Ke,Vi(He)],(r,[t,i])=>(function(a,o,u,p){for(;u<=p;){const m=u+p>>1;if(o[m]===a)return!0;o[m]>a?p=m-1:u=m+1}return!1})(r.properties()[t.value],i.value,0,i.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(r,[t,i])=>t.evaluate(r)&&i.evaluate(r)],[kn(Ye),(r,t)=>{for(const i of t)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(r,[t,i])=>t.evaluate(r)||i.evaluate(r)],[kn(Ye),(r,t)=>{for(const i of t)if(i.evaluate(r))return!0;return!1}]]},"!":[Ye,[Ye],(r,[t])=>!t.evaluate(r)],"is-supported-script":[Ye,[Ke],(r,[t])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(t.evaluate(r))}],upcase:[Ke,[Ke],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[Ke,[Ke],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[Ke,kn(He),(r,t)=>t.map((i=>it(i.evaluate(r)))).join("")],"resolved-locale":[Ke,[Yn],(r,[t])=>t.evaluate(r).resolvedLocale()]});class Xo{constructor(t,i,a){this.expression=t,this._warningHistory={},this._evaluator=new Ba,this._defaultValue=i?(function(o){if(o.type==="color"&&Ls(o.default))return new Qe(0,0,0,0);switch(o.type){case"color":return Qe.parse(o.default)||null;case"padding":return ci.parse(o.default)||null;case"numberArray":return Qt.parse(o.default)||null;case"colorArray":return hi.parse(o.default)||null;case"variableAnchorOffsetCollection":return wi.parse(o.default)||null;case"projectionDefinition":return zi.parse(o.default)||null;default:return o.default===void 0?null:o.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=a}evaluateWithoutErrorHandling(t,i,a,o,u,p){return this._globalState&&(t=Dn(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(t,i,a,o,u,p){this._globalState&&(t=Dn(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new vt("Expected value to be one of ".concat(Object.keys(this._enumValues).map((_=>JSON.stringify(_))).join(", "),", but found ").concat(JSON.stringify(m)," instead."));return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function Bs(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in la}function Os(r,t,i){const a=new Oa(la,ks,[],t?(function(u){const p={color:ji,string:Ke,number:Me,enum:Ke,boolean:Ye,formatted:za,padding:bn,numberArray:Dr,colorArray:Ea,projectionDefinition:Sr,resolvedImage:wn,variableAnchorOffsetCollection:jt};return u.type==="array"?Vi(p[u.value]||He,u.length):p[u.type]})(t):void 0),o=a.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?nc(new Xo(o,t,i)):ca(a.errors)}class js{constructor(t,i,a){this.kind=t,this._styleExpression=i,this.isStateDependent=t!=="constant"&&!qa(i.expression),this.globalStateRefs=Xa(i.expression),this._globalState=a}evaluateWithoutErrorHandling(t,i,a,o,u,p){return this._globalState&&(t=Dn(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,i,a,o,u,p)}evaluate(t,i,a,o,u,p){return this._globalState&&(t=Dn(t,this._globalState)),this._styleExpression.evaluate(t,i,a,o,u,p)}}class Vs{constructor(t,i,a,o,u){this.kind=t,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=t!=="camera"&&!qa(i.expression),this.globalStateRefs=Xa(i.expression),this.interpolationType=o,this._globalState=u}evaluateWithoutErrorHandling(t,i,a,o,u,p){return this._globalState&&(t=Dn(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,i,a,o,u,p)}evaluate(t,i,a,o,u,p){return this._globalState&&(t=Dn(t,this._globalState)),this._styleExpression.evaluate(t,i,a,o,u,p)}interpolationFactor(t,i,a){return this.interpolationType?Xt.interpolationFactor(this.interpolationType,t,i,a):0}}function Yo(r,t,i){const a=Os(r,t,i);if(a.result==="error")return a;const o=a.value.expression,u=Ds(o);if(!u&&!ha(t))return ca([new Bi("","data expressions not supported")]);const p=Rs(o,["zoom"]);if(!p&&!ac(t))return ca([new Bi("","zoom expressions not supported")]);const m=Us(o);return m||p?m instanceof Bi?ca([m]):m instanceof Xt&&!Wa(t)?ca([new Bi("",'"interpolate" expressions cannot be used with this property')]):nc(m?new Vs(u?"camera":"composite",a.value,m.labels,m instanceof Xt?m.interpolation:void 0,i):new js(u?"constant":"source",a.value,i)):ca([new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ns{constructor(t,i){this._parameters=t,this._specification=i,Pr(this,Wo(this._parameters,this._specification))}static deserialize(t){return new Ns(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Us(r){let t=null;if(r instanceof ra)t=Us(r.result);else if(r instanceof ws){for(const i of r.args)if(t=Us(i),t)break}else(r instanceof Jr||r instanceof Xt)&&r.input instanceof er&&r.input.name==="zoom"&&(t=r);return t instanceof Bi||r.eachChild((i=>{const a=Us(i);a instanceof Bi?t=a:!t&&a?t=new Bi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new Bi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function Xa(r,t=new Set){return r instanceof Ga&&t.add(r.key),r.eachChild((i=>{Xa(i,t)})),t}function Dn(r,t){const{zoom:i,heatmapDensity:a,elevation:o,lineProgress:u,isSupportedScript:p,accumulated:m}=r!=null?r:{};return{zoom:i,heatmapDensity:a,elevation:o,lineProgress:u,isSupportedScript:p,accumulated:m,globalState:t}}function $s(r){if(r===!0||r===!1)return!0;
5if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!$s(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const uh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ya(r,t){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};$s(r)||(r=Ka(r));const i=Os(r,uh,t);if(i.result==="error")throw new Error(i.value.map((a=>"".concat(a.key,": ").concat(a.message))).join(", "));return{filter:(a,o,u)=>i.value.evaluate(a,o,{},u),needGeometry:sc(r),getGlobalStateRefs:()=>Xa(i.value.expression)}}function dh(r,t){return r<t?-1:r>t?1:0}function sc(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let t=1;t<r.length;t++)if(sc(r[t]))return!0;return!1}function Ka(r){if(!r)return!0;const t=r[0];return r.length<=1?t!=="any":t==="=="?Zs(r[1],r[2],"=="):t==="!="?ua(Zs(r[1],r[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Zs(r[1],r[2],t):t==="any"?(i=r.slice(1),["any"].concat(i.map(Ka))):t==="all"?["all"].concat(r.slice(1).map(Ka)):t==="none"?["all"].concat(r.slice(1).map(Ka).map(ua)):t==="in"?Gs(r[1],r.slice(2)):t==="!in"?ua(Gs(r[1],r.slice(2))):t==="has"?qs(r[1]):t!=="!has"||ua(qs(r[1]));var i}function Zs(r,t,i){switch(r){case"$type":return["filter-type-".concat(i),t];case"$id":return["filter-id-".concat(i),t];default:return["filter-".concat(i),r,t]}}function Gs(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((i=>typeof i!=typeof t[0]))?["filter-in-large",r,["literal",t.sort(dh)]]:["filter-in-small",r,["literal",t]]}}function qs(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function ua(r){return["!",r]}function Ja(r){const t=typeof r;if(t==="number"||t==="boolean"||t==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let o="[";for(const u of r)o+="".concat(Ja(u),",");return"".concat(o,"]")}const i=Object.keys(r).sort();let a="{";for(let o=0;o<i.length;o++)a+="".concat(JSON.stringify(i[o]),":").concat(Ja(r[i[o]]),",");return"".concat(a,"}")}function Ws(r){let t="";for(const i of st)t+="/".concat(Ja(r[i]));return t}function oc(r){const t=r.value;return t?[new ve(r.key,t,"constants have been deprecated as of v8")]:[]}function Rt(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Rn(r){if(Array.isArray(r))return r.map(Rn);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const i in r)t[i]=Rn(r[i]);return t}return Rt(r)}function tr(r){const t=r.key,i=r.value,a=r.valueSpec||{},o=r.objectElementValidators||{},u=r.style,p=r.styleSpec,m=r.validateSpec;let _=[];const x=et(i);if(x!=="object")return[new ve(t,i,"object expected, ".concat(x," found"))];for(const v in i){const T=v.split(".")[0],M=ka(a,T)||a["*"];let C;if(ka(o,T))C=o[T];else if(ka(a,T))C=m;else if(o["*"])C=o["*"];else{if(!a["*"]){_.push(new ve(t,i[v],'unknown property "'.concat(v,'"')));continue}C=m}_=_.concat(C({key:(t&&"".concat(t,"."))+v,value:i[v],valueSpec:M,style:u,styleSpec:p,object:i,objectKey:v,validateSpec:m},i))}for(const v in a)o[v]||a[v].required&&a[v].default===void 0&&i[v]===void 0&&_.push(new ve(t,i,'missing required property "'.concat(v,'"')));return _}function Ko(r){const t=r.value,i=r.valueSpec,a=r.style,o=r.styleSpec,u=r.key,p=r.arrayElementValidator||r.validateSpec;if(et(t)!=="array")return[new ve(u,t,"array expected, ".concat(et(t)," found"))];if(i.length&&t.length!==i.length)return[new ve(u,t,"array length ".concat(i.length," expected, length ").concat(t.length," found"))];if(i["min-length"]&&t.length<i["min-length"])return[new ve(u,t,"array length at least ".concat(i["min-length"]," expected, length ").concat(t.length," found"))];let m={type:i.value,values:i.values};o.$version<7&&(m.function=i.function),et(i.value)==="object"&&(m=i.value);let _=[];for(let x=0;x<t.length;x++)_=_.concat(p({array:t,arrayIndex:x,value:t[x],valueSpec:m,validateSpec:r.validateSpec,style:a,styleSpec:o,key:"".concat(u,"[").concat(x,"]")}));return _}function Hs(r){const t=r.key,i=r.value,a=r.valueSpec;let o=et(i);return o==="number"&&i!=i&&(o="NaN"),o!=="number"?[new ve(t,i,"number expected, ".concat(o," found"))]:"minimum"in a&&i<a.minimum?[new ve(t,i,"".concat(i," is less than the minimum value ").concat(a.minimum))]:"maximum"in a&&i>a.maximum?[new ve(t,i,"".concat(i," is greater than the maximum value ").concat(a.maximum))]:[]}function Jo(r){const t=r.valueSpec,i=Rt(r.value.type);let a,o,u,p={};const m=i!=="categorical"&&r.value.property===void 0,_=!m,x=et(r.value.stops)==="array"&&et(r.value.stops[0])==="array"&&et(r.value.stops[0][0])==="object",v=tr({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(C){if(i==="identity")return[new ve(C.key,C.value,'identity function may not have a "stops" property')];let E=[];const R=C.value;return E=E.concat(Ko({key:C.key,value:R,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:T})),et(R)==="array"&&R.length===0&&E.push(new ve(C.key,R,"array must have at least one stop")),E},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return i==="identity"&&m&&v.push(new ve(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||v.push(new ve(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!Wa(r.valueSpec)&&v.push(new ve(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(_&&!ha(r.valueSpec)?v.push(new ve(r.key,r.value,"property functions not supported")):m&&!ac(r.valueSpec)&&v.push(new ve(r.key,r.value,"zoom functions not supported"))),i!=="c
5ategorical"&&!x||r.value.property!==void 0||v.push(new ve(r.key,r.value,'"property" property is required')),v;function T(C){let E=[];const R=C.value,L=C.key;if(et(R)!=="array")return[new ve(L,R,"array expected, ".concat(et(R)," found"))];if(R.length!==2)return[new ve(L,R,"array length 2 expected, length ".concat(R.length," found"))];if(x){if(et(R[0])!=="object")return[new ve(L,R,"object expected, ".concat(et(R[0])," found"))];if(R[0].zoom===void 0)return[new ve(L,R,"object stop key must have zoom")];if(R[0].value===void 0)return[new ve(L,R,"object stop key must have value")];if(u&&u>Rt(R[0].zoom))return[new ve(L,R[0].zoom,"stop zoom values must appear in ascending order")];Rt(R[0].zoom)!==u&&(u=Rt(R[0].zoom),o=void 0,p={}),E=E.concat(tr({key:"".concat(L,"[0]"),value:R[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:Hs,value:M}}))}else E=E.concat(M({key:"".concat(L,"[0]"),value:R[0],validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},R));return Bs(Rn(R[1]))?E.concat([new ve("".concat(L,"[1]"),R[1],"expressions are not allowed in function stops.")]):E.concat(C.validateSpec({key:"".concat(L,"[1]"),value:R[1],valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function M(C,E){const R=et(C.value),L=Rt(C.value),V=C.value!==null?C.value:E;
5if(a){if(R!==a)return[new ve(C.key,V,"".concat(R," stop domain type must match previous stop domain type ").concat(a))]}else a=R;if(R!=="number"&&R!=="string"&&R!=="boolean")return[new ve(C.key,V,"stop domain value must be a number, string, or boolean")];if(R!=="number"&&i!=="categorical"){let ie="number expected, ".concat(R," found");return ha(t)&&i===void 0&&(ie+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ve(C.key,V,ie)]}return i!=="categorical"||R!=="number"||isFinite(L)&&Math.floor(L)===L?i!=="categorical"&&R==="number"&&o!==void 0&&L<o?[new ve(C.key,V,"stop domain values must appear in ascending order")]:(o=L,i==="categorical"&&L in p?[new ve(C.key,V,"stop domain values must be unique")]:(p[L]=!0,[])):[new ve(C.key,V,"integer expected, found ".concat(L))]}}function Ln(r){const t=(r.expressionContext==="property"?Yo:Os)(Rn(r.value),r.valueSpec);if(t.result==="error")return t.value.map((a=>new ve("".concat(r.key).concat(a.key),r.value,a.message)));const i=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new ve(r.key,r.value,'Invalid data expression for "'.concat(r.propertyKey,'". Output values must be contained as literals within the expression.'))];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!qa(i))return[new ve(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!qa(i))return[new ve(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Rs(i,["zoom","feature-state"]))return[new ve(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!Ds(i))return[new ve(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function da(r){const t=r.key,i=r.value,a=et(i);return a!=="string"?[new ve(t,i,"color expected, ".concat(a," found"))]:Qe.parse(String(i))?[]:[new ve(t,i,'color expected, "'.concat(i,'" found'))]}function Qa(r){const t=r.key,i=r.value,a=r.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(Rt(i))===-1&&o.push(new ve(t,i,"expected one of [".concat(a.values.join(", "),"], ").concat(JSON.stringify(i)," found"))):Object.keys(a.values).indexOf(Rt(i))===-1&&o.push(new ve(t,i,"expected one of [".concat(Object.keys(a.values).join(", "),"], ").concat(JSON.stringify(i)," found"))),o}function Xs(r){return $s(Rn(r.value))?Ln(Pr({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qo(r)}function Qo(r){const t=r.value,i=r.key;if(et(t)!=="array")return[new ve(i,t,"array expected, ".concat(et(t)," found"))];const a=r.styleSpec;let o,u=[];if(t.length<1)return[new ve(i,t,"filter array must have at least 1 element")];switch(u=u.concat(Qa({key:"".concat(i,"[0]"),value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),Rt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Rt(t[1])==="$type"&&u.push(new ve(i,t,'"$type" cannot be use with operator "'.concat(t[0],'"')));case"==":case"!=":t.length!==3&&u.push(new ve(i,t,'filter array for operator "'.concat(t[0],'" must have 3 elements')));case"in":case"!in":t.length>=2&&(o=et(t[1]),o!=="string"&&u.push(new ve("".concat(i,"[1]"),t[1],"string expected, ".concat(o," found"))));for(let p=2;p<t.length;p++)o=et(t[p]),Rt(t[1])==="$type"?u=u.concat(Qa({key:"".concat(i,"[").concat(p,"]"),value:t[p],valueSpec:a.geometry_type,style:r.style,styleSpec:r.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&u.push(new ve("".concat(i,"[").concat(p,"]"),t[p],"string, number, or boolean expected, ".concat(o," found")));break;case"any":case"all":case"none":for(let p=1;p<t.length;p++)u=u.concat(Qo({key:"".concat(i,"[").concat(p,"]"),value:t[p],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":o=et(t[1]),t.length!==2?u.push(new ve(i,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):o!=="string"&&u.push(new ve("".concat(i,"[1]"),t[1],"string expected, ".concat(o," found")))}return u}function lc(r,t){const i=r.key,a=r.validateSpec,o=r.style,u=r.styleSpec,p=r.value,m=r.objectKey,_=u["".concat(t,"_").concat(r.layerType)];if(!_)return[];const x=m.match(/^(.*)-transition$/);if(t==="paint"&&x&&_[x[1]]&&_[x[1]].transition)return a({key:i,value:p,valueSpec:u.transition,style:o,styleSpec:u});const v=r.valueSpec||_[m];if(!v)return[new ve(i,p,'unknown property "'.concat(m,'"'))];let T;
5if(et(p)==="string"&&ha(v)&&!v.tokens&&(T=/^{([^}]+)}$/.exec(p)))return[new ve(i,p,'"'.concat(m,'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ').concat(JSON.stringify(T[1])," }`."))];const M=[];return r.layerType==="symbol"&&(m==="text-field"&&o&&!o.glyphs&&M.push(new ve(i,p,'use of "text-field" requires a style "glyphs" property')),m==="text-font"&&Ls(Rn(p))&&Rt(p.type)==="identity"&&M.push(new ve(i,p,'"text-font" does not support identity functions'))),M.concat(a({key:r.key,value:p,valueSpec:v,style:o,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:m}))}function el(r){return lc(r,"paint")}function tl(r){return lc(r,"layout")}function pa(r){let t=[];const i=r.value,a=r.key,o=r.style,u=r.styleSpec;if(et(i)!=="object")return[new ve(a,i,"object expected, ".concat(et(i)," found"))];i.type||i.ref||t.push(new ve(a,i,'either "type" or "ref" is required'));let p=Rt(i.type);const m=Rt(i.ref);if(i.id){const _=Rt(i.id);for(let x=0;x<r.arrayIndex;x++){const v=o.layers[x];Rt(v.id)===_&&t.push(new ve(a,i.id,'duplicate layer id "'.concat(i.id,'", previously used at line ').concat(v.id.__line__)))}}if("ref"in i){let _;["type","source","source-layer","filter","layout"].forEach((x=>{x in i&&t.push(new ve(a,i[x],'"'.concat(x,'" is prohibited for ref layers')))})),o.layers.forEach((x=>{Rt(x.id)===m&&(_=x)})),_?_.ref?t.push(new ve(a,i.ref,"ref cannot reference another ref layer")):p=Rt(_.type):t.push(new ve(a,i.ref,'ref layer "'.concat(m,'" not found')))}else if(p!=="background")if(i.source){const _=o.sources&&o.sources[i.source],x=_&&Rt(_.type);_?x==="vector"&&p==="raster"?t.push(new ve(a,i.source,'layer "'.concat(i.id,'" requires a raster source'))):x!=="raster-dem"&&p==="hillshade"||x!=="raster-dem"&&p==="color-relief"?t.push(new ve(a,i.source,'layer "'.concat(i.id,'" requires a raster-dem source'))):x==="raster"&&p!=="raster"?t.push(new ve(a,i.source,'layer "'.concat(i.id,'" requires a vector source'))):x!=="vector"||i["source-layer"]?x==="raster-dem"&&p!=="hillshade"&&p!=="color-relief"?t.push(new ve(a,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):p!=="line"||!i.paint||!i.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||t.push(new ve(a,i,'layer "'.concat(i.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):t.push(new ve(a,i,'layer "'.concat(i.id,'" must specify a "source-layer"'))):t.push(new ve(a,i.source,'source "'.concat(i.source,'" not found')))}else t.push(new ve(a,i,'missing required property "source"'));return t=t.concat(tr({key:a,value:i,valueSpec:u.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:"".concat(a,".type"),value:i.type,valueSpec:u.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:i,objectKey:"type"}),filter:Xs,layout:_=>tr({layer:i,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>tl(Pr({layerType:p},x))}}),paint:_=>tr({layer:i,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>el(Pr({layerType:p},x))}})}})),t}function Fn(r){const t=r.value,i=r.key,a=et(t);return a!=="string"?[new ve(i,t,"string expected, ".concat(a," found"))]:[]}const cc={promoteId:function({key:r,value:t}
5){if(et(t)==="string")return Fn({key:r,value:t});{const i=[];for(const a in t)i.push(...Fn({key:"".concat(r,".").concat(a),value:t[a]}));return i}}};function hc(r){const t=r.value,i=r.key,a=r.styleSpec,o=r.style,u=r.validateSpec;if(!t.type)return[new ve(i,t,'"type" is required')];const p=Rt(t.type);let m;switch(p){case"vector":case"raster":return m=tr({key:i,value:t,valueSpec:a["source_".concat(p.replace("-","_"))],style:r.style,styleSpec:a,objectElementValidators:cc,validateSpec:u}),m;case"raster-dem":return m=(function(_){var x;const v=(x=_.sourceName)!==null&&x!==void 0?x:"",T=_.value,M=_.styleSpec,C=M.source_raster_dem,E=_.style;let R=[];const L=et(T);if(T===void 0)return R;if(L!=="object")return R.push(new ve("source_raster_dem",T,"object expected, ".concat(L," found"))),R;const V=Rt(T.encoding)==="custom",ie=["redFactor","greenFactor","blueFactor","baseShift"],q=_.value.encoding?'"'.concat(_.value.encoding,'"'):"Default";for(const Y in T)!V&&ie.includes(Y)?R.push(new ve(Y,T[Y],'In "'.concat(v,'": "').concat(Y,'" is only valid when "encoding" is set to "custom". ').concat(q," encoding found"))):C[Y]?R=R.concat(_.validateSpec({key:Y,value:T[Y],valueSpec:C[Y],validateSpec:_.validateSpec,style:E,styleSpec:M})):R.push(new ve(Y,T[Y],'unknown property "'.concat(Y,'"')));return R})({sourceName:i,value:t,style:r.style,styleSpec:a,validateSpec:u}),m;case"geojson":if(m=tr({key:i,value:t,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:u,objectElementValidators:cc}),t.cluster)for(const _ in t.clusterProperties){const[x,v]=t.clusterProperties[_],T=typeof x=="string"?[x,["accumulated"],["get",_]]:x;m.push(...Ln({key:"".concat(i,".").concat(_,".map"),value:v,expressionContext:"cluster-map"})),m.push(...Ln({key:"".concat(i,".").concat(_,".reduce"),value:T,expressionContext:"cluster-reduce"}))}return m;case"video":return tr({key:i,value:t,valueSpec:a.source_video,style:o,validateSpec:u,styleSpec:a});case"image":return tr({key:i,value:t,valueSpec:a.source_image,style:o,validateSpec:u,styleSpec:a});case"canvas":return[new ve(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Qa({key:"".concat(i,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function uc(r){const t=r.value,i=r.styleSpec,a=i.light,o=r.style;let u=[];const p=et(t);if(t===void 0)return u;if(p!=="object")return u=u.concat([new ve("light",t,"object expected, ".concat(p," found"))]),u;for(const m in t){const _=m.match(/^(.*)-transition$/);u=u.concat(_&&a[_[1]]&&a[_[1]].transition?r.validateSpec({key:m,value:t[m],valueSpec:i.transition,validateSpec:r.validateSpec,style:o,styleSpec:i}):a[m]?r.validateSpec({key:m,value:t[m],valueSpec:a[m],validateSpec:r.validateSpec,style:o,styleSpec:i}):[new ve(m,t[m],'unknown property "'.concat(m,'"'))])}return u}function dc(r){const t=r.value,i=r.styleSpec,a=i.sky,o=r.style,u=et(t);if(t===void 0)return[];if(u!=="object")return[new ve("sky",t,"object expected, ".concat(u," found"))];let p=[];for(const m in t)p=p.concat(a[m]?r.validateSpec({key:m,value:t[m],valueSpec:a[m],style:o,styleSpec:i}):[new ve(m,t[m],'unknown property "'.concat(m,'"'))]);return p}function pc(r){const t=r.value,i=r.styleSpec,a=i.terrain,o=r.style;let u=[];const p=et(t);if(t===void 0)return u;if(p!=="object")return u=u.concat([new ve("terrain",t,"object expected, ".concat(p," found"))]),u;for(const m in t)u=u.concat(a[m]?r.validateSpec({key:m,value:t[m],valueSpec:a[m],validateSpec:r.validateSpec,style:o,styleSpec:i}):[new ve(m,t[m],'unknown property "'.concat(m,'"'))]);return u}function fa(r){let t=[];const i=r.value,a=r.key;if(Array.isArray(i)){const o=[],u=[];for(const p in i)i[p].id&&o.includes(i[p].id)&&t.push(new ve(a,i,"all the sprites' ids must be unique, but ".concat(i[p].id," is duplicated"))),o.push(i[p].id),i[p].url&&u.includes(i[p].url)&&t.push(new ve(a,i,"all the sprites' URLs must be unique, but ".concat(i[p].url," is duplicated"))),u.push(i[p].url),t=t.concat(tr({key:"".concat(a,"[").concat(p,"]"),value:i[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return t}return Fn({key:a,value:i})}function ma(r){return t=r.value,t&&t.constructor===Object?[]:[new ve(r.key,r.value,"object expected, ".concat(et(r.value)," found"))];var t}const Ei={"*":()=>[],array:Ko,boolean:function(r){const t=r.value,i=r.key,a=et(t);return a!=="boolean"?[new ve(i,t,"boolean expected, ".concat(a," found"))]:[]},number:Hs,color:da,constants:oc,enum:Qa,filter:Xs,function:Jo,layer:pa,object:tr,source:hc,light:uc,sky:dc,terrain:pc,projection:function(r){const t=r.value,i=r.styleSpec,a=i.projection,o=r.style,u=et(t);if(t===void 0)return[];if(u!=="object")return[new ve("projection",t,"object expected, ".concat(u," found"))];let p=[];for(const m in t)p=p.concat(a[m]?r.validateSpec({key:m,value:t[m],valueSpec:a[m],style:o,styleSpec:i}):[new ve(m,t[m],'unknown property "'.concat(m,'"'))]);return p},projectionDefinition:function(r){const t=r.key;let i=r.value;i=i instanceof String?i.valueOf():i;const a=et(i);return a!=="array"||(function(o){return Array.isArray(o)&&o.length===3&&typeof o[0]=="string"&&typeof o[1]=="string"&&typeof o[2]=="number"})(i)||(function(o){return!!["interpolate","step","literal"].includes(o[0])})(i)?["array","string"].includes(a)?[]:[new ve(t,i,'projection expected, invalid type "'.concat(a,'" found'))]:[new ve(t,i,"projection expected, invalid array ".concat(JSON.stringify(i)," found"))]}
vendor: 4,158 bytes, line 5
5,string:Fn,formatted:function(r){return Fn(r).length===0?[]:Ln(r)},resolvedImage:function(r){return Fn(r).length===0?[]:Ln(r)},padding:function(r){const t=r.key,i=r.value;if(et(i)==="array"){if(i.length<1||i.length>4)return[new ve(t,i,"padding requires 1 to 4 values; ".concat(i.length," values found"))];const a={type:"number"};let o=[];for(let u=0;u<i.length;u++)o=o.concat(r.validateSpec({key:"".concat(t,"[").concat(u,"]"),value:i[u],validateSpec:r.validateSpec,valueSpec:a}));return o}return Hs({key:t,value:i,valueSpec:{}})},numberArray:function(r){const t=r.key,i=r.value;if(et(i)==="array"){const a={type:"number"};if(i.length<1)return[new ve(t,i,"array length at least 1 expected, length 0 found")];let o=[];for(let u=0;u<i.length;u++)o=o.concat(r.validateSpec({key:"".concat(t,"[").concat(u,"]"),value:i[u],validateSpec:r.validateSpec,valueSpec:a}));return o}return Hs({key:t,value:i,valueSpec:{}})},colorArray:function(r){const t=r.key,i=r.value;if(et(i)==="array"){if(i.length<1)return[new ve(t,i,"array length at least 1 expected, length 0 found")];let a=[];for(let o=0;o<i.length;o++)a=a.concat(da({key:"".concat(t,"[").concat(o,"]"),value:i[o]}));return a}return da({key:t,value:i})},variableAnchorOffsetCollection:function(r){const t=r.key,i=r.value,a=et(i),o=r.styleSpec;if(a!=="array"||i.length<1||i.length%2!=0)return[new ve(t,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let u=[];for(let p=0;p<i.length;p+=2)u=u.concat(Qa({key:"".concat(t,"[").concat(p,"]"),value:i[p],valueSpec:o.layout_symbol["text-anchor"]})),u=u.concat(Ko({key:"".concat(t,"[").concat(p+1,"]"),value:i[p+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:o}));return u},sprite:fa,state:ma};function Qr(r){const t=r.value,i=r.valueSpec,a=r.styleSpec;return r.validateSpec=Qr,i.expression&&Ls(Rt(t))?Jo(r):i.expression&&Bs(Rn(t))?Ln(r):i.type&&Ei[i.type]?Ei[i.type](r):tr(Pr({},r,{valueSpec:i.type?a[i.type]:i}))}function il(r){const t=r.value,i=r.key,a=Fn(r);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new ve(i,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new ve(i,t,'"glyphs" url must include a "{range}" token'))),a}function ir(r,t=ne){let i=[];return i=i.concat(Qr({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,validateSpec:Qr,objectElementValidators:{glyphs:il,"*":()=>[]}})),r.constants&&(i=i.concat(oc({key:"constants",value:r.constants}))),_a(i)}function dr(r){return function(t){return r(Object.assign({},t,{validateSpec:Qr}))}}function _a(r){return[].concat(r).sort(((t,i)=>t.line-i.line))}function rr(r){return function(...t){return _a(r.apply(this,t))}}ir.source=rr(dr(hc)),ir.sprite=rr(dr(fa)),ir.glyphs=rr(dr(il)),ir.light=rr(dr(uc)),ir.sky=rr(dr(dc)),ir.terrain=rr(dr(pc)),ir.state=rr(dr(ma)),ir.layer=rr(dr(pa)),ir.filter=rr(dr(Xs)),ir.paintProperty=rr(dr(el)),ir.layoutProperty=rr(dr(tl));const en=ir,ph=en.light,rl=en.sky,fh=en.paintProperty,es=en.layoutProperty;function fc(r,t){let i=!1;if(t&&t.length)for(const a of t)r.fire(new De(new Error(a.message))),i=!0;return i}class ts{constructor(t,i,a){const o=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const p=new Int32Array(this.arrayBuffer);t=p[0],this.d=(i=p[1])+2*(a=p[2]);for(let _=0;_<this.d*this.d;_++){const x=p[3+_],v=p[3+_+1];o.push(x===v?null:p.subarray(x,v))}const m=p[3+o.length+1];this.keys=p.subarray(p[3+o.length],m),this.bboxes=p.subarray(m),this.insert=this._insertReadonly}else{this.d=i+2*a;for(let p=0;p<this.d*this.d;p++)o.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=t,this.padding=a,this.scale=i/t,this.uid=0;const u=a/i*t;this.min=-u,this.max=t+u}insert(t,i,a,o,u){this._forEachCell(i,a,o,u,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(o),this.bboxes.push(u)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,i,a,o,u,p){this.cells[u].push(p)}query(t,i,a,o,u){const p=this.min,m=this.max;if(t<=p&&i<=p&&m<=a&&m<=o&&!u)return Array.prototype.slice.call(this.keys);{const _=[];
5return this._forEachCell(t,i,a,o,this._queryCell,_,{},u),_}}_queryCell(t,i,a,o,u,p,m,_){const x=this.cells[u];if(x!==null){const v=this.keys,T=this.bboxes;for(let M=0;M<x.length;M++){const C=x[M];if(m[C]===void 0){const E=4*C;(_?_(T[E+0],T[E+1],T[E+2],T[E+3]):t<=T[E+2]&&i<=T[E+3]&&a>=T[E+0]&&o>=T[E+1])?(m[C]=!0,p.push(v[C])):m[C]=!1}}}}_forEachCell(t,i,a,o,u,p,m,_){const x=this._convertToCellCoord(t),v=this._convertToCellCoord(i),T=this._convertToCellCoord(a),M=this._convertToCellCoord(o);for(let C=x;C<=T;C++)for(let E=v;E<=M;E++){const R=this.d*E+C;if((!_||_(this._convertFromCellCoord(C),this._convertFromCellCoord(E),this._convertFromCellCoord(C+1),this._convertFromCellCoord(E+1)))&&u.call(this,t,i,a,o,R,p,m,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,i=3+this.cells.length+1+1;let a=0;for(let p=0;p<this.cells.length;p++)a+=this.cells[p].length;const o=new Int32Array(i+a+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;let u=i;for(let p=0;p<t.length;p++){const m=t[p];o[3+p]=u,o.set(m,u),u+=m.length}return o[3+t.length]=u,o.set(this.keys,u),u+=this.keys.length,o[3+t.length+1]=u,o.set(this.bboxes,u),u+=this.bboxes.length,o.buffer}static serialize(t,i){const a=t.toArrayBuffer();return i&&i.push(a),{buffer:a}}static deserialize(t){return new ts(t.buffer)}}const Br={};function Ae(r,t,i={}){if(Br[r])throw new Error("".concat(r," is already registered."));Object.defineProperty(t,"_classRegistryKey",{value:r,writeable:!1}),Br[r]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}Ae("Object",Object),Ae("Set",Set),Ae("TransferableGridIndex",ts),Ae("Color",Qe),Ae("Error",Error),Ae("AJAXError",X),Ae("ResolvedImage",Ni),Ae("StylePropertyFunction",Ns),Ae("StyleExpression",Xo,{omit:["_evaluator"]}),Ae("ZoomDependentExpression",Vs),Ae("ZoomConstantExpression",js),Ae("CompoundExpression",er,{omit:["_evaluate"]});for(const r in la)la[r]._classRegistryKey||Ae("Expression_".concat(r),la[r]);function mc(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function nl(r){return r.$name||r.constructor._classRegistryKey}function is(r){return!(function(t){if(t===null||typeof t!="object")return!1;const i=nl(t);return!(!i||i==="Object")})(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||mc(r)||Fi(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function rs(r,t){if(is(r))return(mc(r)||Fi(r))&&t&&t.push(r),ArrayBuffer.isView(r)&&t&&t.push(r.buffer),r instanceof ImageData&&t&&t.push(r.data.buffer),r;if(Array.isArray(r)){const u=[];for(const p of r)u.push(rs(p,t));return u}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);const i=nl(r);if(!i)throw new Error("can't serialize object of unregistered class ".concat(r.constructor.name));if(!Br[i])throw new Error("".concat(i," is not registered."));const{klass:a}=Br[i],o=a.serialize?a.serialize(r,t):{};if(a.serialize){if(t&&o===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const u in r){if(!r.hasOwnProperty(u)||Br[i].omit.indexOf(u)>=0)continue;const p=r[u];o[u]=Br[i].shallow.indexOf(u)>=0?p:rs(p,t)}r instanceof Error&&(o.message=r.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(o.$name=i),o}function Bn(r){if(is(r))return r;if(Array.isArray(r))return r.map(Bn);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);const t=nl(r)||"Object";if(!Br[t])throw new Error("can't deserialize unregistered class ".concat(t));const{klass:i}=Br[t];if(!i)throw new Error("can't deserialize unregistered class ".concat(t));if(i.deserialize)return i.deserialize(r);const a=Object.create(i.prototype);for(const o of Object.keys(r)){if(o==="$name")continue;const u=r[o];a[o]=Br[t].shallow.indexOf(o)>=0?u:Bn(u)}return a}class ga{constructor(){this.first=!0}update(t,i){const a=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=i),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=a,!0))}}const tt={"Latin-1 Supplement":r=>r>=128&&r<=255,"Hangul Jamo":r=>r>=4352&&r<=4607,Khmer:r=>r>=6016&&r<=6143,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Kanbun:r=>r>=12688&&r<=12703,"CJK Strokes":r=>r>=12736&&r<=12783,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Hangul Syllables":r=>r>=44032&&r<=55215,"Private Use Area":r=>r>=57344&&r<=63743,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function Ys(r){for(const t of r)if(Js(t.charCodeAt(0)))return!0;return!1}function _c(r){for(const t of r)if(!gc(t.charCodeAt(0)))return!1;return!0}function Ks(r){const t=r.map((i=>{try{return new RegExp("\\p{sc=".concat(i,"}"),"u").source}catch(a){return null}})).filter((i=>i));return new RegExp(t.join("|"),"u")}const al=Ks(["Arab","Dupl","Mong","Ougr","Syrc"]);function gc(r){return!al.test(String.fromCodePoint(r))}const yc=Ks(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Js(r){return!(r!==746&&r!==747&&(r<4352||!(tt["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||tt["CJK Compatibility"](r)||tt["CJK Strokes"](r)||!(!tt["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||tt["Enclosed CJK Letters and Months"](r)||tt["Ideographic Description Characters"](r)||tt.Kanbun(r)||tt.Katakana(r)&&r!==12540||!(!tt["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!tt["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||tt["Vertical Forms"](r)||tt["Yijing Hexagram Symbols"](r)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(r))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(r))||yc.test(String.fromCodePoint(r)))))}function xc(r){return!(Js(r)||(function(t){return!!(tt["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||tt["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||tt["Letterlike Symbols"](t)||tt["Number Forms"](t)||tt["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||tt["Control Pictures"](t)&&t!==9251||tt["Optical Character Recognition"](t)||tt["Enclosed Alphanumerics"](t)||tt["Geometric Shapes"](t)||tt["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||tt["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||tt["CJK Symbols and Punctuation"](t)||tt.Katakana(t)||tt["Private Use Area"](t)||tt["CJK Compatibility Forms"](t)||tt["Small Form Variants"](t)||tt["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)})(r))}
vendor: 11,975 bytes, line 5
5const vc=Ks(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function bc(r){return vc.test(String.fromCodePoint(r))}function wc(r,t){return!(!t&&bc(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||tt.Khmer(r))}function Tc(r){for(const t of r)if(bc(t.charCodeAt(0)))return!0;return!1}const tn=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){if(tn.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(r,t){return c(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(r.pluginStatus!=="loading")return this.setState(r),r;const i=r.pluginURL,a=new Promise((u=>{this.loadScriptResolve=u}));t(i);const o=new Promise((u=>setTimeout((()=>u()),this.TIMEOUT)));if(yield Promise.race([a,o]),this.isParsed()){const u={pluginStatus:"loaded",pluginURL:i};return this.setState(u),u}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error("RTL Text Plugin failed to import scripts from ".concat(i))}))}};class yt{constructor(t,i){this.isSupportedScript=Pc,this.zoom=t,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new ga,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ga,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,i=t-Math.floor(t),a=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*i}}}function Pc(r){return(function(t,i){for(const a of t)if(!wc(a.charCodeAt(0),i))return!1;return!0})(r,tn.getRTLTextPluginStatus()==="loaded")}class ns{constructor(t,i,a){this.property=t,this.value=i,this.expression=(function(o,u,p){if(Ls(o))return new Ns(o,u);if(Bs(o)){const m=Yo(o,u,p);if(m.result==="error")throw new Error(m.value.map((_=>"".concat(_.key,": ").concat(_.message))).join(", "));return m.value}{let m=o;return u.type==="color"&&typeof o=="string"?m=Qe.parse(o):u.type!=="padding"||typeof o!="number"&&!Array.isArray(o)?u.type!=="numberArray"||typeof o!="number"&&!Array.isArray(o)?u.type!=="colorArray"||typeof o!="string"&&!Array.isArray(o)?u.type==="variableAnchorOffsetCollection"&&Array.isArray(o)?m=wi.parse(o):u.type==="projectionDefinition"&&typeof o=="string"&&(m=zi.parse(o)):m=hi.parse(o):m=Qt.parse(o):m=ci.parse(o),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>m}}})(i===void 0?t.specification.default:i,t.specification,a)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,i,a){return this.property.possiblyEvaluate(this,t,i,a)}}class Qs{constructor(t,i){this.property=t,this.value=new ns(t,void 0,i)}transitioned(t,i){return new as(this.property,this.value,i,Yi({},t.transition,this.transition),t.now)}untransitioned(){return new as(this.property,this.value,null,{},0)}}class sl{constructor(t,i){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=i}getValue(t){return Li(this._values[t].value.value)}setValue(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Qs(this._values[t].property,this._globalState)),this._values[t].value=new ns(this._values[t].property,i===null?void 0:Li(i),this._globalState)}getTransition(t){return Li(this._values[t].transition)}setTransition(t,i){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Qs(this._values[t].property,this._globalState)),this._values[t].transition=Li(i)||void 0}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a);const o=this.getTransition(i);o!==void 0&&(t["".concat(i,"-transition")]=o)}return t}transitioned(t,i){const a=new Sc(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(t,i._values[o]);return a}untransitioned(){const t=new Sc(this._properties);for(const i of Object.keys(this._values))t._values[i]=this._values[i].untransitioned();return t}}class as{constructor(t,i,a,o,u){this.property=t,this.value=i,this.begin=u+o.delay||0,this.end=this.begin+o.duration||0,t.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(t,i,a){const o=t.now||0,u=this.value.possiblyEvaluate(t,i,a),p=this.prior;if(p){if(o>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(o<this.begin)return p.possiblyEvaluate(t,i,a);{const m=(o-this.begin)/(this.end-this.begin);return this.property.interpolate(p.possiblyEvaluate(t,i,a),u,br(m))}}return u}}class Sc{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,i,a){const o=new eo(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(t,i,a);return o}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ol{constructor(t,i){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=i}hasValue(t){return this._values[t].value!==void 0}getValue(t){return Li(this._values[t].value)}setValue(t,i){this._values[t]=new ns(this._values[t].property,i===null?void 0:Li(i),this._globalState)}serialize(){const t={};for(const i of Object.keys(this._values)){const a=this.getValue(i);a!==void 0&&(t[i]=a)}return t}possiblyEvaluate(t,i,a){const o=new eo(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].possiblyEvaluate(t,i,a);return o}}class Ir{constructor(t,i,a){this.property=t,this.value=i,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,i,a,o){return this.property.evaluate(this.value,this.parameters,t,i,a,o)}}class eo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Le{constructor(t){this.specification=t}possiblyEvaluate(t,i){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(i)}interpolate(t,i,a){const o=Qi[this.specification.type];return o?o(t,i,a):t}}class Ue{constructor(t,i){this.specification=t,this.overrides=i}possiblyEvaluate(t,i,a,o){return new Ir(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(i,null,{},a,o)}:t.expression,i)}interpolate(t,i,a){if(t.value.kind!=="constant"||i.value.kind!=="constant")return t;if(t.value.value===void 0||i.value.value===void 0)return new Ir(this,{kind:"constant",value:void 0},t.parameters);const o=Qi[this.specification.type];if(o){const u=o(t.value.value,i.value.value,a);return new Ir(this,{kind:"constant",value:u},t.parameters)}return t}evaluate(t,i,a,o,u,p){return t.kind==="constant"?t.value:t.evaluate(i,a,o,u,p)}}class ya extends Ue{possiblyEvaluate(t,i,a,o){if(t.value===void 0)return new Ir(this,{kind:"constant",value:void 0},i);if(t.expression.kind==="constant"){const u=t.expression.evaluate(i,null,{},a,o),p=t.property.specification.type==="resolvedImage"&&typeof u!="string"?u.name:u,m=this._calculate(p,p,p,i);return new Ir(this,{kind:"constant",value:m},i)}if(t.expression.kind==="camera"){const u=this._calculate(t.expression.evaluate({zoom:i.zoom-1}),t.expression.evaluate({zoom:i.zoom}),t.expression.evaluate({zoom:i.zoom+1}),i);return new Ir(this,{kind:"constant",value:u},i)}return new Ir(this,t.expression,i)}evaluate(t,i,a,o,u,p){if(t.kind==="source"){const m=t.evaluate(i,a,o,u,p);return this._calculate(m,m,m,i)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(i.zoom)-1},a,o),t.evaluate({zoom:Math.floor(i.zoom)},a,o),t.evaluate({zoom:Math.floor(i.zoom)+1},a,o),i):t.value}_calculate(t,i,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:a,to:i}}interpolate(t){return t}}class Mc{constructor(t){this.specification=t}possiblyEvaluate(t,i,a,o){if(t.value!==void 0){if(t.expression.kind==="constant"){const u=t.expression.evaluate(i,null,{},a,o);return this._calculate(u,u,u,i)}return this._calculate(t.expression.evaluate(new yt(Math.floor(i.zoom-1),i)),t.expression.evaluate(new yt(Math.floor(i.zoom),i)),t.expression.evaluate(new yt(Math.floor(i.zoom+1),i)),i)}}_calculate(t,i,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:t,to:i}:{from:a,to:i}}interpolate(t){return t}}class to{constructor(t){this.specification=t}possiblyEvaluate(t,i,a,o){return!!t.expression.evaluate(i,null,{},a,o)}interpolate(){return!1}}class Ti{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const i in t){const a=t[i];a.specification.overridable&&this.overridableProperties.push(i);const o=this.defaultPropertyValues[i]=new ns(a,void 0,void 0),u=this.defaultTransitionablePropertyValues[i]=new Qs(a,void 0);this.defaultTransitioningPropertyValues[i]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=o.possiblyEvaluate({})}}}Ae("DataDrivenProperty",Ue),Ae("DataConstantProperty",Le),Ae("CrossFadedDataDrivenProperty",ya),Ae("CrossFadedProperty",Mc),Ae("ColorRampProperty",to);const Cc="-transition";class pr extends Ve{constructor(t,i,a){if(super(),this.id=t.id,this.type=t.type,this._globalState=a,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=Ya(t.filter,a)),i.layout&&(this._unevaluatedLayout=new ol(i.layout,a)),i.paint)){this._transitionablePaint=new sl(i.paint,a);for(const o in t.paint)this.setPaintProperty(o,t.paint[o],{validate:!1});for(const o in t.layout)this.setLayoutProperty(o,t.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new eo(i.paint)}}setFilter(t){this.filter=t,this._featureFilter=Ya(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){const t=new Set;if(this._unevaluatedLayout)for(const i in this._unevaluatedLayout._values){const a=this._unevaluatedLayout._values[i];for(const o of a.getGlobalStateRefs())t.add(o)}for(const i of this._featureFilter.getGlobalStateRefs())t.add(i);return t}getPaintAffectingGlobalStateRefs(){var t;const i=new globalThis.Map;if(this._transitionablePaint)for(const a in this._transitionablePaint._values){const o=this._transitionablePaint._values[a].value;for(const u of o.getGlobalStateRefs()){const p=(t=i.get(u))!==null&&t!==void 0?t:[];p.push({name:a,value:o.value}),i.set(u,p)}}return i}setLayoutProperty(t,i,a={}
5){i!=null&&this._validate(es,"layers.".concat(this.id,".layout.").concat(t),t,i,a)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,i):this.visibility=i)}getPaintProperty(t){return t.endsWith(Cc)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,a={}){if(i!=null&&this._validate(fh,"layers.".concat(this.id,".paint.").concat(t),t,i,a))return!1;if(t.endsWith(Cc))return this._transitionablePaint.setTransition(t.slice(0,-11),i||void 0),!1;{const o=this._transitionablePaint._values[t],u=o.property.specification["property-type"]==="cross-faded-data-driven",p=o.value.isDataDriven(),m=o.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||p||u||this._handleOverridablePaintPropertyUpdate(t,m,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,i,a){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}
vendor: 5,455 bytes, line 5
5serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Hn(t,((i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length)))}_validate(t,i,a,o,u={}){return(!u||u.validate!==!1)&&fc(this,t.call(en,{key:i,layerType:this.type,objectKey:a,value:o,styleSpec:ne,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const i=this.paint.get(t);if(i instanceof Ir&&ha(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let On;var mh={get paint(){return On=On||new Ti({"raster-opacity":new Le(ne.paint_raster["raster-opacity"]),"raster-hue-rotate":new Le(ne.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Le(ne.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Le(ne.paint_raster["raster-brightness-max"]),"raster-saturation":new Le(ne.paint_raster["raster-saturation"]),"raster-contrast":new Le(ne.paint_raster["raster-contrast"]),"raster-resampling":new Le(ne.paint_raster["raster-resampling"]),"raster-fade-duration":new Le(ne.paint_raster["raster-fade-duration"])})}};class _h extends pr{constructor(t,i){super(t,mh,i)}}const gh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class xa{constructor(t,i){this._structArray=t,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Mt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,i){return t._trim(),i&&(t.isTransferred=!0,i.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const i=Object.create(this.prototype);return i.arrayBuffer=t.arrayBuffer,i.length=t.length,i.capacity=t.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Lt(r,t=1){let i=0,a=0;return{members:r.map((o=>{const u=gh[o.type].BYTES_PER_ELEMENT,p=i=rn(i,Math.max(t,u)),m=o.components||1;return a=Math.max(a,u),i+=u*m,{name:o.name,type:o.type,components:m,offset:p}})),size:rn(i,Math.max(a,t)),alignment:t}}function rn(r,t){return Math.ceil(r/t)*t}class va extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const o=2*t;return this.int16[o+0]=i,this.int16[o+1]=a,t}}va.prototype.bytesPerElement=4,Ae("StructArrayLayout2i4",va);class ba extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,i,a)}emplace(t,i,a,o){const u=3*t;return this.int16[u+0]=i,this.int16[u+1]=a,this.int16[u+2]=o,t}}ba.prototype.bytesPerElement=6,Ae("StructArrayLayout3i6",ba);class io extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a,o)}emplace(t,i,a,o,u){const p=4*t;return this.int16[p+0]=i,this.int16[p+1]=a,this.int16[p+2]=o,this.int16[p+3]=u,t}}io.prototype.bytesPerElement=8,Ae("StructArrayLayout4i8",io);class ss extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,o,u,p)}emplace(t,i,a,o,u,p,m){const _=6*t;return this.int16[_+0]=i,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=p,this.int16[_+5]=m,t}}ss.prototype.bytesPerElement=12,Ae("StructArrayLayout2i4i12",ss);class ll extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,o,u,p)}emplace(t,i,a,o,u,p,m){const _=4*t,x=8*t;return this.int16[_+0]=i,this.int16[_+1]=a,this.uint8[x+4]=o,this.uint8[x+5]=u,this.uint8[x+6]=p,this.uint8[x+7]=m,t}}ll.prototype.bytesPerElement=8,Ae("StructArrayLayout2i4ub8",ll);class nn extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const o=2*t;return this.float32[o+0]=i,this.float32[o+1]=a,t}}nn.prototype.bytesPerElement=8,Ae("StructArrayLayout2f8",nn);
vendor: 9,660 bytes, line 5
5class jn extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_,x,v){const T=this.length;return this.resize(T+1),this.emplace(T,t,i,a,o,u,p,m,_,x,v)}emplace(t,i,a,o,u,p,m,_,x,v,T){const M=10*t;return this.uint16[M+0]=i,this.uint16[M+1]=a,this.uint16[M+2]=o,this.uint16[M+3]=u,this.uint16[M+4]=p,this.uint16[M+5]=m,this.uint16[M+6]=_,this.uint16[M+7]=x,this.uint16[M+8]=v,this.uint16[M+9]=T,t}}jn.prototype.bytesPerElement=20,Ae("StructArrayLayout10ui20",jn);class cl extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_){const x=this.length;return this.resize(x+1),this.emplace(x,t,i,a,o,u,p,m,_)}emplace(t,i,a,o,u,p,m,_,x){const v=8*t;return this.uint16[v+0]=i,this.uint16[v+1]=a,this.uint16[v+2]=o,this.uint16[v+3]=u,this.uint16[v+4]=p,this.uint16[v+5]=m,this.uint16[v+6]=_,this.uint16[v+7]=x,t}}cl.prototype.bytesPerElement=16,Ae("StructArrayLayout8ui16",cl);class ro extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_,x,v,T,M){const C=this.length;return this.resize(C+1),this.emplace(C,t,i,a,o,u,p,m,_,x,v,T,M)}emplace(t,i,a,o,u,p,m,_,x,v,T,M,C){const E=12*t;return this.int16[E+0]=i,this.int16[E+1]=a,this.int16[E+2]=o,this.int16[E+3]=u,this.uint16[E+4]=p,this.uint16[E+5]=m,this.uint16[E+6]=_,this.uint16[E+7]=x,this.int16[E+8]=v,this.int16[E+9]=T,this.int16[E+10]=M,this.int16[E+11]=C,t}}ro.prototype.bytesPerElement=24,Ae("StructArrayLayout4i4ui4i24",ro);class Vn extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,i,a)}emplace(t,i,a,o){const u=3*t;return this.float32[u+0]=i,this.float32[u+1]=a,this.float32[u+2]=o,t}}Vn.prototype.bytesPerElement=12,Ae("StructArrayLayout3f12",Vn);class hl extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint32[1*t+0]=i,t}}hl.prototype.bytesPerElement=4,Ae("StructArrayLayout1ul4",hl);class ul extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,i,a,o,u,p,m,_,x)}emplace(t,i,a,o,u,p,m,_,x,v){const T=10*t,M=5*t;return this.int16[T+0]=i,this.int16[T+1]=a,this.int16[T+2]=o,this.int16[T+3]=u,this.int16[T+4]=p,this.int16[T+5]=m,this.uint32[M+3]=_,this.uint16[T+8]=x,this.uint16[T+9]=v,t}}ul.prototype.bytesPerElement=20,Ae("StructArrayLayout6i1ul2ui20",ul);class no extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,o,u,p)}emplace(t,i,a,o,u,p,m){const _=6*t;return this.int16[_+0]=i,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=u,this.int16[_+4]=p,this.int16[_+5]=m,t}}no.prototype.bytesPerElement=12,Ae("StructArrayLayout2i2i2i12",no);class dl extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u){const p=this.length;return this.resize(p+1),this.emplace(p,t,i,a,o,u)}emplace(t,i,a,o,u,p){const m=4*t,_=8*t;return this.float32[m+0]=i,this.float32[m+1]=a,this.float32[m+2]=o,this.int16[_+6]=u,this.int16[_+7]=p,t}}dl.prototype.bytesPerElement=16,Ae("StructArrayLayout2f1f2i16",dl);class h extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,t,i,a,o,u,p)}emplace(t,i,a,o,u,p,m){const _=16*t,x=4*t,v=8*t;return this.uint8[_+0]=i,this.uint8[_+1]=a,this.float32[x+1]=o,this.float32[x+2]=u,this.int16[v+6]=p,this.int16[v+7]=m,t}}h.prototype.bytesPerElement=16,Ae("StructArrayLayout2ub2f2i16",h);class e extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,i,a)}emplace(t,i,a,o){const u=3*t;return this.uint16[u+0]=i,this.uint16[u+1]=a,this.uint16[u+2]=o,t}}e.prototype.bytesPerElement=6,Ae("StructArrayLayout3ui6",e);class n extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V){const ie=this.length;return this.resize(ie+1),this.emplace(ie,t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V)}emplace(t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V,ie){const q=24*t,Y=12*t,oe=48*t;return this.int16[q+0]=i,this.int16[q+1]=a,this.uint16[q+2]=o,this.uint16[q+3]=u,this.uint32[Y+2]=p,this.uint32[Y+3]=m,this.uint32[Y+4]=_,this.uint16[q+10]=x,this.uint16[q+11]=v,this.uint16[q+12]=T,this.float32[Y+7]=M,this.float32[Y+8]=C,this.uint8[oe+36]=E,this.uint8[oe+37]=R,this.uint8[oe+38]=L,this.uint32[Y+10]=V,this.int16[q+22]=ie,t}}n.prototype.bytesPerElement=48,Ae("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",n);class s extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V,ie,q,Y,oe,de,xe,ze,Pe,Ce,Oe,Se){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V,ie,q,Y,oe,de,xe,ze,Pe,Ce,Oe,Se)}emplace(t,i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V,ie,q,Y,oe,de,xe,ze,Pe,Ce,Oe,Se,Ie){const me=32*t,$e=16*t;return this.int16[me+0]=i,this.int16[me+1]=a,this.int16[me+2]=o,this.int16[me+3]=u,this.int16[me+4]=p,this.int16[me+5]=m,this.int16[me+6]=_,this.int16[me+7]=x,this.uint16[me+8]=v,this.uint16[me+9]=T,this.uint16[me+10]=M,this.uint16[me+11]=C,this.uint16[me+12]=E,this.uint16[me+13]=R,this.uint16[me+14]=L,this.uint16[me+15]=V,this.uint16[me+16]=ie,this.uint16[me+17]=q,this.uint16[me+18]=Y,this.uint16[me+19]=oe,this.uint16[me+20]=de,this.uint16[me+21]=xe,this.uint16[me+22]=ze,this.uint32[$e+12]=Pe,this.float32[$e+13]=Ce,this.float32[$e+14]=Oe,this.uint16[me+30]=Se,this.uint16[me+31]=Ie,t}}s.prototype.bytesPerElement=64,Ae("StructArrayLayout8i15ui1ul2f2ui64",s);class l extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.float32[1*t+0]=i,t}}l.prototype.bytesPerElement=4,Ae("StructArrayLayout1f4",l);class d extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,i,a)}emplace(t,i,a,o){const u=3*t;return this.uint16[6*t+0]=i,this.float32[u+1]=a,this.float32[u+2]=o,t}}d.prototype.bytesPerElement=12,Ae("StructArrayLayout1ui2f12",d);class f extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,i,a)}emplace(t,i,a,o){const u=4*t;return this.uint32[2*t+0]=i,this.uint16[u+2]=a,this.uint16[u+3]=o,t}}f.prototype.bytesPerElement=8,Ae("StructArrayLayout1ul2ui8",f);class g extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,i)}emplace(t,i,a){const o=2*t;return this.uint16[o+0]=i,this.uint16[o+1]=a,t}}g.prototype.bytesPerElement=4,Ae("StructArrayLayout2ui4",g);class y extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){return this.uint16[1*t+0]=i,t}}y.prototype.bytesPerElement=2,Ae("StructArrayLayout1ui2",y);class b extends Mt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,a,o){const u=this.length;return this.resize(u+1),this.emplace(u,t,i,a,o)}emplace(t,i,a,o,u){const p=4*t;return this.float32[p+0]=i,this.float32[p+1]=a,this.float32[p+2]=o,this.float32[p+3]=u,t}}b.prototype.bytesPerElement=16,Ae("StructArrayLayout4f16",b);class w extends xa{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]}
vendor: 6,926 bytes, line 5
5get anchorPoint(){return new Ee(this.anchorPointX,this.anchorPointY)}}w.prototype.size=20;class S extends ul{get(t){return new w(this,t)}}Ae("CollisionBoxArray",S);class P extends xa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}P.prototype.size=48;class I extends n{get(t){return new P(this,t)}}Ae("PlacedSymbolArray",I);class D extends xa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}D.prototype.size=64;class B extends s{get(t){return new D(this,t)}}Ae("SymbolInstanceArray",B);class O extends l{getoffsetX(t){return this.float32[1*t+0]}}Ae("GlyphOffsetArray",O);class j extends ba{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Ae("SymbolLineVertexArray",j);class N extends xa{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]}}N.prototype.size=12;class $ extends d{get(t){return new N(this,t)}}Ae("TextAnchorOffsetArray",$);class U extends xa{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]}}U.prototype.size=8;class W extends f{get(t){return new U(this,t)}}Ae("FeatureIndexArray",W);class K extends va{}class Z extends va{}class ee extends va{}class he extends ss{}class se extends ll{}class le extends nn{}class ce extends jn{}class we extends cl{}class Te extends ro{}class ge extends Vn{}class ke extends hl{}class We extends no{}class ut extends h{}class dt extends e{}class _t extends g{}const Ct=Lt([{name:"a_pos",components:2,type:"Int16"}],4),{members:xt}=Ct;class at{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,i,a,o){const u=this.segments[this.segments.length-1];return t>at.MAX_VERTEX_ARRAY_LENGTH&&Ot("Max vertices per segment is ".concat(at.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t,". Consider using the `fillLargeMeshArrays` function if you require meshes with more than ").concat(at.MAX_VERTEX_ARRAY_LENGTH," vertices.")),this._forceNewSegmentOnNextPrepare||!u||u.vertexLength+t>at.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==o?this.createNewSegment(i,a,o):u}createNewSegment(t,i,a){const o={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return a!==void 0&&(o.sortKey=a),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(o),o}getOrCreateLatestSegment(t,i,a){return this.prepareSegment(0,t,i,a)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const i in t.vaos)t.vaos[i].destroy()}static simpleSegment(t,i,a,o){return new at([{vertexOffset:t,primitiveOffset:i,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function St(r,t){return 256*(r=Ci(Math.floor(r),0,255))+Ci(Math.floor(t),0,255)}at.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ae("SegmentVector",at);const ui=Lt([{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"}]),Vt=Lt([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var Nt,Pi,an,fr={exports:{}},sn={exports:{}},Nn={exports:{}},ao=(function(){if(an)return fr.exports;an=1;var r=(Nt||(Nt=1,sn.exports=function(i,a){var o,u,p,m,_,x,v,T;for(u=i.length-(o=3&i.length),p=a,_=3432918353,x=461845907,T=0;T<u;
vendor: 1,416 bytes, line 5
5)v=255&i.charCodeAt(T)|(255&i.charCodeAt(++T))<<8|(255&i.charCodeAt(++T))<<16|(255&i.charCodeAt(++T))<<24,++T,p=27492+(65535&(m=5*(65535&(p=(p^=v=(65535&(v=(v=(65535&v)*_+(((v>>>16)*_&65535)<<16)&4294967295)<<15|v>>>17))*x+(((v>>>16)*x&65535)<<16)&4294967295)<<13|p>>>19))+((5*(p>>>16)&65535)<<16)&4294967295))+((58964+(m>>>16)&65535)<<16);switch(v=0,o){case 3:v^=(255&i.charCodeAt(T+2))<<16;case 2:v^=(255&i.charCodeAt(T+1))<<8;case 1:p^=v=(65535&(v=(v=(65535&(v^=255&i.charCodeAt(T)))*_+(((v>>>16)*_&65535)<<16)&4294967295)<<15|v>>>17))*x+(((v>>>16)*x&65535)<<16)&4294967295}return p^=i.length,p=2246822507*(65535&(p^=p>>>16))+((2246822507*(p>>>16)&65535)<<16)&4294967295,p=3266489909*(65535&(p^=p>>>13))+((3266489909*(p>>>16)&65535)<<16)&4294967295,(p^=p>>>16)>>>0}),sn.exports),t=(Pi||(Pi=1,Nn.exports=function(i,a){for(var o,u=i.length,p=a^u,m=0;u>=4;)o=1540483477*(65535&(o=255&i.charCodeAt(m)|(255&i.charCodeAt(++m))<<8|(255&i.charCodeAt(++m))<<16|(255&i.charCodeAt(++m))<<24))+((1540483477*(o>>>16)&65535)<<16),p=1540483477*(65535&p)+((1540483477*(p>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>16)&65535)<<16)),u-=4,++m;switch(u){case 3:p^=(255&i.charCodeAt(m+2))<<16;case 2:p^=(255&i.charCodeAt(m+1))<<8;case 1:p=1540483477*(65535&(p^=255&i.charCodeAt(m)))+((1540483477*(p>>>16)&65535)<<16)}return p=1540483477*(65535&(p^=p>>>13))+((1540483477*(p>>>16)&65535)<<16),(p^=p>>>15)>>>0}
vendor: 12,171 bytes, line 5
5),Nn.exports);return fr.exports=r,fr.exports.murmur3=r,fr.exports.murmur2=t,fr.exports})(),wa=Bt(ao);class Or{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,i,a,o){this.ids.push(Ui(t)),this.positions.push(i,a,o)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const i=Ui(t);let a=0,o=this.ids.length-1;for(;a<o;){const p=a+o>>1;this.ids[p]>=i?o=p:a=p+1}const u=[];for(;this.ids[a]===i;)u.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return u}static serialize(t,i){const a=new Float64Array(t.ids),o=new Uint32Array(t.positions);return zr(a,o,0,a.length-1),i&&i.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(t){const i=new Or;return i.ids=t.ids,i.positions=t.positions,i.indexed=!0,i}}function Ui(r){const t=+r;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:wa(String(r))}function zr(r,t,i,a){for(;i<a;){const o=r[i+a>>1];let u=i-1,p=a+1;for(;;){do u++;while(r[u]<o);do p--;while(r[p]>o);if(u>=p)break;Er(r,u,p),Er(t,3*u,3*p),Er(t,3*u+1,3*p+1),Er(t,3*u+2,3*p+2)}p-i<a-p?(zr(r,t,i,p),i=p+1):(zr(r,t,p+1,a),a=p)}}function Er(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}Ae("FeaturePositionMap",Or);class $i{constructor(t,i){this.gl=t.gl,this.location=i}}class Ft extends $i{constructor(t,i){super(t,i),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Yt extends $i{constructor(t,i){super(t,i),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Zi extends $i{constructor(t,i){super(t,i),this.current=Qe.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const ii=new Float32Array(16);function pl(r){return[St(255*r.r,255*r.g),St(255*r.b,255*r.a)]}class os{constructor(t,i,a){this.value=t,this.uniformNames=i.map((o=>"u_".concat(o))),this.type=a}setUniform(t,i,a){t.set(a.constantOr(this.value))}getBinding(t,i,a){return this.type==="color"?new Zi(t,i):new Ft(t,i)}}class Un{constructor(t,i){this.uniformNames=i.map((a=>"u_".concat(a))),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,i){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(t,i,a,o){let u=null;o==="u_pattern_to"?u=this.patternTo:o==="u_pattern_from"?u=this.patternFrom:o==="u_dasharray_to"?u=this.dashTo:o==="u_dasharray_from"?u=this.dashFrom:o==="u_pixel_ratio_to"?u=this.pixelRatioTo:o==="u_pixel_ratio_from"&&(u=this.pixelRatioFrom),u!==null&&t.set(u)}getBinding(t,i,a){return a.substr(0,9)==="u_pattern"||a.substr(0,12)==="u_dasharray_"?new Yt(t,i):new Ft(t,i)}}class jr{constructor(t,i,a,o){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map((u=>({name:"a_".concat(u),type:"Float32",components:a==="color"?2:1,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,i,a){const o=this.paintVertexArray.length,u=this.expression.evaluate(new yt(0,a),i,{},a.canonical,[],a.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(o,t,u)}updatePaintArray(t,i,a,o,u){const p=this.expression.evaluate(new yt(0,u),a,o);this._setPaintValue(t,i,p)}_setPaintValue(t,i,a){if(this.type==="color"){const o=pl(a);for(let u=t;u<i;u++)this.paintVertexArray.emplace(u,o[0],o[1])}else{for(let o=t;o<i;o++)this.paintVertexArray.emplace(o,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class mr{constructor(t,i,a,o,u,p){this.expression=t,this.uniformNames=i.map((m=>"u_".concat(m,"_t"))),this.type=a,this.useIntegerZoom=o,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=i.map((m=>({name:"a_".concat(m),type:"Float32",components:a==="color"?4:2,offset:0}))),this.paintVertexArray=new p}populatePaintArray(t,i,a){const o=this.expression.evaluate(new yt(this.zoom,a),i,{},a.canonical,[],a.formattedSection),u=this.expression.evaluate(new yt(this.zoom+1,a),i,{},a.canonical,[],a.formattedSection),p=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(p,t,o,u)}updatePaintArray(t,i,a,o,u){const p=this.expression.evaluate(new yt(this.zoom,u),a,o),m=this.expression.evaluate(new yt(this.zoom+1,u),a,o);this._setPaintValue(t,i,p,m)}_setPaintValue(t,i,a,o){if(this.type==="color"){const u=pl(a),p=pl(o);for(let m=t;m<i;m++)this.paintVertexArray.emplace(m,u[0],u[1],p[0],p[1])}else{for(let u=t;u<i;u++)this.paintVertexArray.emplace(u,a,o);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(o))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,i){const a=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,o=Ci(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);t.set(o)}getBinding(t,i,a){return new Ft(t,i)}}class on{constructor(t,i,a,o,u,p){this.expression=t,this.type=i,this.useIntegerZoom=a,this.zoom=o,this.layerId=p,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u}populatePaintArray(t,i,a){const o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(o,t,this.getPositionIds(i),a)}updatePaintArray(t,i,a,o,u){this._setPaintValues(t,i,this.getPositionIds(a),u)}_setPaintValues(t,i,a,o){const u=this.getPositions(o);if(!u||!a)return;const p=u[a.min],m=u[a.mid],_=u[a.max];if(p&&m&&_)for(let x=t;x<i;x++)this.emplace(this.zoomInPaintVertexArray,x,m,p),this.emplace(this.zoomOutPaintVertexArray,x,m,_)}upload(t){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){const i=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,i,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,i,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class ln extends on{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return ui.members}emplace(t,i,a,o){t.emplace(i,a.tlbr[0],a.tlbr[1],a.tlbr[2],a.tlbr[3],o.tlbr[0],o.tlbr[1],o.tlbr[2],o.tlbr[3],a.pixelRatio,o.pixelRatio)}}class fl extends on{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return Vt.members}emplace(t,i,a,o){t.emplace(i,0,a.y,a.height,a.width,0,o.y,o.height,o.width)}}class ml{constructor(t,i,a){this.binders={},this._buffers=[];const o=[];for(const u in t.paint._values){if(!a(u))continue;const p=t.paint.get(u);if(!(p instanceof Ir&&ha(p.property.specification)))continue;const m=_l(u,t.type),_=p.value,x=p.property.specification.type,v=p.property.useIntegerZoom,T=p.property.specification["property-type"],M=T==="cross-faded"||T==="cross-faded-data-driven";if(_.kind==="constant")this.binders[u]=M?new Un(_.value,m):new os(_.value,m,x),o.push("/u_".concat(u));else if(_.kind==="source"||M){const C=gl(u,x,"source");this.binders[u]=M?u==="line-dasharray"?new fl(_,x,v,i,C,t.id):new ln(_,x,v,i,C,t.id):new jr(_,m,x,C),o.push("/a_".concat(u))}else{const C=gl(u,x,"composite");this.binders[u]=new mr(_,m,x,v,i,C),o.push("/z_".concat(u))}}this.cacheKey=o.sort().join("")}getMaxValue(t){const i=this.binders[t];return i instanceof jr||i instanceof mr?i.maxValue:0}populatePaintArrays(t,i,a){for(const o in this.binders){const u=this.binders[o];(u instanceof jr||u instanceof mr||u instanceof on)&&u.populatePaintArray(t,i,a)}}setConstantPatternPositions(t,i){for(const a in this.binders){const o=this.binders[a];o instanceof Un&&o.setConstantPatternPositions(t,i)}}setConstantDashPositions(t,i){for(const a in this.binders){const o=this.binders[a];o instanceof Un&&o.setConstantDashPositions(t,i)}}updatePaintArrays(t,i,a,o,u){let p=!1;for(const m in t){const _=i.getPositions(m);for(const x of _){const v=a.feature(x.index);for(const T in this.binders){const M=this.binders[T];if((M instanceof jr||M instanceof mr||M instanceof on)&&M.expression.isStateDependent===!0){const C=o.paint.get(T);M.expression=C.value,M.updatePaintArray(x.start,x.end,v,t[m],u),p=!0}}}}return p}defines(){const t=[];for(const i in this.binders){const a=this.binders[i];(a instanceof os||a instanceof Un)&&t.push(...a.uniformNames.map((o=>"#define HAS_UNIFORM_".concat(o))))}return t}getBinderAttributes(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof jr||a instanceof mr)for(let o=0;o<a.paintVertexAttributes.length;o++)t.push(a.paintVertexAttributes[o].name);else if(a instanceof on){const o=a.getVertexAttributes();for(const u of o)t.push(u.name)}}return t}getBinderUniforms(){const t=[];for(const i in this.binders){const a=this.binders[i];if(a instanceof os||a instanceof Un||a instanceof mr)for(const o of a.uniformNames)t.push(o)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,i){const a=[];for(const o in this.binders){const u=this.binders[o];if(u instanceof os||u instanceof Un||u instanceof mr){for(const p of u.uniformNames)if(i[p]){const m=u.getBinding(t,i[p],p);a.push({name:p,property:o,binding:m})}}}return a}setUniforms(t,i,a,o){for(const{name:u,property:p,binding:m}of i)this.binders[p].setUniform(m,o,a.get(p),u)}updatePaintBuffers(t){this._buffers=[];for(const i in this.binders){const a=this.binders[i];if(t&&a instanceof on){const o=t.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}else(a instanceof jr||a instanceof mr)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(t){for(const i in this.binders){const a=this.binders[i];(a instanceof jr||a instanceof mr||a instanceof on)&&a.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const i=this.binders[t];(i instanceof jr||i instanceof mr||i instanceof on)&&i.destroy()}}}class cn{constructor(t,i,a=()=>!0){this.programConfigurations={};for(const o of t)this.programConfigurations[o.id]=new ml(o,i,a);this.needsUpload=!1,this._featureMap=new Or,this._bufferOffset=0}populatePaintArrays(t,i,a,o){for(const u in this.programConfigurations)this.programConfigurations[u].populatePaintArrays(t,i,o);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,i,a,o){for(const u of a)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(t,this._featureMap,i,u,o)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function _l(r,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["ga
5pwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[r]||[r.replace("".concat(t,"-"),"").replace(/-/g,"_")]}function gl(r,t,i){const a={color:{source:nn,composite:b},number:{source:l,composite:nn}},o=(function(u){return{"line-pattern":{source:ce,composite:ce},"fill-pattern":{source:ce,composite:ce},"fill-extrusion-pattern":{source:ce,composite:ce},"line-dasharray":{source:we,composite:we}}[u]})(r);return o&&o[i]||a[t][i]}Ae("ConstantBinder",os),Ae("CrossFadedConstantBinder",Un),Ae("SourceExpressionBinder",jr),Ae("CrossFadedPatternBinder",ln),Ae("CrossFadedDasharrayBinder",fl),Ae("CompositeExpressionBinder",mr),Ae("ProgramConfiguration",ml,{omit:["_buffers"]}),Ae("ProgramConfigurationSet",cn);const ls=Math.pow(2,14)-1,su=-ls-1;function cs(r){const t=ft/r.extent,i=r.loadGeometry();for(let a=0;a<i.length;a++){const o=i[a];for(let u=0;u<o.length;u++){const p=o[u],m=Math.round(p.x*t),_=Math.round(p.y*t);p.x=Ci(m,su,ls),p.y=Ci(_,su,ls),(m<p.x||m>p.x+1||_<p.y||_>p.y+1)&&Ot("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function hs(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?cs(r):[]}}const ou=-32768;function Yd(r,t,i,a,o){r.emplaceBack(ou+8*t+a,ou+8*i+o)}class yh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Z,this.indexArray=new dt,this.segments=new at,this.programConfigurations=new cn(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(t,i,a){const o=this.layers[0],u=[];let p=null,m=!1,_=o.type==="heatmap";if(o.type==="circle"){const v=o;p=v.layout.get("circle-sort-key"),m=!p.isConstant(),_=_||v.paint.get("circle-pitch-alignment")==="map"}const x=_?i.subdivisionGranularity.circle:1;for(const{feature:v,id:T,index:M,sourceLayerIndex:C}of t){const E=this.layers[0]._featureFilter.needGeometry,R=hs(v,E);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),R,a))continue;const L=m?p.evaluate(R,{},a):void 0,V={id:T,properties:v.properties,type:v.type,sourceLayerIndex:C,index:M,geometry:E?R.geometry:cs(v),patterns:{},sortKey:L};u.push(V)}m&&u.sort(((v,T)=>v.sortKey-T.sortKey));for(const v of u){const{geometry:T,index:M,sourceLayerIndex:C}=v,E=t[M].feature;this.addFeature(v,T,M,a,x),i.featureIndex.insert(E,T,M,C,this.index)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:a})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xt),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,i,a,o,u=1){let p;switch(u){case 1:p=[0,7];break;case 3:p=[0,2,5,7];break;case 5:p=[0,1,3,4,6,7];break;case 7:p=[0,1,2,3,4,5,6,7];break;default:throw new Error("Invalid circle bucket granularity: ".concat(u,"; valid values are 1, 3, 5, 7."))}const m=p.length;for(const _ of i)for(const x of _){const v=x.x,T=x.y;if(v<0||v>=ft||T<0||T>=ft)continue;const M=this.segments.prepareSegment(m*m,this.layoutVertexArray,this.indexArray,t.sortKey),C=M.vertexLength;for(let E=0;E<m;E++)for(let R=0;R<m;R++)Yd(this.layoutVertexArray,v,T,p[R],p[E]);for(let E=0;E<m-1;E++)for(let R=0;R<m-1;R++){const L=C+E*m+R,V=C+(E+1)*m+R;this.indexArray.emplaceBack(L,V+1,L+1),this.indexArray.emplaceBack(L,V,V+1)}M.vertexLength+=m*m,M.primitiveLength+=(m-1)*(m-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{imagePositions:{},canonical:o})}}function lu(r,t){for(let i=0;i<r.length;i++)if(so(t,r[i]))return!0;for(let i=0;i<t.length;i++)if(so(r,t[i]))return!0;return!!xh(r,t)}function Ic(r,t,i){return!!so(r,t)||!!vh(t,r,i)}function cu(r,t){if(r.length===1)return uu(t,r[0]);for(let i=0;i<t.length;i++){const a=t[i];for(let o=0;o<a.length;o++)if(so(r,a[o]))return!0}for(let i=0;i<r.length;i++)if(uu(t,r[i]))return!0;for(let i=0;i<t.length;i++)if(xh(r,t[i]))return!0;return!1}function Kd(r,t,i){if(r.length>1){if(xh(r,t))return!0;for(let a=0;a<t.length;a++)if(vh(t[a],r,i))return!0}for(let a=0;a<r.length;a++)if(vh(r[a],t,i))return!0;return!1}function xh(r,t){if(r.length===0||t.length===0)return!1;for(let i=0;i<r.length-1;i++){const a=r[i],o=r[i+1];for(let u=0;u<t.length-1;u++)if(Jd(a,o,t[u],t[u+1]))return!0}return!1}function Jd(r,t,i,a){return cr(r,i,a)!==cr(t,i,a)&&cr(r,t,i)!==cr(r,t,a)}function vh(r,t,i){const a=i*i;if(t.length===1)return r.distSqr(t[0])<a;for(let o=1;o<t.length;o++)if(hu(r,t[o-1],t[o])<a)return!0;return!1}function hu(r,t,i){const a=t.distSqr(i);if(a===0)return r.distSqr(t);const o=((r.x-t.x)*(i.x-t.x)+(r.y-t.y)*(i.y-t.y))/a;return r.distSqr(o<0?t:o>1?i:i.sub(t)._mult(o)._add(t))}function uu(r,t){let i,a,o,u=!1;for(let p=0;p<r.length;p++){i=r[p];for(let m=0,_=i.length-1;m<i.length;_=m++)a=i[m],o=i[_],a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(u=!u)}return u}function so(r,t){let i=!1;for(let a=0,o=r.length-1;a<r.length;o=a++){const u=r[a],p=r[o];u.y>t.y!=p.y>t.y&&t.x<(p.x-u.x)*(t.y-u.y)/(p.y-u.y)+u.x&&(i=!i)}return i}function Qd(r,t,i){const a=i[0],o=i[2];if(r.x<a.x&&t.x<a.x||r.x>o.x&&t.x>o.x||r.y<a.y&&t.y<a.y||r.y>o.y&&t.y>o.y)return!1;const u=cr(r,t,i[0]);return u!==cr(r,t,i[1])||u!==cr(r,t,i[2])||u!==cr(r,t,i[3])}function oo(r,t,i){const a=t.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(t.id).getMaxValue(r)}function zc(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Ec(r,t,i,a,o){if(!t[0]&&!t[1])return r;const u=Ee.convert(t)._mult(o);i==="viewport"&&u._rotate(-a);const p=[];for(let m=0;m<r.length;m++)p.push(r[m].sub(u));return p}function ep({queryGeometry:r,size:t},i){return Ic(r,i,t)}function tp({queryGeometry:r,size:t,transform:i,unwrappedTileID:a,getElevation:o},u){return Ic(r,u,t*(i.projectTileCoordinates(u.x,u.y,a,o).signedDistanceFromCamera/i.cameraToCenterDistance))}function ip({queryGeometry:r,size:t,transform:i,unwrappedTileID:a,getElevation:o},u){const p=i.projectTileCoordinates(u.x,u.y,a,o).signedDistanceFromCamera,m=t*(i.cameraToCenterDistance/p);return Ic(r,bh(u,i,a,o),m)}function rp({queryGeometry:r,size:t,transform:i,unwrappedTileID:a,getElevation:o},u){return Ic(r,bh(u,i,a,o),t)}function du({queryGeometry:r,size:t,transform:i,unwrappedTileID:a,getElevation:o,pitchAlignment:u="map",pitchScale:p="map"},m){const _=u==="map"?p==="map"?ep:tp:p==="map"?ip:rp,x={queryGeometry:r,size:t,transform:i,unwrappedTileID:a,getElevation:o};for(const v of m)for(const T of v)if(_(x,T))return!0;return!1}function bh(r,t,i,a){const o=t.projectTileCoordinates(r.x,r.y,i,a).point;return new Ee((.5*o.x+.5)*t.width,(.5*-o.y+.5)*t.height)}let pu,fu;Ae("CircleBucket",yh,{omit:["layers"]});var np={get paint(){return fu=fu||new Ti({"circle-radius":new Ue(ne.paint_circle["circle-radius"]),"circle-color":new Ue(ne.paint_circle["circle-color"]),"circle-blur":new
vendor: 170,149 bytes, line 5
5Ue(ne.paint_circle["circle-blur"]),"circle-opacity":new Ue(ne.paint_circle["circle-opacity"]),"circle-translate":new Le(ne.paint_circle["circle-translate"]),"circle-translate-anchor":new Le(ne.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Le(ne.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Le(ne.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ue(ne.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ue(ne.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ue(ne.paint_circle["circle-stroke-opacity"])})},get layout(){return pu=pu||new Ti({"circle-sort-key":new Ue(ne.layout_circle["circle-sort-key"])})}};class ap extends pr{constructor(t,i){super(t,np,i)}createBucket(t){return new yh(t)}queryRadius(t){const i=t;return oo("circle-radius",this,i)+oo("circle-stroke-width",this,i)+zc(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:o,transform:u,pixelsToTileUnits:p,unwrappedTileID:m,getElevation:_}){const x=Ec(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-u.bearingInRadians,p),v=this.paint.get("circle-radius").evaluate(i,a)+this.paint.get("circle-stroke-width").evaluate(i,a),T=this.paint.get("circle-pitch-scale"),M=this.paint.get("circle-pitch-alignment");let C,E;return M==="map"?(C=x,E=v*p):(C=(function(R,L,V,ie){return R.map((q=>bh(q,L,V,ie)))})(x,u,m,_),E=v),du({queryGeometry:C,size:E,transform:u,unwrappedTileID:m,getElevation:_,pitchAlignment:M,pitchScale:T},o)}}class mu extends yh{}let _u;Ae("HeatmapBucket",mu,{omit:["layers"]});var sp={get paint(){return _u=_u||new Ti({"heatmap-radius":new Ue(ne.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ue(ne.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Le(ne.paint_heatmap["heatmap-intensity"]),"heatmap-color":new to(ne.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Le(ne.paint_heatmap["heatmap-opacity"])})}};function wh(r,{width:t,height:i},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==t*i*a)throw new RangeError("mismatched image size. expected: ".concat(o.length," but got: ").concat(t*i*a))}else o=new Uint8Array(t*i*a);return r.width=t,r.height=i,r.data=o,r}function gu(r,{width:t,height:i},a){if(t===r.width&&i===r.height)return;const o=wh({},{width:t,height:i},a);Th(r,o,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,t),height:Math.min(r.height,i)},a),r.width=t,r.height=i,r.data=o.data}function Th(r,t,i,a,o,u){if(o.width===0||o.height===0)return t;if(o.width>r.width||o.height>r.height||i.x>r.width-o.width||i.y>r.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>t.width||o.height>t.height||a.x>t.width-o.width||a.y>t.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const p=r.data,m=t.data;if(p===m)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<o.height;_++){const x=((i.y+_)*r.width+i.x)*u,v=((a.y+_)*t.width+a.x)*u;for(let T=0;T<o.width*u;T++)m[v+T]=p[x+T]}return t}class yl{constructor(t,i){wh(this,t,1,i)}resize(t){gu(this,t,1)}clone(){return new yl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,a,o,u){Th(t,i,a,o,u,1)}}class Gi{constructor(t,i){wh(this,t,4,i)}resize(t){gu(this,t,4)}replace(t,i){i?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Gi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,i,a,o,u){Th(t,i,a,o,u,4)}setPixel(t,i,a){const o=4*(t*this.width+i);this.data[o+0]=Math.round(255*a.r/a.a),this.data[o+1]=Math.round(255*a.g/a.a),this.data[o+2]=Math.round(255*a.b/a.a),this.data[o+3]=Math.round(255*a.a)}}function yu(r){const t={},i=r.resolution||256,a=r.clips?r.clips.length:1,o=r.image||new Gi({width:i,height:a});if(Math.log(i)/Math.LN2%1!=0)throw new Error("width is not a power of 2 - ".concat(i));const u=(p,m,_)=>{t[r.evaluationKey]=_;const x=r.expression.evaluate(t);o.setPixel(p/4/i,m/4,x)};if(r.clips)for(let p=0,m=0;p<a;++p,m+=4*i)for(let _=0,x=0;_<i;_++,x+=4){const v=_/(i-1),{start:T,end:M}=r.clips[p];u(m,x,T*(1-v)+M*v)}else for(let p=0,m=0;p<i;p++,m+=4)u(0,m,p/(i-1));return o}Ae("AlphaImage",yl),Ae("RGBAImage",Gi);const Ph="big-fb";class op extends pr{createBucket(t){return new mu(t)}constructor(t,i){super(t,sp,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=yu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ph)&&this.heatmapFbos.delete(Ph)}queryRadius(t){return oo("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:o,transform:u,pixelsToTileUnits:p,unwrappedTileID:m,getElevation:_}){return du({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(i,a)*p,transform:u,unwrappedTileID:m,getElevation:_},o)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let xu;var lp={get paint(){return xu=xu||new Ti({"hillshade-illumination-direction":new Le(ne.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Le(ne.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Le(ne.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Le(ne.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Le(ne.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Le(ne.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Le(ne.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Le(ne.paint_hillshade["hillshade-method"])})}};class cp extends pr{constructor(t,i){super(t,lp,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,a=this.paint.get("hillshade-highlight-color").values,o=this.paint.get("hillshade-shadow-color").values;const u=Math.max(t.length,i.length,a.length,o.length);t=t.concat(Array(u-t.length).fill(t.at(-1))),i=i.concat(Array(u-i.length).fill(i.at(-1))),a=a.concat(Array(u-a.length).fill(a.at(-1))),o=o.concat(Array(u-o.length).fill(o.at(-1)));const p=i.map(Ia);return{directionRadians:t.map(Ia),altitudeRadians:p,shadowColor:o,highlightColor:a}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let vu;var hp={get paint(){return vu=vu||new Ti({"color-relief-opacity":new Le(ne["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new to(ne["paint_color-relief"]["color-relief-color"])})}};class Sh{constructor(t,i,a,o){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(i,o)}update(t,i,a){const{width:o,height:u}=t,p=!(this.size&&this.size[0]===o&&this.size[1]===u||a),{context:m}=this,{gl:_}=m;if(this.useMipmap=!!(i&&i.useMipmap),_.bindTexture(_.TEXTURE_2D,this.texture),m.pixelStoreUnpackFlipY.set(!1),m.pixelStoreUnpack.set(1),m.pixelStoreUnpackPremultiplyAlpha.set(this.format===_.RGBA&&(!i||i.premultiply!==!1)),p)this.size=[o,u],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Fi(t)?_.texImage2D(_.TEXTURE_2D,0,this.format,this.format,_.UNSIGNED_BYTE,t):_.texImage2D(_.TEXTURE_2D,0,this.format,o,u,0,this.format,_.UNSIGNED_BYTE,t.data);else{const{x,y:v}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Fi(t)?_.texSubImage2D(_.TEXTURE_2D,0,x,v,_.RGBA,_.UNSIGNED_BYTE,t):_.texSubImage2D(_.TEXTURE_2D,0,x,v,o,u,_.RGBA,_.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&_.generateMipmap(_.TEXTURE_2D),m.pixelStoreUnpackFlipY.setDefault(),m.pixelStoreUnpack.setDefault(),m.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(t,i,a){const{context:o}=this,{gl:u}=o;u.bindTexture(u.TEXTURE_2D,this.texture),a!==u.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=u.LINEAR),t!==this.filter&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,t),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,a||t),this.filter=t),i!==this.wrap&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class bu{constructor(t,i,a,o=1,u=1,p=1,m=0){if(this.uid=t,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void Ot('"'.concat(a,'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".'));this.stride=i.height;const _=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=o,this.greenFactor=u,this.blueFactor=p,this.baseShift=m;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<_;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(_,x)]=this.data[this._idx(_-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,_)]=this.data[this._idx(x,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<_;x++)for(let v=0;v<_;v++){const T=this.get(x,v);T>this.max&&(this.max=T),T<this.min&&(this.min=T)}}get(t,i){const a=new Uint8Array(this.data.buffer),o=4*this._idx(t,i);return this.unpack(a[o],a[o+1],a[o+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,i){if(t<-1||t>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}unpack(t,i,a){return t*this.redFactor+i*this.greenFactor+a*this.blueFactor-this.baseShift}pack(t){return wu(t,this.getUnpackVector())}getPixels(){return new Gi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,i,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let o=i*this.dim,u=i*this.dim+this.dim,p=a*this.dim,m=a*this.dim+this.dim;switch(i){case-1:o=u-1;break;case 1:u=o+1}switch(a){case-1:p=m-1;break;case 1:m=p+1}const _=-i*this.dim,x=-a*this.dim;for(let v=p;v<m;v++)for(let T=o;T<u;T++)this.data[this._idx(T,v)]=t.data[this._idx(T+_,v+x)]}}function wu(r,t){const i=t[0],a=t[1],o=t[2],u=t[3],p=Math.min(i,a,o),m=Math.round((r+u)/p);return{r:Math.floor(m*p/i)%256,g:Math.floor(m*p/a)%256,b:Math.floor(m*p/o)%256}}Ae("DEMData",bu);class up extends pr{constructor(t,i){super(t,hp,i)}_createColorRamp(t){const i={elevationStops:[],colorStops:[]},a=this._transitionablePaint._values["color-relief-color"].value.expression;if(a instanceof js&&a._styleExpression.expression instanceof Xt){this.colorRampExpression=a;const p=a._styleExpression.expression;i.elevationStops=p.labels,i.colorStops=[];for(const m of i.elevationStops)i.colorStops.push(p.evaluate({globals:{elevation:m}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[Qe.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=t)return i;const o={elevationStops:[],colorStops:[]},u=(i.elevationStops.length-1)/(t-1);for(let p=0;p<i.elevationStops.length-.5;p+=u)o.elevationStops.push(i.elevationStops[Math.round(p)]),o.colorStops.push(i.colorStops[Math.round(p)]);return Ot("Too many colors in specification of ".concat(this.id," color-relief layer, may not render properly.")),o}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,i,a){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const o=this._createColorRamp(i),u=new Gi({width:o.colorStops.length,height:1}),p=new Gi({width:o.colorStops.length,height:1});for(let m=0;m<o.elevationStops.length;m++){const _=wu(o.elevationStops[m],a);p.setPixel(0,m,new Qe(_.r/255,_.g/255,_.b/255,1)),u.setPixel(0,m,o.colorStops[m])}return this.colorRampTextures={elevationTexture:new Sh(t,p,t.gl.RGBA),colorTexture:new Sh(t,u,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}}const dp=Lt([{name:"a_pos",components:2,type:"Int16"}],4),{members:pp}=dp;function Ac(r,t,i){const a=i.patternDependencies;let o=!1;for(const u of t){const p=u.paint.get("".concat(r,"-pattern"));p.isConstant()||(o=!0);const m=p.constantOr(null);m&&(o=!0,a[m.to]=!0,a[m.from]=!0)}return o}function Mh(r,t,i,a,o){const{zoom:u}=a,p=o.patternDependencies;for(const m of t){const _=m.paint.get("".concat(r,"-pattern")).value;if(_.kind!=="constant"){let x=_.evaluate({zoom:u-1},i,{},o.availableImages),v=_.evaluate({zoom:u},i,{},o.availableImages),T=_.evaluate({zoom:u+1},i,{},o.availableImages);x=x&&x.name?x.name:x,v=v&&v.name?v.name:v,T=T&&T.name?T.name:T,p[x]=!0,p[v]=!0,p[T]=!0,i.patterns[m.id]={min:x,mid:v,max:T}}}return i}function Tu(r,t,i,a,o){let u;if(o===(function(p,m,_,x){let v=0;for(let T=m,M=_-x;T<_;T+=x)v+=(p[M]-p[T])*(p[T+1]+p[M+1]),M=T;return v})(r,t,i,a)>0)for(let p=t;p<i;p+=a)u=Cu(p/a|0,r[p],r[p+1],u);else for(let p=i-a;p>=t;p-=a)u=Cu(p/a|0,r[p],r[p+1],u);return u&&lo(u,u.next)&&(wl(u),u=u.next),u}function us(r,t){if(!r)return r;t||(t=r);let i,a=r;do if(i=!1,a.steiner||!lo(a,a.next)&&Ut(a.prev,a,a.next)!==0)a=a.next;else{if(wl(a),a=t=a.prev,a===a.next)break;i=!0}while(i||a!==t);return t}function xl(r,t,i,a,o,u,p){if(!r)return;!p&&u&&(function(_,x,v,T){let M=_;do M.z===0&&(M.z=Ch(M.x,M.y,x,v,T)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==_);M.prevZ.nextZ=null,M.prevZ=null,(function(C){let E,R=1;do{let L,V=C;C=null;let ie=null;for(E=0;V;){E++;let q=V,Y=0;for(let de=0;de<R&&(Y++,q=q.nextZ,q);de++);let oe=R;for(;Y>0||oe>0&&q;)Y!==0&&(oe===0||!q||V.z<=q.z)?(L=V,V=V.nextZ,Y--):(L=q,q=q.nextZ,oe--),ie?ie.nextZ=L:C=L,L.prevZ=ie,ie=L;V=q}ie.nextZ=null,R*=2}while(E>1)})(M)})(r,a,o,u);let m=r;for(;r.prev!==r.next;){const _=r.prev,x=r.next;if(u?mp(r,a,o,u):fp(r))t.push(_.i,r.i,x.i),wl(r),r=x.next,m=x.next;else if((r=x)===m){p?p===1?xl(r=_p(us(r),t),t,i,a,o,u,2):p===2&&gp(r,t,i,a,o,u):xl(us(r),t,i,a,o,u,1);break}}}function fp(r){const t=r.prev,i=r,a=r.next;if(Ut(t,i,a)>=0)return!1;const o=t.x,u=i.x,p=a.x,m=t.y,_=i.y,x=a.y,v=Math.min(o,u,p),T=Math.min(m,_,x),M=Math.max(o,u,p),C=Math.max(m,_,x);let E=a.next;for(;E!==t;){if(E.x>=v&&E.x<=M&&E.y>=T&&E.y<=C&&vl(o,m,u,_,p,x,E.x,E.y)&&Ut(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function mp(r,t,i,a){const o=r.prev,u=r,p=r.next;if(Ut(o,u,p)>=0)return!1;const m=o.x,_=u.x,x=p.x,v=o.y,T=u.y,M=p.y,C=Math.min(m,_,x),E=Math.min(v,T,M),R=Math.max(m,_,x),L=Math.max(v,T,M),V=Ch(C,E,t,i,a),ie=Ch(R,L,t,i,a);let q=r.prevZ,Y=r.nextZ;for(;q&&q.z>=V&&Y&&Y.z<=ie;){if(q.x>=C&&q.x<=R&&q.y>=E&&q.y<=L&&q!==o&&q!==p&&vl(m,v,_,T,x,M,q.x,q.y)&&Ut(q.prev,q,q.next)>=0||(q=q.prevZ,Y.x>=C&&Y.x<=R&&Y.y>=E&&Y.y<=L&&Y!==o&&Y!==p&&vl(m,v,_,T,x,M,Y.x,Y.y)&&Ut(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;q&&q.z>=V;){if(q.x>=C&&q.x<=R&&q.y>=E&&q.y<=L&&q!==o&&q!==p&&vl(m,v,_,T,x,M,q.x,q.y)&&Ut(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;Y&&Y.z<=ie;){if(Y.x>=C&&Y.x<=R&&Y.y>=E&&Y.y<=L&&Y!==o&&Y!==p&&vl(m,v,_,T,x,M,Y.x,Y.y)&&Ut(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function _p(r,t){let i=r;do{const a=i.prev,o=i.next.next;!lo(a,o)&&Su(a,i,i.next,o)&&bl(a,o)&&bl(o,a)&&(t.push(a.i,i.i,o.i),wl(i),wl(i.next),i=r=o),i=i.next}while(i!==r);return us(i)}function gp(r,t,i,a,o,u){let p=r;do{let m=p.next.next;for(;m!==p.prev;){if(p.i!==m.i&&wp(p,m)){let _=Mu(p,m);return p=us(p,p.next),_=us(_,_.next),xl(p,t,i,a,o,u,0),void xl(_,t,i,a,o,u,0)}m=m.next}p=p.next}while(p!==r)}function yp(r,t){let i=r.x-t.x;return i===0&&(i=r.y-t.y,i===0)&&(i=(r.next.y-r.y)/(r.next.x-r.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function xp(r,t){const i=(function(o,u){let p=u;const m=o.x,_=o.y;let x,v=-1/0;if(lo(o,p))return p;do{if(lo(o,p.next))return p.next;if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){const R=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(R<=m&&R>v&&(v=R,x=p.x<p.next.x?p:p.next,R===m))return x}p=p.next}while(p!==u);if(!x)return null;const T=x,M=x.x,C=x.y;let E=1/0;p=x;do{if(m>=p.x&&p.x>=M&&m!==p.x&&Pu(_<C?m:v,_,M,C,_<C?v:m,_,p.x,p.y)){const R=Math.abs(_-p.y)/(m-p.x);bl(p,o)&&(R<E||R===E&&(p.x>x.x||p.x===x.x&&vp(x,p)))&&(x=p,E=R)}p=p.next}while(p!==T);return x})(r,t);if(!i)return t;const a=Mu(i,r);return us(a,a.next),us(i,i.next)}function vp(r,t){return Ut(r.prev,r,t.prev)<0&&Ut(t.next,r,r.next)<0}function Ch(r,t,i,a,o){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*o|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function bp(r){let t=r,i=r;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==r);return i}function Pu(r,t,i,a,o,u,p,m){return(o-p)*(t-m)>=(r-p)*(u-m)&&(r-p)*(a-m)>=(i-p)*(t-m)&&(i-p)*(u-m)>=(o-p)*(a-m)}function vl(r,t,i,a,o,u,p,m){return!(r===p&&t===m)&&Pu(r,t,i,a,o,u,p,m)}function wp(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!(function(i,a){let o=i;do{if(o.i!==i.i&&o.next.i!==i.i&&o.i!==a.i&&o.next.i!==a.i&&Su(o,o.next,i,a))return!0;o=o.next}while(o!==i);return!1})(r,t)&&(bl(r,t)&&bl(t,r)&&(function(i,a){let o=i,u=!1;const p=(i.x+a.x)/2,m=(i.y+a.y)/2;do o.y>m!=o.next.y>m&&o.next.y!==o.y&&p<(o.next.x-o.x)*(m-o.y)/(o.next.y-o.y)+o.x&&(u=!u),o=o.next;while(o!==i);return u})(r,t)&&(Ut(r.prev,r,t.prev)||Ut(r,t.prev,t))||lo(r,t)&&Ut(r.prev,r,r.next)>0&&Ut(t.prev,t,t.next)>0)}function Ut(r,t,i){return(t.y-r.y)*(i.x-t.x)-(t.x-r.x)*(i.y-t.y)}function lo(r,t){return r.x===t.x&&r.y===t.y}function Su(r,t,i,a){const o=Dc(Ut(r,t,i)),u=Dc(Ut(r,t,a)),p=Dc(Ut(i,a,r)),m=Dc(Ut(i,a,t));return o!==u&&p!==m||!(o!==0||!kc(r,i,t))||!(u!==0||!kc(r,a,t))||!(p!==0||!kc(i,r,a))||!(m!==0||!kc(i,t,a))}function kc(r,t,i){return t.x<=Math.max(r.x,i.x)&&t.x>=Math.min(r.x,i.x)&&t.y<=Math.max(r.y,i.y)&&t.y>=Math.min(r.y,i.y)}function Dc(r){return r>0?1:r<0?-1:0}function bl(r,t){return Ut(r.prev,r,r.next)<0?Ut(r,t,r.next)>=0&&Ut(r,r.prev,t)>=0:Ut(r,t,r.prev)<0||Ut(r,r.next,t)<0}function Mu(r,t){const i=Ih(r.i,r.x,r.y),a=Ih(t.i,t.x,t.y),o=r.next,u=t.prev;return r.next=t,t.prev=r,i.next=o,o.prev=i,a.next=i,i.prev=a,u.next=a,a.prev=u,a}function Cu(r,t,i,a){const o=Ih(r,t,i);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function wl(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Ih(r,t,i){return{i:r,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class co{constructor(t,i){if(i>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=i}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class Rc{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}Rc.noSubdivision=new Rc({fill:new co(0,0),line:new co(0,0),tile:new co(0,0),stencil:new co(0,0),circle:1}),Ae("SubdivisionGranularityExpression",co),Ae("SubdivisionGranularitySetting",Rc);const ho=-32768,Tl=32767;class Tp{constructor(t,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=ft/t,this._canonical=i}_getKey(t,i){return(t+=32768)<<16|i+32768}_vertexToIndex(t,i){if(t<-32768||i<-32768||t>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const a=0|Math.round(t),o=0|Math.round(i),u=this._getKey(a,o);if(this._vertexDictionary.has(u))return this._vertexDictionary.get(u);const p=this._vertexBuffer.length/2;return this._vertexDictionary.set(u,p),this._vertexBuffer.push(a,o),p}_subdivideTrianglesScanline(t){if(this._granularity<2)return(function(o,u){const p=[];for(let m=0;m<u.length;m+=3){const _=u[m],x=u[m+1],v=u[m+2],T=o[2*_],M=o[2*_+1];(o[2*x]-T)*(o[2*v+1]-M)-(o[2*x+1]-M)*(o[2*v]-T)>0?(p.push(_),p.push(v),p.push(x)):(p.push(_),p.push(x),p.push(v))}return p})(this._vertexBuffer,t);const i=[],a=t.length;for(let o=0;o<a;o+=3){const u=[t[o+0],t[o+1],t[o+2]],p=[this._vertexBuffer[2*t[o+0]+0],this._vertexBuffer[2*t[o+0]+1],this._vertexBuffer[2*t[o+1]+0],this._vertexBuffer[2*t[o+1]+1],this._vertexBuffer[2*t[o+2]+0],this._vertexBuffer[2*t[o+2]+1]];let m=1/0,_=1/0,x=-1/0,v=-1/0;for(let R=0;R<3;R++){const L=p[2*R],V=p[2*R+1];m=Math.min(m,L),x=Math.max(x,L),_=Math.min(_,V),v=Math.max(v,V)}if(m===x||_===v)continue;const T=Math.floor(m/this._granularityCellSize),M=Math.ceil(x/this._granularityCellSize),C=Math.floor(_/this._granularityCellSize),E=Math.ceil(v/this._granularityCellSize);if(T!==M||C!==E)for(let R=C;R<E;R++){const L=this._scanlineGenerateVertexRingForCellRow(R,p,u);Pp(this._vertexBuffer,L,i)}else i.push(...u)}return i}_scanlineGenerateVertexRingForCellRow(t,i,a){const o=t*this._granularityCellSize,u=o+this._granularityCellSize,p=[];for(let m=0;m<3;m++){const _=i[2*m],x=i[2*m+1],v=i[2*(m+1)%6],T=i[(2*(m+1)+1)%6],M=i[2*(m+2)%6],C=i[(2*(m+2)+1)%6],E=v-_,R=T-x,L=E===0,V=R===0,ie=(o-x)/R,q=(u-x)/R,Y=Math.min(ie,q),oe=Math.max(ie,q);if(!V&&(Y>=1||oe<=0)||V&&(x<o||x>u)){T>=o&&T<=u&&p.push(a[(m+1)%3]);continue}!V&&Y>0&&p.push(this._vertexToIndex(_+E*Y,x+R*Y));const de=_+E*Math.max(Y,0),xe=_+E*Math.min(oe,1);L||this._generateIntraEdgeVertices(p,_,x,v,T,de,xe),!V&&oe<1&&p.push(this._vertexToIndex(_+E*oe,x+R*oe)),(V||T>=o&&T<=u)&&p.push(a[(m+1)%3]),!V&&(T<=o||T>=u)&&this._generateInterEdgeVertices(p,_,x,v,T,M,C,xe,o,u)}return p}_generateIntraEdgeVertices(t,i,a,o,u,p,m){const _=o-i,x=u-a,v=x===0,T=v?Math.min(i,o):Math.min(p,m),M=v?Math.max(i,o):Math.max(p,m),C=Math.floor(T/this._granularityCellSize)+1,E=Math.ceil(M/this._granularityCellSize)-1;if(v?i<o:p<m)for(let R=C;R<=E;R++){const L=R*this._granularityCellSize;t.push(this._vertexToIndex(L,a+x*(L-i)/_))}else for(let R=E;R>=C;R--){const L=R*this._granularityCellSize;t.push(this._vertexToIndex(L,a+x*(L-i)/_))}}_generateInterEdgeVertices(t,i,a,o,u,p,m,_,x,v){const T=u-a,M=p-o,C=m-u,E=(x-u)/C,R=(v-u)/C,L=Math.min(E,R),V=Math.max(E,R),ie=o+M*L;let q=Math.floor(Math.min(ie,_)/this._granularityCellSize)+1,Y=Math.ceil(Math.max(ie,_)/this._granularityCellSize)-1,oe=_<ie;const de=C===0;if(de&&(m===x||m===v))return;if(de||L>=1||V<=0){const ze=a-m,Pe=p+(i-p)*Math.min((x-m)/ze,(v-m)/ze);q=Math.floor(Math.min(Pe,_)/this._granularityCellSize)+1,Y=Math.ceil(Math.max(Pe,_)/this._granularityCellSize)-1,oe=_<Pe}const xe=T>0?v:x;if(oe)for(let ze=q;ze<=Y;ze++)t.push(this._vertexToIndex(ze*this._granularityCellSize,xe));else for(let ze=Y;ze>=q;ze--)t.push(this._vertexToIndex(ze*this._granularityCellSize,xe))}_generateOutline(t){const i=[];for(const a of t){const o=ds(a,this._granularity,!0),u=this._pointArrayToIndices(o),p=[];for(let m=1;m<u.length;m++)p.push(u[m-1]),p.push(u[m]);i.push(p)}return i}_handlePoles(t){let i=!1,a=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(a=!0)),(i||a)&&this._fillPoles(t,i,a)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let i=0;i<t.length;i+=2){const a=t[i+1];a===ho&&(t[i+1]=-32767),a===Tl&&(t[i+1]=32766)}}_generatePoleQuad(t,i,a,o,u,p){o>u!=(p===ho)?(t.push(i),t.push(a),t.push(this._vertexToIndex(o,p)),t.push(a),t.push(this._vertexToIndex(u,p)),t.push(this._vertexToIndex(o,p))):(t.push(a),t.push(i),t.push(this._vertexToIndex(o,p)),t.push(this._vertexToIndex(u,p)),t.push(a),t.push(this._vertexToIndex(o,p)))}_fillPoles(t,i,a){const o=this._vertexBuffer,u=ft,p=t.length;for(let m=2;m<p;m+=3){const _=t[m-2],x=t[m-1],v=t[m],T=o[2*_],M=o[2*_+1],C=o[2*x],E=o[2*x+1],R=o[2*v],L=o[2*v+1];i&&(M===0&&E===0&&this._generatePoleQuad(t,_,x,T,C,ho),E===0&&L===0&&this._generatePoleQuad(t,x,v,C,R,ho),L===0&&M===0&&this._generatePoleQuad(t,v,_,R,T,ho)),a&&(M===u&&E===u&&this._generatePoleQuad(t,_,x,T,C,Tl),E===u&&L===u&&this._generatePoleQuad(t,x,v,C,R,Tl),L===u&&M===u&&this._generatePoleQuad(t,v,_,R,T,Tl))}}_initializeVertices(t){for(let i=0;i<t.length;i+=2)this._vertexToIndex(t[i],t[i+1])}subdividePolygonInternal(t,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:a,holeIndices:o}=(function(m){const _=[],x=[];for(const v of m)if(v.length!==0){v!==m[0]&&_.push(x.length/2);for(let T=0;T<v.length;T++)x.push(v[T].x),x.push(v[T].y)}return{flattened:x,holeIndices:_}})(t);let u;this._initializeVertices(a);try{const m=(function(x,v,T=2){const M=v&&v.length,C=M?v[0]*T:x.length;let E=Tu(x,0,C,T,!0);const R=[];if(!E||E.next===E.prev)return R;let L,V,ie;if(M&&(E=(function(q,Y,oe,de){const xe=[];for(let ze=0,Pe=Y.length;ze<Pe;ze++){const Ce=Tu(q,Y[ze]*de,ze<Pe-1?Y[ze+1]*de:q.length,de,!1);Ce===Ce.next&&(Ce.steiner=!0),xe.push(bp(Ce))}xe.sort(yp);for(let ze=0;ze<xe.length;ze++)oe=xp(xe[ze],oe);return oe})(x,v,E,T)),x.length>80*T){L=x[0],V=x[1];let q=L,Y=V;for(let oe=T;oe<C;oe+=T){const de=x[oe],xe=x[oe+1];de<L&&(L=de),xe<V&&(V=xe),de>q&&(q=de),xe>Y&&(Y=xe)}ie=Math.max(q-L,Y-V),ie=ie!==0?32767/ie:0}return xl(E,R,T,L,V,ie,0),R})(a,o),_=this._convertIndices(a,m);u=this._subdivideTrianglesScanline(_)}catch(m){console.error(m)}let p=[];return i&&(p=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(u),{verticesFlattened:this._vertexBuffer,indicesTriangles:u,indicesLineList:p}}_convertIndices(t,i){const a=[];for(let o=0;o<i.length;o++)a.push(this._vertexToIndex(t[2*i[o]],t[2*i[o]+1]));return a}_pointArrayToIndices(t){const i=[];for(let a=0;a<t.length;a++){const o=t[a];i.push(this._vertexToIndex(o.x,o.y))}return i}}function Iu(r,t,i,a=!0){return new Tp(i,t).subdividePolygonInternal(r,a)}function ds(r,t,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];const a=r[0],o=r[r.length-1],u=i&&(a.x!==o.x||a.y!==o.y);if(t<2)return u?[...r,r[0]]:[...r];const p=Math.floor(ft/t),m=[];m.push(new Ee(r[0].x,r[0].y));const _=r.length,x=u?_:_-1;for(let v=0;v<x;v++){const T=r[v],M=v<_-1?r[v+1]:r[0],C=T.x,E=T.y,R=M.x,L=M.y,V=C!==R,ie=E!==L;if(!V&&!ie)continue;const q=R-C,Y=L-E,oe=Math.abs(q),de=Math.abs(Y);let xe=C,ze=E;for(;;){const Ce=q>0?(Math.floor(xe/p)+1)*p:(Math.ceil(xe/p)-1)*p,Oe=Y>0?(Math.floor(ze/p)+1)*p:(Math.ceil(ze/p)-1)*p,Se=Math.abs(xe-Ce),Ie=Math.abs(ze-Oe),me=Math.abs(xe-R),$e=Math.abs(ze-L),Ge=V?Se/oe:Number.POSITIVE_INFINITY,je=ie?Ie/de:Number.POSITIVE_INFINITY;if((me<=Se||!V)&&($e<=Ie||!ie))break;if(Ge<je&&V||!ie){xe=Ce,ze+=Y*Ge;const Fe=new Ee(xe,Math.round(ze));m[m.length-1].x===Fe.x&&m[m.length-1].y===Fe.y||m.push(Fe)}else{xe+=q*je,ze=Oe;const Fe=new Ee(Math.round(xe),ze);m[m.length-1].x===Fe.x&&m[m.length-1].y===Fe.y||m.push(Fe)}}const Pe=new Ee(R,L);m[m.length-1].x===Pe.x&&m[m.length-1].y===Pe.y||m.push(Pe)}return m}function Pp(r,t,i){if(t.length===0)throw new Error("Subdivision vertex ring is empty.");let a=0,o=r[2*t[0]];for(let _=1;_<t.length;_++){const x=r[2*t[_]];x<o&&(o=x,a=_)}const u=t.length;let p=a,m=(p+1)%u;for(;;){const _=p-1>=0?p-1:u-1,x=(m+1)%u,v=r[2*t[_]],T=r[2*t[x]],M=r[2*t[p]],C=r[2*t[p]+1],E=r[2*t[m]+1];let R=!1;if(v<T)R=!0;else if(v>T)R=!1;else{const L=E-C,V=-(r[2*t[m]]-M),ie=C<E?1:-1;((v-M)*L+(r[2*t[_]+1]-C)*V)*ie>((T-M)*L+(r[2*t[x]+1]-C)*V)*ie&&(R=!0)}if(R){const L=t[_],V=t[p],ie=t[m];L!==V&&L!==ie&&V!==ie&&i.push(ie,V,L),p--,p<0&&(p=u-1)}else{const L=t[x],V=t[p],ie=t[m];L!==V&&L!==ie&&V!==ie&&i.push(ie,V,L),m++,m>=u&&(m=0)}if(_===x)break}}function zu(r,t,i,a,o,u,p,m,_){const x=o.length/2,v=p&&m&&_;if(x<at.MAX_VERTEX_ARRAY_LENGTH){const T=t.prepareSegment(x,i,a),M=T.vertexLength;for(let R=0;R<u.length;R+=3)a.emplaceBack(M+u[R],M+u[R+1],M+u[R+2]);let C,E;T.vertexLength+=x,T.primitiveLength+=u.length/3,v&&(E=p.prepareSegment(x,i,m),C=E.vertexLength,E.vertexLength+=x);for(let R=0;R<o.length;R+=2)r(o[R],o[R+1]);if(v)for(let R=0;R<_.length;R++){const L=_[R];for(let V=1;V<L.length;V+=2)m.emplaceBack(C+L[V-1],C+L[V]);E.primitiveLength+=L.length/2}}else(function(T,M,C,E,R,L){const V=[];for(let de=0;de<E.length/2;de++)V.push(-1);const ie={count:0};let q=0,Y=T.getOrCreateLatestSegment(M,C),oe=Y.vertexLength;for(let de=2;de<R.length;de+=3){const xe=R[de-2],ze=R[de-1],Pe=R[de];let Ce=V[xe]<q,Oe=V[ze]<q,Se=V[Pe]<q;Y.vertexLength+((Ce?1:0)+(Oe?1:0)+(Se?1:0))>at.MAX_VERTEX_ARRAY_LENGTH&&(Y=T.createNewSegment(M,C),q=ie.count,Ce=!0,Oe=!0,Se=!0,oe=0);const Ie=Pl(V,E,L,ie,xe,Ce,Y),me=Pl(V,E,L,ie,ze,Oe,Y),$e=Pl(V,E,L,ie,Pe,Se,Y);C.emplaceBack(oe+Ie-q,oe+me-q,oe+$e-q),Y.primitiveLength++}})(t,i,a,o,u,r),v&&(function(T,M,C,E,R,L){const V=[];for(let de=0;de<E.length/2;de++)V.push(-1);const ie={count:0};let q=0,Y=T.getOrCreateLatestSegment(M,C),oe=Y.vertexLength;for(let de=0;de<R.length;de++){const xe=R[de];for(let ze=1;ze<R[de].length;ze+=2){const Pe=xe[ze-1],Ce=xe[ze];let Oe=V[Pe]<q,Se=V[Ce]<q;Y.vertexLength+((Oe?1:0)+(Se?1:0))>at.MAX_VERTEX_ARRAY_LENGTH&&(Y=T.createNewSegment(M,C),q=ie.count,Oe=!0,Se=!0,oe=0);const Ie=Pl(V,E,L,ie,Pe,Oe,Y),me=Pl(V,E,L,ie,Ce,Se,Y);C.emplaceBack(oe+Ie-q,oe+me-q),Y.primitiveLength++}}})(p,i,m,o,_,r),t.forceNewSegmentOnNextPrepare(),p==null||p.forceNewSegmentOnNextPrepare()}function Pl(r,t,i,a,o,u,p){if(u){const m=a.count;return i(t[2*o],t[2*o+1]),r[o]=a.count,a.count++,p.vertexLength++,m}return r[o]}class zh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new ee,this.indexArray=new dt,this.indexArray2=new _t,this.programConfigurations=new cn(t.layers,t.zoom),this.segments=new at,this.segments2=new at,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(t,i,a){this.hasDependencies=Ac("fill",this.layers,i);const o=this.layers[0].layout.get("fill-sort-key"),u=!o.isConstant(),p=[];for(const{feature:m,id:_,index:x,sourceLayerIndex:v}of t){const T=this.layers[0]._featureFilter.needGeometry,M=hs(m,T);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),M,a))continue;const C=u?o.evaluate(M,{},a,i.availableImages):void 0,E={id:_,properties:m.properties,type:m.type,sourceLayerIndex:v,index:x,geometry:T?M.geometry:cs(m),patterns:{},sortKey:C};p.push(E)}u&&p.sort(((m,_)=>m.sortKey-_.sortKey));for(const m of p){const{geometry:_,index:x,sourceLayerIndex:v}=m;if(this.hasDependencies){const T=Mh("fill",this.layers,m,{zoom:this.zoom},i);this.patternFeatures.push(T)}else this.addFeature(m,_,x,a,{},i.subdivisionGranularity);i.featureIndex.insert(t[x].feature,_,x,v,this.index)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:a})}addFeatures(t,i,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,i,a,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pp),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,i,a,o,u,p){for(const m of Cs(i,500)){const _=Iu(m,o,p.fill.getGranularityForZoomLevel(o.z)),x=this.layoutVertexArray;zu(((v,T)=>{x.emplaceBack(v,T)}),this.segments,this.layoutVertexArray,this.indexArray,_.verticesFlattened,_.indicesTriangles,this.segments2,this.indexArray2,_.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{imagePositions:u,canonical:o})}}let Eu,Au;Ae("FillBucket",zh,{omit:["layers","patternFeatures"]});var Sp={get paint(){return Au=Au||new Ti({"fill-antialias":new Le(ne.paint_fill["fill-antialias"]),"fill-opacity":new Ue(ne.paint_fill["fill-opacity"]),"fill-color":new Ue(ne.paint_fill["fill-color"]),"fill-outline-color":new Ue(ne.paint_fill["fill-outline-color"]),"fill-translate":new Le(ne.paint_fill["fill-translate"]),"fill-translate-anchor":new Le(ne.paint_fill["fill-translate-anchor"]),"fill-pattern":new ya(ne.paint_fill["fill-pattern"])})},get layout(){return Eu=Eu||new Ti({"fill-sort-key":new Ue(ne.layout_fill["fill-sort-key"])})}};class Mp extends pr{constructor(t,i){super(t,Sp,i)}recalculate(t,i){super.recalculate(t,i);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new zh(t)}queryRadius(){return zc(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:i,transform:a,pixelsToTileUnits:o}){return cu(Ec(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-a.bearingInRadians,o),i)}isTileClipped(){return!0}}const Cp=Lt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ip=Lt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:zp}=Cp;class uo{constructor(t,i,a,o,u){this.properties={},this.extent=a,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=o,this._values=u,t.readFields(Ep,this,i)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const i=t.readVarint()+t.pos,a=[];let o,u=1,p=0,m=0,_=0;for(;t.pos<i;){if(p<=0){const x=t.readVarint();u=7&x,p=x>>3}if(p--,u===1||u===2)m+=t.readSVarint(),_+=t.readSVarint(),u===1&&(o&&a.push(o),o=[]),o&&o.push(new Ee(m,_));else{if(u!==7)throw new Error("unknown command ".concat(u));o&&o.push(o[0].clone())}}return o&&a.push(o),a}bbox(){const t=this._pbf;t.pos=this._geometry;const i=t.readVarint()+t.pos;let a=1,o=0,u=0,p=0,m=1/0,_=-1/0,x=1/0,v=-1/0;for(;t.pos<i;){if(o<=0){const T=t.readVarint();a=7&T,o=T>>3}if(o--,a===1||a===2)u+=t.readSVarint(),p+=t.readSVarint(),u<m&&(m=u),u>_&&(_=u),p<x&&(x=p),p>v&&(v=p);else if(a!==7)throw new Error("unknown command ".concat(a))}return[m,x,_,v]}toGeoJSON(t,i,a){const o=this.extent*Math.pow(2,a),u=this.extent*t,p=this.extent*i,m=this.loadGeometry();function _(M){return[360*(M.x+u)/o-180,360/Math.PI*Math.atan(Math.exp((1-2*(M.y+p)/o)*Math.PI))-90]}function x(M){return M.map(_)}let v;if(this.type===1){const M=[];for(const E of m)M.push(E[0]);const C=x(M);v=M.length===1?{type:"Point",coordinates:C[0]}:{type:"MultiPoint",coordinates:C}}else if(this.type===2){const M=m.map(x);v=M.length===1?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}}else{if(this.type!==3)throw new Error("unknown feature type");{const M=(function(E){const R=E.length;if(R<=1)return[E];const L=[];let V,ie;for(let q=0;q<R;q++){const Y=Ap(E[q]);Y!==0&&(ie===void 0&&(ie=Y<0),ie===Y<0?(V&&L.push(V),V=[E[q]]):V&&V.push(E[q]))}return V&&L.push(V),L})(m),C=[];for(const E of M)C.push(E.map(x));v=C.length===1?{type:"Polygon",coordinates:C[0]}:{type:"MultiPolygon",coordinates:C}}}const T={type:"Feature",geometry:v,properties:this.properties};return this.id!=null&&(T.id=this.id),T}}function Ep(r,t,i){r===1?t.id=i.readVarint():r===2?(function(a,o){const u=a.readVarint()+a.pos;for(;a.pos<u;){const p=o._keys[a.readVarint()],m=o._values[a.readVarint()];o.properties[p]=m}})(i,t):r===3?t.type=i.readVarint():r===4&&(t._geometry=i.pos)}function Ap(r){let t=0;for(let i,a,o=0,u=r.length,p=u-1;o<u;p=o++)i=r[o],a=r[p],t+=(a.x-i.x)*(i.y+a.y);return t}uo.types=["Unknown","Point","LineString","Polygon"];class ku{constructor(t,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(kp,this,i),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const i=this._pbf.readVarint()+this._pbf.pos;return new uo(this._pbf,i,this.extent,this._keys,this._values)}}function kp(r,t,i){r===15?t.version=i.readVarint():r===1?t.name=i.readString():r===5?t.extent=i.readVarint():r===2?t._features.push(i.pos):r===3?t._keys.push(i.readString()):r===4&&t._values.push((function(a){let o=null;const u=a.readVarint()+a.pos;for(;a.pos<u;){const p=a.readVarint()>>3;o=p===1?a.readString():p===2?a.readFloat():p===3?a.readDouble():p===4?a.readVarint64():p===5?a.readVarint():p===6?a.readSVarint():p===7?a.readBoolean():null}if(o==null)throw new Error("unknown feature value");return o})(i))}class Du{constructor(t,i){this.layers=t.readFields(Dp,{},i)}}function Dp(r,t,i){if(r===3){const a=new ku(i,i.readVarint()+i.pos);a.length&&(t[a.name]=a)}}const Eh=Math.pow(2,13);function Sl(r,t,i,a,o,u,p,m){r.emplaceBack(t,i,2*Math.floor(a*Eh)+p,o*Eh*2,u*Eh*2,Math.round(m))}class Ah{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new he,this.centroidVertexArray=new K,this.indexArray=new dt,this.programConfigurations=new cn(t.layers,t.zoom),this.segments=new at,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(t,i,a){this.features=[],this.hasDependencies=Ac("fill-extrusion",this.layers,i);for(const{feature:o,id:u,index:p,sourceLayerIndex:m}of t){const _=this.layers[0]._featureFilter.needGeometry,x=hs(o,_);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),x,a))continue;const v={id:u,sourceLayerIndex:m,index:p,geometry:_?x.geometry:cs(o),properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(Mh("fill-extrusion",this.layers,v,{zoom:this.zoom},i)):this.addFeature(v,v.geometry,p,a,{},i.subdivisionGranularity),i.featureIndex.insert(o,v.geometry,p,m,this.index,!0)}}addFeatures(t,i,a){for(const o of this.features){const{geometry:u}=o;this.addFeature(o,u,o.index,i,a,t.subdivisionGranularity)}}update(t,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:a})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zp),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Ip.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,i,a,o,u,p){for(const m of Cs(i,500)){const _={x:0,y:0,sampleCount:0},x=this.layoutVertexArray.length;this.processPolygon(_,o,t,m,p);const v=this.layoutVertexArray.length-x,T=Math.floor(_.x/_.sampleCount),M=Math.floor(_.y/_.sampleCount);for(let C=0;C<v;C++)this.centroidVertexArray.emplaceBack(T,M)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{imagePositions:u,canonical:o})}processPolygon(t,i,a,o,u){if(o.length<1||Ru(o[0]))return;for(const T of o)T.length!==0&&Rp(t,T);const p={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},m=u.fill.getGranularityForZoomLevel(i.z),_=uo.types[a.type]==="Polygon";for(const T of o){if(T.length===0||Ru(T))continue;const M=ds(T,m,_);this._generateSideFaces(M,p)}if(!_)return;const x=Iu(o,i,m,!1),v=this.layoutVertexArray;zu(((T,M)=>{Sl(v,T,M,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,x.verticesFlattened,x.indicesTriangles)}_generateSideFaces(t,i){let a=0;for(let o=1;o<t.length;o++){const u=t[o],p=t[o-1];if(Lp(u,p))continue;i.segment.vertexLength+4>at.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const m=u.sub(p)._perp()._unit(),_=p.dist(u);a+_>32768&&(a=0),Sl(this.layoutVertexArray,u.x,u.y,m.x,m.y,0,0,a),Sl(this.layoutVertexArray,u.x,u.y,m.x,m.y,0,1,a),a+=_,Sl(this.layoutVertexArray,p.x,p.y,m.x,m.y,0,0,a),Sl(this.layoutVertexArray,p.x,p.y,m.x,m.y,0,1,a);const x=i.segment.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function Rp(r,t){for(let i=0;i<t.length;i++){const a=t[i];i===t.length-1&&t[0].x===a.x&&t[0].y===a.y||(r.x+=a.x,r.y+=a.y,r.sampleCount++)}}function Lp(r,t){return r.x===t.x&&(r.x<0||r.x>ft)||r.y===t.y&&(r.y<0||r.y>ft)}function Ru(r){return r.every((t=>t.x<0))||r.every((t=>t.x>ft))||r.every((t=>t.y<0))||r.every((t=>t.y>ft))}let Lu;Ae("FillExtrusionBucket",Ah,{omit:["layers","features"]});var Fp={get paint(){return Lu=Lu||new Ti({"fill-extrusion-opacity":new Le(ne["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ue(ne["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Le(ne["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Le(ne["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ya(ne["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ue(ne["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ue(ne["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Le(ne["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Bp extends pr{constructor(t,i){super(t,Fp,i)}createBucket(t){return new Ah(t)}queryRadius(){return zc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:o,transform:u,pixelsToTileUnits:p,pixelPosMatrix:m}){const _=Ec(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-u.bearingInRadians,p),x=this.paint.get("fill-extrusion-height").evaluate(i,a),v=this.paint.get("fill-extrusion-base").evaluate(i,a),T=(function(C,E){const R=[];for(const L of C){const V=[L.x,L.y,0,1];Hr(V,V,E),R.push(new Ee(V[0]/V[3],V[1]/V[3]))}return R})(_,m),M=(function(C,E,R,L){const V=[],ie=[],q=L[8]*E,Y=L[9]*E,oe=L[10]*E,de=L[11]*E,xe=L[8]*R,ze=L[9]*R,Pe=L[10]*R,Ce=L[11]*R;for(const Oe of C){const Se=[],Ie=[];for(const me of Oe){const $e=me.x,Ge=me.y,je=L[0]*$e+L[4]*Ge+L[12],Fe=L[1]*$e+L[5]*Ge+L[13],rt=L[2]*$e+L[6]*Ge+L[14],kt=L[3]*$e+L[7]*Ge+L[15],Kt=rt+oe,xi=kt+de,gr=je+xe,qi=Fe+ze,di=rt+Pe,It=kt+Ce,ni=new Ee((je+q)/xi,(Fe+Y)/xi);ni.z=Kt/xi,Se.push(ni);const pi=new Ee(gr/It,qi/It);pi.z=di/It,Ie.push(pi)}V.push(Se),ie.push(Ie)}return[V,ie]})(o,v,x,m);return(function(C,E,R){let L=1/0;cu(R,E)&&(L=Fu(R,E[0]));for(let V=0;V<E.length;V++){const ie=E[V],q=C[V];for(let Y=0;Y<ie.length-1;Y++){const oe=ie[Y],de=[oe,ie[Y+1],q[Y+1],q[Y],oe];lu(R,de)&&(L=Math.min(L,Fu(R,de)))}}return L!==1/0&&L})(M[0],M[1],T)}}function Ml(r,t){return r.x*t.x+r.y*t.y}function Fu(r,t){if(r.length===1){let i=0;const a=t[i++];let o;for(;!o||a.equals(o);)if(o=t[i++],!o)return 1/0;for(;i<t.length;i++){const u=t[i],p=r[0],m=o.sub(a),_=u.sub(a),x=p.sub(a),v=Ml(m,m),T=Ml(m,_),M=Ml(_,_),C=Ml(x,m),E=Ml(x,_),R=v*M-T*T,L=(M*C-T*E)/R,V=(v*E-T*C)/R,ie=a.z*(1-L-V)+o.z*L+u.z*V;if(isFinite(ie))return ie}return 1/0}{let i=1/0;for(const a of t)i=Math.min(i,a.z);return i}}const Op=Lt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:jp}=Op,Vp=Lt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Np}=Vp,Up=Math.cos(Math.PI/180*37.5),Bu=Math.pow(2,14)/.5;class kh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((i=>{this.gradients[i.id]={}})),this.layoutVertexArray=new se,this.layoutVertexArray2=new le,this.indexArray=new dt,this.programConfigurations=new cn(t.layers,t.zoom),this.segments=new at,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(t,i,a){this.hasDependencies=Ac("line",this.layers,i)||this.hasLineDasharray(this.layers);const o=this.layers[0].layout.get("line-sort-key"),u=!o.isConstant(),p=[];for(const{feature:m,id:_,index:x,sourceLayerIndex:v}of t){const T=this.layers[0]._featureFilter.needGeometry,M=hs(m,T);if(!this.layers[0]._featureFilter.filter(new yt(this.zoom),M,a))continue;const C=u?o.evaluate(M,{},a):void 0,E={id:_,properties:m.properties,type:m.type,sourceLayerIndex:v,index:x,geometry:T?M.geometry:cs(m),patterns:{},dashes:{},sortKey:C};p.push(E)}u&&p.sort(((m,_)=>m.sortKey-_.sortKey));for(const m of p){const{geometry:_,index:x,sourceLayerIndex:v}=m;this.hasDependencies?(Ac("line",this.layers,i)?Mh("line",this.layers,m,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,m,this.zoom,i),this.patternFeatures.push(m)):this.addFeature(m,_,x,a,{},{},i.subdivisionGranularity),i.featureIndex.insert(t[x].feature,_,x,v,this.index)}}update(t,i,a,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,i,this.stateDependentLayers,{imagePositions:a,dashPositions:o})}addFeatures(t,i,a,o){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,a,o,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Np)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,jp),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,i,a,o,u,p,m){const _=this.layers[0].layout,x=_.get("line-join").evaluate(t,{}),v=_.get("line-cap"),T=_.get("line-miter-limit"),M=_.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const C of i)this.addLine(C,t,x,v,T,M,o,m);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{imagePositions:u,dashPositions:p,canonical:o})}addLine(t,i,a,o,u,p,m,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=ds(t,m?_.line.getGranularityForZoomLevel(m.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let q=0;q<t.length-1;q++)this.totalDistance+=t[q].dist(t[q+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const x=uo.types[i.type]==="Polygon";let v=t.length;for(;v>=2&&t[v-1].equals(t[v-2]);)v--;let T=0;for(;T<v-1&&t[T].equals(t[T+1]);)T++;if(v<(x?3:2))return;a==="bevel"&&(u=1.05);const M=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*v,this.layoutVertexArray,this.indexArray);let E,R,L,V,ie;this.e1=this.e2=-1,x&&(E=t[v-2],ie=t[T].sub(E)._unit()._perp());for(let q=T;q<v;q++){if(L=q===v-1?x?t[T+1]:void 0:t[q+1],L&&t[q].equals(L))continue;ie&&(V=ie),E&&(R=E),E=t[q],ie=L?L.sub(E)._unit()._perp():V,V=V||ie;let Y=V.add(ie);Y.x===0&&Y.y===0||Y._unit();const oe=V.x*ie.x+V.y*ie.y,de=Y.x*ie.x+Y.y*ie.y,xe=de!==0?1/de:1/0,ze=2*Math.sqrt(2-2*de),Pe=de<Up&&R&&L,Ce=V.x*ie.y-V.y*ie.x>0;if(Pe&&q>T){const Ie=E.dist(R);if(Ie>2*M){const me=E.sub(E.sub(R)._mult(M/Ie)._round());this.updateDistance(R,me),this.addCurrentVertex(me,V,0,0,C),R=me}}const Oe=R&&L;let Se=Oe?a:x?"butt":o;if(Oe&&Se==="round"&&(xe<p?Se="miter":xe<=2&&(Se="fakeround")),Se==="miter"&&xe>u&&(Se="bevel"),Se==="bevel"&&(xe>2&&(Se="flipbevel"),xe<u&&(Se="miter")),R&&this.updateDistance(R,E),Se==="miter")Y._mult(xe),this.addCurrentVertex(E,Y,0,0,C);else if(Se==="flipbevel"){if(xe>100)Y=ie.mult(-1);else{const Ie=xe*V.add(ie).mag()/V.sub(ie).mag();Y._perp()._mult(Ie*(Ce?-1:1))}this.addCurrentVertex(E,Y,0,0,C),this.addCurrentVertex(E,Y.mult(-1),0,0,C)}else if(Se==="bevel"||Se==="fakeround"){const Ie=-Math.sqrt(xe*xe-1),me=Ce?Ie:0,$e=Ce?0:Ie;if(R&&this.addCurrentVertex(E,V,me,$e,C),Se==="fakeround"){const Ge=Math.round(180*ze/Math.PI/20);for(let je=1;je<Ge;je++){let Fe=je/Ge;if(Fe!==.5){const kt=Fe-.5;Fe+=Fe*kt*(Fe-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*kt*kt+(.848013+oe*(.215638*oe-1.06021)))}const rt=ie.sub(V)._mult(Fe)._add(V)._unit()._mult(Ce?-1:1);this.addHalfVertex(E,rt.x,rt.y,!1,Ce,0,C)}}L&&this.addCurrentVertex(E,ie,-me,-$e,C)}else if(Se==="butt")this.addCurrentVertex(E,Y,0,0,C);else if(Se==="square"){const Ie=R?1:-1;this.addCurrentVertex(E,Y,Ie,Ie,C)}else Se==="round"&&(R&&(this.addCurrentVertex(E,V,0,0,C),this.addCurrentVertex(E,V,1,1,C,!0)),L&&(this.addCurrentVertex(E,ie,-1,-1,C,!0),this.addCurrentVertex(E,ie,0,0,C)));if(Pe&&q<v-1){const Ie=E.dist(L);if(Ie>2*M){const me=E.add(L.sub(E)._mult(M/Ie)._round());this.updateDistance(E,me),this.addCurrentVertex(me,ie,0,0,C),E=me}}}}addCurrentVertex(t,i,a,o,u,p=!1){const m=i.y*o-i.x,_=-i.y-i.x*o;this.addHalfVertex(t,i.x+i.y*a,i.y-i.x*a,p,!1,a,u),this.addHalfVertex(t,m,_,p,!0,-o,u),this.distance>Bu/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,i,a,o,u,p))}addHalfVertex({x:t,y:i},a,o,u,p,m,_){const x=.5*(this.lineClips?this.scaledDistance*(Bu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(u?1:0),(i<<1)+(p?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(m===0?0:m<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 v=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,v,this.e2),_.primitiveLength++),p?this.e2=v:this.e1=v}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,i){this.distance+=t.dist(i),this.updateScaledDistance()}hasLineDasharray(t){for(const i of t){const a=i.paint.get("line-dasharray");if(a&&!a.isConstant())return!0}return!1}addLineDashDependencies(t,i,a,o){for(const u of t){const p=u.paint.get("line-dasharray");if(!p||p.value.kind==="constant")continue;const m=u.layout.get("line-cap")==="round",_={dasharray:p.value.evaluate({zoom:a-1},i,{}),round:m},x={dasharray:p.value.evaluate({zoom:a},i,{}),round:m},v={dasharray:p.value.evaluate({zoom:a+1},i,{}),round:m},T="".concat(_.dasharray.join(","),",").concat(_.round),M="".concat(x.dasharray.join(","),",").concat(x.round),C="".concat(v.dasharray.join(","),",").concat(v.round);o.dashDependencies[T]=_,o.dashDependencies[M]=x,o.dashDependencies[C]=v,i.dashes[u.id]={min:T,mid:M,max:C}}}}let Ou,ju;Ae("LineBucket",kh,{omit:["layers","patternFeatures"]});var Vu={get paint(){return ju=ju||new Ti({"line-opacity":new Ue(ne.paint_line["line-opacity"]),"line-color":new Ue(ne.paint_line["line-color"]),"line-translate":new Le(ne.paint_line["line-translate"]),"line-translate-anchor":new Le(ne.paint_line["line-translate-anchor"]),"line-width":new Ue(ne.paint_line["line-width"]),"line-gap-width":new Ue(ne.paint_line["line-gap-width"]),"line-offset":new Ue(ne.paint_line["line-offset"]),"line-blur":new Ue(ne.paint_line["line-blur"]),"line-dasharray":new ya(ne.paint_line["line-dasharray"]),"line-pattern":new ya(ne.paint_line["line-pattern"]),"line-gradient":new to(ne.paint_line["line-gradient"])})},get layout(){return Ou=Ou||new Ti({"line-cap":new Le(ne.layout_line["line-cap"]),"line-join":new Ue(ne.layout_line["line-join"]),"line-miter-limit":new Le(ne.layout_line["line-miter-limit"]),"line-round-limit":new Le(ne.layout_line["line-round-limit"]),"line-sort-key":new Ue(ne.layout_line["line-sort-key"])})}};class $p extends Ue{possiblyEvaluate(t,i){return i=new yt(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(t,i)}evaluate(t,i,a,o){return i=Yi({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(t,i,a,o)}}let Lc;class Zp extends pr{constructor(t,i){super(t,Vu,i),this.gradientVersion=0,Lc||(Lc=new $p(Vu.paint.properties["line-width"].specification),Lc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const i=this.gradientExpression();this.stepInterpolant=!!(function(a){return a._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof Jr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,i){super.recalculate(t,i),this.paint._values["line-floorwidth"]=Lc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new kh(t)}queryRadius(t){const i=t,a=Nu(oo("line-width",this,i),oo("line-gap-width",this,i)),o=oo("line-offset",this,i);return a/2+Math.abs(o)+zc(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:i,featureState:a,geometry:o,transform:u,pixelsToTileUnits:p}){const m=Ec(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-u.bearingInRadians,p),_=p/2*Nu(this.paint.get("line-width").evaluate(i,a),this.paint.get("line-gap-width").evaluate(i,a)),x=this.paint.get("line-offset").evaluate(i,a);return x&&(o=(function(v,T){const M=[];for(let C=0;C<v.length;C++){const E=v[C],R=[];for(let L=0;L<E.length;L++){const V=E[L-1],ie=E[L],q=E[L+1],Y=L===0?new Ee(0,0):ie.sub(V)._unit()._perp(),oe=L===E.length-1?new Ee(0,0):q.sub(ie)._unit()._perp(),de=Y._add(oe)._unit(),xe=de.x*oe.x+de.y*oe.y;xe!==0&&de._mult(1/xe),R.push(de._mult(T)._add(ie))}M.push(R)}return M})(o,x*p)),(function(v,T,M){for(let C=0;C<T.length;C++){const E=T[C];if(v.length>=3){for(let R=0;R<E.length;R++)if(so(v,E[R]))return!0}if(Kd(v,E,M))return!0}return!1})(m,o,_)}isTileClipped(){return!0}}function Nu(r,t){return t>0?t+2*r:r}const Gp=Lt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qp=Lt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Lt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Wp=Lt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Lt([{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 Uu=Lt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hp=Lt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Xp(r,t,i){return r.sections.forEach((a=>{a.text=(function(o,u,p){const m=u.layout.get("text-transform").evaluate(p,{});return m==="uppercase"?o=o.toLocaleUpperCase():m==="lowercase"&&(o=o.toLocaleLowerCase()),tn.applyArabicShaping&&(o=tn.applyArabicShaping(o)),o})(a.text,t,i)})),r}Lt([{name:"triangle",components:3,type:"Uint16"}]),Lt([{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"}]),Lt([{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"}]),Lt([{type:"Float32",name:"offsetX"}]),Lt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Lt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Cl={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"};var ri=24;const Dh=4294967296,$u=1/Dh,Zu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Rh{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,i,a=this.length){for(;this.pos<a;){const o=this.readVarint(),u=o>>3,p=this.pos;this.type=7&o,t(u,i,this),this.pos===p&&this.skip(o)}return i}readMessage(t,i){return this.readFields(t,i,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Dh;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Dh;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const i=this.buf;let a,o;return o=i[this.pos++],a=127&o,o<128?a:(o=i[this.pos++],a|=(127&o)<<7,o<128?a:(o=i[this.pos++],a|=(127&o)<<14,o<128?a:(o=i[this.pos++],a|=(127&o)<<21,o<128?a:(o=i[this.pos],a|=(15&o)<<28,(function(u,p,m){const _=m.buf;let x,v;if(v=_[m.pos++],x=(112&v)>>4,v<128||(v=_[m.pos++],x|=(127&v)<<3,v<128)||(v=_[m.pos++],x|=(127&v)<<10,v<128)||(v=_[m.pos++],x|=(127&v)<<17,v<128)||(v=_[m.pos++],x|=(127&v)<<24,v<128)||(v=_[m.pos++],x|=(1&v)<<31,v<128))return po(u,x,p);throw new Error("Expected varint not more than 10 bytes")})(a,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){const t=this.readVarint()+this.pos,i=this.pos;return this.pos=t,t-i>=12&&Zu?Zu.decode(this.buf.subarray(i,t)):(function(a,o,u){let p="",m=o;for(;m<u;){const _=a[m];let x,v,T,M=null,C=_>239?4:_>223?3:_>191?2:1;if(m+C>u)break;C===1?_<128&&(M=_):C===2?(x=a[m+1],(192&x)==128&&(M=(31&_)<<6|63&x,M<=127&&(M=null))):C===3?(x=a[m+1],v=a[m+2],(192&x)==128&&(192&v)==128&&(M=(15&_)<<12|(63&x)<<6|63&v,(M<=2047||M>=55296&&M<=57343)&&(M=null))):C===4&&(x=a[m+1],v=a[m+2],T=a[m+3],(192&x)==128&&(192&v)==128&&(192&T)==128&&(M=(15&_)<<18|(63&x)<<12|(63&v)<<6|63&T,(M<=65535||M>=1114112)&&(M=null))),M===null?(M=65533,C=1):M>65535&&(M-=65536,p+=String.fromCharCode(M>>>10&1023|55296),M=56320|1023&M),p+=String.fromCharCode(M),m+=C}return p})(this.buf,i,t)}readBytes(){const t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i}readPackedVarint(t=[],i){const a=this.readPackedEnd();for(;this.pos<a;)t.push(this.readVarint(i));return t}readPackedSVarint(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(t){const i=7&t;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error("Unimplemented type: ".concat(i));this.pos+=8}}writeTag(t,i){this.writeVarint(t<<3|i)}realloc(t){let i=this.length||16;for(;i<this.pos+t;)i*=2;if(i!==this.length){const a=new Uint8Array(i);a.set(this.buf),this.buf=a,this.dataView=new DataView(a.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*$u),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*$u),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?(function(i,a){let o,u;if(i>=0?(o=i%4294967296|0,u=i/4294967296|0):(o=~(-i%4294967296),u=~(-i/4294967296),4294967295^o?o=o+1|0:(o=0,u=u+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),(function(p,m,_){_.buf[_.pos++]=127&p|128,p>>>=7,_.buf[_.pos++]=127&p|128,p>>>=7,_.buf[_.pos++]=127&p|128,p>>>=7,_.buf[_.pos++]=127&p|128,_.buf[_.pos]=127&(p>>>=7)})(o,0,a),(function(p,m){const _=(7&p)<<4;m.buf[m.pos++]|=_|((p>>>=3)?128:0),p&&(m.buf[m.pos++]=127&p|((p>>>=7)?128:0),p&&(m.buf[m.pos++]=127&p|((p>>>=7)?128:0),p&&(m.buf[m.pos++]=127&p|((p>>>=7)?128:0),p&&(m.buf[m.pos++]=127&p|((p>>>=7)?128:0),p&&(m.buf[m.pos++]=127&p)))))})(u,a)})(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const i=this.pos;this.pos=(function(o,u,p){for(let m,_,x=0;x<u.length;x++){if(m=u.charCodeAt(x),m>55295&&m<57344){if(!_){m>56319||x+1===u.length?(o[p++]=239,o[p++]=191,o[p++]=189):_=m;continue}if(m<56320){o[p++]=239,o[p++]=191,o[p++]=189,_=m;continue}m=_-55296<<10|m-56320|65536,_=null}else _&&(o[p++]=239,o[p++]=191,o[p++]=189,_=null);m<128?o[p++]=m:(m<2048?o[p++]=m>>6|192:(m<65536?o[p++]=m>>12|224:(o[p++]=m>>18|240,o[p++]=m>>12&63|128),o[p++]=m>>6&63|128),o[p++]=63&m|128)}return p})(this.buf,t,this.pos);const a=this.pos-i;a>=128&&Gu(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const i=t.length;this.writeVarint(i),this.realloc(i);for(let a=0;a<i;a++)this.buf[this.pos++]=t[a]}writeRawMessage(t,i){this.pos++;const a=this.pos;t(i,this);const o=this.pos-a;o>=128&&Gu(a,o,this),this.pos=a-1,this.writeVarint(o),this.pos+=o}writeMessage(t,i,a){this.writeTag(t,2),this.writeRawMessage(i,a)}writePackedVarint(t,i){i.length&&this.writeMessage(t,Yp,i)}writePackedSVarint(t,i){i.length&&this.writeMessage(t,Kp,i)}writePackedBoolean(t,i){i.length&&this.writeMessage(t,ef,i)}writePackedFloat(t,i){i.length&&this.writeMessage(t,Jp,i)}writePackedDouble(t,i){i.length&&this.writeMessage(t,Qp,i)}writePackedFixed32(t,i){i.length&&this.writeMessage(t,tf,i)}writePackedSFixed32(t,i){i.length&&this.writeMessage(t,rf,i)}writePackedFixed64(t,i){i.length&&this.writeMessage(t,nf,i)}writePackedSFixed64(t,i){i.length&&this.writeMessage(t,af,i)}writeBytesField(t,i){this.writeTag(t,2),this.writeBytes(i)}writeFixed32Field(t,i){this.writeTag(t,5),this.writeFixed32(i)}writeSFixed32Field(t,i){this.writeTag(t,5),this.writeSFixed32(i)}writeFixed64Field(t,i){this.writeTag(t,1),this.writeFixed64(i)}writeSFixed64Field(t,i){this.writeTag(t,1),this.writeSFixed64(i)}writeVarintField(t,i){this.writeTag(t,0),this.writeVarint(i)}writeSVarintField(t,i){this.writeTag(t,0),this.writeSVarint(i)}writeStringField(t,i){this.writeTag(t,2),this.writeString(i)}writeFloatField(t,i){this.writeTag(t,5),this.writeFloat(i)}writeDoubleField(t,i){this.writeTag(t,1),this.writeDouble(i)}writeBooleanField(t,i){this.writeVarintField(t,+i)}}function po(r,t,i){return i?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function Gu(r,t,i){const a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(a);for(let o=i.pos-1;o>=r;o--)i.buf[o+a]=i.buf[o]}function Yp(r,t){for(let i=0;i<r.length;i++)t.writeVarint(r[i])}function Kp(r,t){for(let i=0;i<r.length;i++)t.writeSVarint(r[i])}function Jp(r,t){for(let i=0;i<r.length;i++)t.writeFloat(r[i])}function Qp(r,t){for(let i=0;i<r.length;i++)t.writeDouble(r[i])}function ef(r,t){for(let i=0;i<r.length;i++)t.writeBoolean(r[i])}function tf(r,t){for(let i=0;i<r.length;i++)t.writeFixed32(r[i])}function rf(r,t){for(let i=0;i<r.length;i++)t.writeSFixed32(r[i])}function nf(r,t){for(let i=0;i<r.length;i++)t.writeFixed64(r[i])}function af(r,t){for(let i=0;i<r.length;i++)t.writeSFixed64(r[i])}function sf(r,t,i){r===1&&i.readMessage(of,t)}function of(r,t,i){if(r===3){const{id:a,bitmap:o,width:u,height:p,left:m,top:_,advance:x}=i.readMessage(lf,{});t.push({id:a,bitmap:new yl({width:u+6,height:p+6},o),metrics:{width:u,height:p,left:m,top:_,advance:x}})}}function lf(r,t,i){r===1?t.id=i.readVarint():r===2?t.bitmap=i.readBytes():r===3?t.width=i.readVarint():r===4?t.height=i.readVarint():r===5?t.left=i.readSVarint():r===6?t.top=i.readSVarint():r===7&&(t.advance=i.readVarint())}function qu(r){let t=0,i=0;for(const p of r)t+=p.w*p.h,i=Math.max(i,p.w);r.sort(((p,m)=>m.h-p.h));const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let o=0,u=0;for(const p of r)for(let m=a.length-1;m>=0;m--){const _=a[m];if(!(p.w>_.w||p.h>_.h)){if(p.x=_.x,p.y=_.y,u=Math.max(u,p.y+p.h),o=Math.max(o,p.x+p.w),p.w===_.w&&p.h===_.h){const x=a.pop();x&&m<a.length&&(a[m]=x)}else p.h===_.h?(_.x+=p.w,_.w-=p.w):p.w===_.w?(_.y+=p.h,_.h-=p.h):(a.push({x:_.x+p.w,y:_.y,w:_.w-p.w,h:p.h}),_.y+=p.h,_.h-=p.h);break}}return{w:o,h:u,fill:t/(o*u)||0}}class Lh{constructor(t,{pixelRatio:i,version:a,stretchX:o,stretchY:u,content:p,textFitWidth:m,textFitHeight:_}){this.paddedRect=t,this.pixelRatio=i,this.stretchX=o,this.stretchY=u,this.content=p,this.version=a,this.textFitWidth=m,this.textFitHeight=_}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Wu{constructor(t,i){const a={},o={};this.haveRenderCallbacks=[];const u=[];this.addImages(t,a,u),this.addImages(i,o,u);const{w:p,h:m}=qu(u),_=new Gi({width:p||1,height:m||1});for(const x in t){const v=t[x],T=a[x].paddedRect;Gi.copy(v.data,_,{x:0,y:0},{x:T.x+1,y:T.y+1},v.data)}for(const x in i){const v=i[x],T=o[x].paddedRect,M=T.x+1,C=T.y+1,E=v.data.width,R=v.data.height;Gi.copy(v.data,_,{x:0,y:0},{x:M,y:C},v.data),Gi.copy(v.data,_,{x:0,y:R-1},{x:M,y:C-1},{width:E,height:1}),Gi.copy(v.data,_,{x:0,y:0},{x:M,y:C+R},{width:E,height:1}),Gi.copy(v.data,_,{x:E-1,y:0},{x:M-1,y:C},{width:1,height:R}),Gi.copy(v.data,_,{x:0,y:0},{x:M+E,y:C},{width:1,height:R})}this.image=_,this.iconPositions=a,this.patternPositions=o}addImages(t,i,a){for(const o in t){const u=t[o],p={x:0,y:0,w:u.data.width+2,h:u.data.height+2};a.push(p),i[o]=new Lh(p,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(o)}}patchUpdatedImages(t,i){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),i)}patchUpdatedImage(t,i,a){if(!t||!i||t.version===i.version)return;t.version=i.version;const[o,u]=t.tl;a.update(i.data,void 0,{x:o,y:u})}}var Ta;Ae("ImagePosition",Lh),Ae("ImageAtlas",Wu),z.ao=void 0,(Ta=z.ao||(z.ao={}))[Ta.none=0]="none",Ta[Ta.horizontal=1]="horizontal",Ta[Ta.vertical=2]="vertical",Ta[Ta.horizontalOnly=3]="horizontalOnly";class Il{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,i,a){const o=new Il;return o.scale=t||1,o.fontStack=i,o.verticalAlign=a||"bottom",o}static forImage(t,i){const a=new Il;return a.imageName=t,a.verticalAlign=i||"bottom",a}}class fo{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,i){const a=new fo;for(let o=0;o<t.sections.length;o++){const u=t.sections[o];u.image?a.addImageSection(u):a.addTextSection(u,i)}return a}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=(function(t){let i="";for(let a=0;a<t.length;a++){const o=t.charCodeAt(a+1)||null,u=t.charCodeAt(a-1)||null;i+=o&&xc(o)&&!Cl[t[a+1]]||u&&xc(u)&&!Cl[t[a-1]]||!Cl[t[a]]?t[a]:Cl[t[a]]}return i})(this.text)}trim(){let t=0;for(let a=0;a<this.text.length&&Bc[this.text.charCodeAt(a)];a++)t++;let i=this.text.length;for(let a=this.text.length-1;a>=0&&a>=t&&Bc[this.text.charCodeAt(a)];a--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)}substring(t,i){const a=new fo;return a.text=this.text.substring(t,i),a.sectionIndex=this.sectionIndex.slice(t,i),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,i)=>Math.max(t,this.sections[i].scale)),0)}getMaxImageSize(t){let i=0,a=0;for(let o=0;o<this.length();o++){const u=this.getSection(o);if(u.imageName){const p=t[u.imageName];if(!p)continue;const m=p.displaySize;i=Math.max(i,m[0]),a=Math.max(a,m[1])}}return{maxImageWidth:i,maxImageHeight:a}}addTextSection(t,i){this.text+=t.text,this.sections.push(Il.forText(t.scale,t.fontStack||i,t.verticalAlign));const a=this.sections.length-1;for(let o=0;o<t.text.length;++o)this.sectionIndex.push(a)}addImageSection(t){const i=t.image?t.image.name:"";if(i.length===0)return void Ot("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(Il.forImage(i,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):Ot("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Fc(r,t,i,a,o,u,p,m,_,x,v,T,M,C,E){const R=fo.fromFeature(r,o);let L;T===z.ao.vertical&&R.verticalizePunctuation();const{processBidirectionalText:V,processStyledBidirectionalText:ie}=tn;if(V&&R.sections.length===1){L=[];const oe=V(R.toString(),Fh(R,x,u,t,a,C));for(const de of oe){const xe=new fo;xe.text=de,xe.sections=R.sections;for(let ze=0;ze<de.length;ze++)xe.sectionIndex.push(0);L.push(xe)}}else if(ie){L=[];const oe=ie(R.text,R.sectionIndex,Fh(R,x,u,t,a,C));for(const de of oe){const xe=new fo;xe.text=de[0],xe.sectionIndex=de[1],xe.sections=R.sections,L.push(xe)}}else L=(function(oe,de){const xe=[],ze=oe.text;let Pe=0;for(const Ce of de)xe.push(oe.substring(Pe,Ce)),Pe=Ce;return Pe<ze.length&&xe.push(oe.substring(Pe,ze.length)),xe})(R,Fh(R,x,u,t,a,C));const q=[],Y={positionedLines:q,text:R.toString(),top:v[1],bottom:v[1],left:v[0],right:v[0],writingMode:T,iconsInText:!1,verticalizable:!1};return(function(oe,de,xe,ze,Pe,Ce,Oe,Se,Ie,me,$e,Ge){let je=0,Fe=0,rt=0,kt=0;const Kt=Se==="right"?1:Se==="left"?0:.5,xi=ri/Ge;let gr=0;for(const It of Pe){It.trim();const ni=It.getMaxScale(),pi={positionedGlyphs:[],lineOffset:0};oe.positionedLines[gr]=pi;const fi=pi.positionedGlyphs;let Ai=0;if(!It.length()){Fe+=Ce,++gr;continue}const yr=df(ze,It,xi);for(let Wi=0;Wi<It.length();Wi++){const Jt=It.getSection(Wi),si=It.getSectionIndex(Wi),oi=It.getCharCode(Wi),Zt=pf(Ie,$e,oi);let bt;if(Jt.imageName){if(oe.iconsInText=!0,Jt.scale=Jt.scale*xi,bt=mf(Jt,Zt,ni,yr,ze),!bt)continue;Ai=Math.max(Ai,bt.imageOffset)}else if(bt=ff(Jt,oi,Zt,yr,de,xe),!bt)continue;const{rect:Vr,metrics:yo,baselineOffset:Nr}=bt;fi.push({glyph:oi,imageName:Jt.imageName,x:je,y:Fe+Nr+-17,vertical:Zt,scale:Jt.scale,fontStack:Jt.fontStack,sectionIndex:si,metrics:yo,rect:Vr}),Zt?(oe.verticalizable=!0,je+=(Jt.imageName?yo.advance:ri)*Jt.scale+me):je+=yo.advance*Jt.scale+me}fi.length!==0&&(rt=Math.max(je-me,rt),_f(fi,0,fi.length-1,Kt)),je=0,pi.lineOffset=Math.max(Ai,(ni-1)*ri);const ai=Ce*ni+Ai;Fe+=ai,kt=Math.max(ai,kt),++gr}const{horizontalAlign:qi,verticalAlign:di}=Bh(Oe);(function(It,ni,pi,fi,Ai,yr,ai,Wi,Jt){const si=(ni-pi)*Ai;let oi=0;oi=yr!==ai?-Wi*fi- -17:-fi*Jt*ai+.5*ai;for(const Zt of It)for(const bt of Zt.positionedGlyphs)bt.x+=si,bt.y+=oi})(oe.positionedLines,Kt,qi,di,rt,kt,Ce,Fe,Pe.length),oe.top+=-di*Fe,oe.bottom=oe.top+Fe,oe.left+=-qi*rt,oe.right=oe.left+rt})(Y,t,i,a,L,p,m,_,T,x,M,E),!(function(oe){for(const de of oe)if(de.positionedGlyphs.length!==0)return!1;return!0})(q)&&Y}const Bc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},cf={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},hf={40:!0};function Hu(r,t,i,a,o,u){if(t.imageName){const p=a[t.imageName];return p?p.displaySize[0]*t.scale*ri/u+o:0}{const p=i[t.fontStack],m=p&&p[r];return m?m.metrics.advance*t.scale+o:0}}function Xu(r,t,i,a){const o=Math.pow(r-t,2);return a?r<t?o/2:2*o:o+Math.abs(i)*i}function uf(r,t,i){let a=0;return r===10&&(a-=1e4),i&&(a+=150),r!==40&&r!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function Yu(r,t,i,a,o,u){let p=null,m=Xu(t,i,o,u);for(const _ of a){const x=Xu(t-_.x,i,o,u)+_.badness;x<=m&&(p=_,m=x)}return{index:r,x:t,priorBreak:p,badness:m}}function Ku(r){return r?Ku(r.priorBreak).concat(r.index):[]}function Fh(r,t,i,a,o,u){if(!r)return[];const p=[],m=(function(T,M,C,E,R,L){let V=0;for(let ie=0;ie<T.length();ie++){const q=T.getSection(ie);V+=Hu(T.getCharCode(ie),q,E,R,M,L)}return V/Math.max(1,Math.ceil(V/C))})(r,t,i,a,o,u),_=r.text.indexOf("â")>=0;let x=0;for(let T=0;T<r.length();T++){const M=r.getSection(T),C=r.getCharCode(T);if(Bc[C]||(x+=Hu(C,M,a,o,t,u)),T<r.length()-1){const E=!((v=C)<11904)&&(!!tt["CJK Compatibility Forms"](v)||!!tt["CJK Compatibility"](v)||!!tt["CJK Strokes"](v)||!!tt["CJK Symbols and Punctuation"](v)||!!tt["Enclosed CJK Letters and Months"](v)||!!tt["Halfwidth and Fullwidth Forms"](v)||!!tt["Ideographic Description Characters"](v)||!!tt["Vertical Forms"](v)||yc.test(String.fromCodePoint(v)));(cf[C]||E||M.imageName||T!==r.length()-2&&hf[r.getCharCode(T+1)])&&p.push(Yu(T+1,x,m,p,uf(C,r.getCharCode(T+1),E&&_),!1))}}var v;return Ku(Yu(r.length(),x,m,p,0,!0))}function Bh(r){let t=.5,i=.5;switch(r){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function df(r,t,i){const a=t.getMaxScale()*ri,{maxImageWidth:o,maxImageHeight:u}=t.getMaxImageSize(r),p=Math.max(a,u*i);return{verticalLineContentWidth:Math.max(a,o*i),horizontalLineContentHeight:p}}function Ju(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function pf(r,t,i){return!(r===z.ao.horizontal||!t&&!Js(i)||t&&(Bc[i]||(a=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(a)))));var a}function ff(r,t,i,a,o,u){const p=u[r.fontStack],m=(function(x,v,T,M){if(x&&x.rect)return x;const C=v[T.fontStack],E=C&&C[M];return E?{rect:null,metrics:E.metrics}:null})(p&&p[t],o,r,t);if(m===null)return null;let _;if(i)_=a.verticalLineContentWidth-r.scale*ri;else{const x=Ju(r.verticalAlign);_=(a.horizontalLineContentHeight-r.scale*ri)*x}return{rect:m.rect,metrics:m.metrics,baselineOffset:_}}function mf(r,t,i,a,o){const u=o[r.imageName];if(!u)return null;const p=u.paddedRect,m=u.displaySize,_={width:m[0],height:m[1],left:1,top:-3,advance:t?m[1]:m[0]};let x;if(t)x=a.verticalLineContentWidth-m[1]*r.scale;else{const v=Ju(r.verticalAlign);x=(a.horizontalLineContentHeight-m[1]*r.scale)*v}return{rect:p,metrics:_,baselineOffset:x,imageOffset:(t?m[0]:m[1])*r.scale-ri*i}}function _f(r,t,i,a){if(a===0)return;const o=r[i],u=(r[i].x+o.metrics.advance*o.scale)*a;for(let p=t;p<=i;p++)r[p].x-=u}function gf(r,t,i){const{horizontalAlign:a,verticalAlign:o}=Bh(i),u=t[0]-r.displaySize[0]*a,p=t[1]-r.displaySize[1]*o;return{image:r,top:p,bottom:p+r.displaySize[1],left:u,right:u+r.displaySize[0]}}function Qu(r){var t,i;let a=r.left,o=r.top,u=r.right-a,p=r.bottom-o;const m=(t=r.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",_=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",x=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(_==="proportional"){if(m==="stretchOnly"&&u/p<x||m==="proportional"){const v=Math.ceil(p*x);a*=v/u,u=v}}else if(m==="proportional"&&_==="stretchOnly"&&x!==0&&u/p>x){const v=Math.ceil(u/x);o*=v/p,p=v}return{x1:a,y1:o,x2:a+u,y2:o+p}}function ed(r,t,i,a,o,u){const p=r.image;let m;if(p.content){const L=p.content,V=p.pixelRatio||1;m=[L[0]/V,L[1]/V,p.displaySize[0]-L[2]/V,p.displaySize[1]-L[3]/V]}const _=t.left*u,x=t.right*u;let v,T,M,C;i==="width"||i==="both"?(C=o[0]+_-a[3],T=o[0]+x+a[1]):(C=o[0]+(_+x-p.displaySize[0])/2,T=C+p.displaySize[0]);const E=t.top*u,R=t.bottom*u;return i==="height"||i==="both"?(v=o[1]+E-a[0],M=o[1]+R+a[2]):(v=o[1]+(E+R-p.displaySize[1])/2,M=v+p.displaySize[1]),{image:p,top:v,right:T,bottom:M,left:C,collisionPadding:m}}const $n=128,Pa=32640;function td(r,t){const{expression:i}=t;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new yt(r+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:o}=i;let u=0;for(;u<a.length&&a[u]<=r;)u++;u=Math.max(0,u-1);let p=u;for(;p<a.length&&a[p]<r+1;)p++;p=Math.min(a.length-1,p);const m=a[u],_=a[p];return i.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:_,interpolationType:o}:{kind:"camera",minZoom:m,maxZoom:_,minSize:i.evaluate(new yt(m)),maxSize:i.evaluate(new yt(_)),interpolationType:o}}}function Oh(r,t,i){let a="never";const o=r.get(t);return o?a=o:r.get(i)&&(a="always"),a}const yf=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Oc(r,t,i,a,o,u,p,m,_,x,v,T,M){const C=m?Math.min(Pa,Math.round(m[0])):0,E=m?Math.min(Pa,Math.round(m[1])):0;r.emplaceBack(t,i,Math.round(32*a),Math.round(32*o),u,p,(C<<1)+(_?1:0),E,16*x,16*v,256*T,256*M)}function jh(r,t,i){r.emplaceBack(t.x,t.y,i),r.emplaceBack(t.x,t.y,i),r.emplaceBack(t.x,t.y,i),r.emplaceBack(t.x,t.y,i)}function xf(r){for(const t of r.sections)if(Tc(t.text))return!0;return!1}class Vh{constructor(t){this.layoutVertexArray=new Te,this.indexArray=new dt,this.programConfigurations=t,this.segments=new at,this.dynamicLayoutVertexArray=new ge,this.opacityVertexArray=new ke,this.hasVisibleVertices=!1,this.placedSymbolArray=new I}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,i,a,o){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Gp.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,qp.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,yf,!0),this.opacityVertexBuffer.itemSize=1),(a||o)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ae("SymbolBuffers",Vh);class Nh{constructor(t,i,a){this.layoutVertexArray=new t,this.layoutAttributes=i,this.indexArray=new a,this.segments=new at,this.collisionVertexArray=new ut}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Wp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ae("CollisionBuffers",Nh);class mo{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=xn(globalThis)?Math.min(t.overscaling,128):t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((p=>p.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=td(this.zoom,i["text-size"]),this.iconSizeData=td(this.zoom,i["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),u=a.get("symbol-z-order");this.canOverlap=Oh(a,"text-overlap","text-allow-overlap")!=="never"||Oh(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&!o.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((p=>z.ao[p]))),this.stateDependentLayerIds=this.layers.filter((p=>p.isStateDependent())).map((p=>p.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Vh(new cn(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Vh(new cn(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new O,this.lineVertexArray=new j,this.symbolInstances=new B,this.textAnchorOffsets=new $}calculateGlyphDependencies(t,i,a,o,u){for(let p=0;p<t.length;p++)if(i[t.charCodeAt(p)]=!0,(a||o)&&u){const m=Cl[t.charAt(p)];m&&(i[m.charCodeAt(0)]=!0)}}populate(t,i,a){const o=this.layers[0],u=o.layout,p=u.get("text-font"),m=u.get("text-field"),_=u.get("icon-image"),x=(m.value.kind!=="constant"||m.value.value instanceof Ii&&!m.value.value.isEmpty()||m.value.value.toString().length>0)&&(p.value.kind!=="constant"||p.value.value.length>0),v=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,T=u.get("symbol-sort-key");if(this.features=[],!x&&!v)return;const M=i.iconDependencies,C=i.glyphDependencies,E=i.availableImages,R=new yt(this.zoom);for(const{feature:L,id:V,index:ie,sourceLayerIndex:q}of t){const Y=o._featureFilter.needGeometry,oe=hs(L,Y);if(!o._featureFilter.filter(R,oe,a))continue;let de,xe;if(Y||(oe.geometry=cs(L)),x){const Pe=o.getValueAndResolveTokens("text-field",oe,a,E),Ce=Ii.factory(Pe),Oe=this.hasRTLText=this.hasRTLText||xf(Ce);(!Oe||tn.getRTLTextPluginStatus()==="unavailable"||Oe&&tn.isParsed())&&(de=Xp(Ce,o,oe))}if(v){const Pe=o.getValueAndResolveTokens("icon-image",oe,a,E);xe=Pe instanceof Ni?Pe:Ni.fromString(Pe)}if(!de&&!xe)continue;const ze=this.sortFeaturesByKey?T.evaluate(oe,{},a):void 0;if(this.features.push({id:V,text:de,icon:xe,index:ie,sourceLayerIndex:q,geometry:oe.geometry,properties:L.properties,type:uo.types[L.type],sortKey:ze}),xe&&(M[xe.name]=!0),de){const Pe=p.evaluate(oe,{},a).join(","),Ce=u.get("text-rotation-alignment")!=="viewport"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(z.ao.vertical)>=0;for(const Oe of de.sections)if(Oe.image)M[Oe.image.name]=!0;else{const Se=Ys(de.toString()),Ie=Oe.fontStack||Pe,me=C[Ie]=C[Ie]||{};this.calculateGlyphDependencies(Oe.text,me,Ce,this.allowVerticalPlacement,Se)}}}u.get("symbol-placement")==="line"&&(this.features=(function(L){const V={},ie={},q=[];let Y=0;function oe(Pe){q.push(L[Pe]),Y++}function de(Pe,Ce,Oe){const Se=ie[Pe];return delete ie[Pe],ie[Ce]=Se,q[Se].geometry[0].pop(),q[Se].geometry[0]=q[Se].geometry[0].concat(Oe[0]),Se}function xe(Pe,Ce,Oe){const Se=V[Ce];return delete V[Ce],V[Pe]=Se,q[Se].geometry[0].shift(),q[Se].geometry[0]=Oe[0].concat(q[Se].geometry[0]),Se}function ze(Pe,Ce,Oe){const Se=Oe?Ce[0][Ce[0].length-1]:Ce[0][0];return"".concat(Pe,":").concat(Se.x,":").concat(Se.y)}for(let Pe=0;Pe<L.length;Pe++){const Ce=L[Pe],Oe=Ce.geometry,Se=Ce.text?Ce.text.toString():null;if(!Se){oe(Pe);continue}const Ie=ze(Se,Oe),me=ze(Se,Oe,!0);if(Ie in ie&&me in V&&ie[Ie]!==V[me]){const $e=xe(Ie,me,Oe),Ge=de(Ie,me,q[$e].geometry);delete V[Ie],delete ie[me],ie[ze(Se,q[Ge].geometry,!0)]=Ge,q[$e].geometry=null}else Ie in ie?de(Ie,me,Oe):me in V?xe(Ie,me,Oe):(oe(Pe),V[Ie]=Y-1,ie[me]=Y-1)}return q.filter((Pe=>Pe.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((L,V)=>L.sortKey-V.sortKey))}update(t,i,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,i,this.layers,{imagePositions:a}),this.icon.programConfigurations.updatePaintArrays(t,i,this.layers,{imagePositions:a}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,i){const a=this.lineVertexArray.length;if(t.segment!==void 0){let o=t.dist(i[t.segment+1]),u=t.dist(i[t.segment]);const p={};for(let m=t.segment+1;m<i.length;m++)p[m]={x:i[m].x,y:i[m].y,tileUnitDistanceFromAnchor:o},m<i.length-1&&(o+=i[m+1].dist(i[m]));for(let m=t.segment||0;m>=0;m--)p[m]={x:i[m].x,y:i[m].y,tileUnitDistanceFromAnchor:u},m>0&&(u+=i[m-1].dist(i[m]));for(let m=0;m<i.length;m++){const _=p[m];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,i,a,o,u,p,m,_,x,v,T,M){const C=t.indexArray,E=t.layoutVertexArray,R=t.segments.prepareSegment(4*i.length,E,C,this.canOverlap?p.sortKey:void 0),L=this.glyphOffsetArray.length,V=R.vertexLength,ie=this.allowVerticalPlacement&&m===z.ao.vertical?Math.PI/2:0,q=p.text&&p.text.sections;for(let Y=0;Y<i.length;Y++){const{tl:oe,tr:de,bl:xe,br:ze,tex:Pe,pixelOffsetTL:Ce,pixelOffsetBR:Oe,minFontScaleX:Se,minFontScaleY:Ie,glyphOffset:me,isSDF:$e,sectionIndex:Ge}=i[Y],je=R.vertexLength,Fe=me[1];Oc(E,_.x,_.y,oe.x,Fe+oe.y,Pe.x,Pe.y,a,$e,Ce.x,Ce.y,Se,Ie),Oc(E,_.x,_.y,de.x,Fe+de.y,Pe.x+Pe.w,Pe.y,a,$e,Oe.x,Ce.y,Se,Ie),Oc(E,_.x,_.y,xe.x,Fe+xe.y,Pe.x,Pe.y+Pe.h,a,$e,Ce.x,Oe.y,Se,Ie),Oc(E,_.x,_.y,ze.x,Fe+ze.y,Pe.x+Pe.w,Pe.y+Pe.h,a,$e,Oe.x,Oe.y,Se,Ie),jh(t.dynamicLayoutVertexArray,_,ie),C.emplaceBack(je,je+2,je+1),C.emplaceBack(je+1,je+2,je+3),R.vertexLength+=4,R.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(me[0]),Y!==i.length-1&&Ge===i[Y+1].sectionIndex||t.programConfigurations.populatePaintArrays(E.length,p,p.index,{imagePositions:{},canonical:M,formattedSection:q&&q[Ge]})}t.placedSymbolArray.emplaceBack(_.x,_.y,L,this.glyphOffsetArray.length-L,V,x,v,_.segment,a?a[0]:0,a?a[1]:0,o[0],o[1],m,0,!1,0,T)}_addCollisionDebugVertex(t,i,a,o,u,p){return i.emplaceBack(0,0),t.emplaceBack(a.x,a.y,o,u,Math.round(p.x),Math.round(p.y))}addCollisionDebugVertices(t,i,a,o,u,p,m){const _=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),x=_.vertexLength,v=u.layoutVertexArray,T=u.collisionVertexArray,M=m.anchorX,C=m.anchorY;this._addCollisionDebugVertex(v,T,p,M,C,new Ee(t,i)),this._addCollisionDebugVertex(v,T,p,M,C,new Ee(a,i)),this._addCollisionDebugVertex(v,T,p,M,C,new Ee(a,o)),this._addCollisionDebugVertex(v,T,p,M,C,new Ee(t,o)),_.vertexLength+=4;const E=u.indexArray;E.emplaceBack(x,x+1),E.emplaceBack(x+1,x+2),E.emplaceBack(x+2,x+3),E.emplaceBack(x+3,x),_.primitiveLength+=4}addDebugCollisionBoxes(t,i,a,o){for(let u=t;u<i;u++){const p=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(p.x1,p.y1,p.x2,p.y2,o?this.textCollisionBox:this.iconCollisionBox,p.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Nh(We,Uu.members,_t),this.iconCollisionBox=new Nh(We,Uu.members,_t);for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(t,i,a,o,u,p,m,_,x){const v={};for(let T=i;T<a;T++){const M=t.get(T);v.textBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},v.textFeatureIndex=M.featureIndex;break}for(let T=o;T<u;T++){const M=t.get(T);v.verticalTextBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},v.verticalTextFeatureIndex=M.featureIndex;break}for(let T=p;T<m;T++){const M=t.get(T);v.iconBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},v.iconFeatureIndex=M.featureIndex;break}for(let T=_;T<x;T++){const M=t.get(T);v.verticalIconBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},v.verticalIconFeatureIndex=M.featureIndex;break}return v}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const a=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,i){const a=t.placedSymbolArray.get(i),o=a.vertexStartIndex+4*a.numGlyphs;for(let u=a.vertexStartIndex;u<o;u+=4)t.indexArray.emplaceBack(u,u+2,u+1),t.indexArray.emplaceBack(u+1,u+2,u+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(t),a=Math.cos(t),o=[],u=[],p=[];for(let m=0;m<this.symbolInstances.length;++m){p.push(m);const _=this.symbolInstances.get(m);o.push(0|Math.round(i*_.anchorX+a*_.anchorY)),u.push(_.featureIndex)}return p.sort(((m,_)=>o[m]-o[_]||u[_]-u[m])),p}addToSortKeyRanges(t,i){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(((o,u,p)=>{o>=0&&p.indexOf(o)===u&&this.addIndicesForPlacedSymbol(this.text,o)})),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 id,rd;Ae("SymbolBucket",mo,{omit:["layers","collisionBoxArray","features","compareText"]}),mo.MAX_GLYPHS=65535,mo.addDynamicAttributes=jh;var Uh={get paint(){return rd=rd||new Ti({"icon-opacity":new Ue(ne.paint_symbol["icon-opacity"]),"icon-color":new Ue(ne.paint_symbol["icon-color"]),"icon-halo-color":new Ue(ne.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ue(ne.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ue(ne.paint_symbol["icon-halo-blur"]),"icon-translate":new Le(ne.paint_symbol["icon-translate"]),"icon-translate-anchor":new Le(ne.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ue(ne.paint_symbol["text-opacity"]),"text-color":new Ue(ne.paint_symbol["text-color"],{runtimeType:ji,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new Ue(ne.paint_symbol["text-halo-color"]),"text-halo-width":new Ue(ne.paint_symbol["text-halo-width"]),"text-halo-blur":new Ue(ne.paint_symbol["text-halo-blur"]),"text-translate":new Le(ne.paint_symbol["text-translate"]),"text-translate-anchor":new Le(ne.paint_symbol["text-translate-anchor"])})},get layout(){return id=id||new Ti({"symbol-placement":new Le(ne.layout_symbol["symbol-placement"]),"symbol-spacing":new Le(ne.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Le(ne.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ue(ne.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Le(ne.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Le(ne.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Le(ne.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Le(ne.layout_symbol["icon-ignore-placement"]),"icon-optional":new Le(ne.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Le(ne.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ue(ne.layout_symbol["icon-size"]),"icon-text-fit":new Le(ne.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Le(ne.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ue(ne.layout_symbol["icon-image"]),"icon-rotate":new Ue(ne.layout_symbol["icon-rotate"]),"icon-padding":new Ue(ne.layout_symbol["icon-padding"]),"icon-keep-upright":new Le(ne.layout_symbol["icon-keep-upright"]),"icon-offset":new Ue(ne.layout_symbol["icon-offset"]),"icon-anchor":new Ue(ne.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Le(ne.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Le(ne.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Le(ne.layout_symbol["text-rotation-alignment"]),"text-field":new Ue(ne.layout_symbol["text-field"]),"text-font":new Ue(ne.layout_symbol["text-font"]),"text-size":new Ue(ne.layout_symbol["text-size"]),"text-max-width":new Ue(ne.layout_symbol["text-max-width"]),"text-line-height":new Le(ne.layout_symbol["text-line-height"]),"text-letter-spacing":new Ue(ne.layout_symbol["text-letter-spacing"]),"text-justify":new Ue(ne.layout_symbol["text-justify"]),"text-radial-offset":new Ue(ne.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Le(ne.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ue(ne.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ue(ne.layout_symbol["text-anchor"]),"text-max-angle":new Le(ne.layout_symbol["text-max-angle"]),"text-writing-mode":new Le(ne.layout_symbol["text-writing-mode"]),"text-rotate":new Ue(ne.layout_symbol["text-rotate"]),"text-padding":new Le(ne.layout_symbol["text-padding"]),"text-keep-upright":new Le(ne.layout_symbol["text-keep-upright"]),"text-transform":new Ue(ne.layout_symbol["text-transform"]),"text-offset":new Ue(ne.layout_symbol["text-offset"]),"text-allow-overlap":new Le(ne.layout_symbol["text-allow-overlap"]),"text-overlap":new Le(ne.layout_symbol["text-overlap"]),"text-ignore-placement":new Le(ne.layout_symbol["text-ignore-placement"]),"text-optional":new Le(ne.layout_symbol["text-optional"])})}};class nd{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Ht,this.defaultValue=t}evaluate(t){if(t.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(t.formattedSection))return i.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ae("FormatSectionOverride",nd,{omit:["defaultValue"]});class jc extends pr{constructor(t,i){super(t,Uh,i)}recalculate(t,i){if(super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const o=[];for(const u of a)o.indexOf(u)<0&&o.push(u);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,i,a,o){const u=this.layout.get(t).evaluate(i,{},a,o),p=this._unevaluatedLayout._values[t];return p.isDataDriven()||Bs(p.value)||!u?u:(function(m,_){return _.replace(/{([^{}]+)}/g,((x,v)=>m&&v in m?String(m[v]):""))})(i.properties,u)}createBucket(t){return new mo(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Uh.paint.overridableProperties){if(!jc.hasPaintOverride(this.layout,t))continue;const i=this.paint.get(t),a=new nd(i),o=new Xo(a,i.property.specification);let u=null;u=i.value.kind==="constant"||i.value.kind==="source"?new js("source",o):new Vs("composite",o,i.value.zoomStops),this.paint._values[t]=new Ir(i.property,u,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&jc.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){const a=t.get("text-field"),o=Uh.paint.properties[i];let u=!1;const p=m=>{for(const _ of m)if(o.overrides&&o.overrides.hasOverride(_))return void(u=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Ii)p(a.value.value.sections);else if(a.value.kind==="source"||a.value.kind==="composite"){const m=x=>{u||(x instanceof qe&&At(x.value)===za?p(x.value.sections):x instanceof Ss?p(x.sections):x.eachChild(m))},_=a.value;_._styleExpression&&m(_._styleExpression.expression)}return u}}let ad;var vf={get paint(){return ad=ad||new Ti({"background-color":new Le(ne.paint_background["background-color"]),"background-pattern":new Mc(ne.paint_background["background-pattern"]),"background-opacity":new Le(ne.paint_background["background-opacity"])})}};class bf extends pr{constructor(t,i){super(t,vf,i)}}class wf extends pr{constructor(t,i){super(t,{},i),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Tf{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Pf={once:!0},$h=63710088e-1;class Sa{constructor(t,i){if(isNaN(t)||isNaN(i))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(i,")"));if(this.lng=+t,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Sa(qn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(t){const i=Math.PI/180,a=this.lat*i,o=t.lat*i,u=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((t.lng-this.lng)*i);return $h*Math.acos(Math.min(u,1))}static convert(t){if(t instanceof Sa)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Sa(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Sa(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const sd=2*Math.PI*$h;function od(r){return sd*Math.cos(r*Math.PI/180)}function ld(r){return(180+r)/360}function cd(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function hd(r,t){return r/od(t)}function Zh(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function ud(r,t){return r*od(Zh(t))}class zl{constructor(t,i,a=0){this.x=+t,this.y=+i,this.z=+a}static fromLngLat(t,i=0){const a=Sa.convert(t);return new zl(ld(a.lng),cd(a.lat),hd(i,a.lat))}toLngLat(){return new Sa(360*this.x-180,Zh(this.y))}toAltitude(){return ud(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/sd*(t=Zh(this.y),1/Math.cos(t*Math.PI/180));var t}}function dd(r,t,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class Gh{constructor(t,i,a){if(!(function(o,u,p){return!(o<0||o>25||p<0||p>=Math.pow(2,o)||u<0||u>=Math.pow(2,o))})(t,i,a))throw new Error("x=".concat(i,", y=").concat(a,", z=").concat(t," outside of bounds. 0<=x<").concat(Math.pow(2,t),", 0<=y<").concat(Math.pow(2,t)," 0<=z<=25 "));this.z=t,this.x=i,this.y=a,this.key=_o(0,t,t,i,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,i,a){const o=(p=this.y,m=this.z,_=dd(256*(u=this.x),256*(p=Math.pow(2,m)-p-1),m),x=dd(256*(u+1),256*(p+1),m),_[0]+","+_[1]+","+x[0]+","+x[1]);var u,p,m,_,x;const v=(function(T,M,C){let E,R="";for(let L=T;L>0;L--)E=1<<L-1,R+=(M&E?1:0)+(C&E?2:0);return R})(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,v).replace(/{bbox-epsg-3857}/g,o)}isChildOf(t){const i=this.z-t.z;return i>0&&t.x===this.x>>i&&t.y===this.y>>i}getTilePoint(t){const i=Math.pow(2,this.z);return new Ee((t.x*i-this.x)*ft,(t.y*i-this.y)*ft)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}}class pd{constructor(t,i){this.wrap=t,this.canonical=i,this.key=_o(t,i.z,i.z,i.x,i.y)}}class _r{constructor(t,i,a,o,u){if(this.terrainRttPosMatrix32f=null,t<a)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(t,"; z = ").concat(a));this.overscaledZ=t,this.wrap=i,this.canonical=new Gh(a,+o,+u),this.key=_o(i,t,a,o,u)}clone(){return new _r(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));const i=this.canonical.z-t;return t>this.canonical.z?new _r(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new _r(t,this.wrap,t,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,i){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));const a=this.canonical.z-t;return t>this.canonical.z?_o(this.wrap*+i,t,this.canonical.z,this.canonical.x,this.canonical.y):_o(this.wrap*+i,t,t,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;const i=this.canonical.z-t.canonical.z;return!(i<0)&&t.canonical.x===this.canonical.x>>i&&t.canonical.y===this.canonical.y>>i}children(t){if(this.overscaledZ>=t)return[new _r(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new _r(i,this.wrap,i,a,o),new _r(i,this.wrap,i,a+1,o),new _r(i,this.wrap,i,a,o+1),new _r(i,this.wrap,i,a+1,o+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new _r(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new _r(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new pd(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(t){return this.canonical.getTilePoint(new zl(t.x-this.wrap,t.y))}}function _o(r,t,i,a,o){(r*=2)<0&&(r=-1*r-1);const u=1<<i;return(u*u*r+u*o+a).toString(36)+i.toString(36)+t.toString(36)}function El(r,t){return t?r.properties[t]:r.id}Ae("CanonicalTileID",Gh),Ae("OverscaledTileID",_r,{omit:["terrainRttPosMatrix32f"]});class ps{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){const i=new ps;return i.extend(t(new Ee(this.minX,this.minY))),i.extend(t(new Ee(this.maxX,this.minY))),i.extend(t(new Ee(this.minX,this.maxY))),i.extend(t(new Ee(this.maxX,this.maxY))),i}static fromPoints(t){const i=new ps;for(const a of t)i.extend(a);return i}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class fd{constructor(t){this._stringToNumber={},this._numberToString=[];for(let i=0;i<t.length;i++){const a=t[i];this._stringToNumber[a]=i,this._numberToString[i]=a}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(t," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[t]}}class md{constructor(t,i,a,o,u){this.type="Feature",this._vectorTileFeature=t,t._z=i,t._x=a,t._y=o,this.properties=t.properties,this.id=u}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&(t[i]=this[i]);return t}}class _d{constructor(t,i){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ts(ft,16,0),this.grid3D=new ts(ft,16,0),this.featureIndexArray=new W,this.promoteId=i}insert(t,i,a,o,u,p){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,u);const _=p?this.grid3D:this.grid;for(let x=0;x<i.length;x++){const v=i[x],T=[1/0,1/0,-1/0,-1/0];for(let M=0;M<v.length;M++){const C=v[M];T[0]=Math.min(T[0],C.x),T[1]=Math.min(T[1],C.y),T[2]=Math.max(T[2],C.x),T[3]=Math.max(T[3],C.y)}T[0]<ft&&T[1]<ft&&T[2]>=0&&T[3]>=0&&_.insert(m,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Du(new Rh(this.rawTileData)).layers,this.sourceLayerCoder=new fd(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,i,a,o){this.loadVTLayers();const u=t.params,p=ft/t.tileSize/t.scale,m=Ya(u.filter,u.globalState),_=t.queryGeometry,x=t.queryPadding*p,v=ps.fromPoints(_),T=this.grid.query(v.minX-x,v.minY-x,v.maxX+x,v.maxY+x),M=ps.fromPoints(t.cameraQueryGeometry).expandBy(x),C=this.grid3D.query(M.minX,M.minY,M.maxX,M.maxY,((L,V,ie,q)=>(function(Y,oe,de,xe,ze){for(const Ce of Y)if(oe<=Ce.x&&de<=Ce.y&&xe>=Ce.x&&ze>=Ce.y)return!0;const Pe=[new Ee(oe,de),new Ee(oe,ze),new Ee(xe,ze),new Ee(xe,de)];if(Y.length>2){for(const Ce of Pe)if(so(Y,Ce))return!0}for(let Ce=0;Ce<Y.length-1;Ce++)if(Qd(Y[Ce],Y[Ce+1],Pe))return!0;return!1})(t.cameraQueryGeometry,L-x,V-x,ie+x,q+x)));for(const L of C)T.push(L);T.sort(Sf);const E={};let R;for(let L=0;L<T.length;L++){const V=T[L];if(V===R)continue;R=V;const ie=this.featureIndexArray.get(V);let q=null;this.loadMatchingFeature(E,ie.bucketIndex,ie.sourceLayerIndex,ie.featureIndex,m,u.layers,u.availableImages,i,a,o,((Y,oe,de)=>(q||(q=cs(Y)),oe.queryIntersectsFeature({queryGeometry:_,feature:Y,featureState:de,geometry:q,zoom:this.z,transform:t.transform,pixelsToTileUnits:p,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation}))))}return E}loadMatchingFeature(t,i,a,o,u,p,m,_,x,v,T){const M=this.bucketLayerIDs[i];if(p&&!M.some((L=>p.has(L))))return;const C=this.sourceLayerCoder.decode(a),E=this.vtLayers[C].feature(o);if(u.needGeometry){const L=hs(E,!0);if(!u.filter(new yt(this.tileID.overscaledZ),L,this.tileID.canonical))return}else if(!u.filter(new yt(this.tileID.overscaledZ),E))return;const R=this.getId(E,C);for(let L=0;L<M.length;L++){const V=M[L];if(p&&!p.has(V))continue;const ie=_[V];if(!ie)continue;let q={};R&&v&&(q=v.getState(ie.sourceLayer||"_geojsonTileLayer",R));const Y=Yi({},x[V]);Y.paint=gd(Y.paint,ie.paint,E,q,m),Y.layout=gd(Y.layout,ie.layout,E,q,m);const oe=!T||T(E,ie,q);if(!oe)continue;const de=new md(E,this.z,this.x,this.y,R);de.layer=Y;let xe=t[V];xe===void 0&&(xe=t[V]=[]),xe.push({featureIndex:o,feature:de,intersectionZ:oe})}}lookupSymbolFeatures(t,i,a,o,u,p,m,_){const x={};this.loadVTLayers();const v=Ya(u.filterSpec,u.globalState);for(const T of t)this.loadMatchingFeature(x,a,o,T,v,p,m,_,i);return x}hasLayer(t){for(const i of this.bucketLayerIDs)for(const a of i)if(t===a)return!0;return!1}getId(t,i){var a;let o=t.id;return this.promoteId&&(o=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof o=="boolean"&&(o=Number(o)),o===void 0&&(!((a=t.properties)===null||a===void 0)&&a.cluster)&&this.promoteId&&(o=Number(t.properties.cluster_id))),o}}function gd(r,t,i,a,o){return Wn(r,((u,p)=>{const m=t instanceof eo?t.get(p):null;return m&&m.evaluate?m.evaluate(i,a,o):m}))}function Sf(r,t){return t-r}function yd(r,t,i,a,o){const u=[];for(let p=0;p<r.length;p++){const m=r[p];let _;for(let x=0;x<m.length-1;x++){let v=m[x],T=m[x+1];v.x<t&&T.x<t||(v.x<t?v=new Ee(t,v.y+(t-v.x)/(T.x-v.x)*(T.y-v.y))._round():T.x<t&&(T=new Ee(t,v.y+(t-v.x)/(T.x-v.x)*(T.y-v.y))._round()),v.y<i&&T.y<i||(v.y<i?v=new Ee(v.x+(i-v.y)/(T.y-v.y)*(T.x-v.x),i)._round():T.y<i&&(T=new Ee(v.x+(i-v.y)/(T.y-v.y)*(T.x-v.x),i)._round()),v.x>=a&&T.x>=a||(v.x>=a?v=new Ee(a,v.y+(a-v.x)/(T.x-v.x)*(T.y-v.y))._round():T.x>=a&&(T=new Ee(a,v.y+(a-v.x)/(T.x-v.x)*(T.y-v.y))._round()),v.y>=o&&T.y>=o||(v.y>=o?v=new Ee(v.x+(o-v.y)/(T.y-v.y)*(T.x-v.x),o)._round():T.y>=o&&(T=new Ee(v.x+(o-v.y)/(T.y-v.y)*(T.x-v.x),o)._round()),_&&v.equals(_[_.length-1])||(_=[v],u.push(_)),_.push(T)))))}}return u}Ae("FeatureIndex",_d,{omit:["rawTileData","sourceLayerCoder"]});class Ma extends Ee{constructor(t,i,a,o){super(t,i),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new Ma(this.x,this.y,this.angle,this.segment)}}function xd(r,t,i,a,o){if(t.segment===void 0||i===0)return!0;let u=t,p=t.segment+1,m=0;for(;m>-i/2;){if(p--,p<0)return!1;m-=r[p].dist(u),u=r[p]}m+=r[p].dist(r[p+1]),p++;const _=[];let x=0;for(;m<i/2;){const v=r[p],T=r[p+1];if(!T)return!1;let M=r[p-1].angleTo(v)-v.angleTo(T);for(M=Math.abs((M+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:m,angleDelta:M}),x+=M;m-_[0].distance>a;)x-=_.shift().angleDelta;if(x>o)return!1;p++,m+=v.dist(T)}return!0}function vd(r){let t=0;for(let i=0;i<r.length-1;i++)t+=r[i].dist(r[i+1]);return t}function bd(r,t,i){return r?.6*t*i:0}function wd(r,t){return Math.max(r?r.right-r.left:0,t?t.right-t.left:0)}function Mf(r,t,i,a,o,u){const p=bd(i,o,u),m=wd(i,a)*u;let _=0;const x=vd(r)/2;for(let v=0;v<r.length-1;v++){const T=r[v],M=r[v+1],C=T.dist(M);if(_+C>x){const E=(x-_)/C,R=Qi.number(T.x,M.x,E),L=Qi.number(T.y,M.y,E),V=new Ma(R,L,M.angleTo(T),v);return V._round(),!p||xd(r,V,m,p,t)?V:void 0}_+=C}}function Cf(r,t,i,a,o,u,p,m,_){const x=bd(a,u,p),v=wd(a,o),T=v*p,M=r[0].x===0||r[0].x===_||r[0].y===0||r[0].y===_;return t-T<t/4&&(t=T+t/4),Td(r,M?t/2*m%t:(v/2+2*u)*p*m%t,t,x,i,T,M,!1,_)}function Td(r,t,i,a,o,u,p,m,_){const x=u/2,v=vd(r);let T=0,M=t-i,C=[];for(let E=0;E<r.length-1;E++){const R=r[E],L=r[E+1],V=R.dist(L),ie=L.angleTo(R);for(;M+i<T+V;){M+=i;const q=(M-T)/V,Y=Qi.number(R.x,L.x,q),oe=Qi.number(R.y,L.y,q);if(Y>=0&&Y<_&&oe>=0&&oe<_&&M-x>=0&&M+x<=v){const de=new Ma(Y,oe,ie,E);de._round(),a&&!xd(r,de,u,a,o)||C.push(de)}}T+=V}return m||C.length||p||(C=Td(r,T/2,i,a,o,u,p,!0,_)),C}function Pd(r,t,i,a){const o=[],u=r.image,p=u.pixelRatio,m=u.paddedRect.w-2,_=u.paddedRect.h-2;let x={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom};const v=u.stretchX||[[0,m]],T=u.stretchY||[[0,_]],M=(me,$e)=>me+$e[1]-$e[0],C=v.reduce(M,0),E=T.reduce(M,0),R=m-C,L=_-E;let V=0,ie=C,q=0,Y=E,oe=0,de=R,xe=0,ze=L;if(u.content&&a){const me=u.content,$e=me[2]-me[0],Ge=me[3]-me[1];(u.textFitWidth||u.textFitHeight)&&(x=Qu(r)),V=Vc(v,0,me[0]),q=Vc(T,0,me[1]),ie=Vc(v,me[0],me[2]),Y=Vc(T,me[1],me[3]),oe=me[0]-V,xe=me[1]-q,de=$e-ie,ze=Ge-Y}const Pe=x.x1,Ce=x.y1,Oe=x.x2-Pe,Se=x.y2-Ce,Ie=(me,$e,Ge,je)=>{const Fe=Nc(me.stretch-V,ie,Oe,Pe),rt=Uc(me.fixed-oe,de,me.stretch,C),kt=Nc($e.stretch-q,Y,Se,Ce),Kt=Uc($e.fixed-xe,ze,$e.stretch,E),xi=Nc(Ge.stretch-V,ie,Oe,Pe),gr=Uc(Ge.fixed-oe,de,Ge.stretch,C),qi=Nc(je.stretch-q,Y,Se,Ce),di=Uc(je.fixed-xe,ze,je.stretch,E),It=new Ee(Fe,kt),ni=new Ee(xi,kt),pi=new Ee(xi,qi),fi=new Ee(Fe,qi),Ai=new Ee(rt/p,Kt/p),yr=new Ee(gr/p,di/p),ai=t*Math.PI/180;if(ai){const si=Math.sin(ai),oi=Math.cos(ai),Zt=[oi,-si,si,oi];It._matMult(Zt),ni._matMult(Zt),fi._matMult(Zt),pi._matMult(Zt)}const Wi=me.stretch+me.fixed,Jt=$e.stretch+$e.fixed;return{tl:It,tr:ni,bl:fi,br:pi,tex:{x:u.paddedRect.x+1+Wi,y:u.paddedRect.y+1+Jt,w:Ge.stretch+Ge.fixed-Wi,h:je.stretch+je.fixed-Jt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ai,pixelOffsetBR:yr,minFontScaleX:de/p/Oe,minFontScaleY:ze/p/Se,isSDF:i}};if(a&&(u.stretchX||u.stretchY)){const me=Sd(v,R,C),$e=Sd(T,L,E);for(let Ge=0;Ge<me.length-1;Ge++){const je=me[Ge],Fe=me[Ge+1];for(let rt=0;rt<$e.length-1;rt++)o.push(Ie(je,$e[rt],Fe,$e[rt+1]))}}else o.push(Ie({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:_+1}));return o}function Vc(r,t,i){let a=0;for(const o of r)a+=Math.max(t,Math.min(i,o[1]))-Math.max(t,Math.min(i,o[0]));return a}function Sd(r,t,i){const a=[{fixed:-1,stretch:0}];for(const[o,u]of r){const p=a[a.length-1];a.push({fixed:o-p.stretch,stretch:p.stretch}),a.push({fixed:o-p.stretch,stretch:p.stretch+(u-o)})}return a.push({fixed:t+1,stretch:i}),a}function Nc(r,t,i,a){return r/t*i+a}function Uc(r,t,i,a){return r-t*i/a}Ae("Anchor",Ma);class $c{constructor(t,i,a,o,u,p,m,_,x,v){var T;if(this.boxStartIndex=t.length,x){let M=p.top,C=p.bottom;const E=p.collisionPadding;E&&(M-=E[1],C+=E[3]);let R=C-M;R>0&&(R=Math.max(10,R),this.circleDiameter=R)}else{const M=!((T=p.image)===null||T===void 0)&&T.content&&(p.image.textFitWidth||p.image.textFitHeight)?Qu(p):{x1:p.left,y1:p.top,x2:p.right,y2:p.bottom};M.y1=M.y1*m-_[0],M.y2=M.y2*m+_[2],M.x1=M.x1*m-_[3],M.x2=M.x2*m+_[1];const C=p.collisionPadding;if(C&&(M.x1-=C[0]*m,M.y1-=C[1]*m,M.x2+=C[2]*m,M.y2+=C[3]*m),v){const E=new Ee(M.x1,M.y1),R=new Ee(M.x2,M.y1),L=new Ee(M.x1,M.y2),V=new Ee(M.x2,M.y2),ie=v*Math.PI/180;E._rotate(ie),R._rotate(ie),L._rotate(ie),V._rotate(ie),M.x1=Math.min(E.x,R.x,L.x,V.x),M.x2=Math.max(E.x,R.x,L.x,V.x),M.y1=Math.min(E.y,R.y,L.y,V.y),M.y2=Math.max(E.y,R.y,L.y,V.y)}t.emplaceBack(i.x,i.y,M.x1,M.y1,M.x2,M.y2,a,o,u)}this.boxEndIndex=t.length}}class If{constructor(t=[],i=(a,o)=>a<o?-1:a>o?1:0){if(this.data=t,this.length=this.data.length,this.compare=i,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:i,compare:a}=this,o=i[t];for(;t>0;){const u=t-1>>1,p=i[u];if(a(o,p)>=0)break;i[t]=p,t=u}i[t]=o}_down(t){const{data:i,compare:a}=this,o=this.length>>1,u=i[t];for(;t<o;){let p=1+(t<<1);const m=p+1;if(m<this.length&&a(i[m],i[p])<0&&(p=m),a(i[p],u)>=0)break;i[t]=i[p],t=p}i[t]=u}}function zf(r,t=1,i=!1){const a=ps.fromPoints(r[0]),o=Math.min(a.width(),a.height());let u=o/2;const p=new If([],Ef),{minX:m,minY:_,maxX:x,maxY:v}=a;if(o===0)return new Ee(m,_);for(let C=m;C<x;C+=o)for(let E=_;E<v;E+=o)p.push(new go(C+u,E+u,u,r));let T=(function(C){let E=0,R=0,L=0;const V=C[0];for(let ie=0,q=V.length,Y=q-1;ie<q;Y=ie++){const oe=V[ie],de=V[Y],xe=oe.x*de.y-de.x*oe.y;R+=(oe.x+de.x)*xe,L+=(oe.y+de.y)*xe,E+=3*xe}return new go(R/E,L/E,0,C)})(r),M=p.length;for(;p.length;){const C=p.pop();(C.d>T.d||!T.d)&&(T=C,i&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,M)),C.max-T.d<=t||(u=C.h/2,p.push(new go(C.p.x-u,C.p.y-u,u,r)),p.push(new go(C.p.x+u,C.p.y-u,u,r)),p.push(new go(C.p.x-u,C.p.y+u,u,r)),p.push(new go(C.p.x+u,C.p.y+u,u,r)),M+=4)}return i&&(console.log("num probes: ".concat(M)),console.log("best distance: ".concat(T.d))),T.p}function Ef(r,t){return t.max-r.max}function go(r,t,i,a){this.p=new Ee(r,t),this.h=i,this.d=(function(o,u){let p=!1,m=1/0;for(let _=0;_<u.length;_++){const x=u[_];for(let v=0,T=x.length,M=T-1;v<T;M=v++){const C=x[v],E=x[M];C.y>o.y!=E.y>o.y&&o.x<(E.x-C.x)*(o.y-C.y)/(E.y-C.y)+C.x&&(p=!p),m=Math.min(m,hu(o,C,E))}}return(p?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}var yi;z.aE=void 0,(yi=z.aE||(z.aE={}))[yi.center=1]="center",yi[yi.left=2]="left",yi[yi.right=3]="right",yi[yi.top=4]="top",yi[yi.bottom=5]="bottom",yi[yi["top-left"]=6]="top-left",yi[yi["top-right"]=7]="top-right",yi[yi["bottom-left"]=8]="bottom-left",yi[yi["bottom-right"]=9]="bottom-right";const qh=Number.POSITIVE_INFINITY;function Md(r,t){return t[1]!==qh?(function(i,a,o){let u=0,p=0;switch(a=Math.abs(a),o=Math.abs(o),i){case"top-right":case"top-left":case"top":p=o-7;break;case"bottom-right":case"bottom-left":case"bottom":p=7-o}switch(i){case"top-right":case"bottom-right":case"right":u=-a;break;case"top-left":case"bottom-left":case"left":u=a}return[u,p]})(r,t[0],t[1]):(function(i,a){let o=0,u=0;a<0&&(a=0);const p=a/Math.SQRT2;switch(i){case"top-right":case"top-left":u=p-7;break;case"bottom-right":case"bottom-left":u=7-p;break;case"bottom":u=7-a;break;case"top":u=a-7}switch(i){case"top-right":case"bottom-right":o=-p;break;case"top-left":case"bottom-left":o=p;break;case"left":o=a;break;case"right":o=-a}return[o,u]})(r,t[0])}function Cd(r,t,i){var a;const o=r.layout,u=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(t,{},i);if(u){const m=u.values,_=[];for(let x=0;x<m.length;x+=2){const v=_[x]=m[x],T=m[x+1].map((M=>M*ri));v.startsWith("top")?T[1]-=7:v.startsWith("bottom")&&(T[1]+=7),_[x+1]=T}return new wi(_)}const p=o.get("text-variable-anchor");if(p){let m;m=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(t,{},i)*ri,qh]:o.get("text-offset").evaluate(t,{},i).map((x=>x*ri));const _=[];for(const x of p)_.push(x,Md(x,m));return new wi(_)}return null}function Wh(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Af(r,t,i,a,o,u,p,m,_,x,v,T){let M=u.textMaxSize.evaluate(t,{});M===void 0&&(M=p);const C=r.layers[0].layout,E=C.get("icon-offset").evaluate(t,{},v),R=zd(i.horizontal),L=p/24,V=r.tilePixelRatio*L,ie=r.tilePixelRatio*M/24,q=r.tilePixelRatio*m,Y=r.tilePixelRatio*C.get("symbol-spacing"),oe=C.get("text-padding")*r.tilePixelRatio,de=(function(Ge,je,Fe,rt=1){const kt=Ge.get("icon-padding").evaluate(je,{},Fe),Kt=kt&&kt.values;return[Kt[0]*rt,Kt[1]*rt,Kt[2]*rt,Kt[3]*rt]})(C,t,v,r.tilePixelRatio),xe=C.get("text-max-angle")/180*Math.PI,ze=C.get("text-rotation-alignment")!=="viewport"&&C.get("symbol-placement")!=="point",Pe=C.get("icon-rotation-alignment")==="map"&&C.get("symbol-placement")!=="point",Ce=C.get("symbol-placement"),Oe=Y/2,Se=C.get("icon-text-fit");let Ie;a&&Se!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(Ie=ed(a,i.vertical,Se,C.get("icon-text-fit-padding"),E,L)),R&&(a=ed(a,R,Se,C.get("icon-text-fit-padding"),E,L)));const me=v?T.line.getGranularityForZoomLevel(v.z):1,$e=(Ge,je)=>{je.x<0||je.x>=ft||je.y<0||je.y>=ft||(function(Fe,rt,kt,Kt,xi,gr,qi,di,It,ni,pi,fi,Ai,yr,ai,Wi,Jt,si,oi,Zt,bt,Vr,yo,Nr,Rf){const xo=Fe.addToLineVertexArray(rt,kt);let fs,vo,bo,wo,Dd=0,Rd=0,Ld=0,Fd=0,tu=-1,iu=-1;const Zn={};let Bd=wa("");if(Fe.allowVerticalPlacement&&Kt.vertical){const Si=di.layout.get("text-rotate").evaluate(bt,{},Nr)+90;bo=new $c(It,rt,ni,pi,fi,Kt.vertical,Ai,yr,ai,Si),qi&&(wo=new $c(It,rt,ni,pi,fi,qi,Jt,si,ai,Si))}if(xi){const Si=di.layout.get("icon-rotate").evaluate(bt,{}),xr=di.layout.get("icon-text-fit")!=="none",ms=Pd(xi,Si,yo,xr),$r=qi?Pd(qi,Si,yo,xr):void 0;vo=new $c(It,rt,ni,pi,fi,xi,Jt,si,!1,Si),Dd=4*ms.length;const _s=Fe.iconSizeData;let hn=null;_s.kind==="source"?(hn=[$n*di.layout.get("icon-size").evaluate(bt,{})],hn[0]>Pa&&Ot("".concat(Fe.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".'))):_s.kind==="composite"&&(hn=[$n*Vr.compositeIconSizes[0].evaluate(bt,{},Nr),$n*Vr.compositeIconSizes[1].evaluate(bt,{},Nr)],(hn[0]>Pa||hn[1]>Pa)&&Ot("".concat(Fe.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".'))),Fe.addSymbols(Fe.icon,ms,hn,Zt,oi,bt,z.ao.none,rt,xo.lineStartIndex,xo.lineLength,-1,Nr),tu=Fe.icon.placedSymbolArray.length-1,$r&&(Rd=4*$r.length,Fe.addSymbols(Fe.icon,$r,hn,Zt,oi,bt,z.ao.vertical,rt,xo.lineStartIndex,xo.lineLength,-1,Nr),iu=Fe.icon.placedSymbolArray.length-1)}const Od=Object.keys(Kt.horizontal);for(const Si of Od){const xr=Kt.horizontal[Si];if(!fs){Bd=wa(xr.text);const $r=di.layout.get("text-rotate").evaluate(bt,{},Nr);fs=new $c(It,rt,ni,pi,fi,xr,Ai,yr,ai,$r)}const ms=xr.positionedLines.length===1;if(Ld+=Id(Fe,rt,xr,gr,di,ai,bt,Wi,xo,Kt.vertical?z.ao.horizontal:z.ao.horizontalOnly,ms?Od:[Si],Zn,tu,Vr,Nr),ms)break}Kt.vertical&&(Fd+=Id(Fe,rt,Kt.vertical,gr,di,ai,bt,Wi,xo,z.ao.vertical,["vertical"],Zn,iu,Vr,Nr));const Lf=fs?fs.boxStartIndex:Fe.collisionBoxArray.length,Ff=fs?fs.boxEndIndex:Fe.collisionBoxArray.length,Bf=bo?bo.boxStartIndex:Fe.collisionBoxArray.length,Of=bo?bo.boxEndIndex:Fe.collisionBoxArray.length,jf=vo?vo.boxStartIndex:Fe.collisionBoxArray.length,Vf=vo?vo.boxEndIndex:Fe.collisionBoxArray.length,Nf=wo?wo.boxStartIndex:Fe.collisionBoxArray.length,Uf=wo?wo.boxEndIndex:Fe.collisionBoxArray.length;let Ur=-1;const Gc=(Si,xr)=>Si&&Si.circleDiameter?Math.max(Si.circleDiameter,xr):xr;Ur=Gc(fs,Ur),Ur=Gc(bo,Ur),Ur=Gc(vo,Ur),Ur=Gc(wo,Ur);const jd=Ur>-1?1:0;jd&&(Ur*=Rf/ri),Fe.glyphOffsetArray.length>=mo.MAX_GLYPHS&&Ot("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),bt.sortKey!==void 0&&Fe.addToSortKeyRanges(Fe.symbolInstances.length,bt.sortKey);const $f=Cd(di,bt,Nr),[Zf,Gf]=(function(Si,xr){const ms=Si.length,$r=xr==null?void 0:xr.values;if(($r==null?void 0:$r.length)>0)for(let _s=0;_s<$r.length;_s+=2){const hn=$r[_s+1];Si.emplaceBack(z.aE[$r[_s]],hn[0],hn[1])}return[ms,Si.length]})(Fe.textAnchorOffsets,$f);Fe.symbolInstances.emplaceBack(rt.x,rt.y,Zn.right>=0?Zn.right:-1,Zn.center>=0?Zn.center:-1,Zn.left>=0?Zn.left:-1,Zn.vertical||-1,tu,iu,Bd,Lf,Ff,Bf,Of,jf,Vf,Nf,Uf,ni,Ld,Fd,Dd,Rd,jd,0,Ai,Ur,Zf,Gf)})(r,je,Ge,i,a,o,Ie,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,V,[oe,oe,oe,oe],ze,_,q,de,Pe,E,t,u,x,v,p)};if(Ce==="line")for(const Ge of yd(t.geometry,0,0,ft,ft)){const je=ds(Ge,me),Fe=Cf(je,Y,xe,i.vertical||R,a,24,ie,r.overscaling,ft);for(const rt of Fe)R&&kf(r,R.text,Oe,rt)||$e(je,rt)}else if(Ce==="line-center"){for(const Ge of t.geometry)if(Ge.length>1){const je=ds(Ge,me),Fe=Mf(je,xe,i.vertical||R,a,24,ie);Fe&&$e(je,Fe)}}else if(t.type==="Polygon")for(const Ge of Cs(t.geometry,0)){const je=zf(Ge,16);$e(ds(Ge[0],me,!0),new Ma(je.x,je.y,0))}else if(t.type==="LineString")for(const Ge of t.geometry){const je=ds(Ge,me);$e(je,new Ma(je[0].x,je[0].y,0))}else if(t.type==="Point")for(const Ge of t.geometry)for(const je of Ge)$e([je],new Ma(je.x,je.y,0))}function Id(r,t,i,a,o,u,p,m,_,x,v,T,M,C,E){const R=(function(ie,q,Y,oe,de,xe,ze,Pe){const Ce=oe.layout.get("text-rotate").evaluate(xe,{})*Math.PI/180,Oe=[];for(const Se of q.positionedLines)for(const Ie of Se.positionedGlyphs){if(!Ie.rect)continue;const me=Ie.rect||{};let $e=4,Ge=!0,je=1,Fe=0;const rt=(de||Pe)&&Ie.vertical,kt=Ie.metrics.advance*Ie.scale/2;if(Pe&&q.verticalizable&&(Fe=Se.lineOffset/2-(Ie.imageName?-(ri-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*ri)),Ie.imageName){const si=ze[Ie.imageName];Ge=si.sdf,je=si.pixelRatio,$e=1/je}const Kt=de?[Ie.x+kt,Ie.y]:[0,0];let xi=de?[0,0]:[Ie.x+kt+Y[0],Ie.y+Y[1]-Fe],gr=[0,0];rt&&(gr=xi,xi=[0,0]);const qi=Ie.metrics.isDoubleResolution?2:1,di=(Ie.metrics.left-$e)*Ie.scale-kt+xi[0],It=(-Ie.metrics.top-$e)*Ie.scale+xi[1],ni=di+me.w/qi*Ie.scale/je,pi=It+me.h/qi*Ie.scale/je,fi=new Ee(di,It),Ai=new Ee(ni,It),yr=new Ee(di,pi),ai=new Ee(ni,pi);if(rt){const si=new Ee(-kt,kt- -17),oi=-Math.PI/2,Zt=12-kt,bt=new Ee(22-Zt,-(Ie.imageName?Zt:0)),Vr=new Ee(...gr);fi._rotateAround(oi,si)._add(bt)._add(Vr),Ai._rotateAround(oi,si)._add(bt)._add(Vr),yr._rotateAround(oi,si)._add(bt)._add(Vr),ai._rotateAround(oi,si)._add(bt)._add(Vr)}if(Ce){const si=Math.sin(Ce),oi=Math.cos(Ce),Zt=[oi,-si,si,oi];fi._matMult(Zt),Ai._matMult(Zt),yr._matMult(Zt),ai._matMult(Zt)}const Wi=new Ee(0,0),Jt=new Ee(0,0);Oe.push({tl:fi,tr:Ai,bl:yr,br:ai,tex:me,writingMode:q.writingMode,glyphOffset:Kt,sectionIndex:Ie.sectionIndex,isSDF:Ge,pixelOffsetTL:Wi,pixelOffsetBR:Jt,minFontScaleX:0,minFontScaleY:0})}return Oe})(0,i,m,o,u,p,a,r.allowVerticalPlacement),L=r.textSizeData;let V=null;L.kind==="source"?(V=[$n*o.layout.get("text-size").evaluate(p,{})],V[0]>Pa&&Ot("".concat(r.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".'))):L.kind==="composite"&&(V=[$n*C.compositeTextSizes[0].evaluate(p,{},E),$n*C.compositeTextSizes[1].evaluate(p,{},E)],(V[0]>Pa||V[1]>Pa)&&Ot("".concat(r.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".'))),r.addSymbols(r.text,R,V,m,u,p,x,t,_.lineStartIndex,_.lineLength,M,E);for(const ie of v)T[ie]=r.text.placedSymbolArray.length-1;return 4*R.length}function zd(r){for(const t in r)return r[t];return null}function kf(r,t,i,a){const o=r.compareText;if(t in o){const u=o[t];for(let p=u.length-1;p>=0;p--)if(a.dist(u[p])<i)return!0}else o[t]=[];return o[t].push(a),!1}const Ed=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Hh{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,a]=new Uint8Array(t,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=a>>4;if(o!==1)throw new Error("Got v".concat(o," data when expected v1."));const u=Ed[15&a];if(!u)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(t,2,1),[m]=new Uint32Array(t,4,1);return new Hh(m,p,u,t)}constructor(t,i=64,a=Float64Array,o){if(isNaN(t)||t<0)throw new Error("Unpexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const u=Ed.indexOf(this.ArrayType),p=2*t*this.ArrayType.BYTES_PER_ELEMENT,m=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-m%8)%8;if(u<0)throw new Error("Unexpected typed array class: ".concat(a,"."));o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+p+m+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+u]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t)}add(t,i){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=i,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error("Added ".concat(t," items when expected ").concat(this.numItems,"."));return Xh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,i,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:p,nodeSize:m}=this,_=[0,u.length-1,0],x=[];for(;_.length;){const v=_.pop()||0,T=_.pop()||0,M=_.pop()||0;if(T-M<=m){for(let L=M;L<=T;L++){const V=p[2*L],ie=p[2*L+1];V>=t&&V<=a&&ie>=i&&ie<=o&&x.push(u[L])}continue}const C=M+T>>1,E=p[2*C],R=p[2*C+1];E>=t&&E<=a&&R>=i&&R<=o&&x.push(u[C]),(v===0?t<=E:i<=R)&&(_.push(M),_.push(C-1),_.push(1-v)),(v===0?a>=E:o>=R)&&(_.push(C+1),_.push(T),_.push(1-v))}return x}within(t,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:u,nodeSize:p}=this,m=[0,o.length-1,0],_=[],x=a*a;for(;m.length;){const v=m.pop()||0,T=m.pop()||0,M=m.pop()||0;if(T-M<=p){for(let L=M;L<=T;L++)kd(u[2*L],u[2*L+1],t,i)<=x&&_.push(o[L]);continue}const C=M+T>>1,E=u[2*C],R=u[2*C+1];kd(E,R,t,i)<=x&&_.push(o[C]),(v===0?t-a<=E:i-a<=R)&&(m.push(M),m.push(C-1),m.push(1-v)),(v===0?t+a>=E:i+a>=R)&&(m.push(C+1),m.push(T),m.push(1-v))}return _}}function Xh(r,t,i,a,o,u){if(o-a<=i)return;const p=a+o>>1;Ad(r,t,p,a,o,u),Xh(r,t,i,a,p-1,1-u),Xh(r,t,i,p+1,o,1-u)}function Ad(r,t,i,a,o,u){for(;o>a;){if(o-a>600){const x=o-a+1,v=i-a+1,T=Math.log(x),M=.5*Math.exp(2*T/3),C=.5*Math.sqrt(T*M*(x-M)/x)*(v-x/2<0?-1:1);Ad(r,t,i,Math.max(a,Math.floor(i-v*M/x+C)),Math.min(o,Math.floor(i+(x-v)*M/x+C)),u)}const p=t[2*i+u];let m=a,_=o;for(Al(r,t,a,i),t[2*o+u]>p&&Al(r,t,a,o);m<_;){for(Al(r,t,m,_),m++,_--;t[2*m+u]<p;)m++;for(;t[2*_+u]>p;)_--}t[2*a+u]===p?Al(r,t,a,_):(_++,Al(r,t,_,o)),_<=i&&(a=_+1),i<=_&&(o=_-1)}}function Al(r,t,i,a){Yh(r,i,a),Yh(t,2*i,2*a),Yh(t,2*i+1,2*a+1)}function Yh(r,t,i){const a=r[t];r[t]=r[i],r[i]=a}function kd(r,t,i,a){const o=r-i,u=t-a;return o*o+u*u}var Kh;z.cx=void 0,(Kh=z.cx||(z.cx={})).create="create",Kh.load="load",Kh.fullLoad="fullLoad";let Zc=null,kl=[];const Jh=1e3/60,Qh="loadTime",eu="fullLoadTime",Df={mark(r){performance.mark(r)},frame(r){const t=r;Zc!=null&&kl.push(t-Zc),Zc=t},clearMetrics(){Zc=null,kl=[],performance.clearMeasures(Qh),performance.clearMeasures(eu);for(const r in z.cx)performance.clearMarks(z.cx[r])},getPerformanceMetrics(){performance.measure(Qh,z.cx.create,z.cx.load),performance.measure(eu,z.cx.create,z.cx.fullLoad);const r=performance.getEntriesByName(Qh)[0].duration,t=performance.getEntriesByName(eu)[0].duration,i=kl.length,a=1/(kl.reduce(((u,p)=>u+p),0)/i/1e3),o=kl.filter((u=>u>Jh)).reduce(((u,p)=>u+(p-Jh)/Jh),0);return{loadTime:r,fullLoadTime:t,fps:a,percentDroppedFrames:o/(i+o)*100,totalFrames:i}}};z.$=ft,z.A=Et,z.B=function([r,t,i]){return t+=90,t*=Math.PI/180,i*=Math.PI/180,{x:r*Math.cos(t)*Math.sin(i),y:r*Math.sin(t)*Math.sin(i),z:r*Math.cos(i)}},z.C=Qi,z.D=Le,z.E=Ve,z.F=yt,z.G=rl,z.H=xn,z.I=Lh,z.J=class{constructor(r,t){this.target=r,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Tf((()=>this.process())),this.subscription=vn(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=wr(self)?r:window}registerMessageHandler(r,t){this.messageHandlers[r]=t}sendAsync(r,t){return new Promise(((i,a)=>{const o=Math.round(1e18*Math.random()).toString(36).substring(0,10),u=t?vn(t.signal,"abort",(()=>{u==null||u.unsubscribe(),delete this.resolveRejects[o];const _={id:o,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(_)}),Pf):null;this.resolveRejects[o]={resolve:_=>{u==null||u.unsubscribe(),i(_)},reject:_=>{u==null||u.unsubscribe(),a(_)}};const p=[],m=Object.assign(Object.assign({},r),{id:o,sourceMapId:this.mapId,origin:location.origin,data:rs(r.data,p)});this.target.postMessage(m,{transfer:p})}))}receive(r){const t=r.data,i=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[i];const a=this.abortControllers[i];return delete this.abortControllers[i],void(a&&a.abort())}if(wr(self)||t.mustQueue)return this.tasks[i]=t,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,t)}}process(){if(this.taskQueue.length===0)return;const r=this.taskQueue.shift(),t=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(r,t)}processTask(r,t){return c(this,void 0,void 0,(function*(){if(t.type==="<response>"){const o=this.resolveRejects[r];return delete this.resolveRejects[r],o?void(t.error?o.reject(Bn(t.error)):o.resolve(Bn(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(r,new Error("Could not find a registered handler for ".concat(t.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));const i=Bn(t.data),a=new AbortController;this.abortControllers[r]=a;try{const o=yield this.messageHandlers[t.type](t.sourceMapId,i,a);this.completeTask(r,null,o)}catch(o){this.completeTask(r,o)}}))}completeTask(r,t,i){const a=[];delete this.abortControllers[r];const o={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?rs(t):null,data:rs(i,a)};this.target.postMessage(o,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},z.K=G,z.L=function(){var r=new Et(16);return Et!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},z.M=function(r,t,i){var a,o,u,p,m,_,x,v,T,M,C,E,R=i[0],L=i[1],V=i[2];return t===r?(r[12]=t[0]*R+t[4]*L+t[8]*V+t[12],r[13]=t[1]*R+t[5]*L+t[9]*V+t[13],r[14]=t[2]*R+t[6]*L+t[10]*V+t[14],r[15]=t[3]*R+t[7]*L+t[11]*V+t[15]):(o=t[1],u=t[2],p=t[3],m=t[4],_=t[5],x=t[6],v=t[7],T=t[8],M=t[9],C=t[10],E=t[11],r[0]=a=t[0],r[1]=o,r[2]=u,r[3]=p,r[4]=m,r[5]=_,r[6]=x,r[7]=v,r[8]=T,r[9]=M,r[10]=C,r[11]=E,r[12]=a*R+m*L+T*V+t[12],r[13]=o*R+_*L+M*V+t[13],r[14]=u*R+x*L+C*V+t[14],r[15]=p*R+v*L+E*V+t[15]),r},z.N=function(r,t,i){var a=i[0],o=i[1],u=i[2];return r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r[3]=t[3]*a,r[4]=t[4]*o,r[5]=t[5]*o,r[6]=t[6]*o,r[7]=t[7]*o,r[8]=t[8]*u,r[9]=t[9]*u,r[10]=t[10]*u,r[11]=t[11]*u,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},z.O=function(r,t,i){var a=t[0],o=t[1],u=t[2],p=t[3],m=t[4],_=t[5],x=t[6],v=t[7],T=t[8],M=t[9],C=t[10],E=t[11],R=t[12],L=t[13],V=t[14],ie=t[15],q=i[0],Y=i[1],oe=i[2],de=i[3];return r[0]=q*a+Y*m+oe*T+de*R,r[1]=q*o+Y*_+oe*M+de*L,r[2]=q*u+Y*x+oe*C+de*V,r[3]=q*p+Y*v+oe*E+de*ie,r[4]=(q=i[4])*a+(Y=i[5])*m+(oe=i[6])*T+(de=i[7])*R,r[5]=q*o+Y*_+oe*M+de*L,r[6]=q*u+Y*x+oe*C+de*V,r[7]=q*p+Y*v+oe*E+de*ie,r[8]=(q=i[8])*a+(Y=i[9])*m+(oe=i[10])*T+(de=i[11])*R,r[9]=q*o+Y*_+oe*M+de*L,r[10]=q*u+Y*x+oe*C+de*V,r[11]=q*p+Y*v+oe*E+de*ie,r[12]=(q=i[12])*a+(Y=i[13])*m+(oe=i[14])*T+(de=i[15])*R,r[13]=q*o+Y*_+oe*M+de*L,r[14]=q*u+Y*x+oe*C+de*V,r[15]=q*p+Y*v+oe*E+de*ie,r},z.P=Ee,z.Q=function(r,t){const i={};for(let a=0;a<t.length;a++){const o=t[a];o in r&&(i[o]=r[o])}return i},z.R=Gi,z.S=Sa,z.T=Sh,z.U=cd,z.V=ld,z.W=Hi,z.X=Ar,z.Y=Ca,z.Z=_r,z._=c,z.a=k,z.a$=or,z.a0=function(r,t){var i,a,o,u,p;if(!r)return t!=null?t:{};if(!t)return r;let m=Object.assign({},r);if(t.removeAll&&(m={removeAll:!0}),t.remove){const _=new Set(t.remove);m.add&&(m.add=m.add.filter((v=>!_.has(v.id)))),m.update&&(m.update=m.update.filter((v=>!_.has(v.id))));const x=new Set(((i=r.add)!==null&&i!==void 0?i:[]).map((v=>v.id)));t.remove=t.remove.filter((v=>!x.has(v)))}if(t.remove){const _=new Set(m.remove?m.remove.concat(t.remove):t.remove);m.remove=Array.from(_.values())}if(t.add){const _=m.add?m.add.concat(t.add):t.add,x=new Map(_.map((v=>[v.id,v])));m.add=Array.from(x.values())}if(t.update){const _=new Map((a=m.update)===null||a===void 0?void 0:a.map((x=>[x.id,x])));for(const x of t.update){const v=(o=_.get(x.id))!==null&&o!==void 0?o:{id:x.id};x.newGeometry&&(v.newGeometry=x.newGeometry),x.addOrUpdateProperties&&(v.addOrUpdateProperties=((u=v.addOrUpdateProperties)!==null&&u!==void 0?u:[]).concat(x.addOrUpdateProperties)),x.removeProperties&&(v.removeProperties=((p=v.removeProperties)!==null&&p!==void 0?p:[]).concat(x.removeProperties)),x.removeAllProperties&&(v.removeAllProperties=!0),_.set(x.id,v)}m.update=Array.from(_.values())}return m.remove&&m.add&&(m.remove=m.remove.filter((_=>m.add.findIndex((x=>x.id===_))===-1))),m},z.a1=zl,z.a2=ps,z.a3=25,z.a4=Gh,z.a5=r=>{const t=window.document.createElement("video");return t.muted=!0,new Promise((i=>{t.onloadstart=()=>{i(t)};for(const a of r){const o=window.document.createElement("source");re(a)||(t.crossOrigin="Anonymous"),o.src=a,t.appendChild(o)}}))},z.a6=ve,z.a7=function(){return lr++},z.a8=S,z.a9=mo,z.aA=function(r){let t=1/0,i=1/0,a=-1/0,o=-1/0;for(const u of r)t=Math.min(t,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y);return[t,i,a,o]},z.aB=ri,z.aC=mn,z.aD=function(r,t,i,a,o=!1){if(!i[0]&&!i[1])return[0,0];const u=o?a==="map"?-r.bearingInRadians:0:a==="viewport"?r.bearingInRadians:0;if(u){const p=Math.sin(u),m=Math.cos(u);i=[i[0]*m-i[1]*p,i[0]*p+i[1]*m]}return[o?i[0]:mn(t,i[0],r.zoom),o?i[1]:mn(t,i[1],r.zoom)]},z.aF=Oh,z.aG=Wh,z.aH=Bh,z.aI=Hh,z.aJ=Lt,z.aK=Rc,z.aL=K,z.aM=at,z.aN=dt,z.aO=qn,z.aP=Ki,z.aQ=ud,z.aR=Mi,z.aS=Wr,z.aT=function(r){var t=new Et(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t},z.aU=function(r,t,i){return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],r},z.aV=function(r,t){var i=t[0],a=t[1],o=t[2],u=i*i+a*a+o*o;return u>0&&(u=1/Math.sqrt(u)),r[0]=t[0]*u,r[1]=t[1]*u,r[2]=t[2]*u,r},z.aW=sr,z.aX=function(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]},z.aY=function(r,t,i){return r[0]=t[0]*i[0],r[1]=t[1]*i[1],r[2]=t[2]*i[2],r[3]=t[3]*i[3],r},z.aZ=kr,z.a_=function(r,t,i){const a=t[0]*i[0]+t[1]*i[1]+t[2]*i[2];return a===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/a},z.aa=Ya,z.ab=hs,z.ac=md,z.ad=function(r){const t={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,a,o,u)=>{const p=o||u;return t[a]=!p||p.toLowerCase(),""})),t["max-age"]){const i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t},z.ae=Ia,z.af=function(r){return Math.pow(2,r)},z.ag=qr,z.ah=Ci,z.ai=85.051129,z.aj=hd,z.ak=function(r){return Math.log(r)/Math.LN2},z.al=function(r){var t=r[0],i=r[1];return t*t+i*i},z.am=function(r){if(!r.length)return new Set;const t=Math.max(...r.map((_=>_.canonical.z)));let i=1/0,a=-1/0,o=1/0,u=-1/0;const p=[];for(const _ of r){const{x,y:v,z:T}=_.canonical,M=Math.pow(2,t-T),C=x*M,E=v*M;p.push({id:_,x:C,y:E}),C<i&&(i=C),C>a&&(a=C),E<o&&(o=E),E>u&&(u=E)}const m=new Set;for(const _ of p)_.x!==i&&_.x!==a&&_.y!==o&&_.y!==u||m.add(_.id);return m},z.an=function(r,t){let i=0,a=0;if(r.kind==="constant")a=r.layoutSize;else if(r.kind!=="source"){const{interpolationType:o,minZoom:u,maxZoom:p}=r,m=o?Ci(Xt.interpolationFactor(o,t,u,p),0,1):0;r.kind==="camera"?a=Qi.number(r.minSize,r.maxSize,m):i=m}return{uSizeT:i,uSize:a}},z.ap=function(r,{uSize:t,uSizeT:i},{lowerSize:a,upperSize:o}){return r.kind==="source"?a/$n:r.kind==="composite"?Qi.number(a/$n,o/$n,i):t},z.aq=function(r,t){var i=t[0],a=t[1],o=t[2],u=t[3],p=t[4],m=t[5],_=t[6],x=t[7],v=t[8],T=t[9],M=t[10],C=t[11],E=t[12],R=t[13],L=t[14],V=t[15],ie=i*m-a*p,q=i*_-o*p,Y=i*x-u*p,oe=a*_-o*m,de=a*x-u*m,xe=o*x-u*_,ze=v*R-T*E,Pe=v*L-M*E,Ce=v*V-C*E,Oe=T*L-M*R,Se=T*V-C*R,Ie=M*V-C*L,me=ie*Ie-q*Se+Y*Oe+oe*Ce-de*Pe+xe*ze;return me?(r[0]=(m*Ie-_*Se+x*Oe)*(me=1/me),r[1]=(o*Se-a*Ie-u*Oe)*me,r[2]=(R*xe-L*de+V*oe)*me,r[3]=(M*de-T*xe-C*oe)*me,r[4]=(_*Ce-p*Ie-x*Pe)*me,r[5]=(i*Ie-o*Ce+u*Pe)*me,r[6]=(L*Y-E*xe-V*q)*me,r[7]=(v*xe-M*Y+C*q)*me,r[8]=(p*Se-m*Ce+x*ze)*me,r[9]=(a*Ce-i*Se-u*ze)*me,r[10]=(E*de-R*Y+V*ie)*me,r[11]=(T*Y-v*de-C*ie)*me,r[12]=(m*Pe-p*Oe-_*ze)*me,r[13]=(i*Oe-a*Pe+o*ze)*me,r[14]=(R*q-E*oe-L*ie)*me,r[15]=(v*oe-T*q+M*ie)*me,r):null},z.ar=fn,z.as=function(r){var t=r[0],i=r[1];return Math.sqrt(t*t+i*i)},z.at=function(r){return r[0]=0,r[1]=0,r},z.au=function(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r},z.av=jh,z.aw=Hr,z.ax=function(r,t,i,a){const o=t.y-r.y,u=t.x-r.x,p=a.y-i.y,m=a.x-i.x,_=p*u-m*o;if(_===0)return null;const x=(m*(r.y-i.y)-p*(r.x-i.x))/_;return new Ee(r.x+x*u,r.y+x*o)},z.ay=yd,z.az=lu,z.b=Fi,z.b$=class extends $i{constructor(r,t){super(r,t),this.current=new Array}set(r){if(r!=this.current){this.current=r;const t=new Float32Array(r);this.gl.uniform1fv(this.location,t)}}},z.b0=function(r,t,i){return r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r[3]=t[3]*i,r},z.b1=function(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]},z.b2=pd,z.b3=_o,z.b4=function(r,t,i,a,o){var u=1/Math.tan(t/2);if(r[0]=u/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,o!=null&&o!==1/0){var p=1/(a-o);r[10]=(o+a)*p,r[14]=2*o*a*p}else r[10]=-1,r[14]=-2*a;return r},z.b5=function(r){var t=new Et(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},z.b6=function(r,t,i){var a=Math.sin(i),o=Math.cos(i),u=t[0],p=t[1],m=t[2],_=t[3],x=t[4],v=t[5],T=t[6],M=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=u*o+x*a,r[1]=p*o+v*a,r[2]=m*o+T*a,r[3]=_*o+M*a,r[4]=x*o-u*a,r[5]=v*o-p*a,r[6]=T*o-m*a,r[7]=M*o-_*a,r},z.b7=function(r,t,i){var a=Math.sin(i),o=Math.cos(i),u=t[4],p=t[5],m=t[6],_=t[7],x=t[8],v=t[9],T=t[10],M=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=u*o+x*a,r[5]=p*o+v*a,r[6]=m*o+T*a,r[7]=_*o+M*a,r[8]=x*o-u*a,r[9]=v*o-p*a,r[10]=T*o-m*a,r[11]=M*o-_*a,r},z.b8=function(){const r=new Float32Array(16);return qr(r),r},z.b9=function(){const r=new Float64Array(16);return qr(r),r},z.bA=function(r,t){const i=_i(r,360),a=_i(t,360),o=a-i,u=a>i?o-360:o+360;return Math.abs(o)<Math.abs(u)?o:u},z.bB=function(r){return r[0]=0,r[1]=0,r[2]=0,r},z.bC=function(r,t,i,a){const o=Math.sqrt(r*r+t*t),u=Math.sqrt(i*i+a*a);r/=o,t/=o,i/=u,a/=u;const p=Math.acos(r*i+t*a);return-t*i+r*a>0?p:-p},z.bD=function(r,t){const i=_i(r,2*Math.PI),a=_i(t,2*Math.PI);return Math.min(Math.abs(i-a),Math.abs(i-a+2*Math.PI),Math.abs(i-a-2*Math.PI))},z.bE=function(){const r={},t=ne.$version;for(const i in ne.$root){const a=ne.$root[i];if(a.required){let o=null;o=i==="version"?t:a.type==="array"?[]:{},o!=null&&(r[i]=o)}}return r},z.bF=ga,z.bG=te,z.bH=function r(t,i){if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let a=0;a<t.length;a++)if(!r(t[a],i[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&i!==null){if(typeof i!="object"||Object.keys(t).length!==Object.keys(i).length)return!1;for(const a in t)if(!r(t[a],i[a]))return!1;return!0}return t===i},z.bI=function(r){r=r.slice();const t=Object.create(null);for(let i=0;i<r.length;i++)t[r[i].id]=r[i];for(let i=0;i<r.length;i++)"ref"in r[i]&&(r[i]=ct(r[i],t[r[i].ref]));return r},z.bJ=function(r,t){if(r.type==="custom")return new wf(r,t);switch(r.type){case"background":return new bf(r,t);case"circle":return new ap(r,t);case"color-relief":return new up(r,t);case"fill":return new Mp(r,t);case"fill-extrusion":return new Bp(r,t);case"heatmap":return new op(r,t);case"hillshade":return new cp(r,t);case"line":return new Zp(r,t);case"raster":return new _h(r,t);case"symbol":return new jc(r,t)}},z.bK=r=>r.type==="raster",z.bL=Li,z.bM=function(r,t){if(!r)return[{command:"setStyle",args:[t]}];let i=[];try{if(!Re(r.version,t.version))return[{command:"setStyle",args:[t]}];Re(r.center,t.center)||i.push({command:"setCenter",args:[t.center]}),Re(r.state,t.state)||i.push({command:"setGlobalState",args:[t.state]}),Re(r.centerAltitude,t.centerAltitude)||i.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Re(r.zoom,t.zoom)||i.push({command:"setZoom",args:[t.zoom]}),Re(r.bearing,t.bearing)||i.push({command:"setBearing",args:[t.bearing]}),Re(r.pitch,t.pitch)||i.push({command:"setPitch",args:[t.pitch]}),Re(r.roll,t.roll)||i.push({command:"setRoll",args:[t.roll]}),Re(r.sprite,t.sprite)||i.push({command:"setSprite",args:[t.sprite]}),Re(r.glyphs,t.glyphs)||i.push({command:"setGlyphs",args:[t.glyphs]}),Re(r.transition,t.transition)||i.push({command:"setTransition",args:[t.transition]}),Re(r.light,t.light)||i.push({command:"setLight",args:[t.light]}),Re(r.terrain,t.terrain)||i.push({command:"setTerrain",args:[t.terrain]}),Re(r.sky,t.sky)||i.push({command:"setSky",args:[t.sky]}),Re(r.projection,t.projection)||i.push({command:"setProjection",args:[t.projection]});const a={},o=[];(function(p,m,_,x){let v;for(v in m=m||{},p=p||{})Object.prototype.hasOwnProperty.call(p,v)&&(Object.prototype.hasOwnProperty.call(m,v)||qt(v,_,x));for(v in m)Object.prototype.hasOwnProperty.call(m,v)&&(Object.prototype.hasOwnProperty.call(p,v)?Re(p[v],m[v])||(p[v].type==="geojson"&&m[v].type==="geojson"&&li(p,m,v)?ot(_,{command:"setGeoJSONSourceData",args:[v,m[v].data]}):$t(v,m,_,x)):Gt(v,m,_))})(r.sources,t.sources,o,a);const u=[];r.layers&&r.layers.forEach((p=>{"source"in p&&a[p.source]?i.push({command:"removeLayer",args:[p.id]}):u.push(p)})),i=i.concat(o),(function(p,m,_){m=m||[];const x=(p=p||[]).map(Wt),v=m.map(Wt),T=p.reduce(ht,{}),M=m.reduce(ht,{}),C=x.slice(),E=Object.create(null);let R,L,V,ie,q;for(let Y=0,oe=0;Y<x.length;Y++)R=x[Y],Object.prototype.hasOwnProperty.call(M,R)?oe++:(ot(_,{command:"removeLayer",args:[R]}),C.splice(C.indexOf(R,oe),1));for(let Y=0,oe=0;Y<v.length;Y++)R=v[v.length-1-Y],C[C.length-1-Y]!==R&&(Object.prototype.hasOwnProperty.call(T,R)?(ot(_,{command:"removeLayer",args:[R]}),C.splice(C.lastIndexOf(R,C.length-oe),1)):oe++,ie=C[C.length-Y],ot(_,{command:"addLayer",args:[M[R],ie]}),C.splice(C.length-Y,0,R),E[R]=!0);for(let Y=0;Y<v.length;Y++)if(R=v[Y],L=T[R],V=M[R],!E[R]&&!Re(L,V))if(Re(L.source,V.source)&&Re(L["source-layer"],V["source-layer"])&&Re(L.type,V.type)){for(q in gt(L.layout,V.layout,_,R,null,"setLayoutProperty"),gt(L.paint,V.paint,_,R,null,"setPaintProperty"),Re(L.filter,V.filter)||ot(_,{command:"setFilter",args:[R,V.filter]}),Re(L.minzoom,V.minzoom)&&Re(L.maxzoom,V.maxzoom)||ot(_,{command:"setLayerZoomRange",args:[R,V.minzoom,V.maxzoom]}),L)Object.prototype.hasOwnProperty.call(L,q)&&q!=="layout"&&q!=="paint"&&q!=="filter"&&q!=="metadata"&&q!=="minzoom"&&q!=="maxzoom"&&(q.indexOf("paint.")===0?gt(L[q],V[q],_,R,q.slice(6),"setPaintProperty"):Re(L[q],V[q])||ot(_,{command:"setLayerProperty",args:[R,q,V[q]]}));for(q in V)Object.prototype.hasOwnProperty.call(V,q)&&!Object.prototype.hasOwnProperty.call(L,q)&&q!=="layout"&&q!=="paint"&&q!=="filter"&&q!=="metadata"&&q!=="minzoom"&&q!=="maxzoom"&&(q.indexOf("paint.")===0?gt(L[q],V[q],_,R,q.slice(6),"setPaintProperty"):Re(L[q],V[q])||ot(_,{command:"setLayerProperty",args:[R,q,V[q]]}))}else ot(_,{command:"removeLayer",args:[R]}),ie=C[C.lastIndexOf(R)+1],ot(_,{command:"addLayer",args:[V,ie]})})(u,t.layers,i)}catch(a){console.warn("Unable to compute style diff:",a),i=[{command:"setStyle",args:[t]}]}return i},z.bN=function(r){const t=[],i=r.id;return i===void 0&&t.push({message:"layers.".concat(i,': missing required property "id"')}),r.render===void 0&&t.push({message:"layers.".concat(i,': missing required method "render"')}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:"layers.".concat(i,': property "renderingMode" must be either "2d" or "3d"')}),t},z.bO=Wn,z.bP=Hn,z.bQ=class extends $i{constructor(r,t){super(r,t),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},z.bR=Zi,z.bS=class extends $i{constructor(r,t){super(r,t),this.current=ii}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let t=1;t<16;t++)if(r[t]!==this.current[t]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},z.bT=Yt,z.bU=class extends $i{constructor(r,t){super(r,t),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},z.bV=class extends $i{constructor(r,t){super(r,t),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},z.bW=mi,z.bX=function(r,t){var i=Math.sin(t),a=Math.cos(t);return r[0]=a,r[1]=i,r[2]=0,r[3]=-i,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},z.bY=function(r,t,i){var a=t[0],o=t[1],u=t[2];return r[0]=a*i[0]+o*i[3]+u*i[6],r[1]=a*i[1]+o*i[4]+u*i[7],r[2]=a*i[2]+o*i[5]+u*i[8],r},z.bZ=function(r,t,i,a,o,u,p){var m=1/(t-i),_=1/(a-o),x=1/(u-p);return r[0]=-2*m,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*_,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*x,r[11]=0,r[12]=(t+i)*m,r[13]=(o+a)*_,r[14]=(p+u)*x,r[15]=1,r},z.b_=class extends $i{constructor(r,t){super(r,t),this.current=new Array}set(r){if(r!=this.current){this.current=r;const t=new Float32Array(4*r.length);for(let i=0;i<r.length;i++)t[4*i]=r[i].r,t[4*i+1]=r[i].g,t[4*i+2]=r[i].b,t[4*i+3]=r[i].a;this.gl.uniform4fv(this.location,t)}}},z.ba=function(){return new Float64Array(16)},z.bb=function(r,t,i){const a=new Float64Array(4);return Ne(a,r,t-90,i),a},z.bc=function(r,t,i,a){var o,u,p,m,_,x=t[0],v=t[1],T=t[2],M=t[3],C=i[0],E=i[1],R=i[2],L=i[3];return(u=x*C+v*E+T*R+M*L)<0&&(u=-u,C=-C,E=-E,R=-R,L=-L),1-u>zt?(o=Math.acos(u),p=Math.sin(o),m=Math.sin((1-a)*o)/p,_=Math.sin(a*o)/p):(m=1-a,_=a),r[0]=m*x+_*C,r[1]=m*v+_*E,r[2]=m*T+_*R,r[3]=m*M+_*L,r},z.bd=function(r){const t=new Float64Array(9);var i,a,o,u,p,m,_,x,v,T,M,C,E,R,L,V,ie,q;T=(o=(a=r)[0])*(_=o+o),M=(u=a[1])*_,E=(p=a[2])*_,R=p*(x=u+u),V=(m=a[3])*_,ie=m*x,q=m*(v=p+p),(i=t)[0]=1-(C=u*x)-(L=p*v),i[3]=M-q,i[6]=E+ie,i[1]=M+q,i[4]=1-T-L,i[7]=R-V,i[2]=E-ie,i[5]=R+V,i[8]=1-T-C;const Y=Ki(-Math.asin(Ci(t[2],-1,1)));let oe,de;return Math.hypot(t[5],t[8])<.001?(oe=0,de=-Ki(Math.atan2(t[3],t[4]))):(oe=Ki(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),de=Ki(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:oe,pitch:Y+90,bearing:de}},z.be=function(r,t){return r.roll==t.roll&&r.pitch==t.pitch&&r.bearing==t.bearing},z.bf=Qe,z.bg=Ft,z.bh=ho,z.bi=Tl,z.bj=co,z.bk=_n,z.bl=br,z.bm=zi,z.bn=function(r,t,i,a,o){return _n(a,o,Ci((r-t)/(i-t),0,1))},z.bo=_i,z.bp=function(){return new Float64Array(3)},z.bq=function(r,t,i,a){return r[0]=t[0]+i[0]*a,r[1]=t[1]+i[1]*a,r[2]=t[2]+i[2]*a,r},z.br=Ne,z.bs=function(r,t,i){var a=i[0],o=i[1],u=i[2],p=i[3],m=t[0],_=t[1],x=t[2],v=o*x-u*_,T=u*m-a*x,M=a*_-o*m;return r[0]=m+p*(v+=v)+o*(M+=M)-u*(T+=T),r[1]=_+p*T+u*v-a*M,r[2]=x+p*M+a*T-o*v,r},z.bt=function(r,t,i){const a=(o=[r[0],r[1],r[2],t[0],t[1],t[2],i[0],i[1],i[2]])[0]*((v=o[8])*(p=o[4])-(m=o[5])*(x=o[7]))+o[1]*(-v*(u=o[3])+m*(_=o[6]))+o[2]*(x*u-p*_);var o,u,p,m,_,x,v;if(a===0)return null;const T=sr([],[t[0],t[1],t[2]],[i[0],i[1],i[2]]),M=sr([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),C=sr([],[r[0],r[1],r[2]],[t[0],t[1],t[2]]),E=Mi([],T,-r[3]);return Wr(E,E,Mi([],M,-t[3])),Wr(E,E,Mi([],C,-i[3])),Mi(E,E,1/a),E},z.bu=$h,z.bv=function(){return new Float64Array(4)},z.bw=function(r,t,i,a){var o=[],u=[];return o[0]=t[0]-i[0],o[1]=t[1]-i[1],o[2]=t[2]-i[2],u[0]=o[0]*Math.cos(a)-o[1]*Math.sin(a),u[1]=o[0]*Math.sin(a)+o[1]*Math.cos(a),u[2]=o[2],r[0]=u[0]+i[0],r[1]=u[1]+i[1],r[2]=u[2]+i[2],r},z.bx=function(r,t,i,a){var o=[],u=[];return o[0]=t[0]-i[0],o[1]=t[1]-i[1],o[2]=t[2]-i[2],u[0]=o[0],u[1]=o[1]*Math.cos(a)-o[2]*Math.sin(a),u[2]=o[1]*Math.sin(a)+o[2]*Math.cos(a),r[0]=u[0]+i[0],r[1]=u[1]+i[1],r[2]=u[2]+i[2],r},z.by=function(r,t,i,a){var o=[],u=[];return o[0]=t[0]-i[0],o[1]=t[1]-i[1],o[2]=t[2]-i[2],u[0]=o[2]*Math.sin(a)+o[0]*Math.cos(a),u[1]=o[1],u[2]=o[2]*Math.cos(a)-o[0]*Math.sin(a),r[0]=u[0]+i[0],r[1]=u[1]+i[1],r[2]=u[2]+i[2],r},z.bz=function(r,t,i){var a=Math.sin(i),o=Math.cos(i),u=t[0],p=t[1],m=t[2],_=t[3],x=t[8],v=t[9],T=t[10],M=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=u*o-x*a,r[1]=p*o-v*a,r[2]=m*o-T*a,r[3]=_*o-M*a,r[8]=u*a+x*o,r[9]=p*a+v*o,r[10]=m*a+T*o,r[11]=_*a+M*o,r},z.c=A,z.c0=class extends dl{},z.c1=Hp,z.c2=class extends e{},z.c3=Ph,z.c4=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},z.c5=yu,z.c6=function(r,t,i){var a=t[0],o=t[1],u=t[2],p=i[3]*a+i[7]*o+i[11]*u+i[15];return r[0]=(i[0]*a+i[4]*o+i[8]*u+i[12])/(p=p||1),r[1]=(i[1]*a+i[5]*o+i[9]*u+i[13])/p,r[2]=(i[2]*a+i[6]*o+i[10]*u+i[14])/p,r},z.c7=class extends io{},z.c8=class extends y{},z.c9=function(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]},z.cA=function(r,t){k.REGISTERED_PROTOCOLS[r]=t},z.cB=function(r){delete k.REGISTERED_PROTOCOLS[r]},z.cC=function(r,t){const i={};for(let o=0;o<r.length;o++){const u=t&&t[r[o].id]||Ws(r[o]);t&&(t[r[o].id]=u);let p=i[u];p||(p=i[u]=[]),p.push(r[o])}const a=[];for(const o in i)a.push(i[o]);return a},z.cD=Ae,z.cE=fd,z.cF=_d,z.cG=Wu,z.cH=function(r){r.bucket.createArrays(),r.bucket.tilePixelRatio=ft/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;const t=r.bucket.layers[0],i=t.layout,a=t._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new yt(r.bucket.zoom+1),r.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new yt(r.bucket.zoom+1),r.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new yt(18))};if(r.bucket.textSizeData.kind==="composite"){const{minZoom:x,maxZoom:v}=r.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new yt(x),r.canonical),a["text-size"].possiblyEvaluate(new yt(v),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){const{minZoom:x,maxZoom:v}=r.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new yt(x),r.canonical),a["icon-size"].possiblyEvaluate(new yt(v),r.canonical)]}const u=i.get("text-line-height")*ri,p=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",m=i.get("text-keep-upright"),_=i.get("text-size");for(const x of r.bucket.features){const v=i.get("text-font").evaluate(x,{},r.canonical).join(","),T=_.evaluate(x,{},r.canonical),M=o.layoutTextSize.evaluate(x,{},r.canonical),C=o.layoutIconSize.evaluate(x,{},r.canonical),E={horizontal:{},vertical:void 0},R=x.text;let L,V=[0,0];if(R){const Y=R.toString(),oe=i.get("text-letter-spacing").evaluate(x,{},r.canonical)*ri,de=_c(Y)?oe:0,xe=i.get("text-anchor").evaluate(x,{},r.canonical),ze=Cd(t,x,r.canonical);if(!ze){const Se=i.get("text-radial-offset").evaluate(x,{},r.canonical);V=Se?Md(xe,[Se*ri,qh]):i.get("text-offset").evaluate(x,{},r.canonical).map((Ie=>Ie*ri))}let Pe=p?"center":i.get("text-justify").evaluate(x,{},r.canonical);const Ce=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(x,{},r.canonical)*ri:1/0,Oe=()=>{r.bucket.allowVerticalPlacement&&Ys(Y)&&(E.vertical=Fc(R,r.glyphMap,r.glyphPositions,r.imagePositions,v,Ce,u,xe,"left",de,V,z.ao.vertical,!0,M,T))};if(!p&&ze){const Se=new Set;if(Pe==="auto")for(let me=0;me<ze.values.length;me+=2)Se.add(Wh(ze.values[me]));else Se.add(Pe);let Ie=!1;for(const me of Se)if(!E.horizontal[me])if(Ie)E.horizontal[me]=E.horizontal[0];else{const $e=Fc(R,r.glyphMap,r.glyphPositions,r.imagePositions,v,Ce,u,"center",me,de,V,z.ao.horizontal,!1,M,T);$e&&(E.horizontal[me]=$e,Ie=$e.positionedLines.length===1)}Oe()}else{Pe==="auto"&&(Pe=Wh(xe));const Se=Fc(R,r.glyphMap,r.glyphPositions,r.imagePositions,v,Ce,u,xe,Pe,de,V,z.ao.horizontal,!1,M,T);Se&&(E.horizontal[Pe]=Se),Oe(),Ys(Y)&&p&&m&&(E.vertical=Fc(R,r.glyphMap,r.glyphPositions,r.imagePositions,v,Ce,u,xe,Pe,de,V,z.ao.vertical,!1,M,T))}}let ie=!1;if(x.icon&&x.icon.name){const Y=r.imageMap[x.icon.name];Y&&(L=gf(r.imagePositions[x.icon.name],i.get("icon-offset").evaluate(x,{},r.canonical),i.get("icon-anchor").evaluate(x,{},r.canonical)),ie=!!Y.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=ie:r.bucket.sdfIcons!==ie&&Ot("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Y.pixelRatio!==r.bucket.pixelRatio||i.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}const q=zd(E.horizontal)||E.vertical;r.bucket.iconsInText=!!q&&q.iconsInText,(q||L)&&Af(r.bucket,x,E,L,r.imageMap,o,M,C,V,ie,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},z.cI=zh,z.cJ=Ah,z.cK=kh,z.cL=Du,z.cM=Rh,z.cN=class{constructor(r){this._marks={start:[r.url,"start"].join("#"),end:[r.url,"end"].join("#"),measure:r.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let r=performance.getEntriesByName(this._marks.measure);return r.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),r=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),r}},z.cO=function(r,t,i,a,o){return c(this,void 0,void 0,(function*(){if(Ar())try{return yield Ca(r,t,i,a,o)}catch(u){}return(function(u,p,m,_,x){const v=u.width,T=u.height;Yr&&Tr||(Yr=new OffscreenCanvas(v,T),Tr=Yr.getContext("2d",{willReadFrequently:!0})),Yr.width=v,Yr.height=T,Tr.drawImage(u,0,0,v,T);const M=Tr.getImageData(p,m,_,x);return Tr.clearRect(0,0,v,T),M.data})(r,t,i,a,o)}))},z.cP=bu,z.cQ=Bt,z.cR=ku,z.cS=uo,z.cT=Os,z.cU=function(r,t){const i=new Map;if(r!=null)if(r.type==="Feature")i.set(El(r,t),r);else for(const a of r.features)i.set(El(a,t),a);return i},z.cV=function(r,t){if(r==null)return!0;if(r.type==="Feature")return El(r,t)!=null;if(r.type==="FeatureCollection"){const i=new Set;for(const a of r.features){const o=El(a,t);if(o==null||i.has(o))return!1;i.add(o)}return!0}return!1},z.cW=function(r,t,i){var a,o,u,p;if(t.removeAll&&r.clear(),t.remove)for(const m of t.remove)r.delete(m);if(t.add)for(const m of t.add){const _=El(m,i);_!=null&&r.set(_,m)}if(t.update)for(const m of t.update){let _=r.get(m.id);if(_==null)continue;const x=!m.removeAllProperties&&(((a=m.removeProperties)===null||a===void 0?void 0:a.length)>0||((o=m.addOrUpdateProperties)===null||o===void 0?void 0:o.length)>0);if((m.newGeometry||m.removeAllProperties||x)&&(_=Object.assign({},_),r.set(m.id,_),x&&(_.properties=Object.assign({},_.properties))),m.newGeometry&&(_.geometry=m.newGeometry),m.removeAllProperties)_.properties={};else if(((u=m.removeProperties)===null||u===void 0?void 0:u.length)>0)for(const v of m.removeProperties)Object.prototype.hasOwnProperty.call(_.properties,v)&&delete _.properties[v];if(((p=m.addOrUpdateProperties)===null||p===void 0?void 0:p.length)>0)for(const{key:v,value:T}of m.addOrUpdateProperties)_.properties[v]=T}},z.cX=tn,z.ca=function(r,t){var i=r[0],a=r[1],o=r[2],u=r[3],p=r[4],m=r[5],_=r[6],x=r[7],v=r[8],T=r[9],M=r[10],C=r[11],E=r[12],R=r[13],L=r[14],V=r[15],ie=t[0],q=t[1],Y=t[2],oe=t[3],de=t[4],xe=t[5],ze=t[6],Pe=t[7],Ce=t[8],Oe=t[9],Se=t[10],Ie=t[11],me=t[12],$e=t[13],Ge=t[14],je=t[15];return Math.abs(i-ie)<=zt*Math.max(1,Math.abs(i),Math.abs(ie))&&Math.abs(a-q)<=zt*Math.max(1,Math.abs(a),Math.abs(q))&&Math.abs(o-Y)<=zt*Math.max(1,Math.abs(o),Math.abs(Y))&&Math.abs(u-oe)<=zt*Math.max(1,Math.abs(u),Math.abs(oe))&&Math.abs(p-de)<=zt*Math.max(1,Math.abs(p),Math.abs(de))&&Math.abs(m-xe)<=zt*Math.max(1,Math.abs(m),Math.abs(xe))&&Math.abs(_-ze)<=zt*Math.max(1,Math.abs(_),Math.abs(ze))&&Math.abs(x-Pe)<=zt*Math.max(1,Math.abs(x),Math.abs(Pe))&&Math.abs(v-Ce)<=zt*Math.max(1,Math.abs(v),Math.abs(Ce))&&Math.abs(T-Oe)<=zt*Math.max(1,Math.abs(T),Math.abs(Oe))&&Math.abs(M-Se)<=zt*Math.max(1,Math.abs(M),Math.abs(Se))&&Math.abs(C-Ie)<=zt*Math.max(1,Math.abs(C),Math.abs(Ie))&&Math.abs(E-me)<=zt*Math.max(1,Math.abs(E),Math.abs(me))&&Math.abs(R-$e)<=zt*Math.max(1,Math.abs(R),Math.abs($e))&&Math.abs(L-Ge)<=zt*Math.max(1,Math.abs(L),Math.abs(Ge))&&Math.abs(V-je)<=zt*Math.max(1,Math.abs(V),Math.abs(je))},z.cb=function(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},z.cc=r=>r.type==="symbol",z.cd=r=>r.type==="circle",z.ce=r=>r.type==="heatmap",z.cf=r=>r.type==="line",z.cg=r=>r.type==="fill",z.ch=r=>r.type==="fill-extrusion",z.ci=r=>r.type==="hillshade",z.cj=r=>r.type==="color-relief",z.ck=r=>r.type==="background",z.cl=r=>r.type==="custom",z.cm=Xr,z.cn=function(r,t,i){const a=gs(t.x-i.x,t.y-i.y),o=gs(r.x-i.x,r.y-i.y);var u,p;return Ki(Math.atan2(a[0]*o[1]-a[1]*o[0],(u=a)[0]*(p=o)[0]+u[1]*p[1]))},z.co=gn,z.cp=function(r,t){return Ji[t]&&(r instanceof MouseEvent||r instanceof WheelEvent)},z.cq=function(r,t){return Kr[t]&&"touches"in r},z.cr=function(r){return Kr[r]||Ji[r]},z.cs=function(r,t,i){var a=t[0],o=t[1];return r[0]=i[0]*a+i[4]*o+i[12],r[1]=i[1]*a+i[5]*o+i[13],r},z.ct=function(r,t){const{x:i,y:a}=zl.fromLngLat(t);return!(r<0||r>25||a<0||a>=1||i<0||i>=1)},z.cu=function(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},z.cv=class extends ba{},z.cw=Df,z.cy=function(r){return r.message===Q},z.cz=X,z.d=re,z.e=Yi,z.f=r=>c(void 0,void 0,void 0,(function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(t)}catch(i){throw new Error("Could not load image because of ".concat(i.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}})),z.g=F,z.h=r=>new Promise(((t,i)=>{const a=new Image;a.onload=()=>{t(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame((()=>{a.src=Xn}))},a.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const o=new Blob([new Uint8Array(r)],{type:"image/png"});a.src=r.byteLength?URL.createObjectURL(o):Xn})),z.i=wr,z.j=(r,t)=>ae(Yi(r,{type:"json"}),t),z.k=De,z.l=_e,z.m=ae,z.n=(r,t)=>ae(Yi(r,{type:"arrayBuffer"}),t),z.o=function(r){return new Rh(r).readFields(sf,[])},z.p=qu,z.q=yl,z.r=Ti,z.s=vn,z.t=sl,z.u=tt,z.v=ne,z.w=Ot,z.x=ph,z.y=fc,z.z=en})),Be("worker",["./shared"],(function(z){class c{constructor(A,k){this.keyCache={},A&&this.replace(A,k)}replace(A,k){this._layerConfigs={},this._layers={},this.update(A,[],k)}update(A,k,F){for(const X of A){this._layerConfigs[X.id]=X;const te=this._layers[X.id]=z.bJ(X,F);te._featureFilter=z.aa(te.filter,F),this.keyCache[X.id]&&delete this.keyCache[X.id]}for(const X of k)delete this.keyCache[X],delete this._layerConfigs[X],delete this._layers[X];this.familiesBySource={};const G=z.cC(Object.values(this._layerConfigs),this.keyCache);for(const X of G){const te=X.map((De=>this._layers[De.id])),ae=te[0];if(ae.visibility==="none")continue;const re=ae.source||"";let fe=this.familiesBySource[re];fe||(fe=this.familiesBySource[re]={});const be=ae.sourceLayer||"_geojsonTileLayer";let _e=fe[be];_e||(_e=fe[be]=[]),_e.push(te)}}}class Ee{constructor(A){const k={},F=[];for(const ae in A){const re=A[ae],fe=k[ae]={};for(const be in re){const _e=re[+be];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;const De={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};F.push(De),fe[be]={rect:De,metrics:_e.metrics}}}const{w:G,h:X}=z.p(F),te=new z.q({width:G||1,height:X||1});for(const ae in A){const re=A[ae];for(const fe in re){const be=re[+fe];if(!be||be.bitmap.width===0||be.bitmap.height===0)continue;const _e=k[ae][fe].rect;z.q.copy(be.bitmap,te,{x:0,y:0},{x:_e.x+1,y:_e.y+1},be.bitmap)}}this.image=te,this.positions=k}}z.cD("GlyphAtlas",Ee);class Bt{constructor(A){this.tileID=new z.Z(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[]}parse(A,k,F,G,X){return z._(this,void 0,void 0,(function*(){this.status="parsing",this.data=A,this.collisionBoxArray=new z.a8;
5const te=new z.cE(Object.keys(A.layers).sort()),ae=new z.cF(this.tileID,this.promoteId);ae.bucketLayerIDs=[];const re={},fe={featureIndex:ae,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:F,subdivisionGranularity:X},be=k.familiesBySource[this.source];for(const ht in be){const ve=A.layers[ht];if(!ve)continue;ve.version===1&&z.w('Vector tile source "'.concat(this.source,'" layer "').concat(ht,'" does not use vector tile spec v2 and therefore may have some rendering errors.'));const Pr=te.encode(ht),Bi=[];for(let Oi=0;Oi<ve.length;Oi++){const Ht=ve.feature(Oi),Me=ae.getId(Ht,ht);Bi.push({feature:Ht,id:Me,index:Oi,sourceLayerIndex:Pr})}for(const Oi of be[ht]){const Ht=Oi[0];Ht.source!==this.source&&z.w("layer.source = ".concat(Ht.source," does not equal this.source = ").concat(this.source)),Ht.minzoom&&this.zoom<Math.floor(Ht.minzoom)||Ht.maxzoom&&this.zoom>=Ht.maxzoom||Ht.visibility!=="none"&&(wt(Oi,this.zoom,F),(re[Ht.id]=Ht.createBucket({index:ae.bucketLayerIDs.length,layers:Oi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Pr,sourceID:this.source})).populate(Bi,fe,this.tileID.canonical),ae.bucketLayerIDs.push(Oi.map((Me=>Me.id))))}}const _e=z.bO(fe.glyphDependencies,(ht=>Object.keys(ht).map(Number)));this.inFlightDependencies.forEach((ht=>ht==null?void 0:ht.abort())),this.inFlightDependencies=[];let De=Promise.resolve({});if(Object.keys(_e).length){const ht=new AbortController;this.inFlightDependencies.push(ht),De=G.sendAsync({type:"GG",data:{stacks:_e,source:this.source,tileID:this.tileID,type:"glyphs"}},ht)}const Ve=Object.keys(fe.iconDependencies);let ne=Promise.resolve({});if(Ve.length){const ht=new AbortController;this.inFlightDependencies.push(ht),ne=G.sendAsync({type:"GI",data:{icons:Ve,source:this.source,tileID:this.tileID,type:"icons"}},ht)}const st=Object.keys(fe.patternDependencies);let ct=Promise.resolve({});if(st.length){const ht=new AbortController;this.inFlightDependencies.push(ht),ct=G.sendAsync({type:"GI",data:{icons:st,source:this.source,tileID:this.tileID,type:"patterns"}},ht)}const Re=fe.dashDependencies;let ot=Promise.resolve({});if(Object.keys(Re).length){const ht=new AbortController;this.inFlightDependencies.push(ht),ot=G.sendAsync({type:"GDA",data:{dashes:Re}},ht)}const[Gt,qt,$t,li]=yield Promise.all([De,ne,ct,ot]),gt=new Ee(Gt),Wt=new z.cG(qt,$t);for(const ht in re){const ve=re[ht];ve instanceof z.a9?(wt(ve.layers,this.zoom,F),z.cH({bucket:ve,glyphMap:Gt,glyphPositions:gt.positions,imageMap:qt,imagePositions:Wt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:fe.subdivisionGranularity})):ve.hasDependencies&&(ve instanceof z.cI||ve instanceof z.cJ||ve instanceof z.cK)&&(wt(ve.layers,this.zoom,F),ve.addFeatures(fe,this.tileID.canonical,Wt.patternPositions,li))}return this.status="done",{buckets:Object.values(re).filter((ht=>!ht.isEmpty())),featureIndex:ae,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:gt.image,imageAtlas:Wt,dashPositions:li,glyphMap:this.returnDependencies?Gt:null,iconMap:this.returnDependencies?qt:null,glyphPositions:this.returnDependencies?gt.positions:null}}))}}function wt(Q,A,k){const F=new z.F(A);for(const G of Q)G.recalculate(F,k)}class Tt{constructor(A,k,F){this.actor=A,this.layerIndex=k,this.availableImages=F,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(A,k){return z._(this,void 0,void 0,(function*(){const F=yield z.n(A.request,k);try{return{vectorTile:new z.cL(new z.cM(F.data)),rawData:F.data,cacheControl:F.cacheControl,expires:F.expires}}catch(G){const X=new Uint8Array(F.data);let te="Unable to parse the tile at ".concat(A.request.url,", ");throw te+=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: ".concat(G.message),new Error(te)}}))}loadTile(A){return z._(this,void 0,void 0,(function*(){const k=A.uid,F=!!(A&&A.request&&A.request.collectResourceTiming)&&new z.cN(A.request),G=new Bt(A);this.loading[k]=G;const X=new AbortController;G.abort=X;try{const te=yield this.loadVectorTile(A,X);if(delete this.loading[k],!te)return null;const ae=te.rawData,re={};te.expires&&(re.expires=te.expires),te.cacheControl&&(re.cacheControl=te.cacheControl);const fe={};if(F){const _e=F.finish();_e&&(fe.resourceTiming=JSON.parse(JSON.stringify(_e)))}G.vectorTile=te.vectorTile;const be=G.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor,A.subdivisionGranularity);this.loaded[k]=G,this.fetching[k]={rawTileData:ae,cacheControl:re,resourceTiming:fe};try{const _e=yield be;return z.e({rawTileData:ae.slice(0)},_e,re,fe)}finally{delete this.fetching[k]}}catch(te){throw delete this.loading[k],G.status="done",this.loaded[k]=G,te}}))}reloadTile(A){return z._(this,void 0,void 0,(function*(){const k=A.uid;if(!this.loaded||!this.loaded[k])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const F=this.loaded[k];if(F.showCollisionBoxes=A.showCollisionBoxes,F.status==="parsing"){const G=yield F.parse(F.vectorTile,this.layerIndex,this.availableImages,this.actor,A.subdivisionGranularity);let X;if(this.fetching[k]){const{rawTileData:te,cacheControl:ae,resourceTiming:re}=this.fetching[k];delete this.fetching[k],X=z.e({rawTileData:te.slice(0)},G,ae,re)}else X=G;return X}if(F.status==="done"&&F.vectorTile)return F.parse(F.vectorTile,this.layerIndex,this.availableImages,this.actor,A.subdivisionGranularity)}))}abortTile(A){return z._(this,void 0,void 0,(function*(){const k=this.loading,F=A.uid;k&&k[F]&&k[F].abort&&(k[F].abort.abort(),delete k[F])}
vendor: 22,713 bytes, line 5
5))}removeTile(A){return z._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[A.uid]&&delete this.loaded[A.uid]}))}}class Ze{constructor(){this.loaded={}}loadTile(A){return z._(this,void 0,void 0,(function*(){const{uid:k,encoding:F,rawImageData:G,redFactor:X,greenFactor:te,blueFactor:ae,baseShift:re}=A,fe=G.width+2,be=G.height+2,_e=z.b(G)?new z.R({width:fe,height:be},yield z.cO(G,-1,-1,fe,be)):G,De=new z.cP(k,_e,F,X,te,ae,re);return this.loaded=this.loaded||{},this.loaded[k]=De,De}))}removeTile(A){const k=this.loaded,F=A.uid;k&&k[F]&&delete k[F]}}var ue,ar,Di=(function(){if(ar)return ue;function Q(k,F){if(k.length!==0){A(k[0],F);for(var G=1;G<k.length;G++)A(k[G],!F)}}function A(k,F){for(var G=0,X=0,te=0,ae=k.length,re=ae-1;te<ae;re=te++){var fe=(k[te][0]-k[re][0])*(k[re][1]+k[te][1]),be=G+fe;X+=Math.abs(G)>=Math.abs(fe)?G-be+fe:fe-be+G,G=be}G+X>=0!=!!F&&k.reverse()}return ar=1,ue=function k(F,G){var X,te=F&&F.type;if(te==="FeatureCollection")for(X=0;X<F.features.length;X++)k(F.features[X],G);else if(te==="GeometryCollection")for(X=0;X<F.geometries.length;X++)k(F.geometries[X],G);else if(te==="Feature")k(F.geometry,G);else if(te==="Polygon")Q(F.coordinates,G);else if(te==="MultiPolygon")for(X=0;X<F.coordinates.length;X++)Q(F.coordinates[X],G);return F}})(),Hi=z.cQ(Di);class Ar extends z.cS{constructor(A,k){super(new z.cM,0,k,[],[]),this.feature=A,this.type=A.type,this.properties=A.tags?A.tags:{},"id"in A&&(typeof A.id=="string"?this.id=parseInt(A.id,10):typeof A.id!="number"||isNaN(A.id)||(this.id=A.id))}loadGeometry(){const A=[],k=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(const F of k){const G=[];for(const X of F)G.push(new z.P(X[0],X[1]));A.push(G)}return A}}class zt extends z.cR{constructor(A,k){super(new z.cM),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.version=k?k.version:1,this.extent=k?k.extent:4096,this.length=A.length,this.features=A}feature(A){return new Ar(this.features[A],this.extent)}}function Et(Q,A){A.writeVarintField(15,Q.version||1),A.writeStringField(1,Q.name||""),A.writeVarintField(5,Q.extent||4096);const k={keys:[],values:[],keycache:{},valuecache:{}};for(let X=0;X<Q.length;X++)k.feature=Q.feature(X),A.writeMessage(2,mi,k);const F=k.keys;for(const X of F)A.writeStringField(3,X);const G=k.values;for(const X of G)A.writeMessage(4,Wr,X)}function mi(Q,A){if(!Q.feature)return;const k=Q.feature;k.id!==void 0&&A.writeVarintField(1,k.id),A.writeMessage(2,qr,Q),A.writeVarintField(3,k.type),A.writeMessage(4,pn,k)}function qr(Q,A){var k;for(const F in(k=Q.feature)==null?void 0:k.properties){let G=Q.feature.properties[F],X=Q.keycache[F];if(G===null)continue;X===void 0&&(Q.keys.push(F),X=Q.keys.length-1,Q.keycache[F]=X),A.writeVarint(X),typeof G!="string"&&typeof G!="boolean"&&typeof G!="number"&&(G=JSON.stringify(G));const te=typeof G+":"+G;let ae=Q.valuecache[te];ae===void 0&&(Q.values.push(G),ae=Q.values.length-1,Q.valuecache[te]=ae),A.writeVarint(ae)}}function Xi(Q,A){return(A<<3)+(7&Q)}function kr(Q){return Q<<1^Q>>31}function pn(Q,A){const k=Q.loadGeometry(),F=Q.type;let G=0,X=0;for(const te of k){let ae=1;F===1&&(ae=te.length),A.writeVarint(Xi(1,ae));const re=F===3?te.length-1:te.length;for(let fe=0;fe<re;fe++){fe===1&&F!==1&&A.writeVarint(Xi(2,re-1));const be=te[fe].x-G,_e=te[fe].y-X;A.writeVarint(kr(be)),A.writeVarint(kr(_e)),G+=be,X+=_e}Q.type===3&&A.writeVarint(Xi(7,1))}}function Wr(Q,A){const k=typeof Q;k==="string"?A.writeStringField(1,Q):k==="boolean"?A.writeBooleanField(7,Q):k==="number"&&(Q%1!=0?A.writeDoubleField(3,Q):Q<0?A.writeSVarintField(6,Q):A.writeVarintField(5,Q))}const Mi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Q=>Q},sr=Math.fround||(Ri=new Float32Array(1),Q=>(Ri[0]=+Q,Ri[0]));var Ri;class or{constructor(A){this.options=Object.assign(Object.create(Mi),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:k,minZoom:F,maxZoom:G}=this.options;k&&console.time("total time");const X="prepare ".concat(A.length," points");k&&console.time(X),this.points=A;const te=[];for(let re=0;re<A.length;re++){const fe=A[re];if(!fe.geometry)continue;const[be,_e]=fe.geometry.coordinates,De=sr(Ne(be)),Ve=sr(fn(_e));te.push(De,Ve,1/0,re,-1,1),this.options.reduce&&te.push(0)}let ae=this.trees[G+1]=this._createTree(te);k&&console.timeEnd(X);for(let re=G;re>=F;re--){const fe=+Date.now();ae=this.trees[re]=this._createTree(this._cluster(ae,re)),k&&console.log("z%d: %d clusters in %dms",re,ae.numItems,+Date.now()-fe)}return k&&console.timeEnd("total time"),this}getClusters(A,k){let F=((A[0]+180)%360+360)%360-180;const G=Math.max(-90,Math.min(90,A[1]));let X=A[2]===180?180:((A[2]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)F=-180,X=180;else if(F>X){const _e=this.getClusters([F,G,180,te],k),De=this.getClusters([-180,G,X,te],k);return _e.concat(De)}const ae=this.trees[this._limitZoom(k)],re=ae.range(Ne(F),fn(te),Ne(X),fn(G)),fe=ae.data,be=[];for(const _e of re){const De=this.stride*_e;be.push(fe[De+5]>1?Hr(fe,De,this.clusterProps):this.points[fe[De+3]])}return be}getChildren(A){const k=this._getOriginId(A),F=this._getOriginZoom(A),G="No cluster with the specified id.",X=this.trees[F];if(!X)throw new Error(G);const te=X.data;if(k*this.stride>=te.length)throw new Error(G);const ae=this.options.radius/(this.options.extent*Math.pow(2,F-1)),re=X.within(te[k*this.stride],te[k*this.stride+1],ae),fe=[];for(const be of re){const _e=be*this.stride;te[_e+4]===A&&fe.push(te[_e+5]>1?Hr(te,_e,this.clusterProps):this.points[te[_e+3]])}if(fe.length===0)throw new Error(G);return fe}getLeaves(A,k,F){const G=[];return this._appendLeaves(G,A,k=k||10,F=F||0,0),G}getTile(A,k,F){const G=this.trees[this._limitZoom(A)],X=Math.pow(2,A),{extent:te,radius:ae}=this.options,re=ae/te,fe=(F-re)/X,be=(F+1+re)/X,_e={features:[]};return this._addTileFeatures(G.range((k-re)/X,fe,(k+1+re)/X,be),G.data,k,F,X,_e),k===0&&this._addTileFeatures(G.range(1-re/X,fe,1,be),G.data,X,F,X,_e),k===X-1&&this._addTileFeatures(G.range(0,fe,re/X,be),G.data,-1,F,X,_e),_e.features.length?_e:null}getClusterExpansionZoom(A){let k=this._getOriginZoom(A)-1;for(;k<=this.options.maxZoom;){const F=this.getChildren(A);if(k++,F.length!==1)break;A=F[0].properties.cluster_id}return k}_appendLeaves(A,k,F,G,X){const te=this.getChildren(k);for(const ae of te){const re=ae.properties;if(re&&re.cluster?X+re.point_count<=G?X+=re.point_count:X=this._appendLeaves(A,re.cluster_id,F,G,X):X<G?X++:A.push(ae),A.length===F)break}return X}_createTree(A){const k=new z.aI(A.length/this.stride|0,this.options.nodeSize,Float32Array);for(let F=0;F<A.length;F+=this.stride)k.add(A[F],A[F+1]);return k.finish(),k.data=A,k}_addTileFeatures(A,k,F,G,X,te){for(const ae of A){const re=ae*this.stride,fe=k[re+5]>1;let be,_e,De;if(fe)be=vr(k,re,this.clusterProps),_e=k[re],De=k[re+1];else{const st=this.points[k[re+3]];be=st.properties;const[ct,Re]=st.geometry.coordinates;_e=Ne(ct),De=fn(Re)}const Ve={type:1,geometry:[[Math.round(this.options.extent*(_e*X-F)),Math.round(this.options.extent*(De*X-G))]],tags:be};let ne;ne=fe||this.options.generateId?k[re+3]:this.points[k[re+3]].id,ne!==void 0&&(Ve.id=ne),te.features.push(Ve)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,k){const{radius:F,extent:G,reduce:X,minPoints:te}=this.options,ae=F/(G*Math.pow(2,k)),re=A.data,fe=[],be=this.stride;for(let _e=0;_e<re.length;_e+=be){if(re[_e+2]<=k)continue;re[_e+2]=k;const De=re[_e],Ve=re[_e+1],ne=A.within(re[_e],re[_e+1],ae),st=re[_e+5];let ct=st;for(const Re of ne){const ot=Re*be;re[ot+2]>k&&(ct+=re[ot+5])}if(ct>st&&ct>=te){let Re,ot=De*st,Gt=Ve*st,qt=-1;const $t=(_e/be<<5)+(k+1)+this.points.length;for(const li of ne){const gt=li*be;if(re[gt+2]<=k)continue;re[gt+2]=k;const Wt=re[gt+5];ot+=re[gt]*Wt,Gt+=re[gt+1]*Wt,re[gt+4]=$t,X&&(Re||(Re=this._map(re,_e,!0),qt=this.clusterProps.length,this.clusterProps.push(Re)),X(Re,this._map(re,gt)))}re[_e+4]=$t,fe.push(ot/ct,Gt/ct,1/0,$t,-1,ct),X&&fe.push(qt)}else{for(let Re=0;Re<be;Re++)fe.push(re[_e+Re]);if(ct>1)for(const Re of ne){const ot=Re*be;if(!(re[ot+2]<=k)){re[ot+2]=k;for(let Gt=0;Gt<be;Gt++)fe.push(re[ot+Gt])}}}}return fe}_getOriginId(A){return A-this.points.length>>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,k,F){if(A[k+5]>1){const te=this.clusterProps[A[k+6]];return F?Object.assign({},te):te}const G=this.points[A[k+3]].properties,X=this.options.map(G);return F&&X===G?Object.assign({},X):X}}function Hr(Q,A,k){return{type:"Feature",id:Q[A+3],properties:vr(Q,A,k),geometry:{type:"Point",coordinates:[(F=Q[A],360*(F-.5)),gs(Q[A+1])]}};var F}function vr(Q,A,k){const F=Q[A+5],G=F>=1e4?"".concat(Math.round(F/1e3),"k"):F>=1e3?Math.round(F/100)/10+"k":F,X=Q[A+6],te=X===-1?{}:Object.assign({},k[X]);return Object.assign(te,{cluster:!0,cluster_id:Q[A+3],point_count:F,point_count_abbreviated:G})}function Ne(Q){return Q/360+.5}function fn(Q){const A=Math.sin(Q*Math.PI/180),k=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return k<0?0:k>1?1:k}function gs(Q){const A=(180-360*Q)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function ft(Q,A,k,F){let G=F;const X=A+(k-A>>1);let te,ae=k-A;const re=Q[A],fe=Q[A+1],be=Q[k],_e=Q[k+1];for(let De=A+3;De<k;De+=3){const Ve=mn(Q[De],Q[De+1],re,fe,be,_e);if(Ve>G)te=De,G=Ve;else if(Ve===G){const ne=Math.abs(De-X);ne<ae&&(te=De,ae=ne)}}G>F&&(te-A>3&&ft(Q,A,te,F),Q[te+2]=G,k-te>3&&ft(Q,te,k,F))}function mn(Q,A,k,F,G,X){let te=G-k,ae=X-F;if(te!==0||ae!==0){const re=((Q-k)*te+(A-F)*ae)/(te*te+ae*ae);re>1?(k=G,F=X):re>0&&(k+=te*re,F+=ae*re)}return te=Q-k,ae=A-F,te*te+ae*ae}function _i(Q,A,k,F){const G={id:Q==null?null:Q,type:A,geometry:k,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(A==="Point"||A==="MultiPoint"||A==="LineString")_n(G,k);else if(A==="Polygon")_n(G,k[0]);else if(A==="MultiLineString")for(const X of k)_n(G,X);else if(A==="MultiPolygon")for(const X of k)_n(G,X[0]);return G}function _n(Q,A){for(let k=0;k<A.length;k+=3)Q.minX=Math.min(Q.minX,A[k]),Q.minY=Math.min(Q.minY,A[k+1]),Q.maxX=Math.max(Q.maxX,A[k]),Q.maxY=Math.max(Q.maxY,A[k+1])}function br(Q,A,k,F){if(!A.geometry)return;const G=A.geometry.coordinates;if(G&&G.length===0)return;const X=A.geometry.type,te=Math.pow(k.tolerance/((1<<k.maxZoom)*k.extent),2);let ae=[],re=A.id;if(k.promoteId?re=A.properties[k.promoteId]:k.generateId&&(re=F||0),X==="Point")Xr(G,ae);else if(X==="MultiPoint")for(const fe of G)Xr(fe,ae);else if(X==="LineString")gn(G,ae,te,!1);else if(X==="MultiLineString"){if(k.lineMetrics){for(const fe of G)ae=[],gn(fe,ae,te,!1),Q.push(_i(re,"LineString",ae,A.properties));return}Ci(G,ae,te,!1)}else if(X==="Polygon")Ci(G,ae,te,!0);else{if(X!=="MultiPolygon"){if(X==="GeometryCollection"){for(const fe of A.geometry.geometries)br(Q,{id:re,geometry:fe,properties:A.properties},k,F);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const fe of G){const be=[];Ci(fe,be,te,!0),ae.push(be)}}Q.push(_i(re,X,ae,A.properties))}function Xr(Q,A){A.push(qn(Q[0]),Yi(Q[1]),0)}function gn(Q,A,k,F){let G,X,te=0;for(let re=0;re<Q.length;re++){const fe=qn(Q[re][0]),be=Yi(Q[re][1]);A.push(fe,be,0),re>0&&(te+=F?(G*be-fe*X)/2:Math.sqrt(Math.pow(fe-G,2)+Math.pow(be-X,2))),G=fe,X=be}const ae=A.length-3;A[2]=1,ft(A,0,ae,k),A[ae+2]=1,A.size=Math.abs(te),A.start=0,A.end=A.size}function Ci(Q,A,k,F){for(let G=0;G<Q.length;G++){const X=[];gn(Q[G],X,k,F),A.push(X)}}function qn(Q){return Q/360+.5}function Yi(Q){const A=Math.sin(Q*Math.PI/180),k=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return k<0?0:k>1?1:k}function lr(Q,A,k,F,G,X,te,ae){if(F/=A,X>=(k/=A)&&te<F)return Q;if(te<k||X>=F)return null;const re=[];for(const fe of Q){const be=fe.geometry;let _e=fe.type;const De=G===0?fe.minX:fe.minY,Ve=G===0?fe.maxX:fe.maxY;if(De>=k&&Ve<F){re.push(fe);continue}if(Ve<k||De>=F)continue;let ne=[];if(_e==="Point"||_e==="MultiPoint")Wn(be,ne,k,F,G);else if(_e==="LineString")Hn(be,ne,k,F,G,!1,ae.lineMetrics);else if(_e==="MultiLineString")Dt(be,ne,k,F,G,!1);else if(_e==="Polygon")Dt(be,ne,k,F,G,!0);else if(_e==="MultiPolygon")for(const st of be){const ct=[];Dt(st,ct,k,F,G,!0),ct.length&&ne.push(ct)}if(ne.length){if(ae.lineMetrics&&_e==="LineString"){for(const st of ne)re.push(_i(fe.id,_e,st,fe.tags));continue}_e!=="LineString"&&_e!=="MultiLineString"||(ne.length===1?(_e="LineString",ne=ne[0]):_e="MultiLineString"),_e!=="Point"&&_e!=="MultiPoint"||(_e=ne.length===3?"Point":"MultiPoint"),re.push(_i(fe.id,_e,ne,fe.tags))}}return re.length?re:null}function Wn(Q,A,k,F,G){for(let X=0;X<Q.length;X+=3){const te=Q[X+G];te>=k&&te<=F&&Ot(A,Q[X],Q[X+1],Q[X+2])}}function Hn(Q,A,k,F,G,X,te){let ae=Li(Q);const re=G===0?cr:wr;let fe,be,_e=Q.start;for(let ct=0;ct<Q.length-3;ct+=3){const Re=Q[ct],ot=Q[ct+1],Gt=Q[ct+2],qt=Q[ct+3],$t=Q[ct+4],li=G===0?Re:ot,gt=G===0?qt:$t;let Wt=!1;te&&(fe=Math.sqrt(Math.pow(Re-qt,2)+Math.pow(ot-$t,2))),li<k?gt>k&&(be=re(ae,Re,ot,qt,$t,k),te&&(ae.start=_e+fe*be)):li>F?gt<F&&(be=re(ae,Re,ot,qt,$t,F),te&&(ae.start=_e+fe*be)):Ot(ae,Re,ot,Gt),gt<k&&li>=k&&(be=re(ae,Re,ot,qt,$t,k),Wt=!0),gt>F&&li<=F&&(be=re(ae,Re,ot,qt,$t,F),Wt=!0),!X&&Wt&&(te&&(ae.end=_e+fe*be),A.push(ae),ae=Li(Q)),te&&(_e+=fe)}let De=Q.length-3;const Ve=Q[De],ne=Q[De+1],st=G===0?Ve:ne;st>=k&&st<=F&&Ot(ae,Ve,ne,Q[De+2]),De=ae.length-3,X&&De>=3&&(ae[De]!==ae[0]||ae[De+1]!==ae[1])&&Ot(ae,ae[0],ae[1],ae[2]),ae.length&&A.push(ae)}function Li(Q){const A=[];return A.size=Q.size,A.start=Q.start,A.end=Q.end,A}function Dt(Q,A,k,F,G,X){for(const te of Q)Hn(te,A,k,F,G,X,!1)}function Ot(Q,A,k,F){Q.push(A,k,F)}function cr(Q,A,k,F,G,X){const te=(X-A)/(F-A);return Ot(Q,X,k+(G-k)*te,1),te}function wr(Q,A,k,F,G,X){const te=(X-k)/(G-k);return Ot(Q,A+(F-A)*te,X,1),te}function yn(Q,A){const k=[];for(let F=0;F<Q.length;F++){const G=Q[F],X=G.type;let te;if(X==="Point"||X==="MultiPoint"||X==="LineString")te=xn(G.geometry,A);else if(X==="MultiLineString"||X==="Polygon"){te=[];for(const ae of G.geometry)te.push(xn(ae,A))}else if(X==="MultiPolygon"){te=[];for(const ae of G.geometry){const re=[];for(const fe of ae)re.push(xn(fe,A));te.push(re)}}k.push(_i(G.id,X,te,G.tags))}return k}function xn(Q,A){const k=[];k.size=Q.size,Q.start!==void 0&&(k.start=Q.start,k.end=Q.end);for(let F=0;F<Q.length;F+=3)k.push(Q[F]+A,Q[F+1],Q[F+2]);return k}function Fi(Q,A){if(Q.transformed)return Q;const k=1<<Q.z,F=Q.x,G=Q.y;for(const X of Q.features){const te=X.geometry,ae=X.type;if(X.geometry=[],ae===1)for(let re=0;re<te.length;re+=2)X.geometry.push(Xn(te[re],te[re+1],A,k,F,G));else for(let re=0;re<te.length;re++){const fe=[];for(let be=0;be<te[re].length;be+=2)fe.push(Xn(te[re][be],te[re][be+1],A,k,F,G));X.geometry.push(fe)}}return Q.transformed=!0,Q}function Xn(Q,A,k,F,G,X){return[Math.round(k*(Q*F-G)),Math.round(k*(A*F-X))]}function Ca(Q,A,k,F,G){const X=A===G.maxZoom?0:G.tolerance/((1<<A)*G.extent),te={features:[],numPoints:0,numSimplified:0,numFeatures:Q.length,source:null,x:k,y:F,z:A,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const ae of Q)Yr(te,ae,X,G);return te}function Yr(Q,A,k,F){const G=A.geometry,X=A.type,te=[];if(Q.minX=Math.min(Q.minX,A.minX),Q.minY=Math.min(Q.minY,A.minY),Q.maxX=Math.max(Q.maxX,A.maxX),Q.maxY=Math.max(Q.maxY,A.maxY),X==="Point"||X==="MultiPoint")for(let ae=0;ae<G.length;ae+=3)te.push(G[ae],G[ae+1]),Q.numPoints++,Q.numSimplified++;else if(X==="LineString")Tr(te,G,Q,k,!1,!1);else if(X==="MultiLineString"||X==="Polygon")for(let ae=0;ae<G.length;ae++)Tr(te,G[ae],Q,k,X==="Polygon",ae===0);else if(X==="MultiPolygon")for(let ae=0;ae<G.length;ae++){const re=G[ae];for(let fe=0;fe<re.length;fe++)Tr(te,re[fe],Q,k,!0,fe===0)}if(te.length){let ae=A.tags||null;if(X==="LineString"&&F.lineMetrics){ae={};for(const fe in A.tags)ae[fe]=A.tags[fe];ae.mapbox_clip_start=G.start/G.size,ae.mapbox_clip_end=G.end/G.size}const re={geometry:te,type:X==="Polygon"||X==="MultiPolygon"?3:X==="LineString"||X==="MultiLineString"?2:1,tags:ae};A.id!==null&&(re.id=A.id),Q.features.push(re)}}function Tr(Q,A,k,F,G,X){const te=F*F;if(F>0&&A.size<(G?te:F))return void(k.numPoints+=A.length/3);const ae=[];for(let re=0;re<A.length;re+=3)(F===0||A[re+2]>te)&&(k.numSimplified++,ae.push(A[re],A[re+1])),k.numPoints++;G&&(function(re,fe){let be=0;for(let _e=0,De=re.length,Ve=De-2;_e<De;Ve=_e,_e+=2)be+=(re[_e]-re[Ve])*(re[_e+1]+re[Ve+1]);if(be>0===fe)for(let _e=0,De=re.length;_e<De/2;_e+=2){const Ve=re[_e],ne=re[_e+1];re[_e]=re[De-2-_e],re[_e+1]=re[De-1-_e],re[De-2-_e]=Ve,re[De-1-_e]=ne}})(ae,X),Q.push(ae)}const vn={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Ia{constructor(A,k){const F=(k=this.options=(function(X,te){for(const ae in te)X[ae]=te[ae];return X})(Object.create(vn),k)).debug;if(F&&console.time("preprocess data"),k.maxZoom<0||k.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(k.promoteId&&k.generateId)throw new Error("promoteId and generateId cannot be used together.");let G=(function(X,te){const ae=[];if(X.type==="FeatureCollection")for(let re=0;re<X.features.length;re++)br(ae,X.features[re],te,re);else br(ae,X.type==="Feature"?X:{geometry:X},te);return ae})(A,k);this.tiles={},this.tileCoords=[],F&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",k.indexMaxZoom,k.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),G=(function(X,te){const ae=te.buffer/te.extent;let re=X;const fe=lr(X,1,-1-ae,ae,0,-1,2,te),be=lr(X,1,1-ae,2+ae,0,-1,2,te);return(fe||be)&&(re=lr(X,1,-ae,1+ae,0,-1,2,te)||[],fe&&(re=yn(fe,1).concat(re)),be&&(re=re.concat(yn(be,-1)))),re})(G,k),G.length&&this.splitTile(G,0,0,0),F&&(G.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(A,k,F,G,X,te,ae){const re=[A,k,F,G],fe=this.options,be=fe.debug;for(;re.length;){G=re.pop(),F=re.pop(),k=re.pop(),A=re.pop();const _e=1<<k,De=Ki(k,F,G);let Ve=this.tiles[De];if(!Ve&&(be>1&&console.time("creation"),Ve=this.tiles[De]=Ca(A,k,F,G,fe),this.tileCoords.push({z:k,x:F,y:G}),be)){be>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",k,F,G,Ve.numFeatures,Ve.numPoints,Ve.numSimplified),console.timeEnd("creation"));const Wt="z".concat(k);this.stats[Wt]=(this.stats[Wt]||0)+1,this.total++}if(Ve.source=A,X==null){if(k===fe.indexMaxZoom||Ve.numPoints<=fe.indexMaxPoints)continue}else{if(k===fe.maxZoom||k===X)continue;if(X!=null){const Wt=X-k;if(F!==te>>Wt||G!==ae>>Wt)continue}}if(Ve.source=null,A.length===0)continue;be>1&&console.time("clipping");const ne=.5*fe.buffer/fe.extent,st=.5-ne,ct=.5+ne,Re=1+ne;let ot=null,Gt=null,qt=null,$t=null,li=lr(A,_e,F-ne,F+ct,0,Ve.minX,Ve.maxX,fe),gt=lr(A,_e,F+st,F+Re,0,Ve.minX,Ve.maxX,fe);A=null,li&&(ot=lr(li,_e,G-ne,G+ct,1,Ve.minY,Ve.maxY,fe),Gt=lr(li,_e,G+st,G+Re,1,Ve.minY,Ve.maxY,fe),li=null),gt&&(qt=lr(gt,_e,G-ne,G+ct,1,Ve.minY,Ve.maxY,fe),$t=lr(gt,_e,G+st,G+Re,1,Ve.minY,Ve.maxY,fe),gt=null),be>1&&console.timeEnd("clipping"),re.push(ot||[],k+1,2*F,2*G),re.push(Gt||[],k+1,2*F,2*G+1),re.push(qt||[],k+1,2*F+1,2*G),re.push($t||[],k+1,2*F+1,2*G+1)}}getTile(A,k,F){A=+A,k=+k,F=+F;const G=this.options,{extent:X,debug:te}=G;if(A<0||A>24)return null;const ae=1<<A,re=Ki(A,k=k+ae&ae-1,F);if(this.tiles[re])return Fi(this.tiles[re],X);te>1&&console.log("drilling down to z%d-%d-%d",A,k,F);let fe,be=A,_e=k,De=F;for(;!fe&&be>0;)be--,_e>>=1,De>>=1,fe=this.tiles[Ki(be,_e,De)];return fe&&fe.source?(te>1&&(console.log("found parent tile z%d-%d-%d",be,_e,De),console.time("drilling down")),this.splitTile(fe.source,be,_e,De,A,k,F),te>1&&console.timeEnd("drilling down"),this.tiles[re]?Fi(this.tiles[re],X):null):null}}function Ki(Q,A,k){return 32*((1<<Q)*k+A)+Q}class Kr extends Tt{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(A,k){return z._(this,void 0,void 0,(function*(){const F=A.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const G=this._geoJSONIndex.getTile(F.z,F.x,F.y);if(!G)return null;const X=new zt(G.features,{version:2,extent:z.$});let te=(function(ae){const re=new z.cM;return(function(fe,be){for(const _e in fe.layers)be.writeMessage(3,Et,fe.layers[_e])})(ae,re),re.finish()})(X);return te.byteOffset===0&&te.byteLength===te.buffer.byteLength||(te=new Uint8Array(te)),{vectorTile:X,rawData:te.buffer}}))}loadData(A){return z._(this,void 0,void 0,(function*(){var k;(k=this._pendingRequest)===null||k===void 0||k.abort();const F=!!(A&&A.request&&A.request.collectResourceTiming)&&new z.cN(A.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(A,this._pendingRequest);const G=yield this._pendingData;this._geoJSONIndex=A.cluster?new or((function({superclusterOptions:te,clusterProperties:ae}){if(!ae||!te)return te;const re={},fe={},be={accumulated:null,zoom:0},_e={properties:null},De=Object.keys(ae);for(const Ve of De){const[ne,st]=ae[Ve],ct=z.cT(st),Re=z.cT(typeof ne=="string"?[ne,["accumulated"],["get",Ve]]:ne);re[Ve]=ct.value,fe[Ve]=Re.value}return te.map=Ve=>{_e.properties=Ve;const ne={};for(const st of De)ne[st]=re[st].evaluate(be,_e);return ne},te.reduce=(Ve,ne)=>{_e.properties=ne;for(const st of De)be.accumulated=Ve[st],Ve[st]=fe[st].evaluate(be,_e)},te})(A)).load(G.features):(function(te,ae){return new Ia(te,ae)})(G,A.geojsonVtOptions),this.loaded={};const X={data:G};if(F){const te=F.finish();te&&(X.resourceTiming={},X.resourceTiming[A.source]=JSON.parse(JSON.stringify(te)))}return X}catch(G){if(delete this._pendingRequest,z.cy(G))return{abandoned:!0};throw G}}))}getData(){return z._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(A){const k=this.loaded;return k&&k[A.uid]?super.reloadTile(A):this.loadTile(A)}loadAndProcessGeoJSON(A,k){return z._(this,void 0,void 0,(function*(){let F=yield this.loadGeoJSON(A,k);if(delete this._pendingRequest,typeof F!="object")throw new Error("Input data given to '".concat(A.source,"' is not a valid GeoJSON object."));if(Hi(F,!0),A.filter){const G=z.cT(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(G.result==="error")throw new Error(G.value.map((te=>"".concat(te.key,": ").concat(te.message))).join(", "));F={type:"FeatureCollection",features:F.features.filter((te=>G.value.evaluate({zoom:0},te)))}}return F}))}loadGeoJSON(A,k){return z._(this,void 0,void 0,(function*(){const{promoteId:F}=A;if(A.request){const G=yield z.j(A.request,k);return this._dataUpdateable=z.cV(G.data,F)?z.cU(G.data,F):void 0,G.data}
5if(typeof A.data=="string")try{const G=JSON.parse(A.data);return this._dataUpdateable=z.cV(G,F)?z.cU(G,F):void 0,G}catch(G){throw new Error("Input data given to '".concat(A.source,"' is not a valid GeoJSON object."))}if(!A.dataDiff)throw new Error("Input data given to '".concat(A.source,"' is not a valid GeoJSON object."));if(!this._dataUpdateable)throw new Error("Cannot update existing geojson data in ".concat(A.source));return z.cW(this._dataUpdateable,A.dataDiff,F),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(A){return z._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(A){return this._geoJSONIndex.getClusterExpansionZoom(A.clusterId)}getClusterChildren(A){return this._geoJSONIndex.getChildren(A.clusterId)}getClusterLeaves(A){return this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset)}}class Ji{constructor(A){this.self=A,this.actor=new z.J(A),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(k,F)=>{if(this.externalWorkerSourceTypes[k])throw new Error('Worker source with name "'.concat(k,'" already registered.'));this.externalWorkerSourceTypes[k]=F},this.self.addProtocol=z.cA,this.self.removeProtocol=z.cB,this.self.registerRTLTextPlugin=k=>{z.cX.setMethods(k)},this.actor.registerMessageHandler("LDT",((k,F)=>this._getDEMWorkerSource(k,F.source).loadTile(F))),this.actor.registerMessageHandler("RDT",((k,F)=>z._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(k,F.source).removeTile(F)})))),this.actor.registerMessageHandler("GCEZ",((k,F)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(k,F.type,F.source).getClusterExpansionZoom(F)})))),this.actor.registerMessageHandler("GCC",((k,F)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(k,F.type,F.source).getClusterChildren(F)})))),this.actor.registerMessageHandler("GCL",((k,F)=>z._(this,void 0,void 0,(function*(){return this._getWorkerSource(k,F.type,F.source).getClusterLeaves(F)})))),this.actor.registerMessageHandler("LD",((k,F)=>this._getWorkerSource(k,F.type,F.source).loadData(F))),this.actor.registerMessageHandler("GD",((k,F)=>this._getWorkerSource(k,F.type,F.source).getData())),this.actor.registerMessageHandler("LT",((k,F)=>this._getWorkerSource(k,F.type,F.source).loadTile(F))),this.actor.registerMessageHandler("RT",((k,F)=>this._getWorkerSource(k,F.type,F.source).reloadTile(F))),this.actor.registerMessageHandler("AT",((k,F)=>this._getWorkerSource(k,F.type,F.source).abortTile(F))),this.actor.registerMessageHandler("RMT",((k,F)=>this._getWorkerSource(k,F.type,F.source).removeTile(F))),this.actor.registerMessageHandler("RS",((k,F)=>z._(this,void 0,void 0,(function*(){if(!this.workerSources[k]||!this.workerSources[k][F.type]||!this.workerSources[k][F.type][F.source])return;const G=this.workerSources[k][F.type][F.source];delete this.workerSources[k][F.type][F.source],G.removeSource!==void 0&&G.removeSource(F)})))),this.actor.registerMessageHandler("RM",(k=>z._(this,void 0,void 0,(function*(){delete this.layerIndexes[k],delete this.availableImages[k],delete this.workerSources[k],delete this.demWorkerSources[k],this.globalStates.delete(k)})))),this.actor.registerMessageHandler("SR",((k,F)=>z._(this,void 0,void 0,(function*(){this.referrer=F})))),this.actor.registerMessageHandler("SRPS",((k,F)=>this._syncRTLPluginState(k,F))),this.actor.registerMessageHandler("IS",((k,F)=>z._(this,void 0,void 0,(function*(){this.self.importScripts(F)})))),this.actor.registerMessageHandler("SI",((k,F)=>this._setImages(k,F))),this.actor.registerMessageHandler("UL",((k,F)=>z._(this,void 0,void 0,(function*(){this._getLayerIndex(k).update(F.layers,F.removedIds,this._getGlobalState(k))})))),this.actor.registerMessageHandler("UGS",((k,F)=>z._(this,void 0,void 0,(function*(){const G=this._getGlobalState(k);for(const X in F)G[X]=F[X]})))),this.actor.registerMessageHandler("SL",((k,F)=>z._(this,void 0,void 0,(function*(){this._getLayerIndex(k).replace(F,this._getGlobalState(k))}))))}_getGlobalState(A){let k=this.globalStates.get(A);return k||(k={}
vendor: 9,429 bytes, line 5
5,this.globalStates.set(A,k)),k}_setImages(A,k){return z._(this,void 0,void 0,(function*(){this.availableImages[A]=k;for(const F in this.workerSources[A]){const G=this.workerSources[A][F];for(const X in G)G[X].availableImages=k}}))}_syncRTLPluginState(A,k){return z._(this,void 0,void 0,(function*(){return yield z.cX.syncState(k,this.self.importScripts)}))}_getAvailableImages(A){let k=this.availableImages[A];return k||(k=[]),k}_getLayerIndex(A){let k=this.layerIndexes[A];return k||(k=this.layerIndexes[A]=new c),k}_getWorkerSource(A,k,F){if(this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][k]||(this.workerSources[A][k]={}),!this.workerSources[A][k][F]){const G={sendAsync:(X,te)=>(X.targetMapId=A,this.actor.sendAsync(X,te))};switch(k){case"vector":this.workerSources[A][k][F]=new Tt(G,this._getLayerIndex(A),this._getAvailableImages(A));break;case"geojson":this.workerSources[A][k][F]=new Kr(G,this._getLayerIndex(A),this._getAvailableImages(A));break;default:this.workerSources[A][k][F]=new this.externalWorkerSourceTypes[k](G,this._getLayerIndex(A),this._getAvailableImages(A))}}return this.workerSources[A][k][F]}_getDEMWorkerSource(A,k){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][k]||(this.demWorkerSources[A][k]=new Ze),this.demWorkerSources[A][k]}}return z.i(self)&&(self.worker=new Ji(self)),Ji})),Be("index",["exports","./shared"],(function(z,c){var Ee="5.9.0";function Bt(){var h=new c.A(4);return c.A!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h}let wt,Tt;const Ze={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(h,e,n){const s=requestAnimationFrame((d=>{l(),e(d)})),{unsubscribe:l}=c.s(h.signal,"abort",(()=>{l(),cancelAnimationFrame(s),n(c.c())}),!1)},frameAsync(h){return new Promise(((e,n)=>{this.frame(h,e,n)}))},getImageData(h,e=0){return this.getImageCanvasContext(h).getImageData(-e,-e,h.width+2*e,h.height+2*e)},getImageCanvasContext(h){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=h.width,e.height=h.height,n.drawImage(h,0,0,h.width,h.height),n},resolveURL:h=>(wt||(wt=document.createElement("a")),wt.href=h,wt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Tt==null&&(Tt=matchMedia("(prefers-reduced-motion: reduce)")),Tt.matches)}};class ue{static testProp(e){if(!ue.docStyle)return e[0];for(let n=0;n<e.length;n++)if(e[n]in ue.docStyle)return e[n];return e[0]}static create(e,n,s){const l=window.document.createElement(e);return n!==void 0&&(l.className=n),s&&s.appendChild(l),l}static createNS(e,n){return window.document.createElementNS(e,n)}static disableDrag(){ue.docStyle&&ue.selectProp&&(ue.userSelect=ue.docStyle[ue.selectProp],ue.docStyle[ue.selectProp]="none")}static enableDrag(){ue.docStyle&&ue.selectProp&&(ue.docStyle[ue.selectProp]=ue.userSelect)}static setTransform(e,n){e.style[ue.transformProp]=n}static addEventListener(e,n,s,l={}){e.addEventListener(n,s,"passive"in l?l:l.capture)}static removeEventListener(e,n,s,l={}){e.removeEventListener(n,s,"passive"in l?l:l.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",ue.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ue.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",ue.suppressClickInternal,!0)}),0)}static getScale(e){const n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}static getPoint(e,n,s){const l=n.boundingClientRect;return new c.P((s.clientX-l.left)/n.x-e.clientLeft,(s.clientY-l.top)/n.y-e.clientTop)}static mousePos(e,n){const s=ue.getScale(e);return ue.getPoint(e,s,n)}static touchPos(e,n){const s=[],l=ue.getScale(e);for(let d=0;d<n.length;d++)s.push(ue.getPoint(e,l,n[d]));return s}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){const n=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),s=n.querySelectorAll("script");for(const l of s)l.remove();return ue.clean(n),n.innerHTML}static isPossiblyDangerous(e,n){const s=n.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!s.includes("javascript:")&&!s.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){const n=e.children;for(const s of n)ue.removeAttributes(s),ue.clean(s)}static removeAttributes(e){for(const{name:n,value:s}of e.attributes)ue.isPossiblyDangerous(n,s)&&e.removeAttribute(n)}}ue.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ue.selectProp=ue.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ue.transformProp=ue.testProp(["transform","WebkitTransform"]);const ar={supported:!1,testSupport:function(h){!Ar&&Hi&&(zt?Et(h):Di=h)}};let Di,Hi,Ar=!1,zt=!1;function Et(h){const e=h.createTexture();h.bindTexture(h.TEXTURE_2D,e);try{if(h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,Hi),h.isContextLost())return;ar.supported=!0}catch(n){}h.deleteTexture(e),Ar=!0}var mi;typeof document<"u"&&(Hi=document.createElement("img"),Hi.onload=()=>{Di&&Et(Di),Di=null,zt=!0},Hi.onerror=()=>{Ar=!0,Di=null},Hi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(h){let e,n,s,l;h.resetRequestQueue=()=>{e=[],n=0,s=0,l={}},h.addThrottleControl=y=>{const b=s++;return l[b]=y,b},h.removeThrottleControl=y=>{delete l[y],f()},h.getImage=(y,b,w=!0)=>new Promise(((S,P)=>{ar.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*"),c.e(y,{type:"image"}),e.push({abortController:b,requestParameters:y,supportImageRefresh:w,state:"queued",onError:I=>{P(I)},onSuccess:I=>{S(I)}}),f()}));const d=y=>c._(this,void 0,void 0,(function*(){y.state="running";const{requestParameters:b,supportImageRefresh:w,onError:S,onSuccess:P,abortController:I}=y,D=w===!1&&!c.i(self)&&!c.g(b.url)&&(!b.headers||Object.keys(b.headers).reduce(((j,N)=>j&&N==="accept"),!0));n++;const B=D?g(b,I):c.m(b,I);try{const j=yield B;delete y.abortController,y.state="completed",j.data instanceof HTMLImageElement||c.b(j.data)?P(j):j.data&&P({data:yield(O=j.data,typeof createImageBitmap=="function"?c.f(O):c.h(O)),cacheControl:j.cacheControl,expires:j.expires})}catch(j){delete y.abortController,S(j)}finally{n--,f()}var O})),f=()=>{const y=(()=>{for(const b of Object.keys(l))if(l[b]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let b=n;b<y&&e.length>0;b++){const w=e.shift();w.abortController.signal.aborted?b--:d(w)}},g=(y,b)=>new Promise(((w,S)=>{const P=new Image,I=y.url,D=y.credentials;D&&D==="include"?P.crossOrigin="use-credentials":(D&&D==="same-origin"||!c.d(I))&&(P.crossOrigin="anonymous"),b.signal.addEventListener("abort",(()=>{P.src="",S(c.c())})),P.fetchPriority="high",P.onload=()=>{P.onerror=P.onload=null,w({data:P})},P.onerror=()=>{P.onerror=P.onload=null,b.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."))},P.src=I}))})(mi||(mi={})),mi.resetRequestQueue();class qr{constructor(e){this._transformRequestFn=e!=null?e:null}transformRequest(e,n){return this._transformRequestFn&&this._transformRequestFn(e,n)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Xi(h){const e=[];if(typeof h=="string")e.push({id:"default",url:h});else if(h&&h.length>0){const n=[];for(const{id:s,url:l}of h){const d="".concat(s).concat(l);n.indexOf(d)===-1&&(n.push(d),e.push({id:s,url:l}))}}return e}function kr(h,e,n){try{const s=new URL(h);return s.pathname+="".concat(e).concat(n),s.toString()}catch(s){throw new Error('Invalid sprite URL "'.concat(h,'", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically'))}}function pn(h){const{userImage:e}=h;return!!(e&&e.render&&e.render())&&(h.data.replace(new Uint8Array(e.data.buffer)),!0)}class Wr extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:n,promiseResolve:s}of this.requestors)s(this._getImagesForIds(n));this.requestors=[]}}getImage(e){const n=this.images[e];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new c.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(e,n){if(this.images[e])throw new Error("Image id ".concat(e," already exist, use updateImage instead"));this._validate(e,n)&&(this.images[e]=n)}_validate(e,n){let s=!0;const l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l&&l.width)||(this.fire(new c.k(new Error('Image "'.concat(e,'" has invalid "stretchX" value')))),s=!1),this._validateStretch(n.stretchY,l&&l.height)||(this.fire(new c.k(new Error('Image "'.concat(e,'" has invalid "stretchY" value')))),s=!1),this._validateContent(n.content,n)||(this.fire(new c.k(new Error('Image "'.concat(e,'" has invali
5d "content" value')))),s=!1),s}_validateStretch(e,n){if(!e)return!0;let s=0;for(const l of e){if(l[0]<s||l[1]<l[0]||n<l[1])return!1;s=l[1]}return!0}_validateContent(e,n){if(!e)return!0;if(e.length!==4)return!1;const s=n.spriteData,l=s&&s.width||n.data.width,d=s&&s.height||n.data.height;return!(e[0]<0||l<e[0]||e[1]<0||d<e[1]||e[2]<0||l<e[2]||e[3]<0||d<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,n,s=!0){const l=this.getImage(e);if(s&&(l.data.width!==n.data.width||l.data.height!==n.data.height))throw new Error("size mismatch between old image (".concat(l.data.width,"x").concat(l.data.height,") and new image (").concat(n.data.width,"x").concat(n.data.height,")."));n.version=l.version+1,this.images[e]=n,this.updatedImages[e]=!0}removeImage(e){const n=this.images[e];delete this.images[e],delete this.patterns[e],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((n,s)=>{let l=!0;if(!this.isLoaded())for(const d of e)this.images[d]||(l=!1);this.isLoaded()||l?n(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:n})}
5))}_getImagesForIds(e){const n={};for(const s of e){let l=this.getImage(s);l||(this.fire(new c.l("styleimagemissing",{id:s})),l=this.getImage(s)),l?n[s]={data:l.data.clone(),pixelRatio:l.pixelRatio,sdf:l.sdf,version:l.version,stretchX:l.stretchX,stretchY:l.stretchY,content:l.content,textFitWidth:l.textFitWidth,textFitHeight:l.textFitHeight,hasRenderCallback:!!(l.userImage&&l.userImage.render)}:c.w('Image "'.concat(s,'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.'))}return n}getPixelSize(){const{width:e,height:n}=this.atlasImage;return{width:e,height:n}}getPattern(e){const n=this.patterns[e],s=this.getImage(e);if(!s)return null;if(n&&n.position.version===s.version)return n.position;if(n)n.position.version=s.version;else{const l={w:s.data.width+2,h:s.data.height+2,x:0,y:0},d=new c.I(l,s);this.patterns[e]={bin:l,position:d}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new c.T(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const d in this.patterns)e.push(this.patterns[d].bin);const{w:n,h:s}=c.p(e),l=this.atlasImage;l.resize({width:n||1,height:s||1});for(const d in this.patterns){const{bin:f}=this.patterns[d],g=f.x+1,y=f.y+1,b=this.getImage(d).data,w=b.width,S=b.height;c.R.copy(b,l,{x:0,y:0},{x:g,y},{width:w,height:S}),c.R.copy(b,l,{x:0,y:S-1},{x:g,y:y-1},{width:w,height:1}),c.R.copy(b,l,{x:0,y:0},{x:g,y:y+S},{width:w,height:1}),c.R.copy(b,l,{x:w-1,y:0},{x:g-1,y},{width:1,height:S}),c.R.copy(b,l,{x:0,y:0},{x:g+w,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.getImage(n);s||c.w('Image with ID: "'.concat(n,'" was not found')),pn(s)&&this.updateImage(n,s)}}}const Mi=1e20;function sr(h,e,n,s,l,d,f,g,y){for(let b=e;b<e+s;b++)Ri(h,n*d+b,d,l,f,g,y);for(let b=n;b<n+l;b++)Ri(h,b*d+e,1,s,f,g,y)}function Ri(h,e,n,s,l,d,f){d[0]=0,f[0]=-Mi,f[1]=Mi,l[0]=h[e];for(let g=1,y=0,b=0;g<s;g++){l[g]=h[e+g*n];const w=g*g;do{const S=d[y];b=(l[g]-l[S]+w-S*S)/(g-S)/2}while(b<=f[y]&&--y>-1);y++,d[y]=g,f[y]=b,f[y+1]=Mi}for(let g=0,y=0;g<s;g++){for(;f[y+1]<g;)y++;const b=d[y],w=g-b;h[e+g*n]=l[b]+w*w}}class or{constructor(e,n,s){this.requestManager=e,this.localIdeographFontFamily=n,this.entries={},this.lang=s}setURL(e){this.url=e}getGlyphs(e){return c._(this,void 0,void 0,(function*(){const n=[];for(const d in e)for(const f of e[d])n.push(this._getAndCacheGlyphsPromise(d,f));const s=yield Promise.all(n),l={};for(const{stack:d,id:f,glyph:g}of s)l[d]||(l[d]={}),l[d][f]=g&&{id:g.id,bitmap:g.bitmap.clone(),metrics:g.metrics};return l}))}_getAndCacheGlyphsPromise(e,n){return c._(this,void 0,void 0,(function*(){let s=this.entries[e];s||(s=this.entries[e]={glyphs:{},requests:{},ranges:{}});let l=s.glyphs[n];if(l!==void 0)return{stack:e,id:n,glyph:l};if(l=this._tinySDF(s,e,n),l)return s.glyphs[n]=l,{stack:e,id:n,glyph:l};const d=Math.floor(n/256);if(256*d>65535)throw new Error("glyphs > 65535 not supported");if(s.ranges[d])return{stack:e,id:n,glyph:l};if(!this.url)throw new Error("glyphsUrl is not set");if(!s.requests[d]){const g=or.loadGlyphRange(e,d,this.url,this.requestManager);s.requests[d]=g}const f=yield s.requests[d];for(const g in f)this._doesCharSupportLocalGlyph(+g)||(s.glyphs[+g]=f[+g]);return s.ranges[d]=!0,{stack:e,id:n,glyph:f[n]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))||c.u["CJK Unified Ideographs"](e)||c.u["Hangul Syllables"](e)||c.u.Hiragana(e)||c.u.Katakana(e)||c.u["CJK Symbols and Punctuation"](e)||c.u["Halfwidth and Fullwidth Forms"](e))}_tinySDF(e,n,s){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(s))return;let d=e.tinySDF;if(!d){let g="400";/bold/i.test(n)?g="900":/medium/i.test(n)?g="500":/light/i.test(n)&&(g="200"),d=e.tinySDF=new or.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,lang:this.lang,fontFamily:l,fontWeight:g})}const f=d.draw(String.fromCharCode(s));return{id:s,bitmap:new c.q({width:f.width||60,height:f.height||60},f.data),metrics:{width:f.glyphWidth/2||24,height:f.glyphHeight/2||24,left:f.glyphLeft/2+.5||0,top:f.glyphTop/2-27.5||-8,advance:f.glyphAdvance/2||24,isDoubleResolution:!0}}}}or.loadGlyphRange=function(h,e,n,s){return c._(this,void 0,void 0,(function*(){const l=256*e,d=l+255,f=s.transformRequest(n.replace("{fontstack}",h).replace("{range}","".concat(l,"-").concat(d)),"Glyphs"),g=yield c.n(f,new AbortController);if(!g||!g.data)throw new Error("Could not load glyph range. range: ".concat(e,", ").concat(l,"-").concat(d));const y={};for(const b of c.o(g.data))y[b.id]=b;return y}
vendor: 21,054 bytes, line 5
5))},or.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:n=8,cutoff:s=.25,fontFamily:l="sans-serif",fontWeight:d="normal",fontStyle:f="normal",lang:g=null}={}){this.buffer=e,this.cutoff=s,this.radius=n,this.lang=g;const y=this.size=h+4*e,b=this._createCanvas(y),w=this.ctx=b.getContext("2d",{willReadFrequently:!0});w.font="".concat(f," ").concat(d," ").concat(h,"px ").concat(l),w.textBaseline="alphabetic",w.textAlign="left",w.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Uint16Array(y)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:l,actualBoundingBoxRight:d}=this.ctx.measureText(h),f=Math.ceil(n),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(d-l))),y=Math.min(this.size-this.buffer,f+Math.ceil(s)),b=g+2*this.buffer,w=y+2*this.buffer,S=Math.max(b*w,0),P=new Uint8ClampedArray(S),I={data:P,width:b,height:w,glyphWidth:g,glyphHeight:y,glyphTop:f,glyphLeft:0,glyphAdvance:e};if(g===0||y===0)return I;const{ctx:D,buffer:B,gridInner:O,gridOuter:j}=this;this.lang&&(D.lang=this.lang),D.clearRect(B,B,g,y),D.fillText(h,B,B+f);const N=D.getImageData(B,B,g,y);j.fill(Mi,0,S),O.fill(0,0,S);for(let $=0;$<y;$++)for(let U=0;U<g;U++){const W=N.data[4*($*g+U)+3]/255;if(W===0)continue;const K=($+B)*b+U+B;if(W===1)j[K]=0,O[K]=Mi;else{const Z=.5-W;j[K]=Z>0?Z*Z:0,O[K]=Z<0?Z*Z:0}}sr(j,0,0,b,w,b,this.f,this.v,this.z),sr(O,B,B,g,y,b,this.f,this.v,this.z);for(let $=0;$<S;$++){const U=Math.sqrt(j[$])-Math.sqrt(O[$]);P[$]=Math.round(255-255*(U/this.radius+this.cutoff))}return I}};class Hr{constructor(){this.specification=c.v.light.position}possiblyEvaluate(e,n){return c.B(e.expression.evaluate(n))}interpolate(e,n,s){return{x:c.C.number(e.x,n.x,s),y:c.C.number(e.y,n.y,s),z:c.C.number(e.z,n.z,s)}}}let vr;class Ne extends c.E{constructor(e){super(),vr=vr||new c.r({anchor:new c.D(c.v.light.anchor),position:new Hr,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.t(vr,void 0),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,n={}){if(!this._validate(c.x,e,n))for(const s in e){const l=e[s];s.endsWith("-transition")?this._transitionable.setTransition(s.slice(0,-11),l):this._transitionable.setValue(s,l)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,s){return(!s||s.validate!==!1)&&c.y(this,e.call(c.z,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:c.v}))}}const fn=new c.r({"sky-color":new c.D(c.v.sky["sky-color"]),"horizon-color":new c.D(c.v.sky["horizon-color"]),"fog-color":new c.D(c.v.sky["fog-color"]),"fog-ground-blend":new c.D(c.v.sky["fog-ground-blend"]),"horizon-fog-blend":new c.D(c.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new c.D(c.v.sky["sky-horizon-blend"]),"atmosphere-blend":new c.D(c.v.sky["atmosphere-blend"])});class gs extends c.E{constructor(e){super(),this._transitionable=new c.t(fn,void 0),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.F(0))}setSky(e,n={}){if(!this._validate(c.G,e,n)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const s in e){const l=e[s];s.endsWith("-transition")?this._transitionable.setTransition(s.slice(0,-11),l):this._transitionable.setValue(s,l)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,s={}){return(s==null?void 0:s.validate)!==!1&&c.y(this,e.call(c.z,c.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class ft{constructor(e,n){this.width=e,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,n){const s=e.join(",")+String(n);return this.dashEntry[s]||(this.dashEntry[s]=this.addDash(e,n)),this.dashEntry[s]}getDashRanges(e,n,s){const l=[];let d=e.length%2==1?-e[e.length-1]*s:0,f=e[0]*s,g=!0;l.push({left:d,right:f,isDash:g,zeroLength:e[0]===0});let y=e[0];for(let b=1;b<e.length;b++){g=!g;const w=e[b];d=y*s,y+=w,f=y*s,l.push({left:d,right:f,isDash:g,zeroLength:w===0})}return l}addRoundDash(e,n,s){const l=n/2;for(let d=-s;d<=s;d++){const f=this.width*(this.nextRow+s+d);let g=0,y=e[g];for(let b=0;b<this.width;b++){b/y.right>1&&(y=e[++g]);const w=Math.abs(b-y.left),S=Math.abs(b-y.right),P=Math.min(w,S);let I;const D=d/s*(l+1);if(y.isDash){const B=l-Math.abs(D);I=Math.sqrt(P*P+B*B)}else I=l-Math.sqrt(P*P+D*D);this.data[f+b]=Math.max(0,Math.min(255,I+128))}}}addRegularDash(e){for(let g=e.length-1;g>=0;--g){const y=e[g],b=e[g+1];y.zeroLength?e.splice(g,1):b&&b.isDash===y.isDash&&(b.left=y.left,e.splice(g,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const l=this.width*this.nextRow;let d=0,f=e[d];for(let g=0;g<this.width;g++){g/f.right>1&&(f=e[++d]);const y=Math.abs(g-f.left),b=Math.abs(g-f.right),w=Math.min(y,b);this.data[l+g]=Math.max(0,Math.min(255,(f.isDash?w:-w)+128))}}addDash(e,n){const s=n?7:0,l=2*s+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let d=0;for(let g=0;g<e.length;g++)d+=e[g];if(d!==0){const g=this.width/d,y=this.getDashRanges(e,this.width,g);n?this.addRoundDash(y,g,s):this.addRegularDash(y)}const f={y:this.nextRow+s,height:2*s,width:d};return this.nextRow+=l,this.dirty=!0,f}bind(e){const n=e.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}const mn="maplibre_preloaded_worker_pool";class _i{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<_i.workerCount;)this.workers.push(new Worker(c.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach((n=>{n.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[mn]}numActive(){return Object.keys(this.active).length}}const _n=Math.floor(Ze.hardwareConcurrency/2);let br,Xr;function gn(){return br||(br=new _i),br}_i.workerCount=c.H(globalThis)?Math.max(Math.min(_n,3),1):1;class Ci{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const s=this.workerPool.acquire(n);for(let l=0;l<s.length;l++){const d=new c.J(s[l],n);d.name="Worker ".concat(l),this.actors.push(d)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,n){const s=[];for(const l of this.actors)s.push(l.sendAsync({type:e,data:n}));return Promise.all(s)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach((n=>{n.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,n){for(const s of this.actors)s.registerMessageHandler(e,n)}}function qn(){return Xr||(Xr=new Ci(gn(),c.K),Xr.registerMessageHandler("GR",((h,e,n)=>c.m(e,n)))),Xr}function Yi(h,e){const n=c.L();return c.M(n,n,[1,1,0]),c.N(n,n,[.5*h.width,.5*h.height,1]),h.calculatePosMatrix?c.O(n,n,h.calculatePosMatrix(e.toUnwrapped())):n}function lr(h,e,n,s,l,d,f){var g;const y=(function(P,I,D){if(P)for(const B of P){const O=I[B];if(O&&O.source===D&&O.type==="fill-extrusion")return!0}else for(const B in I){const O=I[B];if(O.source===D&&O.type==="fill-extrusion")return!0}return!1})((g=l==null?void 0:l.layers)!==null&&g!==void 0?g:null,e,h.id),b=d.maxPitchScaleFactor(),w=h.tilesIn(s,b,y);w.sort(Wn);const S=[];for(const P of w)S.push({wrappedTileID:P.tileID.wrapped().key,queryResults:P.tile.queryRenderedFeatures(e,n,h._state,P.queryGeometry,P.cameraQueryGeometry,P.scale,l,d,b,Yi(h.transform,P.tileID),f?(I,D)=>f(P.tileID,I,D):void 0)});return(function(P,I){for(const D in P)for(const B of P[D])Hn(B,I);return P})((function(P){const I={},D={};for(const B of P){const O=B.queryResults,j=B.wrappedTileID,N=D[j]=D[j]||{};for(const $ in O){const U=O[$],W=N[$]=N[$]||{},K=I[$]=I[$]||[];for(const Z of U)W[Z.featureIndex]||(W[Z.featureIndex]=!0,K.push(Z))}}return I})(S),h)}function Wn(h,e){const n=h.tileID,s=e.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}function Hn(h,e){const n=h.feature,s=e.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=s}function Li(h,e,n){return c._(this,void 0,void 0,(function*(){let s=h;if(h.url?s=(yield c.j(e.transformRequest(h.url,"Source"),n)).data:yield Ze.frameAsync(n),!s)return null;const l=c.Q(c.e(s,h),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(l.vectorLayerIds=s.vector_layers.map((d=>d.id))),l}))}class Dt{constructor(e,n){e&&(n?this.setSouthWest(e).setNorthEast(n):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof c.S?new c.S(e.lng,e.lat):c.S.convert(e),this}setSouthWest(e){return this._sw=e instanceof c.S?new c.S(e.lng,e.lat):c.S.convert(e),this}extend(e){const n=this._sw,s=this._ne;let l,d;if(e instanceof c.S)l=e,d=e;else{if(!(e instanceof Dt))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(Dt.convert(e)):this.extend(c.S.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(c.S.convert(e)):this;if(l=e._sw,d=e._ne,!l||!d)return this}return n||s?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),s.lng=Math.max(d.lng,s.lng),s.lat=Math.max(d.lat,s.lat)):(this._sw=new c.S(l.lng,l.lat),this._ne=new c.S(d.lng,d.lat)),this}getCenter(){return new c.S((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 c.S(this.getWest(),this.getNorth())}getSouthEast(){return new c.S(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(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:n,lat:s}=c.S.convert(e);let l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&l}static convert(e){return e instanceof Dt?e:e&&new Dt(e)}static fromLngLat(e,n=0){const s=360*n/40075017,l=s/Math.cos(Math.PI/180*e.lat);return new Dt(new c.S(e.lng-l,e.lat-s),new c.S(e.lng+l,e.lat+s))}adjustAntiMeridian(){const e=new c.S(this._sw.lng,this._sw.lat),n=new c.S(this._ne.lng,this._ne.lat);return new Dt(e,e.lng>n.lng?new c.S(n.lng+360,n.lat):n)}}class Ot{constructor(e,n,s){this.bounds=Dt.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const n=Math.pow(2,e.z),s=Math.floor(c.V(this.bounds.getWest())*n),l=Math.floor(c.U(this.bounds.getNorth())*n),d=Math.ceil(c.V(this.bounds.getEast())*n),f=Math.ceil(c.U(this.bounds.getSouth())*n);return e.x>=s&&e.x<d&&e.y>=l&&e.y<f}}class cr extends c.E{constructor(e,n,s,l){if(super(),this.id=e,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.Q(n,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield Li(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(c.e(this,e),e.bounds&&(this.tileBounds=new Ot(e.bounds,this.minzoom,this.maxzoom)),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.l("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,this.fire(new c.k(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(e){return c._(this,void 0,void 0,(function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:this.map._requestManager.transformRequest(n,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};s.request.collectResourceTiming=this._collectResourceTiming;let l="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise(((d,f)=>{e.reloadPromise={resolve:d,reject:f}}))}else e.actor=this.dispatcher.getActor(),l="LT";e.abortController=new AbortController;try{const d=yield e.actor.sendAsync({type:l,data:s},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,d)}catch(d){if(delete e.abortController,e.aborted)return;if(d&&d.status!==404)throw d;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,n){if(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),e.reloadPromise){const s=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(s.resolve).catch(s.reject)}}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class wr extends c.E{constructor(e,n,s,l){super(),this.id=e,this.dispatcher=s,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},n),c.e(this,c.Q(n,["url","scheme","tileSize"]))}load(){return c._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const n=yield Li(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,n&&(c.e(this,n),n.bounds&&(this.tileBounds=new Ot(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(n){this._tileJSONRequest=null,this._loaded=!0,this.fire(new c.k(n))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return c.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return c._(this,void 0,void 0,(function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const s=yield mi.getImage(this.map._requestManager.transformRequest(n,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(s&&s.data){this.map._refreshExpiredTiles&&(s.cacheControl||s.expires)&&e.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});const l=this.map.painter.context,d=l.gl,f=s.data;e.texture=this.map.painter.getTileTexture(f.width),e.texture?e.texture.update(f,{useMipmap:!0}):(e.texture=new c.T(l,f,d.RGBA,{useMipmap:!0}),e.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(s){if(delete e.abortController,e.aborted)e.state="unloaded";else if(s)throw e.state="errored",s}}))}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class yn extends wr{constructor(e,n,s,l){super(e,n,s,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return c._(this,void 0,void 0,(function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=this.map._requestManager.transformRequest(n,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const l=yield mi.getImage(s,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(l&&l.data){const d=l.data;this.map._refreshExpiredTiles&&(l.cacheControl||l.expires)&&e.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});const f=c.b(d)&&c.W()?d:yield this.readImageNow(d),g={type:this.type,uid:e.uid,source:this.id,rawImageData:f,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const y=yield e.actor.sendAsync({type:"LDT",data:g});e.dem=y,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(l){if(delete e.abortController,e.aborted)e.state="unloaded";else if(l)throw e.state="errored",l}}))}readImageNow(e){return c._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&c.X()){const n=e.width+2,s=e.height+2;try{return new c.R({width:n,height:s},yield c.Y(e,-1,-1,n,s))}catch(l){}}return Ze.getImageData(e,1)}))}_getNeighboringTiles(e){const n=e.canonical,s=Math.pow(2,n.z),l=(n.x-1+s)%s,d=n.x===0?e.wrap-1:e.wrap,f=(n.x+1+s)%s,g=n.x+1===s?e.wrap+1:e.wrap,y={};return y[new c.Z(e.overscaledZ,d,n.z,l,n.y).key]={backfilled:!1},y[new c.Z(e.overscaledZ,g,n.z,f,n.y).key]={backfilled:!1},n.y>0&&(y[new c.Z(e.overscaledZ,d,n.z,l,n.y-1).key]={backfilled:!1},y[new c.Z(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},y[new c.Z(e.overscaledZ,g,n.z,f,n.y-1).key]={backfilled:!1}),n.y+1<s&&(y[new c.Z(e.overscaledZ,d,n.z,l,n.y+1).key]={backfilled:!1},y[new c.Z(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},y[new c.Z(e.overscaledZ,g,n.z,f,n.y+1).key]={backfilled:!1}),y}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.t
5ype,uid:e.uid,source:this.id}}))}))}}class xn extends c.E{constructor(e,n,s,l){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:n.data},this.actor=s.getActor(),this.setEventedParent(l),this._data=n.data,this._options=c.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId,n.clusterMaxZoom!==void 0&&this.maxzoom<=n.clusterMaxZoom&&c.w('The maxzoom value "'.concat(this.maxzoom,'" is expected to be greater than the clusterMaxZoom value "').concat(n.clusterMaxZoom,'".')),this.workerOptions=c.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(n.buffer!==void 0?n.buffer:128),tolerance:this._pixelsToTileUnits(n.tolerance!==void 0?n.tolerance:.375),extent:c.$,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(n.clusterMaxZoom),minPoints:Math.max(2,n.clusterMinPoints||2),extent:c.$,radius:this._pixelsToTileUnits(n.clusterRadius||50),log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(c.$/this.tileSize)}_getClusterMaxZoom(e){const n=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||c.w("Integer expected for option 'clusterMaxZoom': provided value \"".concat(e,'" rounded to "').concat(n,'"')),n}load(){return c._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._pendingWorkerUpdate={data:e},this._updateWorkerData(),this}updateData(e){return this._pendingWorkerUpdate.diff=c.a0(this._pendingWorkerUpdate.diff,e),this._updateWorkerData(),this}getData(){return c._(this,void 0,void 0,(function*(){const e=c.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}getCoordinatesFromGeometry(e){return e.type==="GeometryCollection"?e.geometries.map((n=>n.coordinates)).flat(1/0):e.coordinates.flat(1/0)}getBounds(){return c._(this,void 0,void 0,(function*(){const e=new Dt,n=yield this.getData();let s;switch(n.type){case"FeatureCollection":s=n.features.map((l=>this.getCoordinatesFromGeometry(l.geometry))).flat(1/0);break;case"Feature":s=this.getCoordinatesFromGeometry(n.geometry);break;default:s=this.getCoordinatesFromGeometry(n)}if(s.length==0)return e;for(let l=0;l<s.length-1;l+=2)e.extend([s[l],s[l+1]]);return e}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMa
5xZoom))),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,n,s){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:n,offset:s}})}_updateWorkerData(){return c._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;const{data:e,diff:n}=this._pendingWorkerUpdate;if(!e&&!n)return void c.w("No data or diff provided to GeoJSONSource ".concat(this.id,"."));const s=c.e({type:this.type},this.workerOptions);e?(typeof e=="string"?(s.request=this.map._requestManager.transformRequest(Ze.resolveURL(e),"Source"),s.request.collectResourceTiming=this._collectResourceTiming):s.data=JSON.stringify(e),this._pendingWorkerUpdate.data=void 0):n&&(s.dataDiff=n,this._pendingWorkerUpdate.diff=void 0),this._isUpdatingWorker=!0,this.fire(new c.l("dataloading",{dataType:"source"}));try{const l=yield this.actor.sendAsync({type:"LD",data:s});if(this._isUpdatingWorker=!1,this._removed||l.abandoned)return void this.fire(new c.l("dataabort",{dataType:"source"}));this._data=l.data;let d=null;l.resourceTiming&&l.resourceTiming[this.id]&&(d=l.resourceTiming[this.id].slice(0));const f={dataType:"source"};this._collectResourceTiming&&d&&d.length>0&&c.e(f,{resourceTiming:d}),this.fire(new c.l("data",Object.assign(Object.assign({},f),{sourceDataType:"metadata"}))),this.fire(new c.l("data",Object.assign(Object.assign({},f),{sourceDataType:"content"})))}catch(l){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new c.l("dataabort",{dataType:"source"}));this.fire(new c.k(l))}finally{(this._pendingWorkerUpdate.data||this._pendingWorkerUpdate.diff)&&this._updateWorkerData()}}))}loaded(){return!this._isUpdatingWorker&&this._pendingWorkerUpdate.data===void 0&&this._pendingWorkerUpdate.diff===void 0}loadTile(e){return c._(this,void 0,void 0,(function*(){const n=e.actor?"RT":"LT";e.actor=this.actor;const s={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;const l=yield this.actor.sendAsync({type:n,data:s},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(l,this.map.painter,n==="RT")}))}abortTile(e){return c._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return c._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.t
vendor: 71,524 bytes, line 5
5ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class Fi extends c.E{constructor(e,n,s,l){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}load(e){return c._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new c.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield mi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,e&&(this.coordinates=e),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new c.k(n))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const n=e.map(c.a1.fromLngLat);var s;return this.tileID=(function(l){const d=c.a2.fromPoints(l),f=d.width(),g=d.height(),y=Math.max(f,g),b=Math.max(0,Math.floor(-Math.log(y)/Math.LN2)),w=Math.pow(2,b);return new c.a4(b,Math.floor((d.minX+d.maxX)/2*w),Math.floor((d.minY+d.maxY)/2*w))})(n),this.terrainTileRanges=this._getOverlappingTileRanges(n),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=n.map((l=>this.tileID.getTilePoint(l)._round())),this.flippedWindingOrder=((s=this.tileCoords)[1].x-s[0].x)*(s[2].y-s[0].y)-(s[1].y-s[0].y)*(s[2].x-s[0].x)<0,this.fire(new c.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,n=e.gl;this.texture||(this.texture=new c.T(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const l in this.tiles){const d=this.tiles[l];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture,s=!0)}s&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return c._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){const{minX:n,minY:s,maxX:l,maxY:d}=c.a2.fromPoints(e),f={};for(let g=0;g<=c.a3;g++){const y=Math.pow(2,g),b=Math.floor(n*y),w=Math.floor(s*y),S=Math.floor(l*y),P=Math.floor(d*y);f[g]={minTileX:b,minTileY:w,maxTileX:S,maxTileY:P}}return f}}class Xn extends Fi{constructor(e,n,s,l){super(e,n,s,l),this.roundZoom=!0,this.type="video",this.options=n}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const n of e.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield c.a5(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 c.k(n))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new c.k(new c.a6("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(n.start(0)," and ").concat(n.end(0),"-second mark.")))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,n=e.gl;this.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 c.T(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const l in this.tiles){const d=this.tiles[l];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture,s=!0)}s&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ca extends Fi{constructor(e,n,s,l){super(e,n,s,l),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((d=>!Array.isArray(d)||d.length!==2||d.some((f=>typeof f!="number"))))||this.fire(new c.k(new c.a6("sources.".concat(e),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.k(new c.a6("sources.".concat(e),null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new c.k(new c.a6("sources.".concat(e),null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new c.k(new c.a6("sources.".concat(e),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.k(new c.a6("sources.".concat(e),null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return c._(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 c.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const n=this.map.painter.context,s=n.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new c.T(n,this.canvas,s.RGBA,{premultiply:!0});let l=!1;for(const d in this.tiles){const f=this.tiles[d];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture,l=!0)}l&&this.fire(new c.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Yr={},Tr=h=>{switch(h){case"geojson":return xn;case"image":return Fi;case"raster":return wr;case"raster-dem":return yn;case"vector":return cr;case"video":return Xn;case"canvas":return Ca}return Yr[h]},vn="RTLPluginLoaded";class Ia extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=qn()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((n=>{throw this.status="error",n}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return c._(this,arguments,void 0,(function*(n,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Ze.resolveURL(n),!this.url)throw new Error("requested url ".concat(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 c._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.l(vn))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ki=null;function Kr(){return Ki||(Ki=new Ia),Ki}var Ji,Q;(function(h){h[h.Base=0]="Base",h[h.Parent=1]="Parent"})(Ji||(Ji={})),(function(h){h[h.Departing=0]="Departing",h[h.Incoming=1]="Incoming"})(Q||(Q={}));class A{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=c.a7(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:n,fadingParentID:s,fadeEndTime:l}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=n,this.fadingParentID=s,this.fadeEndTime=l}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Ze.now(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,n,s){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=(function(l,d){const f={};if(!d)return f;for(const g of l){const y=g.layerIds.map((b=>d.getLayer(b))).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map((b=>y.filter((w=>w.id===b))[0])));for(const b of y)f[b.id]=g}}return f})(e.buckets,n==null?void 0:n.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const d=this.buckets[l];if(d instanceof c.a9){if(this.hasSymbolBuckets=!0,!s)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const d=this.buckets[l];if(d instanceof c.a9&&d.hasRTLText){this.hasRTLText=!0,Kr().lazyLoad();break}}this.queryPadding=0;for(const l in this.buckets){const d=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(d))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new c.a8}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const s in this.buckets){const l=this.buckets[s];l.uploadPending()&&l.upload(e)}const n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new c.T(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new c.T(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,n,s,l,d,f,g,y,b,w,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:d,scale:f,tileSize:this.tileSize,pixelPosMatrix:w,transform:y,params:g,queryPadding:this.queryPadding*b,getElevation:S},e,n,s):{}}querySourceFeatures(e,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const l=s.loadVTLayers(),d=n&&n.sourceLayer?n.sourceLayer:"",f=l._geojsonTileLayer||l[d];if(!f)return;const g=c.aa(n==null?void 0:n.filter,n==null?void 0:n.globalState),{z:y,x:b,y:w}=this.tileID.canonical,S={z:y,x:b,y:w};for(let P=0;P<f.length;P++){const I=f.feature(P);if(g.needGeometry){const O=c.ab(I,!0);if(!g.filter(new c.F(this.tileID.overscaledZ),O,this.tileID.canonical))continue}else if(!g.filter(new c.F(this.tileID.overscaledZ),I))continue;const D=s.getId(I,d),B=new c.ac(I,y,b,w,D);B.tile=S,e.push(B)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const n=this.expirationTime;if(e.cacheControl){const s=c.ad(e.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const s=Date.now();let l=!1;if(this.expirationTime>s)l=!1;else if(n)if(this.expirationTime<n)l=!0;else{const d=this.expirationTime-n;d?this.expirationTime=s+Math.max(d,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const s=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!n.style.hasLayer(l))continue;const d=this.buckets[l],f=d.layers[0].sourceLayer||"_geojsonTileLayer",g=s[f],y=e[f];if(!g||!y||Object.keys(y).length===0)continue;d.update(y,g,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const b=n&&n.style&&n.style.getLayer(l);b&&(this.queryPadding=Math.max(this.queryPadding,b.queryRadius(d)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ze.now()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=Ze.now()+e}setDependencies(e,n){const s={};for(const l of n)s[l]=!0;this.dependencies[e]=s}hasDependency(e,n){for(const s of e){const l=this.dependencies[s];if(l){for(const d of n)if(l[d])return!0}}return!1}}class k{constructor(e,n){this.max=e,this.onRemove=n,this.reset()}reset(){for(const e in this.data)for(const n of this.data[e])n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);return this.data={},this.order=[],this}add(e,n,s){const l=e.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const d={value:n,timeout:void 0};if(s!==void 0&&(d.timeout=setTimeout((()=>{this.remove(e,d)}),s)),this.data[l].push(d),this.order.push(l),this.order.length>this.max){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const n=this.data[e].shift();return n.timeout&&clearTimeout(n.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),n.value}getByKey(e){const n=this.data[e];return n?n[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,n){if(!this.has(e))return this;const s=e.wrapped().key,l=n===void 0?0:this.data[s].indexOf(n),d=this.data[s][l];return this.data[s].splice(l,1),d.timeout&&clearTimeout(d.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(d.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(e){const n=[];for(const s in this.data)for(const l of this.data[s])e(l.value)||n.push(l);for(const s of n)this.remove(s.value.tileID,s)}}class F{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,s){const l=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][l]=this.stateChanges[e][l]||{},c.e(this.stateChanges[e][l],s),this.deletedStates[e]===null){this.deletedStates[e]={};for(const d in this.state[e])d!==l&&(this.deletedStates[e][d]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][l]===null){this.deletedStates[e][l]={};for(const d in this.state[e][l])s[d]||(this.deletedStates[e][l][d]=null)}else for(const d in s)this.deletedStates[e]&&this.deletedStates[e][l]&&this.deletedStates[e][l][d]===null&&delete this.deletedStates[e][l][d]}removeFeatureState(e,n,s){if(this.deletedStates[e]===null)return;const l=String(n);if(this.deletedStates[e]=this.deletedStates[e]||{},s&&n!==void 0)this.deletedStates[e][l]!==null&&(this.deletedStates[e][l]=this.deletedStates[e][l]||{},this.deletedStates[e][l][s]=null);else if(n!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][l])for(s in this.deletedStates[e][l]={},this.stateChanges[e][l])this.deletedStates[e][l][s]=null;else this.deletedStates[e][l]=null;else this.deletedStates[e]=null}getState(e,n){const s=String(n),l=c.e({},(this.state[e]||{})[s],(this.stateChanges[e]||{})[s]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const d=this.deletedStates[e][n];if(d===null)return{};for(const f in d)delete l[f]}return l}initializeTileState(e,n){e.setFeatureState(this.state,n)}coalesceChanges(e,n){const s={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const d={};for(const f in this.stateChanges[l])this.state[l][f]||(this.state[l][f]={}),c.e(this.state[l][f],this.stateChanges[l][f]),d[f]=this.state[l][f];s[l]=d}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const d={};if(this.deletedStates[l]===null)for(const f in this.state[l])d[f]={},this.state[l][f]={};else for(const f in this.deletedStates[l]){if(this.deletedStates[l][f]===null)this.state[l][f]={};else for(const g of Object.keys(this.deletedStates[l][f]))delete this.state[l][f][g];d[f]=this.state[l][f]}s[l]=s[l]||{},c.e(s[l],d)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const l in e)e[l].setFeatureState(s,n)}}const G=89.25;function X(h,e){const n=c.ah(e.lat,-c.ai,c.ai);return new c.P(c.V(e.lng)*h,c.U(n)*h)}function te(h,e){return new c.a1(e.x/h,e.y/h).toLngLat()}function ae(h){return h.cameraToCenterDistance*Math.min(.85*Math.tan(c.ae(90-h.pitch)),Math.tan(c.ae(G-h.pitch)))}function re(h,e){const n=h.canonical,s=e/c.af(n.z),l=n.x+Math.pow(2,n.z)*h.wrap,d=c.ag(new Float64Array(16));return c.M(d,d,[l*s,n.y*s,0]),c.N(d,d,[s/c.$,s/c.$,1]),d}function fe(h,e,n,s,l){const d=c.a1.fromLngLat(h,e),f=l*c.aj(1,h.lat),g=f*Math.cos(c.ae(n)),y=Math.sqrt(f*f-g*g),b=y*Math.sin(c.ae(-s)),w=y*Math.cos(c.ae(-s));return new c.a1(d.x+b,d.y+w,d.z+g)}function be(h,e,n){const s=e.intersectsFrustum(h);if(!n||s===0)return s;const l=e.intersectsPlane(n);return l===0?0:s===2&&l===2?2:1}function _e(h,e,n){let s=0;const l=(n-e)/10;for(let d=0;d<10;d++)s+=l*Math.pow(Math.cos(e+(d+.5)/10*(n-e)),h);return s}function De(h,e){return function(n,s,l,d,f){const g=2*((h-1)/c.ak(Math.cos(c.ae(G-f))/Math.cos(c.ae(G)))-1),y=Math.acos(l/d),b=2*_e(g-1,0,c.ae(f/2)),w=Math.min(c.ae(G),y+c.ae(f/2)),S=_e(g-1,Math.min(w,y-c.ae(f/2)),w),P=Math.atan(s/l),I=Math.hypot(s,l);let D=n;return D+=c.ak(d/I/Math.max(.5,Math.cos(c.ae(f/2)))),D+=g*c.ak(Math.cos(P))/2,D-=c.ak(Math.max(1,S/b/e))/2,D}}const Ve=De(9.314,3);function ne(h,e){const n=(e.roundZoom?Math.round:Math.floor)(h.zoom+c.ak(h.tileSize/e.tileSize));return Math.max(0,n)}function st(h,e){const n=h.getCameraFrustum(),s=h.getClippingPlane(),l=h.screenPointToMercatorCoordinate(h.getCameraPoint()),d=c.a1.fromLngLat(h.center,h.elevation);l.z=d.z+Math.cos(h.pitchInRadians)*h.cameraToCenterDistance/h.worldSize;const f=h.getCoveringTilesDetailsProvider(),g=f.allowVariableZoom(h,e),y=ne(h,e),b=e.minzoom||0,w=e.maxzoom!==void 0?e.maxzoom:h.maxZoom,S=Math.min(Math.max(0,y),w),P=Math.pow(2,S),I=[P*l.x,P*l.y,0],D=[P*d.x,P*d.y,0],B=Math.hypot(d.x-l.x,d.y-l.y),O=Math.abs(d.z-l.z),j=Math.hypot(B,O),N=W=>({zoom:0,x:0,y:0,wrap:W,fullyVisible:!1}),$=[],U=[];if(h.renderWorldCopies&&f.allowWorldCopies())for(let W=1;W<=3;W++)$.push(N(-W)),$.push(N(W));for($.push(N(0));$.length>0;){const W=$.pop(),K=W.x,Z=W.y;let ee=W.fullyVisible;const he={x:K,y:Z,z:W.zoom},se=f.getTileBoundingVolume(he,W.wrap,h.elevation,e);if(!ee){const Te=be(n,se,s);if(Te===0)continue;ee=Te===2}const le=f.distanceToTile2d(l.x,l.y,he,se);let ce=y;g&&(ce=(e.calculateTileZoom||Ve)(h.zoom+c.ak(h.tileSize/e.tileSize),le,O,j,h.fov)),ce=(e.roundZoom?Math.round:Math.floor)(ce),ce=Math.max(0,ce);const we=Math.min(ce,w);if(W.wrap=f.getWrap(d,he,W.wrap),W.zoom>=we){if(W.zoom<b)continue;const Te=S-W.zoom,ge=I[0]-.5-(K<<Te),ke=I[1]-.5-(Z<<Te),We=e.reparseOverscaled?Math.max(W.zoom,ce):W.zoom;U.push({tileID:new c.Z(W.zoom===w?We:W.zoom,W.wrap,W.zoom,K,Z),distanceSq:c.al([D[0]-.5-K,D[1]-.5-Z]),tileDistanceToCamera:Math.sqrt(ge*ge+ke*ke)})}else for(let Te=0;Te<4;Te++)$.push({zoom:W.zoom+1,x:(K<<1)+Te%2,y:(Z<<1)+(Te>>1),wrap:W.wrap,fullyVisible:ee})}return U.sort(((W,K)=>W.distanceSq-K.distanceSq)).map((W=>W.tileID))}const ct=c.a2.fromPoints([new c.P(0,0),new c.P(c.$,c.$)]);class Re extends c.E{constructor(e,n,s){super(),this.id=e,this.dispatcher=s,this.on("data",(l=>this._dataHandler(l))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((l,d,f,g)=>{const y=new(Tr(d.type))(l,d,f,g);if(y.id!==l)throw new Error("Expected Source id to be ".concat(l," instead of ").concat(y.id));return y})(e,n,s,this),this._tiles={},this._cache=new k(0,(l=>this._unloadTile(l))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new F,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const n=this._tiles[e];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,s){return c._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,s)}catch(l){e.state="errored",l.status!==404?this._source.fire(new c.k(l,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new c.l("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const s=this._tiles[n];s.upload(e),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(ot).map((e=>e.key))}getRenderableIds(e){const n=[];for(const s in this._tiles)this._isIdRenderable(s,e)&&n.push(this._tiles[s]);return e?n.sort(((s,l)=>{const d=s.tileID,f=l.tileID,g=new c.P(d.canonical.x,d.canonical.y)._rotate(-this.transform.bearingInRadians),y=new c.P(f.canonical.x,f.canonical.y)._rotate(-this.transform.bearingInRadians);return d.overscaledZ-f.overscaledZ||y.y-g.y||y.x-g.x})).map((s=>s.tileID.key)):n.map((s=>s.tileID)).sort(ot).map((s=>s.key))}hasRenderableParent(e){const n=e.overscaledZ-1;if(n>=this._source.minzoom){const s=this._getLoadedTile(e.scaledTo(n));if(s)return this._isIdRenderable(s.tileID.key)}return!1}_isIdRenderable(e,n=!1){var s;return(s=this._tiles[e])===null||s===void 0?void 0:s.isRenderable(n)}reload(e){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const n in this._tiles)e?this._reloadTile(n,"expired"):this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")}}_reloadTile(e,n){return c._(this,void 0,void 0,(function*(){const s=this._tiles[e];s&&(s.state!=="loading"&&(s.state=n),yield this._loadTile(s,e,n))}))}_tileLoaded(e,n,s){e.timeAdded=Ze.now(),s==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new c.l("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const n=this.getRenderableIds();for(let l=0;l<n.length;l++){const d=n[l];if(e.neighboringTiles&&e.neighboringTiles[d]){const f=this.getTileByID(d);s(e,f),s(f,e)}}function s(l,d){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let f=d.tileID.canonical.x-l.tileID.canonical.x;const g=d.tileID.canonical.y-l.tileID.canonical.y,y=Math.pow(2,l.tileID.canonical.z),b=d.tileID.key;f===0&&g===0||Math.abs(g)>1||(Math.abs(f)>1&&(Math.abs(f+y)===1?f+=y:Math.abs(f-y)===1&&(f-=y)),d.dem&&l.dem&&(l.dem.backfillBorder(d.dem,f,g),l.neighboringTiles&&l.neighboringTiles[b]&&(l.neighboringTiles[b].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,n){const s=Object.values(e),l=this._getLoadedDescendents(s),d={};for(const f of s){const g=l[f.key];if(!(g!=null&&g.length)){d[f.key]=f;continue}const y=f.overscaledZ+Re.maxUnderzooming,b=g.filter((P=>P.tileID.overscaledZ<=y));if(!b.length){d[f.key]=f;continue}const w=Math.min(...b.map((P=>P.tileID.overscaledZ))),S=b.filter((P=>P.tileID.overscaledZ===w)).map((P=>P.tileID));for(const P of S)n[P.key]=P;this._areDescendentsComplete(S,w,f.overscaledZ)||(d[f.key]=f)}return d}_getLoadedDescendents(e){var n;const s={};for(const l in this._tiles){const d=this._tiles[l];if(d.hasData())for(const f of e)d.tileID.isChildOf(f)&&(s[n=f.key]||(s[n]=[])).push(d)}return s}_areDescendentsComplete(e,n,s){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===n:Math.pow(4,n-s)===e.length}_getLoadedTile(e){const n=this._tiles[e.key];return n!=null&&n.hasData()?n:null}updateCacheSize(e){const n=Math.ceil(e.width/this._source.tileSize)+1,s=Math.ceil(e.height/this._source.tileSize)+1,l=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(d)}handleWrapJump(e){const n=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,n){const s={};for(const l in this._tiles){const d=this._tiles[l];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),s[d.tileID.key]=d}this._tiles=s;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(e,n){if(!this._sourceLoaded||this._paused)return;let s;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((y=>new c.Z(y.canonical.z,y.wrap,y.canonical.z,y.canonical.x,y.canonical.y))):(s=st(e,{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,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(s=s.filter((y=>this._source.hasTile(y))))):s=[],this.usedForTerrain&&(s=this._addTerrainIdealTiles(s));const l=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,l&&this.fire(new c.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const d=ne(e,this._source),f=this._updateRetainedTiles(s,d),g=Gt(this._source.type);g&&this._rasterFadeDuration>0&&!n&&this._updateFadingTiles(s,f),g?this._cleanUpRasterTiles(f):this._cleanUpVectorTiles(f)}_cleanUpRasterTiles(e){for(const n in this._tiles)e[n]||this._removeTile(n)}_cleanUpVectorTiles(e){for(const n in this._tiles){const s=this._tiles[n];e[n]?s.clearSymbolFadeHold():s.hasSymbolBuckets?s.holdingForSymbolFade()?s.symbolFadeFinished()&&this._removeTile(n):s.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(n)}}_addTerrainIdealTiles(e){const n=[];for(const s of e)if(s.canonical.z>this._source.minzoom){const l=s.scaledTo(s.canonical.z-1);n.push(l);const d=s.scaledTo(Math.max(this._source.minzoom,Math.min(s.canonical.z,5)));n.push(d)}return e.concat(n)}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,n){var s;const l={},d={},f=Math.max(n-Re.maxOverzooming,this._source.minzoom);let g={};for(const y of e){const b=this._addTile(y);l[y.key]=y,b.hasData()||(g[y.key]=y)}g=this._retainLoadedChildren(g,l);for(const y in g){const b=g[y];let w=this._tiles[y],S=w==null?void 0:w.wasRequested();for(let P=b.overscaledZ-1;P>=f;--P){const I=b.scaledTo(P);if(d[I.key])break;if(d[I.key]=!0,w=this.getTile(I),!w&&S&&(w=this._addTile(I)),w){const D=w.hasData();if((D||!(!((s=this.map)===null||s===void 0)&&s.cancelPendingTileRequestsWhileZooming)||S)&&(l[I.key]=I),S=w.wasRequested(),D)break}}}return l}_updateFadingTiles(e,n){const s=Ze.now(),l=c.am(e);for(const d of e){const f=this._tiles[d.key];f.fadingDirection!==Q.Departing&&f.fadeOpacity!==0||f.resetFadeLogic(),this._updateFadingAncestor(f,n,s)||this._updateFadingDescendents(f,n,s)||this._updateFadingEdge(f,l,s)||f.resetFadeLogic()}}_updateFadingAncestor(e,n,s){if(!e.hasData())return!1;const{tileID:l,fadingRole:d,fadingDirection:f,fadingParentID:g}=e;if(d===Ji.Base&&f===Q.Incoming&&g)return n[g.key]=g,!0;const y=Math.max(l.overscaledZ-this._maxFadingAncestorLevels,this._source.minzoom);for(let b=l.overscaledZ-1;b>=y;b--){const w=l.scaledTo(b),S=this._getLoadedTile(w);if(S)return e.setCrossFadeLogic({fadingRole:Ji.Base,fadingDirection:Q.Incoming,fadingParentID:S.tileID,fadeEndTime:s+this._rasterFadeDuration}),S.setCrossFadeLogic({fadingRole:Ji.Parent,fadingDirection:Q.Departing,fadeEndTime:s+this._rasterFadeDuration}),n[w.key]=w,!0}return!1}_updateFadingDescendents(e,n,s){if(!e.hasData())return!1;const l=e.tileID.children(this._source.maxzoom);let d=this._updateFadingChildren(e,l,n,s);if(d)return!0;for(const f of l){const g=f.children(this._source.maxzoom);this._updateFadingChildren(e,g,n,s)&&(d=!0)}return d}_updateFadingChildren(e,n,s,l){if(n[0].overscaledZ>=this._source.maxzoom)return!1;let d=!1;for(const f of n){const g=this._getLoadedTile(f);if(!g)continue;const{fadingRole:y,fadingDirection:b,fadingParentID:w}=g;y===Ji.Base&&b===Q.Departing&&w||(g.setCrossFadeLogic({fadingRole:Ji.Base,fadingDirection:Q.Departing,fadingParentID:e.tileID,fadeEndTime:l+this._rasterFadeDuration}),e.setCrossFadeLogic({fadingRole:Ji.Parent,fadingDirection:Q.Incoming,fadeEndTime:l+this._rasterFadeDuration})),s[f.key]=f,d=!0}return d}_updateFadingEdge(e,n,s){const l=e.tileID;return!!e.selfFading||!e.hasData()&&!!n.has(l)&&(e.setSelfFadeLogic(s+this._rasterFadeDuration),!0)}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(n.resetFadeLogic(),this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));const s=n;return n||(n=new A(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,s||this._source.fire(new c.l("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(e,n){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const s=n.getExpiryTimeout();s&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),s))}refreshTiles(e){for(const n in this._tiles)(this._isIdRenderable(n)||this._tiles[n].state=="errored")&&e.some((s=>s.equals(this._tiles[n].tileID.canonical)))&&this._reloadTile(n,"expired")}_removeTile(e){const n=this._tiles[e];n&&(n.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(e){e.dataType==="source"&&(e.sourceDataType!=="metadata"?e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,s){const l=[],d=this.transform;if(!d)return l;const f=d.getCoveringTilesDetailsProvider().allowWorldCopies(),g=s?d.getCameraQueryGeometry(e):e,y=I=>d.screenPointToMercatorCoordinate(I,this.terrain),b=this.transformBbox(e,y,!f),w=this.transformBbox(g,y,!f),S=this.getIds(),P=c.a2.fromPoints(w);for(let I=0;I<S.length;I++){const D=this._tiles[S[I]];if(D.holdingForSymbolFade())continue;const B=f?[D.tileID]:[D.tileID.unwrapTo(-1),D.tileID.unwrapTo(0)],O=Math.pow(2,d.zoom-D.tileID.overscaledZ),j=n*D.queryPadding*c.$/D.tileSize/O;for(const N of B){const $=P.map((U=>N.getTilePoint(new c.a1(U.x,U.y))));if($.expandBy(j),$.intersects(ct)){const U=b.map((K=>N.getTilePoint(K))),W=w.map((K=>N.getTilePoint(K)));l.push({tile:D,tileID:f?N:N.unwrapTo(0),queryGeometry:U,cameraQueryGeometry:W,scale:O})}}}return l}transformBbox(e,n,s){let l=e.map(n);if(s){const d=c.a2.fromPoints(e);d.shrinkBy(.001*Math.min(d.width(),d.height()));const f=d.map(n);c.a2.fromPoints(l).covers(f)||(l=l.map((g=>g.x>.5?new c.a1(g.x-1,g.y,g.z):g)))}return l}getVisibleCoordinates(e){const n=this.getRenderableIds(e).map((s=>this._tiles[s].tileID));return this.transform&&this.transform.populateCache(n),n}hasTransition(){if(this._source.hasTransition())return!0;if(Gt(this._source.type)&&this._rasterFadeDuration>0){const e=Ze.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=e)return!0}return!1}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,n,s){this._state.updateState(e=e||"_geojsonTileLayer",n,s)}removeFeatureState(e,n,s){this._state.removeFeatureState(e=e||"_geojsonTileLayer",n,s)}getFeatureState(e,n){return this._state.getState(e=e||"_geojsonTileLayer",n)}setDependencies(e,n,s){const l=this._tiles[e];l&&l.setDependencies(n,s)}reloadTilesForDependencies(e,n){for(const s in this._tiles)this._tiles[s].hasDependency(e,n)&&this._reloadTile(s,"reloading");this._cache.filter((s=>!s.hasDependency(e,n)))}}function ot(h,e){const n=Math.abs(2*h.wrap)-+(h.wrap<0),s=Math.abs(2*e.wrap)-+(e.wrap<0);return h.overscaledZ-e.overscaledZ||s-n||e.canonical.y-h.canonical.y||e.canonical.x-h.canonical.x}function Gt(h){return h==="raster"||h==="image"||h==="video"}Re.maxOverzooming=10,Re.maxUnderzooming=3;class qt{constructor(e,n){this.reset(e,n)}reset(e,n){this.points=e||[],this._distances=[0];for(let s=1;s<this.points.length;s++)this._distances[s]=this._distances[s-1]+this.points[s].dist(this.points[s-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=c.ah(e,0,1);let n=1,s=this._distances[n];const l=e*this.paddedLength+this.padding;for(;s<l&&n<this._distances.length;)s=this._distances[++n];const d=n-1,f=this._distances[d],g=s-f,y=g>0?(l-f)/g:0;return this.points[d].mult(1-y).add(this.points[n].mult(y))}}function $t(h,e){let n=!0;return h==="always"||h!=="never"&&e!=="never"||(n=!1),n}class li{constructor(e,n,s){const l=this.boxCells=[],d=this.circleCells=[];this.xCellCount=Math.ceil(e/s),this.yCellCount=Math.ceil(n/s);for(let f=0;f<this.xCellCount*this.yCellCount;f++)l.push([]),d.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=n,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,n,s,l,d){this._forEachCell(n,s,l,d,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(l),this.bboxes.push(d)}insertCircle(e,n,s,l){this._forEachCell(n-l,s-l,n+l,s+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(n),this.circles.push(s),this.circles.push(l)}_insertBoxCell(e,n,s,l,d,f){this.boxCells[d].push(f)}_insertCircleCell(e,n,s,l,d,f){this.circleCells[d].push(f)}_query(e,n,s,l,d,f,g){if(s<0||e>this.width||l<0||n>this.height)return[];const y=[];if(e<=0&&n<=0&&this.width<=s&&this.height<=l){if(d)return[{key:null,x1:e,y1:n,x2:s,y2:l}];for(let b=0;b<this.boxKeys.length;b++)y.push({key:this.boxKeys[b],x1:this.bboxes[4*b],y1:this.bboxes[4*b+1],x2:this.bboxes[4*b+2],y2:this.bboxes[4*b+3]});for(let b=0;b<this.circleKeys.length;b++){const w=this.circles[3*b],S=this.circles[3*b+1],P=this.circles[3*b+2];y.push({key:this.circleKeys[b],x1:w-P,y1:S-P,x2:w+P,y2:S+P})}}else this._forEachCell(e,n,s,l,this._queryCell,y,{hitTest:d,overlapMode:f,seenUids:{box:{},circle:{}}},g);return y}query(e,n,s,l){return this._query(e,n,s,l,!1,null)}hitTest(e,n,s,l,d,f){return this._query(e,n,s,l,!0,d,f).length>0}hitTestCircle(e,n,s,l,d){const f=e-s,g=e+s,y=n-s,b=n+s;if(g<0||f>this.width||b<0||y>this.height)return!1;const w=[];return this._forEachCell(f,y,g,b,this._queryCellCircle,w,{hitTest:!0,overlapMode:l,circle:{x:e,y:n,radius:s},seenUids:{box:{},circle:{}}},d),w.length>0}_queryCell(e,n,s,l,d,f,g,y){const{seenUids:b,hitTest:w,overlapMode:S}=g,P=this.boxCells[d];if(P!==null){const D=this.bboxes;for(const B of P)if(!b.box[B]){b.box[B]=!0;const O=4*B,j=this.boxKeys[B];if(e<=D[O+2]&&n<=D[O+3]&&s>=D[O+0]&&l>=D[O+1]&&(!y||y(j))&&(!w||!$t(S,j.overlapMode))&&(f.push({key:j,x1:D[O],y1:D[O+1],x2:D[O+2],y2:D[O+3]}),w))return!0}}const I=this.circleCells[d];if(I!==null){const D=this.circles;for(const B of I)if(!b.circle[B]){b.circle[B]=!0;const O=3*B,j=this.circleKeys[B];if(this._circleAndRectCollide(D[O],D[O+1],D[O+2],e,n,s,l)&&(!y||y(j))&&(!w||!$t(S,j.overlapMode))){const N=D[O],$=D[O+1],U=D[O+2];if(f.push({key:j,x1:N-U,y1:$-U,x2:N+U,y2:$+U}),w)return!0}}}return!1}_queryCellCircle(e,n,s,l,d,f,g,y){const{circle:b,seenUids:w,overlapMode:S}=g,P=this.boxCells[d];if(P!==null){const D=this.bboxes;for(const B of P)if(!w.box[B]){w.box[B]=!0;const O=4*B,j=this.boxKeys[B];if(this._circleAndRectCollide(b.x,b.y,b.radius,D[O+0],D[O+1],D[O+2],D[O+3])&&(!y||y(j))&&!$t(S,j.overlapMode))return f.push(!0),!0}}const I=this.circleCells[d];if(I!==null){const D=this.circles;for(const B of I)if(!w.circle[B]){w.circle[B]=!0;const O=3*B,j=this.circleKeys[B];if(this._circlesCollide(D[O],D[O+1],D[O+2],b.x,b.y,b.radius)&&(!y||y(j))&&!$t(S,j.overlapMode))return f.push(!0),!0}}}_forEachCell(e,n,s,l,d,f,g,y){const b=this._convertToXCellCoord(e),w=this._convertToYCellCoord(n),S=this._convertToXCellCoord(s),P=this._convertToYCellCoord(l);for(let I=b;I<=S;I++)for(let D=w;D<=P;D++)if(d.call(this,e,n,s,l,this.xCellCount*D+I,f,g,y))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,n,s,l,d,f){const g=l-e,y=d-n,b=s+f;return b*b>g*g+y*y}_circleAndRectCollide(e,n,s,l,d,f,g){const y=(f-l)/2,b=Math.abs(e-(l+y));if(b>y+s)return!1;const w=(g-d)/2,S=Math.abs(n-(d+w));if(S>w+s)return!1;if(b<=y||S<=w)return!0;const P=b-y,I=S-w;return P*P+I*I<=s*s}}function gt(h,e,n){const s=c.L();if(!h){const{vecSouth:S,vecEast:P}=ht(e),I=Bt();I[0]=P[0],I[1]=P[1],I[2]=S[0],I[3]=S[1],l=I,(w=(f=(d=I)[0])*(b=d[3])-(y=d[2])*(g=d[1]))&&(l[0]=b*(w=1/w),l[1]=-g*w,l[2]=-y*w,l[3]=f*w),s[0]=I[0],s[1]=I[1],s[4]=I[2],s[5]=I[3]}var l,d,f,g,y,b,w;return c.N(s,s,[1/n,1/n,1]),s}function Wt(h,e,n,s){if(h){const l=c.L();if(!e){const{vecSouth:d,vecEast:f}=ht(n);l[0]=f[0],l[1]=f[1],l[4]=d[0],l[5]=d[1]}return c.N(l,l,[s,s,1]),l}return n.pixelsToClipSpaceMatrix}function ht(h){const e=Math.cos(h.rollInRadians),n=Math.sin(h.rollInRadians),s=Math.cos(h.pitchInRadians),l=Math.cos(h.bearingInRadians),d=Math.sin(h.bearingInRadians),f=c.ar();f[0]=-l*s*n-d*e,f[1]=-d*s*n+l*e;const g=c.as(f);g<1e-9?c.at(f):c.au(f,f,1/g);const y=c.ar();y[0]=l*s*e-d*n,y[1]=d*s*e+l*n;const b=c.as(y);return b<1e-9?c.at(y):c.au(y,y,1/b),{vecEast:y,vecSouth:f}}function ve(h,e,n,s){let l;s?(l=[h,e,s(h,e),1],c.aw(l,l,n)):(l=[h,e,0,1],wn(l,l,n));const d=l[3];return{point:new c.P(l[0]/d,l[1]/d),signedDistanceFromCamera:d,isOccluded:!1}}function Pr(h,e){return .5+h/e*.5}function Bi(h,e){return h.x>=-e[0]&&h.x<=e[0]&&h.y>=-e[1]&&h.y<=e[1]}function Oi(h,e,n,s,l,d,f,g,y,b,w,S,P){const I=n?h.textSizeData:h.iconSizeData,D=c.an(I,e.transform.zoom),B=[256/e.width*2+1,256/e.height*2+1],O=n?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;O.clear();const j=h.lineVertexArray,N=n?h.text.placedSymbolArray:h.icon.placedSymbolArray,$=e.transform.width/e.transform.height;let U=!1;for(let W=0;W<N.length;W++){const K=N.get(W);if(K.hidden||K.writingMode===c.ao.vertical&&!U){Dr(K.numGlyphs,O);continue}U=!1;const Z=new c.P(K.anchorX,K.anchorY),ee={getElevation:P,pitchedLabelPlaneMatrix:s,lineVertexArray:j,pitchWithMap:d,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:Z,unwrappedTileID:y,width:b,height:w,translation:S},he=He(K.anchorX,K.anchorY,ee);if(!Bi(he.point,B)){Dr(K.numGlyphs,O);continue}const se=Pr(e.transform.cameraToCenterDistance,he.signedDistanceFromCamera),le=c.ap(I,D,K),ce=d?le*e.transform.getPitchedTextCorrection(K.anchorX,K.anchorY,y)/se:le*se,we=Ke({projectionContext:ee,pitchedLabelPlaneMatrixInverse:l,symbol:K,fontSize:ce,flip:!1,keepUpright:f,glyphOffsetArray:h.glyphOffsetArray,dynamicLayoutVertexArray:O,aspectRatio:$,rotateToLine:g});U=we.useVertical,(we.notEnoughRoom||U||we.needsFlipping&&Ke({projectionContext:ee,pitchedLabelPlaneMatrixInverse:l,symbol:K,fontSize:ce,flip:!0,keepUpright:f,glyphOffsetArray:h.glyphOffsetArray,dynamicLayoutVertexArray:O,aspectRatio:$,rotateToLine:g}).notEnoughRoom)&&Dr(K.numGlyphs,O)}n?h.text.dynamicLayoutVertexBuffer.updateData(O):h.icon.dynamicLayoutVertexBuffer.updateData(O)}function Ht(h,e,n,s,l,d,f,g){const y=d.glyphStartIndex+d.numGlyphs,b=d.lineStartIndex,w=d.lineStartIndex+d.lineLength,S=e.getoffsetX(d.glyphStartIndex),P=e.getoffsetX(y-1),I=bn(h*S,n,s,l,d.segment,b,w,g,f);if(!I)return null;const D=bn(h*P,n,s,l,d.segment,b,w,g,f);return D?g.projectionCache.anyProjectionOccluded?null:{first:I,last:D}:null}function Me(h,e,n,s){return h===c.ao.horizontal&&Math.abs(n.y-e.y)>Math.abs(n.x-e.x)*s?{useVertical:!0}:(h===c.ao.vertical?e.y<n.y:e.x>n.x)?{needsFlipping:!0}:null}function Ke(h){const{projectionContext:e,pitchedLabelPlaneMatrixInverse:n,symbol:s,fontSize:l,flip:d,keepUpright:f,glyphOffsetArray:g,dynamicLayoutVertexArray:y,aspectRatio:b,rotateToLine:w}=h,S=l/24,P=s.lineOffsetX*S,I=s.lineOffsetY*S;let D;if(s.numGlyphs>1){const B=s.glyphStartIndex+s.numGlyphs,O=s.lineStartIndex,j=s.lineStartIndex+s.lineLength,N=Ht(S,g,P,I,d,s,w,e);if(!N)return{notEnoughRoom:!0};const $=Mr(N.first.point.x,N.first.point.y,e,n),U=Mr(N.last.point.x,N.last.point.y,e,n);if(f&&!d){const W=Me(s.writingMode,$,U,b);if(W)return W}D=[N.first];for(let W=s.glyphStartIndex+1;W<B-1;W++){const K=bn(S*g.getoffsetX(W),P,I,d,s.segment,O,j,e,w);if(!K)return{notEnoughRoom:!0};D.push(K)}D.push(N.last)}else{if(f&&!d){const O=Sr(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,j=s.lineStartIndex+s.segment+1,N=new c.P(e.lineVertexArray.getx(j),e.lineVertexArray.gety(j)),$=Sr(N.x,N.y,e),U=$.signedDistanceFromCamera>0?$.point:Ye(e.tileAnchorPoint,N,O,1,e),W=Mr(O.x,O.y,e,n),K=Mr(U.x,U.y,e,n),Z=Me(s.writingMode,W,K,b);if(Z)return Z}const B=bn(S*g.getoffsetX(s.glyphStartIndex),P,I,d,s.segment,s.lineStartIndex,s.lineStartIndex+s.lineLength,e,w);if(!B||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};D=[B]}for(const B of D)c.av(y,B.point,B.angle);return{}}function Ye(h,e,n,s,l){const d=h.add(h.sub(e)._unit()),f=Sr(d.x,d.y,l).point,g=n.sub(f);return n.add(g._mult(s/g.mag()))}function ji(h,e,n){const s=e.projectionCache;if(s.projections[h])return s.projections[h];const l=new c.P(e.lineVertexArray.getx(h),e.lineVertexArray.gety(h)),d=Sr(l.x,l.y,e);if(d.signedDistanceFromCamera>0)return s.projections[h]=d.point,s.anyProjectionOccluded=s.anyProjectionOccluded||d.isOccluded,d.point;const f=h-n.direction;return Ye(n.distanceFromAnchor===0?e.tileAnchorPoint:new c.P(e.lineVertexArray.getx(f),e.lineVertexArray.gety(f)),l,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,e)}function Sr(h,e,n){const s=h+n.translation[0],l=e+n.translation[1];let d;return n.pitchWithMap?(d=ve(s,l,n.pitchedLabelPlaneMatrix,n.getElevation),d.isOccluded=!1):(d=n.transform.projectTileCoordinates(s,l,n.unwrappedTileID,n.getElevation),d.point.x=(.5*d.point.x+.5)*n.width,d.point.y=(.5*-d.point.y+.5)*n.height),d}function Mr(h,e,n,s){if(n.pitchWithMap){const l=[h,e,0,1];return c.aw(l,l,s),n.transform.projectTileCoordinates(l[0]/l[3],l[1]/l[3],n.unwrappedTileID,n.getElevation).point}return{x:h/n.width*2-1,y:1-e/n.height*2}}function He(h,e,n){return n.transform.projectTileCoordinates(h,e,n.unwrappedTileID,n.getElevation)}function Yn(h,e,n){return h._unit()._perp()._mult(e*n)}function za(h,e,n,s,l,d,f,g,y){if(g.projectionCache.offsets[h])return g.projectionCache.offsets[h];const b=n.add(e);if(h+y.direction<s||h+y.direction>=l)return g.projectionCache.offsets[h]=b,b;const w=ji(h+y.direction,g,y),S=Yn(w.sub(n),f,y.direction),P=n.add(S),I=w.add(S);return g.projectionCache.offsets[h]=c.ax(d,b,P,I)||b,g.projectionCache.offsets[h]}function bn(h,e,n,s,l,d,f,g,y){const b=s?h-e:h+e;let w=b>0?1:-1,S=0;s&&(w*=-1,S=Math.PI),w<0&&(S+=Math.PI);let P,I=w>0?d+l:d+l+1;g.projectionCache.cachedAnchorPoint?P=g.projectionCache.cachedAnchorPoint:(P=Sr(g.tileAnchorPoint.x,g.tileAnchorPoint.y,g).point,g.projectionCache.cachedAnchorPoint=P);let D,B,O=P,j=P,N=0,$=0;const U=Math.abs(b),W=[];let K;for(;N+$<=U;){if(I+=w,I<d||I>=f)return null;N+=$,j=O,B=D;const he={absOffsetX:U,direction:w,distanceFromAnchor:N,previousVertex:j};if(O=ji(I,g,he),n===0)W.push(j),K=O.sub(j);else{let se;const le=O.sub(j);se=le.mag()===0?Yn(ji(I+w,g,he).sub(O),n,w):Yn(le,n,w),B||(B=j.add(se)),D=za(I,se,O,d,f,B,n,g,he),W.push(B),K=D.sub(B)}$=K.mag()}const Z=K._mult((U-N)/$)._add(B||j),ee=S+Math.atan2(O.y-j.y,O.x-j.x);return W.push(Z),{point:Z,angle:y?ee:0,path:W}}const Ea=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dr(h,e){for(let n=0;n<h;n++){const s=e.length;e.resize(s+4),e.float32.set(Ea,3*s)}}function wn(h,e,n){const s=e[0],l=e[1];return h[0]=n[0]*s+n[4]*l+n[12],h[1]=n[1]*s+n[5]*l+n[13],h[3]=n[3]*s+n[7]*l+n[15],h}const jt=100;class Vi{constructor(e,n=new li(e.width+200,e.height+200,25),s=new li(e.width+200,e.height+200,25)){this.transform=e,this.grid=n,this.ignoredGrid=s,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+jt,this.screenBottomBoundary=e.height+jt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,n,s,l,d,f,g,y,b,w,S,P){const I=this.projectAndGetPerspectiveRatio(e.anchorPointX+y[0],e.anchorPointY+y[1],d,w,P),D=s*I.perspectiveRatio;let B;if(f||g)B=this._projectCollisionBox(e,D,l,d,f,g,y,I,w,S,P);else{const K=I.x+(S?S.x*D:0),Z=I.y+(S?S.y*D:0);B={allPointsOccluded:!1,box:[K+e.x1*D,Z+e.y1*D,K+e.x2*D,Z+e.y2*D]}}const[O,j,N,$]=B.box,U=f?B.allPointsOccluded:I.isOccluded;let W=U;return W||(W=I.perspectiveRatio<this.perspectiveRatioCutoff),W||(W=!this.isInsideGrid(O,j,N,$)),W||n!=="always"&&this.grid.hitTest(O,j,N,$,n,b)?{box:[O,j,N,$],placeable:!1,offscreen:!1,occluded:U}:{box:[O,j,N,$],placeable:!0,offscreen:this.isOffscreen(O,j,N,$),occluded:U}}placeCollisionCircles(e,n,s,l,d,f,g,y,b,w,S,P,I,D){const B=[],O=new c.P(n.anchorX,n.anchorY),j=this.getPerspectiveRatio(O.x,O.y,f,D),N=(b?d*this.transform.getPitchedTextCorrection(n.anchorX,n.anchorY,f)/j:d*j)/c.aB,$={getElevation:D,pitchedLabelPlaneMatrix:g,lineVertexArray:s,pitchWithMap:b,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:O,unwrappedTileID:f,width:this.transform.width,height:this.transform.height,translation:I},U=Ht(N,l,n.lineOffsetX*N,n.lineOffsetY*N,!1,n,!1,$);let W=!1,K=!1,Z=!0;if(U){const ee=.5*S*j+P,he=new c.P(-100,-100),se=new c.P(this.screenRightBoundary,this.screenBottomBoundary),le=new qt,ce=U.first,we=U.last;let Te=[];for(let We=ce.path.length-1;We>=1;We--)Te.push(ce.path[We]);for(let We=1;We<we.path.length;We++)Te.push(we.path[We]);const ge=2.5*ee;if(b){const We=this.projectPathToScreenSpace(Te,$);Te=We.some((ut=>ut.signedDistanceFromCamera<=0))?[]:We.map((ut=>ut.point))}let ke=[];if(Te.length>0){const We=Te[0].clone(),ut=Te[0].clone();for(let dt=1;dt<Te.length;dt++)We.x=Math.min(We.x,Te[dt].x),We.y=Math.min(We.y,Te[dt].y),ut.x=Math.max(ut.x,Te[dt].x),ut.y=Math.max(ut.y,Te[dt].y);ke=We.x>=he.x&&ut.x<=se.x&&We.y>=he.y&&ut.y<=se.y?[Te]:ut.x<he.x||We.x>se.x||ut.y<he.y||We.y>se.y?[]:c.ay([Te],he.x,he.y,se.x,se.y)}for(const We of ke){le.reset(We,.25*ee);let ut=0;ut=le.length<=.5*ee?1:Math.ceil(le.paddedLength/ge)+1;for(let dt=0;dt<ut;dt++){const _t=dt/Math.max(ut-1,1),Ct=le.lerp(_t),xt=Ct.x+jt,at=Ct.y+jt;B.push(xt,at,ee,0);const St=xt-ee,ui=at-ee,Vt=xt+ee,Nt=at+ee;if(Z=Z&&this.isOffscreen(St,ui,Vt,Nt),K=K||this.isInsideGrid(St,ui,Vt,Nt),e!=="always"&&this.grid.hitTestCircle(xt,at,ee,e,w)&&(W=!0,!y))return{circles:[],offscreen:!1,collisionDetected:W}}}}return{circles:!y&&W||!K||j<this.perspectiveRatioCutoff?[]:B,offscreen:Z,collisionDetected:W}}projectPathToScreenSpace(e,n){const s=(function(l,d){const f=c.L();return c.aq(f,d.pitchedLabelPlaneMatrix),l.map((g=>{const y=ve(g.x,g.y,f,d.getElevation),b=d.transform.projectTileCoordinates(y.point.x,y.point.y,d.unwrappedTileID,d.getElevation);return b.point.x=(.5*b.point.x+.5)*d.width,b.point.y=(.5*-b.point.y+.5)*d.height,b}))})(e,n);return(function(l){let d=0,f=0,g=0,y=0;for(let b=0;b<l.length;b++)l[b].isOccluded?(g=b+1,y=0):(y++,y>f&&(f=y,d=g));return l.slice(d,d+f)})(s)}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const n=[],s=new c.a2;for(const S of e){const P=new c.P(S.x+jt,S.y+jt);s.extend(P),n.push(P)}const{minX:l,minY:d,maxX:f,maxY:g}=s,y=this.grid.query(l,d,f,g).concat(this.ignoredGrid.query(l,d,f,g)),b={},w={};for(const S of y){const P=S.key;if(b[P.bucketInstanceId]===void 0&&(b[P.bucketInstanceId]={}),b[P.bucketInstanceId][P.featureIndex])continue;const I=[new c.P(S.x1,S.y1),new c.P(S.x2,S.y1),new c.P(S.x2,S.y2),new c.P(S.x1,S.y2)];c.az(n,I)&&(b[P.bucketInstanceId][P.featureIndex]=!0,w[P.bucketInstanceId]===void 0&&(w[P.bucketInstanceId]=[]),w[P.bucketInstanceId].push(P.featureIndex))}return w}insertCollisionBox(e,n,s,l,d,f){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:d,collisionGroupID:f,overlapMode:n},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,n,s,l,d,f){const g=s?this.ignoredGrid:this.grid,y={bucketInstanceId:l,featureIndex:d,collisionGroupID:f,overlapMode:n};for(let b=0;b<e.length;b+=4)g.insertCircle(y,e[b],e[b+1],e[b+2])}projectAndGetPerspectiveRatio(e,n,s,l,d){if(d){let f;l?(f=[e,n,l(e,n),1],c.aw(f,f,d)):(f=[e,n,0,1],wn(f,f,d));const g=f[3];return{x:(f[0]/g+1)/2*this.transform.width+jt,y:(-f[1]/g+1)/2*this.transform.height+jt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/g*.5,isOccluded:!1,signedDistanceFromCamera:g}}{const f=this.transform.projectTileCoordinates(e,n,s,l);return{x:(f.point.x+1)/2*this.transform.width+jt,y:(1-f.point.y)/2*this.transform.height+jt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/f.signedDistanceFromCamera*.5,isOccluded:f.isOccluded,signedDistanceFromCamera:f.signedDistanceFromCamera}}}getPerspectiveRatio(e,n,s,l){const d=this.transform.projectTileCoordinates(e,n,s,l);return .5+this.transform.cameraToCenterDistance/d.signedDistanceFromCamera*.5}isOffscreen(e,n,s,l){return s<jt||e>=this.screenRightBoundary||l<jt||n>this.screenBottomBoundary}isInsideGrid(e,n,s,l){return s>=0&&e<this.gridRightBoundary&&l>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const e=c.ag([]);return c.M(e,e,[-100,-100,0]),e}_projectCollisionBox(e,n,s,l,d,f,g,y,b,w,S){let P=1,I=0,D=0,B=1;const O=e.anchorPointX+g[0],j=e.anchorPointY+g[1];if(f&&!d){const Te=this.projectAndGetPerspectiveRatio(O+1,j,l,b,S),ge=Te.x-y.x,ke=Math.atan((Te.y-y.y)/ge)+(ge<0?Math.PI:0),We=Math.sin(ke),ut=Math.cos(ke);P=ut,I=We,D=-We,B=ut}else if(!f&&d){const Te=ht(this.transform);P=Te.vecEast[0],I=Te.vecEast[1],D=Te.vecSouth[0],B=Te.vecSouth[1]}let N=y.x,$=y.y,U=n;d&&(N=O,$=j,U=Math.pow(2,-(this.transform.zoom-s.overscaledZ)),U*=this.transform.getPitchedTextCorrection(O,j,l),w||(U*=c.ah(.5+y.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),w&&(N+=P*w.x*U+D*w.y*U,$+=I*w.x*U+B*w.y*U);const W=e.x1*U,K=e.x2*U,Z=(W+K)/2,ee=e.y1*U,he=e.y2*U,se=(ee+he)/2,le=[{offsetX:W,offsetY:ee},{offsetX:Z,offsetY:ee},{offsetX:K,offsetY:ee},{offsetX:K,offsetY:se},{offsetX:K,offsetY:he},{offsetX:Z,offsetY:he},{offsetX:W,offsetY:he},{offsetX:W,offsetY:se}];let ce=[];for(const{offsetX:Te,offsetY:ge}of le)ce.push(new c.P(N+P*Te+D*ge,$+I*Te+B*ge));let we=!1;if(d){const Te=ce.map((ge=>this.projectAndGetPerspectiveRatio(ge.x,ge.y,l,b,S)));we=Te.some((ge=>!ge.isOccluded)),ce=Te.map((ge=>new c.P(ge.x,ge.y)))}else we=!0;return{box:c.aA(ce),allPointsOccluded:!we}}}class Pt{constructor(e,n,s,l){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?n:-n))):l&&s?1:0,this.placed=s}isHidden(){return this.opacity===0&&!this.placed}}class Aa{constructor(e,n,s,l,d){this.text=new Pt(e?e.text:null,n,s,d),this.icon=new Pt(e?e.icon:null,n,l,d)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Kn{constructor(e,n,s){this.text=e,this.icon=n,this.skipFade=s}}class To{constructor(e,n,s,l,d){this.bucketInstanceId=e,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=l,this.tileID=d}}class Tn{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const n=++this.maxGroupID;this.collisionGroups[e]={ID:n,predicate:s=>s.collisionGroupID===n}}return this.collisionGroups[e]}}function Rr(h,e,n,s,l){const{horizontalAlign:d,verticalAlign:f}=c.aH(h);return new c.P(-(d-.5)*e+s[0]*l,-(f-.5)*n+s[1]*l)}class Dl{constructor(e,n,s,l,d){this.transform=e.clone(),this.terrain=n,this.collisionIndex=new Vi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new Tn(l),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const n=this.terrain;return n?(s,l)=>n.getElevation(e,s,l):null}getBucketParts(e,n,s,l){const d=s.getBucket(n),f=s.latestFeatureIndex;if(!d||!f||n.id!==d.layerIds[0])return;const g=s.collisionBoxArray,y=d.layers[0].layout,b=d.layers[0].paint,w=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),S=s.tileSize/c.$,P=s.tileID.toUnwrapped(),I=y.get("text-rotation-alignment")==="map",D=c.aC(s,1,this.transform.zoom),B=c.aD(this.collisionIndex.transform,s,b.get("text-translate"),b.get("text-translate-anchor")),O=c.aD(this.collisionIndex.transform,s,b.get("icon-translate"),b.get("icon-translate-anchor")),j=gt(I,this.transform,D);this.retainedQueryData[d.bucketInstanceId]=new To(d.bucketInstanceId,f,d.sourceLayerIndex,d.index,s.tileID);const N={bucket:d,layout:y,translationText:B,translationIcon:O,unwrappedTileID:P,pitchedLabelPlaneMatrix:j,scale:w,textPixelRatio:S,holdingForFade:s.holdingForSymbolFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:c.an(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(l)for(const $ of d.sortKeyRanges){const{sortKey:U,symbolInstanceStart:W,symbolInstanceEnd:K}=$;e.push({sortKey:U,symbolInstanceStart:W,symbolInstanceEnd:K,parameters:N})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:N})}attemptAnchorPlacement(e,n,s,l,d,f,g,y,b,w,S,P,I,D,B,O,j,N,$,U){const W=c.aE[e.textAnchor],K=[e.textOffset0,e.textOffset1],Z=Rr(W,s,l,K,d),ee=this.collisionIndex.placeCollisionBox(n,P,y,b,w,g,f,O,S.predicate,$,Z,U);if((!N||this.collisionIndex.placeCollisionBox(N,P,y,b,w,g,f,j,S.predicate,$,Z,U).placeable)&&ee.placeable){let he;if(this.prevPlacement&&this.prevPlacement.variableOffsets[I.crossTileID]&&this.prevPlacement.placements[I.crossTileID]&&this.prevPlacement.placements[I.crossTileID].text&&(he=this.prevPlacement.variableOffsets[I.crossTileID].anchor),I.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[I.crossTileID]={textOffset:K,width:s,height:l,anchor:W,textBoxScale:d,prevAnchor:he},this.markUsedJustification(D,W,I,B),D.allowVerticalPlacement&&(this.markUsedOrientation(D,B,I),this.placedOrientations[I.crossTileID]=B),{shift:Z,placedGlyphBoxes:ee}}}placeLayerBucketPart(e,n,s){const{bucket:l,layout:d,translationText:f,translationIcon:g,unwrappedTileID:y,pitchedLabelPlaneMatrix:b,textPixelRatio:w,holdingForFade:S,collisionBoxArray:P,partiallyEvaluatedTextSize:I,collisionGroup:D}=e.parameters,B=d.get("text-optional"),O=d.get("icon-optional"),j=c.aF(d,"text-overlap","text-allow-overlap"),N=j==="always",$=c.aF(d,"icon-overlap","icon-allow-overlap"),U=$==="always",W=d.get("text-rotation-alignment")==="map",K=d.get("text-pitch-alignment")==="map",Z=d.get("icon-text-fit")!=="none",ee=d.get("symbol-z-order")==="viewport-y",he=N&&(U||!l.hasIconData()||O),se=U&&(N||!l.hasTextData()||B);!l.collisionArrays&&P&&l.deserializeCollisionBoxes(P);const le=this.retainedQueryData[l.bucketInstanceId].tileID,ce=this._getTerrainElevationFunc(le),we=this.transform.getFastPathSimpleProjectionMatrix(le),Te=(ge,ke,We)=>{var ut,dt;if(n[ge.crossTileID])return;if(S)return void(this.placements[ge.crossTileID]=new Kn(!1,!1,!1));let _t=!1,Ct=!1,xt=!0,at=null,St={box:null,placeable:!1,offscreen:null,occluded:!1},ui={placeable:!1},Vt=null,Nt=null,Pi=null,an=0,fr=0,sn=0;ke.textFeatureIndex?an=ke.textFeatureIndex:ge.useRuntimeCollisionCircles&&(an=ge.featureIndex),ke.verticalTextFeatureIndex&&(fr=ke.verticalTextFeatureIndex);const Nn=ke.textBox;if(Nn){const Ui=Ft=>{let Yt=c.ao.horizontal;if(l.allowVerticalPlacement&&!Ft&&this.prevPlacement){const Zi=this.prevPlacement.placedOrientations[ge.crossTileID];Zi&&(this.placedOrientations[ge.crossTileID]=Zi,Yt=Zi,this.markUsedOrientation(l,Yt,ge))}return Yt},zr=(Ft,Yt)=>{if(l.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&ke.verticalTextBox){for(const Zi of l.writingModes)if(Zi===c.ao.vertical?(St=Yt(),ui=St):St=Ft(),St&&St.placeable)break}else St=Ft()},Er=ge.textAnchorOffsetStartIndex,$i=ge.textAnchorOffsetEndIndex;if($i===Er){const Ft=(Yt,Zi)=>{const ii=this.collisionIndex.placeCollisionBox(Yt,j,w,le,y,K,W,f,D.predicate,ce,void 0,we);return ii&&ii.placeable&&(this.markUsedOrientation(l,Zi,ge),this.placedOrientations[ge.crossTileID]=Zi),ii};zr((()=>Ft(Nn,c.ao.horizontal)),(()=>{const Yt=ke.verticalTextBox;return l.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&Yt?Ft(Yt,c.ao.vertical):{box:null,offscreen:null}})),Ui(St&&St.placeable)}else{let Ft=c.aE[(dt=(ut=this.prevPlacement)===null||ut===void 0?void 0:ut.variableOffsets[ge.crossTileID])===null||dt===void 0?void 0:dt.anchor];const Yt=(ii,pl,os)=>{const Un=ii.x2-ii.x1,jr=ii.y2-ii.y1,mr=ge.textBoxScale,on=Z&&$==="never"?pl:null;let ln=null,fl=j==="never"?1:2,ml="never";Ft&&fl++;for(let cn=0;cn<fl;cn++){for(let _l=Er;_l<$i;_l++){const gl=l.textAnchorOffsets.get(_l);if(Ft&&gl.textAnchor!==Ft)continue;const ls=this.attemptAnchorPlacement(gl,ii,Un,jr,mr,W,K,w,le,y,D,ml,ge,l,os,f,g,on,ce);if(ls&&(ln=ls.placedGlyphBoxes,ln&&ln.placeable))return _t=!0,at=ls.shift,ln}Ft?Ft=null:ml=j}return s&&!ln&&(ln={box:this.collisionIndex.placeCollisionBox(Nn,"always",w,le,y,K,W,f,D.predicate,ce,void 0,we).box,offscreen:!1,placeable:!1,occluded:!1}),ln};zr((()=>Yt(Nn,ke.iconBox,c.ao.horizontal)),(()=>{const ii=ke.verticalTextBox;return l.allowVerticalPlacement&&(!St||!St.placeable)&&ge.numVerticalGlyphVertices>0&&ii?Yt(ii,ke.verticalIconBox,c.ao.vertical):{box:null,occluded:!0,offscreen:null}})),St&&(_t=St.placeable,xt=St.offscreen);const Zi=Ui(St&&St.placeable);if(!_t&&this.prevPlacement){const ii=this.prevPlacement.variableOffsets[ge.crossTileID];ii&&(this.variableOffsets[ge.crossTileID]=ii,this.markUsedJustification(l,ii.anchor,ge,Zi))}}}if(Vt=St,_t=Vt&&Vt.placeable,xt=Vt&&Vt.offscreen,ge.useRuntimeCollisionCircles&&ge.centerJustifiedTextSymbolIndex>=0){const Ui=l.text.placedSymbolArray.get(ge.centerJustifiedTextSymbolIndex),zr=c.ap(l.textSizeData,I,Ui),Er=d.get("text-padding");Nt=this.collisionIndex.placeCollisionCircles(j,Ui,l.lineVertexArray,l.glyphOffsetArray,zr,y,b,s,K,D.predicate,ge.collisionCircleDiameter,Er,f,ce),Nt.circles.length&&Nt.collisionDetected&&!s&&c.w("Collisions detected, but collision boxes are not shown"),_t=N||Nt.circles.length>0&&!Nt.collisionDetected,xt=xt&&Nt.offscreen}if(ke.iconFeatureIndex&&(sn=ke.iconFeatureIndex),ke.iconBox){const Ui=zr=>this.collisionIndex.placeCollisionBox(zr,$,w,le,y,K,W,g,D.predicate,ce,Z&&at?at:void 0,we);ui&&ui.placeable&&ke.verticalIconBox?(Pi=Ui(ke.verticalIconBox),Ct=Pi.placeable):(Pi=Ui(ke.iconBox),Ct=Pi.placeable),xt=xt&&Pi.offscreen}const ao=B||ge.numHorizontalGlyphVertices===0&&ge.numVerticalGlyphVertices===0,wa=O||ge.numIconVertices===0;ao||wa?wa?ao||(Ct=Ct&&_t):_t=Ct&&_t:Ct=_t=Ct&&_t;const Or=Ct&&Pi.placeable;if(_t&&Vt.placeable&&this.collisionIndex.insertCollisionBox(Vt.box,j,d.get("text-ignore-placement"),l.bucketInstanceId,ui&&ui.placeable&&fr?fr:an,D.ID),Or&&this.collisionIndex.insertCollisionBox(Pi.box,$,d.get("icon-ignore-placement"),l.bucketInstanceId,sn,D.ID),Nt&&_t&&this.collisionIndex.insertCollisionCircles(Nt.circles,j,d.get("text-ignore-placement"),l.bucketInstanceId,an,D.ID),s&&this.storeCollisionData(l.bucketInstanceId,We,ke,Vt,Pi,Nt),ge.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ge.crossTileID]=new Kn((_t||he)&&!(Vt!=null&&Vt.occluded),(Ct||se)&&!(Pi!=null&&Pi.occluded),xt||l.justReloaded),n[ge.crossTileID]=!0};if(ee){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const ge=l.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let ke=ge.length-1;ke>=0;--ke){const We=ge[ke];Te(l.symbolInstances.get(We),l.collisionArrays[We],We)}}else for(let ge=e.symbolInstanceStart;ge<e.symbolInstanceEnd;ge++)Te(l.symbolInstances.get(ge),l.collisionArrays[ge],ge);l.justReloaded=!1}storeCollisionData(e,n,s,l,d,f){if(s.textBox||s.iconBox){let g,y;this.collisionBoxArrays.has(e)?g=this.collisionBoxArrays.get(e):(g=new Map,this.collisionBoxArrays.set(e,g)),g.has(n)?y=g.get(n):(y={text:null,icon:null},g.set(n,y)),s.textBox&&(y.text=l.box),s.iconBox&&(y.icon=d.box)}if(f){let g=this.collisionCircleArrays[e];g===void 0&&(g=this.collisionCircleArrays[e]=[]);for(let y=0;y<f.circles.length;y+=4)g.push(f.circles[y+0]-jt),g.push(f.circles[y+1]-jt),g.push(f.circles[y+2]),g.push(f.collisionDetected?1:0)}}markUsedJustification(e,n,s,l){let d;d=l===c.ao.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[c.aG(n)];const f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(const g of f)g>=0&&(e.text.placedSymbolArray.get(g).crossTileID=d>=0&&g!==d?0:s.crossTileID)}markUsedOrientation(e,n,s){const l=n===c.ao.horizontal||n===c.ao.horizontalOnly?n:0,d=n===c.ao.vertical?n:0,f=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const g of f)e.text.placedSymbolArray.get(g).placedOrientation=l;s.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=d)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const l=n?n.symbolFadeChange(e):1,d=n?n.opacities:{},f=n?n.variableOffsets:{},g=n?n.placedOrientations:{};for(const y in this.placements){const b=this.placements[y],w=d[y];w?(this.opacities[y]=new Aa(w,l,b.text,b.icon),s=s||b.text!==w.text.placed||b.icon!==w.icon.placed):(this.opacities[y]=new Aa(null,l,b.text,b.icon,b.skipFade),s=s||b.text||b.icon)}for(const y in d){const b=d[y];if(!this.opacities[y]){const w=new Aa(b,l,!1,!1);w.isHidden()||(this.opacities[y]=w,s=s||b.text.placed||b.icon.placed)}}for(const y in f)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=f[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:e)}updateLayerOpacities(e,n){const s={};for(const l of n){const d=l.getBucket(e);d&&l.latestFeatureIndex&&e.id===d.layerIds[0]&&this.updateBucketOpacities(d,l.tileID,s,l.collisionBoxArray)}}updateBucketOpacities(e,n,s,l){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const d=e.layers[0],f=d.layout,g=new Aa(null,0,!1,!1,!0),y=f.get("text-allow-overlap"),b=f.get("icon-allow-overlap"),w=d._unevaluatedLayout.hasValue("text-variable-anchor")||d._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=f.get("text-rotation-alignment")==="map",P=f.get("text-pitch-alignment")==="map",I=f.get("icon-text-fit")!=="none",D=new Aa(null,0,y&&(b||!e.hasIconData()||f.get("icon-optional")),b&&(y||!e.hasTextData()||f.get("text-optional")),!0);!e.collisionArrays&&l&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(l);const B=(j,N,$)=>{for(let U=0;U<N/4;U++)j.opacityVertexArray.emplaceBack($);j.hasVisibleVertices=j.hasVisibleVertices||$!==Pn},O=this.collisionBoxArrays.get(e.bucketInstanceId);for(let j=0;j<e.symbolInstances.length;j++){const N=e.symbolInstances.get(j),{numHorizontalGlyphVertices:$,numVerticalGlyphVertices:U,crossTileID:W}=N;let K=this.opacities[W];s[W]?K=g:K||(K=D,this.opacities[W]=K),s[W]=!0;const Z=N.numIconVertices>0,ee=this.placedOrientations[N.crossTileID],he=ee===c.ao.vertical,se=ee===c.ao.horizontal||ee===c.ao.horizontalOnly;if($>0||U>0){const ce=So(K.text);B(e.text,$,he?Pn:ce),B(e.text,U,se?Pn:ce);const we=K.text.isHidden();[N.rightJustifiedTextSymbolIndex,N.centerJustifiedTextSymbolIndex,N.leftJustifiedTextSymbolIndex].forEach((ke=>{ke>=0&&(e.text.placedSymbolArray.get(ke).hidden=we||he?1:0)})),N.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(N.verticalPlacedTextSymbolIndex).hidden=we||se?1:0);const Te=this.variableOffsets[N.crossTileID];Te&&this.markUsedJustification(e,Te.anchor,N,ee);const ge=this.placedOrientations[N.crossTileID];ge&&(this.markUsedJustification(e,"left",N,ge),this.markUsedOrientation(e,ge,N))}if(Z){const ce=So(K.icon),we=!(I&&N.verticalPlacedIconSymbolIndex&&he);N.placedIconSymbolIndex>=0&&(B(e.icon,N.numIconVertices,we?ce:Pn),e.icon.placedSymbolArray.get(N.placedIconSymbolIndex).hidden=K.icon.isHidden()),N.verticalPlacedIconSymbolIndex>=0&&(B(e.icon,N.numVerticalIconVertices,we?Pn:ce),e.icon.placedSymbolArray.get(N.verticalPlacedIconSymbolIndex).hidden=K.icon.isHidden())}const le=O&&O.has(j)?O.get(j):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const ce=e.collisionArrays[j];if(ce){let we=new c.P(0,0);if(ce.textBox||ce.verticalTextBox){let Te=!0;if(w){const ge=this.variableOffsets[W];ge?(we=Rr(ge.anchor,ge.width,ge.height,ge.textOffset,ge.textBoxScale),S&&we._rotate(P?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Te=!1}if(ce.textBox||ce.verticalTextBox){let ge;ce.textBox&&(ge=he),ce.verticalTextBox&&(ge=se),Po(e.textCollisionBox.collisionVertexArray,K.text.placed,!Te||ge,le.text,we.x,we.y)}}if(ce.iconBox||ce.verticalIconBox){const Te=!!(!se&&ce.verticalIconBox);let ge;ce.iconBox&&(ge=Te),ce.verticalIconBox&&(ge=!Te),Po(e.iconCollisionBox.collisionVertexArray,K.icon.placed,ge,le.icon,I?we.x:0,I?we.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error("bucket.text.opacityVertexArray.length (= ".concat(e.text.opacityVertexArray.length,") !== bucket.text.layoutVertexArray.length (= ").concat(e.text.layoutVertexArray.length,") / 4"));if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error("bucket.icon.opacityVertexArray.length (= ".concat(e.icon.opacityVertexArray.length,") !== bu
5cket.icon.layoutVertexArray.length (= ").concat(e.icon.layoutVertexArray.length,") / 4"));e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,n){const s=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*s>e}setStale(){this.stale=!0}}function Po(h,e,n,s,l,d){s&&s.length!==0||(s=[0,0,0,0]);const f=s[0]-jt,g=s[1]-jt,y=s[2]-jt,b=s[3]-jt;h.emplaceBack(e?1:0,n?1:0,l||0,d||0,f,g),h.emplaceBack(e?1:0,n?1:0,l||0,d||0,y,g),h.emplaceBack(e?1:0,n?1:0,l||0,d||0,y,b),h.emplaceBack(e?1:0,n?1:0,l||0,d||0,f,b)}const Rl=Math.pow(2,25),Jn=Math.pow(2,24),Ll=Math.pow(2,17),Wc=Math.pow(2,16),Hc=Math.pow(2,9),Xc=Math.pow(2,8),Fl=Math.pow(2,1);function So(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;const e=h.placed?1:0,n=Math.floor(127*h.opacity);return n*Rl+e*Jn+n*Ll+e*Wc+n*Hc+e*Xc+n*Fl+e}const Pn=0;class Mo{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,n,s,l,d){const f=this._bucketParts;for(;this._currentTileIndex<e.length;)if(n.getBucketParts(f,l,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,d())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort(((g,y)=>g.sortKey-y.sortKey)));this._currentPartIndex<f.length;)if(n.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,s),this._currentPartIndex++,d())return!0;return!1}}class Bl{constructor(e,n,s,l,d,f,g,y){this.placement=new Dl(e,n,f,g,y),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(e,n,s){const l=Ze.now(),d=()=>!this._forceFullPlacement&&Ze.now()-l>2;for(;this._currentPlacementIndex>=0;){const f=n[e[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(f.type==="symbol"&&(!f.minzoom||f.minzoom<=g)&&(!f.maxzoom||f.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new Mo(f)),this._inProgressLayer.continuePlacement(s[f.source],this.placement,this._showCollisionBoxes,f,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Sn=512/c.$/2;class Co{constructor(e,n,s){this.tileID=e,this.bucketInstanceId=s,this._symbolsByKey={};const l=new Map;for(let d=0;d<n.length;d++){const f=n.get(d),g=f.key,y=l.get(g);y?y.push(f):l.set(g,[f])}for(const[d,f]of l){const g={positions:f.map((y=>({x:Math.floor(y.anchorX*Sn),y:Math.floor(y.anchorY*Sn)}))),crossTileIDs:f.map((y=>y.crossTileID))};if(g.positions.length>128){const y=new c.aI(g.positions.length,16,Uint16Array);for(const{x:b,y:w}of g.positions)y.add(b,w);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[d]=g}}getScaledCoordinates(e,n){const{x:s,y:l,z:d}=this.tileID.canonical,{x:f,y:g,z:y}=n.canonical,b=Sn/Math.pow(2,y-d),w=(g*c.$+e.anchorY)*b,S=l*c.$*Sn;return{x:Math.floor((f*c.$+e.anchorX)*b-s*c.$*Sn),y:Math.floor(w-S)}}findMatches(e,n,s){const l=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let d=0;d<e.length;d++){const f=e.get(d);if(f.crossTileID)continue;const g=this._symbolsByKey[f.key];if(!g)continue;const y=this.getScaledCoordinates(f,n);if(g.index){const b=g.index.range(y.x-l,y.y-l,y.x+l,y.y+l).sort();for(const w of b){const S=g.crossTileIDs[w];if(!s[S]){s[S]=!0,f.crossTileID=S;break}}}else if(g.positions)for(let b=0;b<g.positions.length;b++){const w=g.positions[b],S=g.crossTileIDs[b];if(Math.abs(w.x-y.x)<=l&&Math.abs(w.y-y.y)<=l&&!s[S]){s[S]=!0,f.crossTileID=S;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class Yc{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ka{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const n=Math.round((e-this.lng)/360);if(n!==0)for(const s in this.indexes){const l=this.indexes[s],d={};for(const f in l){const g=l[f];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+n),d[g.tileID.key]=g}this.indexes[s]=d}this.lng=e}addBucket(e,n,s){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if
vendor: 10,034 bytes, line 5
5(this.indexes[e.overscaledZ][e.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let d=0;d<n.symbolInstances.length;d++)n.symbolInstances.get(d).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const l=this.usedCrossTileIDs[e.overscaledZ];for(const d in this.indexes){const f=this.indexes[d];if(Number(d)>e.overscaledZ)for(const g in f){const y=f[g];y.tileID.isChildOf(e)&&y.findMatches(n.symbolInstances,e,l)}else{const g=f[e.scaledTo(Number(d)).key];g&&g.findMatches(n.symbolInstances,e,l)}}for(let d=0;d<n.symbolInstances.length;d++){const f=n.symbolInstances.get(d);f.crossTileID||(f.crossTileID=s.generate(),l[f.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Co(e,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(e,n){for(const s of n.getCrossTileIDsLists())for(const l of s)delete this.usedCrossTileIDs[e][l]}removeStaleBuckets(e){let n=!1;for(const s in this.indexes){const l=this.indexes[s];for(const d in l)e[l[d].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,l[d]),delete l[d],n=!0)}return n}}class Da{constructor(){this.layerIndexes={},this.crossTileIDs=new Yc,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,n,s){let l=this.layerIndexes[e.id];l===void 0&&(l=this.layerIndexes[e.id]=new ka);let d=!1;const f={};l.handleWrapJump(s);for(const g of n){const y=g.getBucket(e);y&&e.id===y.layerIds[0]&&(y.bucketInstanceId||(y.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(g.tileID,y,this.crossTileIDs)&&(d=!0),f[y.bucketInstanceId]=!0)}return l.removeStaleBuckets(f)&&(d=!0),d}pruneUnusedLayers(e){const n={};e.forEach((s=>{n[s]=!0}));for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}var Io="void main() {fragColor=vec4(1.0);}";const vi={prelude:nt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c\n);}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:nt("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:nt("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:nt("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:nt("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;
5uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:nt("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:nt(Io,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:nt("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:nt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:nt("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:nt("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:nt("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}
5"),depth:nt(Io,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:nt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:nt("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:nt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}
5"),fillPattern:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:nt("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:nt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
5ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:nt("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:nt("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);
5float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:nt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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);
5float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:nt("uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat 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);
5float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),lineGradientSDF:nt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);
5float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),raster:nt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:nt("uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:nt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:nt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
5fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:nt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
5float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:nt("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:nt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:nt("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:nt("in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:nt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
vendor: 65,150 bytes, line 5
5function nt(h,e){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=e.match(/in ([\w]+) ([\w]+)/g),l=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=d?d.concat(l):l,g={};return{fragmentSource:h=h.replace(n,((y,b,w,S,P)=>(g[P]=!0,b==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(P,"\nin ").concat(w," ").concat(S," ").concat(P,";\n#else\nuniform ").concat(w," ").concat(S," u_").concat(P,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(P,"\n ").concat(w," ").concat(S," ").concat(P," = u_").concat(P,";\n#endif\n")))),vertexSource:e=e.replace(n,((y,b,w,S,P)=>{const I=S==="float"?"vec2":"vec4",D=P.match(/color/)?"color":I;return g[P]?b==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(P,"\nuniform lowp float u_").concat(P,"_t;\nin ").concat(w," ").concat(I," a_").concat(P,";\nout ").concat(w," ").concat(S," ").concat(P,";\n#else\nuniform ").concat(w," ").concat(S," u_").concat(P,";\n#endif\n"):D==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(P,"\n ").concat(P," = a_").concat(P,";\n#else\n ").concat(w," ").concat(S," ").concat(P," = u_").concat(P,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(P,"\n ").concat(P," = unpack_mix_").concat(D,"(a_").concat(P,", u_").concat(P,"_t);\n#else\n ").concat(w," ").concat(S," ").concat(P," = u_").concat(P,";\n#endif\n"):b==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(P,"\nuniform lowp float u_").concat(P,"_t;\nin ").concat(w," ").concat(I," a_").concat(P,";\n#else\nuniform ").concat(w," ").concat(S," u_").concat(P,";\n#endif\n"):D==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(P,"\n ").concat(w," ").concat(S," ").concat(P," = a_").concat(P,";\n#else\n ").concat(w," ").concat(S," ").concat(P," = u_").concat(P,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(P,"\n ").concat(w," ").concat(S," ").concat(P," = unpack_mix_").concat(D,"(a_").concat(P,", u_").concat(P,"_t);\n#else\n ").concat(w," ").concat(S," ").concat(P," = u_").concat(P,";\n#endif\n")})),staticAttributes:s,staticUniforms:f}}class Qn{constructor(e,n,s){this.vertexBuffer=e,this.indexBuffer=n,this.segments=s}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var bi=c.aJ([{name:"a_pos",type:"Int16",components:2}]);const Mn="#define PROJECTION_MERCATOR",Qe="mercator";class Ra{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Qe}get shaderDefine(){return Mn}get shaderPreludeCode(){return vi.projectionMercator}get vertexShaderPreludeCode(){return vi.projectionMercator.vertexSource}get subdivisionGranularity(){return c.aK.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,n,s,l,d){if(this._cachedMesh)return this._cachedMesh;const f=new c.aL;f.emplaceBack(0,0),f.emplaceBack(c.$,0),f.emplaceBack(0,c.$),f.emplaceBack(c.$,c.$);const g=e.createVertexBuffer(f,bi.members),y=c.aM.simpleSegment(0,0,4,2),b=new c.aN;b.emplaceBack(1,0,2),b.emplaceBack(1,2,3);const w=e.createIndexBuffer(b);return this._cachedMesh=new Qn(g,w,y),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}class La{constructor(e=0,n=0,s=0,l=0){if(isNaN(e)||e<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=s,this.right=l}interpolate(e,n,s){return n.top!=null&&e.top!=null&&(this.top=c.C.number(e.top,n.top,s)),n.bottom!=null&&e.bottom!=null&&(this.bottom=c.C.number(e.bottom,n.bottom,s)),n.left!=null&&e.left!=null&&(this.left=c.C.number(e.left,n.left,s)),n.right!=null&&e.right!=null&&(this.right=c.C.number(e.right,n.right,s)),this}getCenter(e,n){const s=c.ah((this.left+e-this.right)/2,0,e),l=c.ah((this.top+n-this.bottom)/2,0,n);return new c.P(s,l)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new La(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ea(h,e){if(!h.renderWorldCopies||h.lngRange)return;const n=e.lng-h.center.lng;e.lng+=n>180?-360:n<-180?360:0}function Ii(h){return Math.max(0,Math.floor(h))}class ci{constructor(e,n,s,l,d,f){this._callbacks=e,this._tileSize=512,this._renderWorldCopies=f===void 0||!!f,this._minZoom=n||0,this._maxZoom=s||22,this._minPitch=l==null?0:l,this._maxPitch=d==null?60:d,this.setMaxBounds(),this._width=0,this._height=0,this._center=new c.S(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Ii(this._zoom),this._scale=c.af(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new La,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,n,s){this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Ii(this._zoom),this._scale=c.af(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new La(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!s&&e.autoCalculateNearFarZ,n&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){const n=c.aO(e,-180,180)*Math.PI/180;var s,l,d,f,g,y,b,w,S;this._bearingInRadians!==n&&(this._unmodified=!1,this._bearingInRadians=n,this._calcMatrices(),this._rotationMatrix=Bt(),s=this._rotationMatrix,d=-this._bearingInRadians,f=(l=this._rotationMatrix)[0],g=l[1],y=l[2],b=l[3],w=Math.sin(d),S=Math.cos(d),s[0]=f*S+y*w,s[1]=g*S+b*w,s[2]=f*-w+y*S,s[3]=g*-w+b*S)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){const n=c.ah(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==n&&(this._unmodified=!1,this._pitchInRadians=n,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){const n=e/180*Math.PI;this._rollInRadians!==n&&(this._unmodified=!1,this._rollInRadians=n,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return c.aP(this._fovInRadians)}setFov(e){e=c.ah(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=c.ae(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){const n=this.getConstrained(this._center,e).zoom;this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this._tileZoom=Math.max(0,Math.floor(n)),this._scale=c.af(n),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,n){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=n,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,n,s){this._unmodified=!1,this._edgeInsets.interpolate(e,n,s),this._constrain(),this._calcMatrices()}resize(e,n,s=!0){this._width=e,this._height=n,s&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new Dt([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-c.ai,c.ai])}getConstrained(e,n){return this._callbacks.getConstrained(e,n)}getCameraQueryGeometry(e,n){if(n.length===1)return[n[0],e];{const{minX:s,minY:l,maxX:d,maxY:f}=c.a2.fromPoints(n).extend(e);return[new c.P(s,l),new c.P(d,l),new c.P(d,f),new c.P(s,f),new c.P(s,l)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:n,zoom:s}=this.getConstrained(this.center,this.zoom);this.setCenter(n),this.setZoom(s),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=c.ag(new Float64Array(16));c.N(e,e,[this._width/2,-this._height/2,1]),c.M(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=c.ag(new Float64Array(16)),c.N(e,e,[1,-1,1]),c.M(e,e,[-1,-1,0]),c.N(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,n,s,l){const d=s!==void 0?s:this.bearing,f=l=l!==void 0?l:this.pitch,g=c.a1.fromLngLat(e,n),y=-Math.cos(c.ae(f)),b=Math.sin(c.ae(f)),w=b*Math.sin(c.ae(d)),S=-b*Math.cos(c.ae(d));let P=this.elevation;const I=n-P;let D;y*I>=0||Math.abs(y)<.1?(D=1e4,P=n+D*y):D=-I/y;let B,O,j=c.aQ(1,g.y),N=0;do{if(N+=1,N>10)break;O=D/j,B=new c.a1(g.x+w*O,g.y+S*O),j=1/B.meterInMercatorCoordinateUnits()}while(Math.abs(D-O*j)>1e-12);return{center:B.toLngLat(),elevation:P,zoom:c.ak(this.height/2/Math.tan(this.fovInRadians/2)/O/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;const n=c.aj(1,this.center.lat)*this.worldSize,s=this.cameraToCenterDistance/n,l=c.a1.fromLngLat(this.center,this.elevation),d=fe(this.center,this.elevation,this.pitch,this.bearing,s);this._elevation=e;const f=this.calculateCenterFromCameraLngLatAlt(d.toLngLat(),c.aQ(d.z,l.y),this.bearing,this.pitch);this._elevation=f.elevation,this._center=f.center,this.setZoom(f.zoom)}getCameraPoint(){const e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const e=c.aj(1,this.center.lat)*this.worldSize;return fe(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];const n=e.canonical.z>=0?1<<e.canonical.z:Math.pow(2,e.canonical.z);return[e.canonical.x/n,e.canonical.y/n,1/n/c.$,1/n/c.$]}}class Qt{constructor(e,n){this.min=e,this.max=n,this.center=c.aR([],c.aS([],this.min,this.max),.5)}quadrant(e){const n=[e%2==0,e<2],s=c.aT(this.min),l=c.aT(this.max);for(let d=0;d<n.length;d++)s[d]=n[d]?this.min[d]:this.center[d],l[d]=n[d]?this.center[d]:this.max[d];return l[2]=this.max[2],new Qt(s,l)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let n=!0;for(let s=0;s<e.planes.length;s++){const l=this.intersectsPlane(e.planes[s]);if(l===0)return 0;l===1&&(n=!1)}return n?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let n=e[3],s=e[3];for(let l=0;l<3;l++)e[l]>0?(n+=e[l]*this.min[l],s+=e[l]*this.max[l]):(s+=e[l]*this.min[l],n+=e[l]*this.max[l]);return n>=0?2:s<0?0:1}}class hi{distanceToTile2d(e,n,s,l){const d=l.distanceX([e,n]),f=l.distanceY([e,n]);return Math.hypot(d,f)}getWrap(e,n,s){return s}getTileBoundingVolume(e,n,s,l){var d,f;let g=0,y=0;if(l!=null&&l.terrain){const w=new c.Z(e.z,n,e.z,e.x,e.y),S=l.terrain.getMinMaxElevation(w);g=(d=S.minElevation)!==null&&d!==void 0?d:Math.min(0,s),y=(f=S.maxElevation)!==null&&f!==void 0?f:Math.max(0,s)}const b=1<<e.z;return new Qt([n+e.x/b,e.y/b,g],[n+(e.x+1)/b,(e.y+1)/b,y])}allowVariableZoom(e,n){const s=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,l=c.ah(78.5-s/2,0,60);return!!n.terrain||e.pitch>l}allowWorldCopies(){return!0}prepareNextFrame(){}}class vt{constructor(e,n,s){this.points=e,this.planes=n,this.aabb=s}static fromInvProjectionMatrix(e,n=1,s=0,l,d){const f=d?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],g=Math.pow(2,s),y=[[-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((P=>(function(I,D,B,O){const j=c.aw([],I,D),N=1/j[3]/B*O;return c.aY(j,j,[N,N,1/j[3],N])})(P,e,n,g)));l&&(function(P,I,D,B){const O=B?4:0,j=B?0:4;let N=0;const $=[],U=[];for(let Z=0;Z<4;Z++){const ee=c.aU([],P[Z+j],P[Z+O]),he=c.aZ(ee);c.aR(ee,ee,1/he),$.push(he),U.push(ee)}for(let Z=0;Z<4;Z++){const ee=c.a_(P[Z+O],U[Z],D);N=ee!==null&&ee>=0?Math.max(N,ee):Math.max(N,$[Z])}const W=(function(Z,ee){const he=c.aU([],Z[ee[0]],Z[ee[1]]),se=c.aU([],Z[ee[2]],Z[ee[1]]),le=[0,0,0,0];return c.aV(le,c.aW([],he,se)),le[3]=-c.aX(le,Z[ee[0]]),le})(P,I),K=(function(Z,ee){const he=c.a$(Z),se=c.b0([],Z,1/he),le=c.aU([],ee,c.aR([],se,c.aX(ee,se))),ce=c.a$(le);if(ce>0){const we=Math.sqrt(1-se[3]*se[3]),Te=c.aR([],se,-se[3]),ge=c.aS([],Te,c.aR([],le,we/ce));return c.b1(ee,ge)}return null})(D,W);if(K!==null){const Z=K/c.aX(U[0],W);N=Math.min(N,Z)}for(let Z=0;Z<4;Z++){const ee=Math.min(N,$[Z]);P[Z+j]=[P[Z+O][0]+U[Z][0]*ee,P[Z+O][1]+U[Z][1]*ee,P[Z+O][2]+U[Z][2]*ee,1]}})(y,f[0],l,d);const b=f.map((P=>{const I=c.aU([],y[P[0]],y[P[1]]),D=c.aU([],y[P[2]],y[P[1]]),B=c.aV([],c.aW([],I,D)),O=-c.aX(B,y[P[1]]);return B.concat(O)})),w=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],S=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const P of y)for(let I=0;I<3;I++)w[I]=Math.min(w[I],P[I]),S[I]=Math.max(S[I],P[I]);return new vt(y,b,new Qt(w,S))}}class ta{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,n,s){return this._helper.interpolatePadding(e,n,s)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,n,s=!0){this._helper.resize(e,n,s)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,n){this._helper.overrideNearFarZ(e,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e,n){}constructor(e,n,s,l,d){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new ci({calcMatrices:()=>{this._calcMatrices()},getConstrained:(f,g)=>this.getConstrained(f,g)},e,n,s,l,d),this._coveringTilesDetailsProvider=new hi}clone(){const e=new ta;return e.apply(this),e}apply(e,n,s){this._helper.apply(e,n,s)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){const n=[new c.b2(0,e)];if(this._helper._renderWorldCopies){const s=this.screenPointToMercatorCoordinate(new c.P(0,0)),l=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,0)),d=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,this._helper._height)),f=this.screenPointToMercatorCoordinate(new c.P(0,this._helper._height)),g=Math.floor(Math.min(s.x,l.x,d.x,f.x)),y=Math.floor(Math.max(s.x,l.x,d.x,f.x)),b=1;for(let w=g-b;w<=y+b;w++)w!==0&&n.push(new c.b2(w,e))}return n}getCameraFrustum(){return vt.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){const n=this.screenPointToLocation(this.centerPoint,e),s=e?e.getElevationForLngLatZoom(n,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(s)}setLocationAtPoint(e,n){const s=c.aj(this.elevation,this.center.lat),l=this.screenPointToMercatorCoordinateAtZ(n,s),d=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,s),f=c.a1.fromLngLat(e),g=new c.a1(f.x-(l.x-d.x),f.y-(l.y-d.y));this.setCenter(g==null?void 0:g.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,n){return n?this.coordinatePoint(c.a1.fromLngLat(e),n.getElevationForLngLatZoom(e,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(c.a1.fromLngLat(e))}screenPointToLocation(e,n){var s;return(s=this.screenPointToMercatorCoordinate(e,n))===null||s===void 0?void 0:s.toLngLat()}screenPointToMercatorCoordinate(e,n){if(n){const s=n.pointCoordinate(e);if(s!=null)return s}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,n){const s=n||0,l=[e.x,e.y,0,1],d=[e.x,e.y,1,1];c.aw(l,l,this._pixelMatrixInverse),c.aw(d,d,this._pixelMatrixInverse);const f=l[3],g=d[3],y=l[1]/f,b=d[1]/g,w=l[2]/f,S=d[2]/g,P=w===S?0:(s-w)/(S-w);return new c.a1(c.C.number(l[0]/f,d[0]/g,P)/this.worldSize,c.C.number(y,b,P)/this.worldSize,s)}coordinatePoint(e,n=0,s=this._pixelMatrix){const l=[e.x*this.worldSize,e.y*this.worldSize,n,1];return c.aw(l,l,s),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){const e=Math.max(0,this._helper._height/2-ae(this));return new Dt().extend(this.screenPointToLocation(new c.P(0,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,e))).extend(this.screenPointToLocation(new c.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new c.P(0,this._helper._height)))}isPointOnMapSurface(e,n){return n?n.pointCoordinate(e)!=null:e.y>this.height/2-ae(this)}calculatePosMatrix(e,n=!1,s){var l;const d=(l=e.key)!==null&&l!==void 0?l:c.b3(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),f=n?this._alignedPosMatrixCache:this._posMatrixCache;if(f.has(d)){const b=f.get(d);return s?b.f32:b.f64}const g=re(e,this.worldSize);c.O(g,n?this._alignedProjMatrix:this._viewProjMatrix,g);const y={f64:g,f32:new Float32Array(g)};return f.set(d,y),s?y.f32:y.f64}calculateFogMatrix(e){const n=e.key,s=this._fogMatrixCacheF32;if(s.has(n))return s.get(n);const l=re(e,this.worldSize);return c.O(l,this._fogMatrix,l),s.set(n,new Float32Array(l)),s.get(n)}getConstrained(e,n){n=c.ah(+n,this.minZoom,this.maxZoom);const s={center:new c.S(e.lng,e.lat),zoom:n};let l=this._helper._lngRange;if(!this._helper._renderWorldCopies&&l===null){const $=179.9999999999;l=[-$,$]}const d=this.tileSize*c.af(s.zoom);let f=0,g=d,y=0,b=d,w=0,S=0;const{x:P,y:I}=this.size;if(this._helper._latRange){const $=this._helper._latRange;f=c.U($[1])*d,g=c.U($[0])*d,g-f<I&&(w=I/(g-f))}l&&(y=c.aO(c.V(l[0])*d,0,d),b=c.aO(c.V(l[1])*d,0,d),b<y&&(b+=d),b-y<P&&(S=P/(b-y)));const{x:D,y:B}=X(d,e);let O,j;const N=Math.max(S||0,w||0);if(N){const $=new c.P(S?(b+y)/2:D,w?(g+f)/2:B);return s.center=te(d,$).wrap(),s.zoom+=c.ak(N),s}if(this._helper._latRange){const $=I/2;B-$<f&&(j=f+$),B+$>g&&(j=g-$)}if(l){const $=(y+b)/2;let U=D;this._helper._renderWorldCopies&&(U=c.aO(D,$-d/2,$+d/2));const W=P/2;U-W<y&&(O=y+W),U+W>b&&(O=b-W)}if(O!==void 0||j!==void 0){const $=new c.P(O!=null?O:D,j!=null?j:B);s.center=te(d,$).wrap()}return s}calculateCenterFromCameraLngLatAlt(e,n,s,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,n,s,l)}_calculateNearFarZIfNeeded(e,n,s){if(!this._helper.autoCalculateNearFarZ)return;const l=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),d=e-l*this._helper._pixelPerMeter/Math.cos(n),f=l<0?d:e,g=Math.PI/2+this.pitchInRadians,y=c.ae(this.fov)*(Math.abs(Math.cos(c.ae(this.roll)))*this.height+Math.abs(Math.sin(c.ae(this.roll)))*this.width)/this.height*(.5+s.y/this.height),b=Math.sin(y)*f/Math.sin(c.ah(Math.PI-g-y,.01,Math.PI-.01)),w=ae(this),S=Math.atan(w/this._helper.cameraToCenterDistance),P=c.ae(.75),I=S>P?2*S*(.5+s.y/(2*w)):P,D=Math.sin(I)*f/Math.sin(c.ah(Math.PI-g-I,.01,Math.PI-.01)),B=Math.min(b,D);this._helper._farZ=1.01*(Math.cos(Math.PI/2-n)*B+f),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const e=this.centerOffset,n=X(this.worldSize,this.center),s=n.x,l=n.y;this._helper._pixelPerMeter=c.aj(1,this.center.lat)*this.worldSize;const d=c.ae(Math.min(this.pitch,G)),f=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(d));let g;this._calculateNearFarZIfNeeded(f,d,e),g=new Float64Array(16),c.b4(g,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),c.aq(this._invProjMatrix,g),g[8]=2*-e.x/this._helper._width,g[9]=2*e.y/this._helper._height,this._projectionMatrix=c.b5(g),c.N(g,g,[1,-1,1]),c.M(g,g,[0,0,-this._helper.cameraToCenterDistance]),c.b6(g,g,-this.rollInRadians),c.b7(g,g,this.pitchInRadians),c.b6(g,g,-this.bearingInRadians),c.M(g,g,[-s,-l,0]),this._mercatorMatrix=c.N([],g,[this.worldSize,this.worldSize,this.worldSize]),c.N(g,g,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=c.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,g),c.M(g,g,[0,0,-this.elevation]),this._viewProjMatrix=g,this._invViewProjMatrix=c.aq([],g);const y=[0,0,-1,1];c.aw(y,y,this._invViewProjMatrix),this._cameraPosition=[y[0]/y[3],y[1]/y[3],y[2]/y[3]],this._fogMatrix=new Float64Array(16),c.b4(this._fogMatrix,this.fovInRadians,this.width/this.height,f,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,c.N(this._fogMatrix,this._fogMatrix,[1,-1,1]),c.M(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b6(this._fogMatrix,this._fogMatrix,-this.rollInRadians),c.b7(this._fogMatrix,this._fogMatrix,this.pitchInRadians),c.b6(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),c.M(this._fogMatrix,this._fogMatrix,[-s,-l,0]),c.N(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),c.M(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=c.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,g);const b=this._helper._width%2/2,w=this._helper._height%2/2,S=Math.cos(this.bearingInRadians),P=Math.sin(-this.bearingInRadians),I=s-Math.round(s)+S*b+P*w,D=l-Math.round(l)+S*w+P*b,B=new Float64Array(g);if(c.M(B,B,[I>.5?I-1:I,D>.5?D-1:D,0]),this._alignedProjMatrix=B,g=c.aq(new Float64Array(16),this._pixelMatrix),!g)throw new Error("failed to invert matrix");this._pixelMatrixInverse=g,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const e=this.screenPointToMercatorCoordinate(new c.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return c.aw(n,n,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const e=c.aj(1,this.center.lat)*this.worldSize;return fe(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,n){const s=c.a1.fromLngLat(e),l=[s.x*this.worldSize,s.y*this.worldSize,n,1];return c.aw(l,l,this._viewProjMatrix),l[2]/l[3]}getProjectionData(e){const{overscaledTileID:n,aligned:s,applyTerrainMatrix:l}=e,d=this._helper.getMercatorTileCoordinates(n),f=n?this.calculatePosMatrix(n,s,!0):null;let g;return g=n&&n.terrainRttPosMatrix32f&&l?n.terrainRttPosMatrix32f:f||c.b8(),{mainMatrix:g,tileMercatorCoords:d,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:g}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,n,s){return 1}transformLightDirection(e){return c.aT(e)}getRayDirectionFromPixel(e){throw new Error("Not implemented.")}projectTileCoordinates(e,n,s,l){const d=this.calculatePosMatrix(s);let f;l?(f=[e,n,l(e,n),1],c.aw(f,f,d)):(f=[e,n,0,1],wn(f,f,d));const g=f[3];return{point:new c.P(f[0]/g,f[1]/g),signedDistanceFromCamera:g,isOccluded:!1}}populateCache(e){for(const n of e)this.calculatePosMatrix(n)}getMatrixForModel(e,n){const s=c.a1.fromLngLat(e,n),l=s.meterInMercatorCoordinateUnits(),d=c.b9();return c.M(d,d,[s.x,s.y,s.z]),c.b6(d,d,Math.PI),c.b7(d,d,Math.PI/2),c.N(d,d,[-l,l,l]),d}getProjectionDataForCustomLayer(e=!0){const n=new c.Z(0,0,0,0,0),s=this.getProjectionData({overscaledTileID:n,applyGlobeMatrix:e}),l=re(n,this.worldSize);c.O(l,this._viewProjMatrix,l),s.tileMercatorCoords=[0,0,1,1];const d=[c.$,c.$,this.worldSize/this._helper.pixelsPerMeter],f=c.ba();return c.N(f,l,d),s.fallbackMatrix=f,s.mainMatrix=f,s}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function wi(){c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Ni(h){if(h.useSlerp)if(h.k<1){const e=c.bb(h.startEulerAngles.roll,h.startEulerAngles.pitch,h.startEulerAngles.bearing),n=c.bb(h.endEulerAngles.roll,h.endEulerAngles.pitch,h.endEulerAngles.bearing),s=new Float64Array(4);c.bc(s,e,n,h.k);const l=c.bd(s);h.tr.setRoll(l.roll),h.tr.setPitch(l.pitch),h.tr.setBearing(l.bearing)}else h.tr.setRoll(h.endEulerAngles.roll),h.tr.setPitch(h.endEulerAngles.pitch),h.tr.setBearing(h.endEulerAngles.bearing);else h.tr.setRoll(c.C.number(h.startEulerAngles.roll,h.endEulerAngles.roll,h.k)),h.tr.setPitch(c.C.number(h.startEulerAngles.pitch,h.endEulerAngles.pitch,h.k)),h.tr.setBearing(c.C.number(h.startEulerAngles.bearing,h.endEulerAngles.bearing,h.k))}function zi(h,e,n,s,l){const d=l.padding,f=X(l.worldSize,n.getNorthWest()),g=X(l.worldSize,n.getNorthEast()),y=X(l.worldSize,n.getSouthEast()),b=X(l.worldSize,n.getSouthWest()),w=c.ae(-s),S=f.rotate(w),P=g.rotate(w),I=y.rotate(w),D=b.rotate(w),B=new c.P(Math.max(S.x,P.x,D.x,I.x),Math.max(S.y,P.y,D.y,I.y)),O=new c.P(Math.min(S.x,P.x,D.x,I.x),Math.min(S.y,P.y,D.y,I.y)),j=B.sub(O),N=(l.width-(d.left+d.right+e.left+e.right))/j.x,$=(l.height-(d.top+d.bottom+e.top+e.bottom))/j.y;if($<0||N<0)return void wi();const U=Math.min(c.ak(l.scale*Math.min(N,$)),h.maxZoom),W=c.P.convert(h.offset),K=new c.P((e.left-e.right)/2,(e.top-e.bottom)/2).rotate(c.ae(s)),Z=W.add(K).mult(l.scale/c.af(U));return{center:te(l.worldSize,f.add(y).div(2).sub(Z)),zoom:U,bearing:s}}class Fa{get useGlobeControls(){return!1}handlePanInertia(e,n){const s=e.mag(),l=Math.abs(ae(n));return{easingOffset:e.mult(Math.min(.75*l/s,1)),easingCenter:n.center}}handleMapControlsRollPitchBearingZoom(e,n){e.bearingDelta&&n.setBearing(n.bearing+e.bearingDelta),e.pitchDelta&&n.setPitch(n.pitch+e.pitchDelta),e.rollDelta&&n.setRoll(n.roll+e.rollDelta),e.zoomDelta&&n.setZoom(n.zoom+e.zoomDelta)}handleMapControlsPan(e,n,s){e.around.distSqr(n.centerPoint)<.01||n.setLocationAtPoint(s,e.around)}cameraForBoxAndBearing(e,n,s,l,d){return zi(e,n,s,l,d)}handleJumpToCenterZoom(e,n){e.zoom!==(n.zoom!==void 0?+n.zoom:e.zoom)&&e.setZoom(+n.zoom),n.center!==void 0&&e.setCenter(c.S.convert(n.center))}handleEaseTo(e,n){const s=e.zoom,l=e.padding,d={roll:e.roll,pitch:e.pitch,bearing:e.bearing},f={roll:n.roll===void 0?e.roll:n.roll,pitch:n.pitch===void 0?e.pitch:n.pitch,bearing:n.bearing===void 0?e.bearing:n.bearing},g=n.zoom!==void 0,y=!e.isPaddingEqual(n.padding);let b=!1;const w=g?+n.zoom:e.zoom;let S=e.centerPoint.add(n.offsetAsPoint);const P=e.screenPointToLocation(S),{center:I,zoom:D}=e.getConstrained(c.S.convert(n.center||P),w!=null?w:s);ea(e,I);const B=X(e.worldSize,P),O=X(e.worldSize,I).sub(B),j=c.af(D-s);return b=D!==s,{easeFunc:N=>{if(b&&e.setZoom(c.C.number(s,D,N)),c.be(d,f)||Ni({startEulerAngles:d,endEulerAngles:f,tr:e,k:N,useSlerp:d.roll!=f.roll}),y&&(e.interpolatePadding(l,n.padding,N),S=e.centerPoint.add(n.offsetAsPoint)),n.around)e.setLocationAtPoint(n.around,n.aroundPoint);else{const $=c.af(e.zoom-s),U=D>s?Math.min(2,j):Math.max(.5,j),W=Math.pow(U,1-N),K=te(e.worldSize,B.add(O.mult(N*W)).mult($));e.setLocationAtPoint(e.renderWorldCopies?K.wrap():K,S)}},isZooming:b,elevationCenter:I}}handleFlyTo(e,n){const s=n.zoom!==void 0,l=e.zoom,d=e.getConstrained(c.S.convert(n.center||n.locationAtOffset),s?+n.zoom:l),f=d.center,g=d.zoom;ea(e,f);const y=X(e.worldSize,n.locationAtOffset),b=X(e.worldSize,f).sub(y),w=b.mag(),S=c.af(g-l);let P;if(n.minZoom!==void 0){const I=Math.min(+n.minZoom,l,g),D=e.getConstrained(f,I).zoom;P=c.af(D-l)}return{easeFunc:(I,D,B,O)=>{e.setZoom(I===1?g:l+c.ak(D));const j=I===1?f:te(e.worldSize,y.add(b.mult(B)).mult(D));e.setLocationAtPoint(e.renderWorldCopies?j.wrap():j,O)},scaleOfZoom:S,targetCenter:f,scaleOfMinZoom:P,pixelPathLength:w}}}class mt{constructor(e,n,s){this.blendFunction=e,this.blendColor=n,this.mask=s}}mt.Replace=[1,0],mt.disabled=new mt(mt.Replace,c.bf.transparent,[!1,!1,!1,!1]),mt.unblended=new mt(mt.Replace,c.bf.transparent,[!0,!0,!0,!0]),mt.alphaBlended=new mt([1,771],c.bf.transparent,[!0,!0,!0,!0]);const At=2305;class it{constructor(e,n,s){this.enable=e,this.mode=n,this.frontFace=s}}it.disabled=new it(!1,1029,At),it.backCCW=new it(!0,1029,At),it.frontCCW=new it(!0,1028,At);class qe{constructor(e,n,s){this.func=e,this.mask=n,this.range=s}}qe.ReadOnly=!1,qe.ReadWrite=!0,qe.disabled=new qe(519,qe.ReadOnly,[0,1]);const ia=7680;class Xe{constructor(e,n,s,l,d,f){this.test=e,this.ref=n,this.mask=s,this.fail=l,this.depthFail=d,this.pass=f}}Xe.disabled=new Xe({func:519,mask:0},0,0,ia,ia,ia);const ys=new WeakMap;function gi(h){var e;if(ys.has(h))return ys.get(h);{const n=(e=h.getParameter(h.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return ys.set(h,n),n}}class zo{get awaitingQuery(){return!!this._readbackQueue}constructor(e){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=e;const n=e.context,s=n.gl;this._texFormat=s.RGBA,this._texType=s.UNSIGNED_BYTE;const l=new c.aL;l.emplaceBack(-1,-1),l.emplaceBack(2,-1),l.emplaceBack(-1,2);const d=new c.aN;d.emplaceBack(0,1,2),this._fullscreenTriangle=new Qn(n.createVertexBuffer(l,bi.members),n.createIndexBuffer(d),c.aM.simpleSegment(0,0,l.length,d.length)),this._resultBuffer=new Uint8Array(4),n.activeTexture.set(s.TEXTURE1);const f=s.createTexture();s.bindTexture(s.TEXTURE_2D,f),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texImage2D(s.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=n.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(f),gi(s)&&(this._pbo=s.createBuffer(),s.bindBuffer(s.PIXEL_PACK_BUFFER,this._pbo),s.bufferData(s.PIXEL_PACK_BUFFER,4,s.STREAM_READ),s.bindBuffer(s.PIXEL_PACK_BUFFER,null))}destroy(){const e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,n){const s=this._updateCount;return this._readbackQueue?s>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():s>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,n),this._updateCount++,this._measuredError}_bindFramebuffer(){const e=this._cachedRenderContext.context,n=e.gl;e.activeTexture.set(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,n){const s=this._cachedRenderContext.context,l=s.gl;if(this._bindFramebuffer(),s.viewport.set([0,0,this._texWidth,this._texHeight]),s.clear({color:c.bf.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(s,l.TRIANGLES,qe.disabled,Xe.disabled,mt.unblended,it.disabled,((d,f)=>({u_input:d,u_output_expected:f}))(e,n),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&gi(l)){l.bindBuffer(l.PIXEL_PACK_BUFFER,this._pbo),l.readBuffer(l.COLOR_ATTACHMENT0),l.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);const d=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);l.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:d}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&gi(e)){const n=e.clientWaitSync(this._readbackQueue.sync,0,0);if(n===e.WAIT_FAILED)return c.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(n===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=zo._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let n=0;return n+=e[0]/256,n+=e[1]/65536,n+=e[2]/16777216,e[3]<127&&(n=-n),n/128}}const Ba=c.$/128;function Oa(h,e){const n=h.granularity!==void 0?Math.max(h.granularity,1):1,s=n+(h.generateBorders?2:0),l=n+(h.extendToNorthPole||h.generateBorders?1:0)+(h.extendToSouthPole||h.generateBorders?1:0),d=s+1,f=l+1,g=h.generateBorders?-1:0,y=h.generateBorders||h.extendToNorthPole?-1:0,b=n+(h.generateBorders?1:0),w=n+(h.generateBorders||h.extendToSouthPole?1:0),S=d*f,P=s*l*6,I=d*f>65536;if(I&&e==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const D=I||e==="32bit",B=new Int16Array(2*S);let O=0;for(let $=y;$<=w;$++)for(let U=g;U<=b;U++){let W=U/n*c.$;U===-1&&(W=-Ba),U===n+1&&(W=c.$+Ba);let K=$/n*c.$;$===-1&&(K=h.extendToNorthPole?c.bh:-Ba),$===n+1&&(K=h.extendToSouthPole?c.bi:c.$+Ba),B[O++]=W,B[O++]=K}const j=D?new Uint32Array(P):new Uint16Array(P);let N=0;for(let $=0;$<l;$++)for(let U=0;U<s;U++){const W=U+1+$*d,K=U+($+1)*d,Z=U+1+($+1)*d;j[N++]=U+$*d,j[N++]=K,j[N++]=W,j[N++]=W,j[N++]=K,j[N++]=Z}return{vertices:B.buffer.slice(0),indices:j.buffer.slice(0),uses32bitIndices:D}}const ra=new c.aK({fill:new c.bj(128,2),line:new c.bj(512,0),tile:new c.bj(128,32),stencil:new c.bj(128,1),circle:3});class ja{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return vi.projectionGlobe}get vertexShaderPreludeCode(){return vi.projectionMercator.vertexSource}get subdivisionGranularity(){return ra}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||(this._errorMeasurement=new zo(e));const n=c.U(this._errorQueryLatitudeDegrees),s=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI,l=this._errorMeasurement.updateErrorLoop(n,s),d=Ze.now();l!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=l,this._errorMeasurementLastChangeTime=d);const f=Math.min(Math.max((d-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=c.bk(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,c.bl(f))}_getMeshKey(e){return"".concat(e.granularity.toString(36),"_").concat(e.generateBorders?"b":"").concat(e.extendToNorthPole?"n":"").concat(e.extendToSouthPole?"s":"")}getMeshFromTileID(e,n,s,l,d){const f=(d==="stencil"?ra.stencil:ra.tile).getGranularityForZoomLevel(n.z);return this._getMesh(e,{granularity:f,generateBorders:s,extendToNorthPole:n.y===0&&l,extendToSouthPole:n.y===(1<<n.z)-1&&l})}_getMesh(e,n){const s=this._getMeshKey(n);if(s in this._tileMeshCache)return this._tileMeshCache[s];const l=(function(d,f){const g=Oa(f,"16bit"),y=c.aL.deserialize({arrayBuffer:g.vertices,length:g.vertices.byteLength/2/2}),b=c.aN.deserialize({arrayBuffer:g.indices,length:g.indices.byteLength/2/3});return new Qn(d.createVertexBuffer(y,bi.members),d.createIndexBuffer(b),c.aM.simpleSegment(0,0,y.length,b.length))})(e,n);return this._tileMeshCache[s]=l,l}recalculate(e){}hasTransition(){const e=Ze.now();let n=!1;return n=n||(e-this._errorMeasurementLastChangeTime)/1e3<.7,n=n||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,n}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}const Eo=new c.r({type:new c.D(c.v.projection.type)});class xs extends c.E{constructor(e){super(),this._transitionable=new c.t(Eo,void 0),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.F(0)),this._mercatorProjection=new Ra,this._verticalPerspectiveProjection=new ja}get transitionState(){const e=this.properties.get("type");if(typeof e=="string"&&e==="mercator")return 0;if(typeof e=="string"&&e==="vertical-perspective")return 1;if(e instanceof c.bm){if(e.from==="vertical-perspective"&&e.to==="mercator")return 1-e.transition;if(e.from==="mercator"&&e.to==="vertical-perspective")return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,n,s,l,d){return this.currentProjection.getMeshFromTileID(e,n,s,l,d)}setProjection(e){this._transitionable.setValue("type",(e==null?void 0:e.type)||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function Va(h){const e=Cn(h.worldSize,h.center.lat);return 2*Math.PI*e}function Cr(h,e,n,s,l){const d=1/(1<<l),f=e/c.$*d+s*d,g=c.bo((h/c.$*d+n*d)*Math.PI*2+Math.PI,2*Math.PI),y=2*Math.atan(Math.exp(Math.PI-f*Math.PI*2))-.5*Math.PI,b=Math.cos(y),w=new Float64Array(3);return w[0]=Math.sin(g)*b,w[1]=Math.sin(y),w[2]=Math.cos(g)*b,w}function ei(h){return(function(e,n){const s=Math.cos(n),l=new Float64Array(3);return l[0]=Math.sin(e)*s,l[1]=Math.sin(n),l[2]=Math.cos(e)*s,l})(h.lng*Math.PI/180,h.lat*Math.PI/180)}function Cn(h,e){return h/(2*Math.PI)/Math.cos(e*Math.PI/180)}function Na(h){const e=Math.asin(h[1])/Math.PI*180,n=Math.sqrt(h[0]*h[0]+h[2]*h[2]);if(n>1e-6){const s=h[0]/n,l=Math.acos(h[2]/n),d=(s>0?l:-l)/Math.PI*180;return new c.S(c.aO(d,-180,180),e)}return new c.S(0,e)}function Jr(h){return Math.cos(h*Math.PI/180)}function ti(h,e){const n=Jr(h),s=Jr(e);return c.ak(s/n)}function vs(h,e){const n=h.rotate(e.bearingInRadians),s=e.zoom+ti(e.center.lat,0),l=c.bk(1/Jr(e.center.lat),1/Jr(Math.min(Math.abs(e.center.lat),60)),c.bn(s,7,3,0,1)),d=360/Va({worldSize:e.worldSize,center:{lat:e.center.lat}});return new c.S(e.center.lng-n.x*d*l,c.ah(e.center.lat+n.y*d,-c.ai,c.ai))}function bs(h){const e=.5*h,n=Math.sin(e),s=Math.cos(e);return Math.log(n+s)-Math.log(s-n)}function Ol(h,e,n,s){const l=h.lat+n*s;if(Math.abs(n)>1){const d=(Math.sign(h.lat+n)!==Math.sign(h.lat)?-Math.abs(h.lat):Math.abs(h.lat))*Math.PI/180,f=Math.abs(h.lat+n)*Math.PI/180,g=bs(d+s*(f-d)),y=bs(d),b=bs(f);return new c.S(h.lng+e*((g-y)/(b-y)),l)}return new c.S(h.lng+e*s,l)}class Kc{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;const e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,n,s,l){const d="".concat(e.z,"_").concat(e.x,"_").concat(e.y,"_").concat(l!=null&&l.terrain?"t":""),f=this._cache.get(d);if(f)return f;const g=this._cachePrevious.get(d);if(g)return this._cache.set(d,g),g;const y=this._boundingVolumeFactory(e,n,s,l);return this._cache.set(d,y),this._hadAnyChanges=!0,y}}class Xt{constructor(e,n,s,l){this.min=s,this.max=l,this.points=e,this.planes=n}static fromAabb(e,n){const s=[];for(let l=0;l<8;l++)s.push([1&~l?e[0]:n[0],(l>>1&1)==1?n[1]:e[1],(l>>2&1)==1?n[2]:e[2]]);return new Xt(s,[[-1,0,0,n[0]],[1,0,0,-e[0]],[0,-1,0,n[1]],[0,1,0,-e[1]],[0,0,-1,n[2]],[0,0,1,-e[2]]],e,n)}static fromCenterSizeAngles(e,n,s){const l=c.br([],s[0],s[1],s[2]),d=c.bs([],[n[0],0,0],l),f=c.bs([],[0,n[1],0],l),g=c.bs([],[0,0,n[2]],l),y=[...e],b=[...e];for(let S=0;S<8;S++)for(let P=0;P<3;P++){const I=e[P]+d[P]*(1&~S?-1:1)+f[P]*((S>>1&1)==1?1:-1)+g[P]*((S>>2&1)==1?1:-1);y[P]=Math.min(y[P],I),b[P]=Math.max(b[P],I)}const w=[];for(let S=0;S<8;S++){const P=[...e];c.aS(P,P,c.aR([],d,1&~S?-1:1)),c.aS(P,P,c.aR([],f,(S>>1&1)==1?1:-1)),c.aS(P,P,c.aR([],g,(S>>2&1)==1?1:-1)),w.push(P)}return new Xt(w,[[...d,-c.aX(d,w[0])],[...f,-c.aX(f,w[0])],[...g,-c.aX(g,w[0])],[-d[0],-d[1],-d[2],-c.aX(d,w[7])],[-f[0],-f[1],-f[2],-c.aX(f,w[7])],[-g[0],-g[1],-g[2],-c.aX(g,w[7])]],y,b)}intersectsFrustum(e){let n=!0;const s=this.points.length,l=this.planes.length,d=e.planes.length,f=e.points.length;for(let g=0;g<d;g++){const y=e.planes[g];let b=0;for(let w=0;w<s;w++){const S=this.points[w];y[0]*S[0]+y[1]*S[1]+y[2]*S[2]+y[3]>=0&&b++}if(b===0)return 0;b<s&&(n=!1)}if(n)return 2;for(let g=0;g<l;g++){const y=this.planes[g];let b=0;for(let w=0;w<f;w++){const S=e.points[w];y[0]*S[0]+y[1]*S[1]+y[2]*S[2]+y[3]>=0&&b++}if(b===0)return 0}return 1}intersectsPlane(e){const n=this.points.length;let s=0;for(let l=0;l<n;l++){const d=this.points[l];e[0]*d[0]+e[1]*d[1]+e[2]*d[2]+e[3]>=0&&s++}return s===n?2:s===0?0:1}}function na(h,e,n){const s=h-e;return s<0?-s:Math.max(0,s-n)}function Qi(h,e,n,s,l){const d=h-n;let f;return f=d<0?Math.min(-d,1+d-l):d>1?Math.min(Math.max(d-l,0),1-d):0,Math.max(f,na(e,s,l))}class ws{constructor(){this._boundingVolumeCache=new Kc(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,n,s,l){const d=1<<s.z,f=1/d,g=s.x/d,y=s.y/d;let b=2;return b=Math.min(b,Qi(e,n,g,y,f)),b=Math.min(b,Qi(e,n,g+.5,-y-f,f)),b=Math.min(b,Qi(e,n,g+.5,2-y-f,f)),b}getWrap(e,n,s){const l=1<<n.z,d=1/l,f=n.x/l,g=na(e.x,f,d),y=na(e.x,f-1,d),b=na(e.x,f+1,d),w=Math.min(g,y,b);return w===b?1:w===y?-1:0}allowVariableZoom(e,n){return ne(e,n)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,n,s,l){return this._boundingVolumeCache.getTileBoundingVolume(e,n,s,l)}_computeTileBoundingVolume(e,n,s,l){var d,f;let g=0,y=0;if(l!=null&&l.terrain){const b=new c.Z(e.z,n,e.z,e.x,e.y),w=l.terrain.getMinMaxElevation(b);g=(d=w.minElevation)!==null&&d!==void 0?d:Math.min(0,s),y=(f=w.maxElevation)!==null&&f!==void 0?f:Math.max(0,s)}if(g/=c.bu,y/=c.bu,g+=1,y+=1,e.z<=0)return Xt.fromAabb([-y,-y,-y],[y,y,y]);if(e.z===1)return Xt.fromAabb([e.x===0?-y:0,e.y===0?0:-y,-y],[e.x===0?0:y,e.y===0?y:0,y]);{const b=[Cr(0,0,e.x,e.y,e.z),Cr(c.$,0,e.x,e.y,e.z),Cr(c.$,c.$,e.x,e.y,e.z),Cr(0,c.$,e.x,e.y,e.z)],w=[];for(const le of b)w.push(c.aR([],le,y));if(y!==g)for(const le of b)w.push(c.aR([],le,g));e.y===0&&w.push([0,1,0]),e.y===(1<<e.z)-1&&w.push([0,-1,0]);const S=[1,1,1],P=[-1,-1,-1];for(const le of w)for(let ce=0;ce<3;ce++)S[ce]=Math.min(S[ce],le[ce]),P[ce]=Math.max(P[ce],le[ce]);const I=Cr(c.$/2,c.$/2,e.x,e.y,e.z),D=c.aW([],[0,1,0],I);c.aV(D,D);const B=c.aW([],I,D);c.aV(B,B);const O=c.aW([],b[2],b[1]);c.aV(O,O);const j=c.aW([],b[0],b[3]);c.aV(j,j),w.push(c.aR([],I,y)),e.y>=(1<<e.z)/2&&w.push(c.aR([],Cr(c.$/2,0,e.x,e.y,e.z),y)),e.y<(1<<e.z)/2&&w.push(c.aR([],Cr(c.$/2,c.$,e.x,e.y,e.z),y));const N=Ao(I,w),$=Ao(B,w),U=[-I[0],-I[1],-I[2],N.max],W=[I[0],I[1],I[2],-N.min],K=[-B[0],-B[1],-B[2],$.max],Z=[B[0],B[1],B[2],-$.min],ee=[...O,0],he=[...j,0],se=[];return e.y===0?se.push(c.bt(he,ee,U),c.bt(he,ee,W)):se.push(c.bt(K,ee,U),c.bt(K,ee,W),c.bt(K,he,U),c.bt(K,he,W)),e.y===(1<<e.z)-1?se.push(c.bt(he,ee,U),c.bt(he,ee,W)):se.push(c.bt(Z,ee,U),c.bt(Z,ee,W),c.bt(Z,he,U),c.bt(Z,he,W)),new Xt(se,[U,W,K,Z,ee,he],S,P)}}}function Ao(h,e){let n=1/0,s=-1/0;for(const l of e){const d=c.aX(h,l);n=Math.min(n,d),s=Math.max(s,d)}return{min:n,max:s}}class Ua{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,n,s){return this._helper.interpolatePadding(e,n,s)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,n){this._helper.resize(e,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,n){this._helper.overrideNearFarZ(e,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(){this._cachedClippingPlane=c.bv(),this._projectionMatrix=c.b9(),this._globeViewProjMatrix32f=c.b8(),this._globeViewProjMatrixNoCorrection=c.b9(),this._globeViewProjMatrixNoCorrectionInverted=c.b9(),this._globeProjMatrixInverted=c.b9(),this._cameraPosition=c.bp(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new ci({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,n)=>this.getConstrained(e,n)}),this._coveringTilesDetailsProvider=new ws}clone(){const e=new Ua;return e.apply(this),e}apply(e,n){this._globeLatitudeErrorCorrectionRadians=n||0,this._helper.apply(e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const e=c.bp();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){const{overscaledTileID:n,applyGlobeMatrix:s}=e,l=this._helper.getMercatorTileCoordinates(n);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:l,clippingPlane:this._cachedClippingPlane,projectionTransition:s?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){const n=this.pitchInRadians,s=this.cameraToCenterDistance/e,l=Math.sin(n)*s,d=Math.cos(n)*s+1,f=1/Math.sqrt(l*l+d*d)*1;let g=-l,y=d;const b=Math.sqrt(g*g+y*y);g/=b,y/=b;const w=[0,g,y];c.bw(w,w,[0,0,0],-this.bearingInRadians),c.bx(w,w,[0,0,0],-1*this.center.lat*Math.PI/180),c.by(w,w,[0,0,0],this.center.lng*Math.PI/180);const S=1/c.aZ(w);return c.aR(w,w,S),[...w,-f*S]}isLocationOccluded(e){return!this.isSurfacePointVisible(ei(e))}transformLightDirection(e){const n=this._helper._center.lng*Math.PI/180,s=this._helper._center.lat*Math.PI/180,l=Math.cos(s),d=[Math.sin(n)*l,Math.sin(s),Math.cos(n)*l],f=[d[2],0,-d[0]],g=[0,0,0];c.aW(g,f,d),c.aV(f,f),c.aV(g,g);const y=[0,0,0];return c.aV(y,[f[0]*e[0]+g[0]*e[1]+d[0]*e[2],f[1]*e[0]+g[1]*e[1]+d[1]*e[2],f[2]*e[0]+g[2]*e[1]+d[2]*e[2]]),y}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,n,s){const l=(function(g,y,b){const w=1/(1<<b.z);return new c.a1(g/c.$*w+b.x*w,y/c.$*w+b.y*w)})(e,n,s.canonical),d=(f=l.y,[c.bo(l.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-f*Math.PI*2))-.5*Math.PI]);var f;return this.getCircleRadiusCorrection()/Math.cos(d[1])}projectTileCoordinates(e,n,s,l){const d=s.canonical,f=Cr(e,n,d.x,d.y,d.z),g=1+(l?l(e,n):0)/c.bu,y=[f[0]*g,f[1]*g,f[2]*g,1];c.aw(y,y,this._globeViewProjMatrixNoCorrection);const b=this._cachedClippingPlane,w=b[0]*f[0]+b[1]*f[1]+b[2]*f[2]+b[3]<0;return{point:new c.P(y[0]/y[3],y[1]/y[3]),signedDistanceFromCamera:y[3],isOccluded:w}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const e=Cn(this.worldSize,this.center.lat),n=c.ba(),s=c.ba();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),c.b4(n,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const l=this.centerOffset;n[8]=2*-l.x/this._helper._width,n[9]=2*l.y/this._helper._height,this._projectionMatrix=c.b5(n),this._globeProjMatrixInverted=c.ba(),c.aq(this._globeProjMatrixInverted,n),c.M(n,n,[0,0,-this.cameraToCenterDistance]),c.b6(n,n,this.rollInRadians),c.b7(n,n,-this.pitchInRadians),c.b6(n,n,this.bearingInRadians),c.M(n,n,[0,0,-e]);const d=c.bp();d[0]=e,d[1]=e,d[2]=e,c.b7(s,n,this.center.lat*Math.PI/180),c.bz(s,s,-this.center.lng*Math.PI/180),c.N(s,s,d),this._globeViewProjMatrixNoCorrection=s,c.b7(n,n,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),c.bz(n,n,-this.center.lng*Math.PI/180),c.N(n,n,d),this._globeViewProjMatrix32f=new Float32Array(n),this._globeViewProjMatrixNoCorrectionInverted=c.ba(),c.aq(this._globeViewProjMatrixNoCorrectionInverted,s);const f=c.bp();this._cameraPosition=c.bp(),this._cameraPosition[2]=this.cameraToCenterDistance/e,c.bw(this._cameraPosition,this._cameraPosition,f,-this.rollInRadians),c.bx(this._cameraPosition,this._cameraPosition,f,this.pitchInRadians),c.bw(this._cameraPosition,this._cameraPosition,f,-this.bearingInRadians),c.aS(this._cameraPosition,this._cameraPosition,[0,0,1]),c.bx(this._cameraPosition,this._cameraPosition,f,-this.center.lat*Math.PI/180),c.by(this._cameraPosition,this._cameraPosition,f,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);const g=c.b5(this._globeViewProjMatrixNoCorrectionInverted);c.N(g,g,[1,1,-1]),this._cachedFrustum=vt.fromInvProjectionMatrix(g,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){c.w("calculateFogMatrix is not supported on globe projection.");const n=c.ba();return c.ag(n),n}getVisibleUnwrappedCoordinates(e){return[new c.b2(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&c.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,n){if(!this._globeViewProjMatrixNoCorrection)return 1;const s=ei(e);c.aR(s,s,1+n/c.bu);const l=c.bv();return c.aw(l,[s[0],s[1],s[2],1],this._globeViewProjMatrixNoCorrection),l[2]/l[3]}populateCache(e){}getBounds(){const e=.5*this.width,n=.5*this.height,s=[new c.P(0,0),new c.P(e,0),new c.P(this.width,0),new c.P(this.width,n),new c.P(this.width,this.height),new c.P(e,this.height),new c.P(0,this.height),new c.P(0,n)],l=[];for(const S of s)l.push(this.unprojectScreenPoint(S));let d=0,f=0,g=0,y=0;const b=this.center;for(const S of l){const P=c.bA(b.lng,S.lng),I=c.bA(b.lat,S.lat);P<f&&(f=P),P>d&&(d=P),I<y&&(y=I),I>g&&(g=I)}const w=[b.lng+f,b.lat+y,b.lng+d,b.lat+g];return this.isSurfacePointOnScreen([0,1,0])&&(w[3]=90,w[0]=-180,w[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(w[1]=-90,w[0]=-180,w[2]=180),new Dt(w)}getConstrained(e,n){const s=c.ah(e.lat,-c.ai,c.ai),l=c.ah(+n,this.minZoom+ti(0,s),this.maxZoom);return{center:new c.S(e.lng,s),zoom:l}}calculateCenterFromCameraLngLatAlt(e,n,s,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,n,s,l)}setLocationAtPoint(e,n){const s=ei(this.unprojectScreenPoint(n)),l=ei(e),d=c.bp();c.bB(d);const f=c.bp();c.by(f,s,d,-this.center.lng*Math.PI/180),c.bx(f,f,d,this.center.lat*Math.PI/180);const g=l[0]*l[0]+l[2]*l[2],y=f[0]*f[0];if(g<y)return;const b=Math.sqrt(g-y),w=-b,S=c.bC(l[0],l[2],f[0],b),P=c.bC(l[0],l[2],f[0],w),I=c.bp();c.by(I,l,d,-S);const D=c.bC(I[1],I[2],f[1],f[2]),B=c.bp();c.by(B,l,d,-P);const O=c.bC(B[1],B[2],f[1],f[2]),j=.5*Math.PI,N=D>=-j&&D<=j,$=O>=-j&&O<=j;let U,W;if(N&&$){const he=this.center.lng*Math.PI/180,se=this.center.lat*Math.PI/180;c.bD(S,he)+c.bD(D,se)<c.bD(P,he)+c.bD(O,se)?(U=S,W=D):(U=P,W=O)}else if(N)U=S,W=D;else{if(!$)return;U=P,W=O}const K=U/Math.PI*180,Z=W/Math.PI*180,ee=this.center.lat;this.setCenter(new c.S(K,c.ah(Z,-90,90))),this.setZoom(this.zoom+ti(ee,this.center.lat))}locationToScreenPoint(e,n){const s=ei(e);if(n){const l=n.getElevationForLngLatZoom(e,this._helper._tileZoom);c.aR(s,s,1+l/c.bu)}return this._projectSurfacePointToScreen(s)}_projectSurfacePointToScreen(e){const n=c.bv();return c.aw(n,[...e,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],new c.P((.5*n[0]+.5)*this.width,(.5*-n[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,n){if(n){const s=n.pointCoordinate(e);if(s)return s}return c.a1.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,n){var s;return(s=this.screenPointToMercatorCoordinate(e,n))===null||s===void 0?void 0:s.toLngLat()}isPointOnMapSurface(e,n){const s=this._cameraPosition,l=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(s,l)}getRayDirectionFromPixel(e){const n=c.bv();n[0]=e.x/this.width*2-1,n[1]=-1*(e.y/this.height*2-1),n[2]=1,n[3]=1,c.aw(n,n,this._globeViewProjMatrixNoCorrectionInverted),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3];const s=c.bp();s[0]=n[0]-this._cameraPosition[0],s[1]=n[1]-this._cameraPosition[1],s[2]=n[2]-this._cameraPosition[2];const l=c.bp();return c.aV(l,s),l}isSurfacePointVisible(e){const n=this._cachedClippingPlane;return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;const n=c.bv();return c.aw(n,[...e,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3],n[0]>-1&&n[0]<1&&n[1]>-1&&n[1]<1&&n[2]>-1&&n[2]<1}rayPlanetIntersection(e,n){const s=c.aX(e,n),l=c.bp(),d=c.bp();c.aR(d,n,s),c.aU(l,e,d);const f=1-c.aX(l,l);if(f<0)return null;const g=c.aX(e,e)-1,y=-s+(s<0?1:-1)*Math.sqrt(f),b=g/y,w=y;return{tMin:Math.min(b,w),tMax:Math.max(b,w)}}unprojectScreenPoint(e){const n=this._cameraPosition,s=this.getRayDirectionFromPixel(e),l=this.rayPlanetIntersection(n,s);if(l){const w=c.bp();c.aS(w,n,[s[0]*l.tMin,s[1]*l.tMin,s[2]*l.tMin]);const S=c.bp();return c.aV(S,w),Na(S)}const d=this._cachedClippingPlane,f=d[0]*s[0]+d[1]*s[1]+d[2]*s[2],g=-c.b1(d,n)/f,y=c.bp();if(g>0)c.aS(y,n,[s[0]*g,s[1]*g,s[2]*g]);else{const w=c.bp();c.aS(w,n,[2*s[0],2*s[1],2*s[2]]);const S=c.b1(this._cachedClippingPlane,w);c.aU(y,w,[this._cachedClippingPlane[0]*S,this._cachedClippingPlane[1]*S,this._cachedClippingPlane[2]*S])}const b=(function(w){const S=c.bp();return S[0]=w[0]*-w[3],S[1]=w[1]*-w[3],S[2]=w[2]*-w[3],{center:S,radius:Math.sqrt(1-w[3]*w[3])}})(d);return Na((function(w,S,P){const I=c.bp();c.aU(I,P,w);const D=c.bp();return c.bq(D,w,I,S/c.a$(I)),D})(b.center,b.radius,y))}getMatrixForModel(e,n){const s=c.S.convert(e),l=1/c.bu,d=c.b9();return c.bz(d,d,s.lng/180*Math.PI),c.b7(d,d,-s.lat/180*Math.PI),c.M(d,d,[0,0,1+n/c.bu]),c.b7(d,d,.5*Math.PI),c.N(d,d,[l,l,l]),d}getProjectionDataForCustomLayer(e=!0){const n=this.getProjectionData({overscaledTileID:new c.Z(0,0,0,0,0),applyGlobeMatrix:e});return n.tileMercatorCoords=[0,0,1,1],n}getFastPathSimpleProjectionMatrix(e){}}class Lr{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,n,s){return this._helper.interpolatePadding(e,n,s)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,n,s=!0){this._helper.resize(e,n,s)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}
vendor: 6,260 bytes, line 5
5overrideNearFarZ(e,n){this._helper.overrideNearFarZ(e,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e,n){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=n,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new ci({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,n)=>this.getConstrained(e,n)}),this._globeness=1,this._mercatorTransform=new ta,this._verticalPerspectiveTransform=new Ua}clone(){const e=new Lr;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this),e}apply(e){this._helper.apply(e),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){const n=this._mercatorTransform.getProjectionData(e),s=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?s.mainMatrix:n.mainMatrix,clippingPlane:s.clippingPlane,tileMercatorCoords:s.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:n.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return c.bk(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return c.bk(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,n,s){const l=this._mercatorTransform.getPitchedTextCorrection(e,n,s),d=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,n,s);return c.bk(l,d,this._globeness)}projectTileCoordinates(e,n,s,l){return this.currentTransform.projectTileCoordinates(e,n,s,l)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,n){return this.currentTransform.lngLatToCameraDepth(e,n)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}getConstrained(e,n){return this.currentTransform.getConstrained(e,n)}calculateCenterFromCameraLngLatAlt(e,n,s,l){return this._helper.calculateCenterFromCameraLngLatAlt(e,n,s,l)}setLocationAtPoint(e,n){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,n),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(e,n),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(e,n){return this.currentTransform.locationToScreenPoint(e,n)}screenPointToMercatorCoordinate(e,n){return this.currentTransform.screenPointToMercatorCoordinate(e,n)}screenPointToLocation(e,n){return this.currentTransform.screenPointToLocation(e,n)}
vendor: 17,019 bytes, line 5
5isPointOnMapSurface(e,n){return this.currentTransform.isPointOnMapSurface(e,n)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,n){return this.currentTransform.getMatrixForModel(e,n)}getProjectionDataForCustomLayer(e=!0){const n=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return n;const s=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return s.fallbackMatrix=n.mainMatrix,s}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class hr{get useGlobeControls(){return!0}handlePanInertia(e,n){const s=vs(e,n);return Math.abs(s.lng-n.center.lng)>180&&(s.lng=n.center.lng+179.5*Math.sign(s.lng-n.center.lng)),{easingCenter:s,easingOffset:new c.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,n){const s=e.around,l=n.screenPointToLocation(s);e.bearingDelta&&n.setBearing(n.bearing+e.bearingDelta),e.pitchDelta&&n.setPitch(n.pitch+e.pitchDelta),e.rollDelta&&n.setRoll(n.roll+e.rollDelta);const d=n.zoom;e.zoomDelta&&n.setZoom(n.zoom+e.zoomDelta);const f=n.zoom-d;if(f===0)return;const g=c.bA(n.center.lng,l.lng),y=g/(Math.abs(g/180)+1),b=c.bA(n.center.lat,l.lat),w=n.getRayDirectionFromPixel(s),S=n.cameraPosition,P=-1*c.aX(S,w),I=c.bp();c.aS(I,S,[w[0]*P,w[1]*P,w[2]*P]);const D=c.aZ(I)-1,B=Math.exp(.5*-Math.max(D-.3,0)),O=Cn(n.worldSize,n.center.lat)/Math.min(n.width,n.height),j=c.bn(O,.9,.5,1,.25),N=(1-c.af(-f))*Math.min(B,j),$=n.center.lat,U=n.zoom,W=new c.S(n.center.lng+y*N,c.ah(n.center.lat+b*N,-c.ai,c.ai));n.setLocationAtPoint(l,s);const K=n.center,Z=c.bn(Math.abs(g),45,85,0,1),ee=c.bn(O,.75,.35,0,1),he=Math.pow(Math.max(Z,ee),.25),se=c.bA(K.lng,W.lng),le=c.bA(K.lat,W.lat);n.setCenter(new c.S(K.lng+se*he,K.lat+le*he).wrap()),n.setZoom(U+ti($,n.center.lat))}handleMapControlsPan(e,n,s){if(!e.panDelta)return;const l=n.center.lat,d=n.zoom;n.setCenter(vs(e.panDelta,n).wrap()),n.setZoom(d+ti(l,n.center.lat))}cameraForBoxAndBearing(e,n,s,l,d){const f=zi(e,n,s,l,d),g=n.left/d.width*2-1,y=(d.width-n.right)/d.width*2-1,b=n.top/d.height*-2+1,w=(d.height-n.bottom)/d.height*-2+1,S=c.bA(s.getWest(),s.getEast())<0,P=S?s.getEast():s.getWest(),I=S?s.getWest():s.getEast(),D=Math.max(s.getNorth(),s.getSouth()),B=Math.min(s.getNorth(),s.getSouth()),O=P+.5*c.bA(P,I),j=D+.5*c.bA(D,B),N=d.clone();N.setCenter(f.center),N.setBearing(f.bearing),N.setPitch(0),N.setRoll(0),N.setZoom(f.zoom);const $=N.modelViewProjectionMatrix,U=[ei(s.getNorthWest()),ei(s.getNorthEast()),ei(s.getSouthWest()),ei(s.getSouthEast()),ei(new c.S(I,j)),ei(new c.S(P,j)),ei(new c.S(O,D)),ei(new c.S(O,B))],W=ei(f.center);let K=Number.POSITIVE_INFINITY;for(const Z of U)g<0&&(K=hr.getLesserNonNegativeNonNull(K,hr.solveVectorScale(Z,W,$,"x",g))),y>0&&(K=hr.getLesserNonNegativeNonNull(K,hr.solveVectorScale(Z,W,$,"x",y))),b>0&&(K=hr.getLesserNonNegativeNonNull(K,hr.solveVectorScale(Z,W,$,"y",b))),w<0&&(K=hr.getLesserNonNegativeNonNull(K,hr.solveVectorScale(Z,W,$,"y",w)));if(Number.isFinite(K)&&K!==0)return f.zoom=N.zoom+c.ak(K),f;wi()}handleJumpToCenterZoom(e,n){const s=e.center.lat,l=e.getConstrained(n.center?c.S.convert(n.center):e.center,e.zoom).center;e.setCenter(l.wrap());const d=n.zoom!==void 0?+n.zoom:e.zoom+ti(s,l.lat);e.zoom!==d&&e.setZoom(d)}handleEaseTo(e,n){const s=e.zoom,l=e.center,d=e.padding,f={roll:e.roll,pitch:e.pitch,bearing:e.bearing},g={roll:n.roll===void 0?e.roll:n.roll,pitch:n.pitch===void 0?e.pitch:n.pitch,bearing:n.bearing===void 0?e.bearing:n.bearing},y=n.zoom!==void 0,b=!e.isPaddingEqual(n.padding);let w=!1;const S=n.center?c.S.convert(n.center):l,P=e.getConstrained(S,s).center;ea(e,P);const I=e.clone();I.setCenter(P),I.setZoom(y?+n.zoom:s+ti(l.lat,S.lat)),I.setBearing(n.bearing);const D=new c.P(c.ah(e.centerPoint.x+n.offsetAsPoint.x,0,e.width),c.ah(e.centerPoint.y+n.offsetAsPoint.y,0,e.height));I.setLocationAtPoint(P,D);const B=(n.offset&&n.offsetAsPoint.mag())>0?I.center:P,O=y?+n.zoom:s+ti(l.lat,B.lat),j=s+ti(l.lat,0),N=O+ti(B.lat,0),$=c.bA(l.lng,B.lng),U=c.bA(l.lat,B.lat),W=c.af(N-j);return w=O!==s,{easeFunc:K=>{if(c.be(f,g)||Ni({startEulerAngles:f,endEulerAngles:g,tr:e,k:K,useSlerp:f.roll!=g.roll}),b&&e.interpolatePadding(d,n.padding,K),n.around)c.w("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(n.around,n.aroundPoint);else{const Z=N>j?Math.min(2,W):Math.max(.5,W),ee=Math.pow(Z,1-K),he=Ol(l,$,U,K*ee);e.setCenter(he.wrap())}if(w){const Z=c.C.number(j,N,K)+ti(0,e.center.lat);e.setZoom(Z)}},isZooming:w,elevationCenter:B}}handleFlyTo(e,n){const s=n.zoom!==void 0,l=e.center,d=e.zoom,f=e.padding,g=!e.isPaddingEqual(n.padding),y=e.getConstrained(c.S.convert(n.center||n.locationAtOffset),d).center,b=s?+n.zoom:e.zoom+ti(e.center.lat,y.lat),w=e.clone();w.setCenter(y),w.setZoom(b),w.setBearing(n.bearing);const S=new c.P(c.ah(e.centerPoint.x+n.offsetAsPoint.x,0,e.width),c.ah(e.centerPoint.y+n.offsetAsPoint.y,0,e.height));w.setLocationAtPoint(y,S);const P=w.center;ea(e,P);const I=(function(U,W,K){const Z=ei(W),ee=ei(K),he=c.aX(Z,ee),se=Math.acos(he),le=Va(U);return se/(2*Math.PI)*le})(e,l,P),D=d+ti(l.lat,0),B=b+ti(P.lat,0),O=c.af(B-D);let j;if(typeof n.minZoom=="number"){const U=+n.minZoom+ti(P.lat,0),W=Math.min(U,D,B)+ti(0,P.lat),K=e.getConstrained(P,W).zoom+ti(P.lat,0);j=c.af(K-D)}const N=c.bA(l.lng,P.lng),$=c.bA(l.lat,P.lat);return{easeFunc:(U,W,K,Z)=>{const ee=Ol(l,N,$,K);g&&e.interpolatePadding(f,n.padding,U);const he=U===1?P:ee;e.setCenter(he.wrap());const se=D+c.ak(W);e.setZoom(U===1?b:se+ti(0,he.lat))},scaleOfZoom:O,targetCenter:P,scaleOfMinZoom:j,pixelPathLength:I}}static solveVectorScale(e,n,s,l,d){const f=l==="x"?[s[0],s[4],s[8],s[12]]:[s[1],s[5],s[9],s[13]],g=[s[3],s[7],s[11],s[15]],y=e[0]*f[0]+e[1]*f[1]+e[2]*f[2],b=e[0]*g[0]+e[1]*g[1]+e[2]*g[2],w=n[0]*f[0]+n[1]*f[1]+n[2]*f[2],S=n[0]*g[0]+n[1]*g[1]+n[2]*g[2];return w+d*b===y+d*S||g[3]*(y-w)+f[3]*(S-b)+y*S==w*b?null:(w+f[3]-d*S-d*g[3])/(w-y-d*S+d*b)}static getLesserNonNegativeNonNull(e,n){return n!==null&&n>=0&&n<e?n:e}}class jl{constructor(e){this._globe=e,this._mercatorCameraHelper=new Fa,this._verticalPerspectiveCameraHelper=new hr}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,n){return this.currentHelper.handlePanInertia(e,n)}handleMapControlsRollPitchBearingZoom(e,n){return this.currentHelper.handleMapControlsRollPitchBearingZoom(e,n)}handleMapControlsPan(e,n,s){this.currentHelper.handleMapControlsPan(e,n,s)}cameraForBoxAndBearing(e,n,s,l,d){return this.currentHelper.cameraForBoxAndBearing(e,n,s,l,d)}handleJumpToCenterZoom(e,n){this.currentHelper.handleJumpToCenterZoom(e,n)}handleEaseTo(e,n){return this.currentHelper.handleEaseTo(e,n)}handleFlyTo(e,n){return this.currentHelper.handleFlyTo(e,n)}}const Ts=(h,e)=>c.y(h,e&&e.filter((n=>n.identifier!=="source.canvas"))),Jc=c.bE();class ko extends c.E{constructor(e,n={}){var s,l;super(),this._rtlPluginLoaded=()=>{for(const f in this.sourceCaches){const g=this.sourceCaches[f].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[f].reload()}},this.map=e,this.dispatcher=new Ci(gn(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((f,g)=>this.getGlyphs(f,g))),this.dispatcher.registerMessageHandler("GI",((f,g)=>this.getImages(f,g))),this.dispatcher.registerMessageHandler("GDA",((f,g)=>this.getDashes(f,g))),this.imageManager=new Wr,this.imageManager.setEventedParent(this);const d=((s=e._container)===null||s===void 0?void 0:s.lang)||typeof document<"u"&&((l=document.documentElement)===null||l===void 0?void 0:l.lang)||void 0;this.glyphManager=new or(e._requestManager,n.localIdeographFontFamily,d),this.lineAtlas=new ft(256,512),this.crossTileSymbolIndex=new Da,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.bF,this._loaded=!1,this._availableImages=[],this._globalState={},this._resetUpdates(),this.dispatcher.broadcast("SR",c.bG()),Kr().on(vn,this._rtlPluginLoaded),this.on("data",(f=>{if(f.dataType!=="source"||f.sourceDataType!=="metadata")return;const g=this.sourceCaches[f.sourceId];if(!g)return;const y=g.getSource();if(y&&y.vectorLayerIds)for(const b in this._layers){const w=this._layers[b];w.source===y.id&&this._validateLayer(w)}}))}setGlobalStateProperty(e,n){var s,l,d;this._checkLoaded();const f=n===null?(d=(l=(s=this.stylesheet.state)===null||s===void 0?void 0:s[e])===null||l===void 0?void 0:l.default)!==null&&d!==void 0?d:null:n;if(c.bH(f,this._globalState[e]))return this;this._globalState[e]=f,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();const n=[];for(const s in e)!c.bH(this._globalState[s],e[s].default)&&(n.push(s),this._globalState[s]=e[s].default);this._applyGlobalStateChanges(n)}_applyGlobalStateChanges(e){if(e.length===0)return;const n=new Set,s={};for(const l of e){s[l]=this._globalState[l];for(const d in this._layers){const f=this._layers[d],g=f.getLayoutAffectingGlobalStateRefs(),y=f.getPaintAffectingGlobalStateRefs();if(g.has(l)&&n.add(f.source),y.has(l))for(const{name:b,value:w}of y.get(l))this._updatePaintProperty(f,b,w)}}this.dispatcher.broadcast("UGS",s);for(const l in this.sourceCaches)n.has(l)&&(this._reloadSource(l),this._changed=!0)}loadURL(e,n={},s){this.fire(new c.l("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const l=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const d=this._loadStyleRequest;c.j(l,this._loadStyleRequest).then((f=>{this._loadStyleRequest=null,this._load(f.data,n,s)})).catch((f=>{this._loadStyleRequest=null,f&&!d.signal.aborted&&this.fire(new c.k(f))}))}loadJSON(e,n={},s){this.fire(new c.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Ze.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(e,n,s)})).catch((()=>{}))}loadEmpty(){this.fire(new c.l("dataloading",{dataType:"style"})),this._load(Jc,{validate:!1})}_load(e,n,s){var l,d;let f=n.transformStyle?n.transformStyle(s,e):e;if(!n.validate||!Ts(this,c.z(f))){f=Object.assign({},f),this._loaded=!0,this.stylesheet=f;for(const g in f.sources)this.addSource(g,f.sources[g],{validate:!1});f.sprite?this._loadSprite(f.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(f.glyphs),this._createLayers(),this.light=new Ne(this.stylesheet.light),this._setProjectionInternal(((l=this.stylesheet.projection)===null||l===void 0?void 0:l.type)||"mercator"),this.sky=new gs(this.stylesheet.sky),this.map.setTerrain((d=this.stylesheet.terrain)!==null&&d!==void 0?d:null),this.fire(new c.l("data",{dataType:"style"})),this.fire(new c.l("style.load"))}}_createLayers(){var e,n,s;const l=c.bI(this.stylesheet.layers);this.setGlobalState((e=this.stylesheet.state)!==null&&e!==void 0?e:null),this.dispatcher.broadcast("SL",l),this._order=l.map((d=>d.id)),this._layers={},this._serializedLayers=null;for(const d of l){const f=c.bJ(d,this._globalState);if(f.setEventedParent(this,{layer:{id:d.id}}),this._layers[d.id]=f,c.bK(f)&&this.sourceCaches[f.source]){const g=(s=(n=d.paint)===null||n===void 0?void 0:n["raster-fade-duration"])!==null&&s!==void 0?s:f.paint.get("raster-fade-duration");this.sourceCaches[f.source].setRasterFadeDuration(g)}}}_loadSprite(e,n=!1,s=void 0){let l;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(d,f,g,y){return c._(this,void 0,void 0,(function*(){const b=Xi(d),w=g>1?"@2x":"",S={},P={};for(const{id:I,url:D}of b){const B=f.transformRequest(kr(D,w,".json"),"SpriteJSON");S[I]=c.j(B,y);const O=f.transformRequest(kr(D,w,".png"),"SpriteImage");P[I]=mi.getImage(O,y)}return yield Promise.all([...Object.values(S),...Object.values(P)]),(function(I,D){return c._(this,void 0,void 0,(function*(){const B={};for(const O in I){B[O]={};const j=Ze.getImageCanvasContext((yield D[O]).data),N=(yield I[O]).data;for(const $ in N){const{width:U,height:W,x:K,y:Z,sdf:ee,pixelRatio:he,stretchX:se,stretchY:le,content:ce,textFitWidth:we,textFitHeight:Te}=N[$];B[O][$]={data:null,pixelRatio:he,sdf:ee,stretchX:se,stretchY:le,content:ce,textFitWidth:we,textFitHeight:Te,spriteData:{width:U,height:W,x:K,y:Z,context:j}}}}return B}))})(S,P)}))})(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((d=>{if(this._spriteRequest=null,d)for(const f in d){this._spritesImagesIds[f]=[];const g=this._spritesImagesIds[f]?this._spritesImagesIds[f].filter((y=>!(y in d))):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in d[f]){const b=f==="default"?y:"".concat(f,":").concat(y);this._spritesImagesIds[f].push(b),b in this.imageManager.images?this.imageManager.updateImage(b,d[f][y],!1):this.imageManager.addImage(b,d[f][y]),n&&(this._changedImages[b]=!0)}}})).catch((d=>{this._spriteRequest=null,l=d,this.fire(new c.k(l))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"})),s&&s(l)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}_validateLayer(e){const n=this.sourceCaches[e.source];if(!n)return;const s=e.sourceLayer;if(!s)return;const l=n.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(s)===-1)&&this.fire(new c.k(new Error('Source layer "'.concat(s,'" does not exist on source "').concat(l.id,'" as specified by style layer "').concat(e.id,'".'))))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){const s=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?c.bL(s):s);const l=[];for(const d of e)if(s[d]){const f=n?c.bL(s[d]):s[d];l.push(f)}return l}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const l=this._layers[s];l.type!=="custom"&&(e[s]=l.serialize())}return e}hasTransitions(){var e,n,s;if(!((e=this.light)===null||e===void 0)&&e.hasTransition()||!((n=this.sky)===null||n===void 0)&&n.hasTransition()||!((s=this.projection)===null||s===void 0)&&s.hasTransition())return!0;for(const l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(const l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const n=this._changed;if(n){const l=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);(l.length||d.length)&&this._updateWorkerLayers(l,d);for(const f in this._updatedSources){const g=this._updatedSources[f];if(g==="reload")this._reloadSource(f);else{if(g!=="clear")throw new Error("Invalid action ".concat(g));this._clearSource(f)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const f in this._updatedPaintProps)this._layers[f].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const s={};for(const l in this.sourceCaches){const d=this.sourceCaches[l];s[l]=d.used,d.used=!1}for(const l of this._order){const d=this._layers[l];d.recalculate(e,this._availableImages),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const l in s){const d=this.sourceCaches[l];!!s[l]!=!!d.used&&d.fire(new c.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,n&&this.fire(new c.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var s;this._checkLoaded();const l=this.serialize();if(e=n.transformStyle?n.transformStyle(l,e):e,((s=n.validate)===null||s===void 0||s)&&Ts(this,c.z(e)))return!1;
5(e=c.bL(e)).layers=c.bI(e.layers);const d=c.bM(l,e),f=this._getOperationsToPerform(d);if(f.unimplemented.length>0)throw new Error("Unimplemented: ".concat(f.unimplemented.join(", "),"."));if(f.operations.length===0)return!1;for(const g of f.operations)g();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const n=[],s=[];for(const l of e)switch(l.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":n.push((()=>this.addLayer.apply(this,l.args)));break;case"removeLayer":n.push((()=>this.removeLayer.apply(this,l.args)));break;case"setPaintProperty":n.push((()=>this.setPaintProperty.apply(this,l.args)));break;case"setLayoutProperty":n.push((()=>this.setLayoutProperty.apply(this,l.args)));break;case"setFilter":n.push((()=>this.setFilter.apply(this,l.args)));break;case"addSource":n.push((()=>this.addSource.apply(this,l.args)));break;case"removeSource":n.push((()=>this.removeSource.apply(this,l.args)));break;case"setLayerZoomRange":n.push((()=>this.setLayerZoomRange.apply(this,l.args)));break;case"setLight":n.push((()=>this.setLight.apply(this,l.args)));break;case"setGeoJSONSourceData":n.push((()=>this.setGeoJSONSourceData.apply(this,l.args)));break;case"setGlyphs":n.push((()=>this.setGlyphs.apply(this,l.args)));break;case"setSprite":n.push((()=>this.setSprite.apply(this,l.args)));break;case"setTerrain":n.push((()=>this.map.setTerrain.apply(this,l.args)));break;case"setSky":n.push((()=>this.setSky.apply(this,l.args)));break;case"setProjection":this.setProjection.apply(this,l.args);break;case"setGlobalState":n.push((()=>this.setGlobalState.apply(this,l.args)));break;case"setTransition":n.push((()=>{}));break;default:s.push(l.command)}return{operations:n,unimplemented:s}}addImage(e,n){if(this.getImage(e))return this.fire(new c.k(new Error('An image named "'.concat(e,'" already exists.'))));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,n){this.imageManager.updateImage(e,n)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new c.k(new Error('An image named "'.concat(e,'" does not exist.'))));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,s={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error('Source "'.concat(e,'" already exists.'));if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(n).join(", "),"."));if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(c.z.source,"sources.".concat(e),n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const l=this.sourceCaches[e]=new Re(e,n,this.dispatcher);l.style=this,l.setEventedParent(this,(()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:e}))),l.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===e)return this.fire(new c.k(new Error('Source "'.concat(e,'" cannot be removed while layer "').concat(s,'" is using it.'))));const n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new c.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,n){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID=".concat(e));const s=this.sourceCaches[e].getSource();if(s.type!=="geojson")throw new Error("geojsonSource.type is ".concat(s.type,", which is !== 'geojson"));s.setData(n),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,s={}){this._checkLoaded();const l=e.id;if(this.getLayer(l))return void this.fire(new c.k(new Error('Layer "'.concat(l,'" already exists on this map.'))));let d;if(e.type==="custom"){if(Ts(this,c.bN(e)))return;d=c.bJ(e,this._globalState)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(l,e.source),e=c.bL(e),e=c.e(e,{source:l}
vendor: 179,666 bytes, line 5
5)),this._validate(c.z.layer,"layers.".concat(l),e,{arrayIndex:-1},s))return;d=c.bJ(e,this._globalState),this._validateLayer(d),d.setEventedParent(this,{layer:{id:l}})}const f=n?this._order.indexOf(n):this._order.length;if(n&&f===-1)this.fire(new c.k(new Error('Cannot add layer "'.concat(l,'" before non-existing layer "').concat(n,'".'))));else{if(this._order.splice(f,0,l),this._layerOrderChanged=!0,this._layers[l]=d,this._removedLayers[l]&&d.source&&d.type!=="custom"){const g=this._removedLayers[l];delete this._removedLayers[l],g.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new c.k(new Error("The layer '".concat(e,"' does not exist in the map's style and cannot be moved."))));if(e===n)return;const s=this._order.indexOf(e);this._order.splice(s,1);const l=n?this._order.indexOf(n):this._order.length;n&&l===-1?this.fire(new c.k(new Error('Cannot move layer "'.concat(e,'" before non-existing layer "').concat(n,'".')))):(this._order.splice(l,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const n=this._layers[e];if(!n)return void this.fire(new c.k(new Error('Cannot remove non-existing layer "'.concat(e,'".'))));n.setEventedParent(null);const s=this._order.indexOf(e);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,s){this._checkLoaded();const l=this.getLayer(e);l?l.minzoom===n&&l.maxzoom===s||(n!=null&&(l.minzoom=n),s!=null&&(l.maxzoom=s),this._updateLayer(l)):this.fire(new c.k(new Error('Cannot set the zoom range of non-existing layer "'.concat(e,'".'))))}setFilter(e,n,s={}){this._checkLoaded();const l=this.getLayer(e);if(l){if(!c.bH(l.filter,n))return n==null?(l.setFilter(void 0),void this._updateLayer(l)):void(this._validate(c.z.filter,"layers.".concat(l.id,".filter"),n,null,s)||(l.setFilter(c.bL(n)),this._updateLayer(l)))}else this.fire(new c.k(new Error('Cannot filter non-existing layer "'.concat(e,'".'))))}getFilter(e){return c.bL(this.getLayer(e).filter)}setLayoutProperty(e,n,s,l={}){this._checkLoaded();const d=this.getLayer(e);d?c.bH(d.getLayoutProperty(n),s)||(d.setLayoutProperty(n,s,l),this._updateLayer(d)):this.fire(new c.k(new Error('Cannot style non-existing layer "'.concat(e,'".'))))}getLayoutProperty(e,n){const s=this.getLayer(e);if(s)return s.getLayoutProperty(n);this.fire(new c.k(new Error('Cannot get style of non-existing layer "'.concat(e,'".'))))}setPaintProperty(e,n,s,l={}){this._checkLoaded();const d=this.getLayer(e);d?c.bH(d.getPaintProperty(n),s)||this._updatePaintProperty(d,n,s,l):this.fire(new c.k(new Error('Cannot style non-existing layer "'.concat(e,'".'))))}_updatePaintProperty(e,n,s,l={}){e.setPaintProperty(n,s,l)&&this._updateLayer(e),c.bK(e)&&n==="raster-fade-duration"&&this.sourceCaches[e.source].setRasterFadeDuration(s),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,n){return this.getLayer(e).getPaintProperty(n)}setFeatureState(e,n){this._checkLoaded();const s=e.source,l=e.sourceLayer,d=this.sourceCaches[s];if(d===void 0)return void this.fire(new c.k(new Error("The source '".concat(s,"' does not exist in the map's style."))));const f=d.getSource().type;f==="geojson"&&l?this.fire(new c.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):f!=="vector"||l?(e.id===void 0&&this.fire(new c.k(new Error("The feature id parameter must be provided."))),d.setFeatureState(l,e.id,n)):this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,n){this._checkLoaded();const s=e.source,l=this.sourceCaches[s];if(l===void 0)return void this.fire(new c.k(new Error("The source '".concat(s,"' does not exist in the map's style."))));const d=l.getSource().type,f=d==="vector"?e.sourceLayer:void 0;d!=="vector"||f?n&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new c.k(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(f,e.id,n):this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const n=e.source,s=e.sourceLayer,l=this.sourceCaches[n];if(l!==void 0)return l.getSource().type!=="vector"||s?(e.id===void 0&&this.fire(new c.k(new Error("The feature id parameter must be provided."))),l.getFeatureState(s,e.id)):void this.fire(new c.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.k(new Error("The source '".concat(n,"' does not exist in the map's style."))))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=c.bO(this.sourceCaches,(d=>d.serialize())),n=this._serializeByIds(this._order,!0),s=this.map.getTerrain()||void 0,l=this.stylesheet;return c.bP({version:l.version,name:l.name,metadata:l.metadata,light:l.light,sky:l.sky,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,projection:l.projection,sources:e,layers:n,terrain:s},(d=>d!==void 0))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const n=f=>this._layers[f].type==="fill-extrusion",s={},l=[];for(let f=this._order.length-1;f>=0;f--){const g=this._order[f];if(n(g)){s[g]=f;for(const y of e){const b=y[g];if(b)for(const w of b)l.push(w)}}}l.sort(((f,g)=>g.intersectionZ-f.intersectionZ));const d=[];for(let f=this._order.length-1;f>=0;f--){const g=this._order[f];if(n(g))for(let y=l.length-1;y>=0;y--){const b=l[y].feature;if(s[b.layer.id]<f)break;d.push(b),l.pop()}else for(const y of e){const b=y[g];if(b)for(const w of b)d.push(w.feature)}}return d}queryRenderedFeatures(e,n,s){n&&n.filter&&this._validate(c.z.filter,"queryRenderedFeatures.filter",n.filter,null,n);const l={};if(n&&n.layers){if(!(Array.isArray(n.layers)||n.layers instanceof Set))return this.fire(new c.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const b of n.layers){const w=this._layers[b];if(!w)return this.fire(new c.k(new Error("The layer '".concat(b,"' does not exist in the map's style and cannot be queried for features.")))),[];l[w.source]=!0}}const d=[];n.availableImages=this._availableImages;const f=this._serializedAllLayers(),g=n.layers instanceof Set?n.layers:Array.isArray(n.layers)?new Set(n.layers):null,y=Object.assign(Object.assign({},n),{layers:g,globalState:this._globalState});for(const b in this.sourceCaches)n.layers&&!l[b]||d.push(lr(this.sourceCaches[b],this._layers,f,e,y,s,this.map.terrain?(w,S,P)=>this.map.terrain.getElevation(w,S,P):void 0));return this.placement&&d.push((function(b,w,S,P,I,D,B){const O={},j=D.queryRenderedSymbols(P),N=[];for(const $ of Object.keys(j).map(Number))N.push(B[$]);N.sort(Wn);for(const $ of N){const U=$.featureIndex.lookupSymbolFeatures(j[$.bucketInstanceId],w,$.bucketIndex,$.sourceLayerIndex,{filterSpec:I.filter,globalState:I.globalState},I.layers,I.availableImages,b);for(const W in U){const K=O[W]=O[W]||[],Z=U[W];Z.sort(((ee,he)=>{const se=$.featureSortOrder;if(se){const le=se.indexOf(ee.featureIndex);return se.indexOf(he.featureIndex)-le}return he.featureIndex-ee.featureIndex}));for(const ee of Z)K.push(ee)}}return(function($,U,W){for(const K in $)for(const Z of $[K])Hn(Z,W[U[K].source]);return $})(O,b,S)})(this._layers,f,this.sourceCaches,e,y,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(e,n){n!=null&&n.filter&&this._validate(c.z.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[e];return s?(function(l,d){const f=l.getRenderableIds().map((b=>l.getTileByID(b))),g=[],y={};for(let b=0;b<f.length;b++){const w=f[b],S=w.tileID.canonical.key;y[S]||(y[S]=!0,w.querySourceFeatures(g,d))}return g})(s,n?Object.assign(Object.assign({},n),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();const s=this.light.getLight();let l=!1;for(const f in e)if(!c.bH(e[f],s[f])){l=!0;break}if(!l)return;const d={now:Ze.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(d)}getProjection(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.projection}setProjection(e){if(this._checkLoaded(),this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=e,this._setProjectionInternal(e.type)}getSky(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.sky}setSky(e,n={}){this._checkLoaded();const s=this.getSky();let l=!1;if(!e&&!s)return;if(e&&!s)l=!0;else if(!e&&s)l=!0;else for(const f in e)if(!c.bH(e[f],s[f])){l=!0;break}if(!l)return;const d={now:Ze.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,n),this.sky.updateTransitions(d)}_setProjectionInternal(e){const n=(function(s){if(Array.isArray(s)){const l=new xs({type:s});return{projection:l,transform:new Lr,cameraHelper:new jl(l)}}switch(s){case"mercator":return{projection:new Ra,transform:new ta,cameraHelper:new Fa};case"globe":{const l=new xs({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:l,transform:new Lr,cameraHelper:new jl(l)}}case"vertical-perspective":return{projection:new ja,transform:new Ua,cameraHelper:new hr};default:return c.w("Unknown projection name: ".concat(s,". Falling back to mercator projection.")),{projection:new Ra,transform:new ta,cameraHelper:new Fa}}})(e);this.projection=n.projection,this.map.migrateProjection(n.transform,n.cameraHelper);for(const s in this.sourceCaches)this.sourceCaches[s].reload()}_validate(e,n,s,l,d={}){return(!d||d.validate!==!1)&&Ts(this,e.call(c.z,c.e({key:n,style:this.serialize(),value:s,styleSpec:c.v},l)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Kr().off(vn,this._rtlPluginLoaded);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const s=this.sourceCaches[n];s.setEventedParent(null),s.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const n in this.sourceCaches)this.sourceCaches[n].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,n,s,l,d=!1){let f=!1,g=!1;const y={};for(const b of this._order){const w=this._layers[b];if(w.type!=="symbol")continue;if(!y[w.source]){const P=this.sourceCaches[w.source];y[w.source]=P.getRenderableIds(!0).map((I=>P.getTileByID(I))).sort(((I,D)=>D.tileID.overscaledZ-I.tileID.overscaledZ||(I.tileID.isLessThan(D.tileID)?-1:1)))}const S=this.crossTileSymbolIndex.addLayer(w,y[w.source],e.center.lng);f=f||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Ze.now(),e.zoom))&&(this.pauseablePlacement=new Bl(e,this.map.terrain,this._order,d,n,s,l,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(Ze.now()),g=!0),f&&this.pauseablePlacement.placement.setStale()),g||f)for(const b of this._order){const w=this._layers[b];w.type==="symbol"&&this.placement.updateLayerOpacities(w,y[w.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Ze.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return c._(this,void 0,void 0,(function*(){const s=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const l=this.sourceCaches[n.source];return l&&l.setDependencies(n.tileID.key,n.type,n.icons),s}))}getGlyphs(e,n){return c._(this,void 0,void 0,(function*(){const s=yield this.glyphManager.getGlyphs(n.stacks),l=this.sourceCaches[n.source];return l&&l.setDependencies(n.tileID.key,n.type,[""]),s}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(c.z.glyphs,"glyphs",e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getDashes(e,n){return c._(this,void 0,void 0,(function*(){const s={};for(const[l,d]of Object.entries(n.dashes))s[l]=this.lineAtlas.getDash(d.dasharray,d.round);return s}))}addSprite(e,n,s={},l){this._checkLoaded();const d=[{id:e,url:n}],f=[...Xi(this.stylesheet.sprite),...d];this._validate(c.z.sprite,"sprite",f,null,s)||(this.stylesheet.sprite=f,this._loadSprite(d,!0,l))}removeSprite(e){this._checkLoaded();const n=Xi(this.stylesheet.sprite);if(n.find((s=>s.id===e))){if(this._spritesImagesIds[e])for(const s of this._spritesImagesIds[e])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex((s=>s.id===e)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.l("data",{dataType:"style"}))}else this.fire(new c.k(new Error('Sprite "'.concat(e,"\" doesn't exists on this map."))))}getSprite(){return Xi(this.stylesheet.sprite)}setSprite(e,n={},s){this._checkLoaded(),e&&this._validate(c.z.sprite,"sprite",e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,s):(this._unloadSprite(),s&&s(null)))}}var Qc=c.aJ([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ps{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,n,s,l,d,f,g,y,b){this.context=e;let w=this.boundPaintVertexBuffers.length!==l.length;for(let S=0;!w&&S<l.length;S++)this.boundPaintVertexBuffers[S]!==l[S]&&(w=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||w||this.boundIndexBuffer!==d||this.boundVertexOffset!==f||this.boundDynamicVertexBuffer!==g||this.boundDynamicVertexBuffer2!==y||this.boundDynamicVertexBuffer3!==b?this.freshBind(n,s,l,d,f,g,y,b):(e.bindVertexArray.set(this.vao),g&&g.bind(),d&&d.dynamicDraw&&d.bind(),y&&y.bind(),b&&b.bind())}freshBind(e,n,s,l,d,f,g,y){const b=e.numAttributes,w=this.context,S=w.gl;this.vao&&this.destroy(),this.vao=w.createVertexArray(),w.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=l,this.boundVertexOffset=d,this.boundDynamicVertexBuffer=f,this.boundDynamicVertexBuffer2=g,this.boundDynamicVertexBuffer3=y,n.enableAttributes(S,e);for(const P of s)P.enableAttributes(S,e);f&&f.enableAttributes(S,e),g&&g.enableAttributes(S,e),y&&y.enableAttributes(S,e),n.bind(),n.setVertexAttribPointers(S,e,d);for(const P of s)P.bind(),P.setVertexAttribPointers(S,e,d);f&&(f.bind(),f.setVertexAttribPointers(S,e,d)),l&&l.bind(),g&&(g.bind(),g.setVertexAttribPointers(S,e,d)),y&&(y.bind(),y.setVertexAttribPointers(S,e,d)),w.currentNumAttributes=b}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Do=(h,e,n,s,l)=>({u_texture:0,u_ele_delta:h,u_fog_matrix:e,u_fog_color:n?n.properties.get("fog-color"):c.bf.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:l?0:n?n.calculateFogBlendOpacity(s):0,u_horizon_color:n?n.properties.get("horizon-color"):c.bf.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1,u_is_globe_mode:l?1:0}),Ss={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function aa(h){const e=[];for(let n=0;n<h.length;n++){if(h[n]===null)continue;const s=h[n].split(" ");e.push(s.pop())}return e}class Ro{constructor(e,n,s,l,d,f,g,y,b=[]){const w=e.gl;this.program=w.createProgram();const S=aa(n.staticAttributes),P=s?s.getBinderAttributes():[],I=S.concat(P),D=vi.prelude.staticUniforms?aa(vi.prelude.staticUniforms):[],B=g.staticUniforms?aa(g.staticUniforms):[],O=n.staticUniforms?aa(n.staticUniforms):[],j=s?s.getBinderUniforms():[],N=D.concat(B).concat(O).concat(j),$=[];for(const se of N)$.indexOf(se)<0&&$.push(se);const U=s?s.defines():[];gi(w)&&U.unshift("#version 300 es"),d&&U.push("#define OVERDRAW_INSPECTOR;"),f&&U.push("#define TERRAIN3D;"),y&&U.push(y),b&&U.push(...b);let W=U.concat(vi.prelude.fragmentSource,g.fragmentSource,n.fragmentSource).join("\n"),K=U.concat(vi.prelude.vertexSource,g.vertexSource,n.vertexSource).join("\n");gi(w)||(W=(function(se){return se.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(W),K=(function(se){return se.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(K));const Z=w.createShader(w.FRAGMENT_SHADER);if(w.isContextLost())return void(this.failedToCreate=!0);if(w.shaderSource(Z,W),w.compileShader(Z),!w.getShaderParameter(Z,w.COMPILE_STATUS))throw new Error("Could not compile fragment shader: ".concat(w.getShaderInfoLog(Z)));w.attachShader(this.program,Z);const ee=w.createShader(w.VERTEX_SHADER);if(w.isContextLost())return void(this.failedToCreate=!0);if(w.shaderSource(ee,K),w.compileShader(ee),!w.getShaderParameter(ee,w.COMPILE_STATUS))throw new Error("Could not compile vertex shader: ".concat(w.getShaderInfoLog(ee)));w.attachShader(this.program,ee),this.attributes={};const he={};this.numAttributes=I.length;for(let se=0;se<this.numAttributes;se++)I[se]&&(w.bindAttribLocation(this.program,se,I[se]),this.attributes[I[se]]=se);if(w.linkProgram(this.program),!w.getProgramParameter(this.program,w.LINK_STATUS))throw new Error("Program failed to link: ".concat(w.getProgramInfoLog(this.program)));w.deleteShader(ee),w.deleteShader(Z);for(let se=0;se<$.length;se++){const le=$[se];if(le&&!he[le]){const ce=w.getUniformLocation(this.program,le);ce&&(he[le]=ce)}}this.fixedUniforms=l(e,he),this.terrainUniforms=((se,le)=>({u_depth:new c.bQ(se,le.u_depth),u_terrain:new c.bQ(se,le.u_terrain),u_terrain_dim:new c.bg(se,le.u_terrain_dim),u_terrain_matrix:new c.bS(se,le.u_terrain_matrix),u_terrain_unpack:new c.bT(se,le.u_terrain_unpack),u_terrain_exaggeration:new c.bg(se,le.u_terrain_exaggeration)}))(e,he),this.projectionUniforms=((se,le)=>({u_projection_matrix:new c.bS(se,le.u_projection_matrix),u_projection_tile_mercator_coords:new c.bT(se,le.u_projection_tile_mercator_coords),u_projection_clipping_plane:new c.bT(se,le.u_projection_clipping_plane),u_projection_transition:new c.bg(se,le.u_projection_transition),u_projection_fallback_matrix:new c.bS(se,le.u_projection_fallback_matrix)}))(e,he),this.binderUniforms=s?s.getUniforms(e,he):[]}draw(e,n,s,l,d,f,g,y,b,w,S,P,I,D,B,O,j,N,$){const U=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(s),e.setStencilMode(l),e.setColorMode(d),e.setCullFace(f),y){e.activeTexture.set(U.TEXTURE2),U.bindTexture(U.TEXTURE_2D,y.depthTexture),e.activeTexture.set(U.TEXTURE3),U.bindTexture(U.TEXTURE_2D,y.texture);for(const K in this.terrainUniforms)this.terrainUniforms[K].set(y[K])}if(b)for(const K in b)this.projectionUniforms[Ss[K]].set(b[K]);if(g)for(const K in this.fixedUniforms)this.fixedUniforms[K].set(g[K]);O&&O.setUniforms(e,this.binderUniforms,D,{zoom:B});let W=0;switch(n){case U.LINES:W=2;break;case U.TRIANGLES:W=3;break;case U.LINE_STRIP:W=1}for(const K of I.get()){const Z=K.vaos||(K.vaos={});(Z[w]||(Z[w]=new Ps)).bind(e,this,S,O?O.getPaintVertexBuffers():[],P,K.vertexOffset,j,N,$),U.drawElements(n,K.primitiveLength*W,U.UNSIGNED_SHORT,K.primitiveOffset*W*2)}}}function ur(h,e,n){const s=1/c.aC(n,1,e.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),d=n.tileSize*Math.pow(2,e.transform.tileZoom)/l,f=d*(n.tileID.canonical.x+n.tileID.wrap*l),g=d*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[f>>16,g>>16],u_pixel_coord_lower:[65535&f,65535&g]}}const Vl=(h,e,n,s)=>{const l=h.style.light,d=l.properties.get("position"),f=[d.x,d.y,d.z],g=c.bW();l.properties.get("anchor")==="viewport"&&c.bX(g,h.transform.bearingInRadians),c.bY(f,f,g);const y=h.transform.transformLightDirection(f),b=l.properties.get("color");return{u_lightpos:f,u_lightpos_globe:y,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+e,u_opacity:n,u_fill_translate:s}},Lo=(h,e,n,s,l,d,f)=>c.e(Vl(h,e,n,s),ur(d,h,f),{u_height_factor:-Math.pow(2,l.overscaledZ)/f.tileSize/8}),sa=(h,e,n,s)=>c.e(ur(e,h,n),{u_fill_translate:s}),$a=(h,e)=>({u_world:h,u_fill_translate:e}),eh=(h,e,n,s,l)=>c.e(sa(h,e,n,l),{u_world:s}),Ms=(h,e,n,s,l)=>{const d=h.transform;let f,g,y=0;if(n.paint.get("circle-pitch-alignment")==="map"){const b=c.aC(e,1,d.zoom);f=!0,g=[b,b],y=b/(c.$*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*l}else f=!1,g=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+f,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:g,u_globe_extrude_scale:y,u_translate:s}},th=h=>({u_pixel_extrude_scale:[1/h.width,1/h.height]}),oa=h=>({u_viewport_size:[h.width,h.height]}),Nl=(h,e=1)=>({u_color:h,u_overlay:0,u_overlay_scale:e}),Fo=(h,e,n,s)=>{const l=c.aC(h,1,e)/(c.$*Math.pow(2,h.tileID.overscaledZ))*2*Math.PI*s;return{u_extrude_scale:c.aC(h,1,e),u_intensity:n,u_globe_extrude_scale:l}},Ul=(h,e,n,s)=>{const l=c.L();c.bZ(l,0,h.width,h.height,0,0,1);const d=h.context.gl;return{u_matrix:l,u_world:[d.drawingBufferWidth,d.drawingBufferHeight],u_image:n,u_color_ramp:s,u_opacity:e.paint.get("heatmap-opacity")}},$l=(h,e,n)=>{const s=n.paint.get("hillshade-accent-color");let l;switch(n.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}const d=n.getIlluminationProperties();for(let f=0;f<d.directionRadians.length;f++)n.paint.get("hillshade-illumination-anchor")==="viewport"&&(d.directionRadians[f]+=h.transform.bearingInRadians);return{u_image:0,u_latrange:Zl(0,e.tileID),u_exaggeration:n.paint.get("hillshade-exaggeration"),u_altitudes:d.altitudeRadians,u_azimuths:d.directionRadians,u_accent:s,u_method:l,u_highlights:d.highlightColor,u_shadows:d.shadowColor}},Bo=(h,e)=>{const n=e.stride,s=c.L();return c.bZ(s,0,c.$,-c.$,0,0,1),c.M(s,s,[0,-c.$,0]),{u_matrix:s,u_image:1,u_dimension:[n,n],u_zoom:h.overscaledZ,u_unpack:e.getUnpackVector()}};function Zl(h,e){const n=Math.pow(2,e.canonical.z),s=e.canonical.y;return[new c.a1(0,s/n).toLngLat().lat,new c.a1(0,(s+1)/n).toLngLat().lat]}const Gl=(h,e,n=0)=>({u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:n,u_opacity:h.paint.get("color-relief-opacity")}),Za=(h,e,n,s)=>{const l=h.transform;return{u_translation:Xl(h,e,n),u_ratio:s/c.aC(e,1,l.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},ql=(h,e,n,s,l)=>c.e(Za(h,e,n,s),{u_image:0,u_image_height:l}),In=(h,e,n,s,l)=>{const d=h.transform,f=zn(e,d);return{u_translation:Xl(h,e,n),u_texsize:e.imageAtlasTexture.size,u_ratio:s/c.aC(e,1,d.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[f,l.fromScale,l.toScale],u_fade:l.t,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},Wl=(h,e,n,s,l)=>{const d=zn(e,h.transform);return c.e(Za(h,e,n,s),{u_tileratio:d,u_crossfade_from:l.fromScale,u_crossfade_to:l.toScale,u_image:0,u_mix:l.t,u_lineatlas_width:h.lineAtlas.width,u_lineatlas_height:h.lineAtlas.height})},Hl=(h,e,n,s,l,d)=>{const f=zn(e,h.transform);return c.e(Za(h,e,n,s),{u_image:0,u_image_height:d,u_tileratio:f,u_crossfade_from:l.fromScale,u_crossfade_to:l.toScale,u_image_dash:1,u_mix:l.t,u_lineatlas_width:h.lineAtlas.width,u_lineatlas_height:h.lineAtlas.height})};function zn(h,e){return 1/c.aC(h,1,e.tileZoom)}function Xl(h,e,n){return c.aD(h.transform,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Cs=(h,e,n,s,l)=>{return{u_tl_parent:h,u_scale_parent:e,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*s.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:s.paint.get("raster-brightness-min"),u_brightness_high:s.paint.get("raster-brightness-max"),u_saturation_factor:(f=s.paint.get("raster-saturation"),f>0?1-1/(1.001-f):-f),u_contrast_factor:(d=s.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:ih(s.paint.get("raster-hue-rotate")),u_coords_top:[l[0].x,l[0].y,l[1].x,l[1].y],u_coords_bottom:[l[3].x,l[3].y,l[2].x,l[2].y]};var d,f};function ih(h){h*=Math.PI/180;const e=Math.sin(h),n=Math.cos(h);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}const Yl=(h,e,n,s,l,d,f,g,y,b,w,S,P)=>{const I=f.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:I.cameraToCenterDistance,u_pitch:I.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:I.width/I.height,u_fade_change:f.options.fadeDuration?f.symbolFadeChange:1,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+w,u_pitch_with_map:+s,u_is_along_line:l,u_is_variable_anchor:d,u_texsize:S,u_texture:0,u_translation:b,u_pitched_scale:P}},Oo=(h,e,n,s,l,d,f,g,y,b,w,S,P,I)=>{const D=f.transform;return c.e(Yl(h,e,n,s,l,d,f,g,y,b,w,S,I),{u_gamma_scale:s?Math.cos(D.pitch*Math.PI/180)*D.cameraToCenterDistance:1,u_device_pixel_ratio:f.pixelRatio,u_is_halo:1})},Kl=(h,e,n,s,l,d,f,g,y,b,w,S,P)=>c.e(Oo(h,e,n,s,l,d,f,g,y,b,!0,w,0,P),{u_texsize_icon:S,u_texture_icon:1}),Jl=(h,e)=>({u_opacity:h,u_color:e}),jo=(h,e,n,s,l)=>c.e((function(d,f,g,y){const b=g.imageManager.getPattern(d.from.toString()),w=g.imageManager.getPattern(d.to.toString()),{width:S,height:P}=g.imageManager.getPixelSize(),I=Math.pow(2,y.tileID.overscaledZ),D=y.tileSize*Math.pow(2,g.transform.tileZoom)/I,B=D*(y.tileID.canonical.x+y.tileID.wrap*I),O=D*y.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:b.tl,u_pattern_br_a:b.br,u_pattern_tl_b:w.tl,u_pattern_br_b:w.br,u_texsize:[S,P],u_mix:f.t,u_pattern_size_a:b.displaySize,u_pattern_size_b:w.displaySize,u_scale_a:f.fromScale,u_scale_b:f.toScale,u_tile_units_to_pixels:1/c.aC(y,1,g.transform.tileZoom),u_pixel_coord_upper:[B>>16,O>>16],u_pixel_coord_lower:[65535&B,65535&O]}})(n,l,e,s),{u_opacity:h}),Vo=(h,e)=>{},Is={fillExtrusion:(h,e)=>({u_lightpos:new c.bU(h,e.u_lightpos),u_lightpos_globe:new c.bU(h,e.u_lightpos_globe),u_lightintensity:new c.bg(h,e.u_lightintensity),u_lightcolor:new c.bU(h,e.u_lightcolor),u_vertical_gradient:new c.bg(h,e.u_vertical_gradient),u_opacity:new c.bg(h,e.u_opacity),u_fill_translate:new c.bV(h,e.u_fill_translate)}),fillExtrusionPattern:(h,e)=>({u_lightpos:new c.bU(h,e.u_lightpos),u_lightpos_globe:new c.bU(h,e.u_lightpos_globe),u_lightintensity:new c.bg(h,e.u_lightintensity),u_lightcolor:new c.bU(h,e.u_lightcolor),u_vertical_gradient:new c.bg(h,e.u_vertical_gradient),u_height_factor:new c.bg(h,e.u_height_factor),u_opacity:new c.bg(h,e.u_opacity),u_fill_translate:new c.bV(h,e.u_fill_translate),u_image:new c.bQ(h,e.u_image),u_texsize:new c.bV(h,e.u_texsize),u_pixel_coord_upper:new c.bV(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(h,e.u_pixel_coord_lower),u_scale:new c.bU(h,e.u_scale),u_fade:new c.bg(h,e.u_fade)}),fill:(h,e)=>({u_fill_translate:new c.bV(h,e.u_fill_translate)}),fillPattern:(h,e)=>({u_image:new c.bQ(h,e.u_image),u_texsize:new c.bV(h,e.u_texsize),u_pixel_coord_upper:new c.bV(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(h,e.u_pixel_coord_lower),u_scale:new c.bU(h,e.u_scale),u_fade:new c.bg(h,e.u_fade),u_fill_translate:new c.bV(h,e.u_fill_translate)}),fillOutline:(h,e)=>({u_world:new c.bV(h,e.u_world),u_fill_translate:new c.bV(h,e.u_fill_translate)}),fillOutlinePattern:(h,e)=>({u_world:new c.bV(h,e.u_world),u_image:new c.bQ(h,e.u_image),u_texsize:new c.bV(h,e.u_texsize),u_pixel_coord_upper:new c.bV(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(h,e.u_pixel_coord_lower),u_scale:new c.bU(h,e.u_scale),u_fade:new c.bg(h,e.u_fade),u_fill_translate:new c.bV(h,e.u_fill_translate)}),circle:(h,e)=>({u_camera_to_center_distance:new c.bg(h,e.u_camera_to_center_distance),u_scale_with_map:new c.bQ(h,e.u_scale_with_map),u_pitch_with_map:new c.bQ(h,e.u_pitch_with_map),u_extrude_scale:new c.bV(h,e.u_extrude_scale),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_globe_extrude_scale:new c.bg(h,e.u_globe_extrude_scale),u_translate:new c.bV(h,e.u_translate)}),collisionBox:(h,e)=>({u_pixel_extrude_scale:new c.bV(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_viewport_size:new c.bV(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new c.bR(h,e.u_color),u_overlay:new c.bQ(h,e.u_overlay),u_overlay_scale:new c.bg(h,e.u_overlay_scale)}),depth:Vo,clippingMask:Vo,heatmap:(h,e)=>({u_extrude_scale:new c.bg(h,e.u_extrude_scale),u_intensity:new c.bg(h,e.u_intensity),u_globe_extrude_scale:new c.bg(h,e.u_globe_extrude_scale)}),heatmapTexture:(h,e)=>({u_matrix:new c.bS(h,e.u_matrix),u_world:new c.bV(h,e.u_world),u_image:new c.bQ(h,e.u_image),u_color_ramp:new c.bQ(h,e.u_color_ramp),u_opacity:new c.bg(h,e.u_opacity)}),hillshade:(h,e)=>({u_image:new c.bQ(h,e.u_image),u_latrange:new c.bV(h,e.u_latrange),u_exaggeration:new c.bg(h,e.u_exaggeration),u_altitudes:new c.b$(h,e.u_altitudes),u_azimuths:new c.b$(h,e.u_azimuths),u_accent:new c.bR(h,e.u_accent),u_method:new c.bQ(h,e.u_method),u_shadows:new c.b_(h,e.u_shadows),u_highlights:new c.b_(h,e.u_highlights)}),hillshadePrepare:(h,e)=>({u_matrix:new c.bS(h,e.u_matrix),u_image:new c.bQ(h,e.u_image),u_dimension:new c.bV(h,e.u_dimension),u_zoom:new c.bg(h,e.u_zoom),u_unpack:new c.bT(h,e.u_unpack)}),colorRelief:(h,e)=>({u_image:new c.bQ(h,e.u_image),u_unpack:new c.bT(h,e.u_unpack),u_dimension:new c.bV(h,e.u_dimension),u_elevation_stops:new c.bQ(h,e.u_elevation_stops),u_color_stops:new c.bQ(h,e.u_color_stops),u_color_ramp_size:new c.bQ(h,e.u_color_ramp_size),u_opacity:new c.bg(h,e.u_opacity)}),line:(h,e)=>({u_translation:new c.bV(h,e.u_translation),u_ratio:new c.bg(h,e.u_ratio),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_translation:new c.bV(h,e.u_translation),u_ratio:new c.bg(h,e.u_ratio),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(h,e.u_units_to_pixels),u_image:new c.bQ(h,e.u_image),u_image_height:new c.bg(h,e.u_image_height)}),linePattern:(h,e)=>({u_translation:new c.bV(h,e.u_translation),u_texsize:new c.bV(h,e.u_texsize),u_ratio:new c.bg(h,e.u_ratio),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_image:new c.bQ(h,e.u_image),u_units_to_pixels:new c.bV(h,e.u_units_to_pixels),u_scale:new c.bU(h,e.u_scale),u_fade:new c.bg(h,e.u_fade)}),lineSDF:(h,e)=>({u_translation:new c.bV(h,e.u_translation),u_ratio:new c.bg(h,e.u_ratio),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(h,e.u_units_to_pixels),u_image:new c.bQ(h,e.u_image),u_mix:new c.bg(h,e.u_mix),u_tileratio:new c.bg(h,e.u_tileratio),u_crossfade_from:new c.bg(h,e.u_crossfade_from),u_crossfade_to:new c.bg(h,e.u_crossfade_to),u_lineatlas_width:new c.bg(h,e.u_lineatlas_width),u_lineatlas_height:new c.bg(h,e.u_lineatlas_height)}),lineGradientSDF:(h,e)=>({u_translation:new c.bV(h,e.u_translation),u_ratio:new c.bg(h,e.u_ratio),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_units_to_pixels:new c.bV(h,e.u_units_to_pixels),u_image:new c.bQ(h,e.u_image),u_image_height:new c.bg(h,e.u_image_height),u_tileratio:new c.bg(h,e.u_tileratio),u_crossfade_from:new c.bg(h,e.u_crossfade_from),u_crossfade_to:new c.bg(h,e.u_crossfade_to),u_image_dash:new c.bQ(h,e.u_image_dash),u_mix:new c.bg(h,e.u_mix),u_lineatlas_width:new c.bg(h,e.u_lineatlas_width),u_lineatlas_height:new c.bg(h,e.u_lineatlas_height)}),raster:(h,e)=>({u_tl_parent:new c.bV(h,e.u_tl_parent),u_scale_parent:new c.bg(h,e.u_scale_parent),u_buffer_scale:new c.bg(h,e.u_buffer_scale),u_fade_t:new c.bg(h,e.u_fade_t),u_opacity:new c.bg(h,e.u_opacity),u_image0:new c.bQ(h,e.u_image0),u_image1:new c.bQ(h,e.u_image1),u_brightness_low:new c.bg(h,e.u_brightness_low),u_brightness_high:new c.bg(h,e.u_brightness_high),u_saturation_factor:new c.bg(h,e.u_saturation_factor),u_contrast_factor:new c.bg(h,e.u_contrast_factor),u_spin_weights:new c.bU(h,e.u_spin_weights),u_coords_top:new c.bT(h,e.u_coords_top),u_coords_bottom:new c.bT(h,e.u_coords_bottom)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new c.bQ(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(h,e.u_is_size_feature_constant),u_size_t:new c.bg(h,e.u_size_t),u_size:new c.bg(h,e.u_size),u_camera_to_center_distance:new c.bg(h,e.u_camera_to_center_distance),u_pitch:new c.bg(h,e.u_pitch),u_rotate_symbol:new c.bQ(h,e.u_rotate_symbol),u_aspect_ratio:new c.bg(h,e.u_aspect_ratio),u_fade_change:new c.bg(h,e.u_fade_change),u_label_plane_matrix:new c.bS(h,e.u_label_plane_matrix),u_coord_matrix:new c.bS(h,e.u_coord_matrix),u_is_text:new c.bQ(h,e.u_is_text),u_pitch_with_map:new c.bQ(h,e.u_pitch_with_map),u_is_along_line:new c.bQ(h,e.u_is_along_line),u_is_variable_anchor:new c.bQ(h,e.u_is_variable_anchor),u_texsize:new c.bV(h,e.u_texsize),u_texture:new c.bQ(h,e.u_texture),u_translation:new c.bV(h,e.u_translation),u_pitched_scale:new c.bg(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new c.bQ(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(h,e.u_is_size_feature_constant),u_size_t:new c.bg(h,e.u_size_t),u_size:new c.bg(h,e.u_size),u_camera_to_center_distance:new c.bg(h,e.u_camera_to_center_distance),u_pitch:new c.bg(h,e.u_pitch),u_rotate_symbol:new c.bQ(h,e.u_rotate_symbol),u_aspect_ratio:new c.bg(h,e.u_aspect_ratio),u_fade_change:new c.bg(h,e.u_fade_change),u_label_plane_matrix:new c.bS(h,e.u_label_plane_matrix),u_coord_matrix:new c.bS(h,e.u_coord_matrix),u_is_text:new c.bQ(h,e.u_is_text),u_pitch_with_map:new c.bQ(h,e.u_pitch_with_map),u_is_along_line:new c.bQ(h,e.u_is_along_line),u_is_variable_anchor:new c.bQ(h,e.u_is_variable_anchor),u_texsize:new c.bV(h,e.u_texsize),u_texture:new c.bQ(h,e.u_texture),u_gamma_scale:new c.bg(h,e.u_gamma_scale),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_is_halo:new c.bQ(h,e.u_is_halo),u_translation:new c.bV(h,e.u_translation),u_pitched_scale:new c.bg(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new c.bQ(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new c.bQ(h,e.u_is_size_feature_constant),u_size_t:new c.bg(h,e.u_size_t),u_size:new c.bg(h,e.u_size),u_camera_to_center_distance:new c.bg(h,e.u_camera_to_center_distance),u_pitch:new c.bg(h,e.u_pitch),u_rotate_symbol:new c.bQ(h,e.u_rotate_symbol),u_aspect_ratio:new c.bg(h,e.u_aspect_ratio),u_fade_change:new c.bg(h,e.u_fade_change),u_label_plane_matrix:new c.bS(h,e.u_label_plane_matrix),u_coord_matrix:new c.bS(h,e.u_coord_matrix),u_is_text:new c.bQ(h,e.u_is_text),u_pitch_with_map:new c.bQ(h,e.u_pitch_with_map),u_is_along_line:new c.bQ(h,e.u_is_along_line),u_is_variable_anchor:new c.bQ(h,e.u_is_variable_anchor),u_texsize:new c.bV(h,e.u_texsize),u_texsize_icon:new c.bV(h,e.u_texsize_icon),u_texture:new c.bQ(h,e.u_texture),u_texture_icon:new c.bQ(h,e.u_texture_icon),u_gamma_scale:new c.bg(h,e.u_gamma_scale),u_device_pixel_ratio:new c.bg(h,e.u_device_pixel_ratio),u_is_halo:new c.bQ(h,e.u_is_halo),u_translation:new c.bV(h,e.u_translation),u_pitched_scale:new c.bg(h,e.u_pitched_scale)}),background:(h,e)=>({u_opacity:new c.bg(h,e.u_opacity),u_color:new c.bR(h,e.u_color)}),backgroundPattern:(h,e)=>({u_opacity:new c.bg(h,e.u_opacity),u_image:new c.bQ(h,e.u_image),u_pattern_tl_a:new c.bV(h,e.u_pattern_tl_a),u_pattern_br_a:new c.bV(h,e.u_pattern_br_a),u_pattern_tl_b:new c.bV(h,e.u_pattern_tl_b),u_pattern_br_b:new c.bV(h,e.u_pattern_br_b),u_texsize:new c.bV(h,e.u_texsize),u_mix:new c.bg(h,e.u_mix),u_pattern_size_a:new c.bV(h,e.u_pattern_size_a),u_pattern_size_b:new c.bV(h,e.u_pattern_size_b),u_scale_a:new c.bg(h,e.u_scale_a),u_scale_b:new c.bg(h,e.u_scale_b),u_pixel_coord_upper:new c.bV(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new c.bV(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new c.bg(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_texture:new c.bQ(h,e.u_texture),u_ele_delta:new c.bg(h,e.u_ele_delta),u_fog_matrix:new c.bS(h,e.u_fog_matrix),u_fog_color:new c.bR(h,e.u_fog_color),u_fog_ground_blend:new c.bg(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.bg(h,e.u_fog_ground_blend_opacity),u_horizon_color:new c.bR(h,e.u_horizon_color),u_horizon_fog_blend:new c.bg(h,e.u_horizon_fog_blend),u_is_globe_mode:new c.bg(h,e.u_is_globe_mode)}),terrainDepth:(h,e)=>({u_ele_delta:new c.bg(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_texture:new c.bQ(h,e.u_texture),u_terrain_coords_id:new c.bg(h,e.u_terrain_coords_id),u_ele_delta:new c.bg(h,e.u_ele_delta)}),projectionErrorMeasurement:(h,e)=>({u_input:new c.bg(h,e.u_input),u_output_expected:new c.bg(h,e.u_output_expected)}),atmosphere:(h,e)=>({u_sun_pos:new c.bU(h,e.u_sun_pos),u_atmosphere_blend:new c.bg(h,e.u_atmosphere_blend),u_globe_position:new c.bU(h,e.u_globe_position),u_globe_radius:new c.bg(h,e.u_globe_radius),u_inv_proj_matrix:new c.bS(h,e.u_inv_proj_matrix)}),sky:(h,e)=>({u_sky_color:new c.bR(h,e.u_sky_color),u_horizon_color:new c.bR(h,e.u_horizon_color),u_horizon:new c.bV(h,e.u_horizon),u_horizon_normal:new c.bV(h,e.u_horizon_normal),u_sky_horizon_blend:new c.bg(h,e.u_sky_horizon_blend),u_sky_blend:new c.bg(h,e.u_sky_blend)})};class Fr{constructor(e,n,s){this.context=e;const l=e.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const No={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Uo{constructor(e,n,s,l){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=e;const d=e.gl;this.buffer=d.createBuffer(),e.bindVertexBuffer.set(this.buffer),d.bufferData(d.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error("Length of new data is ".concat(e.length,", which doesn't match current length of ").concat(this.length));const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,n){for(let s=0;s<this.attributes.length;s++){const l=n.attributes[this.attributes[s].name];l!==void 0&&e.enableVertexAttribArray(l)}}setVertexAttribPointers(e,n,s){for(let l=0;l<this.attributes.length;l++){const d=this.attributes[l],f=n.attributes[d.name];f!==void 0&&e.vertexAttribPointer(f,d.components,e[No[d.type]],!1,this.itemSize,d.offset+this.itemSize*(s||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class lt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Ql extends lt{getDefault(){return c.bf.transparent}set(e){const n=this.current;(e.r!==n.r||e.g!==n.g||e.b!==n.b||e.a!==n.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class $o extends lt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class En extends lt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Zo extends lt{getDefault(){return[!0,!0,!0,!0]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||e[3]!==n[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class rh extends lt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class nh extends lt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class ah extends lt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const n=this.current;(e.func!==n.func||e.ref!==n.ref||e.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class sh extends lt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class ec extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=e,this.dirty=!1}}class oh extends lt{getDefault(){return[0,1]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class tc extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=e,this.dirty=!1}}class zs extends lt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Es extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.BLEND):n.disable(n.BLEND),this.current=e,this.dirty=!1}}class As extends lt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Go extends lt{getDefault(){return c.bf.transparent}set(e){const n=this.current;(e.r!==n.r||e.g!==n.g||e.b!==n.b||e.a!==n.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class An extends lt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Ga extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=e,this.dirty=!1}}class la extends lt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class er extends lt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class ic extends lt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class rc extends lt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class qo extends lt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||e[3]!==n[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class kn extends lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class ks extends lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Ds extends lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindTexture(n.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class qa extends lt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Rs extends lt{getDefault(){return null}set(e){const n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class nc extends lt{getDefault(){return null}set(e){var n;if(e===this.current&&!this.dirty)return;const s=this.gl;gi(s)?s.bindVertexArray(e):(n=s.getExtension("OES_vertex_array_object"))===null||n===void 0||n.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class ca extends lt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class ha extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class ac extends lt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Wa extends lt{constructor(e,n){super(e),this.context=e,this.parent=n}getDefault(){return null}}class et extends Wa{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Ls extends Wa{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class lh extends Wa{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const Wo="Framebuffer is not complete";class Ha{constructor(e,n,s,l,d){this.context=e,this.width=n,this.height=s;const f=e.gl,g=this.framebuffer=f.createFramebuffer();if(this.colorAttachment=new et(e,g),l)this.depthAttachment=d?new lh(e,g):new Ls(e,g);else if(d)throw new Error("Stencil cannot be set without depth");if(f.checkFramebufferStatus(f.FRAMEBUFFER)!==f.FRAMEBUFFER_COMPLETE)throw new Error(Wo)}destroy(){const e=this.context.gl,n=this.colorAttachment.get();if(n&&e.deleteTexture(n),this.depthAttachment){const s=this.depthAttachment.get();s&&e.deleteRenderbuffer(s)}e.deleteFramebuffer(this.framebuffer)}}class ch{constructor(e){var n,s;if(this.gl=e,this.clearColor=new Ql(this),this.clearDepth=new $o(this),this.clearStencil=new En(this),this.colorMask=new Zo(this),this.depthMask=new rh(this),this.stencilMask=new nh(this),this.stencilFunc=new ah(this),this.stencilOp=new sh(this),this.stencilTest=new ec(this),this.depthRange=new oh(this),this.depthTest=new tc(this),this.depthFunc=new zs(this),this.blend=new Es(this),this.blendFunc=new As(this),this.blendColor=new Go(this),this.blendEquation=new An(this),this.cullFace=new Ga(this),this.cullFaceSide=new la(this),this.frontFace=new er(this),this.program=new ic(this),this.activeTexture=new rc(this),this.viewport=new qo(this),this.bindFramebuffer=new kn(this),this.bindRenderbuffer=new ks(this),this.bindTexture=new Ds(this),this.bindVertexBuffer=new qa(this),this.bindElementBuffer=new Rs(this),this.bindVertexArray=new nc(this),this.pixelStoreUnpack=new ca(this),this.pixelStoreUnpackPremultiplyAlpha=new ha(this),this.pixelStoreUnpackFlipY=new ac(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),gi(e)){this.HALF_FLOAT=e.HALF_FLOAT;const l=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(n=e.RGBA16F)!==null&&n!==void 0?n:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(s=e.RGB16F)!==null&&s!==void 0?s:l==null?void 0:l.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const l=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,n){return new Fr(this,e,n)}createVertexBuffer(e,n,s){return new Uo(this,e,n,s)}createRenderbuffer(e,n,s){const l=this.gl,d=l.createRenderbuffer();return this.bindRenderbuffer.set(d),l.renderbufferStorage(l.RENDERBUFFER,e,n,s),this.bindRenderbuffer.set(null),d}createFramebuffer(e,n,s,l){return new Ha(this,e,n,s,l)}clear({color:e,depth:n,stencil:s}){const l=this.gl;let d=0;e&&(d|=l.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(d|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s!==void 0&&(d|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(s),this.stencilMask.set(255)),l.clear(d)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){c.bH(e.blendFunction,mt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return gi(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var n;return gi(this.gl)?this.gl.deleteVertexArray(e):(n=this.gl.getExtension("OES_vertex_array_object"))===null||n===void 0?void 0:n.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let Fs;function Ho(h,e,n,s,l){const d=h.context,f=h.transform,g=d.gl,y=h.useProgram("collisionBox"),b=[];let w=0,S=0;for(let j=0;j<s.length;j++){const N=s[j],$=e.getTile(N).getBucket(n);if(!$)continue;const U=l?$.textCollisionBox:$.iconCollisionBox,W=$.collisionCircleArray;W.length>0&&(b.push({circleArray:W,circleOffset:S,coord:N}),w+=W.length/4,S=w),U&&y.draw(d,g.LINES,qe.disabled,Xe.disabled,h.colorModeForRenderPass(),it.disabled,th(h.transform),h.style.map.terrain&&h.style.map.terrain.getTerrainData(N),f.getProjectionData({overscaledTileID:N,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),n.id,U.layoutVertexBuffer,U.indexBuffer,U.segments,null,h.transform.zoom,null,null,U.collisionVertexBuffer)}if(!l||!b.length)return;const P=h.useProgram("collisionCircle"),I=new c.c0;I.resize(4*w),I._trim();let D=0;for(const j of b)for(let N=0;N<j.circleArray.length/4;N++){const $=4*N,U=j.circleArray[$+0],W=j.circleArray[$+1],K=j.circleArray[$+2],Z=j.circleArray[$+3];I.emplace(D++,U,W,K,Z,0),I.emplace(D++,U,W,K,Z,1),I.emplace(D++,U,W,K,Z,2),I.emplace(D++,U,W,K,Z,3)}(!Fs||Fs.length<2*w)&&(Fs=(function(j){const N=2*j,$=new c.c2;$.resize(N),$._trim();for(let U=0;U<N;U++){const W=6*U;$.uint16[W+0]=4*U+0,$.uint16[W+1]=4*U+1,$.uint16[W+2]=4*U+2,$.uint16[W+3]=4*U+2,$.uint16[W+4]=4*U+3,$.uint16[W+5]=4*U+0}return $})(w));const B=d.createIndexBuffer(Fs,!0),O=d.createVertexBuffer(I,c.c1.members,!0);for(const j of b){const N=oa(h.transform);P.draw(d,g.TRIANGLES,qe.disabled,Xe.disabled,h.colorModeForRenderPass(),it.disabled,N,h.style.map.terrain&&h.style.map.terrain.getTerrainData(j.coord),null,n.id,O,B,c.aM.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,h.transform.zoom,null,null,null)}O.destroy(),B.destroy()}const hh=c.ag(new Float32Array(16));function Xo(h,e,n,s,l,d){const{horizontalAlign:f,verticalAlign:g}=c.aH(h);return new c.P((-(f-.5)*e/l+s[0])*d,(-(g-.5)*n/l+s[1])*d)}function Bs(h,e,n,s,l,d){const f=e.tileAnchorPoint.add(new c.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let g=s.mult(d);n||(g=g.rotate(-l));const y=f.add(g);return ve(y.x,y.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(n){const g=Sr(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(h),y=Math.atan(g.y/g.x)+(g.x<0?Math.PI:0);return h.add(s.rotate(y))}return h.add(s)}function Os(h,e,n,s,l,d,f,g,y,b,w,S){const P=h.text.placedSymbolArray,I=h.text.dynamicLayoutVertexArray,D=h.icon.dynamicLayoutVertexArray,B={};I.clear();for(let O=0;O<P.length;O++){const j=P.get(O),N=j.hidden||!j.crossTileID||h.allowVerticalPlacement&&!j.placedOrientation?null:s[j.crossTileID];if(N){const $=new c.P(j.anchorX,j.anchorY),U={getElevation:S,width:l.width,height:l.height,pitchedLabelPlaneMatrix:d,pitchWithMap:n,transform:l,tileAnchorPoint:$,translation:b,unwrappedTileID:w},W=n?He($.x,$.y,U):Sr($.x,$.y,U),K=Pr(l.cameraToCenterDistance,W.signedDistanceFromCamera);let Z=c.ap(h.textSizeData,g,j)*K/c.aB;n&&(Z*=h.tilePixelRatio/f);const{width:ee,height:he,anchor:se,textOffset:le,textBoxScale:ce}=N,we=Xo(se,ee,he,le,ce,Z),Te=l.getPitchedTextCorrection($.x+b[0],$.y+b[1],w),ge=Bs(W.point,U,e,we,-l.bearingInRadians,Te),ke=h.allowVerticalPlacement&&j.placedOrientation===c.ao.vertical?Math.PI/2:0;for(let We=0;We<j.numGlyphs;We++)c.av(I,ge,ke);y&&j.associatedIconIndex>=0&&(B[j.associatedIconIndex]={shiftedAnchor:ge,angle:ke})}else Dr(j.numGlyphs,I)}if(y){D.clear();const O=h.icon.placedSymbolArray;for(let j=0;j<O.length;j++){const N=O.get(j);if(N.hidden)Dr(N.numGlyphs,D);else{const $=B[j];if($)for(let U=0;U<N.numGlyphs;U++)c.av(D,$.shiftedAnchor,$.angle);else Dr(N.numGlyphs,D)}}h.icon.dynamicLayoutVertexBuffer.updateData(D)}h.text.dynamicLayoutVertexBuffer.updateData(I)}function js(h,e,n){return n.iconsInText&&e?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function Vs(h,e,n,s,l,d,f,g,y,b,w,S,P){const I=h.context,D=I.gl,B=h.transform,O=g==="map",j=y==="map",N=g!=="viewport"&&n.layout.get("symbol-placement")!=="point",$=O&&!j&&!N,U=!n.layout.get("symbol-sort-key").isConstant();let W=!1;const K=h.getDepthModeForSublayer(0,qe.ReadOnly),Z=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),ee=[],he=B.getCircleRadiusCorrection();for(const se of s){const le=e.getTile(se),ce=le.getBucket(n);if(!ce)continue;const we=l?ce.text:ce.icon;if(!we||!we.segments.get().length||!we.hasVisibleVertices)continue;const Te=we.programConfigurations.get(n.id),ge=l||ce.sdfIcons,ke=l?ce.textSizeData:ce.iconSizeData,We=j||B.pitch!==0,ut=h.useProgram(js(ge,l,ce),Te),dt=c.an(ke,B.zoom),_t=h.style.map.terrain&&h.style.map.terrain.getTerrainData(se);let Ct,xt,at,St,ui=[0,0],Vt=null;if(l)xt=le.glyphAtlasTexture,at=D.LINEAR,Ct=le.glyphAtlasTexture.size,ce.iconsInText&&(ui=le.imageAtlasTexture.size,Vt=le.imageAtlasTexture,St=We||h.options.rotating||h.options.zooming||ke.kind==="composite"||ke.kind==="camera"?D.LINEAR:D.NEAREST);else{const Ft=n.layout.get("icon-size").constantOr(0)!==1||ce.iconsNeedLinear;xt=le.imageAtlasTexture,at=ge||h.options.rotating||h.options.zooming||Ft||We?D.LINEAR:D.NEAREST,Ct=le.imageAtlasTexture.size}const Nt=c.aC(le,1,h.transform.zoom),Pi=gt(O,h.transform,Nt),an=c.L();c.aq(an,Pi);const fr=Wt(j,O,h.transform,Nt),sn=c.aD(B,le,d,f),Nn=B.getProjectionData({overscaledTileID:se,applyGlobeMatrix:!P,applyTerrainMatrix:!0}),ao=Z&&ce.hasTextData(),wa=n.layout.get("icon-text-fit")!=="none"&&ao&&ce.hasIconData();if(N){const Ft=h.style.map.terrain?(Zi,ii)=>h.style.map.terrain.getElevation(se,Zi,ii):null,Yt=n.layout.get("text-rotation-alignment")==="map";Oi(ce,h,l,Pi,an,j,b,Yt,se.toUnwrapped(),B.width,B.height,sn,Ft)}const Or=l&&Z||wa,Ui=N||Or?hh:j?Pi:h.transform.clipSpaceToPixelsMatrix,zr=ge&&n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Er;Er=ge?ce.iconsInText?Kl(ke.kind,dt,$,j,N,Or,h,Ui,fr,sn,Ct,ui,he):Oo(ke.kind,dt,$,j,N,Or,h,Ui,fr,sn,l,Ct,0,he):Yl(ke.kind,dt,$,j,N,Or,h,Ui,fr,sn,l,Ct,he);const $i={program:ut,buffers:we,uniformValues:Er,projectionData:Nn,atlasTexture:xt,atlasTextureIcon:Vt,atlasInterpolation:at,atlasInterpolationIcon:St,isSDF:ge,hasHalo:zr};if(U&&ce.canOverlap){W=!0;const Ft=we.segments.get();for(const Yt of Ft)ee.push({segments:new c.aM([Yt]),sortKey:Yt.sortKey,state:$i,terrainData:_t})}else ee.push({segments:we.segments,sortKey:0,state:$i,terrainData:_t})}W&&ee.sort(((se,le)=>se.sortKey-le.sortKey));for(const se of ee){const le=se.state;if(I.activeTexture.set(D.TEXTURE0),le.atlasTexture.bind(le.atlasInterpolation,D.CLAMP_TO_EDGE),le.atlasTextureIcon&&(I.activeTexture.set(D.TEXTURE1),le.atlasTextureIcon&&le.atlasTextureIcon.bind(le.atlasInterpolationIcon,D.CLAMP_TO_EDGE)),le.isSDF){const ce=le.uniformValues;le.hasHalo&&(ce.u_is_halo=1,Yo(le.buffers,se.segments,n,h,le.program,K,w,S,ce,le.projectionData,se.terrainData)),ce.u_is_halo=0}Yo(le.buffers,se.segments,n,h,le.program,K,w,S,le.uniformValues,le.projectionData,se.terrainData)}}function Yo(h,e,n,s,l,d,f,g,y,b,w){const S=s.context;l.draw(S,S.gl.TRIANGLES,d,f,g,it.backCCW,y,w,b,n.id,h.layoutVertexBuffer,h.indexBuffer,e,n.paint,s.transform.zoom,h.programConfigurations.get(n.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function Ns(h,e,n,s,l){const d=h.context,f=d.gl,g=Xe.disabled,y=new mt([f.ONE,f.ONE],c.bf.transparent,[!0,!0,!0,!0]),b=e.getBucket(n);if(!b)return;const w=s.key;let S=n.heatmapFbos.get(w);S||(S=Xa(d,e.tileSize,e.tileSize),n.heatmapFbos.set(w,S)),d.bindFramebuffer.set(S.framebuffer),d.viewport.set([0,0,e.tileSize,e.tileSize]),d.clear({color:c.bf.transparent});const P=b.programConfigurations.get(n.id),I=h.useProgram("heatmap",P,!l),D=h.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),B=h.style.map.terrain.getTerrainData(s);I.draw(d,f.TRIANGLES,qe.disabled,g,y,it.disabled,Fo(e,h.transform.zoom,n.paint.get("heatmap-intensity"),1),B,D,n.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,n.paint,h.transform.zoom,P)}function Us(h,e,n,s,l){const d=h.context,f=d.gl,g=h.transform;d.setColorMode(h.colorModeForRenderPass());const y=Dn(d,e),b=n.key,w=e.heatmapFbos.get(b);if(!w)return;d.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,w.colorAttachment.get()),d.activeTexture.set(f.TEXTURE1),y.bind(f.LINEAR,f.CLAMP_TO_EDGE);const S=g.getProjectionData({overscaledTileID:n,applyTerrainMatrix:l,applyGlobeMatrix:!s});h.useProgram("heatmapTexture").draw(d,f.TRIANGLES,qe.disabled,Xe.disabled,h.colorModeForRenderPass(),it.disabled,Ul(h,e,0,1),null,S,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,g.zoom),w.destroy(),e.heatmapFbos.delete(b)}function Xa(h,e,n){var s,l;const d=h.gl,f=d.createTexture();d.bindTexture(d.TEXTURE_2D,f),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR);const g=(s=h.HALF_FLOAT)!==null&&s!==void 0?s:d.UNSIGNED_BYTE,y=(l=h.RGBA16F)!==null&&l!==void 0?l:d.RGBA;d.texImage2D(d.TEXTURE_2D,0,y,e,n,0,d.RGBA,g,null);const b=h.createFramebuffer(e,n,!1,!1);return b.colorAttachment.set(f),b}function Dn(h,e){return e.colorRampTexture||(e.colorRampTexture=new c.T(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function $s(h,e,n,s,l,d,f,g){let y=256;if(l.stepInterpolant){const b=e.getSource().maxzoom,w=f.canonical.z===b?Math.ceil(1<<h.transform.maxZoom-f.canonical.z):1;y=c.ah(c.c4(d.maxLineLength/c.$*1024*w),256,n.maxTextureSize)}return g.gradient=c.c5({expression:l.gradientExpression(),evaluationKey:"lineProgress",resolution:y,image:g.gradient||void 0,clips:d.lineClipsArray}),g.texture?g.texture.update(g.gradient):g.texture=new c.T(n,g.gradient,s.RGBA),g.version=l.gradientVersion,g.texture}function uh(h,e,n,s,l){h.activeTexture.set(e.TEXTURE0),n.imageAtlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE),s.updatePaintBuffers(l)}function Ya(h,e,n,s,l,d){(l||h.lineAtlas.dirty)&&(e.activeTexture.set(n.TEXTURE0),h.lineAtlas.bind(e)),s.updatePaintBuffers(d)}function dh(h,e,n,s,l,d,f){const g=d.gradients[l.id];let y=g.texture;l.gradientVersion!==g.version&&(y=$s(h,e,n,s,l,d,f,g)),n.activeTexture.set(s.TEXTURE0),y.bind(l.stepInterpolant?s.NEAREST:s.LINEAR,s.CLAMP_TO_EDGE)}function sc(h,e,n,s,l,d,f,g,y){const b=d.gradients[l.id];let w=b.texture;l.gradientVersion!==b.version&&(w=$s(h,e,n,s,l,d,f,b)),n.activeTexture.set(s.TEXTURE0),w.bind(l.stepInterpolant?s.NEAREST:s.LINEAR,s.CLAMP_TO_EDGE),n.activeTexture.set(s.TEXTURE1),h.lineAtlas.bind(n),g.updatePaintBuffers(y)}function Ka(h,e,n,s,l){if(!n||!s||!s.imageAtlas)return;const d=s.imageAtlas.patternPositions;let f=d[n.to.toString()],g=d[n.from.toString()];if(!f&&g&&(f=g),!g&&f&&(g=f),!f||!g){const y=l.getPaintProperty(e);f=d[y],g=d[y]}f&&g&&h.setConstantPatternPositions(f,g)}function Zs(h,e,n,s,l,d,f,g){const y=h.context.gl,b="fill-pattern",w=n.paint.get(b),S=w&&w.constantOr(1),P=n.getCrossfadeParameters();let I,D,B,O,j;const N=h.transform,$=n.paint.get("fill-translate"),U=n.paint.get("fill-translate-anchor");f?(D=S&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",I=y.LINES):(D=S?"fillPattern":"fill",I=y.TRIANGLES);const W=w.constantOr(null);for(const K of s){const Z=e.getTile(K);if(S&&!Z.patternsLoaded())continue;const ee=Z.getBucket(n);if(!ee)continue;const he=ee.programConfigurations.get(n.id),se=h.useProgram(D,he),le=h.style.map.terrain&&h.style.map.terrain.getTerrainData(K);S&&(h.context.activeTexture.set(y.TEXTURE0),Z.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),he.updatePaintBuffers(P)),Ka(he,b,W,Z,n);const ce=N.getProjectionData({overscaledTileID:K,applyGlobeMatrix:!g,applyTerrainMatrix:!0}),we=c.aD(N,Z,$,U);if(f){O=ee.indexBuffer2,j=ee.segments2;const ge=[y.drawingBufferWidth,y.drawingBufferHeight];B=D==="fillOutlinePattern"&&S?eh(h,P,Z,ge,we):$a(ge,we)}else O=ee.indexBuffer,j=ee.segments,B=S?sa(h,P,Z,we):{u_fill_translate:we};const Te=h.stencilModeForClipping(K);se.draw(h.context,I,l,Te,d,it.backCCW,B,le,ce,n.id,ee.layoutVertexBuffer,O,j,n.paint,h.transform.zoom,he)}}function Gs(h,e,n,s,l,d,f,g){const y=h.context,b=y.gl,w="fill-extrusion-pattern",S=n.paint.get(w),P=S.constantOr(1),I=n.getCrossfadeParameters(),D=n.paint.get("fill-extrusion-opacity"),B=S.constantOr(null),O=h.transform;for(const j of s){const N=e.getTile(j),$=N.getBucket(n);if(!$)continue;const U=h.style.map.terrain&&h.style.map.terrain.getTerrainData(j),W=$.programConfigurations.get(n.id),K=h.useProgram(P?"fillExtrusionPattern":"fillExtrusion",W);P&&(h.context.activeTexture.set(b.TEXTURE0),N.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),W.updatePaintBuffers(I));const Z=O.getProjectionData({overscaledTileID:j,applyGlobeMatrix:!g,applyTerrainMatrix:!0});Ka(W,w,B,N,n);const ee=c.aD(O,N,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),he=n.paint.get("fill-extrusion-vertical-gradient"),se=P?Lo(h,he,D,ee,j,I,N):Vl(h,he,D,ee);K.draw(y,y.gl.TRIANGLES,l,d,f,it.backCCW,se,U,Z,n.id,$.layoutVertexBuffer,$.indexBuffer,$.segments,n.paint,h.transform.zoom,W,h.style.map.terrain&&$.centroidVertexBuffer)}}function qs(h,e,n,s,l,d,f,g,y){var b;const w=h.style.projection,S=h.context,P=h.transform,I=S.gl,D=["#define NUM_ILLUMINATION_SOURCES ".concat(n.paint.get("hillshade-highlight-color").values.length)],B=h.useProgram("hillshade",null,!1,D),O=!h.options.moving;for(const j of s){const N=e.getTile(j),$=N.fbo;if(!$)continue;const U=w.getMeshFromTileID(S,j.canonical,g,!0,"raster"),W=(b=h.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(j);S.activeTexture.set(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,$.colorAttachment.get());const K=P.getProjectionData({overscaledTileID:j,aligned:O,applyGlobeMatrix:!y,applyTerrainMatrix:!0});B.draw(S,I.TRIANGLES,d,l[j.overscaledZ],f,it.backCCW,$l(h,N,n),W,K,n.id,U.vertexBuffer,U.indexBuffer,U.segments)}}function ua(h,e,n,s,l,d,f,g,y){var b;const w=h.style.projection,S=h.context,P=h.transform,I=S.gl,D=h.useProgram("colorRelief"),B=!h.options.moving;let O=!0,j=0;for(const N of s){const $=e.getTile(N),U=$.dem;if(O){const se=I.getParameter(I.MAX_TEXTURE_SIZE),{elevationTexture:le,colorTexture:ce}=n.getColorRampTextures(S,se,U.getUnpackVector());S.activeTexture.set(I.TEXTURE1),le.bind(I.NEAREST,I.CLAMP_TO_EDGE),S.activeTexture.set(I.TEXTURE4),ce.bind(I.LINEAR,I.CLAMP_TO_EDGE),O=!1,j=le.size[0]}if(!U||!U.data)continue;const W=U.stride,K=U.getPixels();if(S.activeTexture.set(I.TEXTURE0),S.pixelStoreUnpackPremultiplyAlpha.set(!1),$.demTexture=$.demTexture||h.getTileTexture(W),$.demTexture){const se=$.demTexture;se.update(K,{premultiply:!1}),se.bind(I.LINEAR,I.CLAMP_TO_EDGE)}else $.demTexture=new c.T(S,K,I.RGBA,{premultiply:!1}),$.demTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE);const Z=w.getMeshFromTileID(S,N.canonical,g,!0,"raster"),ee=(b=h.style.map.terrain)===null||b===void 0?void 0:b.getTerrainData(N),he=P.getProjectionData({overscaledTileID:N,aligned:B,applyGlobeMatrix:!y,applyTerrainMatrix:!0});D.draw(S,I.TRIANGLES,d,l[N.overscaledZ],f,it.backCCW,Gl(n,$.dem,j),ee,he,n.id,Z.vertexBuffer,Z.indexBuffer,Z.segments)}}const Ja=[new c.P(0,0),new c.P(c.$,0),new c.P(c.$,c.$),new c.P(0,c.$)];function Ws(h,e,n,s,l,d,f,g,y=!1,b=!1){const w=s[s.length-1].overscaledZ,S=h.context,P=S.gl,I=h.useProgram("raster"),D=h.transform,B=h.style.projection,O=h.colorModeForRenderPass(),j=!h.options.moving,N=n.paint.get("raster-opacity"),$=n.paint.get("raster-resampling"),U=n.paint.get("raster-fade-duration"),W=!!h.style.map.terrain;for(const K of s){const Z=h.getDepthModeForSublayer(K.overscaledZ-w,N===1?qe.ReadWrite:qe.ReadOnly,P.LESS),ee=e.getTile(K),he=$==="nearest"?P.NEAREST:P.LINEAR;S.activeTexture.set(P.TEXTURE0),ee.texture.bind(he,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(P.TEXTURE1);const{parentTile:se,parentScaleBy:le,parentTopLeft:ce,fadeValues:we}=oc(ee,e,U,W);ee.fadeOpacity=we.tileOpacity,se?(se.fadeOpacity=we.parentTileOpacity,se.texture.bind(he,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST)):ee.texture.bind(he,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST),ee.texture.useMipmap&&S.extTextureFilterAnisotropic&&h.transform.pitch>20&&P.texParameterf(P.TEXTURE_2D,S.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,S.extTextureFilterAnisotropicMax);const Te=h.style.map.terrain&&h.style.map.terrain.getTerrainData(K),ge=D.getProjectionData({overscaledTileID:K,aligned:j,applyGlobeMatrix:!b,applyTerrainMatrix:!0}),ke=Cs(ce,le,we.fadeMix,n,g),We=B.getMeshFromTileID(S,K.canonical,d,f,"raster");I.draw(S,P.TRIANGLES,Z,l?l[K.overscaledZ]:Xe.disabled,O,y?it.frontCCW:it.backCCW,ke,Te,ge,n.id,We.vertexBuffer,We.indexBuffer,We.segments)}}function oc(h,e,n,s){const l={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(n===0||s)return l;if(h.fadingParentID){const d=e._getLoadedTile(h.fadingParentID);if(!d)return l;const f=Math.pow(2,d.tileID.overscaledZ-h.tileID.overscaledZ),g=[h.tileID.canonical.x*f%1,h.tileID.canonical.y*f%1],y=(function(b,w,S){const P=Ze.now(),I=(P-w.timeAdded)/S,D=b.fadingDirection===Q.Incoming,B=c.ah((P-b.timeAdded)/S,0,1),O=c.ah(1-I,0,1),j=D?B:O;return{tileOpacity:j,parentTileOpacity:D?O:B,fadeMix:{opacity:1,mix:1-j}}})(h,d,n);return{parentTile:d,parentScaleBy:f,parentTopLeft:g,fadeValues:y}}if(h.selfFading){const d=(function(f,g){const y=Ze.now(),b=c.ah((y-f.timeAdded)/g,0,1);return{tileOpacity:b,fadeMix:{opacity:b,mix:0}}})(h,n);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:d}}return l}const Rt=new c.bf(1,0,0,1),Rn=new c.bf(0,1,0,1),tr=new c.bf(0,0,1,1),Ko=new c.bf(1,0,1,1),Hs=new c.bf(0,1,1,1);function Jo(h,e,n,s){da(h,0,e+n/2,h.transform.width,n,s)}function Ln(h,e,n,s){da(h,e-n/2,0,n,h.transform.height,s)}function da(h,e,n,s,l,d){const f=h.context,g=f.gl;g.enable(g.SCISSOR_TEST),g.scissor(e*h.pixelRatio,n*h.pixelRatio,s*h.pixelRatio,l*h.pixelRatio),f.clear({color:d}),g.disable(g.SCISSOR_TEST)}function Qa(h,e,n){const s=h.context,l=s.gl,d=h.useProgram("debug"),f=qe.disabled,g=Xe.disabled,y=h.colorModeForRenderPass(),b="$debug",w=h.style.map.terrain&&h.style.map.terrain.getTerrainData(n);s.activeTexture.set(l.TEXTURE0);const S=e.getTileByID(n.key).latestRawTileData,P=Math.floor((S&&S.byteLength||0)/1024),I=e.getTile(n).tileSize,D=512/Math.min(I,512)*(n.overscaledZ/h.transform.zoom)*.5;let B=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(B+=" => ".concat(n.overscaledZ)),(function(j,N){j.initDebugOverlayCanvas();const $=j.debugOverlayCanvas,U=j.context.gl,W=j.debugOverlayCanvas.getContext("2d");W.clearRect(0,0,$.width,$.height),W.shadowColor="white",W.shadowBlur=2,W.lineWidth=1.5,W.strokeStyle="white",W.textBaseline="top",W.font="bold 36px Open Sans, sans-serif",W.fillText(N,5,5),W.strokeText(N,5,5),j.debugOverlayTexture.update($),j.debugOverlayTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE)})(h,"".concat(B," ").concat(P,"kB"));const O=h.transform.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});d.draw(s,l.TRIANGLES,f,g,mt.alphaBlended,it.disabled,Nl(c.bf.transparent,D),null,O,b,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),d.draw(s,l.LINE_STRIP,f,g,y,it.disabled,Nl(c.bf.red),w,O,b,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function Xs(h,e,n,s){const{isRenderingGlobe:l}=s,d=h.context,f=d.gl,g=h.transform,y=h.colorModeForRenderPass(),b=h.getDepthModeFor3D(),w=h.useProgram("terrain");d.bindFramebuffer.set(null),d.viewport.set([0,0,h.width,h.height]);for(const S of n){const P=e.getTerrainMesh(S.tileID),I=h.renderToTexture.getTexture(S),D=e.getTerrainData(S.tileID);d.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,I.texture);const B=e.getMeshFrameDelta(g.zoom),O=g.calculateFogMatrix(S.tileID.toUnwrapped()),j=Do(B,O,h.style.sky,g.pitch,l),N=g.getProjectionData({overscaledTileID:S.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});w.draw(d,f.TRIANGLES,b,Xe.disabled,y,it.backCCW,j,D,N,"terrain",P.vertexBuffer,P.indexBuffer,P.segments)}}function Qo(h,e){if(!e.mesh){const n=new c.aL;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1);const s=new c.aN;s.emplaceBack(0,1,2),s.emplaceBack(0,2,3),e.mesh=new Qn(h.createVertexBuffer(n,bi.members),h.createIndexBuffer(s),c.aM.simpleSegment(0,0,n.length,s.length))}return e.mesh}class lc{constructor(e,n){this.context=new ch(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.ag(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Re.maxUnderzooming+Re.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Da}resize(e,n,s){if(this.width=Math.floor(e*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const e=this.context,n=new c.aL;n.emplaceBack(0,0),n.emplaceBack(c.$,0),n.emplaceBack(0,c.$),n.emplaceBack(c.$,c.$),this.tileExtentBuffer=e.createVertexBuffer(n,bi.members),this.tileExtentSegments=c.aM.simpleSegment(0,0,4,2);const s=new c.aL;s.emplaceBack(0,0),s.emplaceBack(c.$,0),s.emplaceBack(0,c.$),s.emplaceBack(c.$,c.$),this.debugBuffer=e.createVertexBuffer(s,bi.members),this.debugSegments=c.aM.simpleSegment(0,0,4,5);const l=new c.c7;l.emplaceBack(0,0,0,0),l.emplaceBack(c.$,0,c.$,0),l.emplaceBack(0,c.$,0,c.$),l.emplaceBack(c.$,c.$,c.$,c.$),this.rasterBoundsBuffer=e.createVertexBuffer(l,Qc.members),this.rasterBoundsSegments=c.aM.simpleSegment(0,0,4,2);const d=new c.aL;d.emplaceBack(0,0),d.emplaceBack(c.$,0),d.emplaceBack(0,c.$),d.emplaceBack(c.$,c.$),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(d,bi.members),this.rasterBoundsSegmentsPosOnly=c.aM.simpleSegment(0,0,4,5);const f=new c.aL;f.emplaceBack(0,0),f.emplaceBack(1,0),f.emplaceBack(0,1),f.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(f,bi.members),this.viewportSegments=c.aM.simpleSegment(0,0,4,2);const g=new c.c8;g.emplaceBack(0),g.emplaceBack(1),g.emplaceBack(3),g.emplaceBack(2),g.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(g);const y=new c.aN;y.emplaceBack(1,0,2),y.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(y);const b=this.context.gl;this.stencilClearMode=new Xe({func:b.ALWAYS,mask:0},0,255,b.ZERO,b.ZERO,b.ZERO),this.tileExtentMesh=new Qn(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=c.L();c.bZ(s,0,this.width,this.height,0,0,1),c.N(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]);const l={mainMatrix:s,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s};this.useProgram("clippingMask",null,!0).draw(e,n.TRIANGLES,qe.disabled,this.stencilClearMode,mt.disabled,it.disabled,null,null,l,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,n,s){if(this.currentStencilSource===e.source||!e.isTileClipped()||!n||!n.length)return;this.currentStencilSource=e.source,this.nextStencilID+n.length>256&&this.clearStencil();const l=this.context;l.setColorMode(mt.disabled),l.setDepthMode(qe.disabled);const d={};for(const f of n)d[f.key]=this.nextStencilID++;this._renderTileMasks(d,n,s,!0),this._renderTileMasks(d,n,s,!1),this._tileClippingMaskIDs=d}_renderTileMasks(e,n,s,l){const d=this.context,f=d.gl,g=this.style.projection,y=this.transform,b=this.useProgram("clippingMask");for(const w of n){const S=e[w.key],P=this.style.map.terrain&&this.style.map.terrain.getTerrainData(w),I=g.getMeshFromTileID(this.context,w.canonical,l,!0,"stencil"),D=y.getProjectionData({overscaledTileID:w,applyGlobeMatrix:!s,applyTerrainMatrix:!0});b.draw(d,f.TRIANGLES,qe.disabled,new Xe({func:f.ALWAYS,mask:0},S,255,f.KEEP,f.KEEP,f.REPLACE),mt.disabled,s?it.disabled:it.backCCW,null,P,D,"$clipping",I.vertexBuffer,I.indexBuffer,I.segments)}}_renderTilesDepthBuffer(){const e=this.context,n=e.gl,s=this.style.projection,l=this.transform,d=this.useProgram("depth"),f=this.getDepthModeFor3D(),g=st(l,{tileSize:l.tileSize});for(const y of g){const b=this.style.map.terrain&&this.style.map.terrain.getTerrainData(y),w=s.getMeshFromTileID(this.context,y.canonical,!0,!0,"raster"),S=l.getProjectionData({overscaledTileID:y,applyGlobeMatrix:!0,applyTerrainMatrix:!0});d.draw(e,n.TRIANGLES,f,Xe.disabled,mt.disabled,it.backCCW,null,b,S,"$clipping",w.vertexBuffer,w.indexBuffer,w.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,n=this.context.gl;return new Xe({func:n.NOTEQUAL,mask:255},e,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(e){const n=this.context.gl;return new Xe({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const n=this.context.gl,s=e.sort(((f,g)=>g.overscaledZ-f.overscaledZ)),l=s[s.length-1].overscaledZ,d=s[0].overscaledZ-l+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();const f={};for(let g=0;g<d;g++)f[g+l]=new Xe({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=d,[f,s]}return[{[l]:Xe.disabled},s]}stencilConfigForOverlapTwoPass(e){const n=this.context.gl,s=e.sort(((f,g)=>g.overscaledZ-f.overscaledZ)),l=s[s.length-1].overscaledZ,d=s[0].overscaledZ-l+1;if(this.clearStencil(),d>1){const f={},g={};for(let y=0;y<d;y++)f[y+l]=new Xe({func:n.GREATER,mask:255},d+1+y,255,n.KEEP,n.KEEP,n.REPLACE),g[y+l]=new Xe({func:n.GREATER,mask:255},1+y,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*d+1,[f,g,s]}return this.nextStencilID=3,[{[l]:new Xe({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[l]:new Xe({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},s]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new mt([e.CONSTANT_COLOR,e.ONE],new c.bf(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?mt.unblended:mt.alphaBlended}getDepthModeForSublayer(e,n,s){if(!this.opaquePassEnabledForLayer())return qe.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new qe(s||this.context.gl.LEQUAL,n,[l,l])}getDepthModeFor3D(){return new qe(this.context.gl.LEQUAL,qe.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){var s,l;this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(Ze.now()),this.imageManager.beginFrame();const d=this.style._order,f=this.style.sourceCaches,g={},y={},b={},w={isRenderingToTexture:!1,isRenderingGlobe:((s=e.projection)===null||s===void 0?void 0:s.transitionState)>0};for(const P in f){const I=f[P];I.used&&I.prepare(this.context),g[P]=I.getVisibleCoordinates(!1),y[P]=g[P].slice().reverse(),b[P]=I.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let P=0;P<d.length;P++)if(this.style._layers[d[P]].is3D()){this.opaquePassCutoff=P;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const P of d){const I=this.style._layers[P];if(!I.hasOffscreenPass()||I.isHidden(this.transform.zoom))continue;const D=y[I.source];(I.type==="custom"||D.length)&&this.renderLayer(this,f[I.source],I,D,w)}if((l=this.style.projection)===null||l===void 0||l.updateGPUdependent({context:this.context,useProgram:P=>this.useProgram(P)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?c.bf.black:c.bf.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(P,I){const D=P.context,B=D.gl,O=((K,Z,ee)=>{const he=Math.cos(Z.rollInRadians),se=Math.sin(Z.rollInRadians),le=ae(Z),ce=Z.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:K.properties.get("sky-color"),u_horizon_color:K.properties.get("horizon-color"),u_horizon:[(Z.width/2-le*se)*ee,(Z.height/2+le*he)*ee],u_horizon_normal:[-se,he],u_sky_horizon_blend:K.properties.get("sky-horizon-blend")*Z.height/2*ee,u_sky_blend:ce}})(I,P.style.map.transform,P.pixelRatio),j=new qe(B.LEQUAL,qe.ReadWrite,[0,1]),N=Xe.disabled,$=P.colorModeForRenderPass(),U=P.useProgram("sky"),W=Qo(D,I);U.draw(D,B.TRIANGLES,j,N,$,it.disabled,O,null,void 0,"sky",W.vertexBuffer,W.indexBuffer,W.segments)})(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=d.length-1;this.currentLayer>=0;this.currentLayer--){const P=this.style._layers[d[this.currentLayer]],I=f[P.source],D=g[P.source];this._renderTileClippingMasks(P,D,!1),this.renderLayer(this,I,P,D,w)}this.renderPass="translucent";let S=!1;for(this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){const P=this.style._layers[d[this.currentLayer]],I=f[P.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(P,w))continue;this.opaquePassEnabledForLayer()||S||(S=!0,w.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const D=(P.type==="symbol"?b:y)[P.source];this._renderTileClippingMasks(P,g[P.source],!!this.renderToTexture),this.renderLayer(this,I,P,D,w)}if(w.isRenderingGlobe&&(function(P,I,D){const B=P.context,O=B.gl,j=P.useProgram("atmosphere"),N=new qe(O.LEQUAL,qe.ReadOnly,[0,1]),$=P.transform,U=(function(ce,we){const Te=ce.properties.get("position"),ge=[-Te.x,-Te.y,-Te.z],ke=c.ag(new Float64Array(16));return ce.properties.get("anchor")==="map"&&(c.b6(ke,ke,we.rollInRadians),c.b7(ke,ke,-we.pitchInRadians),c.b6(ke,ke,we.bearingInRadians),c.b7(ke,ke,we.center.lat*Math.PI/180),c.bz(ke,ke,-we.center.lng*Math.PI/180)),c.c6(ge,ge,ke),ge})(D,P.transform),W=$.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),K=I.properties.get("atmosphere-blend")*W.projectionTransition;if(K===0)return;const Z=Cn($.worldSize,$.center.lat),ee=$.inverseProjectionMatrix,he=new Float64Array(4);he[3]=1,c.aw(he,he,$.modelViewProjectionMatrix),he[0]/=he[3],he[1]/=he[3],he[2]/=he[3],he[3]=1,c.aw(he,he,ee),he[0]/=he[3],he[1]/=he[3],he[2]/=he[3],he[3]=1;const se=((ce,we,Te,ge,ke)=>({u_sun_pos:ce,u_atmosphere_blend:we,u_globe_position:Te,u_globe_radius:ge,u_inv_proj_matrix:ke}))(U,K,[he[0],he[1],he[2]],Z,ee),le=Qo(B,I);j.draw(B,O.TRIANGLES,N,Xe.disabled,mt.alphaBlended,it.disabled,se,null,null,"atmosphere",le.vertexBuffer,le.indexBuffer,le.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const P=(function(I,D){let B=null;const O=Object.values(I._layers).flatMap((U=>U.source&&!U.isHidden(D)?[I.sourceCaches[U.source]]:[])),j=O.filter((U=>U.getSource().type==="vector")),N=O.filter((U=>U.getSource().type!=="vector")),$=U=>{(!B||B.getSource().maxzoom<U.getSource().maxzoom)&&(B=U)};return j.forEach((U=>$(U))),B||N.forEach((U=>$(U))),B})(this.style,this.transform.zoom);P&&(function(I,D,B){for(let O=0;O<B.length;O++)Qa(I,D,B[O])})(this,P,P.getVisibleCoordinates())}this.options.showPadding&&(function(P){const I=P.transform.padding;Jo(P,P.transform.height-(I.top||0),3,Rt),Jo(P,I.bottom||0,3,Rn),Ln(P,I.left||0,3,tr),Ln(P,P.transform.width-(I.right||0),3,Ko);const D=P.transform.centerPoint;(function(B,O,j,N){da(B,O-1,j-10,2,20,N),da(B,O-10,j-1,20,2,N)})(P,D.x,P.transform.height-D.y,Hs)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const n=this.terrainFacilitator.matrix,s=this.transform.modelViewProjectionMatrix;let l=this.terrainFacilitator.dirty;l||(l=e?!c.c9(n,s):!c.ca(n,s)),l||(l=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),l&&(c.cb(n,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(d,f){const g=d.context,y=g.gl,b=d.transform,w=mt.unblended,S=new qe(y.LEQUAL,qe.ReadWrite,[0,1]),P=f.sourceCache.getRenderableTiles(),I=d.useProgram("terrainDepth");g.bindFramebuffer.set(f.getFramebuffer("depth").framebuffer),g.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),g.clear({color:c.bf.transparent,depth:1});for(const D of P){const B=f.getTerrainMesh(D.tileID),O=f.getTerrainData(D.tileID),j=b.getProjectionData({overscaledTileID:D.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),N={u_ele_delta:f.getMeshFrameDelta(b.zoom)};I.draw(g,y.TRIANGLES,S,Xe.disabled,w,it.backCCW,N,O,j,"terrain",B.vertexBuffer,B.indexBuffer,B.segments)}g.bindFramebuffer.set(null),g.viewport.set([0,0,d.width,d.height])})(this,this.style.map.terrain),(function(d,f){const g=d.context,y=g.gl,b=d.transform,w=mt.unblended,S=new qe(y.LEQUAL,qe.ReadWrite,[0,1]),P=f.getCoordsTexture(),I=f.sourceCache.getRenderableTiles(),D=d.useProgram("terrainCoords");g.bindFramebuffer.set(f.getFramebuffer("coords").framebuffer),g.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),g.clear({color:c.bf.transparent,depth:1}),f.coordsIndex=[];for(const B of I){const O=f.getTerrainMesh(B.tileID),j=f.getTerrainData(B.tileID);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,P.texture);const N={u_terrain_coords_id:(255-f.coordsIndex.length)/255,u_texture:0,u_ele_delta:f.getMeshFrameDelta(b.zoom)},$=b.getProjectionData({overscaledTileID:B.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});D.draw(g,y.TRIANGLES,S,Xe.disabled,w,it.backCCW,N,j,$,"terrain",O.vertexBuffer,O.indexBuffer,O.segments),f.coordsIndex.push(B.tileID.key)}g.bindFramebuffer.set(null),g.viewport.set([0,0,d.width,d.height])})(this,this.style.map.terrain))}renderLayer(e,n,s,l,d){s.isHidden(this.transform.zoom)||(s.type==="background"||s.type==="custom"||(l||[]).length)&&(this.id=s.id,c.cc(s)?(function(f,g,y,b,w,S){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:P}=S,I=Xe.disabled,D=f.colorModeForRenderPass();(y._unevaluatedLayout.hasValue("text-variable-anchor")||y._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(B,O,j,N,$,U,W,K,Z){const ee=O.transform,he=O.style.map.terrain,se=$==="map",le=U==="map";for(const ce of B){const we=N.getTile(ce),Te=we.getBucket(j);if(!Te||!Te.text||!Te.text.segments.get().length)continue;const ge=c.an(Te.textSizeData,ee.zoom),ke=c.aC(we,1,O.transform.zoom),We=gt(se,O.transform,ke),ut=j.layout.get("icon-text-fit")!=="none"&&Te.hasIconData();if(ge){const dt=Math.pow(2,ee.zoom-we.tileID.overscaledZ),_t=he?(Ct,xt)=>he.getElevation(ce,Ct,xt):null;Os(Te,se,le,Z,ee,We,dt,ge,ut,c.aD(ee,we,W,K),ce.toUnwrapped(),_t)}}})(b,f,y,g,y.layout.get("text-rotation-alignment"),y.layout.get("text-pitch-alignment"),y.paint.get("text-translate"),y.paint.get("text-translate-anchor"),w),y.paint.get("icon-opacity").constantOr(1)!==0&&Vs(f,g,y,b,!1,y.paint.get("icon-translate"),y.paint.get("icon-translate-anchor"),y.layout.get("icon-rotation-alignment"),y.layout.get("icon-pitch-alignment"),y.layout.get("icon-keep-upright"),I,D,P),y.paint.get("text-opacity").constantOr(1)!==0&&Vs(f,g,y,b,!0,y.paint.get("text-translate"),y.paint.get("text-translate-anchor"),y.layout.get("text-rotation-alignment"),y.layout.get("text-pitch-alignment"),y.layout.get("text-keep-upright"),I,D,P),g.map.showCollisionBoxes&&(Ho(f,g,y,b,!0),Ho(f,g,y,b,!1))})(e,n,s,l,this.style.placement.variableOffsets,d):c.cd(s)?(function(f,g,y,b,w){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:S}=w,P=y.paint.get("circle-opacity"),I=y.paint.get("circle-stroke-width"),D=y.paint.get("circle-stroke-opacity"),B=!y.layout.get("circle-sort-key").isConstant();if(P.constantOr(1)===0&&(I.constantOr(1)===0||D.constantOr(1)===0))return;const O=f.context,j=O.gl,N=f.transform,$=f.getDepthModeForSublayer(0,qe.ReadOnly),U=Xe.disabled,W=f.colorModeForRenderPass(),K=[],Z=N.getCircleRadiusCorrection();for(let ee=0;ee<b.length;ee++){const he=b[ee],se=g.getTile(he),le=se.getBucket(y);if(!le)continue;const ce=y.paint.get("circle-translate"),we=y.paint.get("circle-translate-anchor"),Te=c.aD(N,se,ce,we),ge=le.programConfigurations.get(y.id),ke=f.useProgram("circle",ge),We=le.layoutVertexBuffer,ut=le.indexBuffer,dt=f.style.map.terrain&&f.style.map.terrain.getTerrainData(he),_t={programConfiguration:ge,program:ke,layoutVertexBuffer:We,indexBuffer:ut,uniformValues:Ms(f,se,y,Te,Z),terrainData:dt,projectionData:N.getProjectionData({overscaledTileID:he,applyGlobeMatrix:!S,applyTerrainMatrix:!0})};if(B){const Ct=le.segments.get();for(const xt of Ct)K.push({segments:new c.aM([xt]),sortKey:xt.sortKey,state:_t})}else K.push({segments:le.segments,sortKey:0,state:_t})}B&&K.sort(((ee,he)=>ee.sortKey-he.sortKey));for(const ee of K){const{programConfiguration:he,program:se,layoutVertexBuffer:le,indexBuffer:ce,uniformValues:we,terrainData:Te,projectionData:ge}=ee.state;se.draw(O,j.TRIANGLES,$,U,W,it.backCCW,we,Te,ge,y.id,le,ce,ee.segments,y.paint,f.transform.zoom,he)}})(e,n,s,l,d):c.ce(s)?(function(f,g,y,b,w){if(y.paint.get("heatmap-opacity")===0)return;const S=f.context,{isRenderingToTexture:P,isRenderingGlobe:I}=w;if(f.style.map.terrain){for(const D of b){const B=g.getTile(D);g.hasRenderableParent(D)||(f.renderPass==="offscreen"?Ns(f,B,y,D,I):f.renderPass==="translucent"&&Us(f,y,D,P,I))}S.viewport.set([0,0,f.width,f.height])}else f.renderPass==="offscreen"?(function(D,B,O,j){const N=D.context,$=N.gl,U=D.transform,W=Xe.disabled,K=new mt([$.ONE,$.ONE],c.bf.transparent,[!0,!0,!0,!0]);(function(Z,ee,he){const se=Z.gl;Z.activeTexture.set(se.TEXTURE1),Z.viewport.set([0,0,ee.width/4,ee.height/4]);let le=he.heatmapFbos.get(c.c3);le?(se.bindTexture(se.TEXTURE_2D,le.colorAttachment.get()),Z.bindFramebuffer.set(le.framebuffer)):(le=Xa(Z,ee.width/4,ee.height/4),he.heatmapFbos.set(c.c3,le))})(N,D,O),N.clear({color:c.bf.transparent});for(let Z=0;Z<j.length;Z++){const ee=j[Z];if(B.hasRenderableParent(ee))continue;const he=B.getTile(ee),se=he.getBucket(O);if(!se)continue;const le=se.programConfigurations.get(O.id),ce=D.useProgram("heatmap",le),we=U.getProjectionData({overscaledTileID:ee,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Te=U.getCircleRadiusCorrection();ce.draw(N,$.TRIANGLES,qe.disabled,W,K,it.backCCW,Fo(he,U.zoom,O.paint.get("heatmap-intensity"),Te),null,we,O.id,se.layoutVertexBuffer,se.indexBuffer,se.segments,O.paint,U.zoom,le)}N.viewport.set([0,0,D.width,D.height])})(f,g,y,b):f.renderPass==="translucent"&&(function(D,B){const O=D.context,j=O.gl;O.setColorMode(D.colorModeForRenderPass());const N=B.heatmapFbos.get(c.c3);N&&(O.activeTexture.set(j.TEXTURE0),j.bindTexture(j.TEXTURE_2D,N.colorAttachment.get()),O.activeTexture.set(j.TEXTURE1),Dn(O,B).bind(j.LINEAR,j.CLAMP_TO_EDGE),D.useProgram("heatmapTexture").draw(O,j.TRIANGLES,qe.disabled,Xe.disabled,D.colorModeForRenderPass(),it.disabled,Ul(D,B,0,1),null,null,B.id,D.viewportBuffer,D.quadTriangleIndexBuffer,D.viewportSegments,B.paint,D.transform.zoom))})(f,y)})(e,n,s,l,d):c.cf(s)?(function(f,g,y,b,w){if(f.renderPass!=="translucent")return;const{isRenderingToTexture:S}=w,P=y.paint.get("line-opacity"),I=y.paint.get("line-width");if(P.constantOr(1)===0||I.constantOr(1)===0)return;const D=f.getDepthModeForSublayer(0,qe.ReadOnly),B=f.colorModeForRenderPass(),O=y.paint.get("line-dasharray"),j=O.constantOr(1),N=y.paint.get("line-pattern"),$=N.constantOr(1),U=y.paint.get("line-gradient"),W=y.getCrossfadeParameters();let K;K=$?"linePattern":j&&U?"lineGradientSDF":j?"lineSDF":U?"lineGradient":"line";const Z=f.context,ee=Z.gl,he=f.transform;let se=!0;for(const le of b){const ce=g.getTile(le);if($&&!ce.patternsLoaded())continue;const we=ce.getBucket(y);if(!we)continue;const Te=we.programConfigurations.get(y.id),ge=f.context.program.get(),ke=f.useProgram(K,Te),We=se||ke.program!==ge,ut=f.style.map.terrain&&f.style.map.terrain.getTerrainData(le),dt=N.constantOr(null),_t=O&&O.constantOr(null);if(dt&&ce.imageAtlas){const ui=ce.imageAtlas,Vt=ui.patternPositions[dt.to.toString()],Nt=ui.patternPositions[dt.from.toString()];Vt&&Nt&&Te.setConstantPatternPositions(Vt,Nt)}else if(_t){const ui=y.layout.get("line-cap")==="round",Vt=f.lineAtlas.getDash(_t.to,ui),Nt=f.lineAtlas.getDash(_t.from,ui);Te.setConstantDashPositions(Vt,Nt)}const Ct=he.getProjectionData({overscaledTileID:le,applyGlobeMatrix:!S,applyTerrainMatrix:!0}),xt=he.getPixelScale();let at;$?(at=In(f,ce,y,xt,W),uh(Z,ee,ce,Te,W)):j&&U?(at=Hl(f,ce,y,xt,W,we.lineClipsArray.length),sc(f,g,Z,ee,y,we,le,Te,W)):j?(at=Wl(f,ce,y,xt,W),Ya(f,Z,ee,Te,We,W)):U?(at=ql(f,ce,y,xt,we.lineClipsArray.length),dh(f,g,Z,ee,y,we,le)):at=Za(f,ce,y,xt);const St=f.stencilModeForClipping(le);ke.draw(Z,ee.TRIANGLES,D,St,B,it.disabled,at,ut,Ct,y.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,y.paint,f.transform.zoom,Te,we.layoutVertexBuffer2),se=!1}})(e,n,s,l,d):c.cg(s)?(function(f,g,y,b,w){const S=y.paint.get("fill-color"),P=y.paint.get("fill-opacity");if(P.constantOr(1)===0)return;const{isRenderingToTexture:I}=w,D=f.colorModeForRenderPass(),B=y.paint.get("fill-pattern"),O=f.opaquePassEnabledForLayer()&&!B.constantOr(1)&&S.constantOr(c.bf.transparent).a===1&&P.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===O){const j=f.getDepthModeForSublayer(1,f.renderPass==="opaque"?qe.ReadWrite:qe.ReadOnly);Zs(f,g,y,b,j,D,!1,I)}if(f.renderPass==="translucent"&&y.paint.get("fill-antialias")){const j=f.getDepthModeForSublayer(y.getPaintProperty("fill-outline-color")?2:0,qe.ReadOnly);Zs(f,g,y,b,j,D,!0,I)}})(e,n,s,l,d):c.ch(s)?(function(f,g,y,b,w){const S=y.paint.get("fill-extrusion-opacity");if(S===0)return;const{isRenderingToTexture:P}=w;if(f.renderPass==="translucent"){const I=new qe(f.context.gl.LEQUAL,qe.ReadWrite,f.depthRangeFor3D);if(S!==1||y.paint.get("fill-extrusion-pattern").constantOr(1))Gs(f,g,y,b,I,Xe.disabled,mt.disabled,P),Gs(f,g,y,b,I,f.stencilModeFor3D(),f.colorModeForRenderPass(),P);else{const D=f.colorModeForRenderPass();Gs(f,g,y,b,I,Xe.disabled,D,P)}}})(e,n,s,l,d):c.ci(s)?(function(f,g,y,b,w){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent")return;const{isRenderingToTexture:S}=w,P=f.context,I=f.style.projection.useSubdivision,D=f.getDepthModeForSublayer(0,qe.ReadOnly),B=f.colorModeForRenderPass();if(f.renderPass==="offscreen")(function(O,j,N,$,U,W,K){const Z=O.context,ee=Z.gl;for(const he of N){const se=j.getTile(he),le=se.dem;if(!le||!le.data||!se.needsHillshadePrepare)continue;const ce=le.dim,we=le.stride,Te=le.getPixels();if(Z.activeTexture.set(ee.TEXTURE1),Z.pixelStoreUnpackPremultiplyAlpha.set(!1),se.demTexture=se.demTexture||O.getTileTexture(we),se.demTexture){const ke=se.demTexture;ke.update(Te,{premultiply:!1}),ke.bind(ee.NEAREST,ee.CLAMP_TO_EDGE)}else se.demTexture=new c.T(Z,Te,ee.RGBA,{premultiply:!1}),se.demTexture.bind(ee.NEAREST,ee.CLAMP_TO_EDGE);Z.activeTexture.set(ee.TEXTURE0);let ge=se.fbo;if(!ge){const ke=new c.T(Z,{width:ce,height:ce,data:null},ee.RGBA);ke.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ge=se.fbo=Z.createFramebuffer(ce,ce,!0,!1),ge.colorAttachment.set(ke.texture)}Z.bindFramebuffer.set(ge.framebuffer),Z.viewport.set([0,0,ce,ce]),O.useProgram("hillshadePrepare").draw(Z,ee.TRIANGLES,U,W,K,it.disabled,Bo(se.tileID,le),null,null,$.id,O.rasterBoundsBuffer,O.quadTriangleIndexBuffer,O.rasterBoundsSegments),se.needsHillshadePrepare=!1}})(f,g,b,y,D,Xe.disabled,B),P.viewport.set([0,0,f.width,f.height]);else if(f.renderPass==="translucent")if(I){const[O,j,N]=f.stencilConfigForOverlapTwoPass(b);qs(f,g,y,N,O,D,B,!1,S),qs(f,g,y,N,j,D,B,!0,S)}else{const[O,j]=f.getStencilConfigForOverlapAndUpdateStencilID(b);qs(f,g,y,j,O,D,B,!1,S)}})(e,n,s,l,d):c.cj(s)?(function(f,g,y,b,w){if(f.renderPass!=="translucent"||!b.length)return;const{isRenderingToTexture:S}=w,P=f.style.projection.useSubdivision,I=f.getDepthModeForSublayer(0,qe.ReadOnly),D=f.colorModeForRenderPass();if(P){const[B,O,j]=f.stencilConfigForOverlapTwoPass(b);ua(f,g,y,j,B,I,D,!1,S),ua(f,g,y,j,O,I,D,!0,S)}else{const[B,O]=f.getStencilConfigForOverlapAndUpdateStencilID(b);ua(f,g,y,O,B,I,D,!1,S)}})(e,n,s,l,d):c.bK(s)?(function(f,g,y,b,w){if(f.renderPass!=="translucent"||y.paint.get("raster-opacity")===0||!b.length)return;const{isRenderingToTexture:S}=w,P=g.getSource(),I=f.style.projection.useSubdivision;if(P instanceof Fi)Ws(f,g,y,b,null,!1,!1,P.tileCoords,P.flippedWindingOrder,S);else if(I){const[D,B,O]=f.stencilConfigForOverlapTwoPass(b);Ws(f,g,y,O,D,!1,!0,Ja,!1,S),Ws(f,g,y,O,B,!0,!0,Ja,!1,S)}else{const[D,B]=f.getStencilConfigForOverlapAndUpdateStencilID(b);Ws(f,g,y,B,D,!1,!0,Ja,!1,S)}})(e,n,s,l,d):c.ck(s)?(function(f,g,y,b,w){const S=y.paint.get("background-color"),P=y.paint.get("background-opacity");if(P===0)return;const{isRenderingToTexture:I}=w,D=f.context,B=D.gl,O=f.style.projection,j=f.transform,N=j.tileSize,$=y.paint.get("background-pattern");if(f.isPatternMissing($))return;const U=!$&&S.a===1&&P===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==U)return;const W=Xe.disabled,K=f.getDepthModeForSublayer(0,U==="opaque"?qe.ReadWrite:qe.ReadOnly),Z=f.colorModeForRenderPass(),ee=f.useProgram($?"backgroundPattern":"background"),he=b||st(j,{tileSize:N,terrain:f.style.map.terrain});$&&(D.activeTexture.set(B.TEXTURE0),f.imageManager.bind(f.context));const se=y.getCrossfadeParameters();for(const le of he){const ce=j.getProjectionData({overscaledTileID:le,applyGlobeMatrix:!I,applyTerrainMatrix:!0}),we=$?jo(P,f,$,{tileID:le,tileSize:N},se):Jl(P,S),Te=f.style.map.terrain&&f.style.map.terrain.getTerrainData(le),ge=O.getMeshFromTileID(D,le.canonical,!1,!0,"raster");ee.draw(D,B.TRIANGLES,K,W,Z,it.backCCW,we,Te,ce,y.id,ge.vertexBuffer,ge.indexBuffer,ge.segments)}})(e,0,s,l,d):c.cl(s)&&(function(f,g,y,b){const{isRenderingGlobe:w}=b,S=f.context,P=y.implementation,I=f.style.projection,D=f.transform,B=D.getProjectionDataForCustomLayer(w),O={farZ:D.farZ,nearZ:D.nearZ,fov:D.fov*Math.PI/180,modelViewProjectionMatrix:D.modelViewProjectionMatrix,projectionMatrix:D.projectionMatrix,shaderData:{variantName:I.shaderVariantName,vertexShaderPrelude:"const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n".concat(I.shaderPreludeCode.vertexSource),define:I.shaderDefine},defaultProjectionData:B},j=P.renderingMode?P.renderingMode:"2d";if(f.renderPass==="offscreen"){const N=P.prerender;N&&(f.setCustomLayerDefaults(),S.setColorMode(f.colorModeForRenderPass()),N.call(P,S.gl,O),S.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),S.setColorMode(f.colorModeForRenderPass()),S.setStencilMode(Xe.disabled);const N=j==="3d"?f.getDepthModeFor3D():f.getDepthModeForSublayer(0,qe.ReadOnly);S.setDepthMode(N),P.render(S.gl,O),S.setDirty(),f.setBaseState(),S.bindFramebuffer.set(null)}})(e,0,s,d))}saveTileTexture(e){const n=this._tileTextures[e.size[0]];n?n.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const n=this._tileTextures[e];return n&&n.length>0?n.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const n=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!n||!s}useProgram(e,n,s=!1,l=[]){this.cache=this.cache||{};const d=!!this.style.map.terrain,f=this.style.projection,g=s?vi.projectionMercator:f.shaderPreludeCode,y=s?Mn:f.shaderDefine,b=e+(n?n.cacheKey:"")+"/".concat(s?Qe:f.shaderVariantName)+(this._showOverdrawInspector?"/overdraw":"")+(d?"/terrain":"")+(l?"/".concat(l.join("/")):"");return this.cache[b]||(this.cache[b]=new Ro(this.context,vi[e],n,Is[e],this._showOverdrawInspector,d,g,y,l)),this.cache[b]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new c.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:n}=this.context.gl;return this.width!==e||this.height!==n}}function el(h,e){let n,s=!1,l=null,d=null;const f=()=>{l=null,s&&(h.apply(d,n),l=setTimeout(f,e),s=!1)};return(...g)=>(s=!0,d=this,n=g,l||f(),l)}class tl{constructor(e){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map((l=>l.split("="))).forEach((l=>{l[0]===this._hashName&&(s=l)})),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(!this._isValidHash(n))return!1;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},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(n.length===0)return;const s=n.join("/");let l=s;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l="".concat(this._hashName,"=").concat(s));let d=window.location.hash.replace(l,"");d.startsWith("#&")?d=d.slice(0,1)+d.slice(2):d==="#"&&(d="");let f=window.location.href.replace(/(#.+)?$/,d);f=f.replace("&&","&"),window.history.replaceState(window.history.state,null,f)},this._updateHash=el(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,l=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),d=Math.pow(10,l),f=Math.round(n.lng*d)/d,g=Math.round(n.lat*d)/d,y=this._map.getBearing(),b=this._map.getPitch();let w="";if(w+=e?"/".concat(f,"/").concat(g,"/").concat(s):"".concat(s,"/").concat(g,"/").concat(f),(y||b)&&(w+="/"+Math.round(10*y)/10),b&&(w+="/".concat(Math.round(b))),this._hashName){const S=this._hashName;let P=!1;const I=window.location.hash.slice(1).split("&").map((D=>{const B=D.split("=")[0];return B===S?(P=!0,"".concat(B,"=").concat(w)):D})).filter((D=>D));return P||I.push("".concat(S,"=").concat(w)),"#".concat(I.join("&"))}return"#".concat(w)}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new c.S(+e[2],+e[1])}catch(d){return!1}const n=+e[0],s=+(e[3]||0),l=+(e[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&s>=-180&&s<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const pa={linearity:.3,easing:c.cm(0,0,.3,1)},Fn=c.e({deceleration:2500,maxSpeed:1400},pa),cc=c.e({deceleration:20,maxSpeed:1400},pa),hc=c.e({deceleration:1e3,maxSpeed:360},pa),uc=c.e({deceleration:1e3,maxSpeed:90},pa),dc=c.e({deceleration:1e3,maxSpeed:360},pa);class pc{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Ze.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,n=Ze.now();for(;e.length>0&&n-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,roll:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:d}of this._inertiaBuffer)n.zoom+=d.zoomDelta||0,n.bearing+=d.bearingDelta||0,n.pitch+=d.pitchDelta||0,n.roll+=d.rollDelta||0,d.panDelta&&n.pan._add(d.panDelta),d.around&&(n.around=d.around),d.pinchAround&&(n.pinchAround=d.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){const d=ma(n.pan.mag(),s,c.e({},Fn,e||{})),f=n.pan.mult(d.amount/n.pan.mag()),g=this._map.cameraHelper.handlePanInertia(f,this._map.transform);l.center=g.easingCenter,l.offset=g.easingOffset,fa(l,d)}if(n.zoom){const d=ma(n.zoom,s,cc);l.zoom=this._map.transform.zoom+d.amount,fa(l,d)}if(n.bearing){const d=ma(n.bearing,s,hc);l.bearing=this._map.transform.bearing+c.ah(d.amount,-179,179),fa(l,d)}if(n.pitch){const d=ma(n.pitch,s,uc);l.pitch=this._map.transform.pitch+d.amount,fa(l,d)}if(n.roll){const d=ma(n.roll,s,dc);l.roll=this._map.transform.roll+c.ah(d.amount,-179,179),fa(l,d)}if(l.zoom||l.bearing){const d=n.pinchAround===void 0?n.around:n.pinchAround;l.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function fa(h,e){(!h.duration||h.duration<e.duration)&&(h.duration=e.duration,h.easing=e.easing)}function ma(h,e,n){const{maxSpeed:s,linearity:l,deceleration:d}=n,f=c.ah(h*l/(e/1e3),-s,s),g=Math.abs(f)/(d*l);return{easing:n.easing,duration:1e3*g,amount:f*(g/2)}}class Ei extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s,l={}){s=s instanceof MouseEvent?s:new MouseEvent(e,s);const d=ue.mousePos(n.getCanvas(),s),f=n.unproject(d);super(e,c.e({point:d,lngLat:f,originalEvent:s},l)),this._defaultPrevented=!1,this.target=n}}class Qr extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s){const l=e==="touchend"?s.changedTouches:s.touches,d=ue.touchPos(n.getCanvasContainer(),l),f=d.map((y=>n.unproject(y))),g=d.reduce(((y,b,w,S)=>y.add(b.div(S.length))),new c.P(0,0));super(e,{points:d,point:g,lngLats:f,lngLat:n.unproject(g),originalEvent:s}),this._defaultPrevented=!1}}class il extends c.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class ir{constructor(e,n){this._map=e,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new il(e.type,this._map,e))}mousedown(e,n){return this._mousedownPos=n,this._firePreventable(new Ei(e.type,this._map,e))}mouseup(e){this._map.fire(new Ei(e.type,this._map,e))}click(e,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ei(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ei(e.type,this._map,e))}mouseover(e){this._map.fire(new Ei(e.type,this._map,e))}mouseout(e){this._map.fire(new Ei(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Qr(e.type,this._map,e))}touchmove(e){this._map.fire(new Qr(e.type,this._map,e))}touchend(e){this._map.fire(new Qr(e.type,this._map,e))}touchcancel(e){this._map.fire(new Qr(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class dr{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ei(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class _a{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(c.P.convert(e),this._map.terrain)}}class rr{constructor(e,n){this._map=e,this._tr=new _a(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,n){this.isEnabled()&&e.shiftKey&&e.button===0&&(ue.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(e,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=s,this._box||(this._box=ue.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const d=Math.min(l.x,s.x),f=Math.max(l.x,s.x),g=Math.min(l.y,s.y),y=Math.max(l.y,s.y);ue.setTransform(this._box,"translate(".concat(d,"px,").concat(g,"px)")),this._box.style.width=f-d+"px",this._box.style.height=y-g+"px"}mouseupWindow(e,n){if(!this._active||e.button!==0)return;const s=this._startPos,l=n;if(this.reset(),ue.suppressClick(),s.x!==l.x||s.y!==l.y)return this._map.fire(new c.l("boxzoomend",{originalEvent:e})),{cameraAnimation:d=>d.fitScreenCoordinates(s,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ue.remove(this._box),this._box=null),ue.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new c.l(e,{originalEvent:n}))}}function en(h,e){if(h.length!==e.length)throw new Error("The number of touches and points are not equal - touches ".concat(h.length,", points ").concat(e.length));const n={};for(let s=0;s<h.length;s++)n[h[s].identifier]=e[s];return n}class ph{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=(function(l){const d=new c.P(0,0);for(const f of l)d._add(f);return d.div(l.length)})(n),this.touches=en(s,n)))}touchmove(e,n,s){if(this.aborted||!this.centroid)return;const l=en(s,n);for(const d in this.touches){const f=l[d];(!f||f.dist(this.touches[d])>30)&&(this.aborted=!0)}}touchend(e,n,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class rl{constructor(e){this.singleTap=new ph(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,n,s){this.singleTap.touchstart(e,n,s)}touchmove(e,n,s){this.singleTap.touchmove(e,n,s)}touchend(e,n,s){const l=this.singleTap.touchend(e,n,s);if(l){const d=e.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(l)<30;if(d&&f||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class fh{constructor(e){this._tr=new _a(e),this._zoomIn=new rl({numTouches:1,numTaps:2}),this._zoomOut=new rl({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,n,s){this._zoomIn.touchstart(e,n,s),this._zoomOut.touchstart(e,n,s)}touchmove(e,n,s){this._zoomIn.touchmove(e,n,s),this._zoomOut.touchmove(e,n,s)}touchend(e,n,s){const l=this._zoomIn.touchend(e,n,s),d=this._zoomOut.touchend(e,n,s),f=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:f.zoom+1,around:f.unproject(l)},{originalEvent:e})}):d?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:f.zoom-1,around:f.unproject(d)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class es{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const n=this._moveFunction(...e);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(e,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(n)?n[0]:n;return!this._moved&&l.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(s,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ue.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const fc=0,ts=2,Br={[fc]:1,[ts]:2};class Ae{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const n=ue.mouseButton(e);this._eventButton=n}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!(function(n,s){const l=Br[s];return n.buttons===void 0||(n.buttons&l)!==l})(e,this._eventButton)}isValidEndEvent(e){return ue.mouseButton(e)===this._eventButton}}class mc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class nl{constructor(e=new Ae({checkCorrectEvent:()=>!0}),n=new mc){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(e,n,s){return e instanceof MouseEvent?n(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?s(e):void 0}startMove(e){this._executeRelevantHandler(e,(n=>this.mouseMoveStateManager.startMove(n)),(n=>this.oneFingerTouchMoveStateManager.startMove(n)))}endMove(e){this._executeRelevantHandler(e,(n=>this.mouseMoveStateManager.endMove(n)),(n=>this.oneFingerTouchMoveStateManager.endMove(n)))}isValidStartEvent(e){return this._executeRelevantHandler(e,(n=>this.mouseMoveStateManager.isValidStartEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidStartEvent(n)))}isValidMoveEvent(e){return this._executeRelevantHandler(e,(n=>this.mouseMoveStateManager.isValidMoveEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(n)))}isValidEndEvent(e){return this._executeRelevantHandler(e,(n=>this.mouseMoveStateManager.isValidEndEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidEndEvent(n)))}}const is=h=>{h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}};class rs{constructor(e,n){this._clickTolerance=e.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,n,s){return this._calculateTransform(e,n,s)}touchmove(e,n,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,n,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,n,s){this._calculateTransform(e,n,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,s){s.length>0&&(this._active=!0);const l=en(s,n),d=new c.P(0,0),f=new c.P(0,0);let g=0;for(const b in l){const w=l[b],S=this._touches[b];S&&(d._add(w),f._add(w.sub(S)),g++,l[b]=w)}if(this._touches=l,this._shouldBePrevented(g)||!f.mag())return;const y=f.div(g);return this._sum._add(y),this._sum.mag()<this._clickTolerance?void 0:{around:d.div(g),panDelta:y}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Bn{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,n,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([n[0],n[1]]))}touchmove(e,n,s){if(!this._firstTwoTouches)return;e.preventDefault();const[l,d]=this._firstTwoTouches,f=ga(s,n,l),g=ga(s,n,d);if(!f||!g)return;const y=this._aroundCenter?null:f.add(g).div(2);return this._move([f,g],y,e)}touchend(e,n,s){if(!this._firstTwoTouches)return;const[l,d]=this._firstTwoTouches,f=ga(s,n,l),g=ga(s,n,d);f&&g||(this._active&&ue.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ga(h,e,n){for(let s=0;s<h.length;s++)if(h[s].identifier===n)return e[s]}function tt(h,e){return Math.log(h/e)/Math.LN2}class Ys extends Bn{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,n){const s=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(tt(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:tt(this._distance,s),pinchAround:n}}}function _c(h,e){return 180*h.angleWith(e)/Math.PI}class Ks extends Bn{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,n,s){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:_c(this._vector,l),pinchAround:n}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const n=25/(Math.PI*this._minDiameter)*360,s=_c(e,this._startVector);return Math.abs(s)<n}}function al(h){return Math.abs(h.y)>Math.abs(h.x)}class gc extends Bn{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,n,s){super.touchstart(e,n,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,al(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,n,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),d=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,d,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+d.y)/2*-.5}):void 0}gestureBeginsVertically(e,n,s){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,d=n.mag()>=2;if(!l&&!d)return;if(!l||!d)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const f=e.y>0==n.y>0;return al(e)&&al(n)&&f}}const yc={panStep:100,bearingStep:15,pitchStep:10};class Js{constructor(e){this._tr=new _a(e);const n=yc;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,s=0,l=0,d=0,f=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),d=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),d=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),f=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),f=1);break;default:return}return this._rotationDisabled&&(s=0,l=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:xc,zoom:n?Math.round(y.zoom)+n*(e.shiftKey?2:1):y.zoom,bearing:y.bearing+s*this._bearingStep,pitch:y.pitch+l*this._pitchStep,offset:[-d*this._panStep,-f*this._panStep],center:y.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function xc(h){return h*(2-h)}const vc=4.000244140625,bc=1/450;class wc{constructor(e,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new _a(e),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=bc}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const s=Ze.now(),l=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%vc==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=ue.mousePos(this._map.getCanvas(),e),s=this._tr;this._aroundPoint=this._aroundCenter?s.transform.locationToScreenPoint(c.S.convert(s.center)):n,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const g=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=g),typeof this._targetZoom=="number"&&(this._targetZoom+=g)}if(this._delta!==0){const g=this._type==="wheel"&&Math.abs(this._delta)>vc?this._wheelZoomRate:this._defaultZoomRate;let y=2/(1+Math.exp(-Math.abs(this._delta*g)));this._delta<0&&y!==0&&(y=1/y);const b=typeof this._targetZoom!="number"?e.scale:c.af(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),c.ak(b*y)).zoom,this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,s=this._startZoom,l=this._easing;let d,f=!1;if(this._type==="wheel"&&s&&l){const g=Ze.now()-this._lastWheelEventTime,y=Math.min((g+5)/200,1),b=l(y);d=c.C.number(s,n,b),y<1?this._frameId||(this._frameId=!0):f=!0}else d=n,f=!0;return this._active=!0,f&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=d,{noInertia:!0,needsRenderFrame:!f,zoomDelta:d-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=c.co;if(this._prevEase){const s=this._prevEase,l=(Ze.now()-s.start)/s.duration,d=s.easing(l+.01)-s.easing(l),f=.27/Math.sqrt(d*d+1e-4)*.01,g=Math.sqrt(.0729-f*f);n=c.cm(f,g,.25,1)}return this._prevEase={start:Ze.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Tc{constructor(e,n){this._clickZoom=e,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class tn{constructor(e){this._tr=new _a(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yt{constructor(){this._tap=new rl({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,n,s){if(!this._swipePoint)if(this._tapTime){const l=n[0],d=e.timeStamp-this._tapTime<500,f=this._tapPoint.dist(l)<30;d&&f?s.length>0&&(this._swipePoint=l,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,n,s)}touchmove(e,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const l=n[0],d=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:d/128}}}else this._tap.touchmove(e,n,s)}touchend(e,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const l=this._tap.touchend(e,n,s);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pc{constructor(e,n,s){this._el=e,this._mousePan=n,this._touchPan=s}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ns{constructor(e,n,s,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=n,this._mousePitch=s,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Qs{constructor(e,n,s,l){this._el=e,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class sl{constructor(e,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ue.create("div","maplibregl-cooperative-gesture-screen",e);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=n,this._container.appendChild(l);const d=document.createElement("div");d.className="maplibregl-mobile-message",d.textContent=s,this._container.appendChild(d),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ue.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new c.l("cooperativegestureprevented",{gestureType:e,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const as=h=>h.zoom||h.drag||h.roll||h.pitch||h.rotate;class Sc extends c.l{}function ol(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta||h.rollDelta}class Ir{constructor(e,n){this.handleWindowEvent=l=>{this.handleEvent(l,"".concat(l.type,"Window"))},this.handleEvent=(l,d)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const f=l.type==="renderFrame"?void 0:l,g={needsRenderFrame:!1},y={},b={};for(const{handlerName:P,handler:I,allowed:D}of this._handlers){if(!I.isEnabled())continue;let B;if(this._blockedByActive(b,D,P))I.reset();else if(I[d||l.type]){if(c.cp(l,d||l.type)){const O=ue.mousePos(this._map.getCanvas(),l);B=I[d||l.type](l,O)}else if(c.cq(l,d||l.type)){const O=this._getMapTouches(l.touches),j=ue.touchPos(this._map.getCanvas(),O);B=I[d||l.type](l,j,O)}else c.cr(d||l.type)||(B=I[d||l.type](l));this.mergeHandlerResult(g,y,B,P,f),B&&B.needsRenderFrame&&this._triggerRenderFrame()}(B||I.isActive())&&(b[P]=I)}const w={};for(const P in this._previousActiveHandlers)b[P]||(w[P]=f);this._previousActiveHandlers=b,(Object.keys(w).length||ol(g))&&(this._changes.push([g,y,w]),this._triggerRenderFrame()),(Object.keys(b).length||ol(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:S}=g;S&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],S(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new pc(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,d,f]of this._listeners)ue.addEventListener(l,d,l===document?this.handleWindowEvent:this.handleEvent,f)}destroy(){for(const[e,n,s]of this._listeners)ue.removeEventListener(e,n,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new ir(n,e));const l=n.boxZoom=new rr(n,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const d=n.cooperativeGestures=new sl(n,e.cooperativeGestures);this._add("cooperativeGestures",d),e.cooperativeGestures&&d.enable();const f=new fh(n),g=new tn(n);n.doubleClickZoom=new Tc(g,f),this._add("tapZoom",f),this._add("clickZoom",g),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();const y=new yt;this._add("tapDragZoom",y);const b=n.touchPitch=new gc(n);this._add("touchPitch",b),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);const w=()=>n.project(n.getCenter()),S=(function({enable:U,clickTolerance:W,aroundCenter:K=!0,minPixelCenterThreshold:Z=100,rotateDegreesPerPixelMoved:ee=.8},he){const se=new Ae({checkCorrectEvent:le=>ue.mouseButton(le)===0&&le.ctrlKey||ue.mouseButton(le)===2&&!le.ctrlKey});return new es({clickTolerance:W,move:(le,ce)=>{const we=he();if(K&&Math.abs(we.y-le.y)>Z)return{bearingDelta:c.cn(new c.P(le.x,ce.y),ce,we)};let Te=(ce.x-le.x)*ee;return K&&ce.y<we.y&&(Te=-Te),{bearingDelta:Te}},moveStateManager:se,enable:U,assignEvents:is})})(e,w),P=(function({enable:U,clickTolerance:W,pitchDegreesPerPixelMoved:K=-.5}){const Z=new Ae({checkCorrectEvent:ee=>ue.mouseButton(ee)===0&&ee.ctrlKey||ue.mouseButton(ee)===2});return new es({clickTolerance:W,move:(ee,he)=>({pitchDelta:(he.y-ee.y)*K}),moveStateManager:Z,enable:U,assignEvents:is})})(e),I=(function({enable:U,clickTolerance:W,rollDegreesPerPixelMoved:K=.3},Z){const ee=new Ae({checkCorrectEvent:he=>ue.mouseButton(he)===2&&he.ctrlKey});return new es({clickTolerance:W,move:(he,se)=>{const le=Z();let ce=(se.x-he.x)*K;return se.y<le.y&&(ce=-ce),{rollDelta:ce}},moveStateManager:ee,enable:U,assignEvents:is})})(e,w);n.dragRotate=new ns(e,S,P,I),this._add("mouseRotate",S,["mousePitch"]),this._add("mousePitch",P,["mouseRotate","mouseRoll"]),this._add("mouseRoll",I,["mousePitch"]),e.interactive&&e.dragRotate&&n.dragRotate.enable();const D=(function({enable:U,clickTolerance:W}){const K=new Ae({checkCorrectEvent:Z=>ue.mouseButton(Z)===0&&!Z.ctrlKey});return new es({clickTolerance:W,move:(Z,ee)=>({around:ee,panDelta:ee.sub(Z)}),activateOnStart:!0,moveStateManager:K,enable:U,assignEvents:is})})(e),B=new rs(e,n);n.dragPan=new Pc(s,D,B),this._add("mousePan",D),this._add("touchPan",B,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);const O=new Ks,j=new Ys;n.touchZoomRotate=new Qs(s,j,O,y),this._add("touchRotate",O,["touchPan","touchZoom"]),this._add("touchZoom",j,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate);const N=n.scrollZoom=new wc(n,(()=>this._triggerRenderFrame()));this._add("scrollZoom",N,["mousePan"]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);const $=n.keyboard=new Js(n);this._add("keyboard",$),e.interactive&&e.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new dr(n))}_add(e,n,s){this._handlers.push({handlerName:e,handler:n,allowed:s}),this._handlersById[e]=n}stop(e){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!as(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,n,s){for(const l in e)if(l!==s&&(!n||n.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const n=[];for(const s of e)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(e,n,s,l,d){if(!s)return;c.e(e,s);const f={handlerName:l,originalEvent:s.originalEvent||d};s.zoomDelta!==void 0&&(n.zoom=f),s.panDelta!==void 0&&(n.drag=f),s.rollDelta!==void 0&&(n.roll=f),s.pitchDelta!==void 0&&(n.pitch=f),s.bearingDelta!==void 0&&(n.rotate=f)}_applyChanges(){const e={},n={},s={};for(const[l,d,f]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),c.e(n,d),c.e(s,f);this._updateMapTransform(e,n,s),this._changes=[]}_updateMapTransform(e,n,s){const l=this._map,d=l._getTransformForUpdate(),f=l.terrain;if(!(ol(e)||f&&this._terrainMovement))return this._fireEvents(n,s,!0);l._stop(!0);let{panDelta:g,zoomDelta:y,bearingDelta:b,pitchDelta:w,rollDelta:S,around:P,pinchAround:I}=e;I!==void 0&&(P=I),P=P||l.transform.centerPoint,f&&!d.isPointOnMapSurface(P)&&(P=d.centerPoint);const D={panDelta:g,zoomDelta:y,rollDelta:S,pitchDelta:w,bearingDelta:b,around:P};this._map.cameraHelper.useGlobeControls&&!d.isPointOnMapSurface(P)&&(P=d.centerPoint);const B=P.distSqr(d.centerPoint)<.01?d.center:d.screenPointToLocation(g?P.sub(g):P);this._handleMapControls({terrain:f,tr:d,deltasForHelper:D,preZoomAroundLoc:B,combinedEventsInProgress:n,panDelta:g}),l._applyUpdatedTransform(d),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(n,s,!0)}_handleMapControls({terrain:e,tr:n,deltasForHelper:s,preZoomAroundLoc:l,combinedEventsInProgress:d,panDelta:f}){const g=this._map.cameraHelper;if(g.handleMapControlsRollPitchBearingZoom(s,n),e)return g.useGlobeControls?(this._terrainMovement||!d.drag&&!d.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void g.handleMapControlsPan(s,n,l)):this._terrainMovement||!d.drag&&!d.zoom?void(d.drag&&this._terrainMovement&&f?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(f))):g.handleMapControlsPan(s,n,l)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void g.handleMapControlsPan(s,n,l));g.handleMapControlsPan(s,n,l)}_fireEvents(e,n,s){const l=as(this._eventsInProgress),d=as(e),f={};for(const S in e){const{originalEvent:P}=e[S];this._eventsInProgress[S]||(f["".concat(S,"start")]=P),this._eventsInProgress[S]=e[S]}!l&&d&&this._fireEvent("movestart",d.originalEvent);for(const S in f)this._fireEvent(S,f[S]);d&&this._fireEvent("move",d.originalEvent);for(const S in e){const{originalEvent:P}=e[S];this._fireEvent(S,P)}const g={};let y;for(const S in this._eventsInProgress){const{handlerName:P,originalEvent:I}=this._eventsInProgress[S];this._handlersById[P].isActive()||(delete this._eventsInProgress[S],y=n[P]||I,g["".concat(S,"end")]=y)}for(const S in g)this._fireEvent(S,g[S]);const b=as(this._eventsInProgress),w=(l||d)&&!b;if(w&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const S=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&S.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(S)}if(s&&w){this._updatingCamera=!0;const S=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),P=I=>I!==0&&-this._bearingSnap<I&&I<this._bearingSnap;!S||!S.essential&&Ze.prefersReducedMotion?(this._map.fire(new c.l("moveend",{originalEvent:y})),P(this._map.getBearing())&&this._map.resetNorth()):(P(S.bearing||this._map.getBearing())&&(S.bearing=0),S.freezeElevation=!0,this._map.easeTo(S,{originalEvent:y})),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new c.l(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Sc("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class eo extends c.E{constructor(e,n,s){super(),this._renderFrameCallback=()=>{const l=Math.min((Ze.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=s.bearingSnap,this.cameraHelper=n,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(e,n){e.apply(this.transform),this.transform=e,this.cameraHelper=n}getCenter(){return new c.S(this.transform.center.lng,this.transform.center.lat)}setCenter(e,n){return this.jumpTo({center:e},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,n){return this.jumpTo({elevation:e},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,n,s){return e=c.P.convert(e).mult(-1),this.panTo(this.transform.center,c.e({offset:e},n),s)}panTo(e,n,s){return this.easeTo(c.e({center:e},n),s)}getZoom(){return this.transform.zoom}setZoom(e,n){return this.jumpTo({zoom:e},n),this}zoomTo(e,n,s){return this.easeTo(c.e({zoom:e},n),s)}zoomIn(e,n){return this.zoomTo(this.getZoom()+1,e,n),this}zoomOut(e,n){return this.zoomTo(this.getZoom()-1,e,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,n){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new c.l("movestart",n)).fire(new c.l("move",n)).fire(new c.l("moveend",n))),this}getBearing(){return this.transform.bearing}setBearing(e,n){return this.jumpTo({bearing:e},n),this}getPadding(){return this.transform.padding}setPadding(e,n){return this.jumpTo({padding:e},n),this}rotateTo(e,n,s){return this.easeTo(c.e({bearing:e},n),s)}resetNorth(e,n){return this.rotateTo(0,c.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(c.e({bearing:0,pitch:0,roll:0,duration:1e3},e),n),this}snapToNorth(e,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,n):this}getPitch(){return this.transform.pitch}setPitch(e,n){return this.jumpTo({pitch:e},n),this}getRoll(){return this.transform.roll}setRoll(e,n){return this.jumpTo({roll:e},n),this}cameraForBounds(e,n){e=Dt.convert(e).adjustAntiMeridian();const s=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),s,n)}_cameraForBoxAndBearing(e,n,s,l){const d={top:0,bottom:0,right:0,left:0};if(typeof(l=c.e({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const b=l.padding;l.padding={top:b,bottom:b,right:b,left:b}}const f=c.e(d,l.padding);l.padding=f;const g=this.transform,y=new Dt(e,n);return this.cameraHelper.cameraForBoxAndBearing(l,f,y,s,g)}fitBounds(e,n,s){return this._fitInternal(this.cameraForBounds(e,n),n,s)}fitScreenCoordinates(e,n,s,l,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(c.P.convert(e)),this.transform.screenPointToLocation(c.P.convert(n)),s,l),l,d)}_fitInternal(e,n,s){return e?(delete(n=c.e(e,n)).padding,n.linear?this.easeTo(n,s):this.flyTo(n,s)):this}jumpTo(e,n){this.stop();const s=this._getTransformForUpdate();let l=!1,d=!1,f=!1;const g=s.zoom;this.cameraHelper.handleJumpToCenterZoom(s,e);const y=s.zoom!==g;return"elevation"in e&&s.elevation!==+e.elevation&&s.setElevation(+e.elevation),"bearing"in e&&s.bearing!==+e.bearing&&(l=!0,s.setBearing(+e.bearing)),"pitch"in e&&s.pitch!==+e.pitch&&(d=!0,s.setPitch(+e.pitch)),"roll"in e&&s.roll!==+e.roll&&(f=!0,s.setRoll(+e.roll)),e.padding==null||s.isPaddingEqual(e.padding)||s.setPadding(e.padding),this._applyUpdatedTransform(s),this.fire(new c.l("movestart",n)).fire(new c.l("move",n)),y&&this.fire(new c.l("zoomstart",n)).fire(new c.l("zoom",n)).fire(new c.l("zoomend",n)),l&&this.fire(new c.l("rotatestart",n)).fire(new c.l("rotate",n)).fire(new c.l("rotateend",n)),d&&this.fire(new c.l("pitchstart",n)).fire(new c.l("pitch",n)).fire(new c.l("pitchend",n)),f&&this.fire(new c.l("rollstart",n)).fire(new c.l("roll",n)).fire(new c.l("rollend",n)),this.fire(new c.l("moveend",n))}calculateCameraOptionsFromTo(e,n,s,l=0){const d=c.a1.fromLngLat(e,n),f=c.a1.fromLngLat(s,l),g=f.x-d.x,y=f.y-d.y,b=f.z-d.z,w=Math.hypot(g,y,b);if(w===0)throw new Error("Can't calculate camera options with same From and To");const S=Math.hypot(g,y),P=c.ak(this.transform.cameraToCenterDistance/w/this.transform.tileSize),I=180*Math.atan2(g,-y)/Math.PI;let D=180*Math.acos(S/w)/Math.PI;return D=b<0?90-D:90+D,{center:f.toLngLat(),elevation:l,zoom:P,pitch:D,bearing:I}}calculateCameraOptionsFromCameraLngLatAltRotation(e,n,s,l,d){const f=this.transform.calculateCenterFromCameraLngLatAlt(e,n,s,l);return{center:f.center,elevation:f.elevation,zoom:f.zoom,bearing:s,pitch:l,roll:d}}easeTo(e,n){this._stop(!1,e.easeId),((e=c.e({offset:[0,0],duration:500,easing:c.co},e)).animate===!1||!e.essential&&Ze.prefersReducedMotion)&&(e.duration=0);const s=this._getTransformForUpdate(),l=this.getBearing(),d=s.pitch,f=s.roll,g="bearing"in e?this._normalizeBearing(e.bearing,l):l,y="pitch"in e?+e.pitch:d,b="roll"in e?this._normalizeBearing(e.roll,f):f,w="padding"in e?e.padding:s.padding,S=c.P.convert(e.offset);let P,I;e.around&&(P=c.S.convert(e.around),I=s.locationToScreenPoint(P));const D={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},B=this.cameraHelper.handleEaseTo(s,{bearing:g,pitch:y,roll:b,padding:w,around:P,aroundPoint:I,offsetAsPoint:S,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==g,this._pitching=this._pitching||y!==d,this._rolling=this._rolling||b!==f,this._padding=!s.isPaddingEqual(w),this._zooming=this._zooming||B.isZooming,this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,D),this.terrain&&this._prepareElevation(B.elevationCenter),this._ease((O=>{B.easeFunc(O),this.terrain&&!e.freezeElevation&&this._updateElevation(O),this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(O=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,O)}),e),this}_prepareEase(e,n,s={}){this._moving=!0,n||s.moving||this.fire(new c.l("movestart",e)),this._zooming&&!s.zooming&&this.fire(new c.l("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new c.l("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new c.l("pitchstart",e)),this._rolling&&!s.rolling&&this.fire(new c.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(n-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.setElevation(c.C.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const n=e.getCameraLngLat(),s=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(n,e.zoom):0;if(s<l){const d=this.calculateCameraOptionsFromTo(n,l,e.center,e.elevation);return{pitch:d.pitch,zoom:d.zoom}}return{}}_applyUpdatedTransform(e){const n=[];if(n.push((l=>this._elevateCameraIfInsideTerrain(l))),this.transformCameraUpdate&&n.push((l=>this.transformCameraUpdate(l))),!n.length)return;const s=e.clone();for(const l of n){const d=s.clone(),{center:f,zoom:g,roll:y,pitch:b,bearing:w,elevation:S}=l(d);f&&d.setCenter(f),S!==void 0&&d.setElevation(S),g!==void 0&&d.setZoom(g),y!==void 0&&d.setRoll(y),b!==void 0&&d.setPitch(b),w!==void 0&&d.setBearing(w),s.apply(d)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new c.l("move",e)),this._zooming&&this.fire(new c.l("zoom",e)),this._rotating&&this.fire(new c.l("rotate",e)),this._pitching&&this.fire(new c.l("pitch",e)),this._rolling&&this.fire(new c.l("roll",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,l=this._rotating,d=this._pitching,f=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,s&&this.fire(new c.l("zoomend",e)),l&&this.fire(new c.l("rotateend",e)),d&&this.fire(new c.l("pitchend",e)),f&&this.fire(new c.l("rollend",e)),this.fire(new c.l("moveend",e))}flyTo(e,n){if(!e.essential&&Ze.prefersReducedMotion){const ce=c.Q(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(ce,n)}this.stop(),e=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.co},e);const s=this._getTransformForUpdate(),l=s.bearing,d=s.pitch,f=s.roll,g=s.padding,y="bearing"in e?this._normalizeBearing(e.bearing,l):l,b="pitch"in e?+e.pitch:d,w="roll"in e?this._normalizeBearing(e.roll,f):f,S="padding"in e?e.padding:s.padding,P=c.P.convert(e.offset);let I=s.centerPoint.add(P);const D=s.screenPointToLocation(I),B=this.cameraHelper.handleFlyTo(s,{bearing:y,pitch:b,roll:w,padding:S,locationAtOffset:D,offsetAsPoint:P,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let O=e.curve;const j=Math.max(s.width,s.height),N=j/B.scaleOfZoom,$=B.pixelPathLength;typeof B.scaleOfMinZoom=="number"&&(O=Math.sqrt(j/B.scaleOfMinZoom/$*2));const U=O*O;function W(ce){const we=(N*N-j*j+(ce?-1:1)*U*U*$*$)/(2*(ce?N:j)*U*$);return Math.log(Math.sqrt(we*we+1)-we)}function K(ce){return(Math.exp(ce)-Math.exp(-ce))/2}function Z(ce){return(Math.exp(ce)+Math.exp(-ce))/2}const ee=W(!1);let he=function(ce){return Z(ee)/Z(ee+O*ce)},se=function(ce){return j*((Z(ee)*(K(we=ee+O*ce)/Z(we))-K(ee))/U)/$;var we},le=(W(!0)-ee)/O;if(Math.abs($)<2e-6||!isFinite(le)){if(Math.abs(j-N)<1e-6)return this.easeTo(e,n);const ce=N<j?-1:1;le=Math.abs(Math.log(N/j))/O,se=()=>0,he=we=>Math.exp(ce*O*we)}return e.duration="duration"in e?+e.duration:1e3*le/("screenSpeed"in e?+e.screenSpeed/O:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==y,this._pitching=b!==d,this._rolling=w!==f,this._padding=!s.isPaddingEqual(S),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(B.targetCenter),this._ease((ce=>{const we=ce*le,Te=1/he(we),ge=se(we);this._rotating&&s.setBearing(c.C.number(l,y,ce)),this._pitching&&s.setPitch(c.C.number(d,b,ce)),this._rolling&&s.setRoll(c.C.number(f,w,ce)),this._padding&&(s.interpolatePadding(g,S,ce),I=s.centerPoint.add(P)),B.easeFunc(ce,Te,ge,I),this.terrain&&!e.freezeElevation&&this._updateElevation(ce),this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,n){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,n)}return e||(s=this.handlers)===null||s===void 0||s.stop(!1),this}_ease(e,n,s){s.animate===!1||s.duration===0?(e(1),n()):(this._easeStart=Ze.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=c.aO(e,-180,180);const s=Math.abs(e-n);return Math.abs(e-360-n)<s&&(e-=360),Math.abs(e+360-n)<s&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(c.S.convert(e),this.transform.tileZoom):null}}const Le={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Ue{constructor(e=Le){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ue.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ue.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ue.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(){ue.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,n){const s=this._map._getUIString("AttributionControl.".concat(n));e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((l=>typeof l!="string"?"":l))):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const n=this._map.style.sourceCaches;for(const l in n){const d=n[l];if(d.used||d.usedForTerrain){const f=d.getSource();f.attribution&&e.indexOf(f.attribution)<0&&e.push(f.attribution)}}e=e.filter((l=>String(l).trim())),e.sort(((l,d)=>l.length-d.length)),e=e.filter(((l,d)=>{for(let f=d+1;f<e.length;f++)if(e[f].indexOf(l)>=0)return!1;return!0}));const s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=ue.sanitize(s),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ya{constructor(e={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=ue.create("div","maplibregl-ctrl");const n=ue.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(){ue.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Mc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const n=++this._id;return this._queue.push({callback:e,id:n,cancelled:!1}),n}remove(e){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const l of s)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var to=c.aJ([{name:"a_pos3d",type:"Int16",components:3}]);class Ti extends c.E{constructor(e){super(),this._lastTilesetChange=Ze.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];const s={};for(const l of st(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))s[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),c.bZ(l.terrainRttPosMatrix32f,0,c.$,c.$,0,0,1),this._tiles[l.key]=new A(l,this.tileSize),this._lastTilesetChange=Ze.now());for(const l in this._tiles)s[l]||delete this._tiles[l]}freeRtt(e){for(const n in this._tiles){const s=this._tiles[n];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,n){return n?this._getTerrainCoordsForTileRanges(e,n):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const n={};for(const s of this._renderableTilesKeys){const l=this._tiles[s].tileID,d=e.clone(),f=c.ba();if(l.canonical.equals(e.canonical))c.bZ(f,0,c.$,c.$,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const g=l.canonical.z-e.canonical.z,y=l.canonical.x-(l.canonical.x>>g<<g),b=l.canonical.y-(l.canonical.y>>g<<g),w=c.$>>g;c.bZ(f,0,w,w,0,0,1),c.M(f,f,[-y*w,-b*w,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const g=e.canonical.z-l.canonical.z,y=e.canonical.x-(e.canonical.x>>g<<g),b=e.canonical.y-(e.canonical.y>>g<<g),w=c.$>>g;c.bZ(f,0,c.$,c.$,0,0,1),c.M(f,f,[y*w,b*w,0]),c.N(f,f,[1/2**g,1/2**g,0])}}d.terrainRttPosMatrix32f=new Float32Array(f),n[s]=d}return n}_getTerrainCoordsForTileRanges(e,n){const s={};for(const l of this._renderableTilesKeys){const d=this._tiles[l].tileID;if(!this._isWithinTileRanges(d,n))continue;const f=e.clone(),g=c.ba();if(d.canonical.z===e.canonical.z){const y=e.canonical.x-d.canonical.x,b=e.canonical.y-d.canonical.y;c.bZ(g,0,c.$,c.$,0,0,1),c.M(g,g,[y*c.$,b*c.$,0])}else if(d.canonical.z>e.canonical.z){const y=d.canonical.z-e.canonical.z,b=d.canonical.x-(d.canonical.x>>y<<y),w=d.canonical.y-(d.canonical.y>>y<<y),S=e.canonical.x-(d.canonical.x>>y),P=e.canonical.y-(d.canonical.y>>y),I=c.$>>y;c.bZ(g,0,I,I,0,0,1),c.M(g,g,[-b*I+S*c.$,-w*I+P*c.$,0])}else{const y=e.canonical.z-d.canonical.z,b=e.canonical.x-(e.canonical.x>>y<<y),w=e.canonical.y-(e.canonical.y>>y<<y),S=(e.canonical.x>>y)-d.canonical.x,P=(e.canonical.y>>y)-d.canonical.y,I=c.$<<y;c.bZ(g,0,I,I,0,0,1),c.M(g,g,[b*c.$+S*I,w*c.$+P*I,0])}f.terrainRttPosMatrix32f=new Float32Array(g),s[l]=f}return s}getSourceTile(e,n){const s=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>s.maxzoom&&(l=s.maxzoom),l<s.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let d=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!d||!d.dem)&&n)for(;l>=s.minzoom&&(!d||!d.dem);)d=this.sourceCache.getTileByID(e.scaledTo(l--).key);return d}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,n){return n[e.canonical.z]&&e.canonical.x>=n[e.canonical.z].minTileX&&e.canonical.x<=n[e.canonical.z].maxTileX&&e.canonical.y>=n[e.canonical.z].minTileY&&e.canonical.y<=n[e.canonical.z].maxTileY}}class Cc{constructor(e,n,s){this._meshCache={},this.painter=e,this.sourceCache=new Ti(n),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,s,l=c.$){var d;if(!(n>=0&&n<l&&s>=0&&s<l))return 0;const f=this.getTerrainData(e),g=(d=f.tile)===null||d===void 0?void 0:d.dem;if(!g)return 0;const y=c.cs([],[n/l*c.$,s/l*c.$],f.u_terrain_matrix),b=[y[0]*g.dim,y[1]*g.dim],w=Math.floor(b[0]),S=Math.floor(b[1]),P=b[0]-w,I=b[1]-S;return g.get(w,S)*(1-P)*(1-I)+g.get(w+1,S)*P*(1-I)+g.get(w,S+1)*(1-P)*I+g.get(w+1,S+1)*P*I}getElevationForLngLatZoom(e,n){if(!c.ct(n,e.wrap()))return 0;const{tileID:s,mercatorX:l,mercatorY:d}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(s,l%c.$,d%c.$,c.$)}getElevation(e,n,s,l=c.$){return this.getDEMElevation(e,n,s,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,d=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new c.T(l,d,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new c.T(l,new c.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.ag([])}const n=this.sourceCache.getSourceTile(e,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){const l=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new c.T(l,n.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),n.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}const s=n&&n+n.tileID.key+e.key;if(s&&!this._demMatrixCache[s]){const l=this.sourceCache.sourceCache._source.maxzoom;let d=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?d=e.canonical.z-l:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const f=e.canonical.x-(e.canonical.x>>d<<d),g=e.canonical.y-(e.canonical.y>>d<<d),y=c.cu(new Float64Array(16),[1/(c.$<<d),1/(c.$<<d),0]);c.M(y,y,[f*c.$,g*c.$,0]),this._demMatrixCache[e.key]={matrix:y,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){const n=this.painter,s=n.width/devicePixelRatio,l=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new c.T(n.context,{width:s,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new c.T(n.context,{width:s,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(s,l,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,s,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let d=0,f=0;d<this._coordsTextureSize;d++)for(let g=0;g<this._coordsTextureSize;g++,f+=4)n[f+0]=255&g,n[f+1]=255&d,n[f+2]=g>>8<<4|d>>8,n[f+3]=0;const s=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new c.T(e,s,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),s=this.painter.context,l=s.gl,d=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),f=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),g=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(d,g-f-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const y=n[0]+(n[2]>>4<<8),b=n[1]+((15&n[2])<<8),w=this.coordsIndex[255-n[3]],S=w&&this.sourceCache.getTileByID(w);if(!S)return null;const P=this._coordsTextureSize,I=(1<<S.tileID.canonical.z)*P;return new c.a1((S.tileID.canonical.x*P+y)/I+S.tileID.wrap,(S.tileID.canonical.y*P+b)/I,this.getElevation(S.tileID,y,b,P))}depthAtPoint(e){const n=new Uint8Array(4),s=this.painter.context,l=s.gl;return s.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null),(n[0]/16777216+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(e){var n;const s=((n=this.painter.style.projection)===null||n===void 0?void 0:n.transitionState)>0,l=s&&e.canonical.y===0,d=s&&e.canonical.y===(1<<e.canonical.z)-1,f="m_".concat(l?"n":"","_").concat(d?"s":"");if(this._meshCache[f])return this._meshCache[f];const g=this.painter.context,y=new c.cv,b=new c.aN,w=this.meshSize,S=c.$/w,P=w*w;for(let Z=0;Z<=w;Z++)for(let ee=0;ee<=w;ee++)y.emplaceBack(ee*S,Z*S,0);for(let Z=0;Z<P;Z+=w+1)for(let ee=0;ee<w;ee++)b.emplaceBack(ee+Z,w+ee+Z+1,w+ee+Z+2),b.emplaceBack(ee+Z,w+ee+Z+2,ee+Z+1);const I=y.length,D=I+(w+1),B=(w+1)*w,O=l?c.bh:0,j=l?0:1,N=d?c.bi:c.$,$=d?0:1;for(let Z=0;Z<=w;Z++)y.emplaceBack(Z*S,O,j);for(let Z=0;Z<=w;Z++)y.emplaceBack(Z*S,N,$);for(let Z=0;Z<w;Z++)b.emplaceBack(B+Z,D+Z,D+Z+1),b.emplaceBack(B+Z,D+Z+1,B+Z+1),b.emplaceBack(0+Z,I+Z+1,I+Z),b.emplaceBack(0+Z,0+Z+1,I+Z+1);const U=y.length,W=U+2*(w+1);for(const Z of[0,1])for(let ee=0;ee<=w;ee++)for(const he of[0,1])y.emplaceBack(Z*c.$,ee*S,he);for(let Z=0;Z<2*w;Z+=2)b.emplaceBack(U+Z,U+Z+1,U+Z+3),b.emplaceBack(U+Z,U+Z+3,U+Z+2),b.emplaceBack(W+Z,W+Z+3,W+Z+1),b.emplaceBack(W+Z,W+Z+2,W+Z+3);const K=new Qn(g.createVertexBuffer(y,to.members),g.createIndexBuffer(b),c.aM.simpleSegment(0,0,y.length,b.length));return this._meshCache[f]=K,K}getMeshFrameDelta(e){return 2*Math.PI*c.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,n){var s;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,n);return(s=this.getMinMaxElevation(l).minElevation)!==null&&s!==void 0?s:0}getMinMaxElevation(e){const n=this.getTerrainData(e).tile,s={minElevation:null,maxElevation:null};return n&&n.dem&&(s.minElevation=n.dem.min*this.exaggeration,s.maxElevation=n.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(e,n){const s=c.a1.fromLngLat(e.wrap()),l=(1<<n)*c.$,d=s.x*l,f=s.y*l,g=Math.floor(d/c.$),y=Math.floor(f/c.$);return{tileID:new c.Z(n,0,n,g,y),mercatorX:d,mercatorY:f}}}class pr{constructor(e,n,s){this._context=e,this._size=n,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new c.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(s.texture),{id:e,fbo:n,texture:s,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((n=>e.id!==n)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((e=>!e.inUse))===!1}}const On={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class mh{constructor(e,n){this.painter=e,this.terrain=n,this.pool=new pr(e.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((s=>!e._layers[s].isHidden(n))),this._coordsAscending={};for(const s in e.sourceCaches){this._coordsAscending[s]={};const l=e.sourceCaches[s].getVisibleCoordinates(),d=e.sourceCaches[s].getSource(),f=d instanceof Fi?d.terrainTileRanges:null;for(const g of l){const y=this.terrain.sourceCache.getTerrainCoords(g,f);for(const b in y)this._coordsAscending[s][b]||(this._coordsAscending[s][b]=[]),this._coordsAscending[s][b].push(y[b])}}this._coordsAscendingStr={};for(const s of e._order){const l=e._layers[s],d=l.source;if(On[l.type]&&!this._coordsAscendingStr[d]){this._coordsAscendingStr[d]={};for(const f in this._coordsAscending[d])this._coordsAscendingStr[d][f]=this._coordsAscending[d][f].map((g=>g.key)).sort().join()}}for(const s of this._renderableTiles)for(const l in this._coordsAscendingStr){const d=this._coordsAscendingStr[l][s.tileID.key];d&&d!==s.rttCoords[l]&&(s.rtt=[])}}renderLayer(e,n){if(e.isHidden(this.painter.transform.zoom))return!1;const s=Object.assign(Object.assign({},n),{isRenderingToTexture:!0}),l=e.type,d=this.painter,f=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(On[l]&&(this._prevType&&On[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!f))return!0;if(On[this._prevType]||On[l]&&f){this._prevType=l;const g=this._stacks.length-1,y=this._stacks[g]||[];for(const b of this._renderableTiles){if(this.pool.isFull()&&(Xs(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(b),b.rtt[g]){const S=this.pool.getObjectForId(b.rtt[g].id);if(S.stamp===b.rtt[g].stamp){this.pool.useObject(S);continue}}const w=this.pool.getOrCreateFreeObject();this.pool.useObject(w),this.pool.stampObject(w),b.rtt[g]={id:w.id,stamp:w.stamp},d.context.bindFramebuffer.set(w.fbo.framebuffer),d.context.clear({color:c.bf.transparent,stencil:0}),d.currentStencilSource=void 0;for(let S=0;S<y.length;S++){const P=d.style._layers[y[S]],I=P.source?this._coordsAscending[P.source][b.tileID.key]:[b.tileID];d.context.viewport.set([0,0,w.fbo.width,w.fbo.height]),d._renderTileClippingMasks(P,I,!0),d.renderLayer(d,d.style.sourceCaches[P.source],P,I,s),P.source&&(b.rttCoords[P.source]=this._coordsAscendingStr[P.source][b.tileID.key])}}return Xs(this.painter,this.terrain,this._rttTiles,s),this._rttTiles=[],this.pool.freeAllObjects(),On[l]}return!1}}const _h={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use â + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},gh=Ee,xa={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Le,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},Mt={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Lt{constructor(e,n,s=!1){this.mousedown=d=>{this.startMove(d,ue.mousePos(this.element,d)),ue.addEventListener(window,"mousemove",this.mousemove),ue.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=d=>{this.move(d,ue.mousePos(this.element,d))},this.mouseup=d=>{this._rotatePitchHandler.dragEnd(d),this.offTemp()},this.touchstart=d=>{d.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ue.touchPos(this.element,d.targetTouches)[0],this.startMove(d,this._startPos),ue.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ue.addEventListener(window,"touchend",this.touchend))},this.touchmove=d=>{d.targetTouches.length!==1?this.reset():(this._lastPos=ue.touchPos(this.element,d.targetTouches)[0],this.move(d,this._lastPos))},this.touchend=d=>{d.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;const l=new nl;this._rotatePitchHandler=new es({clickTolerance:3,move:(d,f)=>{const g=n.getBoundingClientRect(),y=new c.P((g.bottom-g.top)/2,(g.right-g.left)/2);return{bearingDelta:c.cn(new c.P(d.x,f.y),f,y),pitchDelta:s?-.5*(f.y-d.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,ue.addEventListener(n,"mousedown",this.mousedown),ue.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),ue.addEventListener(n,"touchcancel",this.reset)}startMove(e,n){this._rotatePitchHandler.dragStart(e,n),ue.disableDrag()}move(e,n){const s=this.map,{bearingDelta:l,pitchDelta:d}=this._rotatePitchHandler.dragMove(e,n)||{};l&&s.setBearing(s.getBearing()+l),d&&s.setPitch(s.getPitch()+d)}off(){const e=this.element;ue.removeEventListener(e,"mousedown",this.mousedown),ue.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),ue.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ue.removeEventListener(window,"touchend",this.touchend),ue.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){ue.enableDrag(),ue.removeEventListener(window,"mousemove",this.mousemove),ue.removeEventListener(window,"mouseup",this.mouseup),ue.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ue.removeEventListener(window,"touchend",this.touchend)}}let rn;function va(h,e,n,s=!1){if(s||!n.getCoveringTilesDetailsProvider().allowWorldCopies())return h==null?void 0:h.wrap();const l=new c.S(h.lng,h.lat);if(h=new c.S(h.lng,h.lat),e){const d=new c.S(h.lng-360,h.lat),f=new c.S(h.lng+360,h.lat),g=n.locationToScreenPoint(h).distSqr(e);n.locationToScreenPoint(d).distSqr(e)<g?h=d:n.locationToScreenPoint(f).distSqr(e)<g&&(h=f)}for(;Math.abs(h.lng-n.center.lng)>180;){const d=n.locationToScreenPoint(h);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;h.lng>n.center.lng?h.lng-=360:h.lng+=360}
5return h.lng!==l.lng&&n.isPointOnMapSurface(n.locationToScreenPoint(h))?h:l}const ba={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 io(h,e,n){const s=h.classList;for(const l in ba)s.remove("maplibregl-".concat(n,"-anchor-").concat(l));s.add("maplibregl-".concat(n,"-anchor-").concat(e))}class ss extends c.E{constructor(e){if(super(),this._onKeyPress=n=>{const s=n.code,l=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,l=this._element;this._popup&&(s===l||l.contains(s))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const s=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!s)&&this._map.once("render",this._update),this._lngLat=va(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l="rotateZ(".concat(this._rotation,"deg)"):this._rotationAlignment==="map"&&(l="rotateZ(".concat(this._rotation-this._map.getBearing(),"deg)"));let d="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?d="rotateX(0deg)":this._pitchAlignment==="map"&&(d="rotateX(".concat(this._map.getPitch(),"deg)")),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),ue.setTransform(this._element,"".concat(ba[this._anchor]," translate(").concat(this._pos.x,"px, ").concat(this._pos.y,"px) ").concat(d," ").concat(l)),Ze.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 c.l("dragstart"))),this.fire(new c.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.l("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=c.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=ue.create("div");const n=ue.createNS("http://www.w3.org/2000/svg","svg"),s=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","".concat(s,"px")),n.setAttributeNS(null,"width","".concat(l,"px")),n.setAttributeNS(null,"viewBox","0 0 ".concat(l," ").concat(s));const d=ue.createNS("http://www.w3.org/2000/svg","g");
vendor: 14,587 bytes, line 5
5d.setAttributeNS(null,"stroke","none"),d.setAttributeNS(null,"stroke-width","1"),d.setAttributeNS(null,"fill","none"),d.setAttributeNS(null,"fill-rule","evenodd");const f=ue.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill-rule","nonzero");const g=ue.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const j of y){const N=ue.createNS("http://www.w3.org/2000/svg","ellipse");N.setAttributeNS(null,"opacity","0.04"),N.setAttributeNS(null,"cx","10.5"),N.setAttributeNS(null,"cy","5.80029008"),N.setAttributeNS(null,"rx",j.rx),N.setAttributeNS(null,"ry",j.ry),g.appendChild(N)}const b=ue.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill",this._color);const w=ue.createNS("http://www.w3.org/2000/svg","path");w.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"),b.appendChild(w);const S=ue.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");const P=ue.createNS("http://www.w3.org/2000/svg","path");P.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(P);const I=ue.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(6.0, 7.0)"),I.setAttributeNS(null,"fill","#FFFFFF");const D=ue.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(8.0, 8.0)");const B=ue.createNS("http://www.w3.org/2000/svg","circle");B.setAttributeNS(null,"fill","#000000"),B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"cx","5.5"),B.setAttributeNS(null,"cy","5.5"),B.setAttributeNS(null,"r","5.4999962");const O=ue.createNS("http://www.w3.org/2000/svg","circle");O.setAttributeNS(null,"fill","#FFFFFF"),O.setAttributeNS(null,"cx","5.5"),O.setAttributeNS(null,"cy","5.5"),O.setAttributeNS(null,"r","5.4999962"),D.appendChild(B),D.appendChild(O),f.appendChild(g),f.appendChild(b),f.appendChild(S),f.appendChild(I),f.appendChild(D),n.appendChild(f),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(n=>{n.preventDefault()})),this._element.addEventListener("mousedown",(n=>{n.preventDefault()})),io(this._element,this._anchor,"marker"),e&&e.className)for(const n of e.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),ue.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=c.S.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var n,s;const l=(n=this._map)===null||n===void 0?void 0:n.terrain,d=this._map.transform.isLocationOccluded(this._lngLat);if(!l||d){const I=d?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==I&&(this._element.style.opacity=I))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const f=this._map,g=f.terrain.depthAtPoint(this._pos),y=f.terrain.getElevationForLngLatZoom(this._lngLat,f.transform.tileZoom);if(f.transform.lngLatToCameraDepth(this._lngLat,y)-g<.006)return void(this._element.style.opacity=this._opacity);const b=-this._offset.y/f.transform.pixelsPerMeter,w=Math.sin(f.getPitch()*Math.PI/180)*b,S=f.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),P=f.transform.lngLatToCameraDepth(this._lngLat,y+w)-S>.006;!((s=this._popup)===null||s===void 0)&&s.isOpen()&&P&&this._popup.remove(),this._element.style.opacity=P?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=c.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,n){return(this._opacity===void 0||e===void 0&&n===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const ll={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let nn=0,jn=!1;const cl={maxWidth:100,unit:"metric"};function ro(h,e,n){const s=n&&n.maxWidth||100,l=h._container.clientHeight/2,d=h._container.clientWidth/2,f=h.unproject([d-s/2,l]),g=h.unproject([d+s/2,l]),y=Math.round(h.project(g).x-h.project(f).x),b=Math.min(s,y,h._container.clientWidth),w=f.distanceTo(g);if(n&&n.unit==="imperial"){const S=3.2808*w;S>5280?Vn(e,b,S/5280,h._getUIString("ScaleControl.Miles")):Vn(e,b,S,h._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Vn(e,b,w/1852,h._getUIString("ScaleControl.NauticalMiles")):w>=1e3?Vn(e,b,w/1e3,h._getUIString("ScaleControl.Kilometers")):Vn(e,b,w,h._getUIString("ScaleControl.Meters"))}function Vn(h,e,n,s){const l=(function(d){const f=Math.pow(10,"".concat(Math.floor(d)).length-1);let g=d/f;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:(function(y){const b=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*b)/b})(g),f*g})(n);h.style.width=e*(l/n)+"px",h.innerHTML="".concat(l," ").concat(s)}const hl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},ul=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function no(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,h),"top-left":new c.P(e,e),"top-right":new c.P(-e,e),bottom:new c.P(0,-h),"bottom-left":new c.P(e,-e),"bottom-right":new c.P(-e,-e),left:new c.P(h,0),right:new c.P(-h,0)}}if(h instanceof c.P||Array.isArray(h)){const e=c.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:c.P.convert(h.center||[0,0]),top:c.P.convert(h.top||[0,0]),"top-left":c.P.convert(h["top-left"]||[0,0]),"top-right":c.P.convert(h["top-right"]||[0,0]),bottom:c.P.convert(h.bottom||[0,0]),"bottom-left":c.P.convert(h["bottom-left"]||[0,0]),"bottom-right":c.P.convert(h["bottom-right"]||[0,0]),left:c.P.convert(h.left||[0,0]),right:c.P.convert(h.right||[0,0])}}return no(new c.P(0,0))}const dl=Ee;z.AJAXError=c.cz,z.Event=c.l,z.Evented=c.E,z.LngLat=c.S,z.MercatorCoordinate=c.a1,z.Point=c.P,z.addProtocol=c.cA,z.config=c.a,z.removeProtocol=c.cB,z.AttributionControl=Ue,z.BoxZoomHandler=rr,z.CanvasSource=Ca,z.CooperativeGesturesHandler=sl,z.DoubleClickZoomHandler=Tc,z.DragPanHandler=Pc,z.DragRotateHandler=ns,z.EdgeInsets=La,z.FullscreenControl=class extends c.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=n==null?void 0:n.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=ue.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ue.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=ue.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ue.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},z.GeoJSONSource=xn,z.GeolocateControl=class extends c.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new c.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
5RROR":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 ".concat(this._watchState))}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const n=new c.S(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,l=this._map.getBearing(),d=c.e({bearing:l},this.options.fitBoundsOptions),f=Dt.fromLngLat(n,s);this._map.fitBounds(f,d,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const n=new c.S(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&jn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=ue.create("button","maplibregl-ctrl-geolocate",this._container),ue.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ue.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ss({element:this._dotElement}),this._circleElement=ue.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ss({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(n=>{const s=(n==null?void 0:n[0])instanceof ResizeObserverEntry;n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.l("trackuserlocationend")),this.fire(new c.l("userlocationlostfocus")))}))}},this.options=c.e({},ll,h)}onAdd(h){return this._map=h,this._container=ue.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return c._(this,arguments,void 0,(function*(e=!1){if(rn!==void 0&&!e)return rn;if(window.navigator.permissions===void 0)return rn=!!window.navigator.geolocation,rn;try{rn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch(n){rn=!!window.navigator.geolocation}return rn}))})().then((e=>this._finishSetupUI(e))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),ue.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,nn=0,jn=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),n=h.coords;return e&&(n.longitude<e.getWest()||n.longitude>e.getEast()||n.latitude<e.getSouth()||n.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
5RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}}_updateCircleRadiusIfNeeded(){const h=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&h))return;const e=this._map.project(h),n=this._map.unproject([e.x+100,e.y]),s=h.distanceTo(n)/100,l=2*this._accuracy/s;this._circleElement.style.width="".concat(l.toFixed(2),"px"),this._circleElement.style.height="".concat(l.toFixed(2),"px")}trigger(){if(!this._setup)return c.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 c.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":nn--,jn=!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 c.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.l("trackuserlocationstart")),this.fire(new c.l("userlocationfocus"));break;default:throw new Error("Unexpected watchState ".concat(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 ".concat(this._watchState))}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),nn++,nn>1?(h={maximumAge:6e5,timeout:0},jn=!0):(h=this.options.positionOptions,jn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},z.GlobeControl=class{constructor(){this._toggleProjection=()=>{var h;const e=(h=this._map.getProjection())===null||h===void 0?void 0:h.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var h;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((h=this._map.getProjection())===null||h===void 0?void 0:h.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(h){return this._map=h,this._container=ue.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=ue.create("button","maplibregl-ctrl-globe",this._container),ue.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){ue.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},z.Hash=tl,z.ImageSource=Fi,z.KeyboardHandler=Js,z.LngLatBounds=Dt,z.LogoControl
vendor: 21,549 bytes, line 5
5=ya,z.Map=class extends eo{constructor(h){var e,n;c.cw.mark(c.cx.create);const s=Object.assign(Object.assign(Object.assign({},xa),h),{canvasContextAttributes:Object.assign(Object.assign({},xa.canvasContextAttributes),h.canvasContextAttributes)});if(s.minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new ta,d=new Fa;if(s.minZoom!==void 0&&l.setMinZoom(s.minZoom),s.maxZoom!==void 0&&l.setMaxZoom(s.maxZoom),s.minPitch!==void 0&&l.setMinPitch(s.minPitch),s.maxPitch!==void 0&&l.setMaxPitch(s.maxPitch),s.renderWorldCopies!==void 0&&l.setRenderWorldCopies(s.renderWorldCopies),super(l,d,{bearingSnap:s.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Mc,this._controls=[],this._mapId=c.a7(),this._contextLost=g=>{g.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.l("webglcontextlost",{originalEvent:g}))},this._contextRestored=g=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.l("webglcontextrestored",{originalEvent:g}))},this._onMapScroll=g=>{if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._maxTileCacheZoomLevels=s.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},s.canvasContextAttributes),this._trackResize=s.trackResize===!0,this._bearingSnap=s.bearingSnap,this._centerClampedToGround=s.centerClampedToGround,this._refreshExpiredTiles=s.refreshExpiredTiles===!0,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions===!0,this._collectResourceTiming=s.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},_h),s.locale),this._clickTolerance=s.clickTolerance,this._overridePixelRatio=s.pixelRatio,this._maxCanvasSize=s.maxCanvasSize,this.transformCameraUpdate=s.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=s.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=mi.addThrottleControl((()=>this.isMoving())),this._requestManager=new qr(s.transformRequest),typeof s.container=="string"){if(this._container=document.getElementById(s.container),!this._container)throw new Error("Container '".concat(s.container,"' not found."))}else{if(!(s.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.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 g=!1;const y=el((b=>{this._trackResize&&!this._removed&&(this.resize(b),this.redraw())}),50);this._resizeObserver=new ResizeObserver((b=>{g?y(b):g=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Ir(this,s),this._hash=s.hash&&new tl(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,elevation:s.elevation,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,roll:s.roll}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,c.e({},s.fitBoundsOptions,{duration:0}))));const f=typeof s.style=="string"||((n=(e=s.style)===null||e===void 0?void 0:e.projection)===null||n===void 0?void 0:n.type)!=="globe";this.resize(null,f),this._localIdeographFontFamily=s.localIdeographFontFamily,this._validateStyle=s.validateStyle,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Ue(typeof s.attributionControl=="boolean"?void 0:s.attributionControl)),s.maplibreLogo&&this.addControl(new ya,s.logoPosition),this.on("style.load",(()=>{if(f||this._resizeTransform(),this.transform.unmodified){const g=c.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(g)}})),this.on("data",(g=>{this._update(g.dataType==="style"),this.fire(new c.l("".concat(g.dataType,"data"),g))})),this.on("dataloading",(g=>{this.fire(new c.l("".concat(g.dataType,"dataloading"),g))})),this.on("dataabort",(g=>{this.fire(new c.l("sourcedataabort",g))}))}_getMapId(){return this._mapId}setGlobalStateProperty(h,e){return this.style.setGlobalStateProperty(h,e),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new c.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=h.onAdd(this);this._controls.push(h);const s=this._controlPositions[e];return e.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new c.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}coveringTiles(h){return st(this.transform,h)}calculateCameraOptionsFromTo(h,e,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,n,s)}resize(h,e=!0){const[n,s]=this._containerDimensions(),l=this._getClampedPixelRatio(n,s);if(this._resizeCanvas(n,s,l),this.painter.resize(n,s,l),this.painter.overLimit()){const f=this.painter.context.gl;this._maxCanvasSize=[f.drawingBufferWidth,f.drawingBufferHeight];const g=this._getClampedPixelRatio(n,s);this._resizeCanvas(n,s,g),this.painter.resize(n,s,g)}this._resizeTransform(e);const d=!this._moving;return d&&(this.stop(),this.fire(new c.l("movestart",h)).fire(new c.l("move",h))),this.fire(new c.l("resize",h)),d&&this.fire(new c.l("moveend",h)),this}_resizeTransform(h=!0){var e;const[n,s]=this._containerDimensions();this.transform.resize(n,s,h),(e=this._requestedCameraState)===null||e===void 0||e.resize(n,s,h)}_getClampedPixelRatio(h,e){const{0:n,1:s}=this._maxCanvasSize,l=this.getPixelRatio(),d=h*l,f=e*l;return Math.min(d>n?n/d:1,f>s?s/f:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(Dt.convert(h)),this._update()}setMinZoom(h){if((h=h==null?-2:h)>=-2&&h<=this.transform.maxZoom)return this.transform.setMinZoom(h),this._update(),this.getZoom()<h&&this.setZoom(h),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(h){if((h=h==null?22:h)>=this.transform.minZoom)return this.transform.setMaxZoom(h),this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h==null?0:h)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.setMinPitch(h),this._update(),this.getPitch()<h&&this.setPitch(h),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(h){if((h=h==null?60:h)>180)throw new Error("maxPitch must be less than or equal to 180");if(h>=this.transform.minPitch)return this.transform.setMaxPitch(h),this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.setRenderWorldCopies(h),this._update()}project(h){return this.transform.locationToScreenPoint(c.S.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.screenPointToLocation(c.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,n){if(h==="mouseenter"||h==="mouseover"){let s=!1;return{layers:e,listener:n,delegates:{mousemove:d=>{const f=e.filter((y=>this.getLayer(y))),g=f.length!==0?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length?s||(s=!0,n.call(this,new Ei(h,this,d.originalEvent,{features:g}))):s=!1},mouseout:()=>{s=!1}}}}if(h==="mouseleave"||h==="mouseout"){let s=!1;return{layers:e,listener:n,delegates:{mousemove:f=>{const g=e.filter((y=>this.getLayer(y)));(g.length!==0?this.queryRenderedFeatures(f.point,{layers:g}):[]).length?s=!0:s&&(s=!1,n.call(this,new Ei(h,this,f.originalEvent)))},mouseout:f=>{s&&(s=!1,n.call(this,new Ei(h,this,f.originalEvent)))}}}}{const s=l=>{const d=e.filter((g=>this.getLayer(g))),f=d.length!==0?this.queryRenderedFeatures(l.point,{layers:d}):[];f.length&&(l.features=f,n.call(this,l),delete l.features)};return{layers:e,listener:n,delegates:{[h]:s}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,n){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const s=this._delegatedListeners[h];for(let l=0;l<s.length;l++){const d=s[l];if(d.listener===n&&d.layers.length===e.length&&d.layers.every((f=>e.includes(f)))){for(const f in d.delegates)this.off(f,d.delegates[f]);return void s.splice(l,1)}}}on(h,e,n){if(n===void 0)return super.on(h,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,s,n);this._saveDelegatedListener(h,l);for(const d in l.delegates)this.on(d,l.delegates[d]);return{unsubscribe:()=>{this._removeDelegatedListener(h,s,n)}}}once(h,e,n){if(n===void 0)return super.once(h,e);const s=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,s,n);for(const d in l.delegates){const f=l.delegates[d];l.delegates[d]=(...g)=>{this._removeDelegatedListener(h,s,n),f(...g)}}this._saveDelegatedListener(h,l);for(const d in l.delegates)this.once(d,l.delegates[d]);return this}off(h,e,n){return n===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,n),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let n;const s=h instanceof c.P||Array.isArray(h),l=s?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:h)||{},l instanceof c.P||typeof l[0]=="number")n=[c.P.convert(l)];else{const d=c.P.convert(l[0]),f=c.P.convert(l[1]);n=[d,new c.P(f.x,d.y),f,new c.P(d.x,f.y),d]}return this.style.queryRenderedFeatures(n,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error("Missing UI string '".concat(h,"'"));return e}_updateStyle(h,e){var n,s;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(h,e)));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new ko(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,l):this.style.loadJSON(h,e,l),this):((s=(n=this.style)===null||n===void 0?void 0:n.projection)===null||s===void 0||s.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ko(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const n=this._requestManager.transformRequest(h,"Style");c.j(n,new AbortController).then((s=>{this._updateDiff(s.data,e)})).catch((s=>{s&&this.fire(new c.k(s))}))}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(n){c.w("Unable to perform style diff: ".concat(n.message||n.error||n,". Rebuilding the style from scratch.")),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new c.k(new Error("There is no source with ID '".concat(h,"'"))))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error("cannot load terrain, because there exists no source with ID: ".concat(h.source));this.terrain===null&&e.reload();for(const n in this.style._layers){const s=this.style._layers[n];s.type==="hillshade"&&s.source===h.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),s.type==="color-relief"&&s.source===h.source&&c.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Cc(this.painter,e,h),this.painter.renderToTexture=new mh(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=n=>{var s;n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==h.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((s=n.source)===null||s===void 0?void 0:s.type)==="image"?this.terrain.sourceCache.freeRtt():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.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new c.l("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const n=h[e]._tiles;for(const s in n){const l=n[s];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}setSourceTileLodParams(h,e,n){if(n){const s=this.getSource(n);if(!s)throw new Error('There is no source with ID "'.concat(n,'", cannot set LOD parameters'));s.calculateTileZoom=De(Math.max(1,h),Math.max(1,e))}else for(const s in this.style.sourceCaches)this.style.sourceCaches[s].getSource().calculateTileZoom=De(Math.max(1,h),Math.max(1,e));return this._update(!0),this}refreshTiles(h,e){const n=this.style.sourceCaches[h];if(!n)throw new Error('There is no source cache with ID "'.concat(h,'", cannot refresh tile'));e===void 0?n.reload(!0):n.refreshTiles(e.map((s=>new c.a4(s.z,s.x,s.y))))}addImage(h,e,n={}){const{pixelRatio:s=1,sdf:l=!1,stretchX:d,stretchY:f,content:g,textFitWidth:y,textFitHeight:b}=n;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||c.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new c.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:w,height:S,data:P}=e,I=e;return this.style.addImage(h,{data:new c.R({width:w,height:S},new Uint8Array(P)),pixelRatio:s,stretchX:d,stretchY:f,content:g,textFitWidth:y,textFitHeight:b,sdf:l,version:0,userImage:I}),I.onAdd&&I.onAdd(this,h),this}}{const{width:w,height:S,data:P}=Ze.getImageData(e);this.style.addImage(h,{data:new c.R({width:w,height:S},P),pixelRatio:s,stretchX:d,stretchY:f,content:g,textFitWidth:y,textFitHeight:b,sdf:l,version:0})}}updateImage(h,e){const n=this.style.getImage(h);if(!n)return this.fire(new c.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=e instanceof HTMLImageElement||c.b(e)?Ze.getImageData(e):e,{width:l,height:d,data:f}=s;if(l===void 0||d===void 0)return this.fire(new c.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||d!==n.data.height)return this.fire(new c.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(e instanceof HTMLImageElement||c.b(e));return n.data.replace(f,g),this.style.updateImage(h,n),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new c.k(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return mi.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,n){return this.style.setLayerZoomRange(h,e,n),this._update(!0)}setFilter(h,e,n={}){return this.style.setFilter(h,e,n),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,n,s={}){return this.style.setPaintProperty(h,e,n,s),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,n,s={}){return this.style.setLayoutProperty(h,e,n,s),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,n,(s=>{s||this._update(!0)})),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,(n=>{n||this._update(!0)})),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(h,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=ue.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=ue.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
5on");const n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const l=this._controlContainer=ue.create("div","maplibregl-control-container",h),d=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((f=>{d[f]=ue.create("div","maplibregl-ctrl-".concat(f," "),l)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,n){this._canvas.width=Math.floor(n*h),this._canvas.height=Math.floor(n*e),this._canvas.style.width="".concat(h,"px"),this._canvas.style.height="".concat(e,"px")}_setupPainter(){const h=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{e={requestedAttributes:h},s&&(e.statusMessage=s.statusMessage,e.type=s.type)}),{once:!0});let n=null;if(n=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,h):this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h),!n){const s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new lc(n,this.transform),ar.testSupport(n)}migrateProjection(h,e){super.migrateProjection(h,e),this.painter.transform=h,this.fire(new c.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){var e,n,s,l,d;const f=this._idleTriggered?this._fadeDuration:0,g=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,P=Ze.now();this.style.zoomHistory.update(S,P);const I=new c.F(S,{now:P,fadeDuration:f,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),D=I.crossFadingFactor();D===1&&D===this._crossFadingFactor||(y=!0,this._crossFadingFactor=D),this.style.update(I)}const b=((n=this.style.projection)===null||n===void 0?void 0:n.transitionState)>0!==g;(s=this.style.projection)===null||s===void 0||s.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(d=this.style.projection)===null||d===void 0?void 0:d.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||b)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,f,this._crossSourceCollisions,b),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:f,showPadding:this.showPadding}),this.fire(new c.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.cw.mark(c.cx.load),this.fire(new c.l("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const w=this._sourcesDirty||this._styleDirty||this._placementDirty;return w||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.l("idle")),!this._loaded||this._fullyLoaded||w||(this._fullyLoaded=!0,c.cw.mark(c.cx.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),mi.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ue.remove(this._canvasContainer),ue.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),c.cw.clearMetrics(),this._removed=!0,this.fire(new c.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Ze.frame(this._frameRequest,(h=>{c.cw.frame(h),this._frameRequest=null;try{this._render(h)}catch(e){if(!c.cy(e)&&!(function(n){return n.message===Wo})(e))throw e}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return gh}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(h){return this._lazyInitEmptyStyle(),this.style.setProjection(h),this._update(!0)}},z.MapMouseEvent=Ei,z.MapTouchEvent=Qr,z.MapWheelEvent=il,z.Marker=ss,z.NavigationControl
5=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),n=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5),") rotateZ(").concat(-this._map.transform.roll,"deg) rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(-this._map.transform.bearing,"deg)"):this.options.visualizePitch?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5),") rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(-this._map.transform.bearing,"deg)"):this.options.visualizeRoll?"rotate(".concat(-this._map.transform.bearing-this._map.transform.roll,"deg)"):"rotate(".concat(-this._map.transform.bearing,"deg)")},this._setButtonTitle=(e,n)=>{const s=this._map._getUIString("NavigationControl.".concat(n));e.title=s,e.setAttribute("aria-label",s)},this.options=c.e({},Mt,h),this._container=ue.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),ue.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),ue.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=ue.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Lt(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ue.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const n=ue.create("button",h,this._container);return n.type="button",n.addEventListener("click",e),n}},z.Popup=class extends c.E{constructor(h){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?"".concat(this.options.locationOccludedOpacity):"")},this.remove=()=>(this._content&&ue.remove(this._content),this._container&&(ue.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 c.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ue.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ue.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const f of this.options.className.split(" "))this._container.classList.add(f);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=va(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;const n=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let s=this.options.anchor;const l=no(this.options.offset);if(!s){const f=this._container.offsetWidth,g=this._container.offsetHeight;let y;y=n.y+l.bottom.y<g?["top"]:n.y>this._map.transform.height-g?["bottom"]:[],n.x<f/2?y.push("left"):n.x>this._map.transform.width-f/2&&y.push("right"),s=y.length===0?"bottom":y.join("-")}let d=n.add(l[s]);
vendor: 4,762 bytes, line 5
5this.options.subpixelPositioning||(d=d.round()),ue.setTransform(this._container,"".concat(ba[s]," translate(").concat(d.x,"px,").concat(d.y,"px)")),io(this._container,s,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(hl),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=c.S.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=h;s=n.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ue.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=ue.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(ul);h&&h.focus()}},z.RasterDEMTileSource=yn,z.RasterTileSource=wr,z.ScaleControl=class{constructor(h){this._onMove=()=>{ro(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ro(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},cl),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=ue.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ue.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},z.ScrollZoomHandler=wc,z.Style=ko,z.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=ue.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ue.create("button","maplibregl-ctrl-terrain",this._container),ue.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
5ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ue.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},z.TwoFingersTouchPitchHandler=gc,z.TwoFingersTouchRotateHandler=Ks,z.TwoFingersTouchZoomHandler=Ys,z.TwoFingersTouchZoomRotateHandler=Qs,z.VectorTileSource=cr,z.VideoSource=Xn,z.addSourceType=(h,e)=>c._(void 0,void 0,void 0,(function*(){if(Tr(h))throw new Error('A source type called "'.concat(h,'" already exists.'));((n,s)=>{Yr[n]=s})(h,e)})),z.clearPrewarmedResources=function(){const h=br;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(mn),br=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},z.createTileMesh=Oa,z.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},z.getRTLTextPluginStatus=function(){return Kr().getRTLTextPluginStatus()},z.getVersion=function(){return dl},z.getWorkerCount=function(){return _i.workerCount},z.getWorkerUrl=function(){return c.a.WORKER_URL},z.importScriptInWorkers=function(h){return qn().broadcast("IS",h)},z.prewarm=function(){gn().acquire(mn)},z.setMaxParallelImageRequests=function(h){c.a.MAX_PARALLEL_IMAGE_REQUESTS=h},z.setRTLTextPlugin=function(h,e){return Kr().setRTLTextPlugin(h,e)},z.setWorkerCount=function(h){_i.workerCount=h},z.setWorkerUrl=function(h){c.a.WORKER_URL=h}}));var Je=pe;return Je}))})(qc)),qc.exports}var ki=Jf();class Qf{constructor(H){pt(this,"_map");this._map=H}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(H){return this.transform.screenPointToLocation(ki.Point.convert(H),this._map.terrain)}}class nu{constructor(H){pt(this,"_tr");pt(this,"_enabled",!0);pt(this,"_active",!1);this._tr=new Qf(H),this.reset()}shouldAcceptEvent(H){return!(H.target&&"closest"in H.target&&H.target.closest(".map-marker"))}mouseup(H,pe){if(this.shouldAcceptEvent(H)&&!(H.detail<2||H.button!==2))return{cameraAnimation:ye=>{ye.easeTo({duration:300,zoom:this._tr.zoom+-1,around:this._tr.unproject(pe)},{originalEvent:H})}}}dblclick(H,pe){if(this.shouldAcceptEvent(H))return H.preventDefault(),{cameraAnimation:ye=>{ye.easeTo({duration:300,zoom:this._tr.zoom+(H.shiftKey?-1:1),around:this._tr.unproject(pe)},{originalEvent:H})}}}reset(){this._active=!1}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}static addToMap(H){H.handlers._add("double-right-click-handler",new nu(H)),H.doubleClickZoom.disable()}}const Gn=class Gn extends ki.Popup{constructor(pe,ye,Be){super({anchor:"center",closeButton:!1,closeOnMove:!1});pt(this,"hasImage");pt(this,"map");pt(this,"marker");pt(this,"unHighlightTimeoutId",null);Be.remove(),this.hasImage=Be.dataset.containsImage==="true",this.marker=ye,this.map=pe,this.setDOMContent(Be),ye.setPopup(this),this.on("open",this.onOpen.bind(this)),this.on("close",this.onClose.bind(this)),this.onMapResize=this.onMapResize.bind(this),pe.on("resize",this.onMapResize),this.updatePopoverMaxWidth(),ye.getElement().addEventListener("mouseenter",()=>{this.open()})}destroy(){this.map.off("resize",this.onMapResize)}onOpen(){this.getElement().addEventListener("mouseleave",pe=>this.delayedClose()),this.addClassName("map-marker-popover"),this.hasImage&&this.addClassName("contains-image"),setTimeout(()=>this.highlight(),10),this.getElement().addEventListener("mouseenter",pe=>{if(this.unHighlightTimeoutId!==null){window.clearTimeout(this.unHighlightTimeoutId),this.unHighlightTimeoutId=null;return}})}onClose(){}onMapResize(){this.updatePopoverMaxWidth()}updatePopoverMaxWidth(){const ye=this.map.getContainer().clientWidth;this.setMaxWidth("".concat(ye-Gn.overlapMargin*2,"px"))}open(){this.isOpen()||this.marker.togglePopup()}close(){this.isOpen()&&this.marker.togglePopup()}highlight(){this.addClassName("highlight"),setTimeout(()=>{const ye=this.map.getContainer().getBoundingClientRect();if(!this.getElement())return;const Be=this.getElement().getBoundingClientRect(),Je=ye.left+Gn.overlapMargin-Be.left,z=Be.right+Gn.overlapMargin-ye.right,c=ye.top+Gn.overlapMargin-Be.top,Ee=Be.bottom+Gn.overlapMargin-ye.bottom;if(c>0||Ee>0||Je>0||z>0){const Bt=this.map.getCenter(),wt=this.map.project(Bt),Tt={x:wt.x+(Math.max(z,0)-Math.max(Je,0)),y:wt.y+(Math.max(Ee,0)-Math.max(c,0))},Ze=this.map.unproject([Tt.x,Tt.y]);this.map.panTo(Ze)}},200)}delayedClose(){this.unHighlightTimeoutId=window.setTimeout(()=>{var pe;this.unHighlightTimeoutId=null,(pe=this.getElement())==null||pe.classList.remove("highlight"),setTimeout(()=>this.close(),200)},250)}};pt(Gn,"overlapMargin",20),pt(Gn,"lastHighlightedPopup",null);let ru=Gn;class em{constructor({map:H,markerTemplate:pe}){pt(this,"marker");pt(this,"popup");const ye=new ki.LngLat(Number(pe.dataset.lng),Number(pe.dataset.lat)),Be=pe.cloneNode(!0);this.marker=new ki.Marker({element:Be,anchor:"bottom",clickTolerance:50}),this.marker.setLngLat(ye).addTo(H);const Je=Be.querySelector(".map-marker-popover-content");Je&&(this.popup=new ru(H,this.marker,Je))}remove(){var H;(H=this.popup)==null||H.destroy(),this.marker.remove()}getMarker(){return this.marker}}var tm=Object.defineProperty,dn=(J,H)=>tm(J,"name",{value:H,configurable:!0});function nr(J,H){let pe="script";return J==="name"?pe="script":J==="name2"?pe="script2":J==="name3"&&(pe="script3"),[["coalesce",["get","pgf:".concat(J)],["get",J]],{"text-font":["case",["==",["get",pe],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[H||"Noto Sans Regular"]]]}]}dn(nr,"get_name_block");function un(J,H,pe){let ye="name";return pe==="name"?ye="":pe==="name2"?ye="2":pe==="name3"&&(ye="3"),H==="Latin"?["has","script".concat(ye)]:J==="ja"?["all",["!=",["get","script".concat(ye)],"Han"],["!=",["get","script".concat(ye)],"Hiragana"],["!=",["get","script".concat(ye)],"Katakana"],["!=",["get","script".concat(ye)],"Mixed-Japanese"]]:["!=",["get","script".concat(ye)],H]}dn(un,"is_not_in_target_script");function Gr(J){return J==="Devanagari"?{"text-font":["literal",["Noto Sans Devanagari Regular v1"]]}:{}}dn(Gr,"get_font_formatting");function au(J){let H=im.find(pe=>pe.lang===J);return H===void 0?"Latin":H.script}dn(au,"get_default_script");function Zd(J,H){let pe=H||au(J),ye;return pe==="Devanagari"?ye="pgf:":ye="",["format",["coalesce",["get","".concat(ye,"name:").concat(J)],["get","name:en"]],Gr(pe)]}dn(Zd,"get_country_name");function Zr(J,H,pe){let ye=H||au(J),Be;return ye==="Devanagari"?Be="pgf:":Be="",["case",["all",["any",["has","name"],["has","pgf:name"]],["!",["any",["has","name2"],["has","pgf:name2"]]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",un(J,ye,"name"),["case",["any",["is-supported-script",["get","name"]],["has","pgf:name"]],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","name:en"]],Gr(ye),"\n",{},["case",["all",["!",["has","".concat(Be,"name:").concat(J)]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[pe||"Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name"],["get","name"]],Gr(ye)]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",un(J,ye,"name"),un(J,ye,"name2")],["format",["get","".concat(Be,"name:").concat(J)],Gr(ye),"\n",{},...nr("name",pe),"\n",{},...nr("name2",pe)],["case",un(J,ye,"name2"),["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name"],["get","name"]],Gr(ye),"\n",{},...nr("name2",pe)],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name2"],["get","name2"]],Gr(ye),"\n",{},...nr("name",pe)]]],["case",["all",un(J,ye,"name"),un(J,ye,"name2"),un(J,ye,"name3")],["format",["get","".concat(Be,"name:").concat(J)],Gr(ye),"\n",{},...nr("name",pe),"\n",{},...nr("name2",pe),"\n",{},...nr("name3",pe)],["case",["!",un(J,ye,"name")],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name"],["get","name"]],Gr(ye),"\n",{},...nr("name2",pe),"\n",{},...nr("name3",pe)],["!",un(J,ye,"name2")],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name2"],["get","name2"]],Gr(ye),"\n",{},...nr("name",pe),"\n",{},...nr("name3",pe)],["format",["coalesce",["get","".concat(Be,"name:").concat(J)],["get","pgf:name3"],["get","name3"]],Gr(ye),"\n",{},...nr("name",pe),"\n",{},...nr("name2",pe)]]]]}dn(Zr,"get_multiline_name");var im=[{lang:"ar",full_name:"Arabic",script:"Arabic"},{lang:"cs",full_name:"Czech",script:"Latin"},{lang:"bg",full_name:"Bulgarian",script:"Cyrillic"},{lang:"da",full_name:"Danish",script:"Latin"},{lang:"de",full_name:"German",script:"Latin"},{lang:"el",full_name:"Greek",script:"Greek"},{lang:"en",full_name:"English",script:"Latin"},{lang:"es",full_name:"Spanish",script:"Latin"},{lang:"et",full_name:"Estonian",script:"Latin"},{lang:"fa",full_name:"Persian",script:"Arabic"},{lang:"fi",full_name:"Finnish",script:"Latin"},{lang:"fr",full_name:"French",script:"Latin"},{lang:"ga",full_name:"Irish",script:"Latin"},{lang:"he",full_name:"Hebrew",script:"Hebrew"},{lang:"hi",full_name:"Hindi",script:"Devanagari"},{lang:"hr",full_name:"Croatian",script:"Latin"},{lang:"hu",full_name:"Hungarian",script:"Latin"},{lang:"id",full_name:"Indonesian",script:"Latin"}
vendor: 11,511 bytes, line 5
5,{lang:"it",full_name:"Italian",script:"Latin"},{lang:"ja",full_name:"Japanese",script:""},{lang:"ko",full_name:"Korean",script:"Hangul"},{lang:"lt",full_name:"Lithuanian",script:"Latin"},{lang:"lv",full_name:"Latvian",script:"Latin"},{lang:"ne",full_name:"Nepali",script:"Devanagari"},{lang:"nl",full_name:"Dutch",script:"Latin"},{lang:"no",full_name:"Norwegian",script:"Latin"},{lang:"mr",full_name:"Marathi",script:"Devanagari"},{lang:"mt",full_name:"Maltese",script:"Latin"},{lang:"pl",full_name:"Polish",script:"Latin"},{lang:"pt",full_name:"Portuguese",script:"Latin"},{lang:"ro",full_name:"Romanian",script:"Latin"},{lang:"ru",full_name:"Russian",script:"Cyrillic"},{lang:"sk",full_name:"Slovak",script:"Latin"},{lang:"sl",full_name:"Slovenian",script:"Latin"},{lang:"sv",full_name:"Swedish",script:"Latin"},{lang:"tr",full_name:"Turkish",script:"Latin"},{lang:"uk",full_name:"Ukrainian",script:"Cyrillic"},{lang:"ur",full_name:"Urdu",script:"Arabic"},{lang:"vi",full_name:"Vietnamese",script:"Latin"},{lang:"zh-Hans",full_name:"Chinese (Simplified)",script:"Han"},{lang:"zh-Hant",full_name:"Chinese (Traditional)",script:"Han"}];function Gd(J,H){return[{id:"background",type:"background",paint:{"background-color":H.background}},{id:"earth",type:"fill",filter:["==","$type","Polygon"],source:J,"source-layer":"earth",paint:{"fill-color":H.earth}},...H.landcover?[{id:"landcover",type:"fill",source:J,"source-layer":"landcover",paint:{"fill-color":["match",["get","kind"],"grassland",H.landcover.grassland,"barren",H.landcover.barren,"urban_area",H.landcover.urban_area,"farmland",H.landcover.farmland,"glacier",H.landcover.glacier,"scrub",H.landcover.scrub,H.landcover.forest],"fill-opacity":["interpolate",["linear"],["zoom"],5,1,7,0]}}]:[],{id:"landuse_park",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course","wood","nature_reserve","forest","scrub","grassland","grass","military","naval_base","airfield"],paint:{"fill-opacity":["interpolate",["linear"],["zoom"],6,0,11,1],"fill-color":["case",["in",["get","kind"],["literal",["national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course"]]],H.park_b,["in",["get","kind"],["literal",["wood","nature_reserve","forest"]]],H.wood_b,["in",["get","kind"],["literal",["scrub","grassland","grass"]]],H.scrub_b,["in",["get","kind"],["literal",["glacier"]]],H.glacier,["in",["get","kind"],["literal",["sand"]]],H.sand,["in",["get","kind"],["literal",["military","naval_base","airfield"]]],H.zoo,H.earth]}},{id:"landuse_urban_green",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","allotments","village_green","playground"],paint:{"fill-color":H.park_b,"fill-opacity":.7}},{id:"landuse_hospital",type:"fill",source:J,"source-layer":"landuse",filter:["==","kind","hospital"],paint:{"fill-color":H.hospital}},{id:"landuse_industrial",type:"fill",source:J,"source-layer":"landuse",filter:["==","kind","industrial"],paint:{"fill-color":H.industrial}},{id:"landuse_school",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","school","university","college"],paint:{"fill-color":H.school}},{id:"landuse_beach",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","beach"],paint:{"fill-color":H.beach}},{id:"landuse_zoo",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","zoo"],paint:{"fill-color":H.zoo}},{id:"landuse_aerodrome",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","aerodrome"],paint:{"fill-color":H.aerodrome}},{id:"roads_runway",type:"line",source:J,"source-layer":"roads",filter:["==","kind_detail","runway"],paint:{"line-color":H.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],10,0,12,4,18,30]}},{id:"roads_taxiway",type:"line",source:J,"source-layer":"roads",minzoom:13,filter:["==","kind_detail","taxiway"],paint:{"line-color":H.runway,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,15,6]}},{id:"landuse_runway",type:"fill",source:J,"source-layer":"landuse",filter:["any",["in","kind","runway","taxiway"]],paint:{"fill-color":H.runway}},{id:"water",type:"fill",filter:["==","$type","Polygon"],source:J,"source-layer":"water",paint:{"fill-color":H.water}},{id:"water_stream",type:"line",source:J,"source-layer":"water",minzoom:14,filter:["in","kind","stream"],paint:{"line-color":H.water,"line-width":.5}},{id:"water_river",type:"line",source:J,"source-layer":"water",minzoom:9,filter:["in","kind","river"],paint:{"line-color":H.water,"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1,18,12]}},{id:"landuse_pedestrian",type:"fill",source:J,"source-layer":"landuse",filter:["in","kind","pedestrian","dam"],paint:{"fill-color":H.pedestrian}},{id:"landuse_pier",type:"fill",source:J,"source-layer":"landuse",filter:["==","kind","pier"],paint:{"fill-color":H.pier}},{id:"roads_tunnels_other_casing",type:"line",source:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":H.tunnel_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_tunnels_minor_casing",type:"line",source:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":H.tunnel_link_casing,"line-dasharray":[3,2],"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,1]}},{id:"roads_tunnels_major_casing",type:"line",source:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["in","kind","other","path"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","minor_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["has","is_link"]],paint:{"line-color":H.tunnel_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_tunnels_major",type:"line",source:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_tunnel"],["==",["get","kind"],"highway"],["!",["has","is_link"]]],paint:{"line-color":H.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:J,"source-layer":"buildings",filter:["in","kind","building","building_part"],paint:{"fill-color":H.buildings,"fill-opacity":.5}},{id:"roads_pier",type:"line",source:J,"source-layer":"roads",filter:["==","kind_detail","pier"],paint:{"line-color":H.pier,"line-width":["interpolate",["exponential",1.6],["zoom"],12,0,12.5,.5,20,16]}},{id:"roads_minor_service_casing",type:"line",source:J,"source-layer":"roads",minzoom:13,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:13,filter:["has","is_link"],paint:{"line-color":H.minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1.5]}},{id:"roads_major_casing_late",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["in","kind","other","path"],["!=","kind_detail","pier"]],paint:{"line-color":H.other,"line-dasharray":[3,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_link",type:"line",source:J,"source-layer":"roads",filter:["has","is_link"],paint:{"line-color":H.link,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_minor_service",type:"line",source:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["==","kind_detail","service"]],paint:{"line-color":H.minor_service,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,18,8]}},{id:"roads_minor",type:"line",source:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","minor_road"],["!=","kind_detail","service"]],paint:{"line-color":["interpolate",["exponential",1.6],["zoom"],11,H.minor_a,16,H.minor_b],"line-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11]}},{id:"roads_major_casing_early",type:"line",source:J,"source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.major_casing_early,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],7,0,7.5,.5,
vendor: 12,742 bytes, line 5
518,13],"line-width":["interpolate",["exponential",1.6],["zoom"],9,0,9.5,1]}},{id:"roads_major",type:"line",source:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",maxzoom:12,filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["!has","is_tunnel"],["!has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}},{id:"roads_rail",type:"line",source:J,"source-layer":"roads",filter:["==","kind","rail"],paint:{"line-dasharray":[.3,.75],"line-opacity":.5,"line-color":H.railway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,.15,18,9]}},{id:"boundaries_country",type:"line",source:J,"source-layer":"boundaries",filter:["<=","kind_detail",2],paint:{"line-color":H.boundaries,"line-width":.7,"line-dasharray":["step",["zoom"],["literal",[2,0]],4,["literal",[2,1]]]}},{id:"boundaries",type:"line",source:J,"source-layer":"boundaries",filter:[">","kind_detail",2],paint:{"line-color":H.boundaries,"line-width":.4,"line-dasharray":["step",["zoom"],["literal",[2,0]],4,["literal",[2,1]]]}},{id:"roads_bridges_other_casing",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":H.bridges_other_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_link_casing",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":H.bridges_minor_casing,"line-gap-width":["interpolate",["exponential",1.6],["zoom"],11,0,12.5,.5,15,2,18,11],"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,.8]}},{id:"roads_bridges_major_casing",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["in","kind","other","path"]],paint:{"line-color":H.bridges_other,"line-dasharray":[2,1],"line-width":["interpolate",["exponential",1.6],["zoom"],14,0,20,7]}},{id:"roads_bridges_minor",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","minor_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["has","is_link"]],paint:{"line-color":H.bridges_minor,"line-width":["interpolate",["exponential",1.6],["zoom"],13,0,13.5,1,18,11]}},{id:"roads_bridges_major",type:"line",source:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","major_road"]],paint:{"line-color":H.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:J,"source-layer":"roads",minzoom:12,filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.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:J,"source-layer":"roads",filter:["all",["has","is_bridge"],["==","kind","highway"],["!has","is_link"]],paint:{"line-color":H.bridges_highway,"line-width":["interpolate",["exponential",1.6],["zoom"],3,0,6,1.1,12,1.6,15,5,18,15]}}]}dn(Gd,"nolabels_layers");function qd(J,H,pe,ye){return[{id:"address_label",type:"symbol",source:J,"source-layer":"buildings",minzoom:18,filter:["==","kind","address"],layout:{"symbol-placement":"point","text-font":[H.italic||"Noto Sans Italic"],"text-field":["get","addr_housenumber"],"text-size":12},paint:{"text-color":H.address_label,"text-halo-color":H.address_label_halo,"text-halo-width":1}},{id:"water_waterway_label",type:"symbol",source:J,"source-layer":"water",minzoom:13,filter:["in","kind","river","stream"],layout:{"symbol-placement":"line","text-font":[H.italic||"Noto Sans Italic"],"text-field":Zr(pe,ye,H.regular),"text-size":12,"text-letter-spacing":.2},paint:{"text-color":H.ocean_label,"text-halo-color":H.water,"text-halo-width":1}},{id:"roads_oneway",type:"symbol",source:J,"source-layer":"roads",minzoom:16,filter:["==",["get","oneway"],"yes"],layout:{"symbol-placement":"line","icon-image":"arrow","icon-rotate":90,"symbol-spacing":100}},{id:"roads_labels_minor",type:"symbol",source:J,"source-layer":"roads",minzoom:15,filter:["in","kind","minor_road","other","path"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":[H.regular||"Noto Sans Regular"],"text-field":Zr(pe,ye,H.regular),"text-size":12},paint:{"text-color":H.roads_label_minor,"text-halo-color":H.roads_label_minor_halo,"text-halo-width":1}},{id:"water_label_ocean",type:"symbol",source:J,"source-layer":"water",filter:["in","kind","sea","ocean","bay","strait","fjord"],layout:{"text-font":[H.italic||"Noto Sans Italic"],"text-field":Zr(pe,ye,H.regular),"text-size":["interpolate",["linear"],["zoom"],3,10,10,12],"text-letter-spacing":.1,"text-max-width":9,"text-transform":"uppercase"},paint:{"text-color":H.ocean_label,"text-halo-width":1,"text-halo-color":H.water}},{id:"earth_label_islands",type:"symbol",source:J,"source-layer":"earth",filter:["in","kind","island"],layout:{"text-font":[H.italic||"Noto Sans Italic"],"text-field":Zr(pe,ye,H.regular),"text-size":10,"text-letter-spacing":.1,"text-max-width":8},paint:{"text-color":H.subplace_label,"text-halo-color":H.subplace_label_halo,"text-halo-width":1}},{id:"water_label_lakes",type:"symbol",source:J,"source-layer":"water",filter:["in","kind","lake","water"],layout:{"text-font":[H.italic||"Noto Sans Italic"],"text-field":Zr(pe,ye,H.regular),"text-size":["interpolate",["linear"],["zoom"],3,10,6,12,10,12],"text-letter-spacing":.1,"text-max-width":9},paint:{"text-color":H.ocean_label,"text-halo-color":H.water,"text-halo-width":1}},{id:"roads_labels_major",type:"symbol",source:J,"source-layer":"roads",minzoom:11,filter:["in","kind","highway","major_road"],layout:{"symbol-sort-key":["get","min_zoom"],"symbol-placement":"line","text-font":[H.regular||"Noto Sans Regular"],"text-field":Zr(pe,ye,H.regular),"text-size":12},paint:{"text-color":H.roads_label_major,"text-halo-color":H.roads_label_major_halo,"text-halo-width":1}},...H.pois?[{id:"pois",type:"symbol",source:J,"source-layer":"pois",filter:["all",["in",["get","kind"],["literal",["beach","forest","marina","park","peak","zoo","garden","bench","aerodrome","station","bus_stop","ferry_terminal","stadium","university","library","school","animal","toilets","drinking_water"]]],[">=",["zoom"],["+",["get","min_zoom"],0]]],layout:{"icon-image":["match",["get","kind"],"station","train_station",["get","kind"]],"text-font":[H.regular||"Noto Sans Regular"],"text-justify":"auto","text-field":Zr(pe,ye,H.regular),"text-size":["interpolate",["linear"],["zoom"],17,10,19,16],"text-max-width":8,"text-offset":[1.1,0],"text-variable-anchor":["left","right"]},paint:{"text-color":["case",["in",["get","kind"],["literal",["beach","forest","marina","park","peak","zoo","garden","bench"]]],H.pois.green,["in",["get","kind"],["literal",["aerodrome","station","bus_stop","ferry_terminal"]]],H.pois.lapis,["in",["get","kind"],["literal",["stadium","university","library","school","animal","toilets","drinking_water"]]],H.pois.slategray,H.earth],"text-halo-color":H.earth,"text-halo-width":1}}]:[],{id:"places_subplace",type:"symbol",source:J,"source-layer":"places",filter:["in","kind","neighbourhood","macrohood"],layout:{"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-field":Zr(pe,ye,H.regular),"text-font":[H.regular||"Noto Sans Regular"],"text-max-width":7,"text-letter-spacing":.1,"text-padding":["interpolate",["linear"],["zoom"],5,2,8,4,12,18,15,20],"text-size":["interpolate",["exponential",1.2],["zoom"],11,8,14,14,18,24],"text-transform":"uppercase"},paint:{"text-color":H.subplace_label,"text-halo-color":H.subplace_label_halo,"text-halo-width":1}},{id:"places_region",type:"symbol",source:J,"source-layer":"places",filter:["==","kind","region"],layout:{"symbol-sort-key":["get","sort_key"],"text-field":["step",["zoom"],["coalesce",["get","ref:en"],["get","ref"]],6,Zr(pe,ye,H.regular)],"text-font":[H.regular||"Noto Sans Regular"],"text-size":["interpolate",["linear"],["zoom"],3,11,7,16],"text-radial-offset":.2,"text-anchor":"center","text-transform":"uppercase"},paint:{"text-color":H.state_label,"text-halo-color":H.state_label_halo,"text-halo-width":1}},{id:"places_locality",type:"symbol",source:J,"source-layer":"places",filter:["==","kind","locality"],layout:{"icon-image":["step",["zoom"],["case",["==",["get","capital"],"yes"],"capital","townspot"],8,""],"icon-size":.7,"text-field":Zr(pe,ye,H.regular),"text-font":["case",["<=",["get","min_zoom"],5],["literal",[H.bold||"Noto Sans Medium"]],["literal",[H.regular||"Noto Sans Regular"]]],"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-padding":["interpolate",["linear"],["zoom"],5,3,8,7,12,11],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],13],8,[">=",["get","population_rank"],13],13,0],4,["case",["<",["get","population_rank"],13],10,[">=",["get","population_rank"],13],15,0],6,["case",["<",["get","population_rank"],12],11,[">=",["get","population_rank"],12],17,0],8,["case",["<",["get","population_rank"],11],11,[">=",["get","population_rank"],11],18,0],10,["case",["<",["get","population_rank"],9],12,[">=",["get","population_rank"],9],20,0],15,["case",["<",["get","population_rank"],8],12,[">=",["get","population_rank"],8],22,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,0,8,4,10,8,12,6,22,2],"text-justify":"auto","text-variable-anchor":["step",["zoom"],["literal",["bottom","left","right","top"]],8,["literal",["center"]]],"text-radial-offset":.3},paint:{"text-color":H.city_label,"text-halo-color":H.city_label_halo,"text-halo-width":1}},{id:"places_country",type:"symbol",source:J,"source-layer":"places",filter:["==","kind","country"],layout:{"symbol-sort-key":["case",["has","sort_key"],["get","sort_key"],["get","min_zoom"]],"text-field":Zd(pe,ye),"text-font":[H.bold||"Noto Sans Medium"],"text-size":["interpolate",["linear"],["zoom"],2,["case",["<",["get","population_rank"],10],8,[">=",["get","population_rank"],10],12,0],6,["case",["<",["get","population_rank"],8],10,[">=",["get","population_rank"],8],18,0],8,["case",["<",["get","population_rank"],7],11,[">=",["get","population_rank"],7],20,0]],"icon-padding":["interpolate",["linear"],["zoom"],0,2,14,2,16,20,17,2,22,2],"text-transform":"uppercase"},paint:{"text-color":H.country_label,"text-halo-color":H.earth,"text-halo-width":1}}]}dn(qd,"labels_layers");var rm={background:"#cccccc",earth:"#e2dfda",park_a:"#cfddd5",park_b:"#9cd3b4",hospital:"#e4dad9",industrial:"#d1dde1",school:"#e4ded7",wood_a:"#d0ded0",wood_b:"#a0d9a0",pedestrian:"#e3e0d4",scrub_a:"#cedcd7",scrub_b:"#99d2bb",glacier:"#e7e7e7",sand:"#e2e0d7",beach:"#e8e4d0",aerodrome:"#dadbdf",runway:"#e9e9ed",water:"#80deea",zoo:"#c6dcdc",military:"#dcdcdc",tunnel_other_casing:"#e0e0e0",tunnel_minor_casing:"#e0e0e0",tunnel_link_casing:"#e0e0e0",tunnel_major_casing:"#e0e0e0",tunnel_highway_casing:"#e0e0e0",tunnel_other:"#d5d5d5",tunnel_minor:"#d5d5d5",tunnel_link:"#d5d5d5",tunnel_major:"#d5d5d5",tunnel_highway:"#d5d5d5",pier:"#e0e0e0",buildings:"#cccccc",minor_service_casing:"#e0e0e0",minor_c
5asing:"#e0e0e0",link_casing:"#e0e0e0",major_casing_late:"#e0e0e0",highway_casing_late:"#e0e0e0",other:"#ebebeb",minor_service:"#ebebeb",minor_a:"#ebebeb",minor_b:"#ffffff",link:"#ffffff",major_casing_early:"#e0e0e0",major:"#ffffff",highway_casing_early:"#e0e0e0",highway:"#ffffff",railway:"#a7b1b3",boundaries:"#adadad",bridges_other_casing:"#e0e0e0",bridges_minor_casing:"#e0e0e0",bridges_link_casing:"#e0e0e0",bridges_major_casing:"#e0e0e0",bridges_highway_casing:"#e0e0e0",bridges_other:"#ebebeb",bridges_minor:"#ffffff",bridges_link:"#ffffff",bridges_major:"#f5f5f5",bridges_highway:"#ffffff",roads_label_minor:"#91888b",roads_label_minor_halo:"#ffffff",roads_label_major:"#938a8d",roads_label_major_halo:"#ffffff",ocean_label:"#728dd4",subplace_label:"#8f8f8f",subplace_label_halo:"#e0e0e0",city_label:"#5c5c5c",city_label_halo:"#e0e0e0",state_label:"#b3b3b3",state_label_halo:"#e0e0e0",country_label:"#a3a3a3",address_label:"#91888b",address_label_halo:"#ffffff",pois:{blue:"#1A8CBD",green:"#20834D",lapis:"#315BCF",pink:"#EF56BA",red:"#F2567A",slategray:"#6A5B8F",tangerine:"#CB6704",turquoise:"#00C3D4"},landcover:{grassland:"rgba(210, 239, 207, 1)",barren:"rgba(255, 243, 215, 1)",urban_area:"rgba(230, 230, 230, 1)",farmland:"rgba(216, 239, 210, 1)",glacier:"rgba(255, 255, 255, 1)",scrub:"rgba(234, 239, 210, 1)",forest:"rgba(196, 231, 210, 1)"}},nm={background:"#34373d",earth:"#1f1f1f",park_a:"#1c2421",park_b:"#192a24",hospital:"#252424",industrial:"#222222",school:"#262323",wood_a:"#202121",wood_b:"#202121",pedestrian:"#1e1e1e",scrub_a:"#222323",scrub_b:"#222323",glacier:"#1c1c1c",sand:"#212123",beach:"#28282a",aerodrome:"#1e1e1e",runway:"#333333",water:"#31353f",zoo:"#222323",military:"#242323",tunnel_other_casing:"#141414",tunnel_minor_casing:"#141414",tunnel_link_casing:"#141414",tunnel_major_casing:"#141414",tunnel_highway_casing:"#141414",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",pier:"#333333",buildings:"#111111",minor_service_casing:"#1f1f1f",minor_casing:"#1f1f1f",link_casing:"#1f1f1f",major_casing_late:"#1f1f1f",highway_casing_late:"#1f1f1f",other:"#333333",minor_service:"#333333",minor_a:"#3d3d3d",minor_b:"#333333",link:"#3d3d3d",major_casing_early:"#1f1f1f",major:"#3d3d3d",highway_casing_early:"#1f1f1f",highway:"#474747",railway:"#000000",boundaries:"#5b6374",bridges_other_casing:"#2b2b2b",bridges_minor_casing:"#1f1f1f",bridges_link_casing:"#1f1f1f",bridges_major_casing:"#1f1f1f",bridges_highway_casing:"#1f1f1f",bridges_other:"#333333",bridges_minor:"#333333",bridges_link:"#3d3d3d",bridges_major:"#3d3d3d",bridges_highway:"#474747",roads_label_minor:"#525252",roads_label_minor_halo:"#1f1f1f",roads_label_major:"#666666",roads_label_major_halo:"#1f1f1f",ocean_label:"#717784",subplace_label:"#525252",subplace_label_halo:"#1f1f1f",city_label:"#7a7a7a",city_label_halo:"#212121",state_label:"#3d3d3d",state_label_halo:"#1f1f1f",country_label:"#5c5c5c",address_label:"#525252",address_label_halo:"#1f1f1f",pois:{blue:"#4299BB",green:"#30C573",lapis:"#2B5CEA",pink:"#EF56BA",red:"#F2567A",slategray:"#93939F",tangerine:"#F19B6E",turquoise:"#00C3D4"},landcover:{grassland:"rgba(30, 41, 31, 1)",barren:"rgba(38, 38, 36, 1)",urban_area:"rgba(28, 28, 28, 1)",farmland:"rgba(31, 36, 32, 1)",glacier:"rgba(43, 43, 43, 1)",scrub:"rgba(34, 36, 30, 1)",forest:"rgba(28, 41, 37, 1)"}},am={background:"#ffffff",earth:"#ffffff",park_a:"#fcfcfc",park_b:"#fcfcfc",hospital:"#f8f8f8",industrial:"#fcfcfc",school:"#f8f8f8",wood_a:"#fafafa",wood_b:"#fafafa",pedestrian:"#fdfdfd",scrub_a:"#fafafa",scrub_b:"#fafafa",glacier:"#fcfcfc",sand:"#fafafa",beach:"#f6f6f6",aerodrome:"#fdfdfd",runway:"#efefef",water:"#dcdcdc",zoo:"#f7f7f7",military:"#fcfcfc",tunnel_other_casing:"#d6d6d6",tunnel_minor_casing:"#fcfcfc",tunnel_link_casing:"#fcfcfc",tunnel_major_casing:"#fcfcfc",tunnel_highway_casing:"#fcfcfc",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",pier:"#efefef",buildings:"#efefef",minor_service_casing:"#ffffff",minor_casing:"#ffffff",link_casing:"#ffffff",major_casing_late:"#ffffff",highway_casing_late:"#ffffff",other:"#f5f5f5",minor_service:"#f5f5f5",minor_a:"#ebebeb",minor_b:"#f5f5f5",link:"#ebebeb",major_casing_early:"#ffffff",major:"#ebebeb",highway_casing_early:"#ffffff",highway:"#ebebeb",railway:"#d6d6d6",boun
5daries:"#adadad",bridges_other_casing:"#ffffff",bridges_minor_casing:"#ffffff",bridges_link_casing:"#ffffff",bridges_major_casing:"#ffffff",bridges_highway_casing:"#ffffff",bridges_other:"#f5f5f5",bridges_minor:"#f5f5f5",bridges_link:"#ebebeb",bridges_major:"#ebebeb",bridges_highway:"#ebebeb",roads_label_minor:"#adadad",roads_label_minor_halo:"#ffffff",roads_label_major:"#999999",roads_label_major_halo:"#ffffff",ocean_label:"#adadad",subplace_label:"#8f8f8f",subplace_label_halo:"#ffffff",city_label:"#5c5c5c",city_label_halo:"#ffffff",state_label:"#b3b3b3",state_label_halo:"#ffffff",country_label:"#b8b8b8",address_label:"#adadad",address_label_halo:"#ffffff"},sm={background:"#a3a3a3",earth:"#cccccc",park_a:"#c2c2c2",park_b:"#c2c2c2",hospital:"#d0d0d0",industrial:"#c6c6c6",school:"#d0d0d0",wood_a:"#c2c2c2",wood_b:"#c2c2c2",pedestrian:"#c4c4c4",scrub_a:"#c2c2c2",scrub_b:"#c2c2c2",glacier:"#d2d2d2",sand:"#d2d2d2",beach:"#d2d2d2",aerodrome:"#c9c9c9",runway:"#f5f5f5",water:"#a3a3a3",zoo:"#c7c7c7",military:"#bfbfbf",tunnel_other_casing:"#b8b8b8",tunnel_minor_casing:"#b8b8b8",tunnel_link_casing:"#b8b8b8",tunnel_major_casing:"#b8b8b8",tunnel_highway_casing:"#b8b8b8",tunnel_other:"#d6d6d6",tunnel_minor:"#d6d6d6",tunnel_link:"#d6d6d6",tunnel_major:"#d6d6d6",tunnel_highway:"#d6d6d6",pier:"#b8b8b8",buildings:"#e0e0e0",minor_service_casing:"#cccccc",minor_casing:"#cccccc",link_casing:"#cccccc",major_casing_late:"#cccccc",highway_casing_late:"#cccccc",other:"#e0e0e0",minor_service:"#e0e0e0",minor_a:"#ebebeb",minor_b:"#e0e0e0",link:"#ebebeb",major_casing_early:"#cccccc",major:"#ebebeb",highway_casing_early:"#cccccc",highway:"#ebebeb",railway:"#f5f5f5",boundaries:"#5c5c5c",bridges_other_casing:"#cccccc",bridges_minor_casing:"#cccccc",bridges_link_casing:"#cccccc",bridges_major_casing:"#cccccc",bridges_highway_casing:"#cccccc",bridges_other:"#e0e0e0",bridges_minor:"#e0e0e0",bridges_link:"#ebebeb",bridges_major:"#ebebeb",bridges_highway:"#ebebeb",roads_label_minor:"#999999",roads_label_minor_halo:"#e0e0e0",roads_label_major:"#8f8f8f",roads_label_major_halo:"#ebebeb",ocean_label:"#7a7a7a",subplace_label:"#7a7a7a",subplace_label_halo:"#cccccc",city_label:"#474747",city_label_halo:"#cccccc",state_label:"#999999",state_label_halo:"#cccccc",country_label:"#858585",address_label:"#999999",address_label_halo:"#e0e0e0"},om={background:"#2b2b2b",earth:"#141414",park_a:"#181818",park_b:"#181818",hospital:"#1d1d1d",industrial:"#101010",school:"#111111",wood_a:"#1a1a1a",wood_b:"#1a1a1a",pedestrian:"#191919",scrub_a:"#1c1c1c",scrub_b:"#1c1c1c",glacier:"#191919",sand:"#161616",beach:"#1f1f1f",aerodrome:"#191919",runway:"#323232",water:"#333333",zoo:"#191919",military:"#121212",tunnel_other_casing:"#101010",tunnel_minor_casing:"#101010",tunnel_link_casing:"#101010",tunnel_major_casing:"#101010",tunnel_highway_casing:"#101010",tunnel_other:"#292929",tunnel_minor:"#292929",tunnel_link:"#292929",tunnel_major:"#292929",tunnel_highway:"#292929",pier:"#0a0a0a",buildings:"#0a0a0a",minor_service_casing:"#141414",minor_casing:"#141414",link_casing:"#141414",major_casing_late:"#141414",highway_casing_late:"#141414",other:"#1f1f1f",minor_service:"#1f1f1f",minor_a:"#292929",minor_b:"#1f1f1f",link:"#1f1f1f",major_casing_early:"#141414",major:"#292929",highway_casing_early:"#141414",highway:"#292929",railway:"#292929",boundaries:"#707070",bridges_other_casing:"#141414",bridges_minor_casing:"#141414",bridges_link_casing:"#141414",bridges_major_casing:"#141414",bridges_highway_casing:"#141414",bridges_other:"#1f1f1f",bridges_minor:"#1f1f1f",bridges_link:"#292929",bridges_major:"#292929",bridges_highway:"#292929",roads_label_minor:"#525252",roads_label_minor_halo:"#141414",roads_label_major:"#5c5c5c",roads_label_major_halo:"#141414",ocean_label:"#707070",subplace_label:"#5c5c5c",subplace_label_halo:"#141414",city_label:"#999999",city_label_halo:"#141414",state_label:"#3d3d3d",state_label_halo:"#141414",country_label:"#707070",address_label:"#525252",address_label_halo:"#141414"};function Wd(J){switch(J){case"light":return rm;case"dark":return nm;case"white":return am;case"grayscale":return sm;case"black":return om}throw new Error("Flavor not found")}dn(Wd,"namedFlavor");function Hd(J,H,pe){let ye=[];return pe!=null&&pe.labelsOnly||(ye=Gd(J,H)),pe!=null&&pe.lang&&(ye=ye.concat(qd(J,H,pe.lang))),ye}dn(Hd,"layers");function Xd(J){return J?Hf(J.landscape):!1}function Nd(J,H){var z,c,Ee,Bt,wt,Tt,Ze,ue,ar,Di,Hi,Ar,zt,Et,mi,qr,Xi,kr,pn,Wr,Mi,sr,Ri,or,Hr,vr;let pe;const ye={bold:"Overpass Bold",regular:"Overpass SemiBold",italic:"Overpass Italic"},Be=Xd(J);
5if(J&&"landscape"in J){const Ne="#00000000";pe={background:J.landscape,earth:J.landscape,park_a:J.landscape,park_b:J.park,hospital:J.landscape,industrial:J.landscape,school:J.landscape,wood_a:J.landscape,wood_b:J.landscape,pedestrian:J.landscape,scrub_a:J.landscape,scrub_b:J.landscape,glacier:J.landscape,sand:J.landscape,beach:J.landscape,aerodrome:J.landscape,runway:(z=J.roadLocal)!=null?z:Ne,water:J.water,zoo:J.landscape,military:J.landscape,tunnel_other_casing:(c=J.roadLocal)!=null?c:Ne,tunnel_minor_casing:(Ee=J.roadLocal)!=null?Ee:Ne,tunnel_link_casing:(Bt=J.roadLocal)!=null?Bt:Ne,tunnel_major_casing:(wt=J.roadLocal)!=null?wt:Ne,tunnel_highway_casing:(Tt=J.roadLocal)!=null?Tt:Ne,tunnel_other:(Ze=J.roadLocal)!=null?Ze:Ne,tunnel_minor:(ue=J.roadLocal)!=null?ue:Ne,tunnel_link:(ar=J.roadLocal)!=null?ar:Ne,tunnel_major:(Di=J.roadLocal)!=null?Di:Ne,tunnel_highway:(Hi=J.roadLocal)!=null?Hi:Ne,pier:J.landscape,buildings:J.landscape,minor_service_casing:(Ar=J.roadLocal)!=null?Ar:Ne,minor_casing:(zt=J.roadLocal)!=null?zt:Ne,link_casing:(Et=J.roadLocal)!=null?Et:Ne,major_casing_late:Ne,highway_casing_late:Ne,other:(mi=J.roadLocal)!=null?mi:Ne,minor_service:(qr=J.roadLocal)!=null?qr:Ne,minor_a:(Xi=J.roadLocal)!=null?Xi:Ne,minor_b:(kr=J.roadLocal)!=null?kr:Ne,link:(pn=J.roadLocal)!=null?pn:Ne,major_casing_early:Ne,major:J.roadHighway,highway_casing_early:Ne,highway:J.roadHighway,railway:(Wr=J.rails)!=null?Wr:J.roadHighway,boundaries:J.roadHighway,bridges_other_casing:Ne,bridges_minor_casing:Ne,bridges_link_casing:Ne,bridges_major_casing:Ne,bridges_highway_casing:Ne,bridges_other:(Mi=J.roadLocal)!=null?Mi:J.roadHighway,bridges_minor:(sr=J.roadLocal)!=null?sr:J.roadHighway,bridges_link:(Ri=J.roadLocal)!=null?Ri:J.roadHighway,bridges_major:(or=J.roadLocal)!=null?or:J.roadHighway,bridges_highway:J.roadHighway,roads_label_minor:(Hr=J.textLevel2)!=null?Hr:Ne,roads_label_minor_halo:J.landscape,roads_label_major:(vr=J.textLevel2)!=null?vr:Ne,roads_label_major_halo:J.landscape,ocean_label:J.textLevel1,subplace_label:J.textLevel1,subplace_label_halo:J.landscape,city_label:J.textLevel1,city_label_halo:J.landscape,state_label:J.textLevel1,state_label_halo:J.landscape,country_label:J.textLevel1,address_label:J.textLevel1,address_label_halo:J.landscape,pois:{blue:"#1A8CBD",green:"#20834D",lapis:"#315BCF",pink:"#EF56BA",red:"#F2567A",slategray:"#6A5B8F",tangerine:"#CB6704",turquoise:"#00C3D4"},landcover:{grassland:J==null?void 0:J.landscape,barren:J==null?void 0:J.landscape,urban_area:J==null?void 0:J.landscape,farmland:J==null?void 0:J.landscape,glacier:J==null?void 0:J.landscape,scrub:J==null?void 0:J.landscape,forest:J==null?void 0:J.landscape},...ye}}else pe={...Wd("light"),...ye};const Je={version:8,sprite:"https://maps.reboot.epixelic.com/sprites/"+(Be?"dark":"light"),glyphs:"https://maps.reboot.epixelic.com/tiles/font/{fontstack}/{range}",sources:{epx:{attribution:'<a href="https://openstreetmap.org" target="_blank" rel="nofollow" style="color: inherit">OpenStreetMap</a>',type:"vector",tiles:["https://maps.reboot.epixelic.com/tiles/planet/{z}/{x}/{y}"],maxzoom:15}},layers:Hd("epx",pe,{lang:H==null?void 0:H.code})};for(let Ne of Je.layers)Ne.type!=="background"&&Ne.source&&!Ne.source.startsWith("ext")&&!Ne.source.startsWith("custom")&&(Ne.source="epx"),Ne.id==="places_country"&&Ne.type==="symbol"&&Ne.layout&&"text-font"in Ne.layout&&(Ne.layout["text-font"]=["Noto Sans Bold"]),Ne.id==="pois"&&Ne.layout&&(Ne.layout.visibility="none"),Ne.id==="roads_rail"&&Ne.paint&&("line-opacity"in Ne.paint&&(Ne.paint["line-opacity"]=1),"line-dasharray"in Ne.paint&&(Ne.paint["line-dasharray"]=[.5,1.75]));return Je}class lm{constructor(){pt(this,"map");pt(this,"element",null);pt(this,"zoomElement",null);pt(this,"downloadButton",null);this.update=this.update.bind(this)}onAdd(H){this.map=H,this.element=document.createElement("div"),this.element.className="maplibre-ctrl",this.element.textContent="",this.downloadButton=document.createElement("a"),this.downloadButton.setAttribute("download","style.json"),this.downloadButton.href="#download",this.downloadButton.innerHTML="JSON",this.downloadButton.addEventListener("click",()=>{var Be;const ye=URL.createObjectURL(new Blob([JSON.stringify((Be=this.map)==null?void 0:Be.getStyle(),null,2)],{type:"application/json"}));this.downloadButton.href=ye,setTimeout(()=>URL.revokeObjectURL(ye),1500)}),this.downloadButton.style.pointerEvents="all";const pe=document.createElement("span");return pe.innerText=" | ",this.zoomElement=document.createElement("span"),this.element.appendChild(this.downloadButton),this.element.appendChild(pe),this.element.appendChild(this.zoomElement),this.element.style.background="var(--ml-c-bg-1)",this.element.style.color="var(--ml-c-icon-1)",this.element.style.padding="2px 8px",this.element.style.borderTopRightRadius="var(--border-radius)",this.element.style.boxShadow="var(--ml-shadow-ctrl)",this.map.on("zoom",this.update),this.map.on("zoomend",this.update),this.update(),this.element}onRemove(H){var pe,ye,Be;(pe=this.map)==null||pe.off("zoom",this.update),(ye=this.map)==null||ye.off("zoomend",this.update),this.map=void 0,(Be=this.element.parentNode)==null||Be.removeChild(this.element)}update(){var pe,ye;let H="";
5H="Zoom actuel : "+Math.round((ye=(pe=this.map)==null?void 0:pe.getZoom())!=null?ye:0),this.zoomElement.textContent=H}getDefaultPosition(){return"bottom-left"}}class cm{constructor(H){pt(this,"map");pt(this,"element",null);pt(this,"rebootMap");this.rebootMap=H,this.update=Xf(this.update.bind(this),50,{maxWait:150})}onAdd(H){this.map=H,this.element=document.createElement("div"),this.element.className="maplibregl-ctrl maplibregl-ctrl-group hidden",this.element.textContent="";const pe=document.createElement("button");pe.className="maplibregl-ctrl-reset",pe.type="button",pe.ariaLabel="Recentrer",pe.title="Recentrer";const ye=document.createElement("span");ye.className="maplibregl-ctrl-icon",ye.style.paddingTop="6px";const Be=document.createElementNS("http://www.w3.org/2000/svg","svg");return Be.setAttribute("viewBox","0 0 512 512"),Be.style.width="19px",Be.style.height="19px",Be.innerHTML='<path fill="currentColor" d="M256 0c17.7 0 32 14.3 32 32l0 34.7C368.4 80.1 431.9 143.6 445.3 224l34.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-34.7 0C431.9 368.4 368.4 431.9 288 445.3l0 34.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7C143.6 431.9 80.1 368.4 66.7 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l34.7 0C80.1 143.6 143.6 80.1 224 66.7L224 32c0-17.7 14.3-32 32-32zM128 256a128 128 0 1 0 256 0 128 128 0 1 0 -256 0zm128-80a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"/>',ye.appendChild(Be),pe.appendChild(ye),this.element.appendChild(pe),pe.addEventListener("click",()=>{this.rebootMap.recenter()}),this.map.on("zoom",this.update),this.map.on("move",this.update),this.map.on("rotate",this.update),this.map.on("pitch",this.update),this.map.on("zoomend",this.update),this.map.on("moveend",this.update),this.map.on("rotateend",this.update),this.map.on("pitchend",this.update),this.element}update(){this.element.classList.toggle("hidden",!this.rebootMap.isMoved())}onRemove(H){var pe,ye,Be,Je,z,c,Ee,Bt,wt;(pe=this.map)==null||pe.off("zoom",this.update),(ye=this.map)==null||ye.off("move",this.update),(Be=this.map)==null||Be.off("rotate",this.update),(Je=this.map)==null||Je.off("pitch",this.update),(z=this.map)==null||z.off("zoomend",this.update),(c=this.map)==null||c.off("moveend",this.update),(Ee=this.map)==null||Ee.off("rotateend",this.update),(Bt=this.map)==null||Bt.off("pitchend",this.update),this.map=void 0,(wt=this.element.parentNode)==null||wt.removeChild(this.element)}getDefaultPosition(){return"top-right"}}class hm{constructor(H,pe){pt(this,"markersLngLat");pt(this,"map");pt(this,"markerNodes");pt(this,"pauseAnimation",!1);pt(this,"enableAnimation",!1);pt(this,"addedCustomMarkers",[]);pt(this,"defaultZoom");pt(this,"simpleMarkers",[]);pt(this,"addedSimpleMarkers",[]);pt(this,"defaultPitch",20);pt(this,"autoZoomLevel",0);pt(this,"targetCenter",{lng:2.349014,lat:48.864716});pt(this,"visible",!1);var c,Ee,Bt,wt;this.mapElement=H,this.options=pe,this.simpleMarkers=(c=pe.simpleMarkers)!=null?c:[],this.markersLngLat=[],pe.markers?pe.markers.forEach(Tt=>{this.markersLngLat.push(new ki.LngLat(Number(Tt.dataset.lng),Number(Tt.dataset.lat)))}):pe.simpleMarkers&&pe.simpleMarkers.forEach(Tt=>{this.markersLngLat.push(new ki.LngLat(Tt.lng,Tt.lat))}),this.defaultPitch=20,this.defaultZoom=(Ee=pe.zoom)!=null?Ee:11,(Bt=pe.language)!=null&&Bt.rtl&&ki.setRTLTextPlugin("https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-rtl-text.js",!0),this.computeCenter();const ye={container:H,style:Nd(this.options.style,this.options.language),center:this.targetCenter,zoom:(wt=pe.zoom)!=null?wt:11,cooperativeGestures:!0,scrollZoom:!1,bearing:0,pitch:this.defaultPitch,maxPitch:80,locale:this.options.localeStrings,attributionControl:{compact:!1,customAttribution:""}};pe.adminControls&&(ye.scrollZoom=!0,ye.cooperativeGestures=!1);const Be=new ki.Map(ye);this.map=Be,this.markerNodes=pe.markers;const Je=new ki.GlobeControl;this.createCompass(),nu.addToMap(Be);const z=new ki.FullscreenControl;z.on("fullscreenstart",()=>{this.map.scrollZoom.enable(),this.map.cooperativeGestures.disable(),this.map.addControl(Je,"bottom-left")}),z.on("fullscreenend",()=>{this.map.scrollZoom.disable(),this.map.cooperativeGestures.enable(),this.map.removeControl(Je)}),Be.addControl(z),Be.addControl(new cm(this)),Be.on("load",()=>{var Ze,ue;const Tt=(ue=(Ze=this.options.style)==null?void 0:Ze.landscape)!=null?ue:"rgb(255,255,255)";Be.setSky({"sky-color":Tt,"horizon-color":Tt,"fog-color":Tt,"sky-horizon-blend":1,"horizon-fog-blend":0,"fog-ground-blend":0}),this.startAnimation(),this.addMarkers(),this.autoZoom()}),this.options.animationWrapper&&(this.visible=!1,Be.on("sourcedata",Tt=>
5{Tt.isSourceLoaded&&this.animateBlockWhenVisible()}),setTimeout(()=>{this.visible||this.animateBlockWhenVisible()},2e3)),Be.on("resize",()=>this.autoZoom()),pe.adminControls&&Be.addControl(new lm,"bottom-left"),this.setCssVars()}animateBlockWhenVisible(){if(!this.options.animationWrapper)return;MutationObserver||(this.visible=!0);const H=()=>{this.options.animationWrapper.classList.add("zoomOut"),Object.assign(this.options.animationWrapper.style,{animationDuration:"0.4s",animationDelay:"0s",visibility:null}),this.visible=!0,this.options.animationWrapper.classList.remove("start-animation")};if(this.options.animationWrapper.classList.contains("start-animation"))H();else{const pe=new MutationObserver(ye=>{ye.some(Be=>Be.type==="attributes"&&Be.attributeName==="class"&&this.options.animationWrapper.classList.contains("start-animation"))&&(H(),pe.disconnect())});pe.observe(this.options.animationWrapper,{attributes:!0,attributeFilter:["class"]})}}setCssVars(){var pe,ye;this.mapElement.style.setProperty("--ml-font-attribution","8px/14px 'Helvetica Neue', Arial, Helvetica, sans-serif"),(pe=this.options.style)!=null&&pe.landscape&&((ye=this.options.style)!=null&&ye.text)?(this.mapElement.style.setProperty("--reboot-map-landscape",this.options.style.landscape),this.mapElement.style.setProperty("--reboot-map-text",this.options.style.text),this.mapElement.style.setProperty("--ml-c-bg-1","var(--reboot-map-landscape, white)"),this.mapElement.style.setProperty("--ml-c-bg-2","var(--reboot-map-landscape, #f0f0f0)"),this.mapElement.style.setProperty("--ml-c-bg-3","rgba(0, 0, 0, 0.2)"),this.mapElement.style.setProperty("--ml-c-icon-1","var(--reboot-map-text, #333333)"),this.mapElement.style.setProperty("--ml-c-icon-2","var(--reboot-map-text, black)"),this.options.adminControls&&(this.mapElement.style.setProperty("--link--color","var(--reboot-map-text, black)"),this.mapElement.style.setProperty("--link--color--highlight","var(--reboot-map-text, black)"))):this.options.style||(this.mapElement.style.setProperty("--reboot-map-landscape","white"),this.mapElement.style.setProperty("--reboot-map-text","#333333"),this.mapElement.style.setProperty("--ml-c-bg-1","white"),this.mapElement.style.setProperty("--ml-c-bg-2","#f0f0f0"),this.mapElement.style.setProperty("--ml-c-bg-3","rgba(0, 0, 0, 0.2)"),this.mapElement.style.setProperty("--ml-c-icon-1","#333333"),this.mapElement.style.setProperty("--ml-c-icon-2","black"),this.options.adminControls&&(this.mapElement.style.setProperty("--link--color","#333333"),this.mapElement.style.setProperty("--link--color--highlight","#333333"))),Xd(this.options.style)?this.map.getContainer().style.setProperty("--ml-c-bg-3","rgba(255,255,255, 0.1)"):this.map.getContainer().style.setProperty("--ml-c-bg-3","rgba(0, 0, 0, 0.15)")}createCompass(){const H=new ki.NavigationControl({showCompass:!0});H._compass.classList.add("hidden"),this.map.addControl(H),this.map.on("rotateend",()=>{const pe=this.map.getBearing();H._compass.classList.toggle("hidden",pe>-1&&pe<1)})}startAnimation(){if(!this.enableAnimation)return;let H,pe=null,ye=0;const Be=1e3/20,Je=z=>{if(this.pauseAnimation){H=requestAnimationFrame(Je);return}if(z-ye<Be){H=requestAnimationFrame(Je);return}ye=z,pe===null&&(pe=z);const c=(z-pe)/1e3,Ee=Math.sin(Ud(c*10))*5-2.5;this.map.setBearing(Ee);const Bt=40+Math.cos(Ud(c*10))*10;this.map.setPitch(Bt),H=requestAnimationFrame(Je)};H=requestAnimationFrame(Je),window.addEventListener("beforeunload",()=>{cancelAnimationFrame(H)}),this.mapElement.closest("section")}computeCenter(){if(this.markersLngLat.length===0)return new ki.LngLat(2.349014,48.864716);let H=0,pe=0;this.markersLngLat.forEach(ye=>{H+=ye.lat,pe+=ye.lng}),H/=this.markersLngLat.length,pe/=this.markersLngLat.length,this.targetCenter=new ki.LngLat(pe,H)}autoZoom(){if(this.autoZoomLevel=this.defaultZoom,this.markersLngLat.length<=1){this.map.setZoom(this.defaultZoom);return}const H=new ki.LngLatBounds;this.markersLngLat.forEach(Je=>{H.extend(new ki.LngLat(Number(Je.lng),Number(Je.lat)))});const pe=this.map.getContainer(),Be=(pe.clientWidth>pe.clientHeight?pe.clientHeight:pe.clientWidth)*.3;this.map.once("zoomend",()=>{this.autoZoomLevel=this.map.getZoom()}),this.options.zoom?(this.map.fitBounds(H,{padding:Be,zoom:this.options.zoom,maxDuration:500}),this.autoZoomLevel=this.options.zoom):(this.map.fitBounds(H,{padding:Be,maxZoom:this.defaultZoom,maxDuration:500}),this.autoZoomLevel=this.map.getZoom())}addMarkers(){var ye,Be;
5this.addedCustomMarkers.forEach(Je=>Je.remove()),this.addedCustomMarkers=[],(ye=this.markerNodes)==null||ye.forEach(Je=>{const z=new em({map:this.map,markerTemplate:Je});this.addedCustomMarkers.push(z)}),this.addedSimpleMarkers.forEach(Je=>Je.remove()),this.addedSimpleMarkers=[],(Be=this.simpleMarkers)==null||Be.forEach(Je=>{const z=new ki.Marker({color:Je.color});z.setLngLat(Je),z.addTo(this.map),this.addedSimpleMarkers.push(z)});const H=[...this.addedCustomMarkers.map(Je=>Je.getMarker()),...this.addedSimpleMarkers];H.sort((Je,z)=>Je.getLngLat().lat>z.getLngLat().lat?-1:1);let pe=1;for(const Je of H)Je.getElement().style.zIndex="".concat(pe++)}setSimpleMarkers(H){this.options.simpleMarkers=H,this.simpleMarkers=H,this.addMarkers()}setZoom(H){if(this.options.zoom=H,H===void 0){this.autoZoom();return}this.autoZoomLevel=H,this.map.easeTo({center:this.targetCenter,zoom:H!=null?H:this.defaultZoom})}updateStyle(H){this.options.style=H,this.setCssVars(),this.map.setStyle(Nd(H,this.options.language))}recenter(){var H;this.map.easeTo({center:this.targetCenter,zoom:(H=this.options.zoom)!=null?H:this.defaultZoom,bearing:0,pitch:this.defaultPitch})}isMoved(){if(Math.abs(this.autoZoomLevel-this.map.getZoom())>.1||Math.abs(this.map.getBearing())>1||Math.abs(this.defaultPitch-this.map.getPitch())>1)return!0;const H=this.targetCenter,pe=this.map.getCenter();return Math.abs(H.lng-pe.lng)>.1||Math.abs(H.lat-pe.lat)>.1}}function Ud(J){return J*(Math.PI/180)}class pm extends Yf{async init(){var Be,Je,z;const H=this.sectionElement.querySelectorAll(".map-markers .map-marker"),pe=this.sectionElement.querySelector(".map-container");if(!pe){console.error("Google Maps element could not be found, aborting map init.");return}let ye;pe.dataset.zoom&&(ye=Number(pe.dataset.zoom)),await new Promise(c=>requestAnimationFrame(()=>{requestAnimationFrame(c)})),new hm(pe,{markers:H,style:JSON.parse((Be=pe.dataset.mapStyle)!=null?Be:"null"),language:{code:this.page.context.locale,rtl:this.page.context.rtl},localeStrings:JSON.parse((Je=pe.dataset.locale)!=null?Je:"{}"),zoom:ye,animationWrapper:(z=this.sectionElement.querySelector(".map-wrapper"))!=null?z:void 0})}}export{pm as MapSection};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.