PageSourceSearch

https://dh.group/assets/mapbox-gl-2026060314-014.js

js dh.group collected 2026-10-05 22:59:19 UTC 987,170 bytes, 1,318 lines download raw bytes

1var fg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mg(Ui){return Ui&&Ui.__esModule&&Object.prototype.hasOwnProperty.call(Ui,"default")?Ui.default:Ui}function gg(Ui){if(Ui.__esModule)return Ui;var va=Ui.default;if(typeof va=="function"){var yr=function xr(){return this instanceof xr?Reflect.construct(va,arguments,this.constructor):va.apply(this,arguments)};yr.prototype=va.prototype}else yr={};return Object.defineProperty(yr,"__esModule",{value:!0}),Object.keys(Ui).forEach(function(xr){var ms=Object.getOwnPropertyDescriptor(Ui,xr);Object.defineProperty(yr,xr,ms.get?ms:{enumerable:!0,get:function(){return Ui[xr]}})}),yr}var Of={exports:{}};(function(Ui,va){(function(yr,xr){Ui.exports=xr()})(fg,function(){var yr,xr,ms;function Mh(a,Se){if(!yr)yr=Se;else if(!xr)xr=Se;else{var vr="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+yr+")(sharedChunk); ("+xr+")(sharedChunk); self.onerror = null;",Yi={};yr(Yi),ms=Se(Yi),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(ms.workerUrl=window.URL.createObjectURL(new Blob([vr],{type:"text/javascript"})))}}Mh(["exports"],function(a){var Se=typeof self<"u"?self:{},vr="2.15.0";let Yi;const it={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(Yi==null){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{Yi={}.API_URL_REGEX!=null?new RegExp({}.API_URL_REGEX):t}catch{Yi=t}}return Yi},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!it.API_URL)return null;try{const t=new URL(it.API_URL);return t.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":t.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ht={supported:!1,testSupport:function(t){!br&&Si&&(wr?bo(t):gi=t)}};let gi,Si,br=!1,wr=!1;function bo(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Si),t.isContextLost())return;ht.supported=!0}
1catch{}t.deleteTexture(e),br=!0}Se.document&&(Si=Se.document.createElement("img"),Si.onload=function(){gi&&bo(gi),gi=null,wr=!0},Si.onerror=function(){br=!0,gi=null},Si.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Ln="01";function Ji(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Rn=Qi;function Qi(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}Qi.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,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)<e)return i;var c=this.sampleCurveDerivativeX(i);if(Math.abs(c)<1e-6)break;i-=s/c}var u=0,p=1;for(i=t,n=0;n<20&&(s=this.sampleCurveX(i),!(Math.abs(s-t)<e));n++)t>s?u=i:p=i,i=.5*(p-u)+u;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var cn=Ji(Rn),hn=er;function er(t,e){this.x=t,this.y=e}er.prototype={clone:function(){return new er(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),s=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},er.convert=function(t){return t instanceof er?t:Array.isArray(t)?new er(t[0],t[1]):t};var Le=Ji(hn);const ba=Math.PI/180,wa=180/Math.PI;function dt(t){return t*ba}function si(t){return t*wa}const Ta=[[0,0],[1,0],[1,1],[0,1]];function _s(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function wo(t,e,i,n){const s=new cn(t,e,i,n);return function(c){return s.solve(c)}}const gs=wo(.25,.1,.25,1);function ct(t,e,i){return Math.min(i,Math.max(e,t))}function Bn(t,e,i){return(i=ct((i-t)/(e-t),0,1))*i*(3-2*i)}function oi(t,e,i){const n=i-e,s=((t-e)%n+n)%n+e;return s===e?i:s}function ai(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const s=new Array(t.length);let c=null;t.forEach((u,p)=>{e(u,(m,_)=>{m&&(c=m),s[p]=_,--n==0&&i(c,s)})})}function Zr(t){const e=[];for(const i in t)e.push(t[i]);return e}function Wt(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}let qr=1;function On(){return qr++}function Wr(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function Tr(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function ys(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function un(t,e){t.forEach(i=>
1{e[i]&&(e[i]=e[i].bind(e))})}function Fn(t,e){return t.indexOf(e,t.length-e.length)!==-1}function pt(t,e,i){const n={};for(const s in t)n[s]=e.call(i||this,t[s],s,t);return n}function Un(t,e,i){const n={};for(const s in t)e.call(i||this,t[s],s,t)&&(n[s]=t[s]);return n}function Li(t){return Array.isArray(t)?t.map(Li):typeof t=="object"&&t?pt(t,Li):t}const To={};function Ut(t){To[t]||(typeof console<"u"&&console.warn(t),To[t]=!0)}function Vi(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function xs(t){let e=0;for(let i,n,s=0,c=t.length,u=c-1;s<c;u=s++)i=t[s],n=t[u],e+=(n.x-i.x)*(i.y+n.y);return e}function Er(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Ri(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,s,c)=>{const u=s||c;return e[n]=!u||u.toLowerCase(),""}),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}let Eo=null;function Vn(t){if(Eo==null){const e=t.navigator?t.navigator.userAgent:null;Eo=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Eo}function So(t){try{const e=Se[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}function Xr(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const Nn="mapbox-tiles";let vs=500,bs=50,Ni,Hr;function Mo(){try{return Se.caches}catch{}}function dn(){Mo()&&!Ni&&(Ni=Se.caches.open(Nn))}function jn(t){const e=t.indexOf("?");if(e<0)return t;const i=function(s){const c=s.indexOf("?");return c>0?s.slice(c+1).split("&"):[]}(t),n=i.filter(s=>{const c=s.split("=");return c[0]==="language"||c[0]==="worldview"});return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let Ao=1/0;const pn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(pn);class Kr extends Error{constructor(e,i,n){i===401&&ne(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=i,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const fn=Er()?()=>self.worker&&self.worker.referrer:()=>(Se.location.protocol==="blob:"?Se.parent:Se).location.href,mn=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(fn())&&!/^\w+:/.test(i))){if(Se.fetch&&Se.Request&&Se.AbortController&&Se.Request.prototype.hasOwnProperty("signal"))return function(n,s){const c=new Se.AbortController,u=new Se.Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,referrer:fn(),referrerPolicy:n.referrerPolicy,signal:c.signal});let p=!1,m=!1;const _=(x=u.url).indexOf("sku=")>0&&ne(x);var x;n.type==="json"&&u.headers.set("Accept","application/json");const b=(S,M,C)=>{if(m)return;if(S&&S.message!=="SecurityError"&&Ut(S.toString()),M&&C)return w(M);const D=Date.now();Se.fetch(u).then(U=>{if(U.ok){const q=_?U.clone():null;return w(U,q,D)}return s(new Kr(U.statusText,U.status,n.url))}).catch(U=>{U.name!=="AbortError"&&s(new Error(`${U.message} ${n.url}`))})},w=(S,M,C)=>{(n.type==="arrayBuffer"?S.arrayBuffer():n.type==="json"?S.json():S.text()).then(D=>{m||(M&&C&&function(U,q,V){if(dn(),!Ni)return;const $={status:q.status,statusText:q.statusText,headers:new Se.Headers};q.headers.forEach((ce,se)=>$.headers.set(se,ce));const X=Ri(q.headers.get("Cache-Control")||"");if(X["no-store"])return;X["max-age"]&&$.headers.set("Expires",new Date(V+1e3*X["max-age"]).toUTCString());const W=$.headers.get("Expires");W&&(new Date(W).getTime()-V<42e4||function(ce,se){if(Hr===void 0)try{new Response(new ReadableStream),Hr=!0}catch{Hr=!1}Hr?se(ce.body):ce.blob().then(se)}(q,ce=>{const se=new Se.Response(ce,$);dn(),Ni&&Ni.then(me=>me.put(jn(U.url),se)).catch(me=>Ut(me.message))}))}(u,M,C),p=!0,s(null,D,S.headers.get("Cache-Control"),S.headers.get("Expires")))}).catch(D=>{m||s(new Error(D.message))})};return _?function(S,M){if(dn(),!Ni)return M(null);const C=jn(S.url);Ni.then(D=>{D.match(C).then(U=>{const q=function(V){if(!V)return!1;const $=new Date(V.headers.get("Expires")||0),X=Ri(V.headers.get("Cache-Control")||"");return $>
1Date.now()&&!X["no-cache"]}(U);D.delete(C),q&&D.put(C,U.clone()),M(null,U,q)}).catch(M)}).catch(M)}(u,b):b(null,null),{cancel:()=>{m=!0,p||c.abort()}}}(t,e);if(Er()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(n,s){const c=new Se.XMLHttpRequest;c.open(n.method||"GET",n.url,!0),n.type==="arrayBuffer"&&(c.responseType="arraybuffer");for(const u in n.headers)c.setRequestHeader(u,n.headers[u]);return n.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=n.credentials==="include",c.onerror=()=>{s(new Error(c.statusText))},c.onload=()=>{if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){let u=c.response;if(n.type==="json")try{u=JSON.parse(c.response)}catch(p){return s(p)}s(null,u,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else s(new Kr(c.statusText,c.status,n.url))},c.send(n.body),{cancel:()=>c.abort()}}(t,e)},Gn=function(t,e){return mn(Wt(t,{type:"arrayBuffer"}),e)};function ws(t){const e=Se.document.createElement("a");return e.href=t,e.protocol===Se.document.location.protocol&&e.host===Se.document.location.host}const Z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let z,P;z=[],P=0;const G=function(t,e){if(ht.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),P>=it.MAX_PARALLEL_IMAGE_REQUESTS){const c={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return z.push(c),c}P++;let i=!1;const n=()=>
1{if(!i)for(i=!0,P--;z.length&&P<it.MAX_PARALLEL_IMAGE_REQUESTS;){const c=z.shift(),{requestParameters:u,callback:p,cancelled:m}=c;m||(c.cancel=G(u,p).cancel)}},s=Gn(t,(c,u,p,m)=>{n(),c?e(c):u&&(Se.createImageBitmap?function(_,x){const b=new Se.Blob([new Uint8Array(_)],{type:"image/png"});Se.createImageBitmap(b).then(w=>{x(null,w)}).catch(w=>{x(new Error(`Could not load image because of ${w.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(u,(_,x)=>e(_,x,p,m)):function(_,x){const b=new Se.Image,w=Se.URL;b.onload=()=>{x(null,b),w.revokeObjectURL(b.src),b.onload=null,Se.requestAnimationFrame(()=>{b.src=Z})},b.onerror=()=>x(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 S=new Se.Blob([new Uint8Array(_)],{type:"image/png"});b.src=_.byteLength?w.createObjectURL(S):Z}(u,(_,x)=>e(_,x,p,m)))});return{cancel:()=>{s.cancel(),n()}}},H="NO_ACCESS_TOKEN";function ee(t){return t.indexOf("mapbox:")===0}function ne(t){return it.API_URL_REGEX.test(t)}function re(t){return it.API_CDN_URL_REGEX.test(t)}function Q(t){return it.API_STYLE_REGEX.test(t)&&!de(t)}function de(t){return it.API_SPRITE_REGEX.test(t)}const Pe=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ke(t){const e=t.match(Pe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Ie(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const Je="mapbox.eventData";function rt(t){if(!t)return null;const e=t.split(".");if(!e||e.length!==3)return null;try{return JSON.parse(decodeURIComponent(Se.atob(e[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class Qe{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const i=rt(it.ACCESS_TOKEN);let n="";return n=i&&i.u?Se.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(s,c)=>String.fromCharCode(+("0x"+c)))):it.ACCESS_TOKEN||"",e?`${Je}.${e}:${n}`:`${Je}:${n}`}fetchEventData(){const e=So("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{const s=Se.localStorage.getItem(i);s&&(this.eventData=JSON.parse(s));const c=Se.localStorage.getItem(n);c&&(this.anonId=c)}catch{Ut("Unable to read from LocalStorage")}}saveEventData(){const e=So("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(e)try{Se.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&Se.localStorage.setItem(i,JSON.stringify(this.eventData))}catch{Ut("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,i,n,s){if(!it.EVENTS_URL)return;const c=ke(it.EVENTS_URL);c.params.push(`access_token=${s||it.ACCESS_TOKEN||""}`);const u={event:this.type,created:new Date(e).toISOString()},p=i?Wt(u,i):u,m={url:Ie(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=function(_,x){return mn(Wt(_,{method:"POST"}),x)}(m,_=>{this.pendingRequest=null,n(_),this.saveEventData(),this.processRequests(s)})}queueRequest(e,i){this.queue.push(e),this.processRequests(i)}}const nt=new class extends Qe{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){it.EVENTS_URL&&it.ACCESS_TOKEN&&Array.isArray(t)&&t.some(i=>ee(i)||ne(i))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=rt(it.ACCESS_TOKEN),i=e?e.u:it.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;ys(this.anonId)||(this.anonId=Wr(),n=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const c=new Date(this.eventData.lastSuccess),u=new Date(s),p=(s-this.eventData.lastSuccess)/864e5;n=n||p>=1||p<-1||c.getDate()!==u.getDate()}else n=!0;n?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:vr,skuId:Ln,"enabled.telemetry":!1,userId:this.anonId},c=>{c||(this.eventData.lastSuccess=s,this.eventData.tokenU=i)},t):this.processRequests()}},ft=nt.postTurnstileEvent.bind(nt),Vt=new class extends Qe{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,it.EVENTS_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),ys(this.anonId)||(this.anonId=Wr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:vr,skuId:Ln,skuToken:this.skuToken,userId:this.anonId},n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t))}},Xt=Vt.postMapLoadEvent.bind(Vt),yi=new class extends Qe{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){it.EVENTS_URL&&(t||it.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:e,performanceData:i}=this.queue.shift(),n=function(s){const c=Se.performance.getEntriesByType("resource"),u=Se.performance.getEntriesByType("mark"),p=function(w){const S={};if(w){for(const M in w)if(M!=="other")for(const C of w[M]){const D=`${M}ResolveRangeMin`,U=`${M}ResolveRangeMax`,q=`${M}
1RequestCount`,V=`${M}RequestCachedCount`;S[D]=Math.min(S[D]||1/0,C.startTime),S[U]=Math.max(S[U]||-1/0,C.responseEnd);const $=X=>{S[X]===void 0&&(S[X]=0),++S[X]};C.transferSize!==void 0&&C.transferSize===0&&$(V),$(q)}}return S}(function(w,S){const M={};if(w)for(const C of w){const D=S(C);M[D]===void 0&&(M[D]=[]),M[D].push(C)}return M}(c,tc)),m=Se.devicePixelRatio,_=Se.navigator.connection||Se.navigator.mozConnection||Se.navigator.webkitConnection,x={counters:[],metadata:[],attributes:[]},b=(w,S,M)=>{M!=null&&w.push({name:S,value:M.toString()})};for(const w in p)b(x.counters,w,p[w]);if(s.interactionRange[0]!==1/0&&s.interactionRange[1]!==-1/0&&(b(x.counters,"interactionRangeMin",s.interactionRange[0]),b(x.counters,"interactionRangeMax",s.interactionRange[1])),u)for(const w of Object.keys($n)){const S=$n[w],M=u.find(C=>C.name===S);M&&b(x.counters,S,M.startTime)}return b(x.counters,"visibilityHidden",s.visibilityHidden),b(x.attributes,"style",function(w){if(w)for(const S of w){const M=S.name.split("?")[0];if(Q(M)){const C=M.split("/").slice(-2);if(C.length===2)return`mapbox://styles/${C[0]}/${C[1]}`}}}(c)),b(x.attributes,"terrainEnabled",s.terrainEnabled?"true":"false"),b(x.attributes,"fogEnabled",s.fogEnabled?"true":"false"),b(x.attributes,"projection",s.projection),b(x.attributes,"zoom",s.zoom),b(x.metadata,"devicePixelRatio",m),b(x.metadata,"connectionEffectiveType",_?_.effectiveType:void 0),b(x.metadata,"navigatorUserAgent",Se.navigator.userAgent),b(x.metadata,"screenWidth",Se.screen.width),b(x.metadata,"screenHeight",Se.screen.height),b(x.metadata,"windowWidth",Se.innerWidth),b(x.metadata,"windowHeight",Se.innerHeight),b(x.metadata,"mapWidth",s.width/m),b(x.metadata,"mapHeight",s.height/m),b(x.metadata,"webglRenderer",s.renderer),b(x.metadata,"webglVendor",s.vendor),b(x.metadata,"sdkVersion",vr),b(x.metadata,"sdkIdentifier","mapbox-gl-js"),x}(i);for(const s of n.metadata);for(const s of n.counters);for(const s of n.attributes);this.postEvent(e,n,()=>{},t)}},ri=yi.postPerformanceEvent.bind(yi),ar=new class extends Qe{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!it.API_URL||!it.SESSION_PATH)return;const s=ke(it.API_URL+it.SESSION_PATH);s.params.push(`sku=${e||""}`),s.params.push(`access_token=${n||it.ACCESS_TOKEN||""}`);const c={url:Ie(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(u,p){return mn(Wt(u,{method:"GET"}),p)}(c,u=>{this.pendingRequest=null,i(u),this.saveEventData(),this.processRequests(n)})}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,it.SESSION_PATH&&it.API_URL&&(i||it.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(H)))}processRequests(t){if(this.pendingRequest||this.queue.length===0)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,n=>{n?this.errorCb(n):e&&(this.success[e]=!0)},t)}},li=ar.getSessionAPI.bind(ar),Ti=new Set,$n={create:"create",load:"load",fullLoad:"fullLoad"},Ah={mark(t){Se.performance.mark(t)},measure(t,e,i){Se.performance.measure(t,e,i)}};function tc(t){const e=t.name.split("?")[0];return re(e)&&e.includes("mapbox-gl.js")?"javascript":re(e)&&e.includes("mapbox-gl.css")?"css":function(i){return it.API_FONTS_REGEX.test(i)}(e)?"fontRange":de(e)?"sprite":Q(e)?"style":function(i){return it.API_TILEJSON_REGEX.test(i)}(e)?"tilejson":"other"}const vt=Se.performance;function Ea(t){const e=t?t.url.toString():void 0;return vt.getEntriesByName(e)}let Io,Sa,Ts,lr;const Sr={now:()=>Ts!==void 0?Ts:Se.performance.now(),setNow(t){Ts=t},restoreNow(){Ts=void 0},frame(t){const e=Se.requestAnimationFrame(t);return{cancel:()=>Se.cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:i,height:n}=t;lr||(lr=Se.document.createElement("canvas"));const s=lr.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return(i>lr.width||n>lr.height)&&(lr.width=i,lr.height=n),s.clearRect(-e,-e,i+2*e,n+2*e),s.drawImage(t,0,0,i,n),s.getImageData(-e,-e,i+2*e,n+2*e)},resolveURL:t=>(Io||(Io=Se.document.createElement("a")),Io.href=t,Io.href),get devicePixelRatio(){return Se.devicePixelRatio},get prefersReducedMotion(){return!!Se.matchMedia&&(Sa==null&&(Sa=Se.matchMedia("(prefers-reduced-motion: reduce)")),Sa.matches)}};function Ma(t,e,i){i[t]&&i[t].indexOf(e)!==-1||(i[t]=i[t]||[],i[t].push(e))}
vendor: 4,219 bytes, line 1
1function Aa(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);n!==-1&&i[t].splice(n,1)}}class _n{constructor(e,i={}){Wt(this,i),this.type=e}}class Mr extends _n{constructor(e,i={}){super("error",Wt({error:e},i))}}class Co{on(e,i){return this._listeners=this._listeners||{},Ma(e,i,this._listeners),this}off(e,i){return Aa(e,i,this._listeners),Aa(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Ma(e,i,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,i){typeof e=="string"&&(e=new _n(e,i||{}));const n=e.type;if(this.listens(n)){e.target=this;const s=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const p of s)p.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const p of c)Aa(n,p,this._oneTimeListeners),p.call(this,e);const u=this._eventedParent;u&&(Wt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Mr&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var fe=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
1,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"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"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1
vendor: 16,128 bytes, line 1
1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":
vendor: 17,203 bytes, line 1
1false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"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"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Ar(t,...e){for(const i of e)for(const n in i)t[n]=i[n];return t}function Ht(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ci(t){if(Array.isArray(t))return t.map(ci);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ci(t[i]);return e}return Ht(t)}
vendor: 14,458 bytes, line 1
1class ic extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}var cr=ic;class Ia{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[n,s]of i)this.bindings[n]=s}concat(e){return new Ia(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var rc=Ia;const Zn={kind:"null"},Oe={kind:"number"},ut={kind:"string"},st={kind:"boolean"},Bi={kind:"color"},tr={kind:"object"},at={kind:"value"},Oi={kind:"collator"},zo={kind:"formatted"},gn={kind:"resolvedImage"};function ji(t,e){return{kind:"array",itemType:t,N:e}}function Ot(t){if(t.kind==="array"){const e=Ot(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}const nc=[Zn,Oe,ut,st,Bi,zo,tr,ji(at),gn];function Ir(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ir(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(const i of nc)if(!Ir(i,e))return null}}return`Expected ${Ot(t)} but found ${Ot(e)} instead.`}function Po(t,e){return e.some(i=>i.kind===t.kind)}function ko(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}var Ca,oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Do(t){return(t=Math.round(t))<0?0:t>255?255:t}function Lo(t){return Do(t[t.length-1]==="%"?parseFloat(t)/100*255:parseInt(t))}function Es(t){return(e=t[t.length-1]==="%"?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function qn(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Ca={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in oc)return oc[i].slice();if(i[0]==="#")return i.length===4?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:i.length===7&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),s=i.indexOf(")");if(n!==-1&&s+1===i.length){var c=i.substr(0,n),u=i.substr(n+1,s-(n+1)).split(","),p=1;switch(c){case"rgba":if(u.length!==4)return null;p=Es(u.pop());case"rgb":return u.length!==3?null:[Lo(u[0]),Lo(u[1]),Lo(u[2]),p];case"hsla":if(u.length!==4)return null;p=Es(u.pop());case"hsl":if(u.length!==3)return null;var m=(parseFloat(u[0])%360+360)%360/360,_=Es(u[1]),x=Es(u[2]),b=x<=.5?x*(_+1):x+_-x*_,w=2*x-b;return[Do(255*qn(w,b,m+1/3)),Do(255*qn(w,b,m)),Do(255*qn(w,b,m-1/3)),p];default:return null}}return null}}catch{}class Mi{constructor(e,i,n,s=1){this.r=e,this.g=i,this.b=n,this.a=s}static parse(e){if(!e)return;if(e instanceof Mi)return e;if(typeof e!="string")return;const i=Ca(e);return i?new Mi(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,i,n,s]=this.toArray();return`rgba(${Math.round(e)},${Math.round(i)},${Math.round(n)},${s})`}toArray(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[255*e/s,255*i/s,255*n/s,s]}toArray01(){const{r:e,g:i,b:n,a:s}=this;return s===0?[0,0,0,0]:[e/s,i/s,n/s,s]}toArray01PremultipliedAlpha(){const{r:e,g:i,b:n,a:s}=this;return[e,i,n,s]}}Mi.black=new Mi(0,0,0,1),Mi.white=new Mi(1,1,1,1),Mi.transparent=new Mi(0,0,0,0),Mi.red=new Mi(1,0,0,1),Mi.blue=new Mi(0,0,1,1);var Zt=Mi;class za{constructor(e,i,n){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pa{constructor(e,i,n,s,c){this.text=e.normalize?e.normalize():e,this.image=i,this.scale=n,this.fontStack=s,this.textColor=c}}class Ai{constructor(e){this.sections=e}static fromString(e){return new Ai([new Pa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ai?e:Ai.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const i of this.sections){if(i.image){e.push(["image",i.image.name]);continue}e.push(i.text);const n={};i.fontStack&&(n["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(n["font-scale"]=i.scale),i.textColor&&(n["text-color"]=["rgba"].concat(i.textColor.toArray())),e.push(n)}return e}}class Gi{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Gi({name:e,available:!1}):null}serialize(){return["image",this.name]}}function sc(t,e,i,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?n===void 0||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ro(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Zt||t instanceof za||t instanceof Ai||t instanceof Gi)return!0;if(Array.isArray(t)){for(const e of t)if(!Ro(e))return!1;return!0}if(typeof t=="object"){for(const e in t)if(!Ro(t[e]))return!1;return!0}return!1}function Gt(t){if(t===null)return Zn;if(typeof t=="string")return ut;if(typeof t=="boolean")return st;if(typeof t=="number")return Oe;if(t instanceof Zt)return Bi;if(t instanceof za)return Oi;if(t instanceof Ai)return zo;if(t instanceof Gi)return gn;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const s=Gt(n);if(i){if(i===s)continue;i=at;break}i=s}return ji(i||at,e)}return tr}function Bo(t){const e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Zt||t instanceof Ai||t instanceof Gi?t.toString():JSON.stringify(t)}class ka{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ro(e[1]))return i.error("invalid value");const n=e[1];let s=Gt(n);const c=i.expectedType;return s.kind!=="array"||s.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(s=c),new ka(s,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Zt?["rgba"].concat(this.value.toArray()):this.value instanceof Ai?this.value.serialize():this.value}}var yn=ka,fi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Da={string:ut,number:Oe,boolean:st,object:tr};class La{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let n,s=1;const c=e[0];if(c==="array"){let p,m;if(e.length>2){const _=e[1];if(typeof _!="string"||!(_ in Da)||_==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);p=Da[_],s++}else p=at;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);m=e[2],s++}n=ji(p,m)}else n=Da[c];const u=[];for(;s<e.length;s++){const p=i.parse(e[s],s,at);if(!p)return null;u.push(p)}return new La(n,u)}evaluate(e){for(let i=0;i<this.args.length;i++){const n=this.args[i].evaluate(e);if(!Ir(this.type,Gt(n)))return n;if(i===this.args.length-1)throw new fi(`Expected value to be of type ${Ot(this.type)}, but found ${Ot(Gt(n))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,i=[e.kind];if(e.kind==="array"){const n=e.itemType;if(n.kind==="string"||n.kind==="number"||n.kind==="boolean"){i.push(n.kind);const s=e.N;(typeof s=="number"||this.args.length>1)&&i.push(s)}}return i.concat(this.args.map(n=>n.serialize()))}}var Cr=La;class Yr{constructor(e){this.type=zo,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&typeof n=="object")return i.error("First argument must be an image or text section.");const s=[];let c=!1;for(let u=1;u<=e.length-1;++u){const p=e[u];if(c&&typeof p=="object"&&!Array.isArray(p)){c=!1;let m=null;if(p["font-scale"]&&(m=i.parse(p["font-scale"],1,Oe),!m))return null;let _=null;if(p["text-font"]&&(_=i.parse(p["text-font"],1,ji(ut)),!_))return null;let x=null;if(p["text-color"]&&(x=i.parse(p["text-color"],1,Bi),!x))return null;const b=s[s.length-1];b.scale=m,b.font=_,b.textColor=x}else{const m=i.parse(e[u],1,at);if(!m)return null;const _=m.type.kind;if(_!=="string"&&_!=="value"&&_!=="null"&&_!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,s.push({content:m,scale:null,font:null,textColor:null})}}return new Yr(s)}evaluate(e){return new Ai(this.sections.map(i=>{const n=i.content.evaluate(e);return Gt(n)===gn?new Pa("",n,null,null,null):new Pa(Bo(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)}))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const i of this.sections){e.push(i.content.serialize());const n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),e.push(n)}return e}}class Ss{constructor(e){this.type=gn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const n=i.parse(e[1],1,ut);return n?new Ss(n):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),n=Gi.fromString(i);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(i)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ih={"to-boolean":st,"to-color":Bi,"to-number":Oe,"to-string":ut};class Ra{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const n=e[0];if((n==="to-boolean"||n==="to-string")&&e.length!==2)return i.error("Expected one argument.");const s=Ih[n],c=[];for(let u=1;u<e.length;u++){const p=i.parse(e[u],u,at);if(!p)return null;c.push(p)}return new Ra(s,c)}
vendor: 6,444 bytes, line 1
1evaluate(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){let i,n;for(const s of this.args){if(i=s.evaluate(e),n=null,i instanceof Zt)return i;if(typeof i=="string"){const c=e.parseColor(i);if(c)return c}else if(Array.isArray(i)&&(n=i.length<3||i.length>4?`Invalid rbga value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:sc(i[0],i[1],i[2],i[3]),!n))return new Zt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new fi(n||`Could not parse color from value '${typeof i=="string"?i:String(JSON.stringify(i))}'`)}if(this.type.kind==="number"){let i=null;for(const n of this.args){if(i=n.evaluate(e),i===null)return 0;const s=Number(i);if(!isNaN(s))return s}throw new fi(`Could not convert ${JSON.stringify(i)} to number.`)}return this.type.kind==="formatted"?Ai.fromString(Bo(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Gi.fromString(Bo(this.args[0].evaluate(e))):Bo(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Yr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ss(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Wn=Ra;const hr=["Unknown","Point","LineString","Polygon"];var Ba=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?hr[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Zt.parse(t)),e}};class xn{constructor(e,i,n,s){this.name=e,this.type=i,this._evaluate=n,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,i){const n=e[0],s=xn.definitions[n];if(!s)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,p=u.filter(([_])=>!Array.isArray(_)||_.length===e.length-1);let m=null;for(const[_,x]of p){m=new ja(i.registry,i.path,null,i.scope);const b=[];let w=!1;for(let S=1;S<e.length;S++){const M=e[S],C=Array.isArray(_)?_[S-1]:_.type,D=m.parse(M,1+b.length,C);if(!D){w=!0;break}b.push(D)}if(!w)if(Array.isArray(_)&&_.length!==b.length)m.error(`Expected ${_.length} arguments, but found ${b.length} instead.`);else{for(let S=0;S<b.length;S++){const M=Array.isArray(_)?_[S]:_.type,C=b[S];m.concat(S+1).checkSubtype(M,C.type)}if(m.errors.length===0)return new xn(n,c,x,b)}}if(p.length===1)i.errors.push(...m.errors);else{const _=(p.length?p:u).map(([b])=>{return w=b,Array.isArray(w)?`(${w.map(Ot).join(", ")})`:`(${Ot(w.type)}...)`;var w}).join(" | "),x=[];for(let b=1;b<e.length;b++){const w=i.parse(e[b],1+x.length);if(!w)return null;x.push(Ot(w.type))}i.error(`Expected arguments of type ${_}, but found (${x.join(", ")}) instead.`)}return null}static register(e,i){xn.definitions=i;for(const n in i)e[n]=xn}}var zr=xn;class Oo{constructor(e,i,n){this.type=Oi,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const n=e[1];if(typeof n!="object"||Array.isArray(n))return i.error("Collator options argument must be an object.");const s=i.parse(n["case-sensitive"]!==void 0&&n["case-sensitive"],1,st);if(!s)return null;const c=i.parse(n["diacritic-sensitive"]!==void 0&&n["diacritic-sensitive"],1,st);if(!c)return null;let u=null;return n.locale&&(u=i.parse(n.locale,1,ut),!u)?null:new Oo(s,c,u)}evaluate(e){return new za(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const Pr=8192;function Ms(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Xn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Fo(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*Pr),Math.round(n*s*Pr)]}function ac(t,e,i){const n=t[0]-e[0],s=t[1]-e[1],c=t[0]-i[0],u=t[1]-i[1];return n*u-c*s==0&&n*c<=0&&s*u<=0}function As(t,e){let i=!1;for(let u=0,p=e.length;u<p;u++){const m=e[u];for(let _=0,x=m.length;_<x-1;_++){if(ac(t,m[_],m[_+1]))return!1;(s=m[_])[1]>(n=t)[1]!=(c=m[_+1])[1]>n[1]&&n[0]<(c[0]-s[0])*(n[1]-s[1])/(c[1]-s[1])+s[0]&&(i=!i)}}var n,s,c;return i}function Oa(t,e){for(let i=0;i<e.length;i++)if(As(t,e[i]))return!0;return!1}function Fa(t,e,i,n){const s=n[0]-i[0],c=n[1]-i[1],u=(t[0]-i[0])*c-s*(t[1]-i[1]),p=(e[0]-i[0])*c-s*(e[1]-i[1]);return u>0&&p<0||u<0&&p>0}function Hn(t,e,i){for(const _ of i)for(let x=0;x<_.length-1;++x)if((p=[(u=_[x+1])[0]-(c=_[x])[0],u[1]-c[1]])[0]*(m=[(s=e)[0]-(n=t)[0],s[1]-n[1]])[1]-p[1]*m[0]!=0&&Fa(n,s,c,u)&&Fa(c,u,n,s))return!0;var n,s,c,u,p,m;return!1}function bt(t,e){for(let i=0;i<t.length;++i)if(!As(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Hn(t[i],t[i+1],e))return!1;return!0}function Ch(t,e){for(let i=0;i<e.length;i++)if(bt(t,e[i]))return!0;return!1}function Ua(t,e,i){const n=[];for(let s=0;s<t.length;s++){const c=[];for(let u=0;u<t[s].length;
vendor: 13,304 bytes, line 1
1u++){const p=Fo(t[s][u],i);Ms(e,p),c.push(p)}n.push(c)}return n}function lc(t,e,i){const n=[];for(let s=0;s<t.length;s++){const c=Ua(t[s],e,i);n.push(c)}return n}function Va(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const s=.5*n;let c=t[0]-i[0]>s?-n:i[0]-t[0]>s?n:0;c===0&&(c=t[0]-i[2]>s?-n:i[2]-t[0]>s?n:0),t[0]+=c}Ms(e,t)}function cc(t,e,i,n){const s=Math.pow(2,n.z)*Pr,c=[n.x*Pr,n.y*Pr],u=[];if(!t)return u;for(const p of t)for(const m of p){const _=[m.x+c[0],m.y+c[1]];Va(_,e,i,s),u.push(_)}return u}function Na(t,e,i,n){const s=Math.pow(2,n.z)*Pr,c=[n.x*Pr,n.y*Pr],u=[];if(!t)return u;for(const m of t){const _=[];for(const x of m){const b=[x.x+c[0],x.y+c[1]];Ms(e,b),_.push(b)}u.push(_)}if(e[2]-e[0]<=s/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(const m of u)for(const _ of m)Va(_,e,i,s)}var p;return u}class Kn{constructor(e,i){this.type=st,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ro(e[1])){const n=e[1];if(n.type==="FeatureCollection")for(let s=0;s<n.features.length;++s){const c=n.features[s].geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Kn(n,n.features[s].geometry)}else if(n.type==="Feature"){const s=n.geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new Kn(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new Kn(n,n)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(i,n){const s=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(!u)return!1;if(n.type==="Polygon"){const p=Ua(n.coordinates,c,u),m=cc(i.geometry(),s,c,u);if(!Xn(s,c))return!1;for(const _ of m)if(!As(_,p))return!1}if(n.type==="MultiPolygon"){const p=lc(n.coordinates,c,u),m=cc(i.geometry(),s,c,u);if(!Xn(s,c))return!1;for(const _ of m)if(!Oa(_,p))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(i,n){const s=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(!u)return!1;if(n.type==="Polygon"){const p=Ua(n.coordinates,c,u),m=Na(i.geometry(),s,c,u);if(!Xn(s,c))return!1;for(const _ of m)if(!bt(_,p))return!1}if(n.type==="MultiPolygon"){const p=lc(n.coordinates,c,u),m=Na(i.geometry(),s,c,u);if(!Xn(s,c))return!1;for(const _ of m)if(!Ch(_,p))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var Is=Kn;function Yn(t){if(t instanceof zr&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof Is)return!1;let e=!0;return t.eachChild(i=>{e&&!Yn(i)&&(e=!1)}),e}function kr(t){if(t instanceof zr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!kr(i)&&(e=!1)}),e}function vn(t,e){if(t instanceof zr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(n=>{i&&!vn(n,e)&&(i=!1)}),i}class Cs{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const n=e[1];return i.scope.has(n)?new Cs(n,i.scope.get(n)):i.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var hc=Cs;class Uo{constructor(e,i=[],n,s=new rc,c=[]){this.registry=e,this.path=i,this.key=i.map(u=>`[${u}]`).join(""),this.scope=s,this.errors=c,this.expectedType=n}parse(e,i,n,s,c={}){return i?this.concat(i,n,s)._parse(e,c):this._parse(e,c)}_parse(e,i){function n(s,c,u){return u==="assert"?new Cr(c,[s]):u==="coerce"?new Wn(c,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[s];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const p=this.expectedType,m=u.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||m.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(p,m))return null}else u=n(u,p,i.typeAnnotation||"coerce");else u=n(u,p,i.typeAnnotation||"assert")}if(!(u instanceof yn)&&u.type.kind!=="resolvedImage"&&Ga(u)){const p=new Ba;try{u=new yn(u.type,u.evaluate(p))}catch(m){return this.error(m.message),null}}return u}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,n){const s=typeof e=="number"?this.path.concat(e):this.path,c=n?this.scope.concat(n):this.scope;return new Uo(this.registry,s,i||null,c,this.errors)}error(e,...i){const n=`${this.key}${i.map(s=>`[${s}]`).join("")}`;this.errors.push(new cr(n,e))}checkSubtype(e,i){const n=Ir(e,i);return n&&this.error(n),n}}var ja=Uo;function Ga(t){if(t instanceof hc)return Ga(t.boundExpression);if(t instanceof zr&&t.name==="error"||t instanceof Oo||t instanceof Is)return!1;const e=t instanceof Wn||t instanceof Cr;let i=!0;return t.eachChild(n=>{i=e?i&&Ga(n):i&&n instanceof yn}),!!i&&Yn(t)&&vn(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function zs(t,e){const i=t.length-1;let n,s,c=0,u=i,p=0;for(;c<=u;)if(p=Math.floor((c+u)/2),n=t[p],s=t[p+1],n<=e){if(p===i||e<s)return p;c=p+1}else{if(!(n>e))throw new fi("Input is not a number.");u=p-1}return 0}class Ps{constructor(e,i,n){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[s,c]of n)this.labels.push(s),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let u=1;u<e.length;u+=2){const p=u===1?-1/0:e[u],m=e[u+1],_=u,x=u+1;if(typeof p!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',_);if(s.length&&s[s.length-1][0]>=p)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);const b=i.parse(m,x,c);if(!b)return null;c=c||b.type,s.push([p,b])}return new Ps(c,n,s)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;return s>=i[c-1]?n[c-1].evaluate(e):n[zs(i,s)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let i=0;i<this.labels.length;i++)i>0&&e.push(this.labels[i]),e.push(this.outputs[i].serialize());return e}}var $a=Ps;function mt(t,e,i){return t*(1-i)+e*i}var Vo=Object.freeze({__proto__:null,array:function(t,e,i){return t.map((n,s)=>mt(n,e[s],i))},color:function(t,e,i){return new Zt(mt(t.r,e.r,i),mt(t.g,e.g,i),mt(t.b,e.b,i),mt(t.a,e.a,i))},number:mt});const uc=.95047,Za=1.08883,dc=4/29,bn=6/29,qa=3*bn*bn,zh=bn*bn*bn,Ph=Math.PI/180,kh=180/Math.PI;function Wa(t){return t>zh?Math.pow(t,1/3):t/qa+dc}function Xa(t){return t>bn?t*t*t:qa*(t-dc)}function Ha(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ks(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pc(t){const e=ks(t.r),i=ks(t.g),n=ks(t.b),s=Wa((.4124564*e+.3575761*i+.1804375*n)/uc),c=Wa((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*c-16,a:500*(s-c),b:200*(c-Wa((.0193339*e+.119192*i+.9503041*n)/Za)),alpha:t.a}}function fc(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xa(e),i=uc*Xa(i),n=Za*Xa(n),new Zt(Ha(3.2404542*i-1.5371385*e-.4985314*n),Ha(-.969266*i+1.8760108*e+.041556*n),Ha(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Dh(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const No={forward:pc,reverse:fc,interpolate:function(t,e,i){return{l:mt(t.l,e.l,i),a:mt(t.a,e.a,i),b:mt(t.b,e.b,i),alpha:mt(t.alpha,e.alpha,i)}}},Jn={forward:function(t){const{l:e,a:i,b:n}=pc(t),s=Math.atan2(n,i)*kh;return{h:s<0?s+360:s,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ph,i=t.c;return fc({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Dh(t.h,e.h,i),c:mt(t.c,e.c,i),l:mt(t.l,e.l,i),alpha:mt(t.alpha,e.alpha,i)}}};var Ka=Object.freeze({__proto__:null,hcl:Jn,lab:No});class jo{constructor(e,i,n,s,c){this.type=e,this.operator=i,this.interpolation=n,this.input=s,this.labels=[],this.outputs=[];for(const[u,p]of c)this.labels.push(u),this.outputs.push(p)}static interpolationFactor(e,i,n,s){let c=0;if(e.name==="exponential")c=Ya(i,e.base,n,s);else if(e.name==="linear")c=Ya(i,1,n,s);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new cn(u[0],u[1],u[2],u[3]).solve(Ya(i,1,n,s))}return c}static parse(e,i){let[n,s,c,...u]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){const _=s[1];if(typeof _!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:_}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{const _=s.slice(1);if(_.length!==4||_.some(x=>typeof x!="number"||x<0||x>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:_}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,Oe),!c)return null;const p=[];let m=null;n==="interpolate-hcl"||n==="interpolate-lab"?m=Bi:i.expectedType&&i.expectedType.kind!=="value"&&(m=i.expectedType);for(let _=0;_<u.length;_+=2){const x=u[_],b=u[_+1],w=_+3,S=_+4;if(typeof x!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',w);if(p.length&&p[p.length-1][0]>=x)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);const M=i.parse(b,S,m);if(!M)return null;m=m||M.type,p.push([x,M])}return m.kind==="number"||m.kind==="color"||m.kind==="array"&&m.itemType.kind==="number"&&typeof m.N=="number"?new jo(m,n,s,c,p):i.error(`Type ${Ot(m)} is not interpolatable.`)}evaluate(e){const i=this.labels,n=this.outputs;if(i.length===1)return n[0].evaluate(e);const s=this.input.evaluate(e);if(s<=i[0])return n[0].evaluate(e);const c=i.length;if(s>=i[c-1])return n[c-1].evaluate(e);const u=zs(i,s),p=jo.interpolationFactor(this.interpolation,s,i[u],i[u+1]),m=n[u].evaluate(e),_=n[u+1].evaluate(e);return this.operator==="interpolate"?Vo[this.type.kind.toLowerCase()](m,_,p):this.operator==="interpolate-hcl"?Jn.reverse(Jn.interpolate(Jn.forward(m),Jn.forward(_),p)):No.reverse(No.interpolate(No.forward(m),No.forward(_),p))}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const i=[this.operator,e,this.input.serialize()];for(let n=0;n<this.labels.length;n++)i.push(this.labels[n],this.outputs[n].serialize());return i}}function Ya(t,e,i,n){const s=n-i,c=t-i;return s===0?0:e===1?c/s:(Math.pow(e,c)-1)/(Math.pow(e,s)-1)}var ur=jo;class Ds{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expectected at least one argument.");let n=null;const s=i.expectedType;s&&s.kind!=="value"&&(n=s);const c=[];for(const p of e.slice(1)){const m=i.parse(p,1+c.length,n,void 0,{typeAnnotation:"omit"});if(!m)return null;n=n||m.type,c.push(m)}const u=s&&c.some(p=>Ir(s,p.type));return new Ds(u?at:n,c)}evaluate(e){let i,n=null,s=0;for(const c of this.args){if(s++,n=c.evaluate(e),n&&n instanceof Gi&&!n.available&&(i||(i=n),n=null,s===this.args.length))return i;if(n!==null)break}return n}
vendor: 4,640 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var Ja=Ds;class Ls{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let c=1;c<e.length-1;c+=2){const u=e[c];if(typeof u!="string")return i.error(`Expected string, but found ${typeof u} instead.`,c);if(/[^a-zA-Z0-9_]/.test(u))return i.error("Variable names must contain only alphanumeric characters or '_'.",c);const p=i.parse(e[c+1],c+1);if(!p)return null;n.push([u,p])}const s=i.parse(e[e.length-1],e.length-1,i.expectedType,n);return s?new Ls(n,s):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[i,n]of this.bindings)e.push(i,n.serialize());return e.push(this.result.serialize()),e}}var mc=Ls;class Qa{constructor(e,i,n){this.type=e,this.index=i,this.input=n}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,Oe),s=i.parse(e[2],2,ji(i.expectedType||at));return n&&s?new Qa(s.type.itemType,n,s):null}evaluate(e){const i=this.index.evaluate(e),n=this.input.evaluate(e);if(i<0)throw new fi(`Array index out of bounds: ${i} < 0.`);if(i>=n.length)throw new fi(`Array index out of bounds: ${i} > ${n.length-1}.`);if(i!==Math.floor(i))throw new fi(`Array index must be an integer, but found ${i} instead.`);return n[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Lh=Qa;class el{constructor(e,i){this.type=st,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);return n&&s?Po(n.type,[st,ut,Oe,Zn,at])?new el(n,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(n==null)return!1;if(!ko(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!ko(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);return n.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Rs=el;class Go{constructor(e,i,n){this.type=Oe,this.needle=e,this.haystack=i,this.fromIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,at);if(!n||!s)return null;if(!Po(n.type,[st,ut,Oe,Zn,at]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new Go(n,s,c):null}return new Go(n,s)}evaluate(e){const i=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ko(i,["boolean","string","number","null"]))throw new fi(`Expected first argument to be of type boolean, string, number or null, but found ${Ot(Gt(i))} instead.`);if(!ko(n,["string","array"]))throw new fi(`Expected second argument to be of type array or string, but found ${Ot(Gt(n))} instead.`);if(this.fromIndex){const s=this.fromIndex.evaluate(e);return n.indexOf(i,s)}return n.indexOf(i)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var _c=Go;class tl{constructor(e,i,n,s,c,u){this.inputType=e,this.type=i,this.input=n,this.cases=s,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let n,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const c={},u=[];for(let _=2;_<e.length-1;_+=2){let x=e[_];const b=e[_+1];Array.isArray(x)||(x=[x]);const w=i.concat(_);
1if(x.length===0)return w.error("Expected at least one branch label.");for(const M of x){if(typeof M!="number"&&typeof M!="string")return w.error("Branch labels must be numbers or strings.");if(typeof M=="number"&&Math.abs(M)>Number.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof M=="number"&&Math.floor(M)!==M)return w.error("Numeric branch labels must be integer values.");if(n){if(w.checkSubtype(n,Gt(M)))return null}else n=Gt(M);if(c[String(M)]!==void 0)return w.error("Branch labels must be unique.");c[String(M)]=u.length}const S=i.parse(b,_,s);if(!S)return null;s=s||S.type,u.push(S)}const p=i.parse(e[1],1,at);if(!p)return null;const m=i.parse(e[e.length-1],e.length-1,s);return m?p.type.kind!=="value"&&i.concat(1).checkSubtype(n,p.type)?null:new tl(n,s,p,c,u,m):null}evaluate(e){const i=this.input.evaluate(e);return(Gt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],i=Object.keys(this.cases).sort(),n=[],s={};for(const u of i){const p=s[this.cases[u]];p===void 0?(s[this.cases[u]]=n.length,n.push([this.cases[u],[u]])):n[p][1].push(u)}const c=u=>this.inputType.kind==="number"?Number(u):u;for(const[u,p]of n)e.push(p.length===1?c(p[0]):p.map(c)),e.push(this.outputs[u].serialize());return e.push(this.otherwise.serialize()),e}}var Rh=tl;class il{constructor(e,i,n){this.type=e,this.branches=i,this.otherwise=n}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let n;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);const s=[];for(let u=1;u<e.length-1;u+=2){const p=i.parse(e[u],u,st);if(!p)return null;const m=i.parse(e[u+1],u+1,n);if(!m)return null;s.push([p,m]),n=n||m.type}const c=i.parse(e[e.length-1],e.length-1,n);
vendor: 14,250 bytes, line 1
1return c?new il(n,s,c):null}evaluate(e){for(const[i,n]of this.branches)if(i.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,n]of this.branches)e(i),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,i])=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(i=>{e.push(i.serialize())}),e}}var gc=il;class $o{constructor(e,i,n,s){this.type=e,this.input=i,this.beginIndex=n,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=i.parse(e[1],1,at),s=i.parse(e[2],2,Oe);if(!n||!s)return null;if(!Po(n.type,[ji(at),ut,at]))return i.error(`Expected first argument to be of type array or string, but found ${Ot(n.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Oe);return c?new $o(n.type,n,s,c):null}return new $o(n.type,n,s)}evaluate(e){const i=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!ko(i,["string","array"]))throw new fi(`Expected first argument to be of type array or string, but found ${Ot(Gt(i))} instead.`);if(this.endIndex){const s=this.endIndex.evaluate(e);return i.slice(n,s)}return i.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var yc=$o;function Bs(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function xc(t,e,i,n){return n.compare(e,i)===0}function Qn(t,e,i){const n=t!=="=="&&t!=="!=";return class Ff{constructor(c,u,p){this.type=st,this.lhs=c,this.rhs=u,this.collator=p,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const p=c[0];let m=u.parse(c[1],1,at);if(!m)return null;if(!Bs(p,m.type))return u.concat(1).error(`"${p}" comparisons are not supported for type '${Ot(m.type)}'.`);let _=u.parse(c[2],2,at);if(!_)return null;if(!Bs(p,_.type))return u.concat(2).error(`"${p}" comparisons are not supported for type '${Ot(_.type)}'.`);if(m.type.kind!==_.type.kind&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error(`Cannot compare types '${Ot(m.type)}' and '${Ot(_.type)}'.`);n&&(m.type.kind==="value"&&_.type.kind!=="value"?m=new Cr(_.type,[m]):m.type.kind!=="value"&&_.type.kind==="value"&&(_=new Cr(m.type,[_])));let x=null;if(c.length===4){if(m.type.kind!=="string"&&_.type.kind!=="string"&&m.type.kind!=="value"&&_.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(x=u.parse(c[3],3,Oi),!x)return null}return new Ff(m,_,x)}evaluate(c){const u=this.lhs.evaluate(c),p=this.rhs.evaluate(c);if(n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!==_.kind||m.kind!=="string"&&m.kind!=="number")throw new fi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${m.kind}, ${_.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const m=Gt(u),_=Gt(p);if(m.kind!=="string"||_.kind!=="string")return e(c,u,p)}return this.collator?i(c,u,p,this.collator.evaluate(c)):e(c,u,p)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}serialize(){const c=[t];return this.eachChild(u=>{c.push(u.serialize())}),c}}}const Bh=Qn("==",function(t,e,i){return e===i},xc),Oh=Qn("!=",function(t,e,i){return e!==i},function(t,e,i,n){return!xc(0,e,i,n)}),Fh=Qn("<",function(t,e,i){return e<i},function(t,e,i,n){return n.compare(e,i)<0}),Uh=Qn(">",function(t,e,i){return e>i},function(t,e,i,n){return n.compare(e,i)>0}),Vh=Qn("<=",function(t,e,i){return e<=i},function(t,e,i,n){return n.compare(e,i)<=0}),vc=Qn(">=",function(t,e,i){return e>=i},function(t,e,i,n){return n.compare(e,i)>=0});class Os{constructor(e,i,n,s,c,u){this.type=ut,this.number=e,this.locale=i,this.currency=n,this.unit=s,this.minFractionDigits=c,this.maxFractionDigits=u}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const n=i.parse(e[1],1,Oe);if(!n)return null;const s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let c=null;if(s.locale&&(c=i.parse(s.locale,1,ut),!c))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,ut),!u))return null;let p=null;if(s.unit&&(p=i.parse(s.unit,1,ut),!p))return null;let m=null;if(s["min-fraction-digits"]&&(m=i.parse(s["min-fraction-digits"],1,Oe),!m))return null;let _=null;return s["max-fraction-digits"]&&(_=i.parse(s["max-fraction-digits"],1,Oe),!_)?null:new Os(n,c,u,p,m,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class eo{constructor(e){this.type=Oe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=i.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Ot(n.type)} instead.`):new eo(n):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string"||Array.isArray(i))return i.length;throw new fi(`Expected value to be of type string or array, but found ${Ot(Gt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(i=>{e.push(i.serialize())}),e}}const bc={"==":Bh,"!=":Oh,">":Uh,"<":Fh,">=":vc,"<=":Vh,array:Cr,at:Lh,boolean:Cr,case:gc,coalesce:Ja,collator:Oo,format:Yr,image:Ss,in:Rs,"index-of":_c,interpolate:ur,"interpolate-hcl":ur,"interpolate-lab":ur,length:eo,let:mc,literal:yn,match:Rh,number:Cr,"number-format":Os,object:Cr,slice:yc,step:$a,string:Cr,"to-boolean":Wn,"to-color":Wn,"to-number":Wn,"to-string":Wn,var:hc,within:Is};function wc(t,[e,i,n,s]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const c=s?s.evaluate(t):1,u=sc(e,i,n,c);if(u)throw new fi(u);return new Zt(e/255*c,i/255*c,n/255*c,c)}function Dr(t,e){return t in e}function Fs(t,e){const i=e[t];return i===void 0?null:i}function $i(t){return{type:t}}zr.register(bc,{error:[{kind:"error"},[ut],(t,[e])=>{throw new fi(e.evaluate(t))}],typeof:[ut,[at],(t,[e])=>Ot(Gt(e.evaluate(t)))],"to-rgba":[ji(Oe,4),[Bi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Bi,[Oe,Oe,Oe],wc],rgba:[Bi,[Oe,Oe,Oe,Oe],wc],has:{type:st,overloads:[[[ut],(t,[e])=>Dr(e.evaluate(t),t.properties())],[[ut,tr],(t,[e,i])=>Dr(e.evaluate(t),i.evaluate(t))]]},get:{type:at,overloads:[[[ut],(t,[e])=>Fs(e.evaluate(t),t.properties())],[[ut,tr],(t,[e,i])=>Fs(e.evaluate(t),i.evaluate(t))]]},"feature-state":[at,[ut],(t,[e])=>Fs(e.evaluate(t),t.featureState||{})],properties:[tr,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[at,[],t=>t.id()],zoom:[Oe,[],t=>t.globals.zoom],pitch:[Oe,[],t=>t.globals.pitch||0],"distance-from-center":[Oe,[],t=>t.distanceFromCenter()],"heatmap-density":[Oe,[],t=>t.globals.heatmapDensity||0],"line-progress":[Oe,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Oe,[],t=>t.globals.skyRadialProgress||0],accumulated:[at,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[Oe,$i(Oe),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Oe,$i(Oe),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Oe,overloads:[[[Oe,Oe],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Oe],(t,[e])=>-e.evaluate(t)]]},"/":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Oe,[Oe,Oe],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Oe,[],()=>Math.LN2],pi:[Oe,[],()=>Math.PI],e:[Oe,[],()=>Math.E],"^":[Oe,[Oe,Oe],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Oe,[Oe],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))],log2:[Oe,[Oe],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Oe,[Oe],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Oe,[Oe],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Oe,[Oe],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Oe,[Oe],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Oe,[Oe],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Oe,[Oe],(t,[e])=>Math.atan(e.evaluate(t))],min:[Oe,$i(Oe),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[Oe,$i(Oe),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[Oe,[Oe],(t,[e])=>Math.abs(e.evaluate(t))],round:[Oe,[Oe],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Oe,[Oe],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Oe,[Oe],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[st,[ut,at],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[st,[at],(t,[e])=>t.id()===e.value],"filter-type-==":[st,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n<s}],"filter-id-<":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>s}],"filter-id->":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n<=s}],"filter-id-<=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[st,[ut,at],(t,[e,i])=>{const n=t.properties()[e.value],s=i.value;return typeof n==typeof s&&n>=s}],"filter-id->=":[st,[at],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[st,[at],(t,[e])=>e.value in t.properties()],"filter-has-id":[st,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[st,[ji(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[st,[ji(at)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[st,[ut,ji(at)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[st,[ut,ji(at)],(t,[e,i])=>function(n,s,c,u){for(;c<=u;){const p=c+u>>1;if(s[p]===n)return!0;s[p]>n?u=p-1:c=p+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[$i(st),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[$i(st),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[st,[st],(t,[e])=>!e.evaluate(t)],"is-supported-script":[st,[ut],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,$i(at),(t,e)=>e.map(i=>Bo(i.evaluate(t))).join("")],"resolved-locale":[ut,[Oi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Zo=bc;function Tc(t){return{result:"success",value:t}}function wn(t){return{result:"error",value:t}}function to(t){return t["property-type"]==="data-driven"}function Us(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Vs(t){return!!t.expression&&t.expression.interpolated}function _t(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function qo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ec(t){return t}function Ns(t,e){const i=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",s=n||!(n||t.property!==void 0),c=t.type||(Vs(e)?"exponential":"interval");if(i&&((t=Ar({},t)).stops&&(t.stops=t.stops.map(_=>[_[0],Zt.parse(_[1])])),t.default=Zt.parse(t.default?t.default:e.default)),t.colorSpace&&t.colorSpace!=="rgb"&&!Ka[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let u,p,m;if(c==="exponential")u=Lr;else if(c==="interval")u=js;else if(c==="categorical"){u=Sc,p=Object.create(null);for(const _ of t.stops)p[_[0]]=_[1];m=typeof t.stops[0][0]}else{if(c!=="identity")throw new Error(`Unknown function type "${c}"`);u=Mc}if(n){const _={},x=[];for(let S=0;S<t.stops.length;S++){const M=t.stops[S],C=M[0].zoom;_[C]===void 0&&(_[C]={zoom:C,type:t.type,property:t.property,default:t.default,stops:[]},x.push(C)),_[C].stops.push([M[0].value,M[1]])}const b=[];for(const S of x)b.push([_[S].zoom,Ns(_[S],e)]);const w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ur.interpolationFactor.bind(void 0,w),zoomStops:b.map(S=>S[0]),evaluate:({zoom:S},M)=>Lr({stops:b,base:t.base},e,S).evaluate(S,M)}}if(s){const _=c==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:ur.interpolationFactor.bind(void 0,_),zoomStops:t.stops.map(x=>x[0]),evaluate:({zoom:x})=>u(t,e,x,p,m)}}return{kind:"source",evaluate(_,x){const b=x&&x.properties?x.properties[t.property]:void 0;return b===void 0?io(t.default,e.default):u(t,e,b,p,m)}}}function io(t,e,i){return t!==void 0?t:e!==void 0?e:i!==void 0?i:void 0}function Sc(t,e,i,n,s){return io(typeof i===s?n[i]:void 0,t.default,e.default)}
1function js(t,e,i){if(_t(i)!=="number")return io(t.default,e.default);const n=t.stops.length;if(n===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const s=zs(t.stops.map(c=>c[0]),i);return t.stops[s][1]}function Lr(t,e,i){const n=t.base!==void 0?t.base:1;if(_t(i)!=="number")return io(t.default,e.default);const s=t.stops.length;if(s===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[s-1][0])return t.stops[s-1][1];const c=zs(t.stops.map(x=>x[0]),i),u=function(x,b,w,S){const M=S-w,C=x-w;return M===0?0:b===1?C/M:(Math.pow(b,C)-1)/(Math.pow(b,M)-1)}(i,n,t.stops[c][0],t.stops[c+1][0]),p=t.stops[c][1],m=t.stops[c+1][1];let _=Vo[e.type]||Ec;if(t.colorSpace&&t.colorSpace!=="rgb"){const x=Ka[t.colorSpace];_=(b,w)=>x.reverse(x.interpolate(x.forward(b),x.forward(w),u))}return typeof p.evaluate=="function"?{evaluate(...x){const b=p.evaluate.apply(void 0,x),w=m.evaluate.apply(void 0,x);if(b!==void 0&&w!==void 0)return _(b,w,u)}}:_(p,m,u)}function Mc(t,e,i){return e.type==="color"?i=Zt.parse(i):e.type==="formatted"?i=Ai.fromString(i.toString()):e.type==="resolvedImage"?i=Gi.fromString(i.toString()):_t(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0),io(i,t.default,e.default)}class Gs{constructor(e,i){this.expression=e,this._warningHistory={},this._evaluator=new Ba,this._defaultValue=i?function(n){return n.type==="color"&&(qo(n.default)||Array.isArray(n.default))?new Zt(0,0,0,0):n.type==="color"?Zt.parse(n.default)||null:n.default===void 0?null:n.default}(i):null,this._enumValues=i&&i.type==="enum"?i.values:null}evaluateWithoutErrorHandling(e,i,n,s,c,u,p,m){return this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=n,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null,this.expression.evaluate(this._evaluator)}evaluate(e,i,n,s,c,u,p,m){this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=n||null,this._evaluator.canonical=s||null,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null,this._evaluator.featureTileCoord=p||null,this._evaluator.featureDistanceData=m||null;try{const _=this.expression.evaluate(this._evaluator);if(_==null||typeof _=="number"&&_!=_)return this._defaultValue;if(this._enumValues&&!(_ in this._enumValues))throw new fi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(_)} instead.`);return _}catch(_){return this._warningHistory[_.message]||(this._warningHistory[_.message]=!0,typeof console<"u"&&console.warn(_.message)),this._defaultValue}}}function ro(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Zo}function no(t,e){const i=new ja(Zo,[],e?function(s){const c={color:Bi,string:ut,number:Oe,enum:ut,boolean:st,formatted:zo,resolvedImage:gn};return s.type==="array"?ji(c[s.value]||at,s.length):c[s.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Tc(new Gs(n,e)):wn(i.errors)}class rl{constructor(e,i){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!kr(i.expression)}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}}class Wo{constructor(e,i,n,s){this.kind=e,this.zoomStops=n,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!kr(i.expression),this.interpolationType=s}evaluateWithoutErrorHandling(e,i,n,s,c,u){return this._styleExpression.evaluateWithoutErrorHandling(e,i,n,s,c,u)}evaluate(e,i,n,s,c,u){return this._styleExpression.evaluate(e,i,n,s,c,u)}interpolationFactor(e,i,n){return this.interpolationType?ur.interpolationFactor(this.interpolationType,e,i,n):0}}function Xo(t,e){if((t=no(t,e)).result==="error")return t;const i=t.value.expression,n=Yn(i);if(!n&&!to(e))return wn([new cr("","data expressions not supported")]);const s=vn(i,["zoom","pitch","distance-from-center"]);if(!s&&!Us(e))return wn([new cr("","zoom expressions not supported")]);const c=Zs(i);return c||s?c instanceof cr?wn([c]):c instanceof ur&&!Vs(e)?wn([new cr("",'"interpolate" expressions cannot be used with this property')]):Tc(c?new Wo(n?"camera":"composite",t.value,c.labels,c instanceof ur?c.interpolation:void 0):new rl(n?"constant":"source",t.value)):wn([new cr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class $s{constructor(e,i){this._parameters=e,this._specification=i,Ar(this,Ns(this._parameters,this._specification))}static deserialize(e){return new $s(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Zs(t){let e=null;if(t instanceof mc)e=Zs(t.result);else if(t instanceof Ja){for(const i of t.args)if(e=Zs(i),e)break}else(t instanceof $a||t instanceof ur)&&t.input instanceof zr&&t.input.name==="zoom"&&(e=t);return e instanceof cr||t.eachChild(i=>{const n=Zs(i);n instanceof cr?e=n:!e&&n?e=new cr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new cr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}class Fe{constructor(e,i,n,s){this.message=(e?`${e}: `:"")+n,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function ir(t){const e=t.key,i=t.value,n=t.valueSpec||{},s=t.objectElementValidators||{},c=t.style,u=t.styleSpec;let p=[];const m=_t(i);if(m!=="object")return[new Fe(e,i,`object expected, ${m}
1 found`)];for(const _ in i){const x=_.split(".")[0];let b;s[x]?b=s[x]:n[x]?b=xi:s["*"]?b=s["*"]:n["*"]&&(b=xi),b?p=p.concat(b({key:(e&&`${e}.`)+_,value:i[_],valueSpec:n[x]||n["*"],style:c,styleSpec:u,object:i,objectKey:_},i)):p.push(new Fe(e,i[_],`unknown property "${_}"`))}for(const _ in n)s[_]||n[_].required&&n[_].default===void 0&&i[_]===void 0&&p.push(new Fe(e,i,`missing required property "${_}"`));return p}function Ac(t){const e=t.value,i=t.valueSpec,n=t.style,s=t.styleSpec,c=t.key,u=t.arrayElementValidator||xi;if(_t(e)!=="array")return[new Fe(c,e,`array expected, ${_t(e)} found`)];if(i.length&&e.length!==i.length)return[new Fe(c,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new Fe(c,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let p={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum,function:void 0};s.$version<7&&(p.function=i.function),_t(i.value)==="object"&&(p=i.value);let m=[];for(let _=0;_<e.length;_++)m=m.concat(u({array:e,arrayIndex:_,value:e[_],valueSpec:p,style:n,styleSpec:s,key:`${c}[${_}]`}));return m}function Ho(t){const e=t.key,i=t.value,n=t.valueSpec;let s=_t(i);if(s==="number"&&i!=i&&(s="NaN"),s!=="number")return[new Fe(e,i,`number expected, ${s} found`)];if("minimum"in n){let c=n.minimum;if(_t(n.minimum)==="array"&&(c=n.minimum[t.arrayIndex]),i<c)return[new Fe(e,i,`${i} is less than the minimum value ${c}`)]}if("maximum"in n){let c=n.maximum;if(_t(n.maximum)==="array"&&(c=n.maximum[t.arrayIndex]),i>c)return[new Fe(e,i,`${i} is greater than the maximum value ${c}`)]}return[]}function Ko(t){const e=t.valueSpec,i=Ht(t.value.type);let n,s,c,u={};const p=i!=="categorical"&&t.value.property===void 0,m=!p,_=_t(t.value.stops)==="array"&&_t(t.value.stops[0])==="array"&&_t(t.value.stops[0][0])==="object",x=ir({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(S){if(i==="identity")return[new Fe(S.key,S.value,'identity function may not have a "stops" property')];let M=[];const C=S.value;return M=M.concat(Ac({key:S.key,value:C,valueSpec:S.valueSpec,style:S.style,styleSpec:S.styleSpec,arrayElementValidator:b})),_t(C)==="array"&&C.length===0&&M.push(new Fe(S.key,C,"array must have at least one stop")),M},default:function(S){return xi({key:S.key,value:S.value,valueSpec:e,style:S.style,styleSpec:S.styleSpec})}}});return i==="identity"&&p&&x.push(new Fe(t.key,t.value,'missing required property "property"')),i==="identity"||t.value.stops||x.push(new Fe(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!Vs(t.valueSpec)&&x.push(new Fe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(m&&!to(t.valueSpec)?x.push(new Fe(t.key,t.value,"property functions not supported")):p&&!Us(t.valueSpec)&&x.push(new Fe(t.key,t.value,"zoom functions not supported"))),i!=="categorical"&&!_||t.value.property!==void 0||x.push(new Fe(t.key,t.value,'"property" property is required')),x;function b(S){let M=[];const C=S.value,D=S.key;if(_t(C)!=="array")return[new Fe(D,C,`array expected, ${_t(C)} found`)];if(C.length!==2)return[new Fe(D,C,`array length 2 expected, length ${C.length} found`)];if(_){if(_t(C[0])!=="object")return[new Fe(D,C,`object expected, ${_t(C[0])} found`)];if(C[0].zoom===void 0)return[new Fe(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new Fe(D,C,"object stop key must have value")];const U=Ht(C[0].zoom);if(typeof U!="number")return[new Fe(D,C[0].zoom,"stop zoom values must be numbers")];if(c&&c>U)return[new Fe(D,C[0].zoom,"stop zoom values must appear in ascending order")];U!==c&&(c=U,s=void 0,u={}),M=M.concat(ir({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},style:S.style,styleSpec:S.styleSpec,objectElementValidators:{zoom:Ho,value:w}}))}else M=M.concat(w({key:`${D}[0]`,value:C[0],valueSpec:{},style:S.style,styleSpec:S.styleSpec},C));return ro(ci(C[1]))?M.concat([new Fe(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):M.concat(xi({key:`${D}[1]`,value:C[1],valueSpec:e,style:S.style,styleSpec:S.styleSpec}))}function w(S,M){const C=_t(S.value),D=Ht(S.value),U=S.value!==null?S.value:M;if(n){if(C!==n)return[new Fe(S.key,U,`${C} stop domain type must match previous stop domain type ${n}`)]}else n=C;if(C!=="number"&&C!=="string"&&C!=="boolean"&&typeof D!="number"&&typeof D!="string"&&typeof D!="boolean")return[new Fe(S.key,U,"stop domain value must be a number, string, or boolean")];
vendor: 4,762 bytes, lines 1-7
1if(C!=="number"&&i!=="categorical"){let q=`number expected, ${C} found`;return to(e)&&i===void 0&&(q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(S.key,U,q)]}return i!=="categorical"||C!=="number"||typeof D=="number"&&isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&typeof D=="number"&&typeof s=="number"&&s!==void 0&&D<s?[new Fe(S.key,U,"stop domain values must appear in ascending order")]:(s=D,i==="categorical"&&D in u?[new Fe(S.key,U,"stop domain values must be unique")]:(u[D]=!0,[])):[new Fe(S.key,U,`integer expected, found ${String(D)}`)]}}function hi(t){const e=(t.expressionContext==="property"?Xo:no)(ci(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new Fe(`${t.key}${n.key}`,t.value,n.message));const i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new Fe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!kr(i))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter")return Yo(i,t);if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!vn(i,["zoom","feature-state"]))return[new Fe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Yn(i))return[new Fe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Yo(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const s of e.valueSpec.expression.parameters)i.delete(s);if(i.size===0)return[];const n=[];return t instanceof zr&&i.has(t.name)?[new Fe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild(s=>{n.push(...Yo(s,e))}),n)}function qs(t){const e=t.key,i=t.value,n=t.valueSpec,s=[];return Array.isArray(n.values)?n.values.indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(n.values).indexOf(Ht(i))===-1&&s.push(new Fe(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function nl(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!nl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Ws(t,e="fill"){if(t==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};nl(t)||(t=so(t));const i=t;let n=!0;try{n=function(_){if(!oo(_))return _;let x=ci(_);return Xs(x),x=Ic(x),x}(i)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
2This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
3and paste the contents of this message in the report.
4Thank you!
5Filter Expression:
6${JSON.stringify(i,null,2)}
7        `)}const s=fe[`filter_${e}`],c=no(n,s);let u=null;if(c.result==="error")throw new Error(c.value.map(_=>`${_.key}: ${_.message}`).join(", "));u=(_,x,b)=>c.value.evaluate(_,x,{},b);let p=null,m=null;if(n!==i){const _=no(i,s);if(_.result==="error")throw new Error(_.value.map(x=>`${x.key}: ${x.message}`).join(", "));p=(x,b,w,S,M)=>_.value.evaluate(x,b,{},w,void 0,void 0,S,M),m=!Yn(_.value.expression)}return{filter:u,dynamicFilter:p||void 0,needGeometry:Cc(n),needFeature:!!m}}function Ic(t){if(!Array.isArray(t))return t;const e=function(i){if(ol.has(i[0])){for(let n=1;n<i.length;n++)if(oo(i[n]))return!0}return i}(t);return e===!0?e:e.map(i=>Ic(i))}function Xs(t){let e=!1;const i=[];if(t[0]==="case"){for(let n=1;n<t.length-1;n+=2)e=e||oo(t[n]),i.push(t[n+1]);i.push(t[t.length-1])}else if(t[0]==="match"){e=e||oo(t[1]);for(let n=2;n<t.length-1;n+=2)i.push(t[n+1]);i.push(t[t.length-1])}else if(t[0]==="step"){e=e||oo(t[1]);for(let n=1;n<t.length-1;n+=2)i.push(t[n+1])}e&&(t.length=0,t.push("any",...i));for(let n=1;n<t.length;n++)Xs(t[n])}function oo(t){if(!Array.isArray(t))return!1;if((e=t[0])==="pitch"||e==="distance-from-center")return!0;var e;
vendor: 4,308 bytes, lines 7-8
7for(let i=1;i<t.length;i++)if(oo(t[i]))return!0;return!1}const ol=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Nh(t,e){return t<e?-1:t>e?1:0}function Cc(t){if(!Array.isArray(t))return!1;if(t[0]==="within")return!0;for(let e=1;e<t.length;e++)if(Cc(t[e]))return!0;return!1}function so(t){if(!t)return!0;const e=t[0];return t.length<=1?e!=="any":e==="=="?sl(t[1],t[2],"=="):e==="!="?Hs(sl(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?sl(t[1],t[2],e):e==="any"?(i=t.slice(1),["any"].concat(i.map(so))):e==="all"?["all"].concat(t.slice(1).map(so)):e==="none"?["all"].concat(t.slice(1).map(so).map(Hs)):e==="in"?al(t[1],t.slice(2)):e==="!in"?Hs(al(t[1],t.slice(2))):e==="has"?ll(t[1]):e==="!has"?Hs(ll(t[1])):e!=="within"||t;var i}function sl(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function al(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Nh)]]:["filter-in-small",t,["literal",e]]}}function ll(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Hs(t){return["!",t]}function Jo(t){return nl(ci(t.value))?hi(Ar({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Qo(t)}function Qo(t){const e=t.value,i=t.key;if(_t(e)!=="array")return[new Fe(i,e,`array expected, ${_t(e)} found`)];const n=t.styleSpec;let s,c=[];if(e.length<1)return[new Fe(i,e,"filter array must have at least 1 element")];switch(c=c.concat(qs({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ht(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ht(e[1])==="$type"&&c.push(new Fe(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new Fe(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=_t(e[1]),s!=="string"&&c.push(new Fe(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u<e.length;u++)s=_t(e[u]),Ht(e[1])==="$type"?c=c.concat(qs({key:`${i}[${u}]`,value:e[u],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):s!=="string"&&s!=="number"&&s!=="boolean"&&c.push(new Fe(`${i}[${u}]`,e[u],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)c=c.concat(Qo({key:`${i}[${u}]`,value:e[u],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":s=_t(e[1]),e.length!==2?c.push(new Fe(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):s!=="string"&&c.push(new Fe(`${i}[1]`,e[1],`string expected, ${s} found`));break;case"within":s=_t(e[1]),e.length!==2?c.push(new Fe(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):s!=="object"&&c.push(new Fe(`${i}[1]`,e[1],`object expected, ${s} found`))}return c}function cl(t,e){const i=t.key,n=t.style,s=t.styleSpec,c=t.value,u=t.objectKey,p=s[`${e}_${t.layerType}`];if(!p)return[];const m=u.match(/^(.*)-transition$/);if(e==="paint"&&m&&p[m[1]]&&p[m[1]].transition)return xi({key:i,value:c,valueSpec:s.transition,style:n,styleSpec:s});const _=t.valueSpec||p[u];if(!_)return[new Fe(i,c,`unknown property "${u}"`)];let x;if(_t(c)==="string"&&to(_)&&!_.tokens&&(x=/^{([^}]+)}$/.exec(c))){const w=`\`{ "type": "identity", "property": ${x?JSON.stringify(x[1]):'"_"'} }\``;return[new Fe(i,c,`"${u}" does not support interpolation syntax
8Use an identity property function instead: ${w}.`)]}const b=[];return t.layerType==="symbol"&&(u==="text-field"&&n&&!n.glyphs&&b.push(new Fe(i,c,'use of "text-field" requires a style "glyphs" property')),u==="text-font"&&qo(ci(c))&&Ht(c.type)==="identity"&&b.push(new Fe(i,c,'"text-font" does not support identity functions'))),b.concat(xi({key:t.key,value:c,valueSpec:_,style:n,styleSpec:s,expressionContext:"property",propertyType:e,propertyKey:u}))}function zc(t){return cl(t,"paint")}function hl(t){return cl(t,"layout")}function Pc(t){let e=[];const i=t.value,n=t.key,s=t.style,c=t.styleSpec;i.type||i.ref||e.push(new Fe(n,i,'either "type" or "ref" is required'));let u=Ht(i.type);const p=Ht(i.ref);
8if(i.id){const m=Ht(i.id);for(let _=0;_<t.arrayIndex;_++){const x=s.layers[_];Ht(x.id)===m&&e.push(new Fe(n,i.id,`duplicate layer id "${i.id}", previously used at line ${x.id.__line__}`))}}if("ref"in i){let m;["type","source","source-layer","filter","layout"].forEach(_=>{_ in i&&e.push(new Fe(n,i[_],`"${_}" is prohibited for ref layers`))}),s.layers.forEach(_=>{Ht(_.id)===p&&(m=_)}),m?m.ref?e.push(new Fe(n,i.ref,"ref cannot reference another ref layer")):u=Ht(m.type):typeof p=="string"&&e.push(new Fe(n,i.ref,`ref layer "${p}" not found`))}else if(u!=="background"&&u!=="sky")if(i.source){const m=s.sources&&s.sources[i.source],_=m&&Ht(m.type);m?_==="vector"&&u==="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a raster source`)):_==="raster"&&u!=="raster"?e.push(new Fe(n,i.source,`layer "${i.id}" requires a vector source`)):_!=="vector"||i["source-layer"]?_==="raster-dem"&&u!=="hillshade"?e.push(new Fe(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):u!=="line"||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||_==="geojson"&&m.lineMetrics||e.push(new Fe(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Fe(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Fe(n,i.source,`source "${i.source}" not found`))}else e.push(new Fe(n,i,'missing required property "source"'));return e=e.concat(ir({key:n,value:i,valueSpec:c.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>xi({key:`${n}.type`,value:i.type,valueSpec:c.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:m=>Jo(Ar({layerType:u},m)),layout:m=>ir({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>hl(Ar({layerType:u},_))}}),paint:m=>ir({layer:i,key:m.key,value:m.value,valueSpec:{},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":_=>zc(Ar({layerType:u},_))}})}})),e}function Jr(t){const e=t.value,i=t.key,n=_t(e);return n!=="string"?[new Fe(i,e,`string expected, ${n} found`)]:[]}const kc={promoteId:function({key:t,value:e}){if(_t(e)==="string")return Jr({key:t,value:e});{const i=[];for(const n in e)i.push(...Jr({key:`${t}.${n}`,value:e[n]}));return i}}};function Dc(t){const e=t.value,i=t.key,n=t.styleSpec,s=t.style;if(!e.type)return[new Fe(i,e,'"type" is required')];const c=Ht(e.type);let u;switch(c){case"vector":case"raster":case"raster-dem":return u=ir({key:i,value:e,valueSpec:n[`source_${c.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:kc}),u;case"geojson":if(u=ir({key:i,value:e,valueSpec:n.source_geojson,style:s,styleSpec:n,objectElementValidators:kc}),e.cluster)for(const p in e.clusterProperties){const[m,_]=e.clusterProperties[p],x=typeof m=="string"?[m,["accumulated"],["get",p]]:m;u.push(...hi({key:`${i}.${p}.map`,value:_,expressionContext:"cluster-map"})),u.push(...hi({key:`${i}.${p}.reduce`,value:x,expressionContext:"cluster-reduce"}))}return u;case"video":return ir({key:i,value:e,valueSpec:n.source_video,style:s,styleSpec:n});case"image":return ir({key:i,value:e,valueSpec:n.source_image,style:s,styleSpec:n});case"canvas":return[new Fe(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qs({key:`${i}.type`,value:e.type,valueSpec:{values:jh(n)},style:s,styleSpec:n})}}function jh(t){return t.source.reduce((e,i)=>{const n=t[i];return n.type.type==="enum"&&(e=e.concat(Object.keys(n.type.values))),e},[])}function Lc(t){const e=t.value,i=t.styleSpec,n=i.light,s=t.style;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("light",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&n[m[1]]&&n[m[1]].transition?xi({key:p,value:e[p],valueSpec:i.transition,style:s,styleSpec:i}):n[p]?xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}function ul(t){const e=t.value,i=t.key,n=t.style,s=t.styleSpec,c=s.terrain;let u=[];const p=_t(e);if(e===void 0)return u;if(p!=="object")return u=u.concat([new Fe("terrain",e,`object expected, ${p} found`)]),u;for(const m in e){const _=m.match(/^(.*)-transition$/);u=u.concat(_&&c[_[1]]&&c[_[1]].transition?xi({key:m,value:e[m],valueSpec:s.transition,style:n,styleSpec:s}
8):c[m]?xi({key:m,value:e[m],valueSpec:c[m],style:n,styleSpec:s}):[new Fe(m,e[m],`unknown property "${m}"`)])}if(e.source){const m=n.sources&&n.sources[e.source],_=m&&Ht(m.type);m?_!=="raster-dem"&&u.push(new Fe(i,e.source,`terrain cannot be used with a source of type ${String(_)}, it only be used with a "raster-dem" source type`)):u.push(new Fe(i,e.source,`source "${e.source}" not found`))}else u.push(new Fe(i,e,'terrain is missing required property "source"'));return u}function Rc(t){const e=t.value,i=t.style,n=t.styleSpec,s=n.fog;let c=[];const u=_t(e);if(e===void 0)return c;if(u!=="object")return c=c.concat([new Fe("fog",e,`object expected, ${u} found`)]),c;for(const p in e){const m=p.match(/^(.*)-transition$/);c=c.concat(m&&s[m[1]]&&s[m[1]].transition?xi({key:p,value:e[p],valueSpec:n.transition,style:i,styleSpec:n}):s[p]?xi({key:p,value:e[p],valueSpec:s[p],style:i,styleSpec:n}):[new Fe(p,e[p],`unknown property "${p}"`)])}return c}const Bc={"*":()=>[],array:Ac,boolean:function(t){const e=t.value,i=t.key,n=_t(e);return n!=="boolean"?[new Fe(i,e,`boolean expected, ${n} found`)]:[]},number:Ho,color:function(t){const e=t.key,i=t.value,n=_t(i);return n!=="string"?[new Fe(e,i,`color expected, ${n} found`)]:Ca(i)===null?[new Fe(e,i,`color expected, "${i}" found`)]:[]},enum:qs,filter:Jo,function:Ko,layer:Pc,object:ir,source:Dc,light:Lc,terrain:ul,fog:Rc,string:Jr,formatted:function(t){return Jr(t).length===0?[]:hi(t)},resolvedImage:function(t){return Jr(t).length===0?[]:hi(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,s=t.style;let c=[];const u=_t(e);if(u==="object")for(const p in e)c=c.concat(xi({key:p,value:e[p],valueSpec:n[p],style:s,styleSpec:i}));else u!=="string"&&(c=c.concat([new Fe("projection",e,`object or string expected, ${u} found`)]));return c}};function xi(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&qo(Ht(e))?Ko(t):i.expression&&ro(ci(e))?hi(t):i.type&&Bc[i.type]?Bc[i.type](t):ir(Ar({},t,{valueSpec:i.type?n[i.type]:i}))}function Gh(t){const e=t.value,i=t.key,n=Jr(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new Fe(i,e,'"glyphs" url must include a "{range}" token'))),n}function Oc(t,e=fe){return Zi(xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Gh,"*":()=>[]}}))}const $h=t=>Zi(zc(t)),Zh=t=>Zi(hl(t));function Zi(t){return t.slice().sort((e,i)=>e.line&&i.line?e.line-i.line:0)}function Fc(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Mr(new Error(n.message))),i=!0;return i}var qh=dr,rr=3;function dr(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(e=s[1])+2*(i=s[2]);for(var c=0;c<this.d*this.d;c++){var u=s[rr+c],p=s[rr+c+1];n.push(u===p?null:s.subarray(u,p))}var m=s[rr+n.length+1];this.keys=s.subarray(s[rr+n.length],m),this.bboxes=s.subarray(m),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var _=0;_<this.d*this.d;_++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var x=i/e*t;this.min=-x,this.max=t+x}dr.prototype.insert=function(t,e,i,n,s){this._forEachCell(e,i,n,s,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(s)},dr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},dr.prototype._insertCell=function(t,e,i,n,s,c){this.cells[s].push(c)},dr.prototype.query=function(t,e,i,n,s){var c=this.min,u=this.max;if(t<=c&&e<=c&&u<=i&&u<=n&&!s)return Array.prototype.slice.call(this.keys);var p=[];return this._forEachCell(t,e,i,n,this._queryCell,p,{},s),p},dr.prototype._queryCell=function(t,e,i,n,s,c,u,p){var m=this.cells[s];if(m!==null)for(var _=this.keys,x=this.bboxes,b=0;b<m.length;b++){var w=m[b];if(u[w]===void 0){var S=4*w;(p?p(x[S+0],x[S+1],x[S+2],x[S+3]):t<=x[S+2]&&e<=x[S+3]&&i>=x[S+0]&&n>=x[S+1])?(u[w]=!0,c.push(_[w])):u[w]=!1}}}
8,dr.prototype._forEachCell=function(t,e,i,n,s,c,u,p){for(var m=this._convertToCellCoord(t),_=this._convertToCellCoord(e),x=this._convertToCellCoord(i),b=this._convertToCellCoord(n),w=m;w<=x;w++)for(var S=_;S<=b;S++){var M=this.d*S+w;if((!p||p(this._convertFromCellCoord(w),this._convertFromCellCoord(S),this._convertFromCellCoord(w+1),this._convertFromCellCoord(S+1)))&&s.call(this,t,e,i,n,M,c,u,p))return}},dr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},dr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},dr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=rr+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var s=new Int32Array(e+i+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;for(var c=e,u=0;u<t.length;u++){var p=t[u];s[rr+u]=c,s.set(p,c),c+=p.length}return s[rr+t.length]=c,s.set(this.keys,c),s[rr+t.length+1]=c+=this.keys.length,s.set(this.bboxes,c),c+=this.bboxes.length,s.buffer};var Tn=Ji(qh);const Ks={};function Ue(t,e,i={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ks[e]={klass:t,omit:i.omit||[]}}Ue(Object,"Object"),Tn.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Tn.deserialize=function(t){return new Tn(t.buffer)},Object.defineProperty(Tn,"name",{value:"Grid"}),Ue(Tn,"Grid"),Ue(Zt,"Color"),Ue(Error,"Error"),Ue(Kr,"AJAXError"),Ue(Gi,"ResolvedImage"),Ue($s,"StylePropertyFunction"),Ue(Gs,"StyleExpression",{omit:["_evaluator"]}),Ue(Wo,"ZoomDependentExpression"),Ue(rl,"ZoomConstantExpression"),Ue(zr,"CompoundExpression",{omit:["_evaluate"]});for(const t in Zo)Ks[Zo[t]._classRegistryKey]||Ue(Zo[t],`Expression${t}`);function dl(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function pl(t){return Se.ImageBitmap&&t instanceof Se.ImageBitmap}function ao(t,e){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(dl(t)||pl(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const i=t;return e&&e.push(i.buffer),i}if(t instanceof Se.ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const n of t)i.push(ao(n,e));return i}if(typeof t=="object"){const i=t.constructor,n=i._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const s=i.serialize?i.serialize(t,e):{};if(!i.serialize){for(const c in t)t.hasOwnProperty(c)&&(Ks[n].omit.indexOf(c)>=0||(s[c]=ao(t[c],e)));t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(s.$name=n),s}throw new Error("can't serialize object of type "+typeof t)}function En(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||dl(t)||pl(t)||ArrayBuffer.isView(t)||t instanceof Se.ImageData)return t;if(Array.isArray(t))return t.map(En);if(typeof t=="object"){const e=t.$name||"Object",{klass:i}=Ks[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const s of Object.keys(t))s!=="$name"&&(n[s]=En(t[s]));return n}throw new Error("can't deserialize object of type "+typeof t)}const Be={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>
8=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function fl(t){for(const e of t)if(ml(e.charCodeAt(0)))return!0;return!1}function Wh(t){for(const e of t)if(!Uc(e.charCodeAt(0)))return!1;return!0}function Uc(t){return!(Be.Arabic(t)||Be["Arabic Supplement"](t)||Be["Arabic Extended-A"](t)||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t))}function ml(t){return!(t!==746&&t!==747&&(t<4352||!(Be["Bopomofo Extended"](t)||Be.Bopomofo(t)||Be["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Be["CJK Compatibility Ideographs"](t)||Be["CJK Compatibility"](t)||Be["CJK Radicals Supplement"](t)||Be["CJK Strokes"](t)||!(!Be["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Be["CJK Unified Ideographs Extension A"](t)||Be["CJK Unified Ideographs"](t)||Be["Enclosed CJK Letters and Months"](t)||Be["Hangul Compatibility Jamo"](t)||Be["Hangul Jamo Extended-A"](t)||Be["Hangul Jamo Extended-B"](t)||Be["Hangul Jamo"](t)||Be["Hangul Syllables"](t)||Be.Hiragana(t)||Be["Ideographic Description Characters"](t)||Be.Kanbun(t)||Be["Kangxi Radicals"](t)||Be["Katakana Phonetic Extensions"](t)||Be.Katakana(t)&&t!==12540||!(!Be["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Be["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Be["Unified Canadian Aboriginal Syllabics"](t)||Be["Unified Canadian Aboriginal Syllabics Extended"](t)||Be["Vertical Forms"](t)||Be["Yijing Hexagram Symbols"](t)||Be["Yi Syllables"](t)||Be["Yi Radicals"](t))))}
8function Vc(t){return!(ml(t)||function(e){return!!(Be["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Be["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Be["Letterlike Symbols"](e)||Be["Number Forms"](e)||Be["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Be["Control Pictures"](e)&&e!==9251||Be["Optical Character Recognition"](e)||Be["Enclosed Alphanumerics"](e)||Be["Geometric Shapes"](e)||Be["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Be["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Be["CJK Symbols and Punctuation"](e)||Be.Katakana(e)||Be["Private Use Area"](e)||Be["CJK Compatibility Forms"](e)||Be["Small Form Variants"](e)||Be["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(t))}function Nc(t){return t>=1424&&t<=2303||Be["Arabic Presentation Forms-A"](t)||Be["Arabic Presentation Forms-B"](t)}function Xh(t,e){return!(!e&&Nc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Be.Khmer(t))}function Hh(t){for(const e of t)if(Nc(e.charCodeAt(0)))return!0;return!1}const _l="deferred",gl="loading",yl="loaded";let lo=null,l="unavailable",r=null;const o=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(l="error"),lo&&lo(t)};function h(){d.fire(new _n("pluginStateChange",{pluginStatus:l,pluginURL:r}))}const d=new Co,f=function(){return l},g=function(){if(l!==_l||!r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");l=gl,h(),r&&Gn({url:r},t=>{t?o(t):(l=yl,h())})},y={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>l===yl||y.applyArabicShaping!=null,isLoading:()=>l===gl,setState(t){l=t.pluginStatus,r=t.pluginURL},isParsed:()=>y.applyArabicShaping!=null&&y.processBidirectionalText!=null&&y.processStyledBidirectionalText!=null,getPluginURL:()=>r};class v{constructor(e,i){this.zoom=e,i?(this.now=i.now,this.fadeDuration=i.fadeDuration,this.transition=i.transition,this.pitch=i.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(i,n){for(const s of i)if(!Xh(s.charCodeAt(0),n))return!1;return!0}(e,y.isLoaded())}}class E{constructor(e,i){this.property=e,this.value=i,this.expression=function(n,s){if(qo(n))return new $s(n,s);if(ro(n)){const c=Xo(n,s);if(c.result==="error")throw new Error(c.value.map(u=>`${u.key}: ${u.message}`).join(", "));return c.value}{let c=n;return typeof n=="string"&&s.type==="color"&&(c=Zt.parse(n)),{kind:"constant",evaluate:()=>c}}}(i===void 0?e.specification.default:i,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,i,n){return this.property.possiblyEvaluate(this,e,i,n)}}class T{constructor(e){this.property=e,this.value=new E(e,void 0)}transitioned(e,i){return new k(this.property,this.value,i,Wt({},e.transition,this.transition),e.now)}untransitioned(){return new k(this.property,this.value,null,{},0)}}class A{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Li(this._values[e].value.value)}setValue(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].value=new E(this._values[e].property,i===null?void 0:Li(i))}getTransition(e){return Li(this._values[e].transition)}setTransition(e,i){this._values.hasOwnProperty(e)||(this._values[e]=new T(this._values[e].property)),this._values[e].transition=Li(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n);const s=this.getTransition(i);s!==void 0&&(e[`${i}-transition`]=s)}return e}transitioned(e,i){const n=new R(this._properties);for(const s of Object.keys(this._values))n._values[s]=this._values[s].transitioned(e,i._values[s]);return n}untransitioned(){const e=new R(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class k{constructor(e,i,n,s,c){const u=s.delay||0,p=s.duration||0;c=c||0,this.property=e,this.value=i,this.begin=c+u,this.end=this.begin+p,e.specification.transition&&(s.delay||s.duration)&&(this.prior=n)}possiblyEvaluate(e,i,n){const s=e.now||0,c=this.value.possiblyEvaluate(e,i,n),u=this.prior;if(u){if(s>this.end)return this.prior=null,c;if(this.value.isDataDriven())return this.prior=null,c;if(s<this.begin)return u.possiblyEvaluate(e,i,n);{const p=(s-this.begin)/(this.end-this.begin);return this.property.interpolate(u.possiblyEvaluate(e,i,n),c,_s(p))}}return c}}class R{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,n){const s=new F(this._properties);for(const c of Object.keys(this._values))s._values[c]=this._values[c].possiblyEvaluate(e,i,n);return s}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class O{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return Li(this._values[e].value)}setValue(e,i){this._values[e]=new E(this._values[e].property,i===null?void 0:Li(i))}serialize(){const e={};for(const i of Object.keys(this._values)){const n=this.getValue(i);n!==void 0&&(e[i]=n)}return e}possiblyEvaluate(e,i,n){const s=new F(this._properties);for(const c of Object.keys(this._values))s._values[c]=this._values[c].possiblyEvaluate(e,i,n);return s}}class B{constructor(e,i,n){this.property=e,this.value=i,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,n,s){return this.property.evaluate(this.value,this.parameters,e,i,n,s)}}class F{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class I{constructor(e){this.specification=e}
vendor: 20,474 bytes, line 8
8possiblyEvaluate(e,i){return e.expression.evaluate(i)}interpolate(e,i,n){const s=Vo[this.specification.type];return s?s(e,i,n):e}}class L{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,n,s){return new B(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},n,s)}:e.expression,i)}interpolate(e,i,n){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new B(this,{kind:"constant",value:void 0},e.parameters);const s=Vo[this.specification.type];return s?new B(this,{kind:"constant",value:s(e.value.value,i.value.value,n)},e.parameters):e}evaluate(e,i,n,s,c,u){return e.kind==="constant"?e.value:e.evaluate(i,n,s,c,u)}}class N{constructor(e){this.specification=e}possiblyEvaluate(e,i,n,s){return!!e.expression.evaluate(i,null,{},n,s)}interpolate(){return!1}}class j{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const i=new v(0,{});for(const n in e){const s=e[n];s.specification.overridable&&this.overridableProperties.push(n);const c=this.defaultPropertyValues[n]=new E(s,void 0),u=this.defaultTransitionablePropertyValues[n]=new T(s);this.defaultTransitioningPropertyValues[n]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=c.possiblyEvaluate(i)}}}function K(t,e){return 256*(t=ct(Math.floor(t),0,255))+ct(Math.floor(e),0,255)}Ue(L,"DataDrivenProperty"),Ue(I,"DataConstantProperty"),Ue(N,"ColorRampProperty");const J={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Y{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ie{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function te(t,e=1){let i=0,n=0;return{members:t.map(s=>{const c=J[s.type].BYTES_PER_ELEMENT,u=i=le(i,Math.max(e,c)),p=s.components||1;return n=Math.max(n,c),i+=c*p,{name:s.name,type:s.type,components:p,offset:u}}),size:le(i,Math.max(n,e)),alignment:e}}function le(t,e){return Math.ceil(t/e)*e}class Te extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.int16[s+0]=i,this.int16[s+1]=n,e}}Te.prototype.bytesPerElement=4,Ue(Te,"StructArrayLayout2i4");class oe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=s,e}}oe.prototype.bytesPerElement=6,Ue(oe,"StructArrayLayout3i6");class ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.int16[u+0]=i,this.int16[u+1]=n,this.int16[u+2]=s,this.int16[u+3]=c,e}}ge.prototype.bytesPerElement=8,Ue(ge,"StructArrayLayout4i8");class he extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=6*e,x=12*e,b=3*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.uint8[x+4]=s,this.uint8[x+5]=c,this.uint8[x+6]=u,this.uint8[x+7]=p,this.float32[b+2]=m,e}}he.prototype.bytesPerElement=12,Ue(he,"StructArrayLayout2i4ub1f12");class we extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.float32[u+0]=i,this.float32[u+1]=n,this.float32[u+2]=s,this.float32[u+3]=c,e}}we.prototype.bytesPerElement=16,Ue(we,"StructArrayLayout4f16");class ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=6*e,m=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=n,this.uint16[p+2]=s,this.uint16[p+3]=c,this.float32[m+2]=u,e}}ae.prototype.bytesPerElement=12,Ue(ae,"StructArrayLayout4ui1f12");class _e extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=4*e;return this.uint16[u+0]=i,this.uint16[u+1]=n,this.uint16[u+2]=s,this.uint16[u+3]=c,e}}_e.prototype.bytesPerElement=8,Ue(_e,"StructArrayLayout4ui8");class Me extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=6*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.int16[m+3]=c,this.int16[m+4]=u,this.int16[m+5]=p,e}}Me.prototype.bytesPerElement=12,Ue(Me,"StructArrayLayout6i12");class ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w){const S=this.length;return this.resize(S+1),this.emplace(S,e,i,n,s,c,u,p,m,_,x,b,w)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=12*e;return this.int16[M+0]=i,this.int16[M+1]=n,this.int16[M+2]=s,this.int16[M+3]=c,this.uint16[M+4]=u,this.uint16[M+5]=p,this.uint16[M+6]=m,this.uint16[M+7]=_,this.int16[M+8]=x,this.int16[M+9]=b,this.int16[M+10]=w,this.int16[M+11]=S,e}}ve.prototype.bytesPerElement=24,Ue(ve,"StructArrayLayout4i4ui4i24");class Ae extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,n,s,c,u)}emplace(e,i,n,s,c,u,p){const m=10*e,_=5*e;return this.int16[m+0]=i,this.int16[m+1]=n,this.int16[m+2]=s,this.float32[_+2]=c,this.float32[_+3]=u,this.float32[_+4]=p,e}}Ae.prototype.bytesPerElement=20,Ue(Ae,"StructArrayLayout3i3f20");class Ge extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Ge.prototype.bytesPerElement=4,Ue(Ge,"StructArrayLayout1ul4");class Xe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S){const M=this.length;return this.resize(M+1),this.emplace(M,e,i,n,s,c,u,p,m,_,x,b,w,S)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=20*e,D=10*e;return this.int16[C+0]=i,this.int16[C+1]=n,this.int16[C+2]=s,this.int16[C+3]=c,this.int16[C+4]=u,this.float32[D+3]=p,this.float32[D+4]=m,this.float32[D+5]=_,this.float32[D+6]=x,this.int16[C+14]=b,this.uint32[D+8]=w,this.uint16[C+18]=S,this.uint16[C+19]=M,e}}Xe.prototype.bytesPerElement=40,Ue(Xe,"StructArrayLayout5i4f1i1ul2ui40");class Ve extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,n,s,c,u,p)}emplace(e,i,n,s,c,u,p,m){const _=8*e;return this.int16[_+0]=i,this.int16[_+1]=n,this.int16[_+2]=s,this.int16[_+4]=c,this.int16[_+5]=u,this.int16[_+6]=p,this.int16[_+7]=m,e}}Ve.prototype.bytesPerElement=16,Ue(Ve,"StructArrayLayout3i2i2i16");class qe extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=4*e,m=8*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.int16[m+6]=c,this.int16[m+7]=u,e}}qe.prototype.bytesPerElement=16,Ue(qe,"StructArrayLayout2f1f2i16");class lt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=12*e,p=3*e;return this.uint8[u+0]=i,this.uint8[u+1]=n,this.float32[p+1]=s,this.float32[p+2]=c,e}}lt.prototype.bytesPerElement=12,Ue(lt,"StructArrayLayout2ub2f12");class ot extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.float32[c+0]=i,this.float32[c+1]=n,this.float32[c+2]=s,e}}ot.prototype.bytesPerElement=12,Ue(ot,"StructArrayLayout3f12");class je extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,i,n)}emplace(e,i,n,s){const c=3*e;return this.uint16[c+0]=i,this.uint16[c+1]=n,this.uint16[c+2]=s,e}}je.prototype.bytesPerElement=6,Ue(je,"StructArrayLayout3ui6");class wt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X){const W=this.length;return this.resize(W+1),this.emplace(W,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W){const ce=30*e,se=15*e,me=60*e;return this.int16[ce+0]=i,this.int16[ce+1]=n,this.int16[ce+2]=s,this.float32[se+2]=c,this.float32[se+3]=u,this.uint16[ce+8]=p,this.uint16[ce+9]=m,this.uint32[se+5]=_,this.uint32[se+6]=x,this.uint32[se+7]=b,this.uint16[ce+16]=w,this.uint16[ce+17]=S,this.uint16[ce+18]=M,this.float32[se+10]=C,this.float32[se+11]=D,this.uint8[me+48]=U,this.uint8[me+49]=q,this.uint8[me+50]=V,this.uint32[se+13]=$,this.int16[ce+28]=X,this.uint8[me+58]=W,e}}wt.prototype.bytesPerElement=60,Ue(wt,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Tt extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be)}emplace(e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D,U,q,V,$,X,W,ce,se,me,Ee,ue,ye,xe,be,Ce){const pe=38*e,De=19*e;return this.int16[pe+0]=i,this.int16[pe+1]=n,this.int16[pe+2]=s,this.float32[De+2]=c,this.float32[De+3]=u,this.int16[pe+8]=p,this.int16[pe+9]=m,this.int16[pe+10]=_,this.int16[pe+11]=x,this.int16[pe+12]=b,this.int16[pe+13]=w,this.uint16[pe+14]=S,this.uint16[pe+15]=M,this.uint16[pe+16]=C,this.uint16[pe+17]=D,this.uint16[pe+18]=U,this.uint16[pe+19]=q,this.uint16[pe+20]=V,this.uint16[pe+21]=$,this.uint16[pe+22]=X,this.uint16[pe+23]=W,this.uint16[pe+24]=ce,this.uint16[pe+25]=se,this.uint16[pe+26]=me,this.uint16[pe+27]=Ee,this.uint16[pe+28]=ue,this.uint32[De+15]=ye,this.float32[De+16]=xe,this.float32[De+17]=be,this.float32[De+18]=Ce,e}}Tt.prototype.bytesPerElement=76,Ue(Tt,"StructArrayLayout3i2f6i15ui1ul3f76");class Et extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}Et.prototype.bytesPerElement=4,Ue(Et,"StructArrayLayout1f4");class St extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,n,s,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,i,n,s,c)}emplace(e,i,n,s,c,u){const p=5*e;return this.float32[p+0]=i,this.float32[p+1]=n,this.float32[p+2]=s,this.float32[p+3]=c,this.float32[p+4]=u,e}}St.prototype.bytesPerElement=20,Ue(St,"StructArrayLayout5f20");class vi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,n,s){const c=this.length;return this.resize(c+1),this.emplace(c,e,i,n,s)}emplace(e,i,n,s,c){const u=6*e;return this.uint32[3*e+0]=i,this.uint16[u+2]=n,this.uint16[u+3]=s,this.uint16[u+4]=c,e}}vi.prototype.bytesPerElement=12,Ue(vi,"StructArrayLayout1ul3ui12");class ui extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=n,e}}ui.prototype.bytesPerElement=4,Ue(ui,"StructArrayLayout2ui4");class qi extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}qi.prototype.bytesPerElement=2,Ue(qi,"StructArrayLayout1ui2");class pr extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,i)}emplace(e,i,n){const s=2*e;return this.float32[s+0]=i,this.float32[s+1]=n,e}}pr.prototype.bytesPerElement=8,Ue(pr,"StructArrayLayout2f8");class Ft extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Ft.prototype.size=40;class Mt extends Xe{get(e){return new Ft(this,e)}}Ue(Mt,"CollisionBoxArray");class yt extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}yt.prototype.size=60;class Kt extends wt{get(e){return new yt(this,e)}}Ue(Kt,"PlacedSymbolArray");class Ei extends Y{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Ei.prototype.size=76;class Bt extends Tt{get(e){return new Ei(this,e)}}Ue(Bt,"SymbolInstanceArray");
8class Ii extends Et{getoffsetX(e){return this.float32[1*e+0]}}Ue(Ii,"GlyphOffsetArray");class Ys extends Te{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ue(Ys,"SymbolLineVertexArray");class Sn extends Y{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Sn.prototype.size=12;class es extends vi{get(e){return new Sn(this,e)}}Ue(es,"FeatureIndexArray");class Rr extends ui{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ue(Rr,"FillExtrusionCentroidArray");const Qr=te([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Mn=te([{name:"a_dash",components:4,type:"Uint16"}]);var Js={exports:{}},ts={exports:{}};ts.exports=function(t,e){var i,n,s,c,u,p,m,_;for(n=t.length-(i=3&t.length),s=e,u=3432918353,p=461845907,_=0;_<n;)m=255&t.charCodeAt(_)|(255&t.charCodeAt(++_))<<8|(255&t.charCodeAt(++_))<<16|(255&t.charCodeAt(++_))<<24,++_,s=27492+(65535&(c=5*(65535&(s=(s^=m=(65535&(m=(m=(65535&m)*u+(((m>>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(m=0,i){case 3:m^=(255&t.charCodeAt(_+2))<<16;case 2:m^=(255&t.charCodeAt(_+1))<<8;case 1:s^=m=(65535&(m=(m=(65535&(m^=255&t.charCodeAt(_)))*u+(((m>>>16)*u&65535)<<16)&4294967295)<<15|m>>>17))*p+(((m>>>16)*p&65535)<<16)&4294967295}return s^=t.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0};var xl=ts.exports,sd={exports:{}};sd.exports=function(t,e){for(var i,n=t.length,s=e^n,c=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24))+((1540483477*(i>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++c;switch(n){case 3:s^=(255&t.charCodeAt(c+2))<<16;case 2:s^=(255&t.charCodeAt(c+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(c)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0};var ad=xl,Vf=sd.exports;Js.exports=ad,Js.exports.murmur3=ad,Js.exports.murmur2=Vf;var Kh=Ji(Js.exports);class jc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,n,s){this.ids.push(ld(e)),this.positions.push(i,n,s)}getPositions(e){const i=ld(e);let n=0,s=this.ids.length-1;for(;n<s;){const u=n+s>>1;this.ids[u]>=i?s=u:n=u+1}const c=[];for(;this.ids[n]===i;)c.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return c}static serialize(e,i){const n=new Float64Array(e.ids),s=new Uint32Array(e.positions);return Yh(n,s,0,n.length-1),i&&i.push(n.buffer,s.buffer),{ids:n,positions:s}}static deserialize(e){const i=new jc;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function ld(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Kh(String(t))}function Yh(t,e,i,n){for(;i<n;){const s=t[i+n>>1];let c=i-1,u=n+1;for(;;){do c++;while(t[c]<s);do u--;while(t[u]>s);if(c>=u)break;Gc(t,c,u),Gc(e,3*c,3*u),Gc(e,3*c+1,3*u+1),Gc(e,3*c+2,3*u+2)}u-i<n-u?(Yh(t,e,i,u),i=u+1):(Yh(t,e,u+1,n),n=u)}}function Gc(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}Ue(jc,"FeaturePositionMap");class An{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,i){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,i),this.initialized=!0),!!this.location}}class $c extends An{constructor(e){super(e),this.current=0}set(e,i,n){this.fetchUniformLocation(e,i)&&this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class cd extends An{constructor(e){super(e),this.current=[0,0,0,0]}set(e,i,n){this.fetchUniformLocation(e,i)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3])))}}class hd extends An{constructor(e){super(e),this.current=Zt.transparent}set(e,i,n){this.fetchUniformLocation(e,i)&&(n.r===this.current.r&&n.g===this.current.g&&n.b===this.current.b&&n.a===this.current.a||(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a)))}}const Nf=new Float32Array(16),jf=new Float32Array(9),Gf=new Float32Array(4);function Jh(t){return[K(255*t.r,255*t.g),K(255*t.b,255*t.a)]}class vl{constructor(e,i,n){this.value=e,this.uniformNames=i.map(s=>`u_${s}`),this.type=n}setUniform(e,i,n,s,c){i.set(e,c,s.constantOr(this.value))}getBinding(e,i){return this.type==="color"?new hd(e):new $c(e)}}class Qs{constructor(e,i){this.uniformNames=i.map(n=>`u_${n}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,i,n,s,c){const u=c==="u_pattern"||c==="u_dash"?this.pattern:c==="u_pixel_ratio"?this.pixelRatio:null;u&&i.set(e,c,u)}getBinding(e,i){return i==="u_pattern"||i==="u_dash"?new cd(e):new $c(e)}}class In{constructor(e,i,n,s){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=i.map(c=>({name:`a_${c}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,i,n,s,c,u){const p=this.paintVertexArray.length,m=this.expression.evaluate(new v(0),i,{},c,s,u);this.paintVertexArray.resize(e),this._setPaintValue(p,e,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:0},n,s,void 0,c);this._setPaintValue(e,i,u)}
vendor: 7,265 bytes, line 8
8_setPaintValue(e,i,n){if(this.type==="color"){const s=Jh(n);for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,s[0],s[1])}else{for(let s=e;s<i;s++)this.paintVertexArray.emplace(s,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Br{constructor(e,i,n,s,c,u){this.expression=e,this.uniformNames=i.map(p=>`u_${p}_t`),this.type=n,this.useIntegerZoom=s,this.zoom=c,this.maxValue=0,this.paintVertexAttributes=i.map(p=>({name:`a_${p}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,n,s,c,u){const p=this.expression.evaluate(new v(this.zoom),i,{},c,s,u),m=this.expression.evaluate(new v(this.zoom+1),i,{},c,s,u),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,m)}updatePaintArray(e,i,n,s,c){const u=this.expression.evaluate({zoom:this.zoom},n,s,void 0,c),p=this.expression.evaluate({zoom:this.zoom+1},n,s,void 0,c);this._setPaintValue(e,i,u,p)}_setPaintValue(e,i,n,s){if(this.type==="color"){const c=Jh(n),u=Jh(s);for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,c[0],c[1],u[0],u[1])}else{for(let c=e;c<i;c++)this.paintVertexArray.emplace(c,n,s);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(s))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i,n,s,c){const u=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,p=ct(this.expression.interpolationFactor(u,this.zoom,this.zoom+1),0,1);i.set(e,c,p)}getBinding(e,i){return new $c(e)}}class co{constructor(e,i,n,s,c){this.expression=e,this.layerId=c,this.paintVertexAttributes=(n==="array"?Mn:Qr).members;for(let u=0;u<i.length;++u);this.paintVertexArray=new s}populatePaintArray(e,i,n){const s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(s,e,i.patterns&&i.patterns[this.layerId],n)}updatePaintArray(e,i,n,s,c,u){this._setPaintValues(e,i,n.patterns&&n.patterns[this.layerId],u)}_setPaintValues(e,i,n,s){if(!s||!n)return;const c=s[n];if(!c)return;const{tl:u,br:p,pixelRatio:m}=c;for(let _=e;_<i;_++)this.paintVertexArray.emplace(_,u[0],u[1],p[0],p[1],m)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ho{constructor(e,i,n=()=>!0){this.binders={},this._buffers=[];const s=[];for(const c in e.paint._values){if(!n(c))continue;const u=e.paint.get(c);if(!(u instanceof B&&to(u.property.specification)))continue;const p=Zf(c,e.type),m=u.value,_=u.property.specification.type,x=!!u.property.useIntegerZoom,b=c==="line-dasharray"||c.endsWith("pattern"),w=c==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant";if(m.kind!=="constant"||w)if(m.kind==="source"||w||b){const S=ud(c,_,"source");this.binders[c]=b?new co(m,p,_,S,e.id):new In(m,p,_,S),s.push(`/a_${c}`)}else{const S=ud(c,_,"composite");this.binders[c]=new Br(m,p,_,x,i,S),s.push(`/z_${c}`)}else this.binders[c]=b?new Qs(m.value,p):new vl(m.value,p,_),s.push(`/u_${c}`)}this.cacheKey=s.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof In||i instanceof Br?i.maxValue:0}populatePaintArrays(e,i,n,s,c,u){for(const p in this.binders){const m=this.binders[p];(m instanceof In||m instanceof Br||m instanceof co)&&m.populatePaintArray(e,i,n,s,c,u)}}setConstantPatternPositions(e){for(const i in this.binders){const n=this.binders[i];n instanceof Qs&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,i,n,s,c,u){let p=!1;for(const m in e){const _=i.getPositions(m);for(const x of _){const b=n.feature(x.index);for(const w in this.binders){const S=this.binders[w];if((S instanceof In||S instanceof Br||S instanceof co)&&S.expression.isStateDependent===!0){const M=s.paint.get(w);S.expression=M.value,S.updatePaintArray(x.start,x.end,b,e[m],c,u),p=!0}}}}return p}defines(){const e=[];for(const i in this.binders){const n=this.binders[i];(n instanceof vl||n instanceof Qs)&&e.push(...n.uniformNames.map(s=>`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof In||n instanceof Br||n instanceof co)for(let s=0;s<n.paintVertexAttributes.length;s++)e.push(n.paintVertexAttributes[s].name)}return e}getBinderUniforms(){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof vl||n instanceof Qs||n instanceof Br)for(const s of n.uniformNames)e.push(s)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const i=[];for(const n in this.binders){const s=this.binders[n];if(s instanceof vl||s instanceof Qs||s instanceof Br)for(const c of s.uniformNames)i.push({name:c,property:n,binding:s.getBinding(e,c)})}return i}setUniforms(e,i,n,s,c){for(const{name:u,property:p,binding:m}of n)this.binders[p].setUniform(e,m,c,s.get(p),u)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const i=this.binders[e];(i instanceof In||i instanceof Br||i instanceof co)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(const i in this.binders){const n=this.binders[i];(n instanceof In||n instanceof Br||n instanceof co)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const i=this.binders[e];(i instanceof In||i instanceof Br||i instanceof co)&&i.destroy()}}}class is{constructor(e,i,n=()=>!0){this.programConfigurations={};for(const s of e)this.programConfigurations[s.id]=new ho(s,i,n);this.needsUpload=!1,this._featureMap=new jc,this._bufferOffset=0}populatePaintArrays(e,i,n,s,c,u,p){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,i,s,c,u,p);i.id!==void 0&&this._featureMap.add(i.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,n,s,c){for(const u of n)this.needsUpload=this.programConfigurations[u.id].updatePaintArrays(e,this._featureMap,i,u,s,c)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const $f={"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
8pwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Zf(t,e){return $f[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const qf={"line-pattern":{source:ae,composite:ae},"fill-pattern":{source:ae,composite:ae},"fill-extrusion-pattern":{source:ae,composite:ae},"line-dasharray":{source:_e,composite:_e}},Wf={color:{source:pr,composite:we},number:{source:Et,composite:pr}};function ud(t,e,i){const n=qf[t];return n&&n[i]||Wf[e][i]}Ue(vl,"ConstantBinder"),Ue(Qs,"PatternConstantBinder"),Ue(In,"SourceExpressionBinder"),Ue(co,"PatternCompositeBinder"),Ue(Br,"CompositeExpressionBinder"),Ue(ho,"ProgramConfiguration",{omit:["_buffers"]}),Ue(is,"ProgramConfigurationSet");const dd="-transition";class Or extends Co{constructor(e,i){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&e.type!=="sky"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new O(i.layout)),i.paint)){this._transitionablePaint=new A(i.paint);for(const n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(const n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new F(i.paint)}}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,i,n={}){i!=null&&this._validate(Zh,`layers.${this.id}.layout.${e}`,e,i,n)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,i):this.visibility=i)}getPaintProperty(e){return Fn(e,dd)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,n={}){if(i!=null&&this._validate($h,`layers.${this.id}.paint.${e}`,e,i,n))return!1;if(Fn(e,dd))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const s=this._transitionablePaint._values[e],c=s.value.isDataDriven(),u=s.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const p=this._transitionablePaint._values[e].value,m=p.isDataDriven(),_=Fn(e,"pattern")||e==="line-dasharray";return m||c||_||this._handleOverridablePaintPropertyUpdate(e,u,p)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,i,n){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,i){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}
8serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Un(e,(i,n)=>!(i===void 0||n==="layout"&&!Object.keys(i).length||n==="paint"&&!Object.keys(i).length))}_validate(e,i,n,s,c={}){return(!c||c.validate!==!1)&&Fc(this,e.call(Oc,{key:i,layerType:this.type,objectKey:n,value:s,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof B&&to(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Ws(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const Xf=te([{name:"a_pos",components:2,type:"Int16"}],4),Hf=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Yt{constructor(e=[]){this.segments=e}prepareSegment(e,i,n,s){let c=this.segments[this.segments.length-1];return e>Yt.MAX_VERTEX_ARRAY_LENGTH&&Ut(`Max vertices per segment is ${Yt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!c||c.vertexLength+e>Yt.MAX_VERTEX_ARRAY_LENGTH||c.sortKey!==s)&&(c={vertexOffset:i.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},s!==void 0&&(c.sortKey=s),this.segments.push(c)),c}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,n,s){return new Yt([{vertexOffset:e,primitiveOffset:i,vertexLength:n,primitiveLength:s,vaos:{},sortKey:0}])}}Yt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue(Yt,"SegmentVector");var Ze=8192;class uo{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):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 At?new At(e.lng,e.lat):At.convert(e),this}setSouthWest(e){return this._sw=e instanceof At?new At(e.lng,e.lat):At.convert(e),this}extend(e){const i=this._sw,n=this._ne;let s,c;if(e instanceof At)s=e,c=e;else{if(!(e instanceof uo))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(uo.convert(e)):this.extend(At.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(At.convert(e)):this;if(s=e._sw,c=e._ne,!s||!c)return this}return i||n?(i.lng=Math.min(s.lng,i.lng),i.lat=Math.min(s.lat,i.lat),n.lng=Math.max(c.lng,n.lng),n.lat=Math.max(c.lat,n.lat)):(this._sw=new At(s.lng,s.lat),this._ne=new At(c.lng,c.lat)),this}getCenter(){return new At((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 At(this.getWest(),this.getNorth())}getSouthEast(){return new At(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:i,lat:n}=At.convert(e);let s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&s}static convert(e){return!e||e instanceof uo?e:new uo(e)}}var Zc=1e-6,Wi=typeof Float32Array<"u"?Float32Array:Array;function pd(){var t=new Wi(9);return Wi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function fd(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=i[0],S=i[1],M=i[2],C=i[3],D=i[4],U=i[5],q=i[6],V=i[7],$=i[8];
vendor: 5,173 bytes, line 8
8return t[0]=w*n+S*u+M*_,t[1]=w*s+S*p+M*x,t[2]=w*c+S*m+M*b,t[3]=C*n+D*u+U*_,t[4]=C*s+D*p+U*x,t[5]=C*c+D*m+U*b,t[6]=q*n+V*u+$*_,t[7]=q*s+V*p+$*x,t[8]=q*c+V*m+$*b,t}function Fr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qh(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8],b=e[9],w=e[10],S=e[11],M=e[12],C=e[13],D=e[14],U=e[15],q=i*p-n*u,V=i*m-s*u,$=i*_-c*u,X=n*m-s*p,W=n*_-c*p,ce=s*_-c*m,se=x*C-b*M,me=x*D-w*M,Ee=x*U-S*M,ue=b*D-w*C,ye=b*U-S*C,xe=w*U-S*D,be=q*xe-V*ye+$*ue+X*Ee-W*me+ce*se;return be?(t[0]=(p*xe-m*ye+_*ue)*(be=1/be),t[1]=(s*ye-n*xe-c*ue)*be,t[2]=(C*ce-D*W+U*X)*be,t[3]=(w*W-b*ce-S*X)*be,t[4]=(m*Ee-u*xe-_*me)*be,t[5]=(i*xe-s*Ee+c*me)*be,t[6]=(D*$-M*ce-U*V)*be,t[7]=(x*ce-w*$+S*V)*be,t[8]=(u*ye-p*Ee+_*se)*be,t[9]=(n*Ee-i*ye-c*se)*be,t[10]=(M*W-C*$+U*q)*be,t[11]=(b*$-x*W-S*q)*be,t[12]=(p*me-u*ue-m*se)*be,t[13]=(i*ue-n*me+s*se)*be,t[14]=(C*V-M*X-D*q)*be,t[15]=(x*X-b*V+w*q)*be,t):null}function rs(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],C=e[12],D=e[13],U=e[14],q=e[15],V=i[0],$=i[1],X=i[2],W=i[3];return t[0]=V*n+$*p+X*b+W*C,t[1]=V*s+$*m+X*w+W*D,t[2]=V*c+$*_+X*S+W*U,t[3]=V*u+$*x+X*M+W*q,t[4]=(V=i[4])*n+($=i[5])*p+(X=i[6])*b+(W=i[7])*C,t[5]=V*s+$*m+X*w+W*D,t[6]=V*c+$*_+X*S+W*U,t[7]=V*u+$*x+X*M+W*q,t[8]=(V=i[8])*n+($=i[9])*p+(X=i[10])*b+(W=i[11])*C,t[9]=V*s+$*m+X*w+W*D,t[10]=V*c+$*_+X*S+W*U,t[11]=V*u+$*x+X*M+W*q,t[12]=(V=i[12])*n+($=i[13])*p+(X=i[14])*b+(W=i[15])*C,t[13]=V*s+$*m+X*w+W*D,t[14]=V*c+$*_+X*S+W*U,t[15]=V*u+$*x+X*M+W*q,t}function bl(t,e,i){var n,s,c,u,p,m,_,x,b,w,S,M,C=i[0],D=i[1],U=i[2];return e===t?(t[12]=e[0]*C+e[4]*D+e[8]*U+e[12],t[13]=e[1]*C+e[5]*D+e[9]*U+e[13],t[14]=e[2]*C+e[6]*D+e[10]*U+e[14],t[15]=e[3]*C+e[7]*D+e[11]*U+e[15]):(s=e[1],c=e[2],u=e[3],p=e[4],m=e[5],_=e[6],x=e[7],b=e[8],w=e[9],S=e[10],M=e[11],t[0]=n=e[0],t[1]=s,t[2]=c,t[3]=u,t[4]=p,t[5]=m,t[6]=_,t[7]=x,t[8]=b,t[9]=w,t[10]=S,t[11]=M,t[12]=n*C+p*D+b*U+e[12],t[13]=s*C+m*D+w*U+e[13],t[14]=c*C+_*D+S*U+e[14],t[15]=u*C+x*D+M*U+e[15]),t}function ns(t,e,i){var n=i[0],s=i[1],c=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*c,t[9]=e[9]*c,t[10]=e[10]*c,t[11]=e[11]*c,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function eu(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[4],u=e[5],p=e[6],m=e[7],_=e[8],x=e[9],b=e[10],w=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=c*s+_*n,t[5]=u*s+x*n,t[6]=p*s+b*n,t[7]=m*s+w*n,t[8]=_*s-c*n,t[9]=x*s-u*n,t[10]=b*s-p*n,t[11]=w*s-m*n,t}function qc(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[8],x=e[9],b=e[10],w=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*s-_*n,t[1]=u*s-x*n,t[2]=p*s-b*n,t[3]=m*s-w*n,t[8]=c*n+_*s,t[9]=u*n+x*s,t[10]=p*n+b*s,t[11]=m*n+w*s,t}function md(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _d(t,e,i){var n,s,c,u=i[0],p=i[1],m=i[2],_=Math.hypot(u,p,m);return _<Zc?null:(u*=_=1/_,p*=_,m*=_,n=Math.sin(e),s=Math.cos(e),t[0]=u*u*(c=1-s)+s,t[1]=p*u*c+m*n,t[2]=m*u*c-p*n,t[3]=0,t[4]=u*p*c-m*n,t[5]=p*p*c+s,t[6]=m*p*c+u*n,t[7]=0,t[8]=u*m*c+p*n,t[9]=p*m*c-u*n,t[10]=m*m*c+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Kf=rs;function tu(){var t=new Wi(3);return Wi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function gd(t){var e=new Wi(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function wl(t){return Math.hypot(t[0],t[1],t[2])}function ea(t,e,i){var n=new Wi(3);return n[0]=t,n[1]=e,n[2]=i,n}function Cn(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function iu(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function yd(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function Tl(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function El(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function nr(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Sl(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t}function Ci(t,e){var i=e[0],n=e[1],s=e[2],c=i*i+n*n+s*s;return c>0&&(c=1/Math.sqrt(c)),t[0]=e[0]*c,t[1]=e[1]*c,t[2]=e[2]*c,t}function fr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ru(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[0],p=i[1],m=i[2];return t[0]=s*m-c*p,t[1]=c*u-n*m,t[2]=n*p-s*u,t}function qt(t,e,i){var n=e[0],s=e[1],c=e[2],u=i[3]*n+i[7]*s+i[11]*c+i[15];return t[0]=(i[0]*n+i[4]*s+i[8]*c+i[12])/(u=u||1),t[1]=(i[1]*n+i[5]*s+i[9]*c+i[13])/u,t[2]=(i[2]*n+i[6]*s+i[10]*c+i[14])/u,t}function xd(t,e,i){var n=i[0],s=i[1],c=i[2],u=e[0],p=e[1],m=e[2],_=s*m-c*p,x=c*u-n*m,b=n*p-s*u,w=s*b-c*x,S=c*_-n*b,M=n*x-s*_,C=2*i[3];return x*=C,b*=C,S*=2,M*=2,t[0]=u+(_*=C)+(w*=2),t[1]=p+x+S,t[2]=m+b+M,t}var Ml,Ur=iu,Yf=yd,Jf=wl;
vendor: 10,173 bytes, line 8
8function vd(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function bd(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=i*i+n*n+s*s+c*c;return u>0&&(u=1/Math.sqrt(u)),t[0]=i*u,t[1]=n*u,t[2]=s*u,t[3]=c*u,t}function os(t,e,i){var n=e[0],s=e[1],c=e[2],u=e[3];return t[0]=i[0]*n+i[4]*s+i[8]*c+i[12]*u,t[1]=i[1]*n+i[5]*s+i[9]*c+i[13]*u,t[2]=i[2]*n+i[6]*s+i[10]*c+i[14]*u,t[3]=i[3]*n+i[7]*s+i[11]*c+i[15]*u,t}function wd(){var t=new Wi(4);return Wi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Td(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ed(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+u*p,t[1]=s*m+c*p,t[2]=c*m-s*p,t[3]=u*m-n*p,t}function Sd(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m-c*p,t[1]=s*m+u*p,t[2]=c*m+n*p,t[3]=u*m-s*p,t}tu(),Ml=new Wi(4),Wi!=Float32Array&&(Ml[0]=0,Ml[1]=0,Ml[2]=0,Ml[3]=0);var Qf=bd;tu(),ea(1,0,0),ea(0,1,0),wd(),wd(),pd();const em=te([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Md}=em,Ad=te([{name:"a_pos_3",components:3,type:"Int16"}]);var Al=te([{name:"a_pos",type:"Int16",components:2}]);class nu{constructor(e,i){this.pos=e,this.dir=i}intersectsPlane(e,i,n){const s=fr(i,this.dir);if(Math.abs(s)<1e-6)return!1;const c=((e[0]-this.pos[0])*i[0]+(e[1]-this.pos[1])*i[1]+(e[2]-this.pos[2])*i[2])/s;return n[0]=this.pos[0]+this.dir[0]*c,n[1]=this.pos[1]+this.dir[1]*c,n[2]=this.pos[2]+this.dir[2]*c,!0}closestPointOnSphere(e,i,n){if(function(S,M){var C=S[0],D=S[1],U=S[2],q=M[0],V=M[1],$=M[2];return Math.abs(C-q)<=Zc*Math.max(1,Math.abs(C),Math.abs(q))&&Math.abs(D-V)<=Zc*Math.max(1,Math.abs(D),Math.abs(V))&&Math.abs(U-$)<=Zc*Math.max(1,Math.abs(U),Math.abs($))}(this.pos,e)||i===0)return n[0]=n[1]=n[2]=0,!1;const[s,c,u]=this.dir,p=this.pos[0]-e[0],m=this.pos[1]-e[1],_=this.pos[2]-e[2],x=s*s+c*c+u*u,b=2*(p*s+m*c+_*u),w=b*b-4*x*(p*p+m*m+_*_-i*i);if(w<0){const S=Math.max(-b/2,0),M=p+s*S,C=m+c*S,D=_+u*S,U=Math.hypot(M,C,D);return n[0]=M*i/U,n[1]=C*i/U,n[2]=D*i/U,!1}{const S=(-b-Math.sqrt(w))/(2*x);if(S<0){const M=Math.hypot(p,m,_);return n[0]=p*i/M,n[1]=m*i/M,n[2]=_*i/M,!1}return n[0]=p+s*S,n[1]=m+c*S,n[2]=_+u*S,!0}}}class ou{constructor(e,i,n,s,c){this.TL=e,this.TR=i,this.BR=n,this.BL=s,this.horizon=c}static fromInvProjectionMatrix(e,i,n){const s=[-1,1,1],c=[1,1,1],u=[1,-1,1],p=[-1,-1,1],m=qt(s,s,e),_=qt(c,c,e),x=qt(u,u,e),b=qt(p,p,e);return new ou(m,_,x,b,i/n)}}class su{constructor(e,i){this.points=e,this.planes=i}static fromInvProjectionMatrix(e,i,n,s){const c=Math.pow(2,n),u=[[-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(m=>{const _=os([],m,e),x=1/_[3]/i*c;return function(b,w,S){return b[0]=w[0]*S[0],b[1]=w[1]*S[1],b[2]=w[2]*S[2],b[3]=w[3]*S[3],b}(_,_,[x,x,s?1/_[3]:x,x])}),p=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{const _=Ci([],ru([],Ur([],u[m[0]],u[m[1]]),Ur([],u[m[2]],u[m[1]]))),x=-fr(_,u[m[1]]);return _.concat(x)});return new su(u,p)}}class zi{static fromPoints(e){const i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const s of e)Tl(i,i,s),El(n,n,s);return new zi(i,n)}static applyTransform(e,i){const n=e.getCorners();for(let s=0;s<n.length;++s)qt(n[s],n[s],i);return zi.fromPoints(n)}constructor(e,i){this.min=e,this.max=i,this.center=nr([],Cn([],this.min,this.max),.5)}quadrant(e){const i=[e%2==0,e<2],n=gd(this.min),s=gd(this.max);for(let c=0;c<i.length;c++)n[c]=i[c]?this.min[c]:this.center[c],s[c]=i[c]?this.center[c]:this.max[c];return s[2]=this.max[2],new zi(n,s)}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]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,i=this.max;return[[e[0],e[1],e[2]],[i[0],e[1],e[2]],[i[0],i[1],e[2]],[e[0],i[1],e[2]],[e[0],e[1],i[2]],[i[0],e[1],i[2]],[i[0],i[1],i[2]],[e[0],i[1],i[2]]]}intersects(e){const i=this.getCorners();let n=!0;for(let s=0;s<e.planes.length;s++){const c=e.planes[s];let u=0;for(let p=0;p<i.length;p++)u+=fr(c,i[p])+c[3]>=0;if(u===0)return 0;u!==i.length&&(n=!1)}if(n)return 2;for(let s=0;s<3;s++){let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let p=0;p<e.points.length;p++){const m=e.points[p][s]-this.min[s];c=Math.min(c,m),u=Math.max(u,m)}if(u<0||c>this.max[s]-this.min[s])return 0}return 1}}const au=5,Id=6,en=Ze/Math.PI/2,tm=16383,ss=64,Il=[ss,32,16],mr=-en,_r=en,im=[new zi([mr,mr,mr],[_r,_r,_r]),new zi([mr,mr,mr],[0,0,_r]),new zi([0,mr,mr],[_r,0,_r]),new zi([mr,0,mr],[0,_r,_r]),new zi([0,0,mr],[_r,_r,_r])];function Wc(t){return t*en/Pl}function Cd(t,e,i,n=!0){const s=nr([],t._camera.position,t.worldSize),c=[e,i,1,1];os(c,c,t.pixelMatrixInverse),vd(c,c,1/c[3]);const u=Ci([],Ur([],c,s)),p=t.globeMatrix,m=[p[12],p[13],p[14]],_=Ur([],m,s),x=wl(_),b=Ci([],_),w=t.worldSize/(2*Math.PI),S=fr(b,u),M=Math.asin(w/x);if(M<Math.acos(S)){if(!n)return null;const Ee=[],ue=[];nr(Ee,u,x/S),Ci(ue,Ur(ue,Ee,_)),Ci(u,Cn(u,_,nr(u,ue,Math.tan(M)*x)))}const C=[];new nu(s,u).closestPointOnSphere(m,w,C);const D=Ci([],Xr(p,0)),U=Ci([],Xr(p,1)),q=Ci([],Xr(p,2)),V=fr(D,C),$=fr(U,C),X=fr(q,C),W=si(Math.asin(-$/w));let ce=si(Math.atan2(V,X));ce=t.center.lng+function(Ee,ue){const ye=(ue-Ee+180)%360-180;return ye<-180?ye+360:ye}(t.center.lng,ce);const se=rn(ce),me=ct(nn(W),0,1);return new na(se,me)}class rm{constructor(e,i,n){this.a=Ur([],e,n),this.b=Ur([],i,n),this.center=n;const s=Ci([],this.a),c=Ci([],this.b);this.angle=Math.acos(fr(s,c))}}function lu(t,e){if(t.angle===0)return null;let i;return i=t.a[e]===0?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),i<0||i>1?null:function(n,s,c,u){const p=Math.sin(c);return n*(Math.sin((1-u)*c)/p)+s*(Math.sin(u*c)/p)}(t.a[e],t.b[e],t.angle,ct(i,0,1))+t.center[e]}function tn(t){if(t.z<=1)return im[t.z+2*t.y+t.x];const e=cu(Xc(t));return zi.fromPoints(e)}function as(t,e,i){return nr(t,t,1-i),Sl(t,t,e,i)}function zd(t,e){const i=ra(e.zoom);if(i===0)return tn(t);const n=Xc(t),s=cu(n),c=rn(n.getWest())*e.worldSize,u=rn(n.getEast())*e.worldSize,p=nn(n.getNorth())*e.worldSize,m=nn(n.getSouth())*e.worldSize,_=[c,p,0],x=[u,p,0],b=[c,m,0],w=[u,m,0],S=Qh([],e.globeMatrix);return qt(_,_,S),qt(x,x,S),qt(b,b,S),qt(w,w,S),s[0]=as(s[0],b,i),s[1]=as(s[1],w,i),s[2]=as(s[2],x,i),s[3]=as(s[3],_,i),zi.fromPoints(s)}function Pd(t,e,i){for(const n of t)qt(n,n,e),nr(n,n,i)}function nm(t,e,i){const n=e/t.worldSize,s=t.globeMatrix;if(i.z<=1){const se=tn(i).getCorners();return Pd(se,s,n),zi.fromPoints(se)}const c=Xc(i),u=cu(c);Pd(u,s,n);const p=Number.MAX_VALUE,m=[-p,-p,-p],_=[p,p,p];if(c.contains(t.center)){for(const Ee of u)Tl(_,_,Ee),El(m,m,Ee);m[2]=0;const se=t.point,me=[se.x*n,se.y*n,0];return Tl(_,_,me),El(m,m,me),new zi(_,m)}const x=[s[12]*n,s[13]*n,s[14]*n],b=c.getCenter(),w=ct(t.center.lat,-wi,wi),S=ct(b.lat,-wi,wi),M=rn(t.center.lng),C=nn(w);let D=M-rn(b.lng);const U=C-nn(S);D>.5?D-=1:D<-.5&&(D+=1);let q=0;Math.abs(D)>Math.abs(U)?q=D>=0?1:3:(q=U>=0?0:2,Sl(x,x,[s[4]*n,s[5]*n,s[6]*n],-Math.sin(dt(U>=0?c.getSouth():c.getNorth()))*en));const V=u[q],$=u[(q+1)%4],X=new rm(V,$,x),W=[lu(X,0)||V[0],lu(X,1)||V[1],lu(X,2)||V[2]],ce=ra(t.zoom);if(ce>0){const se=function({x:Ee,y:ue,z:ye},xe,be,Ce,pe){const De=1/(1<<ye);let Ne=Ee*De,Re=Ne+De,He=ue*De,ze=He+De,$e=0;const Ke=(Ne+Re)/2-Ce;return Ke>.5?$e=-1:Ke<-.5&&($e=1),Ne=((Ne+$e)*xe-(Ce*=xe))*be+Ce,Re=((Re+$e)*xe-Ce)*be+Ce,He=(He*xe-(pe*=xe))*be+pe,ze=(ze*xe-pe)*be+pe,[[Ne,ze,0],[Re,ze,0],[Re,He,0],[Ne,He,0]]}(i,e,t._pixelsPerMercatorPixel,M,C);for(let Ee=0;Ee<u.length;Ee++)as(u[Ee],se[Ee],ce);const me=Cn([],se[q],se[(q+1)%4]);nr(me,me,.5),as(W,me,ce)}for(const se of u)Tl(_,_,se),El(m,m,se);return _[2]=Math.min(V[2],$[2]),Tl(_,_,W),El(m,m,W),new zi(_,m)}function Xc({x:t,y:e,z:i}){const n=1/(1<<i),s=new At(or(t*n),bi((e+1)*n)),c=new At(or((t+1)*n),bi(e*n));return new uo(s,c)}function cu(t){const e=dt(t.getNorth()),i=dt(t.getSouth()),n=Math.cos(e),s=Math.cos(i),c=Math.sin(e),u=Math.sin(i),p=t.getWest(),m=t.getEast();return[ta(s,u,p),ta(s,u,m),ta(n,c,m),ta(n,c,p)]}function ta(t,e,i,n=en){return i=dt(i),[t*Math.sin(i)*n,-e*n,t*Math.cos(i)*n]}function ia(t,e,i){return ta(Math.cos(dt(t)),Math.sin(dt(t)),e,i)}function Cl(t,e,i,n){const s=1<<i.z,c=(t/Ze+i.x)/s;return ia(bi((e/Ze+i.y)/s),or(c),n)}function Hc({min:t,max:e}){return tm/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const kd=new Float64Array(16);function zl(t){const e=Hc(t),i=md(kd,[e,e,e]);return bl(i,i,((n=[])[0]=-(s=t.min)[0],n[1]=-s[1],n[2]=-s[2],n));var n,s}function hu(t){const e=(n=t.min,(i=kd)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n[0],i[13]=n[1],i[14]=n[2],i[15]=1,i);var i,n;const s=1/Hc(t);return ns(e,e,[s,s,s])}function Dd(t,e,i,n,s){const c=function(m){const _=Ze/(2*Math.PI);return m/(2*Math.PI)/_}(i),u=[t,e,-i/(2*Math.PI)],p=Fr(new Float64Array(16));return bl(p,p,u),ns(p,p,[c,c,c]),eu(p,p,dt(-s)),qc(p,p,dt(-n)),p}function ra(t){return Bn(au,Id,t)}function Ld(t,e){const i=ia(e.lat,e.lng),n=function(M){const C=ia(M._center.lat,M._center.lng);let D=ru([],ea(0,1,0),C);const U=_d([],-M.angle,C);D=qt(D,D,U),_d(U,-M._pitch,D);const q=Ci([],C);return nr(q,q,Wc(M.cameraToCenterDistance/M.pixelsPerMeter)),qt(q,q,U),Cn([],C,q)}(t);return u=(s=iu([],n,i))[0],p=s[1],m=s[2],_=(c=i)[0],x=c[1],b=c[2],S=(w=Math.sqrt(u*u+p*p+m*m)*Math.sqrt(_*_+x*x+b*b))&&fr(s,c)/w,Math.acos(Math.min(Math.max(S,-1),1));var s,c,u,p,m,_,x,b,w,S}function uu(t,e){return Ld(t,e)>Math.PI/2*1.01}const Rd=dt(85),om=Math.cos(Rd),sm=Math.sin(Rd),Pl=63710088e-1,Bd=2*Math.PI*Pl;class po{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new po(oi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,n=this.lat*i,s=e.lat*i,c=Math.sin(n)*Math.sin(s)+Math.cos(n)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return Pl*Math.acos(Math.min(c,1))}
vendor: 10,158 bytes, line 8
8toBounds(e=0){const i=360*e/40075017,n=i/Math.cos(Math.PI/180*this.lat);return new uo(new po(this.lng-n,this.lat-i),new po(this.lng+n,this.lat+i))}toEcef(e){const i=Wc(e);return ia(this.lat,this.lng,en+i)}static convert(e){if(e instanceof po)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new po(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new po(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var At=po;function du(t){return Bd*Math.cos(t*Math.PI/180)}function rn(t){return(180+t)/360}function nn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Vr(t,e){return t/du(e)}function or(t){return 360*t-180}function bi(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Od(t,e){return t*du(bi(e))}const wi=85.051129;function Fd(t){return 1/Math.cos(t*Math.PI/180)}class na{constructor(e,i,n=0){this.x=+e,this.y=+i,this.z=+n}static fromLngLat(e,i=0){const n=At.convert(e);return new na(rn(n.lng),nn(n.lat),Vr(i,n.lat))}toLngLat(){return new At(or(this.x),bi(this.y))}toAltitude(){return Od(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Bd*Fd(bi(this.y))}}function pu(t,e,i,n,s,c,u,p,m){const _=(e+n)/2,x=(i+s)/2,b=new Le(_,x);p(b),function(w,S,M,C,D,U){const q=M-D,V=C-U;return Math.abs((C-S)*q-(M-w)*V)/Math.hypot(q,V)}(b.x,b.y,c.x,c.y,u.x,u.y)>=m?(pu(t,e,i,_,x,c,b,p,m),pu(t,_,x,n,s,b,u,p,m)):t.push(u)}function Ud(t,e,i){let n=t[0],s=n.x,c=n.y;e(n);const u=[n];for(let p=1;p<t.length;p++){const m=t[p],{x:_,y:x}=m;e(m),pu(u,s,c,_,x,n,m,e,i),s=_,c=x,n=m}return u}function fu(t,e,i,n){if(n(e,i)){const s=e.add(i)._mult(.5);fu(t,e,s,n),fu(t,s,i,n)}else t.push(i)}function am(t,e){let i=t[0];const n=[i];for(let s=1;s<t.length;s++){const c=t[s];fu(n,i,c,e),i=c}return n}const mu=Math.pow(2,14)-1,Vd=-mu-1;function lm(t,e){const i=Math.round(t.x*e),n=Math.round(t.y*e);return t.x=ct(i,Vd,mu),t.y=ct(n,Vd,mu),(i<t.x||i>t.x+1||n<t.y||n>t.y+1)&&Ut("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function zn(t,e,i){const n=t.loadGeometry(),s=t.extent,c=Ze/s;if(e&&i&&i.projection.isReprojectedInTileSpace){const u=1<<e.z,{scale:p,x:m,y:_,projection:x}=i,b=w=>{const S=or((e.x+w.x/s)/u),M=bi((e.y+w.y/s)/u),C=x.project(S,M);w.x=(C.x*p-m)*s,w.y=(C.y*p-_)*s};for(let w=0;w<n.length;w++)if(t.type!==1)n[w]=Ud(n[w],b,1);else{const S=[];for(const M of n[w])M.x<0||M.x>=s||M.y<0||M.y>=s||(b(M),S.push(M));n[w]=S}}for(const u of n)for(const p of u)lm(p,c);return n}function ls(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?zn(t):[]}}function Kc(t,e,i,n,s){t.emplaceBack(2*e+(n+1)/2,2*i+(s+1)/2)}function Yc(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class _u{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Te,this.indexArray=new je,this.segments=new Yt,this.programConfigurations=new is(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){const c=this.layers[0],u=[];let p=null;c.type==="circle"&&(p=c.layout.get("circle-sort-key"));for(const{feature:_,id:x,index:b,sourceLayerIndex:w}of e){const S=this.layers[0]._featureFilter.needGeometry,M=ls(_,S);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),M,n))continue;const C=p?p.evaluate(M,{},n):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:w,index:b,geometry:S?M.geometry:zn(_,n,s),patterns:{},sortKey:C};u.push(D)}p&&u.sort((_,x)=>_.sortKey-x.sortKey);let m=null;s.projection.name==="globe"&&(this.globeExtVertexArray=new Me,m=s.projection);for(const _ of u){const{geometry:x,index:b,sourceLayerIndex:w}=_,S=e[b].feature;this.addFeature(_,x,b,i.availableImages,n,m),i.featureIndex.insert(S,x,b,w,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Hf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,i,n,s,c,u){for(const p of i)for(const m of p){const _=m.x,x=m.y;if(_<0||_>=Ze||x<0||x>=Ze)continue;if(u){const S=u.projectTilePoint(_,x,c),M=u.upVector(c,_,x),C=this.globeExtVertexArray;Yc(C,S,M),Yc(C,S,M),Yc(C,S,M),Yc(C,S,M)}const b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=b.vertexLength;Kc(this.layoutVertexArray,_,x,-1,-1),Kc(this.layoutVertexArray,_,x,1,-1),Kc(this.layoutVertexArray,_,x,1,1),Kc(this.layoutVertexArray,_,x,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+2,w+3),b.vertexLength+=4,b.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},s,c)}}function Nd(t,e){for(let i=0;i<t.length;i++)if(cs(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(cs(t,e[i]))return!0;return!!gu(t,e)}function cm(t,e,i){return!!cs(t,e)||!!yu(e,t,i)}function jd(t,e){if(t.length===1)return $d(e,t[0]);for(let i=0;i<e.length;i++){const n=e[i];for(let s=0;s<n.length;s++)if(cs(t,n[s]))return!0}for(let i=0;i<t.length;i++)if($d(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(gu(t,e[i]))return!0;return!1}function hm(t,e,i){if(t.length>1){if(gu(t,e))return!0;for(let n=0;n<e.length;n++)if(yu(e[n],t,i))return!0}for(let n=0;n<t.length;n++)if(yu(t[n],e,i))return!0;return!1}function gu(t,e){if(t.length===0||e.length===0)return!1;for(let i=0;i<t.length-1;i++){const n=t[i],s=t[i+1];for(let c=0;c<e.length-1;c++)if(um(n,s,e[c],e[c+1]))return!0}return!1}function um(t,e,i,n){return Vi(t,i,n)!==Vi(e,i,n)&&Vi(t,e,i)!==Vi(t,e,n)}function yu(t,e,i){const n=i*i;if(e.length===1)return t.distSqr(e[0])<n;for(let s=1;s<e.length;s++)if(Gd(t,e[s-1],e[s])<n)return!0;return!1}function Gd(t,e,i){const n=e.distSqr(i);if(n===0)return t.distSqr(e);const s=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(s<0?e:s>1?i:i.sub(e)._mult(s)._add(e))}function $d(t,e){let i,n,s,c=!1;for(let u=0;u<t.length;u++){i=t[u];for(let p=0,m=i.length-1;p<i.length;m=p++)n=i[p],s=i[m],n.y>e.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(c=!c)}return c}function cs(t,e){let i=!1;for(let n=0,s=t.length-1;n<t.length;s=n++){const c=t[n],u=t[s];c.y>e.y!=u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(i=!i)}return i}function Zd(t,e,i,n,s){for(const u of t)if(e<=u.x&&i<=u.y&&n>=u.x&&s>=u.y)return!0;const c=[new Le(e,i),new Le(e,s),new Le(n,s),new Le(n,i)];if(t.length>2){for(const u of c)if(cs(t,u))return!0}for(let u=0;u<t.length-1;u++)if(dm(t[u],t[u+1],c))return!0;return!1}function dm(t,e,i){const n=i[0],s=i[2];if(t.x<n.x&&e.x<n.x||t.x>s.x&&e.x>s.x||t.y<n.y&&e.y<n.y||t.y>s.y&&e.y>s.y)return!1;const c=Vi(t,e,i[0]);return c!==Vi(t,e,i[1])||c!==Vi(t,e,i[2])||c!==Vi(t,e,i[3])}function oa(t,e,i){const n=e.paint.get(t).value;return n.kind==="constant"?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Jc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qd(t,e,i,n,s){if(!e[0]&&!e[1])return t;const c=Le.convert(e)._mult(s);i==="viewport"&&c._rotate(-n);const u=[];for(let p=0;p<t.length;p++)u.push(t[p].sub(c));return u}function Wd(t,e,i,n){const s=Le.convert(t)._mult(n);return e==="viewport"&&s._rotate(-i),s}Ue(_u,"CircleBucket",{omit:["layers"]});const pm=new j({"circle-sort-key":new L(fe.layout_circle["circle-sort-key"])});var fm={paint:new j({"circle-radius":new L(fe.paint_circle["circle-radius"]),"circle-color":new L(fe.paint_circle["circle-color"]),"circle-blur":new L(fe.paint_circle["circle-blur"]),"circle-opacity":new L(fe.paint_circle["circle-opacity"]),"circle-translate":new I(fe.paint_circle["circle-translate"]),"circle-translate-anchor":new I(fe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new I(fe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new I(fe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new L(fe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new L(fe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new L(fe.paint_circle["circle-stroke-opacity"])}),layout:pm};function Xd(t,e,i,n,s,c,u,p,m){if(c&&t.queryGeometry.isAboveHorizon)return!1;c&&(m*=t.pixelToTileUnitsFactor);const _=t.tileID.canonical,x=i.projection.upVectorScale(_,i.center.lat,i.worldSize).metersToTile;for(const b of e)for(const w of b){const S=w.add(p),M=s&&i.elevation?i.elevation.exaggeration()*s.getElevationAt(S.x,S.y,!0):0,C=i.projection.projectTilePoint(S.x,S.y,_);if(M>0){const V=i.projection.upVector(_,S.x,S.y);C.x+=V[0]*x*M,C.y+=V[1]*x*M,C.z+=V[2]*x*M}const D=c?S:mm(C.x,C.y,C.z,n),U=c?t.tilespaceRays.map(V=>gm(V,M)):t.queryGeometry.screenGeometry,q=os([],[C.x,C.y,C.z,1],n);if(!u&&c?m*=q[3]/i.cameraToCenterDistance:u&&!c&&(m*=i.cameraToCenterDistance/q[3]),c){const V=bi((w.y/Ze+_.y)/(1<<_.z));m/=i.projection.pixelsPerMeter(V,1)/Vr(1,V)}if(cm(U,D,m))return!0}return!1}function mm(t,e,i,n){const s=os([],[t,e,i,1],n);return new Le(s[0]/s[3],s[1]/s[3])}const Hd=ea(0,0,0),_m=ea(0,0,1);function gm(t,e){const i=tu();return Hd[2]=e,t.intersectsPlane(Hd,_m,i),new Le(i[0],i[1])}class Kd extends _u{}function Yd(t,{width:e,height:i},n,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*n)throw new RangeError("mismatched image size")}else s=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=s,t}
vendor: 4,144 bytes, line 8
8function Jd(t,e,i){const{width:n,height:s}=e;n===t.width&&s===t.height||(xu(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,s)},i),t.width=n,t.height=s,t.data=e.data)}function xu(t,e,i,n,s,c){if(s.width===0||s.height===0)return e;if(s.width>t.width||s.height>t.height||i.x>t.width-s.width||i.y>t.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||n.x>e.width-s.width||n.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const u=t.data,p=e.data;for(let m=0;m<s.height;m++){const _=((i.y+m)*t.width+i.x)*c,x=((n.y+m)*e.width+n.x)*c;for(let b=0;b<s.width*c;b++)p[x+b]=u[_+b]}return e}Ue(Kd,"HeatmapBucket",{omit:["layers"]});class Pn{constructor(e,i){Yd(this,e,1,i)}resize(e){Jd(this,new Pn(e),1)}clone(){return new Pn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,n,s,c){xu(e,i,n,s,c,1)}}class Xi{constructor(e,i){Yd(this,e,4,i)}resize(e){Jd(this,new Xi(e),4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Xi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,n,s,c){xu(e,i,n,s,c,4)}}Ue(Pn,"AlphaImage"),Ue(Xi,"RGBAImage");var ym={paint:new j({"heatmap-radius":new L(fe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new L(fe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new I(fe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new N(fe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new I(fe.paint_heatmap["heatmap-opacity"])})};function vu(t){const e={},i=t.resolution||256,n=t.clips?t.clips.length:1,s=t.image||new Xi({width:i,height:n}),c=(u,p,m)=>{e[t.evaluationKey]=m;const _=t.expression.evaluate(e);s.data[u+p+0]=Math.floor(255*_.r/_.a),s.data[u+p+1]=Math.floor(255*_.g/_.a),s.data[u+p+2]=Math.floor(255*_.b/_.a),s.data[u+p+3]=Math.floor(255*_.a)};if(t.clips)for(let u=0,p=0;u<n;++u,p+=4*i)for(let m=0,_=0;m<i;m++,_+=4){const x=m/(i-1),{start:b,end:w}=t.clips[u];c(p,_,b*(1-x)+w*x)}else for(let u=0,p=0;u<i;u++,p+=4)c(0,p,u/(i-1));return s}var xm={paint:new j({"hillshade-illumination-direction":new I(fe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new I(fe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new I(fe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new I(fe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new I(fe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new I(fe.paint_hillshade["hillshade-accent-color"])})};const vm=te([{name:"a_pos",components:2,type:"Int16"}],4),{members:bm}=vm;var bu={exports:{}};function Qc(t,e,i){i=i||2;var n,s,c,u,p,m,_,x=e&&e.length,b=x?e[0]*i:t.length,w=Qd(t,0,b,i,!0),S=[];if(!w||w.next===w.prev)return S;if(x&&(w=function(C,D,U,q){var V,$,X,W=[];for(V=0,$=D.length;V<$;V++)(X=Qd(C,D[V]*q,V<$-1?D[V+1]*q:C.length,q,!1))===X.next&&(X.steiner=!0),W.push(Cm(X));for(W.sort(Mm),V=0;V<W.length;V++)U=Am(W[V],U);return U}(t,e,w,i)),t.length>80*i){n=c=t[0],s=u=t[1];for(var M=i;M<b;M+=i)(p=t[M])<n&&(n=p),(m=t[M+1])<s&&(s=m),p>c&&(c=p),m>u&&(u=m);_=(_=Math.max(c-n,u-s))!==0?32767/_:0}return kl(w,S,i,n,s,_,0),S}function Qd(t,e,i,n,s){var c,u;if(s===Eu(t,e,i,n)>0)for(c=e;c<i;c+=n)u=ip(c,t[c],t[c+1],u);else for(c=i-n;c>=e;c-=n)u=ip(c,t[c],t[c+1],u);return u&&eh(u,u.next)&&(Ll(u),u=u.next),u}function hs(t,e){if(!t)return t;e||(e=t);var i,n=t;do if(i=!1,n.steiner||!eh(n,n.next)&&Jt(n.prev,n,n.next)!==0)n=n.next;else{if(Ll(n),(n=e=n.prev)===n.next)break;i=!0}while(i||n!==e);return e}function kl(t,e,i,n,s,c,u){if(t){!u&&c&&function(x,b,w,S){var M=x;do M.z===0&&(M.z=wu(M.x,M.y,b,w,S)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==x);M.prevZ.nextZ=null,M.prevZ=null,function(C){var D,U,q,V,$,X,W,ce,se=1;do{for(U=C,C=null,$=null,X=0;U;){for(X++,q=U,W=0,D=0;D<se&&(W++,q=q.nextZ);D++);for(ce=se;W>0||ce>0&&q;)W!==0&&(ce===0||!q||U.z<=q.z)?(V=U,U=U.nextZ,W--):(V=q,q=q.nextZ,ce--),$?$.nextZ=V:C=V,V.prevZ=$,$=V;U=q}$.nextZ=null,se*=2}while(X>1)}(M)}
vendor: 4,167 bytes, line 8
8(t,n,s,c);for(var p,m,_=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?Tm(t,n,s,c):wm(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),Ll(t),t=m.next,_=m.next;else if((t=m)===_){u?u===1?kl(t=Em(hs(t),e,i),e,i,n,s,c,2):u===2&&Sm(t,e,i,n,s,c):kl(hs(t),e,i,n,s,c,1);break}}}function wm(t){var e=t.prev,i=t,n=t.next;if(Jt(e,i,n)>=0)return!1;for(var s=e.x,c=i.x,u=n.x,p=e.y,m=i.y,_=n.y,x=s<c?s<u?s:u:c<u?c:u,b=p<m?p<_?p:_:m<_?m:_,w=s>c?s>u?s:u:c>u?c:u,S=p>m?p>_?p:_:m>_?m:_,M=n.next;M!==e;){if(M.x>=x&&M.x<=w&&M.y>=b&&M.y<=S&&sa(s,p,c,m,u,_,M.x,M.y)&&Jt(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function Tm(t,e,i,n){var s=t.prev,c=t,u=t.next;if(Jt(s,c,u)>=0)return!1;for(var p=s.x,m=c.x,_=u.x,x=s.y,b=c.y,w=u.y,S=p<m?p<_?p:_:m<_?m:_,M=x<b?x<w?x:w:b<w?b:w,C=p>m?p>_?p:_:m>_?m:_,D=x>b?x>w?x:w:b>w?b:w,U=wu(S,M,e,i,n),q=wu(C,D,e,i,n),V=t.prevZ,$=t.nextZ;V&&V.z>=U&&$&&$.z<=q;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&sa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0||(V=V.prevZ,$.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&sa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;V&&V.z>=U;){if(V.x>=S&&V.x<=C&&V.y>=M&&V.y<=D&&V!==s&&V!==u&&sa(p,x,m,b,_,w,V.x,V.y)&&Jt(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;$&&$.z<=q;){if($.x>=S&&$.x<=C&&$.y>=M&&$.y<=D&&$!==s&&$!==u&&sa(p,x,m,b,_,w,$.x,$.y)&&Jt($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function Em(t,e,i){var n=t;do{var s=n.prev,c=n.next.next;!eh(s,c)&&ep(s,n,n.next,c)&&Dl(s,c)&&Dl(c,s)&&(e.push(s.i/i|0),e.push(n.i/i|0),e.push(c.i/i|0),Ll(n),Ll(n.next),n=t=c),n=n.next}while(n!==t);return hs(n)}function Sm(t,e,i,n,s,c){var u=t;do{for(var p=u.next.next;p!==u.prev;){if(u.i!==p.i&&zm(u,p)){var m=tp(u,p);return u=hs(u,u.next),m=hs(m,m.next),kl(u,e,i,n,s,c,0),void kl(m,e,i,n,s,c,0)}p=p.next}u=u.next}while(u!==t)}function Mm(t,e){return t.x-e.x}function Am(t,e){var i=function(s,c){var u,p=c,m=s.x,_=s.y,x=-1/0;do{if(_<=p.y&&_>=p.next.y&&p.next.y!==p.y){var b=p.x+(_-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(b<=m&&b>x&&(x=b,u=p.x<p.next.x?p:p.next,b===m))return u}p=p.next}while(p!==c);if(!u)return null;var w,S=u,M=u.x,C=u.y,D=1/0;p=u;do m>=p.x&&p.x>=M&&m!==p.x&&sa(_<C?m:x,_,M,C,_<C?x:m,_,p.x,p.y)&&(w=Math.abs(_-p.y)/(m-p.x),Dl(p,s)&&(w<D||w===D&&(p.x>u.x||p.x===u.x&&Im(u,p)))&&(u=p,D=w)),p=p.next;while(p!==S);return u}(t,e);if(!i)return e;var n=tp(i,t);return hs(n,n.next),hs(i,i.next)}function Im(t,e){return Jt(t.prev,t,e.prev)<0&&Jt(e.next,t,t.next)<0}function wu(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Cm(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}function sa(t,e,i,n,s,c,u,p){return(s-u)*(e-p)>=(t-u)*(c-p)&&(t-u)*(n-p)>=(i-u)*(e-p)&&(i-u)*(c-p)>=(s-u)*(n-p)}function zm(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(i,n){var s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==n.i&&s.next.i!==n.i&&ep(s,s.next,i,n))return!0;s=s.next}while(s!==i);return!1}(t,e)&&(Dl(t,e)&&Dl(e,t)&&function(i,n){var s=i,c=!1,u=(i.x+n.x)/2,p=(i.y+n.y)/2;do s.y>p!=s.next.y>p&&s.next.y!==s.y&&u<(s.next.x-s.x)*(p-s.y)/(s.next.y-s.y)+s.x&&(c=!c),s=s.next;while(s!==i);return c}(t,e)&&(Jt(t.prev,t,e.prev)||Jt(t,e.prev,e))||eh(t,e)&&Jt(t.prev,t,t.next)>0&&Jt(e.prev,e,e.next)>0)}function Jt(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function eh(t,e){return t.x===e.x&&t.y===e.y}function ep(t,e,i,n){var s=ih(Jt(t,e,i)),c=ih(Jt(t,e,n)),u=ih(Jt(i,n,t)),p=ih(Jt(i,n,e));return s!==c&&u!==p||!(s!==0||!th(t,i,e))||!(c!==0||!th(t,n,e))||!(u!==0||!th(i,t,n))||!(p!==0||!th(i,e,n))}function th(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function ih(t){return t>0?1:t<0?-1:0}function Dl(t,e){return Jt(t.prev,t,t.next)<0?Jt(t,e,t.next)>=0&&Jt(t,t.prev,e)>=0:Jt(t,e,t.prev)<0||Jt(t,t.next,e)<0}function tp(t,e){var i=new Tu(t.i,t.x,t.y),n=new Tu(e.i,e.x,e.y),s=t.next,c=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,c.next=n,n.prev=c,n}function ip(t,e,i,n){var s=new Tu(t,e,i);
vendor: 7,603 bytes, line 8
8return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Ll(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Tu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eu(t,e,i,n){for(var s=0,c=e,u=i-n;c<i;c+=n)s+=(t[u]-t[c])*(t[c+1]+t[u+1]),u=c;return s}bu.exports=Qc,bu.exports.default=Qc,Qc.deviation=function(t,e,i,n){var s=e&&e.length,c=Math.abs(Eu(t,0,s?e[0]*i:t.length,i));if(s)for(var u=0,p=e.length;u<p;u++)c-=Math.abs(Eu(t,e[u]*i,u<p-1?e[u+1]*i:t.length,i));var m=0;for(u=0;u<n.length;u+=3){var _=n[u]*i,x=n[u+1]*i,b=n[u+2]*i;m+=Math.abs((t[_]-t[b])*(t[x+1]-t[_+1])-(t[_]-t[x])*(t[b+1]-t[_+1]))}return c===0&&m===0?0:Math.abs((m-c)/c)},Qc.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var c=0;c<t[s].length;c++)for(var u=0;u<e;u++)i.vertices.push(t[s][c][u]);s>0&&i.holes.push(n+=t[s-1].length)}return i};var Su=Ji(bu.exports);function Pm(t,e,i,n,s){rp(t,e,i||0,n||t.length-1,s||km)}function rp(t,e,i,n,s){for(;n>i;){if(n-i>600){var c=n-i+1,u=e-i+1,p=Math.log(c),m=.5*Math.exp(2*p/3),_=.5*Math.sqrt(p*m*(c-m)/c)*(u-c/2<0?-1:1);rp(t,e,Math.max(i,Math.floor(e-u*m/c+_)),Math.min(n,Math.floor(e+(c-u)*m/c+_)),s)}var x=t[e],b=i,w=n;for(Rl(t,i,e),s(t[n],x)>0&&Rl(t,i,n);b<w;){for(Rl(t,b,w),b++,w--;s(t[b],x)<0;)b++;for(;s(t[w],x)>0;)w--}s(t[i],x)===0?Rl(t,i,w):Rl(t,++w,n),w<=e&&(i=w+1),e<=w&&(n=w-1)}}function Rl(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function km(t,e){return t<e?-1:t>e?1:0}function Mu(t,e){const i=t.length;if(i<=1)return[t];const n=[];let s,c;for(let u=0;u<i;u++){const p=xs(t[u]);p!==0&&(t[u].area=Math.abs(p),c===void 0&&(c=p<0),c===p<0?(s&&n.push(s),s=[t[u]]):s.push(t[u]))}if(s&&n.push(s),e>1)for(let u=0;u<n.length;u++)n[u].length<=e||(Pm(n[u],e,1,n[u].length-1,Dm),n[u]=n[u].slice(0,e));return n}function Dm(t,e){return e.area-t.area}function Au(t,e,i){const n=i.patternDependencies;let s=!1;for(const c of e){const u=c.paint.get(`${t}-pattern`);u.isConstant()||(s=!0);const p=u.constantOr(null);p&&(s=!0,n[p]=!0)}return s}function Iu(t,e,i,n,s){const c=s.patternDependencies;for(const u of e){const p=u.paint.get(`${t}-pattern`).value;if(p.kind!=="constant"){let m=p.evaluate({zoom:n},i,{},s.availableImages);m=m&&m.name?m.name:m,c[m]=!0,i.patterns[u.id]=m}}return i}class rh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Te,this.indexArray=new je,this.indexArray2=new ui,this.programConfigurations=new is(e.layers,e.zoom),this.segments=new Yt,this.segments2=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.projection=e.projection}populate(e,i,n,s){this.hasPattern=Au("fill",this.layers,i);const c=this.layers[0].layout.get("fill-sort-key"),u=[];for(const{feature:p,id:m,index:_,sourceLayerIndex:x}of e){const b=this.layers[0]._featureFilter.needGeometry,w=ls(p,b);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),w,n))continue;const S=c?c.evaluate(w,{},n,i.availableImages):void 0,M={id:m,properties:p.properties,type:p.type,sourceLayerIndex:x,index:_,geometry:b?w.geometry:zn(p,n,s),patterns:{},sortKey:S};u.push(M)}c&&u.sort((p,m)=>p.sortKey-m.sortKey);for(const p of u){const{geometry:m,index:_,sourceLayerIndex:x}=p;if(this.hasPattern){const b=Iu("fill",this.layers,p,this.zoom,i);this.patternFeatures.push(b)}else this.addFeature(p,m,_,n,{},i.availableImages);i.featureIndex.insert(e[_].feature,m,_,x,this.index)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bm),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,n,s,c,u=[]){for(const p of Mu(i,500)){let m=0;for(const M of p)m+=M.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],w=[];for(const M of p){if(M.length===0)continue;M!==p[0]&&w.push(b.length/2);const C=this.segments2.prepareSegment(M.length,this.layoutVertexArray,this.indexArray2),D=C.vertexLength;this.layoutVertexArray.emplaceBack(M[0].x,M[0].y),this.indexArray2.emplaceBack(D+M.length-1,D),b.push(M[0].x),b.push(M[0].y);for(let U=1;U<M.length;U++)this.layoutVertexArray.emplaceBack(M[U].x,M[U].y),this.indexArray2.emplaceBack(D+U-1,D+U),b.push(M[U].x),b.push(M[U].y);C.vertexLength+=M.length,C.primitiveLength+=M.length}const S=Su(b,w);for(let M=0;M<S.length;M+=3)this.indexArray.emplaceBack(x+S[M],x+S[M+1],x+S[M+2]);_.vertexLength+=m,_.primitiveLength+=S.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}}Ue(rh,"FillBucket",{omit:["layers","patternFeatures"]});const Lm=new j({"fill-sort-key":new L(fe.layout_fill["fill-sort-key"])});var Rm={paint:new j({"fill-antialias":new I(fe.paint_fill["fill-antialias"]),"fill-opacity":new L(fe.paint_fill["fill-opacity"]),"fill-color":new L(fe.paint_fill["fill-color"]),"fill-outline-color":new L(fe.paint_fill["fill-outline-color"]),"fill-translate":new I(fe.paint_fill["fill-translate"]),"fill-translate-anchor":new I(fe.paint_fill["fill-translate-anchor"]),"fill-pattern":new L(fe.paint_fill["fill-pattern"])}),layout:Lm};const Bm=te([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Om=te([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Fm=te([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Um}=Bm;var nh={},Vm=hn,np=aa;function aa(t,e,i,n,s){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=s,t.readFields(Nm,this,e)}function Nm(t,e,i){t==1?e.id=i.readVarint():t==2?function(n,s){for(var c=n.readVarint()+n.pos;n.pos<c;){var u=s._keys[n.readVarint()],p=s._values[n.readVarint()];s.properties[u]=p}}(i,e):t==3?e.type=i.readVarint():t==4&&(e._geometry=i.pos)}function jm(t){for(var e,i,n=0,s=0,c=t.length,u=c-1;s<c;u=s++)n+=((i=t[u]).x-(e=t[s]).x)*(e.y+i.y);return n}aa.types=["Unknown","Point","LineString","Polygon"],aa.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,s=0,c=0,u=0,p=[];t.pos<i;){if(s<=0){var m=t.readVarint();n=7&m,s=m>>3}if(s--,n===1||n===2)c+=t.readSVarint(),u+=t.readSVarint(),n===1&&(e&&p.push(e),e=[]),e.push(new Vm(c,u));else{if(n!==7)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&p.push(e),p},aa.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,s=0,c=0,u=1/0,p=-1/0,m=1/0,_=-1/0;t.pos<e;){if(n<=0){var x=t.readVarint();i=7&x,n=x>>3}if(n--,i===1||i===2)(s+=t.readSVarint())<u&&(u=s),s>p&&(p=s),(c+=t.readSVarint())<m&&(m=c),c>_&&(_=c);else if(i!==7)throw new Error("unknown command "+i)}return[u,m,p,_]}
8,aa.prototype.toGeoJSON=function(t,e,i){var n,s,c=this.extent*Math.pow(2,i),u=this.extent*t,p=this.extent*e,m=this.loadGeometry(),_=aa.types[this.type];function x(S){for(var M=0;M<S.length;M++){var C=S[M];S[M]=[360*(C.x+u)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(C.y+p)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var b=[];for(n=0;n<m.length;n++)b[n]=m[n][0];x(m=b);break;case 2:for(n=0;n<m.length;n++)x(m[n]);break;case 3:for(m=function(S){var M=S.length;if(M<=1)return[S];for(var C,D,U=[],q=0;q<M;q++){var V=jm(S[q]);V!==0&&(D===void 0&&(D=V<0),D===V<0?(C&&U.push(C),C=[S[q]]):C.push(S[q]))}return C&&U.push(C),U}(m),n=0;n<m.length;n++)for(s=0;s<m[n].length;s++)x(m[n][s])}m.length===1?m=m[0]:_="Multi"+_;var w={type:"Feature",geometry:{type:_,coordinates:m},properties:this.properties};return"id"in this&&(w.id=this.id),w};var Gm=np,op=sp;function sp(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields($m,this,e),this.length=this._features.length}function $m(t,e,i){t===15?e.version=i.readVarint():t===1?e.name=i.readString():t===5?e.extent=i.readVarint():t===2?e._features.push(i.pos):t===3?e._keys.push(i.readString()):t===4&&e._values.push(function(n){for(var s=null,c=n.readVarint()+n.pos;n.pos<c;){var u=n.readVarint()>>3;s=u===1?n.readString():u===2?n.readFloat():u===3?n.readDouble():u===4?n.readVarint64():u===5?n.readVarint():u===6?n.readSVarint():u===7?n.readBoolean():null}return s}(i))}sp.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Gm(this._pbf,e,this.extent,this._keys,this._values)};var Zm=op;function qm(t,e,i){if(t===3){var n=new Zm(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var Cu=nh.VectorTile=function(t,e){this.layers=t.readFields(qm,{},e)},oh=nh.VectorTileFeature=np;function sh(t,e,i,n){const s=[],c=n===0?(u,p,m,_,x,b)=>{u.push(new Le(b,m+(b-p)/(_-p)*(x-m)))}:(u,p,m,_,x,b)=>{u.push(new Le(p+(b-m)/(x-m)*(_-p),b))};for(const u of t){const p=[];for(const m of u){if(m.length<=2)continue;const _=[];for(let w=0;w<m.length-1;w++){const S=m[w].x,M=m[w].y,C=m[w+1].x,D=m[w+1].y,U=n===0?S:M,q=n===0?C:D;U<e?q>e&&c(_,S,M,C,D,e):U>i?q<i&&c(_,S,M,C,D,i):_.push(m[w]),q<e&&U>=e&&c(_,S,M,C,D,e),q>i&&U<=i&&c(_,S,M,C,D,i)}let x=m[m.length-1];const b=n===0?x.x:x.y;b>=e&&b<=i&&_.push(x),_.length&&(x=_[_.length-1],_[0].x===x.x&&_[0].y===x.y||_.push(_[0]),p.push(_))}p.length&&s.push(p)}return s}nh.VectorTileLayer=op;const Wm=oh.types,Xm=Math.pow(2,13);function Bl(t,e,i,n,s,c,u,p){t.emplaceBack((e<<1)+u,(i<<1)+c,(Math.floor(n*Xm)<<1)+s,Math.round(p))}function Ol(t,e,i){t.emplaceBack(e.x,e.y,e.z,i[0]*16384,i[1]*16384,i[2]*16384)}class ap{constructor(){this.acc=new Le(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new Le(e.x,e.y),this.max=new Le(e.x,e.y))}append(e,i){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,s=this.max;e.x<n.x?n.x=e.x:e.x>s.x&&(s.x=e.x),e.y<n.y?n.y=e.y:e.y>s.y&&(s.y=e.y),((e.x===0||e.x===Ze)&&e.x===i.x)!=((e.y===0||e.y===Ze)&&e.y===i.y)&&this.processBorderOverlap(e,i),i.x<0!=e.x<0&&this.addBorderIntersection(0,mt(i.y,e.y,(0-i.x)/(e.x-i.x))),i.x>Ze!=e.x>Ze&&this.addBorderIntersection(1,mt(i.y,e.y,(Ze-i.x)/(e.x-i.x))),i.y<0!=e.y<0&&this.addBorderIntersection(2,mt(i.x,e.x,(0-i.y)/(e.y-i.y))),i.y>Ze!=e.y>Ze&&this.addBorderIntersection(3,mt(i.x,e.x,(Ze-i.y)/(e.y-i.y)))}addBorderIntersection(e,i){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];i<n[0]&&(n[0]=i),i>n[1]&&(n[1]=i)}processBorderOverlap(e,i){if(e.x===i.x){if(e.y===i.y)return;const n=e.x===0?0:1;this.addBorderIntersection(n,i.y),this.addBorderIntersection(n,e.y)}else{const n=e.y===0?2:3;this.addBorderIntersection(n,i.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce((i,n)=>i+n.edges,0);return e!==0?this.acc.div(e)._round():new Le(0,0)}span(){return new Le(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((e,i)=>e+ +(i[0]!==Number.MAX_VALUE),0)}}class Fl{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new ge,this.centroidVertexArray=new Rr,this.indexArray=new je,this.programConfigurations=new is(e.layers,e.zoom),this.segments=new Yt,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id),this.enableTerrain=e.enableTerrain}populate(e,i,n,s){this.features=[],this.hasPattern=Au("fill-extrusion",this.layers,i),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(c){const u=Math.exp(Math.PI*(1-c.y/(1<<c.z)*2));return 80150034*u/(u*u+1)/Ze/(1<<c.z)}(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:c,id:u,index:p,sourceLayerIndex:m}of e){const _=this.layers[0]._featureFilter.needGeometry,x=ls(c,_);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),x,n))continue;const b={id:u,sourceLayerIndex:m,index:p,geometry:_?x.geometry:zn(c,n,s),properties:c.properties,type:c.type,patterns:{}},w=this.layoutVertexArray.length;this.hasPattern?this.features.push(Iu("fill-extrusion",this.layers,b,this.zoom,i)):this.addFeature(b,b.geometry,p,n,{},i.availableImages,s),i.featureIndex.insert(c,b.geometry,p,m,this.index,w)}this.sortBorders()}addFeatures(e,i,n,s,c){for(const u of this.features){const{geometry:p}=u;this.addFeature(u,p,u.index,i,n,s,c)}this.sortBorders()}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Um),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Fm.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.centroidVertexArray.length!==0&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Om.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,n,s,c,u,p){const m=[new Le(0,0),new Le(Ze,Ze)],_=p.projection,x=_.name==="globe",b=this.enableTerrain&&!x?new ap:null,w=Wm[e.type]==="Polygon";x&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Me);const S=Mu(i,500);for(let U=S.length-1;U>=0;U--){const q=S[U];(q.length===0||(M=q[0]).every(V=>V.x<=0)||M.every(V=>V.x>=Ze)||M.every(V=>V.y<=0)||M.every(V=>V.y>=Ze))&&S.splice(U,1)}var M;let C;if(x)C=fp(S,m,s);else{C=[];for(const U of S)C.push({polygon:U,bounds:m})}const D=w?this.edgeRadius:0;for(const{polygon:U,bounds:q}of C){let V=0,$=0;for(const W of U)w&&!W[0].equals(W[W.length-1])&&W.push(W[0]),$+=w?W.length-1:W.length;const X=this.segments.prepareSegment((w?5:4)*$,this.layoutVertexArray,this.indexArray);if(w){const W=[],ce=[];V=X.vertexLength;for(const me of U){let Ee,ue;me.length&&me!==U[0]&&ce.push(W.length/2),Ee=me[1].sub(me[0])._perp()._unit();for(let ye=1;ye<me.length;ye++){const xe=me[ye],be=me[ye===me.length-1?1:ye+1];let{x:Ce,y:pe}=xe;if(D){ue=be.sub(xe)._perp()._unit();const De=Ee.add(ue)._unit(),Ne=D*Math.min(4,1/(Ee.x*De.x+Ee.y*De.y));Ce+=Ne*De.x,pe+=Ne*De.y,Ee=ue}Bl(this.layoutVertexArray,Ce,pe,0,0,1,1,0),X.vertexLength++,W.push(xe.x,xe.y),x&&Ol(this.layoutVertexExtArray,_.projectTilePoint(Ce,pe,s),_.upVector(s,Ce,pe))}}const se=Su(W,ce);for(let me=0;me<se.length;me+=3)this.indexArray.emplaceBack(V+se[me],V+se[me+2],V+se[me+1]),X.primitiveLength++}for(const W of U){b&&W.length&&b.startRing(W[0]);let ce,se,me,Ee=W.length>4&&up(W[W.length-2],W[0],W[1]),ue=D?Hm(W[W.length-2],W[0],W[1],D):0;se=W[1].sub(W[0])._perp()._unit();let ye=!0;for(let xe=1,be=0;xe<W.length;xe++){let Ce=W[xe-1],pe=W[xe];
8const De=W[xe===W.length-1?1:xe+1];if(b&&w&&b.currentPolyCount.top++,hp(pe,Ce,q)){D&&(se=De.sub(pe)._perp()._unit(),ye=!ye);continue}b&&b.append(pe,Ce);const Ne=pe.sub(Ce)._perp(),Re=Ne.x/(Math.abs(Ne.x)+Math.abs(Ne.y)),He=Ne.y>0?1:0,ze=Ce.dist(pe);if(be+ze>32768&&(be=0),D){me=De.sub(pe)._perp()._unit();let Ye=cp(Ce,pe,De,lp(se,me),D);isNaN(Ye)&&(Ye=0);const We=pe.sub(Ce)._unit();Ce=Ce.add(We.mult(ue))._round(),pe=pe.add(We.mult(-Ye))._round(),ue=Ye,se=me}const $e=X.vertexLength,Ke=W.length>4&&up(Ce,pe,De);let gt=dp(be,Ee,ye);if(Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,Ce.x,Ce.y,Re,He,0,1,gt),be+=ze,gt=dp(be,Ke,!ye),Ee=Ke,Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,0,gt),Bl(this.layoutVertexArray,pe.x,pe.y,Re,He,0,1,gt),X.vertexLength+=4,this.indexArray.emplaceBack($e+0,$e+1,$e+2),this.indexArray.emplaceBack($e+1,$e+3,$e+2),X.primitiveLength+=2,D){const Ye=V+(xe===1?W.length-2:xe-2),We=xe===1?V:Ye+1;if(this.indexArray.emplaceBack($e+1,Ye,$e+3),this.indexArray.emplaceBack(Ye,We,$e+3),X.primitiveLength+=2,ce===void 0&&(ce=$e),!hp(De,W[xe],q)){const Rt=xe===W.length-1?ce:X.vertexLength;this.indexArray.emplaceBack($e+2,$e+3,Rt),this.indexArray.emplaceBack($e+3,Rt+1,Rt),this.indexArray.emplaceBack($e+3,We,Rt+1),X.primitiveLength+=3}ye=!ye}if(x){const Ye=this.layoutVertexExtArray,We=_.projectTilePoint(Ce.x,Ce.y,s),Rt=_.projectTilePoint(pe.x,pe.y,s),et=_.upVector(s,Ce.x,Ce.y),tt=_.upVector(s,pe.x,pe.y);Ol(Ye,We,et),Ol(Ye,We,et),Ol(Ye,Rt,tt),Ol(Ye,Rt,tt)}}w&&(V+=W.length-1)}}if(b&&b.polyCount.length>0){if(b.borders){b.vertexArrayOffset=this.centroidVertexArray.length;const U=b.borders,q=this.featuresOnBorder.push(b)-1;for(let V=0;V<4;V++)U[V][0]!==Number.MAX_VALUE&&this.borders[V].push(q)}this.encodeCentroid(b.borders?void 0:b.centroid(),b)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort((i,n)=>this.featuresOnBorder[i].borders[e][0]-this.featuresOnBorder[n].borders[e][0])}encodeCentroid(e,i,n=!0){let s,c;if(e)if(e.y!==0){const p=i.span()._mult(this.tileToMeter);s=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(p.x/10)),c=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(p.y/10))}else s=Math.ceil(7*(e.x+450)),c=0;else s=0,c=+n;let u=n?this.centroidVertexArray.length:i.vertexArrayOffset;for(const p of i.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*p.edges+p.top);for(let m=0;m<p.top;m++)this.centroidVertexArray.emplace(u++,s,c);for(let m=0;m<2*p.edges;m++)this.centroidVertexArray.emplace(u++,0,c),this.centroidVertexArray.emplace(u++,s,c)}}}function lp(t,e){const i=t.add(e)._unit();return t.x*i.x+t.y*i.y}function Hm(t,e,i,n){const s=e.sub(t)._perp()._unit(),c=i.sub(e)._perp()._unit();return cp(t,e,i,lp(s,c),n)}function cp(t,e,i,n,s){const c=Math.sqrt(1-n*n);return Math.min(t.dist(e)/3,e.dist(i)/3,s*c/n)}function hp(t,e,i){return t.x<i[0].x&&e.x<i[0].x||t.x>i[1].x&&e.x>i[1].x||t.y<i[0].y&&e.y<i[0].y||t.y>i[1].y&&e.y>i[1].y}function up(t,e,i){if(t.x<0||t.x>=Ze||e.x<0||e.x>=Ze||i.x<0||i.x>=Ze)return!1;const n=i.sub(e),s=n.perp(),c=t.sub(e);return(n.x*c.x+n.y*c.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(c.x*c.x+c.y*c.y))>-.866&&s.x*c.x+s.y*c.y<0}function dp(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function pp(){const t=Math.PI/32,e=Math.tan(t),i=Pl;return i*Math.sqrt(1+2*e*e)-i}function fp(t,e,i){const n=1<<i.z,s=or(i.x/n),c=or((i.x+1)/n),u=bi(i.y/n),p=bi((i.y+1)/n);return function(m,_,x,b,w=0,S){const M=[];if(!m.length||!x||!b)return M;const C=(W,ce)=>{for(const se of W)M.push({polygon:se,bounds:ce})},D=Math.ceil(Math.log2(x)),U=Math.ceil(Math.log2(b)),q=D-U,V=[];for(let W=0;W<Math.abs(q);W++)V.push(q>0?0:1);for(let W=0;W<Math.min(D,U);W++)V.push(0),V.push(1);let $=m;if($=sh($,_[0].y-w,_[1].y+w,1),$=sh($,_[0].x-w,_[1].x+w,0),!$.length)return M;const X=[];for(V.length?X.push({polygons:$,bounds:_,depth:0}):C($,_);X.length;){const W=X.pop(),ce=W.depth,se=V[ce],me=W.bounds[0],Ee=W.bounds[1],ue=se===0?me.x:me.y,ye=se===0?Ee.x:Ee.y,xe=S?S(se,ue,ye):.5*(ue+ye),be=sh(W.polygons,ue-w,xe+w,se),Ce=sh(W.polygons,xe-w,ye+w,se);if(be.length){const pe=[me,new Le(se===0?xe:Ee.x,se===1?xe:Ee.y)];V.length>
vendor: 5,089 bytes, line 8
8ce+1?X.push({polygons:be,bounds:pe,depth:ce+1}):C(be,pe)}if(Ce.length){const pe=[new Le(se===0?xe:me.x,se===1?xe:me.y),Ee];V.length>ce+1?X.push({polygons:Ce,bounds:pe,depth:ce+1}):C(Ce,pe)}}return M}(t,e,Math.ceil((c-s)/11.25),Math.ceil((u-p)/11.25),1,(m,_,x)=>{if(m===0)return .5*(_+x);{const b=bi((i.y+_/Ze)/n);return(nn(.5*(bi((i.y+x/Ze)/n)+b))*n-i.y)*Ze}})}Ue(Fl,"FillExtrusionBucket",{omit:["layers","features"]}),Ue(ap,"PartMetadata");const Km=new j({"fill-extrusion-edge-radius":new I(fe["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Ym={paint:new j({"fill-extrusion-opacity":new I(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new I(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new L(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new I(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new I(fe["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new I(fe["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:Km};function mp(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ah{constructor(e,i,n){this.z=e,this.x=i,this.y=n,this.key=Ul(0,e,e,i,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i){const n=function(c,u,p){var m=mp(256*c,256*(u=Math.pow(2,p)-u-1),p),_=mp(256*(c+1),256*(u+1),p);return m[0]+","+m[1]+","+_[0]+","+_[1]}(this.x,this.y,this.z),s=function(c,u,p){let m,_="";for(let x=c;x>0;x--)m=1<<x-1,_+=(u&m?1:0)+(p&m?2:0);return _}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(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(i==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",s).replace("{bbox-epsg-3857}",n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class _p{constructor(e,i){this.wrap=e,this.canonical=i,this.key=Ul(e,i.z,i.z,i.x,i.y)}}class Pi{constructor(e,i,n,s,c){this.overscaledZ=e,this.wrap=i,this.canonical=new ah(n,+s,+c),this.key=i===0&&e===n?this.canonical.key:Ul(i,e,n,s,c)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const i=this.canonical.z-e;return e>this.canonical.z?new Pi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Pi(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}calculateScaledKey(e,i=!0){if(this.overscaledZ===e&&i)return this.key;if(e>this.canonical.z)return Ul(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return Ul(this.wrap*+i,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const i=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Pi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,n=2*this.canonical.x,s=2*this.canonical.y;return[new Pi(i,this.wrap,i,n,s),new Pi(i,this.wrap,i,n+1,s),new Pi(i,this.wrap,i,n,s+1),new Pi(i,this.wrap,i,n+1,s+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Pi(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Pi(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new _p(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Ul(t,e,i,n,s){const c=1<<Math.min(i,22);let u=c*(s%c)+n%c;return t&&i<22&&(u+=c*c*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*u+i)+(e-i)}Ue(ah,"CanonicalTileID"),Ue(Pi,"OverscaledTileID",{omit:["projMatrix"]});class la extends Le{constructor(e,i,n){super(e,i),this.z=n}}function Vl(t,e){return t.x*e.x+t.y*e.y}function gp(t,e){if(t.length===1){let i=0;const n=e[i++];let s;for(;!s||n.equals(s);)if(s=e[i++],!s)return 1/0;for(;i<e.length;i++){const c=e[i],u=t[0],p=s.sub(n),m=c.sub(n),_=u.sub(n),x=Vl(p,p),b=Vl(p,m),w=Vl(m,m),S=Vl(_,p),M=Vl(_,m),C=x*w-b*b,D=(w*S-b*M)/C,U=(x*M-b*S)/C,q=n.z*(1-D-U)+s.z*D+c.z*U;
vendor: 4,766 bytes, line 8
8if(isFinite(q))return q}return 1/0}{let i=1/0;for(const n of e)i=Math.min(i,n.z);return i}}function yp(t,e,i,n,s,c,u,p){const m=u*s.getElevationAt(t,e,!0,!0),_=c[0]!==0,x=_?c[1]===0?u*(c[0]/7-450):u*function(b,w,S){const M=Math.floor(w[0]/8),C=Math.floor(w[1]/8),D=10*(w[0]-8*M),U=10*(w[1]-8*C),q=b.getElevationAt(M,C,!0,!0),V=b.getMeterToDEM(S),$=Math.floor(.5*(D*V-1)),X=Math.floor(.5*(U*V-1)),W=b.tileCoordToPixel(M,C),ce=2*$+1,se=2*X+1,me=function(Ce,pe,De,Ne,Re){return[Ce.getElevationAtPixel(pe,De,!0),Ce.getElevationAtPixel(pe+Re,De,!0),Ce.getElevationAtPixel(pe,De+Re,!0),Ce.getElevationAtPixel(pe+Ne,De+Re,!0)]}(b,W.x-$,W.y-X,ce,se),Ee=Math.abs(me[0]-me[1]),ue=Math.abs(me[2]-me[3]),ye=Math.abs(me[0]-me[2])+Math.abs(me[1]-me[3]),xe=Math.min(.25,.5*V*(Ee+ue)/ce),be=Math.min(.25,.5*V*ye/se);return q+Math.max(xe*D,be*U)}(s,c,p):m;return{base:m+(i===0)?-1:i,top:_?Math.max(x+n,m+i+2):m+n}}const Jm=te([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:Qm}=Jm,e_=te([{name:"a_packed",components:4,type:"Float32"}]),{members:t_}=e_,i_=oh.types,r_=Math.cos(Math.PI/180*37.5);class lh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(i=>i.id),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new he,this.layoutVertexArray2=new we,this.indexArray=new je,this.programConfigurations=new is(e.layers,e.zoom),this.segments=new Yt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,n,s){this.hasPattern=Au("line",this.layers,i);const c=this.layers[0].layout.get("line-sort-key"),u=[];for(const{feature:x,id:b,index:w,sourceLayerIndex:S}of e){const M=this.layers[0]._featureFilter.needGeometry,C=ls(x,M);if(!this.layers[0]._featureFilter.filter(new v(this.zoom),C,n))continue;const D=c?c.evaluate(C,{},n):void 0,U={id:b,properties:x.properties,type:x.type,sourceLayerIndex:S,index:w,geometry:M?C.geometry:zn(x,n,s),patterns:{},sortKey:D};u.push(U)}c&&u.sort((x,b)=>x.sortKey-b.sortKey);const{lineAtlas:p,featureIndex:m}=i,_=this.addConstantDashes(p);for(const x of u){const{geometry:b,index:w,sourceLayerIndex:S}=x;if(_&&this.addFeatureDashes(x,p),this.hasPattern){const M=Iu("line",this.layers,x,this.zoom,i);this.patternFeatures.push(M)}else this.addFeature(x,b,w,n,p.positions,i.availableImages);m.insert(e[w].feature,b,w,S,this.index)}}addConstantDashes(e){let i=!1;for(const n of this.layers){const s=n.paint.get("line-dasharray").value,c=n.layout.get("line-cap").value;if(s.kind!=="constant"||c.kind!=="constant")i=!0;else{const u=c.value,p=s.value;if(!p)continue;e.addDash(p,u)}}return i}addFeatureDashes(e,i){const n=this.zoom;for(const s of this.layers){const c=s.paint.get("line-dasharray").value,u=s.layout.get("line-cap").value;if(c.kind==="constant"&&u.kind==="constant")continue;let p,m;if(c.kind==="constant"){if(p=c.value,!p)continue}else p=c.evaluate({zoom:n},e);m=u.kind==="constant"?u.value:u.evaluate({zoom:n},e),i.addDash(p,m),e.patterns[s.id]=i.getKey(p,m)}}update(e,i,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,n,s)}addFeatures(e,i,n,s,c){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,i,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,t_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qm),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,n,s,c,u){const p=this.layers[0].layout,m=p.get("line-join").evaluate(e,{}),_=p.get("line-cap").evaluate(e,{}),x=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const w of i)this.addLine(w,e,m,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,c,u,s)}addLine(e,i,n,s,c,u){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineS
vendor: 4,253 bytes, line 8
8oFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U<e.length-1;U++)this.totalDistance+=e[U].dist(e[U+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const p=i_[i.type]==="Polygon";let m=e.length;for(;m>=2&&e[m-1].equals(e[m-2]);)m--;let _=0;for(;_<m-1&&e[_].equals(e[_+1]);)_++;if(m<(p?3:2))return;n==="bevel"&&(c=1.05);const x=this.overscaling<=16?15*Ze/(512*this.overscaling):0,b=this.segments.prepareSegment(10*m,this.layoutVertexArray,this.indexArray);let w,S,M,C,D;this.e1=this.e2=-1,p&&(w=e[m-2],D=e[_].sub(w)._unit()._perp());for(let U=_;U<m;U++){if(M=U===m-1?p?e[_+1]:void 0:e[U+1],M&&e[U].equals(M))continue;D&&(C=D),w&&(S=w),w=e[U],D=M?M.sub(w)._unit()._perp():C,C=C||D;let q=C.add(D);q.x===0&&q.y===0||q._unit();const V=C.x*D.x+C.y*D.y,$=q.x*D.x+q.y*D.y,X=$!==0?1/$:1/0,W=2*Math.sqrt(2-2*$),ce=$<r_&&S&&M,se=C.x*D.y-C.y*D.x>0;if(ce&&U>_){const ue=w.dist(S);if(ue>2*x){const ye=w.sub(w.sub(S)._mult(x/ue)._round());this.updateDistance(S,ye),this.addCurrentVertex(ye,C,0,0,b),S=ye}}const me=S&&M;let Ee=me?n:p?"butt":s;if(me&&Ee==="round"&&(X<u?Ee="miter":X<=2&&(Ee="fakeround")),Ee==="miter"&&X>c&&(Ee="bevel"),Ee==="bevel"&&(X>2&&(Ee="flipbevel"),X<c&&(Ee="miter")),S&&this.updateDistance(S,w),Ee==="miter")q._mult(X),this.addCurrentVertex(w,q,0,0,b);else if(Ee==="flipbevel"){if(X>100)q=D.mult(-1);else{const ue=X*C.add(D).mag()/C.sub(D).mag();q._perp()._mult(ue*(se?-1:1))}this.addCurrentVertex(w,q,0,0,b),this.addCurrentVertex(w,q.mult(-1),0,0,b)}else if(Ee==="bevel"||Ee==="fakeround"){const ue=-Math.sqrt(X*X-1),ye=se?ue:0,xe=se?0:ue;if(S&&this.addCurrentVertex(w,C,ye,xe,b),Ee==="fakeround"){const be=Math.round(180*W/Math.PI/20);for(let Ce=1;Ce<be;Ce++){let pe=Ce/be;if(pe!==.5){const Ne=pe-.5;pe+=pe*Ne*(pe-1)*((1.0904+V*(V*(3.55645-1.43519*V)-3.2452))*Ne*Ne+(.848013+V*(.215638*V-1.06021)))}const De=D.sub(C)._mult(pe)._add(C)._unit()._mult(se?-1:1);this.addHalfVertex(w,De.x,De.y,!1,se,0,b)}}M&&this.addCurrentVertex(w,D,-ye,-xe,b)}else if(Ee==="butt")this.addCurrentVertex(w,q,0,0,b);else if(Ee==="square"){const ue=S?1:-1;S||this.addCurrentVertex(w,q,ue,ue,b),this.addCurrentVertex(w,q,0,0,b),S&&this.addCurrentVertex(w,q,ue,ue,b)}else Ee==="round"&&(S&&(this.addCurrentVertex(w,C,0,0,b),this.addCurrentVertex(w,C,1,1,b,!0)),M&&(this.addCurrentVertex(w,D,-1,-1,b,!0),this.addCurrentVertex(w,D,0,0,b)));if(ce&&U<m-1){const ue=w.dist(M);if(ue>2*x){const ye=w.add(M.sub(w)._mult(x/ue)._round());this.updateDistance(w,ye),this.addCurrentVertex(ye,D,0,0,b),w=ye}}}}addCurrentVertex(e,i,n,s,c,u=!1){const p=i.y*s-i.x,m=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*n,i.y-i.x*n,u,!1,n,c),this.addHalfVertex(e,p,m,u,!0,-s,c)}addHalfVertex({x:e,y:i},n,s,c,u,p,m){this.layoutVertexArray.emplaceBack((e<<1)+(c?1:0),(i<<1)+(u?1:0),Math.round(63*n)+128,Math.round(63*s)+128,1+(p===0?0:p<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const _=m.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),m.primitiveLength++),u?this.e2=_:this.e1=_}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}}Ue(lh,"LineBucket",{omit:["layers","patternFeatures"]});const n_=new j({"line-cap":new L(fe.layout_line["line-cap"]),"line-join":new L(fe.layout_line["line-join"]),"line-miter-limit":new I(fe.layout_line["line-miter-limit"]),"line-round-limit":new I(fe.layout_line["line-round-limit"]),"line-sort-key":new L(fe.layout_line["line-sort-key"])});var xp={paint:new j({"line-opacity":new L(fe.paint_line["line-opacity"]),"line-color":new L(fe.paint_line["line-color"]),"line-translate":new I(fe.paint_line["line-translate"]),"line-translate-anchor":new I(fe.paint_line["line-translate-anchor"]),"line-width":new L(fe.paint_line["line-width"]),"line-gap-width":new L(fe.paint_line["line-gap-width"]),"line-offset":new L(fe.paint_line["line-offset"]),"line-blur"
8:new L(fe.paint_line["line-blur"]),"line-dasharray":new L(fe.paint_line["line-dasharray"]),"line-pattern":new L(fe.paint_line["line-pattern"]),"line-gradient":new N(fe.paint_line["line-gradient"]),"line-trim-offset":new I(fe.paint_line["line-trim-offset"])}),layout:n_};const vp=new class extends L{possiblyEvaluate(t,e){return e=new v(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=Wt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(xp.paint.properties["line-width"].specification);function bp(t,e){return e>0?e+2*t:t}vp.useIntegerZoom=!0;const o_=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),s_=te([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),a_=te([{name:"a_projected_pos",components:4,type:"Float32"}],4);te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const l_=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),c_=te([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wp=te([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),h_=te([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);te([{name:"triangle",components:3,type:"Uint16"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),te([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),te([{type:"Float32",name:"offsetX"}]),te([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var mi=24;const Nr=128;function zu(t,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new v(t+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:n,interpolationType:s}=i;let c=0;for(;c<n.length&&n[c]<=t;)c++;c=Math.max(0,c-1);let u=c;for(;u<n.length&&n[u]<t+1;)u++;u=Math.min(n.length-1,u);const p=n[c],m=n[u];return i.kind==="composite"?{kind:"composite",minZoom:p,maxZoom:m,interpolationType:s}:{kind:"camera",minZoom:p,maxZoom:m,minSize:i.evaluate(new v(p)),maxSize:i.evaluate(new v(m)),interpolationType:s}}}function ch(t,{uSize:e,uSizeT:i},{lowerSize:n,upperSize:s}){return t.kind==="source"?n/Nr:t.kind==="composite"?mt(n/Nr,s/Nr,i):e}function ca(t,e){let i=0,n=0;if(t.kind==="constant")n=t.layoutSize;else if(t.kind!=="source"){const{interpolationType:s,minZoom:c,maxZoom:u}=t,p=s?ct(ur.interpolationFactor(s,e,c,u),0,1):0;t.kind==="camera"?n=mt(t.minSize,t.maxSize,p):i=p}return{uSizeT:i,uSize:n}}var u_=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Nr,evaluateSizeForFeature:ch,evaluateSizeForZoom:ca,getSizeData:zu});function d_(t,e,i){return t.sections.forEach(n=>
vendor: 3,721 bytes, line 8
8{n.text=function(s,c,u){const p=c.layout.get("text-transform").evaluate(u,{});return p==="uppercase"?s=s.toLocaleUpperCase():p==="lowercase"&&(s=s.toLocaleLowerCase()),y.applyArabicShaping&&(s=y.applyArabicShaping(s)),s}(n.text,e,i)}),t}const Nl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function p_(t){return t==="︶"||t==="﹈"||t==="︸"||t==="﹄"||t==="﹂"||t==="︾"||t==="︼"||t==="︺"||t==="︘"||t==="﹀"||t==="︐"||t==="︓"||t==="︔"||t==="`"||t===" ̄"||t==="︑"||t==="︒"}function f_(t){return t==="︵"||t==="﹇"||t==="︷"||t==="﹃"||t==="﹁"||t==="︽"||t==="︻"||t==="︹"||t==="︗"||t==="︿"}var Tp=Pt,Ep=function(t,e,i,n,s){var c,u,p=8*s-n-1,m=(1<<p)-1,_=m>>1,x=-7,b=i?s-1:0,w=i?-1:1,S=t[e+b];for(b+=w,c=S&(1<<-x)-1,S>>=-x,x+=p;x>0;c=256*c+t[e+b],b+=w,x-=8);for(u=c&(1<<-x)-1,c>>=-x,x+=n;x>0;u=256*u+t[e+b],b+=w,x-=8);if(c===0)c=1-_;else{if(c===m)return u?NaN:1/0*(S?-1:1);u+=Math.pow(2,n),c-=_}return(S?-1:1)*u*Math.pow(2,c-n)},Sp=function(t,e,i,n,s,c){var u,p,m,_=8*c-s-1,x=(1<<_)-1,b=x>>1,w=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,M=n?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-u))<1&&(u--,m*=2),(e+=u+b>=1?w/m:w*Math.pow(2,1-b))*m>=2&&(u++,m/=2),u+b>=x?(p=0,u=x):u+b>=1?(p=(e*m-1)*Math.pow(2,s),u+=b):(p=e*Math.pow(2,b-1)*Math.pow(2,s),u=0));s>=8;t[i+S]=255&p,S+=M,p/=256,s-=8);for(u=u<<s|p,_+=s;_>0;t[i+S]=255&u,S+=M,u/=256,_-=8);t[i+S-M]|=128*C};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Pt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Pt.Varint=0,Pt.Fixed64=1,Pt.Bytes=2,Pt.Fixed32=5;var Pu=4294967296,Mp=1/Pu,Ap=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function kn(t){return t.type===Pt.Bytes?t.readVarint()+t.pos:t.pos+1}function ha(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ip(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var s=i.pos-1;s>=t;s--)i.buf[s+n]=i.buf[s]}function m_(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function __(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function g_(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function y_(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function x_(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function v_(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function b_(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function w_(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function T_(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function hh(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}
vendor: 7,156 bytes, line 8
8function ua(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Cp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Pt.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),s=n>>3,c=this.pos;this.type=7&n,t(s,e,this),this.pos===c&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hh(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hh(this.buf,this.pos)+hh(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readSFixed64:function(){var t=hh(this.buf,this.pos)+Cp(this.buf,this.pos+4)*Pu;return this.pos+=8,t},readFloat:function(){var t=Ep(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ep(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(s,c,u){var p,m,_=u.buf;if(p=(112&(m=_[u.pos++]))>>4,m<128||(p|=(127&(m=_[u.pos++]))<<3,m<128)||(p|=(127&(m=_[u.pos++]))<<10,m<128)||(p|=(127&(m=_[u.pos++]))<<17,m<128)||(p|=(127&(m=_[u.pos++]))<<24,m<128)||(p|=(1&(m=_[u.pos++]))<<31,m<128))return ha(s,p,c);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ap?function(i,n,s){return Ap.decode(i.subarray(n,s))}(this.buf,e,t):function(i,n,s){for(var c="",u=n;u<s;){var p,m,_,x=i[u],b=null,w=x>239?4:x>223?3:x>191?2:1;if(u+w>s)break;w===1?x<128&&(b=x):w===2?(192&(p=i[u+1]))==128&&(b=(31&x)<<6|63&p)<=127&&(b=null):w===3?(m=i[u+2],(192&(p=i[u+1]))==128&&(192&m)==128&&((b=(15&x)<<12|(63&p)<<6|63&m)<=2047||b>=55296&&b<=57343)&&(b=null)):w===4&&(m=i[u+2],_=i[u+3],(192&(p=i[u+1]))==128&&(192&m)==128&&(192&_)==128&&((b=(15&x)<<18|(63&p)<<12|(63&m)<<6|63&_)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,w=1):b>65535&&(b-=65536,c+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),c+=String.fromCharCode(b),u+=w}return c}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Pt.Bytes)return t.push(this.readVarint(e));var i=kn(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Pt.Bytes)return t.push(this.readSVarint());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Pt.Bytes)return t.push(this.readBoolean());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Pt.Bytes)return t.push(this.readFloat());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Pt.Bytes)return t.push(this.readDouble());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Pt.Bytes)return t.push(this.readFixed32());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Pt.Bytes)return t.push(this.readSFixed32());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Pt.Bytes)return t.push(this.readFixed64());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Pt.Bytes)return t.push(this.readSFixed64());var e=kn(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Pt.Varint)for(;this.buf[this.pos++]>127;);else if(e===Pt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Pt.Fixed32)this.pos+=4;else{if(e!==Pt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ua(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ua(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ua(this.buf,-1&t,this.pos),ua(this.buf,Math.floor(t*Mp),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ua(this.buf,-1&t,this.pos),ua(this.buf,Math.floor(t*Mp),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(e,i){var n,s;if(e>=0?(n=e%4294967296|0,s=e/4294967296|0):(s=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,s=s+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(c,u,p){p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,c>>>=7,p.buf[p.pos++]=127&c|128,p.buf[p.pos]=127&(c>>>=7)}(n,0,i),function(c,u){var p=(7&c)<<4;u.buf[u.pos++]|=p|((c>>>=3)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c|((c>>>=7)?128:0),c&&(u.buf[u.pos++]=127&c)))))}(s,i)}(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:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(n,s,c){for(var u,p,m=0;m<s.length;m++){if((u=s.charCodeAt(m))>55295&&u<57344){if(!p){u>56319||m+1===s.length?(n[c++]=239,n[c++]=191,n[c++]=189):p=u;continue}if(u<56320){n[c++]=239,n[c++]=191,n[c++]=189,p=u;continue}u=p-55296<<10|u-56320|65536,p=null}else p&&(n[c++]=239,n[c++]=191,n[c++]=189,p=null);u<128?n[c++]=u:(u<2048?n[c++]=u>>6|192:(u<65536?n[c++]=u>>12|224:(n[c++]=u>>18|240,n[c++]=u>>12&63|128),n[c++]=u>>6&63|128),n[c++]=63&u|128)}return c}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ip(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Sp(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Sp(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Ip(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}
vendor: 4,659 bytes, line 8
8,writeMessage:function(t,e,i){this.writeTag(t,Pt.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,m_,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,__,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,x_,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,g_,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,y_,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,v_,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,b_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,w_,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,T_,e)},writeBytesField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Pt.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Pt.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Pt.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Pt.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var uh=Ji(Tp);const ku=3;function E_(t,e,i){e.glyphs=[],t===1&&i.readMessage(S_,e)}function S_(t,e,i){if(t===3){const{id:n,bitmap:s,width:c,height:u,left:p,top:m,advance:_}=i.readMessage(M_,{});e.glyphs.push({id:n,bitmap:new Pn({width:c+2*ku,height:u+2*ku},s),metrics:{width:c,height:u,left:p,top:m,advance:_}})}else t===4?e.ascender=i.readSVarint():t===5&&(e.descender=i.readSVarint())}function M_(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}const zp=ku;function Du(t){let e=0,i=0;for(const u of t)e+=u.w*u.h,i=Math.max(i,u.w);t.sort((u,p)=>p.h-u.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,c=0;for(const u of t)for(let p=n.length-1;p>=0;p--){const m=n[p];if(!(u.w>m.w||u.h>m.h)){if(u.x=m.x,u.y=m.y,c=Math.max(c,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===m.w&&u.h===m.h){const _=n.pop();p<n.length&&(n[p]=_)}else u.h===m.h?(m.x+=u.w,m.w-=u.w):u.w===m.w?(m.y+=u.h,m.h-=u.h):(n.push({x:m.x+u.w,y:m.y,w:m.w-u.w,h:u.h}),m.y+=u.h,m.h-=u.h);break}}return{w:s,h:c,fill:e/(s*c)||0}}const Fi=1;class Lu{constructor(e,{pixelRatio:i,version:n,stretchX:s,stretchY:c,content:u}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=s,this.stretchY=c,this.content=u,this.version=n}get tl(){return[this.paddedRect.x+Fi,this.paddedRect.y+Fi]}get br(){return[this.paddedRect.x+this.paddedRect.w-Fi,this.paddedRect.y+this.paddedRect.h-Fi]}get displaySize(){return[(this.paddedRect.w-2*Fi)/this.pixelRatio,(this.paddedRect.h-2*Fi)/this.pixelRatio]}}class Pp{constructor(e,i){const n={},s={};this.haveRenderCallbacks=[];const c=[];this.addImages(e,n,c),this.addImages(i,s,c);const{w:u,h:p}=Du(c),m=new Xi({width:u||1,height:p||1});for(const _ in e){const x=e[_],b=n[_].paddedRect;Xi.copy(x.data,m,{x:0,y:0},{x:b.x+Fi,y:b.y+Fi},x.data)}for(const _ in i){const x=i[_],b=s[_].paddedRect,w=b.x+Fi,S=b.y+Fi,M=x.data.width,C=x.data.height;Xi.copy(x.data,m,{x:0,y:0},{x:w,y:S},x.data),Xi.copy(x.data,m,{x:0,y:C-1},{x:w,y:S-1},{width:M,height:1}),Xi.copy(x.data,m,{x:0,y:0},{x:w,y:S+C},{width:M,height:1}),Xi.copy(x.data,m,{x:M-1,y:0},{x:w-1,y:S},{width:1,height:C}),Xi.copy(x.data,m,{x:0,y:0},{x:w+M,y:S},{width:1,height:C})}this.image=m,this.iconPositions=n,this.patternPositions=s}addImages(e,i,n){for(const s in e){const c=e[s],u={x:0,y:0,w:c.data.width+2*Fi,h:c.data.height+2*Fi};n.push(u),i[s]=new Lu(u,c),c.hasRenderCallback&&this.haveRenderCallbacks.push(s)}}patchUpdatedImages(e,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(n=>e.hasImage(n)),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),i),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),i)}patchUpdatedImage(e,i,n){if(!e||!i||e.version===i.version)return;e.version=i.version;const[s,c]=e.tl;n.update(i.data,void 0,{x:s,y:c})}}Ue(Lu,"ImagePosition"),Ue(Pp,"ImageAtlas");const sr={horizontal:1,vertical:2,horizontalOnly:3},kp=-17;
vendor: 14,318 bytes, line 8
8class jl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,i){const n=new jl;return n.scale=e||1,n.fontStack=i,n}static forImage(e){const i=new jl;return i.imageName=e,i}}class da{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,i){const n=new da;for(let s=0;s<e.sections.length;s++){const c=e.sections[s];c.image?n.addImageSection(c):n.addTextSection(c,i)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(i,n){let s="";for(let c=0;c<i.length;c++){const u=i.charCodeAt(c+1)||null,p=i.charCodeAt(c-1)||null;s+=!n&&(u&&Vc(u)&&!Nl[i[c+1]]||p&&Vc(p)&&!Nl[i[c-1]])||!Nl[i[c]]?i[c]:Nl[i[c]]}return s}(this.text,e)}trim(){let e=0;for(let n=0;n<this.text.length&&dh[this.text.charCodeAt(n)];n++)e++;let i=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&dh[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(e,i),this.sectionIndex=this.sectionIndex.slice(e,i)}substring(e,i){const n=new da;return n.text=this.text.substring(e,i),n.sectionIndex=this.sectionIndex.slice(e,i),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}addTextSection(e,i){this.text+=e.text,this.sections.push(jl.forText(e.scale,e.fontStack||i));const n=this.sections.length-1;for(let s=0;s<e.text.length;++s)this.sectionIndex.push(n)}addImageSection(e){const i=e.image?e.image.name:"";if(i.length===0)return void Ut("Can't add FormattedSection with an empty image.");const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(jl.forImage(i)),this.sectionIndex.push(this.sections.length-1)):Ut("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ru(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=da.fromFeature(t,s);b===sr.vertical&&C.verticalizePunctuation(w);let D=[];const U=function(W,ce,se,me,Ee,ue){if(!W)return[];const ye=[],xe=function(De,Ne,Re,He,ze,$e){let Ke=0;for(let gt=0;gt<De.length();gt++){const Ye=De.getSection(gt);Ke+=Dp(De.getCharCode(gt),Ye,He,ze,Ne,$e)}return Ke/Math.max(1,Math.ceil(Ke/Re))}(W,ce,se,me,Ee,ue),be=W.text.indexOf("​")>=0;let Ce=0;for(let De=0;De<W.length();De++){const Ne=W.getSection(De),Re=W.getCharCode(De);if(dh[Re]||(Ce+=Dp(Re,Ne,me,Ee,ce,ue)),De<W.length()-1){const He=!((pe=Re)<11904||!(Be["Bopomofo Extended"](pe)||Be.Bopomofo(pe)||Be["CJK Compatibility Forms"](pe)||Be["CJK Compatibility Ideographs"](pe)||Be["CJK Compatibility"](pe)||Be["CJK Radicals Supplement"](pe)||Be["CJK Strokes"](pe)||Be["CJK Symbols and Punctuation"](pe)||Be["CJK Unified Ideographs Extension A"](pe)||Be["CJK Unified Ideographs"](pe)||Be["Enclosed CJK Letters and Months"](pe)||Be["Halfwidth and Fullwidth Forms"](pe)||Be.Hiragana(pe)||Be["Ideographic Description Characters"](pe)||Be["Kangxi Radicals"](pe)||Be["Katakana Phonetic Extensions"](pe)||Be.Katakana(pe)||Be["Vertical Forms"](pe)||Be["Yi Radicals"](pe)||Be["Yi Syllables"](pe)));(A_[Re]||He||Ne.imageName)&&ye.push(Rp(De+1,Ce,xe,ye,I_(Re,W.getCharCode(De+1),He&&be),!1))}}var pe;return Bp(Rp(W.length(),Ce,xe,ye,0,!0))}(C,_,c,e,n,S),{processBidirectionalText:q,processStyledBidirectionalText:V}=y;if(q&&C.sections.length===1){const W=q(C.toString(),U);for(const ce of W){const se=new da;se.text=ce,se.sections=C.sections;for(let me=0;me<ce.length;me++)se.sectionIndex.push(0);D.push(se)}}else if(V){const W=V(C.text,C.sectionIndex,U);for(const ce of W){const se=new da;se.text=ce[0],se.sectionIndex=ce[1],se.sections=C.sections,D.push(se)}}else D=function(W,ce){const se=[],me=W.text;let Ee=0;for(const ue of ce)se.push(W.substring(Ee,ue)),Ee=ue;return Ee<me.length&&se.push(W.substring(Ee,me.length)),se}(C,U);const $=[],X={positionedLines:$,text:C.toString(),top:x[1],bottom:x[1],left:x[0],right:x[0],writingMode:b,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(W,ce,se,me,Ee,ue,ye,xe,be,Ce,pe,De){let Ne=0,Re=0,He=0;const ze=xe==="right"?1:xe==="left"?0:.5;let $e=!1;for(const et of Ee){const tt=et.getSections();for(const It of tt){if(It.imageName)continue;const kt=ce[It.fontStack];if(kt&&($e=kt.ascender!==void 0&&kt.descender!==void 0,!$e))break}if(!$e)break}let Ke=0;for(const et of Ee){et.trim();const tt=et.getMaxScale(),It=(tt-1)*mi,kt={positionedGlyphs:[],lineOffset:0};W.positionedLines[Ke]=kt;const Dt=kt.positionedGlyphs;let Ct=0;if(!et.length()){Re+=ue,++Ke;continue}let Nt=0,$t=0;for(let zt=0;zt<et.length();zt++){const ni=et.getSection(zt),ei=et.getSectionIndex(zt),jt=et.getCharCode(zt);let xt=ni.scale,ti=null,Lt=null,ki=null,ii=mi,_i=0;const di=!(be===sr.horizontal||!pe&&!ml(jt)||pe&&(dh[jt]||(gt=jt,Be.Arabic(gt)||Be["Arabic Supplement"](gt)||Be["Arabic Extended-A"](gt)||Be["Arabic Presentation Forms-A"](gt)||Be["Arabic Presentation Forms-B"](gt))));if(ni.imageName){const Di=me[ni.imageName];if(!Di)continue;ki=ni.imageName,W.iconsInText=W.iconsInText||!0,Lt=Di.paddedRect;const pi=Di.displaySize;xt=xt*mi/De,ti={width:pi[0],height:pi[1],left:Fi,top:-zp,advance:di?pi[1]:pi[0],localGlyph:!1},_i=$e?-ti.height*xt:kp+tt*mi-pi[1]*xt,ii=ti.advance;const $r=(di?pi[0]:pi[1])*xt-mi*tt;$r>0&&$r>Ct&&(Ct=$r)}else{const Di=se[ni.fontStack];if(!Di)continue;Di[jt]&&(Lt=Di[jt]);const pi=ce[ni.fontStack];if(!pi)continue;const $r=pi.glyphs[jt];if(!$r)continue;if(ti=$r.metrics,ii=jt!==8203?mi:0,$e){const xa=pi.ascender!==void 0?Math.abs(pi.ascender):0,Jl=pi.descender!==void 0?Math.abs(pi.descender):0,Ql=(xa+Jl)*xt;Nt<Ql&&(Nt=Ql,$t=(xa-Jl)/2*xt),_i=-xa*xt}else _i=kp+(tt-xt)*mi}di?(W.verticalizable=!0,Dt.push({glyph:jt,imageName:ki,x:Ne,y:Re+_i,vertical:di,scale:xt,localGlyph:ti.localGlyph,fontStack:ni.fontStack,sectionIndex:ei,metrics:ti,rect:Lt}),Ne+=ii*xt+Ce):(Dt.push({glyph:jt,imageName:ki,x:Ne,y:Re+_i,vertical:di,scale:xt,localGlyph:ti.localGlyph,fontStack:ni.fontStack,sectionIndex:ei,metrics:ti,rect:Lt}),Ne+=ti.advance*xt+Ce)}Dt.length!==0&&(He=Math.max(Ne-Ce,He),$e?Op(Dt,ze,Ct,$t,ue*tt/2):Op(Dt,ze,Ct,0,ue/2)),Ne=0;const Qt=ue*tt+Ct;kt.lineOffset=Math.max(Ct,It),Re+=Qt,++Ke}var gt;const Ye=Re,{horizontalAlign:We,verticalAlign:Rt}=Bu(ye);(function(et,tt,It,kt,Dt,Ct){const Nt=(tt-It)*Dt,$t=-Ct*kt;for(const Qt of et)for(const zt of Qt.positionedGlyphs)zt.x+=Nt,zt.y+=$t})(W.positionedLines,ze,We,Rt,He,Ye),W.top+=-Rt*Ye,W.bottom=W.top+Ye,W.left+=-We*He,W.right=W.left+He,W.hasBaseline=$e}(X,e,i,n,D,u,p,m,b,_,w,M),!function(W){for(const ce of W)if(ce.positionedGlyphs.length!==0)return!1;return!0}($)&&X}const dh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},A_={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Dp(t,e,i,n,s,c){if(e.imageName){const u=n[e.imageName];return u?u.displaySize[0]*e.scale*mi/c+s:0}{const u=i[e.fontStack],p=u&&u.glyphs[t];return p?p.metrics.advance*e.scale+s:0}}function Lp(t,e,i,n){const s=Math.pow(t-e,2);return n?t<e?s/2:2*s:s+Math.abs(i)*i}function I_(t,e,i){let n=0;return t===10&&(n-=1e4),i&&(n+=150),t!==40&&t!==65288||(n+=50),e!==41&&e!==65289||(n+=50),n}function Rp(t,e,i,n,s,c){let u=null,p=Lp(e,i,s,c);for(const m of n){const _=Lp(e-m.x,i,s,c)+m.badness;_<=p&&(u=m,p=_)}return{index:t,x:e,priorBreak:u,badness:p}}function Bp(t){return t?Bp(t.priorBreak).concat(t.index):[]}function Bu(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Op(t,e,i,n,s){if(!(e||i||n||s))return;const c=t.length-1,u=t[c],p=(u.x+u.metrics.advance*u.scale)*e;for(let m=0;m<=c;m++)t[m].x-=p,t[m].y+=i+n+s}function C_(t,e,i){const{horizontalAlign:n,verticalAlign:s}=Bu(i),c=e[0]-t.displaySize[0]*n,u=e[1]-t.displaySize[1]*s;return{image:t,top:u,bottom:u+t.displaySize[1],left:c,right:c+t.displaySize[0]}}function Fp(t,e,i,n,s,c){const u=t.image;let p;if(u.content){const D=u.content,U=u.pixelRatio||1;p=[D[0]/U,D[1]/U,u.displaySize[0]-D[2]/U,u.displaySize[1]-D[3]/U]}const m=e.left*c,_=e.right*c;let x,b,w,S;i==="width"||i==="both"?(S=s[0]+m-n[3],b=s[0]+_+n[1]):(S=s[0]+(m+_-u.displaySize[0])/2,b=S+u.displaySize[0]);const M=e.top*c,C=e.bottom*c;return i==="height"||i==="both"?(x=s[1]+M-n[0],w=s[1]+C+n[2]):(x=s[1]+(M+C-u.displaySize[1])/2,w=x+u.displaySize[1]),{image:u,top:x,right:b,bottom:w,left:S,collisionPadding:p}}class Dn extends Le{constructor(e,i,n,s,c){super(e,i),this.angle=s,this.z=n,c!==void 0&&(this.segment=c)}clone(){return new Dn(this.x,this.y,this.z,this.angle,this.segment)}}function Up(t,e,i,n,s){if(e.segment===void 0)return!0;let c=e,u=e.segment+1,p=0;for(;p>-i/2;){if(u--,u<0)return!1;p-=t[u].dist(c),c=t[u]}p+=t[u].dist(t[u+1]),u++;const m=[];let _=0;for(;p<i/2;){const x=t[u],b=t[u+1];if(!b)return!1;let w=t[u-1].angleTo(x)-x.angleTo(b);for(w=Math.abs((w+3*Math.PI)%(2*Math.PI)-Math.PI),m.push({distance:p,angleDelta:w}),_+=w;p-m[0].distance>n;)_-=m.shift().angleDelta;if(_>s)return!1;u++,p+=x.dist(b)}return!0}function Vp(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Np(t,e,i){return t?.6*e*i:0}function jp(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function z_(t,e,i,n,s,c){const u=Np(i,s,c),p=jp(i,n)*c;let m=0;const _=Vp(t)/2;for(let x=0;x<t.length-1;x++){const b=t[x],w=t[x+1],S=b.dist(w);if(m+S>_){const M=(_-m)/S,C=mt(b.x,w.x,M),D=mt(b.y,w.y,M),U=new Dn(C,D,0,w.angleTo(b),x);return!u||Up(t,U,p,u,e)?U:void 0}m+=S}}function P_(t,e,i,n,s,c,u,p,m){const _=Np(n,c,u),x=jp(n,s),b=x*u,w=t[0].x===0||t[0].x===m||t[0].y===0||t[0].y===m;return e-b<e/4&&(e=b+e/4),Gp(t,w?e/2*p%e:(x/2+2*c)*u*p%e,e,_,i,b,w,!1,m)}function Gp(t,e,i,n,s,c,u,p,m){const _=c/2,x=Vp(t);let b=0,w=e-i,S=[];for(let M=0;M<t.length-1;M++){const C=t[M],D=t[M+1],U=C.dist(D),q=D.angleTo(C);for(;w+i<b+U;){w+=i;const V=(w-b)/U,$=mt(C.x,D.x,V),X=mt(C.y,D.y,V);if($>=0&&$<m&&X>=0&&X<m&&w-_>=0&&w+_<=x){const W=new Dn($,X,0,q,M);W._round(),n&&!Up(t,W,c,n,s)||S.push(W)}}b+=U}return p||S.length||u||(S=Gp(t,b/2,i,n,s,c,u,!0,m)),S}function $p(t,e,i,n,s){const c=[];for(let u=0;u<t.length;u++){const p=t[u];let m;for(let _=0;_<p.length-1;_++){let x=p[_],b=p[_+1];x.x<e&&b.x<e||(x.x<e?x=new Le(e,x.y+(e-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x<e&&(b=new Le(e,x.y+(e-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y<i&&b.y<i||(x.y<i?x=new Le(x.x+(i-x.y)/(b.y-x.y)*(b.x-x.x),i)._round():b.y<i&&(b=new Le(x.x+(i-x.y)/(b.y-x.y)*(b.x-x.x),i)._round()),x.x>=n&&b.x>=n||(x.x>=n?x=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round():b.x>=n&&(b=new Le(n,x.y+(n-x.x)/(b.x-x.x)*(b.y-x.y))._round()),x.y>=s&&b.y>=s||(x.y>=s?x=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round():b.y>=s&&(b=new Le(x.x+(s-x.y)/(b.y-x.y)*(b.x-x.x),s)._round()),m&&x.equals(m[m.length-1])||(m=[x],c.push(m)),m.push(b)))))}}return c}Ue(Dn,"Anchor");const Gl=1e20;function Zp(t,e,i,n,s,c,u,p,m){for(let _=e;_<e+n;_++)qp(t,i*c+_,c,s,u,p,m);for(let _=i;_<i+s;_++)qp(t,_*c+e,1,n,u,p,m)}function qp(t,e,i,n,s,c,u){c[0]=0,u[0]=-Gl,u[1]=Gl,s[0]=t[e];for(let p=1,m=0,_=0;p<n;p++){s[p]=t[e+p*i];const x=p*p;do{const b=c[m];_=(s[p]-s[b]+x-b*b)/(p-b)/2}while(_<=u[m]&&--m>-1);m++,c[m]=p,u[m]=_,u[m+1]=Gl}for(let p=0,m=0;p<n;p++){for(;u[m+1]<p;)m++;const _=c[m],x=p-_;t[e+p*i]=s[_]+x*x}}const jr=2,Ou={none:0,ideographs:1,all:2};class pa{constructor(e,i,n){this.requestManager=e,this.localGlyphMode=i,this.localFontFamily=n,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,i){const n=[];for(const s in e)for(const c of e[s])n.push({stack:s,id:c});ai(n,({stack:s,id:c},u)=>{let p=this.entries[s];p||(p=this.entries[s]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let m=p.glyphs[c];if(m!==void 0)return void u(null,{stack:s,id:c,glyph:m});if(m=this._tinySDF(p,s,c),m)return p.glyphs[c]=m,void u(null,{stack:s,id:c,glyph:m});const _=Math.floor(c/256);if(256*_>65535)return void u(new Error("glyphs > 65535 not supported"));if(p.ranges[_])return void u(null,{stack:s,id:c,glyph:m});let x=p.requests[_];x||(x=p.requests[_]=[],pa.loadGlyphRange(s,_,this.url,this.requestManager,(b,w)=>{if(w){p.ascender=w.ascender,p.descender=w.descender;for(const S in w.glyphs)this._doesCharSupportLocalGlyph(+S)||(p.glyphs[+S]=w.glyphs[+S]);p.ranges[_]=!0}for(const S of x)S(b,w);delete p.requests[_]})),x.push((b,w)=>{b?u(b):w&&u(null,{stack:s,id:c,glyph:w.glyphs[c]||null})})},(s,c)=>{if(s)i(s);else if(c){const u={};for(const{stack:p,id:m,glyph:_}of c)u[p]===void 0&&(u[p]={}),u[p].glyphs===void 0&&(u[p].glyphs={}),u[p].glyphs[m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics},u[p].ascender=this.entries[p].ascender,u[p].descender=this.entries[p].descender;i(null,u)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Ou.none&&(this.localGlyphMode===Ou.all?!!this.localFontFamily:!!this.localFontFamily&&(Be["CJK Unified Ideographs"](e)||Be["Hangul Syllables"](e)||Be.Hiragana(e)||Be.Katakana(e)||Be["CJK Symbols and Punctuation"](e)))}_tinySDF(e,i,n){const s=this.localFontFamily;if(!s||!this._doesCharSupportLocalGlyph(n))return;let c=e.tinySDF;if(!c){let C="400";/bold/i.test(i)?C="900":/medium/i.test(i)?C="500":/light/i.test(i)&&(C="200"),c=e.tinySDF=new pa.TinySDF({fontFamily:s,fontWeight:C,fontSize:24*jr,buffer:3*jr,radius:8*jr}),c.fontWeight=C}if(this.localGlyphs[c.fontWeight][n])return this.localGlyphs[c.fontWeight][n];const u=String.fromCharCode(n),{data:p,width:m,height:_,glyphWidth:x,glyphHeight:b,glyphLeft:w,glyphTop:S,glyphAdvance:M}=c.draw(u);return this.localGlyphs[c.fontWeight][n]={id:n,bitmap:new Pn({width:m,height:_},p),metrics:{width:x/jr,height:b/jr,left:w/jr,top:S/jr-27,advance:M/jr,localGlyph:!0}}}}pa.loadGlyphRange=function(t,e,i,n,s){const c=256*e,u=c+255,p=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${c}-${u}`),pn.Glyphs);Gn(p,(m,_)=>{if(m)s(m);else if(_){const x={},b=function(w){return new uh(w).readFields(E_,{})}(_);for(const w of b.glyphs)x[w.id]=w;
vendor: 1,519 bytes, line 8
8s(null,{glyphs:x,ascender:b.ascender,descender:b.descender})}})},pa.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:s="sans-serif",fontWeight:c="normal",fontStyle:u="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const p=this.size=t+4*e,m=this._createCanvas(p),_=this.ctx=m.getContext("2d",{willReadFrequently:!0});_.font=`${u} ${c} ${t}px ${s}`,_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(p*p),this.gridInner=new Float64Array(p*p),this.f=new Float64Array(p),this.z=new Float64Array(p+1),this.v=new Uint16Array(p)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:s,actualBoundingBoxRight:c}=this.ctx.measureText(t),u=Math.ceil(i),p=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(c-s))),m=Math.min(this.size-this.buffer,u+Math.ceil(n)),_=p+2*this.buffer,x=m+2*this.buffer,b=Math.max(_*x,0),w=new Uint8ClampedArray(b),S={data:w,width:_,height:x,glyphWidth:p,glyphHeight:m,glyphTop:u,glyphLeft:0,glyphAdvance:e};if(p===0||m===0)return S;const{ctx:M,buffer:C,gridInner:D,gridOuter:U}=this;M.clearRect(C,C,p,m),M.fillText(t,C,C+u);const q=M.getImageData(C,C,p,m);U.fill(Gl,0,b),D.fill(0,0,b);for(let V=0;V<m;V++)for(let $=0;$<p;$++){const X=q.data[4*(V*p+$)+3]/255;if(X===0)continue;const W=(V+C)*_+$+C;if(X===1)U[W]=0,D[W]=Gl;else{const ce=.5-X;U[W]=ce>0?ce*ce:0,D[W]=ce<0?ce*ce:0}}
vendor: 6,593 bytes, line 8
8Zp(U,0,0,_,x,_,this.f,this.v,this.z),Zp(D,C,C,p,m,_,this.f,this.v,this.z);for(let V=0;V<b;V++){const $=Math.sqrt(U[V])-Math.sqrt(D[V]);w[V]=Math.round(255-255*($/this.radius+this.cutoff))}return S}};const fa=Fi;function Wp(t,e,i,n){const s=[],c=t.image,u=c.pixelRatio,p=c.paddedRect.w-2*fa,m=c.paddedRect.h-2*fa,_=t.right-t.left,x=t.bottom-t.top,b=c.stretchX||[[0,p]],w=c.stretchY||[[0,m]],S=(ue,ye)=>ue+ye[1]-ye[0],M=b.reduce(S,0),C=w.reduce(S,0),D=p-M,U=m-C;let q=0,V=M,$=0,X=C,W=0,ce=D,se=0,me=U;if(c.content&&n){const ue=c.content;q=ph(b,0,ue[0]),$=ph(w,0,ue[1]),V=ph(b,ue[0],ue[2]),X=ph(w,ue[1],ue[3]),W=ue[0]-q,se=ue[1]-$,ce=ue[2]-ue[0]-V,me=ue[3]-ue[1]-X}const Ee=(ue,ye,xe,be)=>{const Ce=fh(ue.stretch-q,V,_,t.left),pe=mh(ue.fixed-W,ce,ue.stretch,M),De=fh(ye.stretch-$,X,x,t.top),Ne=mh(ye.fixed-se,me,ye.stretch,C),Re=fh(xe.stretch-q,V,_,t.left),He=mh(xe.fixed-W,ce,xe.stretch,M),ze=fh(be.stretch-$,X,x,t.top),$e=mh(be.fixed-se,me,be.stretch,C),Ke=new Le(Ce,De),gt=new Le(Re,De),Ye=new Le(Re,ze),We=new Le(Ce,ze),Rt=new Le(pe/u,Ne/u),et=new Le(He/u,$e/u),tt=e*Math.PI/180;if(tt){const Dt=Math.sin(tt),Ct=Math.cos(tt),Nt=[Ct,-Dt,Dt,Ct];Ke._matMult(Nt),gt._matMult(Nt),We._matMult(Nt),Ye._matMult(Nt)}const It=ue.stretch+ue.fixed,kt=ye.stretch+ye.fixed;return{tl:Ke,tr:gt,bl:We,br:Ye,tex:{x:c.paddedRect.x+fa+It,y:c.paddedRect.y+fa+kt,w:xe.stretch+xe.fixed-It,h:be.stretch+be.fixed-kt},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Rt,pixelOffsetBR:et,minFontScaleX:ce/u/_,minFontScaleY:me/u/x,isSDF:i}};if(n&&(c.stretchX||c.stretchY)){const ue=Xp(b,D,M),ye=Xp(w,U,C);for(let xe=0;xe<ue.length-1;xe++){const be=ue[xe],Ce=ue[xe+1];for(let pe=0;pe<ye.length-1;pe++)s.push(Ee(be,ye[pe],Ce,ye[pe+1]))}}else s.push(Ee({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:p+1},{fixed:0,stretch:m+1}));return s}function ph(t,e,i){let n=0;for(const s of t)n+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]));return n}function Xp(t,e,i){const n=[{fixed:-fa,stretch:0}];for(const[s,c]of t){const u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(c-s)})}return n.push({fixed:e+fa,stretch:i}),n}function fh(t,e,i,n){return t/e*i+n}function mh(t,e,i,n){return t-e*i/n}function k_(t,e,i,n){const s=e+t.positionedLines[n].lineOffset;return n===0?i+s/2:i+(s+(e+t.positionedLines[n-1].lineOffset))/2}class D_{constructor(e=[],i=L_){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:n}=this,s=i[e];for(;e>0;){const c=e-1>>1,u=i[c];if(n(s,u)>=0)break;i[e]=u,e=c}i[e]=s}_down(e){const{data:i,compare:n}=this,s=this.length>>1,c=i[e];for(;e<s;){let u=1+(e<<1),p=i[u];const m=u+1;if(m<this.length&&n(i[m],p)<0&&(u=m,p=i[m]),n(p,c)>=0)break;i[e]=p,e=u}i[e]=c}}function L_(t,e){return t<e?-1:t>e?1:0}function R_(t,e=1,i=!1){let n=1/0,s=1/0,c=-1/0,u=-1/0;const p=t[0];for(let S=0;S<p.length;S++){const M=p[S];(!S||M.x<n)&&(n=M.x),(!S||M.y<s)&&(s=M.y),(!S||M.x>c)&&(c=M.x),(!S||M.y>u)&&(u=M.y)}const m=Math.min(c-n,u-s);let _=m/2;const x=new D_([],B_);if(m===0)return new Le(n,s);for(let S=n;S<c;S+=m)for(let M=s;M<u;M+=m)x.push(new ma(S+_,M+_,_,t));let b=function(S){let M=0,C=0,D=0;const U=S[0];for(let q=0,V=U.length,$=V-1;q<V;$=q++){const X=U[q],W=U[$],ce=X.x*W.y-W.x*X.y;C+=(X.x+W.x)*ce,D+=(X.y+W.y)*ce,M+=3*ce}return new ma(C/M,D/M,0,S)}(t),w=x.length;for(;x.length;){const S=x.pop();(S.d>b.d||!b.d)&&(b=S,i&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-b.d<=e||(_=S.h/2,x.push(new ma(S.p.x-_,S.p.y-_,_,t)),x.push(new ma(S.p.x+_,S.p.y-_,_,t)),x.push(new ma(S.p.x-_,S.p.y+_,_,t)),x.push(new ma(S.p.x+_,S.p.y+_,_,t)),w+=4)}return i&&(console.log(`num probes: ${w}`),console.log(`best distance: ${b.d}`)),b.p}function B_(t,e){return e.max-t.max}class ma{constructor(e,i,n,s){this.p=new Le(e,i),this.h=n,this.d=function(c,u){let p=!1,m=1/0;for(let _=0;_<u.length;_++){const x=u[_];for(let b=0,w=x.length,S=w-1;b<w;S=b++){const M=x[b],C=x[S];M.y>c.y!=C.y>c.y&&c.x<(C.x-M.x)*(c.y-M.y)/(C.y-M.y)+M.x&&(p=!p),m=Math.min(m,Gd(c,M,C))}}return(p?1:-1)*Math.sqrt(m)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}}const _a=7,Fu=Number.POSITIVE_INFINITY,O_=Math.sqrt(2);function Hp(t,[e,i]){let n=0,s=0;if(i===Fu){e<0&&(e=0);const c=e/O_;switch(t){case"top-right":case"top-left":s=c-_a;break;case"bottom-right":case"bottom-left":s=-c+_a;break;case"bottom":s=-e+_a;break;case"top":s=e-_a}switch(t){case"top-right":case"bottom-right":n=-c;break;case"top-left":case"bottom-left":n=c;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":s=i-_a;break;case"bottom-right":case"bottom-left":case"bottom":s=-i+_a}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,s]}function F_(t,e,i,n,s,c,u,p,m,_){t.createArrays(),t.tilePixelRatio=Ze/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const x=t.layers[0].layout,b=t.layers[0]._unevaluatedLayout._values,w={};if(t.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.textSizeData;w.compositeTextSizes=[b["text-size"].possiblyEvaluate(new v(C),p),b["text-size"].possiblyEvaluate(new v(D),p)]}if(t.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:D}=t.iconSizeData;w.compositeIconSizes=[b["icon-size"].possiblyEvaluate(new v(C),p),b["icon-size"].possiblyEvaluate(new v(D),p)]}w.layoutTextSize=b["text-size"].possiblyEvaluate(new v(m+1),p),w.layoutIconSize=b["icon-size"].possiblyEvaluate(new v(m+1),p),w.textMaxSize=b["text-size"].possiblyEvaluate(new v(18),p);const S=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point",M=x.get("text-size");for(const C of t.features){const D=x.get("text-font").evaluate(C,{},p).join(","),U=M.evaluate(C,{},p),q=w.layoutTextSize.evaluate(C,{},p),V=(w.layoutIconSize.evaluate(C,{},p),{horizontal:{},vertical:void 0}),$=C.text;let X,W=[0,0];if($){const me=$.toString(),Ee=x.get("text-letter-spacing").evaluate(C,{},p)*mi,ue=x.get("text-line-height").evaluate(C,{},p)*mi,ye=Wh(me)?Ee:0,xe=x.get("text-anchor").evaluate(C,{},p),be=x.get("text-variable-anchor");if(!be){const Re=x.get("text-radial-offset").evaluate(C,{},p);W=Re?Hp(xe,[Re*mi,Fu]):x.get("text-offset").evaluate(C,{},p).map(He=>
8He*mi)}let Ce=S?"center":x.get("text-justify").evaluate(C,{},p);const pe=x.get("symbol-placement")==="point",De=pe?x.get("text-max-width").evaluate(C,{},p)*mi:1/0,Ne=Re=>{t.allowVerticalPlacement&&fl(me)&&(V.vertical=Ru($,e,i,s,D,De,ue,xe,Re,ye,W,sr.vertical,!0,q,U))};if(!S&&be){const Re=Ce==="auto"?be.map(ze=>Uu(ze)):[Ce];let He=!1;for(let ze=0;ze<Re.length;ze++){const $e=Re[ze];if(!V.horizontal[$e])if(He)V.horizontal[$e]=V.horizontal[0];else{const Ke=Ru($,e,i,s,D,De,ue,"center",$e,ye,W,sr.horizontal,!1,q,U);Ke&&(V.horizontal[$e]=Ke,He=Ke.positionedLines.length===1)}}Ne("left")}else{if(Ce==="auto"&&(Ce=Uu(xe)),pe||x.get("text-writing-mode").indexOf("horizontal")>=0||!fl(me)){const Re=Ru($,e,i,s,D,De,ue,xe,Ce,ye,W,sr.horizontal,!1,q,U);Re&&(V.horizontal[Ce]=Re)}Ne(pe?"left":Ce)}}let ce=!1;if(C.icon&&C.icon.name){const me=n[C.icon.name];me&&(X=C_(s[C.icon.name],x.get("icon-offset").evaluate(C,{},p),x.get("icon-anchor").evaluate(C,{},p)),ce=me.sdf,t.sdfIcons===void 0?t.sdfIcons=me.sdf:t.sdfIcons!==me.sdf&&Ut("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(me.pixelRatio!==t.pixelRatio||x.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}const se=Yp(V.horizontal)||V.vertical;t.iconsInText||(t.iconsInText=!!se&&se.iconsInText),(se||X)&&U_(t,C,V,X,n,w,q,0,W,ce,u,p,_)}c&&t.generateCollisionDebugBuffers(m,t.collisionBoxArray)}function Uu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function U_(t,e,i,n,s,c,u,p,m,_,x,b,w){let S=c.textMaxSize.evaluate(e,{},b);S===void 0&&(S=u);const M=t.layers[0].layout,C=M.get("icon-offset").evaluate(e,{},b),D=Yp(i.horizontal)||i.vertical,U=w.name==="globe",q=mi,V=u/q,$=t.tilePixelRatio*S/q,X=(xe=t.overscaling,t.zoom>18&&xe>2&&(xe>>=1),Math.max(Ze/(512*xe),1)*M.get("symbol-spacing")),W=M.get("text-padding")*t.tilePixelRatio,ce=M.get("icon-padding")*t.tilePixelRatio,se=dt(M.get("text-max-angle")),me=M.get("text-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",Ee=M.get("icon-rotation-alignment")==="map"&&M.get("symbol-placement")!=="point",ue=M.get("symbol-placement"),ye=X/2;var xe;const be=M.get("icon-text-fit");let Ce;n&&be!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(Ce=Fp(n,i.vertical,be,M.get("icon-text-fit-padding"),C,V)),D&&(n=Fp(n,D,be,M.get("icon-text-fit-padding"),C,V)));const pe=(De,Ne,Re)=>
8{if(Ne.x<0||Ne.x>=Ze||Ne.y<0||Ne.y>=Ze)return;let He=null;if(U){const{x:ze,y:$e,z:Ke}=w.projectTilePoint(Ne.x,Ne.y,Re);He={anchor:new Dn(ze,$e,Ke,0,void 0),up:w.upVector(Re,Ne.x,Ne.y)}}(function(ze,$e,Ke,gt,Ye,We,Rt,et,tt,It,kt,Dt,Ct,Nt,$t,Qt,zt,ni,ei,jt,xt,ti,Lt,ki,ii){const _i=ze.addToLineVertexArray($e,gt);let di,Di,pi,$r,xa,Jl,Ql,Pf=0,kf=0,Df=0,Lf=0,ed=-1,td=-1;const ln={};let Rf=Kh("");const ps=Ke?Ke.anchor:$e;let id=0,rd=0;if(tt._unevaluatedLayout.getValue("text-radial-offset")===void 0?[id,rd]=tt.layout.get("text-offset").evaluate(xt,{},ii).map(Hi=>Hi*mi):(id=tt.layout.get("text-radial-offset").evaluate(xt,{},ii)*mi,rd=Fu),ze.allowVerticalPlacement&&Ye.vertical){const Hi=Ye.vertical;if($t)Jl=Vu(Hi),et&&(Ql=Vu(et));else{const Ki=tt.layout.get("text-rotate").evaluate(xt,{},ii)+90;pi=_h(It,ps,$e,kt,Dt,Ct,Hi,Nt,Ki,Qt),et&&($r=_h(It,ps,$e,kt,Dt,Ct,et,ni,Ki))}}if(We){const Hi=tt.layout.get("icon-rotate").evaluate(xt,{},ii),Ki=tt.layout.get("icon-text-fit")!=="none",ec=Wp(We,Hi,Lt,Ki),od=et?Wp(et,Hi,Lt,Ki):void 0;Di=_h(It,ps,$e,kt,Dt,Ct,We,ni,Hi),Pf=4*ec.length;const Bf=ze.iconSizeData;let fs=null;Bf.kind==="source"?(fs=[Nr*tt.layout.get("icon-size").evaluate(xt,{},ii)],fs[0]>fo&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)):Bf.kind==="composite"&&(fs=[Nr*ti.compositeIconSizes[0].evaluate(xt,{},ii),Nr*ti.compositeIconSizes[1].evaluate(xt,{},ii)],(fs[0]>fo||fs[1]>fo)&&Ut(`${ze.layerIds[0]}: Value for "icon-size" is >= ${$l}. Reduce your "icon-size".`)),ze.addSymbols(ze.icon,ec,fs,jt,ei,xt,!1,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),ed=ze.icon.placedSymbolArray.length-1,od&&(kf=4*od.length,ze.addSymbols(ze.icon,od,fs,jt,ei,xt,sr.vertical,Ke,$e,_i.lineStartIndex,_i.lineLength,-1,ki,ii),td=ze.icon.placedSymbolArray.length-1)}for(const Hi in Ye.horizontal){const Ki=Ye.horizontal[Hi];di||(Rf=Kh(Ki.text),$t?xa=Vu(Ki):di=_h(It,ps,$e,kt,Dt,Ct,Ki,Nt,tt.layout.get("text-rotate").evaluate(xt,{},ii),Qt));const ec=Ki.positionedLines.length===1;if(Df+=Kp(ze,Ke,$e,Ki,Rt,tt,$t,xt,Qt,_i,Ye.vertical?sr.horizontal:sr.horizontalOnly,ec?Object.keys(Ye.horizontal):[Hi],ln,ed,ti,ki,ii),ec)break}Ye.vertical&&(Lf+=Kp(ze,Ke,$e,Ye.vertical,Rt,tt,$t,xt,Qt,_i,sr.vertical,["vertical"],ln,td,ti,ki,ii));let vo=-1;const nd=(Hi,Ki)=>Hi?Math.max(Hi,Ki):Ki;vo=nd(xa,vo),vo=nd(Jl,vo),vo=nd(Ql,vo);const pg=vo>-1?1:0;ze.glyphOffsetArray.length>=_o.MAX_GLYPHS&&Ut("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),xt.sortKey!==void 0&&ze.addToSortKeyRanges(ze.symbolInstances.length,xt.sortKey),ze.symbolInstances.emplaceBack(ps.x,ps.y,ps.z,$e.x,$e.y,ln.right>=0?ln.right:-1,ln.center>=0?ln.center:-1,ln.left>=0?ln.left:-1,ln.vertical>=0?ln.vertical:-1,ed,td,Rf,di!==void 0?di:ze.collisionBoxArray.length,di!==void 0?di+1:ze.collisionBoxArray.length,pi!==void 0?pi:ze.collisionBoxArray.length,pi!==void 0?pi+1:ze.collisionBoxArray.length,Di!==void 0?Di:ze.collisionBoxArray.length,Di!==void 0?Di+1:ze.collisionBoxArray.length,$r||ze.collisionBoxArray.length,$r?$r+1:ze.collisionBoxArray.length,kt,Df,Lf,Pf,kf,pg,0,id,rd,vo)})(t,Ne,He,De,i,n,s,Ce,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,W,me,m,0,ce,Ee,C,e,c,_,x,b)};if(ue==="line")for(const De of $p(e.geometry,0,0,Ze,Ze)){const Ne=P_(De,X,se,i.vertical||D,n,q,$,t.overscaling,Ze);for(const Re of Ne)D&&V_(t,D.text,ye,Re)||pe(De,Re,b)}else if(ue==="line-center"){for(const De of e.geometry)if(De.length>1){const Ne=z_(De,se,i.vertical||D,n,q,$);Ne&&pe(De,Ne,b)}}else if(e.type==="Polygon")for(const De of Mu(e.geometry,0)){const Ne=R_(De,16);pe(De[0],new Dn(Ne.x,Ne.y,0,0,void 0),b)}else if(e.type==="LineString")for(const De of e.geometry)pe(De,new Dn(De[0].x,De[0].y,0,0,void 0),b);else if(e.type==="Point")for(const De of e.geometry)for(const Ne of De)pe([Ne],new Dn(Ne.x,Ne.y,0,0,void 0),b)}const $l=255,fo=$l*Nr;function Kp(t,e,i,n,s,c,u,p,m,_,x,b,w,S,M,C,D){const U=function($,X,W,ce,se,me,Ee,ue){const ye=[];if(X.positionedLines.length===0)return ye;const xe=ce.layout.get("text-rotate").evaluate(me,{})*Math.PI/180,be=function(Re){const He=Re[0],ze=Re[1],$e=He*ze;return $e>0?[He,-ze]:$e<0?[-He,ze]:He===0?[ze,He]:[ze,-He]}(W);let Ce=Math.abs(X.top-X.bottom);for(const Re of X.positionedLines)Ce-=Re.lineOffset;const pe=X.positionedLines.length,De=Ce/pe;let Ne=X.top-W[1];for(let Re=0;Re<pe;++Re){const He=X.positionedLines[Re];Ne=k_(X,De,Ne,Re);for(const ze of He.positionedGlyphs){if(!ze.rect)continue;const $e=ze.rect||{};let Ke=zp+1,gt=!0,Ye=1,We=0;
vendor: 6,138 bytes, line 8
8if(ze.imageName){const Lt=Ee[ze.imageName];if(!Lt)continue;if(Lt.sdf){Ut("SDF images are not supported in formatted text and will be ignored.");continue}gt=!1,Ye=Lt.pixelRatio,Ke=Fi/Ye}const Rt=(se||ue)&&ze.vertical,et=ze.metrics.advance*ze.scale/2,tt=ze.metrics,It=ze.rect;if(It===null)continue;ue&&X.verticalizable&&(We=ze.imageName?et-ze.metrics.width*ze.scale/2:0);const kt=se?[ze.x+et,ze.y]:[0,0];let Dt=[0,0],Ct=[0,0],Nt=!1;se||(Rt?(Ct=[ze.x+et+be[0],ze.y+be[1]-We],Nt=!0):Dt=[ze.x+et+W[0],ze.y+W[1]-We]);const $t=It.w*ze.scale/(Ye*(ze.localGlyph?jr:1)),Qt=It.h*ze.scale/(Ye*(ze.localGlyph?jr:1));let zt,ni,ei,jt;if(Rt){const Lt=ze.y-Ne,ki=new Le(-et,et-Lt),ii=-Math.PI/2,_i=new Le(...Ct);zt=new Le(-et+Dt[0],Dt[1]),zt._rotateAround(ii,ki)._add(_i),zt.x+=-Lt+et,zt.y-=(tt.left-Ke)*ze.scale;const di=ze.imageName?tt.advance*ze.scale:mi*ze.scale,Di=String.fromCharCode(ze.glyph);p_(Di)?zt.x+=(1-Ke)*ze.scale:f_(Di)?zt.x+=di-tt.height*ze.scale+(-Ke-1)*ze.scale:zt.x+=ze.imageName||tt.width+2*Ke===It.w&&tt.height+2*Ke===It.h?(di-Qt)/2:(di-(tt.height+2*Ke)*ze.scale)/2,ni=new Le(zt.x,zt.y-$t),ei=new Le(zt.x+Qt,zt.y),jt=new Le(zt.x+Qt,zt.y-$t)}else{const Lt=(tt.left-Ke)*ze.scale-et+Dt[0],ki=(-tt.top-Ke)*ze.scale+Dt[1],ii=Lt+$t,_i=ki+Qt;zt=new Le(Lt,ki),ni=new Le(ii,ki),ei=new Le(Lt,_i),jt=new Le(ii,_i)}if(xe){let Lt;Lt=se?new Le(0,0):Nt?new Le(be[0],be[1]):new Le(W[0],W[1]),zt._rotateAround(xe,Lt),ni._rotateAround(xe,Lt),ei._rotateAround(xe,Lt),jt._rotateAround(xe,Lt)}const xt=new Le(0,0),ti=new Le(0,0);ye.push({tl:zt,tr:ni,bl:ei,br:jt,tex:$e,writingMode:X.writingMode,glyphOffset:kt,sectionIndex:ze.sectionIndex,isSDF:gt,pixelOffsetTL:xt,pixelOffsetBR:ti,minFontScaleX:0,minFontScaleY:0})}}return ye}(0,n,m,c,u,p,s,t.allowVerticalPlacement),q=t.textSizeData;let V=null;q.kind==="source"?(V=[Nr*c.layout.get("text-size").evaluate(p,{},D)],V[0]>fo&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)):q.kind==="composite"&&(V=[Nr*M.compositeTextSizes[0].evaluate(p,{},D),Nr*M.compositeTextSizes[1].evaluate(p,{},D)],(V[0]>fo||V[1]>fo)&&Ut(`${t.layerIds[0]}: Value for "text-size" is >= ${$l}. Reduce your "text-size".`)),t.addSymbols(t.text,U,V,m,u,p,x,e,i,_.lineStartIndex,_.lineLength,S,C,D);for(const $ of b)w[$]=t.text.placedSymbolArray.length-1;return 4*U.length}function Yp(t){for(const e in t)return t[e];return null}function _h(t,e,i,n,s,c,u,p,m,_){let x=u.top,b=u.bottom,w=u.left,S=u.right;const M=u.collisionPadding;if(M&&(w-=M[0],x-=M[1],S+=M[2],b+=M[3]),m){const C=new Le(w,x),D=new Le(S,x),U=new Le(w,b),q=new Le(S,b),V=dt(m);let $=new Le(0,0);_&&($=new Le(_[0],_[1])),C._rotateAround(V,$),D._rotateAround(V,$),U._rotateAround(V,$),q._rotateAround(V,$),w=Math.min(C.x,D.x,U.x,q.x),S=Math.max(C.x,D.x,U.x,q.x),x=Math.min(C.y,D.y,U.y,q.y),b=Math.max(C.y,D.y,U.y,q.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,w,x,S,b,p,n,s,c),t.length-1}function Vu(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function V_(t,e,i,n){const s=t.compareText;if(e in s){const c=s[e];for(let u=c.length-1;u>=0;u--)if(n.dist(c[u])<i)return!0}else s[e]=[];return s[e].push(n),!1}function Jp(t,e){const i=t.fovAboveCenter,n=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,s=(t._camera.position[2]*t.worldSize-n)/Math.cos(t._pitch),c=Math.sin(i)*s/Math.sin(Math.max(Math.PI/2-t._pitch-i,.01)),u=Math.sin(t._pitch)*c+s;return Math.min(1.01*u,s*(1/t._horizonShift))}function us(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const i=Math.pow(2,-t.z),n=t.x*i,s=(t.x+1)*i,c=t.y*i,u=(t.y+1)*i,p=or(n),m=or(s),_=bi(c),x=bi(u),b=e.project(p,_),w=e.project(m,_),S=e.project(m,x),M=e.project(p,x);let C=Math.min(b.x,w.x,S.x,M.x),D=Math.min(b.y,w.y,S.y,M.y),U=Math.max(b.x,w.x,S.x,M.x),q=Math.max(b.y,w.y,S.y,M.y);const V=i/16;function $(W,ce,se,me,Ee,ue){const ye=(se+Ee)/2,xe=(me+ue)/2,be=e.project(or(ye),bi(xe)),Ce=Math.max(0,C-be.x,D-be.y,be.x-U,be.y-q);C=Math.min(C,be.x),U=Math.max(U,be.x),D=Math.min(D,be.y),q=Math.max(q,be.y),Ce>V&&($(W,be,se,me,ye,xe),$(be,ce,ye,xe,Ee,ue))}$(b,w,n,c,s,c),$(w,S,s,c,s,u),$(S,M,s,u,n,u),$(M,b,n,u,n,c),C-=V,D-=V,U+=V,q+=V;const X=1/Math.max(U-C,q-D);return{scale:X,x:C*X,y:D*X,x2:U*X,y2:q*X,projection:e}}const N_=Fr(new Float32Array(16));class mo{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,i){return{x:0,y:0,z:0}}unproject(e,i){return new At(0,0)}projectTilePoint(e,i,n){return{x:e,y:i,z:0}}locationPoint(e,i,n=!0){return e._coordinatePoint(e.locationCoordinate(i),n)}pixelsPerMeter(e,i){return Vr(1,e)*i}pixelSpaceConversion(e,i,n){return 1}farthestPixelDistance(e){return Jp(e,e.pixelsPerMeter)}pointCoordinate(e,i,n,s){const c=e.horizonLineFromTop(!1),u=new Le(i,Math.max(c,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(u,s))}pointCoordinate3D(e,i,n){const s=new Le(i,n);if(e.elevation)return e.elevation.pointCoordinate(s);{const c=this.pointCoordinate(e,s.x,s.y,0);return[c.x,c.y,c.z]}}isPointAboveHorizon(e,i){if(e.elevation)return!this.pointCoordinate3D(e,i.x,i.y);const n=e.horizonLineFromTop();return i.y<n}createInversionMatrix(e,i){return N_}createTileMatrix(e,i,n){let s,c,u;const p=n.canonical,m=Fr(new Float64Array(16));if(this.isReprojectedInTileSpace){const _=us(p,this);s=1,c=_.x+n.wrap*_.scale,u=_.y,ns(m,m,[s/_.scale,s/_.scale,e.pixelsPerMeter/i])}else s=i/e.zoomScale(p.z),c=(p.x+Math.pow(2,p.z)*n.wrap)*s,u=p.y*s;return bl(m,m,[c,u,0]),ns(m,m,[s/Ze,s/Ze,1]),m}upVector(e,i,n){return[0,0,1]}upVectorScale(e,i,n){return{metersToTile:1}}}class j_ extends mo{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[i,n]=this.parallels=e.parallels||[29.5,45.5],s=Math.sin(dt(i));this.n=(s+Math.sin(dt(n)))/2,this.c=1+s*(2*this.n-s),this.r0=Math.sqrt(this.c)/this.n}project(e,i){const{n,c:s,r0:c}
vendor: 6,869 bytes, line 8
8=this,u=dt(e-this.center[0]),p=dt(i),m=Math.sqrt(s-2*n*Math.sin(p))/n;return{x:m*Math.sin(u*n),y:m*Math.cos(u*n)-c,z:0}}unproject(e,i){const{n,c:s,r0:c}=this,u=c+i;let p=Math.atan2(e,Math.abs(u))*Math.sign(u);u*n<0&&(p-=Math.PI*Math.sign(e)*Math.sign(u));const m=dt(this.center[0])*n;p=oi(p,-Math.PI-m,Math.PI-m);const _=ct(si(p/n)+this.center[0],-180,180),x=Math.asin(ct((s-(e*e+u*u)*n*n)/(2*n),-1,1)),b=ct(si(x),-wi,wi);return new At(_,b)}}const Zl=1.340264,ql=-.081106,Wl=893e-6,Xl=.003796,gh=Math.sqrt(3)/2;class G_ extends mo{project(e,i){i=i/180*Math.PI,e=e/180*Math.PI;const n=Math.asin(gh*Math.sin(i)),s=n*n,c=s*s*s;return{x:.5*(e*Math.cos(n)/(gh*(Zl+3*ql*s+c*(7*Wl+9*Xl*s)))/Math.PI+.5),y:1-.5*(n*(Zl+ql*s+c*(Wl+Xl*s))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let n=i=(2*(1-i)-1)*Math.PI,s=n*n,c=s*s*s;for(let x,b,w,S=0;S<12&&(b=n*(Zl+ql*s+c*(Wl+Xl*s))-i,w=Zl+3*ql*s+c*(7*Wl+9*Xl*s),x=b/w,n=ct(n-x,-Math.PI/3,Math.PI/3),s=n*n,c=s*s*s,!(Math.abs(x)<1e-12));++S);const u=gh*e*(Zl+3*ql*s+c*(7*Wl+9*Xl*s))/Math.cos(n),p=Math.asin(Math.sin(n)/gh),m=ct(180*u/Math.PI,-180,180),_=ct(180*p/Math.PI,-wi,wi);return new At(m,_)}}class $_ extends mo{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){return{x:.5+e/360,y:.5-i/360,z:0}}unproject(e,i){const n=360*(e-.5),s=ct(360*(.5-i),-wi,wi);return new At(n,s)}}const ga=Math.PI/2;function yh(t){return Math.tan((ga+t)/2)}class Z_ extends mo{constructor(e){super(e),this.center=e.center||[0,30];const[i,n]=this.parallels=e.parallels||[30,30];let s=dt(i),c=dt(n);this.southernCenter=s+c<0,this.southernCenter&&(s=-s,c=-c);const u=Math.cos(s),p=yh(s);this.n=s===c?Math.sin(s):Math.log(u/Math.cos(c))/Math.log(yh(c)/p),this.f=u*Math.pow(yh(s),this.n)/this.n}project(e,i){i=dt(i),this.southernCenter&&(i=-i),e=dt(e-this.center[0]);const n=1e-6,{n:s,f:c}=this;c>0?i<-ga+n&&(i=-ga+n):i>ga-n&&(i=ga-n);const u=c/Math.pow(yh(i),s);let p=u*Math.sin(s*e),m=c-u*Math.cos(s*e);return p=.5*(p/Math.PI+.5),m=.5*(m/Math.PI+.5),{x:p,y:this.southernCenter?m:1-m,z:0}}unproject(e,i){e=(2*e-.5)*Math.PI,this.southernCenter&&(i=1-i),i=(2*(1-i)-.5)*Math.PI;const{n,f:s}=this,c=s-i,u=Math.sign(c),p=Math.sign(n)*Math.sqrt(e*e+c*c);let m=Math.atan2(e,Math.abs(c))*u;c*n<0&&(m-=Math.PI*Math.sign(e)*u);const _=ct(si(m/n)+this.center[0],-180,180),x=ct(si(2*Math.atan(Math.pow(s/p,1/n))-ga),-wi,wi);return new At(_,this.southernCenter?-x:x)}}class Qp extends mo{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,i){return{x:rn(e),y:nn(i),z:0}}unproject(e,i){const n=or(e),s=bi(i);return new At(n,s)}}const ef=dt(wi);class q_ extends mo{project(e,i){const n=(i=dt(i))*i,s=n*n;return{x:.5*((e=dt(e))*(.8707-.131979*n+s*(s*(.003971*n-.001529*s)-.013791))/Math.PI+.5),y:1-.5*(i*(1.007226+n*(.015085+s*(.028874*n-.044475-.005916*s)))/Math.PI+1),z:0}}unproject(e,i){e=(2*e-.5)*Math.PI;let n=i=(2*(1-i)-1)*Math.PI,s=25,c=0,u=n*n;do{u=n*n;const _=u*u;c=(n*(1.007226+u*(.015085+_*(.028874*u-.044475-.005916*_)))-i)/(1.007226+u*(.045255+_*(.259866*u-.311325-.005916*11*_))),n=ct(n-c,-ef,ef)}while(Math.abs(c)>1e-6&&--s>0);u=n*n;const p=ct(si(e/(.8707+u*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979))),-180,180),m=si(n);return new At(p,m)}}const tf=dt(wi);class W_ extends mo{project(e,i){i=dt(i),e=dt(e);const n=Math.cos(i),s=2/Math.PI,c=Math.acos(n*Math.cos(e/2)),u=Math.sin(c)/c,p=.5*(e*s+2*n*Math.sin(e/2)/u)||0,m=.5*(i+Math.sin(i)/u)||0;return{x:.5*(p/Math.PI+.5),y:1-.5*(m/Math.PI+1),z:0}}unproject(e,i){let n=e=(2*e-.5)*Math.PI,s=i=(2*(1-i)-1)*Math.PI,c=25;const u=1e-6;let p=0,m=0;do{const _=Math.cos(s),x=Math.sin(s),b=2*x*_,w=x*x,S=_*_,M=Math.cos(n/2),C=Math.sin(n/2),D=2*M*C,U=C*C,q=1-S*M*M,V=q?1/q:0,$=q?Math.acos(_*M)*Math.sqrt(1/q):0,X=.5*(2*$*_*C+2*n/Math.PI)-e,W=.5*($*x+s)-i,ce=.5*V*(S*U+$*_*M*w)+1/Math.PI,se=V*(D*b/4-$*x*C),me=.125*V*(b*C-$*x*S*D),Ee=.5*V*(w*M+$*U*_)+.5,ue=se*me-Ee*ce;p=(W*se-X*Ee)/ue,m=(X*me-W*ce)/ue,n=ct(n-p,-Math.PI,Math.PI),s=ct(s-m,-tf,tf)}while((Math.abs(p)>u||Math.abs(m)>u)&&--c>0);return new At(si(n),si(s))}}class rf extends mo{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(dt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,i){const{scale:n,cosPhi:s}=this;return{x:dt(e)*s*n+.5,y:-Math.sin(dt(i))/s*n+.5,z:0}}unproject(e,i){const{scale:n,cosPhi:s}=this,c=-(i-.5)/n,u=ct(si((e-.5)/n)/s,-180,180),p=Math.asin(ct(c*s,-1,1)),m=ct(si(p),-wi,wi);return new At(u,m)}}class X_ extends Qp{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,i,n){const s=Cl(e,i,n);return qt(s,s,zl(tn(n))),{x:s[0],y:s[1],z:s[2]}}locationPoint(e,i){const n=ia(i.lat,i.lng),s=Ci([],n),c=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(i),e._centerAltitude):e._centerAltitude;Sl(n,n,s,Vr(1,0)*Ze*c);const u=Fr(new Float64Array(16));return rs(u,e.pixelMatrix,e.globeMatrix),qt(n,n,u),new Le(n[0],n[1])}pixelsPerMeter(e,i){return Vr(1,0)*i}pixelSpaceConversion(e,i,n){const s=Vr(1,e)*i,c=mt(Vr(1,45)*i,s,n);return this.pixelsPerMeter(e,i)/c}createTileMatrix(e,i,n){const s=hu(tn(n.canonical));return rs(new Float64Array(16),e.globeMatrix,s)}createInversionMatrix(e,i){const{center:n}=e,s=zl(tn(i));return qc(s,s,dt(n.lng)),eu(s,s,dt(n.lat)),ns(s,s,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(s)}pointCoordinate(e,i,n,s){return Cd(e,i,n,!0)||new na(0,0)}pointCoordinate3D(e,i,n){const s=this.pointCoordinate(e,i,n,0);return[s.x,s.y,s.z]}isPointAboveHorizon(e,i){return!Cd(e,i.x,i.y,!1)}farthestPixelDistance(e){const i=function(s,c){const u=s.cameraToCenterDistance,p=s._centerAltitude*c,m=s._camera,_=s._camera.forward(),x=Cn([],nr([],_,-u),[0,0,p]),b=s.worldSize/(2*Math.PI),w=[0,0,-b],S=s.width/s.height,M=Math.tan(s.fovAboveCenter),C=nr([],m.up(),M),D=nr([],m.right(),M*S),U=Ci([],Cn([],Cn([],_,C),D)),q=[];let V;if(new nu(x,U).closestPointOnSphere(w,b,q)){const $=Cn([],q,w),X=Ur([],$,x);V=Math.cos(s.fovAboveCenter)*wl(X)}else{const $=Ur([],x,w),X=Ur([],w,x);Ci(X,X);const W=wl($)-b;V=Math.sqrt(W*(W+2*b));const ce=Math.acos(V/(b+W))-Math.acos(fr(_,X));V*=Math.cos(ce)}return 1.01*V}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=ra(e.zoom);if(n>0){const s=Jp(e,Vr(1,e.center.lat)*e.worldSize),c=e.worldSize/(2*Math.PI),u=Math.max(e.width,e.height)/e.worldSize*Math.PI;return mt(i,s+c*(1-Math.cos(u)),Math.pow(n,10))}return i}upVector(e,i,n){return Cl(i,n,e,1)}upVectorScale(e){return{metersToTile:Wc(Hc(tn(e)))}}}function nf(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;
vendor: 2,923 bytes, line 8
8switch(t.name){case"mercator":return new Qp(t);case"equirectangular":return new $_(t);case"naturalEarth":return new q_(t);case"equalEarth":return new G_(t);case"winkelTripel":return new W_(t);case"albers":return i?new rf(t):new j_(t);case"lambertConformalConic":return i?new rf(t):new Z_(t);case"globe":return new X_(t)}throw new Error(`Invalid projection name: ${t.name}`)}const H_=oh.types,K_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xh(t,e,i,n,s,c,u,p,m,_,x,b,w){const S=p?Math.min(fo,Math.round(p[0])):0,M=p?Math.min(fo,Math.round(p[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*s),c,u,(S<<1)+(m?1:0),M,16*_,16*x,256*b,256*w)}function vh(t,e,i,n,s,c,u){t.emplaceBack(e,i,n,s,c,u)}function bh(t,e,i,n,s){t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s),t.emplaceBack(e,i,n,s)}function Y_(t){for(const e of t.sections)if(Hh(e.text))return!0;return!1}class Nu{constructor(e){this.layoutVertexArray=new ve,this.indexArray=new je,this.programConfigurations=e,this.segments=new Yt,this.dynamicLayoutVertexArray=new we,this.opacityVertexArray=new Ge,this.placedSymbolArray=new Kt,this.globeExtVertexArray=new Ae}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,n,s){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,o_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,a_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,K_,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,s_.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Ue(Nu,"SymbolBuffers");class ju{constructor(e,i,n){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new n,this.segments=new Yt,this.collisionVertexArray=new lt,this.collisionVertexArrayExt=new ot}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,l_.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,c_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
8stroy())}}Ue(ju,"CollisionBuffers");class _o{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Fr([]),this.placementViewportMatrix=Fr([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zu(this.zoom,i["text-size"]),this.iconSizeData=zu(this.zoom,i["icon-size"]);const n=this.layers[0].layout,s=n.get("symbol-sort-key"),c=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=c!=="viewport-y"&&s.constantOr(1)!==void 0,this.sortFeaturesByY=(c==="viewport-y"||c==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(u=>sr[u]),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new Nu(new is(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Nu(new is(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Ii,this.lineVertexArray=new Ys,this.symbolInstances=new Bt}calculateGlyphDependencies(e,i,n,s,c){for(let u=0;u<e.length;u++)if(i[e.charCodeAt(u)]=!0,s&&c){const p=Nl[e.charAt(u)];p&&(i[p.charCodeAt(0)]=!0)}}populate(e,i,n,s){const c=this.layers[0],u=c.layout,p=this.projection.name==="globe",m=u.get("text-font"),_=u.get("text-field"),x=u.get("icon-image"),b=(_.value.kind!=="constant"||_.value.value instanceof Ai&&!_.value.value.isEmpty()||_.value.value.toString().length>0)&&(m.value.kind!=="constant"||m.value.value.length>0),w=x.value.kind!=="constant"||!!x.value.value||Object.keys(x.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],!b&&!w)return;const M=i.iconDependencies,C=i.glyphDependencies,D=i.availableImages,U=new v(this.zoom);for(const{feature:q,id:V,index:$,sourceLayerIndex:X}of e){const W=c._featureFilter.needGeometry,ce=ls(q,W);if(!c._featureFilter.filter(U,ce,n))continue;if(W||(ce.geometry=zn(q,n,s)),p&&q.type!==1&&n.z<=5){const ue=ce.geometry,ye=.98078528056,xe=(be,Ce)=>fr(Cl(be.x,be.y,n,1),Cl(Ce.x,Ce.y,n,1))<ye;for(let be=0;be<ue.length;be++)ue[be]=am(ue[be],xe)}let se,me;if(b){const ue=c.getValueAndResolveTokens("text-field",ce,n,D),ye=Ai.factory(ue);Y_(ye)&&(this.hasRTLText=!0),(!this.hasRTLText||f()==="unavailable"||this.hasRTLText&&y.isParsed())&&(se=d_(ye,c,ce))}if(w){const ue=c.getValueAndResolveTokens("icon-image",ce,n,D);me=ue instanceof Gi?ue:Gi.fromString(ue)}if(!se&&!me)continue;const Ee=this.sortFeaturesByKey?S.evaluate(ce,{},n):void 0;if(this.features.push({id:V,text:se,icon:me,index:$,sourceLayerIndex:X,geometry:ce.geometry,properties:q.properties,type:H_[q.type],sortKey:Ee}),me&&(M[me.name]=!0),se){const ue=m.evaluate(ce,{},n).join(","),ye=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(sr.vertical)>=0;for(const xe of se.sections)if(xe.image)M[xe.image.name]=!0;else{const be=fl(se.toString()),Ce=xe.fontStack||ue,pe=C[Ce]=C[Ce]||{};this.calculateGlyphDependencies(xe.text,pe,ye,this.allowVerticalPlacement,be)}}}u.get("symbol-placement")==="line"&&(this.features=function(q){const V={},$={},X=[];let W=0;function ce(ue){X.push(q[ue]),W++}function se(ue,ye,xe){const be=$[ue];return delete $[ue],$[ye]=be,X[be].geometry[0].pop(),X[be].geometry[0]=X[be].geometry[0].concat(xe[0]),be}function me(ue,ye,xe){const be=V[ye];return delete V[ye],V[ue]=be,X[be].geometry[0].shift(),X[be].geometry[0]=xe[0].concat(X[be].geometry[0]),be}function Ee(ue,ye,xe){const be=xe?ye[0][ye[0].length-1]:ye[0][0];return`${ue}:${be.x}:${be.y}`}for(let ue=0;ue<q.length;ue++){const ye=q[ue],xe=ye.geometry,be=ye.text?ye.text.toString():null;if(!be){ce(ue);continue}const Ce=Ee(be,xe),pe=Ee(be,xe,!0);if(Ce in $&&pe in V&&$[Ce]!==V[pe]){const De=me(Ce,pe,xe),Ne=se(Ce,pe,X[De].geometry);delete V[Ce],delete $[pe],$[Ee(be,X[Ne].geometry,!0)]=Ne,X[De].geometry=null}else Ce in $?se(Ce,pe,xe):pe in V?me(Ce,pe,xe):(ce(ue),V[Ce]=W-1,$[pe]=W-1)}return X.filter(ue=>ue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,V)=>q.sortKey-V.sortKey)}update(e,i,n,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,n,s),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,n,s))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=nf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){const n=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:s,y:c}of i)this.lineVertexArray.emplaceBack(s,c);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,i,n,s,c,u,p,m,_,x,b,w,S,M){const C=e.indexArray,D=e.layoutVertexArray,U=e.globeExtVertexArray,q=e.segments.prepareSegment(4*i.length,D,C,this.canOverlap?u.sortKey:void 0),V=this.glyphOffsetArray.length,$=q.vertexLength,X=this.allowVerticalPlacement&&p===sr.vertical?Math.PI/2:0,W=u.text&&u.text.sections;for(let se=0;se<i.length;se++){const{tl:me,tr:Ee,bl:ue,br:ye,tex:xe,pixelOffsetTL:be,pixelOffsetBR:Ce,minFontScaleX:pe,minFontScaleY:
vendor: 7,741 bytes, line 8
8De,glyphOffset:Ne,isSDF:Re,sectionIndex:He}=i[se],ze=q.vertexLength,$e=Ne[1];if(xh(D,_.x,_.y,me.x,$e+me.y,xe.x,xe.y,n,Re,be.x,be.y,pe,De),xh(D,_.x,_.y,Ee.x,$e+Ee.y,xe.x+xe.w,xe.y,n,Re,Ce.x,be.y,pe,De),xh(D,_.x,_.y,ue.x,$e+ue.y,xe.x,xe.y+xe.h,n,Re,be.x,Ce.y,pe,De),xh(D,_.x,_.y,ye.x,$e+ye.y,xe.x+xe.w,xe.y+xe.h,n,Re,Ce.x,Ce.y,pe,De),m){const{x:Ke,y:gt,z:Ye}=m.anchor,[We,Rt,et]=m.up;vh(U,Ke,gt,Ye,We,Rt,et),vh(U,Ke,gt,Ye,We,Rt,et),vh(U,Ke,gt,Ye,We,Rt,et),vh(U,Ke,gt,Ye,We,Rt,et),bh(e.dynamicLayoutVertexArray,Ke,gt,Ye,X)}else bh(e.dynamicLayoutVertexArray,_.x,_.y,_.z,X);C.emplaceBack(ze,ze+1,ze+2),C.emplaceBack(ze+1,ze+2,ze+3),q.vertexLength+=4,q.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ne[0]),se!==i.length-1&&He===i[se+1].sectionIndex||e.programConfigurations.populatePaintArrays(D.length,u,u.index,{},S,M,W&&W[He])}const ce=m?m.anchor:_;e.placedSymbolArray.emplaceBack(ce.x,ce.y,ce.z,_.x,_.y,V,this.glyphOffsetArray.length-V,$,x,b,_.segment,n?n[0]:0,n?n[1]:0,s[0],s[1],p,0,!1,0,w,0)}_commitLayoutVertex(e,i,n,s,c,u,p){e.emplaceBack(i,n,s,c,u,Math.round(p.x),Math.round(p.y))}_addCollisionDebugVertices(e,i,n,s,c,u,p){const m=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),_=m.vertexLength,x=p.tileAnchorX,b=p.tileAnchorY;for(let S=0;S<4;S++)n.collisionVertexArray.emplaceBack(0,0,0,0);n.collisionVertexArrayExt.emplaceBack(i,-e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(i,e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(i,e.padding,e.padding),n.collisionVertexArrayExt.emplaceBack(i,-e.padding,e.padding),this._commitLayoutVertex(n.layoutVertexArray,s,c,u,x,b,new Le(e.x1,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,s,c,u,x,b,new Le(e.x2,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,s,c,u,x,b,new Le(e.x2,e.y2)),this._commitLayoutVertex(n.layoutVertexArray,s,c,u,x,b,new Le(e.x1,e.y2)),m.vertexLength+=4;const w=n.indexArray;w.emplaceBack(_,_+1),w.emplaceBack(_+1,_+2),w.emplaceBack(_+2,_+3),w.emplaceBack(_+3,_),m.primitiveLength+=4}_addTextDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p<c;p++){const m=n.get(p),_=this.getSymbolInstanceTextSize(e,u,i,p);this._addCollisionDebugVertices(m,_,this.textCollisionBox,m.projectedAnchorX,m.projectedAnchorY,m.projectedAnchorZ,u)}}_addIconDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p<c;p++){const m=n.get(p),_=this.getSymbolInstanceIconSize(e,i,u.placedIconSymbolIndex);this._addCollisionDebugVertices(m,_,this.iconCollisionBox,m.projectedAnchorX,m.projectedAnchorY,m.projectedAnchorZ,u)}}generateCollisionDebugBuffers(e,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ju(Ve,wp.members,ui),this.iconCollisionBox=new ju(Ve,wp.members,ui);const n=ca(this.iconSizeData,e),s=ca(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._addTextDebugCollisionBoxes(s,e,i,u.textBoxStartIndex,u.textBoxEndIndex,u),this._addTextDebugCollisionBoxes(s,e,i,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._addIconDebugCollisionBoxes(n,e,i,u.iconBoxStartIndex,u.iconBoxEndIndex,u),this._addIconDebugCollisionBoxes(n,e,i,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u)}}getSymbolInstanceTextSize(e,i,n,s){const c=this.text.placedSymbolArray.get(i.rightJustifiedTextSymbolIndex>=0?i.rightJustifiedTextSymbolIndex:i.centerJustifiedTextSymbolIndex>=0?i.centerJustifiedTextSymbolIndex:i.leftJustifiedTextSymbolIndex>=0?i.leftJustifiedTextSymbolIndex:i.verticalPlacedTextSymbolIndex>=0?i.verticalPlacedTextSymbolIndex:s),u=ch(this.textSizeData,e,c)/mi;return this.tilePixelRatio*u}getSymbolInstanceIconSize(e,i,n){const s=this.icon.placedSymbolArray.get(n),c=ch(this.iconSizeData,e,s);return this.tilePixelRatio*c}_commitDebugCollisionVertexUpdate(e,i,n){e.emplaceBack(i,-n,-n),e.emplaceBack(i,n,-n),e.emplaceBack(i,n,n),e.emplaceBack(i,-n,n)}_updateTextDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p<c;p++){const m=n.get(p),_=this.getSymbolInstanceTextSize(e,u,i,p);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,_,m.padding)}}_updateIconDebugCollisionBoxes(e,i,n,s,c,u){for(let p=s;p<c;p++){const m=n.get(p),_=this.getSymbolInstanceIconSize(e,i,u);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,_,m.padding)}}updateCollisionDebugBuffers(e,i){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const n=ca(this.iconSizeData,e),s=ca(this.textSizeData,e);for(let c=0;c<this.symbolInstances.length;c++){const u=this.symbolInstances.get(c);this._updateTextDebugCollisionBoxes(s,e,i,u.textBoxStartIndex,u.textBoxEndIndex,u),this._updateTextDebugCollisionBoxes(s,e,i,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u),this._updateIconDebugCollisionBoxes(n,e,i,u.iconBoxStartIndex,u.iconBoxEndIndex,u.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(n,e,i,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,i,n,s,c,u,p,m,_){const x={};if(i<n){const{x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$,featureIndex:X}=e.get(i);x.textBox={x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$},x.textFeatureIndex=X}if(s<c){const{x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$,featureIndex:X}=e.get(s);x.verticalTextBox={x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$},x.verticalTextFeatureIndex=X}if(u<p){const{x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$,featureIndex:X}=e.get(u);x.iconBox={x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$},x.iconFeatureIndex=X}if(m<_){const{x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$,featureIndex:X}=e.get(m);x.verticalIconBox={x1:b,y1:w,x2:S,y2:M,padding:C,projectedAnchorX:D,projectedAnchorY:U,projectedAnchorZ:q,tileAnchorX:V,tileAnchorY:$},x.verticalIconFeatureIndex=X}return x}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const n=e.placedSymbolArray.get(i),s=n.vertexStartIndex+4*n.numGlyphs;for(let c=n.vertexStartIndex;c<s;c+=4)e.indexArray.emplaceBack(c,c+1,c+2),e.indexArray.emplaceBack(c+1,c+2,c+3)}
vendor: 14,391 bytes, line 8
8getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(e),n=Math.cos(e),s=[],c=[],u=[];for(let p=0;p<this.symbolInstances.length;++p){u.push(p);const m=this.symbolInstances.get(p);s.push(0|Math.round(i*m.tileAnchorX+n*m.tileAnchorY)),c.push(m.featureIndex)}return u.sort((p,m)=>s[p]-s[m]||c[m]-c[p]),u}addToSortKeyRanges(e,i){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===i?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const n=this.symbolInstances.get(i);this.featureSortOrder.push(n.featureIndex);const{rightJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:c,leftJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:p,placedIconSymbolIndex:m,verticalPlacedIconSymbolIndex:_}=n;s>=0&&this.addIndicesForPlacedSymbol(this.text,s),c>=0&&c!==s&&this.addIndicesForPlacedSymbol(this.text,c),u>=0&&u!==c&&u!==s&&this.addIndicesForPlacedSymbol(this.text,u),p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&this.addIndicesForPlacedSymbol(this.icon,m),_>=0&&this.addIndicesForPlacedSymbol(this.icon,_)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ue(_o,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),_o.MAX_GLYPHS=65535,_o.addDynamicAttributes=bh;const J_=new j({"symbol-placement":new I(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new I(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new I(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new I(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new I(fe.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new I(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new I(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new I(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(fe.layout_symbol["icon-size"]),"icon-text-fit":new I(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new I(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(fe.layout_symbol["icon-image"]),"icon-rotate":new L(fe.layout_symbol["icon-rotate"]),"icon-padding":new I(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new I(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new L(fe.layout_symbol["icon-offset"]),"icon-anchor":new L(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new I(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new I(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new I(fe.layout_symbol["text-rotation-alignment"]),"text-field":new L(fe.layout_symbol["text-field"]),"text-font":new L(fe.layout_symbol["text-font"]),"text-size":new L(fe.layout_symbol["text-size"]),"text-max-width":new L(fe.layout_symbol["text-max-width"]),"text-line-height":new L(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new L(fe.layout_symbol["text-letter-spacing"]),"text-justify":new L(fe.layout_symbol["text-justify"]),"text-radial-offset":new L(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new I(fe.layout_symbol["text-variable-anchor"]),"text-anchor":new L(fe.layout_symbol["text-anchor"]),"text-max-angle":new I(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new I(fe.layout_symbol["text-writing-mode"]),"text-rotate":new L(fe.layout_symbol["text-rotate"]),"text-padding":new I(fe.layout_symbol["text-padding"]),"text-keep-upright":new I(fe.layout_symbol["text-keep-upright"]),"text-transform":new L(fe.layout_symbol["text-transform"]),"text-offset":new L(fe.layout_symbol["text-offset"]),"text-allow-overlap":new I(fe.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new I(fe.layout_symbol["text-ignore-placement"]),"text-optional":new I(fe.layout_symbol["text-optional"])});var Gu={paint:new j({"icon-opacity":new L(fe.paint_symbol["icon-opacity"]),"icon-color":new L(fe.paint_symbol["icon-color"]),"icon-halo-color":new L(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new I(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new I(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(fe.paint_symbol["text-opacity"]),"text-color":new L(fe.paint_symbol["text-color"],{runtimeType:Bi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(fe.paint_symbol["text-halo-color"]),"text-halo-width":new L(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new L(fe.paint_symbol["text-halo-blur"]),"text-translate":new I(fe.paint_symbol["text-translate"]),"text-translate-anchor":new I(fe.paint_symbol["text-translate-anchor"])}),layout:J_};class of{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Zn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ue(of,"FormatSectionOverride",{omit:["defaultValue"]});class wh extends Or{constructor(e){super(e,Gu)}recalculate(e,i){super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const s=[];for(const c of n)s.indexOf(c)<0&&s.push(c);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,i,n,s){const c=this.layout.get(e).evaluate(i,{},n,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||ro(u.value)||!c?c:function(p,m){return m.replace(/{([^{}]+)}/g,(_,x)=>x in p?String(p[x]):"")}(i.properties,c)}createBucket(e){return new _o(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Gu.paint.overridableProperties){if(!wh.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),n=new of(i),s=new Gs(n,i.property.specification);let c=null;c=i.value.kind==="constant"||i.value.kind==="source"?new rl("source",s):new Wo("composite",s,i.value.zoomStops,i.value._interpolationType),this.paint._values[e]=new B(i.property,c,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&wh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const n=e.get("text-field"),s=Gu.paint.properties[i];let c=!1;const u=p=>{for(const m of p)if(s.overrides&&s.overrides.hasOverride(m))return void(c=!0)};if(n.value.kind==="constant"&&n.value.value instanceof Ai)u(n.value.value.sections);else if(n.value.kind==="source"){const p=_=>{c||(_ instanceof yn&&Gt(_.value)===zo?u(_.value.sections):_ instanceof Yr?u(_.sections):_.eachChild(p))},m=n.value;m._styleExpression&&p(m._styleExpression.expression)}return c}getProgramConfiguration(e){return new ho(this,e)}}var Q_={paint:new j({"background-color":new I(fe.paint_background["background-color"]),"background-pattern":new I(fe.paint_background["background-pattern"]),"background-opacity":new I(fe.paint_background["background-opacity"])})},eg={paint:new j({"raster-opacity":new I(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new I(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new I(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new I(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new I(fe.paint_raster["raster-saturation"]),"raster-contrast":new I(fe.paint_raster["raster-contrast"]),"raster-resampling":new I(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new I(fe.paint_raster["raster-fade-duration"])})};class tg extends Or{constructor(e){super(e,{}),this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var ig={paint:new j({"sky-type":new I(fe.paint_sky["sky-type"]),"sky-atmosphere-sun":new I(fe.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new I(fe.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new I(fe.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new I(fe.paint_sky["sky-gradient-radius"]),"sky-gradient":new N(fe.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new I(fe.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new I(fe.paint_sky["sky-atmosphere-color"]),"sky-opacity":new I(fe.paint_sky["sky-opacity"])})};function $u(t,e,i){const n=[0,0,1],s=Td([]);return Sd(s,s,i?-dt(t)+Math.PI:dt(t)),Ed(s,s,-dt(e)),xd(n,n,s),Ci(n,n)}const rg={circle:class extends Or{constructor(t){super(t,fm)}createBucket(t){return new _u(t)}queryRadius(t){const e=t;return oa("circle-radius",this,e)+oa("circle-stroke-width",this,e)+Jc(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=Wd(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),_=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Xd(t,n,c,u,p,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",m,_)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new ho(this,t)}},heatmap:class extends Or{createBucket(t){return new Kd(t)}constructor(t){super(t,ym),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return oa("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p){const m=this.paint.get("heatmap-radius").evaluate(e,i);return Xd(t,n,c,u,p,!0,!0,new Le(0,0),m)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new ho(this,t)}},hillshade:class extends Or{constructor(t){super(t,xm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends Or{constructor(t){super(t,Rm)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new ho(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new rh(t)}queryRadius(){return Jc(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,s,c){return!t.queryGeometry.isAboveHorizon&&jd(qd(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Or{constructor(t){super(t,Ym)}createBucket(t){return new Fl(t)}queryRadius(){return Jc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new ho(this,t)}queryIntersectsFeature(t,e,i,n,s,c,u,p,m){const _=Wd(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),x=this.paint.get("fill-extrusion-height").evaluate(e,i),b=this.paint.get("fill-extrusion-base").evaluate(e,i),w=[0,0],S=p&&c.elevation,M=c.elevation?c.elevation.exaggeration():1,C=t.tile.getBucket(this);if(S&&C instanceof Fl){const $=C.centroidVertexArray,X=m+1;X<$.length&&(w[0]=$.geta_centroid_pos0(X),w[1]=$.geta_centroid_pos1(X))}if(w[0]===0&&w[1]===1)return!1;c.projection.name==="globe"&&(n=fp([n],[new Le(0,0),new Le(Ze,Ze)],t.tileID.canonical).map($=>$.polygon).flat());const D=S?p:null,[U,q]=function($,X,W,ce,se,me,Ee,ue,ye,xe,be){return $.projection.name==="globe"?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke,gt,Ye){const We=[],Rt=[],et=Ce.projection.upVectorScale(Ye,Ce.center.lat,Ce.worldSize).metersToTile,tt=[0,0,0,1],It=[0,0,0,1],kt=(Ct,Nt,$t,Qt)=>{Ct[0]=Nt,Ct[1]=$t,Ct[2]=Qt,Ct[3]=1},Dt=pp();De>0&&(De+=Dt),Ne+=Dt;for(const Ct of pe){const Nt=[],$t=[];
vendor: 4,553 bytes, line 8
8for(const Qt of Ct){const zt=Qt.x+Re.x,ni=Qt.y+Re.y,ei=Ce.projection.projectTilePoint(zt,ni,Ye),jt=Ce.projection.upVector(Ye,Qt.x,Qt.y);let xt=De,ti=Ne;if(ze){const Lt=yp(zt,ni,De,Ne,ze,$e,Ke,gt);xt+=Lt.base,ti+=Lt.top}De!==0?kt(tt,ei.x+jt[0]*et*xt,ei.y+jt[1]*et*xt,ei.z+jt[2]*et*xt):kt(tt,ei.x,ei.y,ei.z),kt(It,ei.x+jt[0]*et*ti,ei.y+jt[1]*et*ti,ei.z+jt[2]*et*ti),qt(tt,tt,He),qt(It,It,He),Nt.push(new la(tt[0],tt[1],tt[2])),$t.push(new la(It[0],It[1],It[2]))}We.push(Nt),Rt.push($t)}return[We,Rt]}($,X,W,ce,se,me,Ee,ue,ye,xe,be):Ee?function(Ce,pe,De,Ne,Re,He,ze,$e,Ke){const gt=[],Ye=[],We=[0,0,0,1];for(const Rt of Ce){const et=[],tt=[];for(const It of Rt){const kt=It.x+Ne.x,Dt=It.y+Ne.y,Ct=yp(kt,Dt,pe,De,He,ze,$e,Ke);We[0]=kt,We[1]=Dt,We[2]=Ct.base,We[3]=1,os(We,We,Re),We[3]=Math.max(We[3],1e-5);const Nt=new la(We[0]/We[3],We[1]/We[3],We[2]/We[3]);We[0]=kt,We[1]=Dt,We[2]=Ct.top,We[3]=1,os(We,We,Re),We[3]=Math.max(We[3],1e-5);const $t=new la(We[0]/We[3],We[1]/We[3],We[2]/We[3]);et.push(Nt),tt.push($t)}gt.push(et),Ye.push(tt)}return[gt,Ye]}(X,W,ce,se,me,Ee,ue,ye,xe):function(Ce,pe,De,Ne,Re){const He=[],ze=[],$e=Re[8]*pe,Ke=Re[9]*pe,gt=Re[10]*pe,Ye=Re[11]*pe,We=Re[8]*De,Rt=Re[9]*De,et=Re[10]*De,tt=Re[11]*De;for(const It of Ce){const kt=[],Dt=[];for(const Ct of It){const Nt=Ct.x+Ne.x,$t=Ct.y+Ne.y,Qt=Re[0]*Nt+Re[4]*$t+Re[12],zt=Re[1]*Nt+Re[5]*$t+Re[13],ni=Re[2]*Nt+Re[6]*$t+Re[14],ei=Re[3]*Nt+Re[7]*$t+Re[15],jt=Qt+$e,xt=zt+Ke,ti=ni+gt,Lt=Math.max(ei+Ye,1e-5),ki=Qt+We,ii=zt+Rt,_i=ni+et,di=Math.max(ei+tt,1e-5);kt.push(new la(jt/Lt,xt/Lt,ti/Lt)),Dt.push(new la(ki/di,ii/di,_i/di))}He.push(kt),ze.push(Dt)}return[He,ze]}(X,W,ce,se,me)}(c,n,b,x,_,u,D,w,M,c.center.lat,t.tileID.canonical),V=t.queryGeometry;return function($,X,W){let ce=1/0;jd(W,X)&&(ce=gp(W,X[0]));for(let se=0;se<X.length;se++){const me=X[se],Ee=$[se];for(let ue=0;ue<me.length-1;ue++){const ye=me[ue],xe=[ye,me[ue+1],Ee[ue+1],Ee[ue],ye];Nd(W,xe)&&(ce=Math.min(ce,gp(W,xe)))}}return ce!==1/0&&ce}(U,q,V.isPointQuery()?V.screenBounds:V.screenGeometry)}},line:class extends Or{constructor(t){super(t,xp),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof $a,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=vp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new lh(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new ho(this,t)}queryRadius(t){const e=t,i=bp(oa("line-width",this,e),oa("line-gap-width",this,e)),n=oa("line-offset",this,e);return i/2+Math.abs(n)+Jc(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,n,s,c){if(t.queryGeometry.isAboveHorizon)return!1;const u=qd(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),c.angle,t.pixelToTileUnitsFactor),p=t.pixelToTileUnitsFactor/2*bp(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),m=this.paint.get("line-offset").evaluate(e,i);return m&&(n=function(_,x){const b=[],w=new Le(0,0);for(let S=0;S<_.length;S++){const M=_[S],C=[];for(let D=0;D<M.length;D++){const U=M[D],q=M[D+1],V=D===0?w:U.sub(M[D-1])._unit()._perp(),$=D===M.length-1?w:q.sub(U)._unit()._perp(),X=V._add($)._unit();X._mult(1/(X.x*$.x+X.y*$.y)),C.push(X._mult(x)._add(U))}b.push(C)}return b}(n,m*t.pixelToTileUnitsFactor)),function(_,x,b){for(let w=0;w<x.length;w++){const S=x[w];if(_.length>=3){for(let M=0;M<S.length;M++)if(cs(_,S[M]))return!0}if(hm(_,S,b))return!0}return!1}(u,n,p)}isTileClipped(){return!0}},symbol:wh,background:class extends Or{constructor(t){super(t,Q_)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends Or{constructor(t){super(t,eg)}getProgramIds(){return["raster"]}},sky:class extends Or{constructor(t){super(t,ig),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="sky-gradient"?this._updateColorRamp():t!=="sky-atmosphere-sun"&&t!=="sky-atmosphere-halo-color"&&t!=="sky-atmosphere-color"&&t!=="sky-atmosphere-sun-intensity"||(this._skyboxInvali
8dated=!0)}_updateColorRamp(){this.colorRamp=vu({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if(this.paint.get("sky-type")==="atmosphere"){const n=this.paint.get("sky-atmosphere-sun"),s=!n,c=t.style.light,u=c.properties.get("position");return s&&c.properties.get("anchor")==="viewport"&&Ut("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),s?$u(u.azimuthal,90-u.polar,e):$u(n[0],90-n[1],e)}const i=this.paint.get("sky-gradient-center");return $u(i[0],90-i[1],e)}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return t==="atmosphere"?["skyboxCapture","skybox"]:t==="gradient"?["skyboxGradient"]:null}}};class Hl{constructor(e,i,n,s){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(i,s)}update(e,i,n){const{width:s,height:c}=e,{context:u}=this,{gl:p}=u,{HTMLImageElement:m,HTMLCanvasElement:_,HTMLVideoElement:x,ImageData:b,ImageBitmap:w}=Se;if(p.bindTexture(p.TEXTURE_2D,this.texture),u.pixelStoreUnpackFlipY.set(!1),u.pixelStoreUnpack.set(1),u.pixelStoreUnpackPremultiplyAlpha.set(this.format===p.RGBA&&(!i||i.premultiply!==!1)),n||this.size&&this.size[0]===s&&this.size[1]===c){const{x:S,y:M}=n||{x:0,y:0};e instanceof m||e instanceof _||e instanceof x||e instanceof b||w&&e instanceof w?p.texSubImage2D(p.TEXTURE_2D,0,S,M,p.RGBA,p.UNSIGNED_BYTE,e):p.texSubImage2D(p.TEXTURE_2D,0,S,M,s,c,p.RGBA,p.UNSIGNED_BYTE,e.data)}else this.size=[s,c],e instanceof m||e instanceof _||e instanceof x||e instanceof b||w&&e instanceof w?p.texImage2D(p.TEXTURE_2D,0,this.format,this.format,p.UNSIGNED_BYTE,e):p.texImage2D(p.TEXTURE_2D,0,this.format,s,c,0,this.format,p.UNSIGNED_BYTE,e.data);this.useMipmap=!!(i&&i.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&p.generateMipmap(p.TEXTURE_2D)}bind(e,i){const{context:n}=this,{gl:s}=n;s.bindTexture(s.TEXTURE_2D,this.texture),e!==this.filter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,this.useMipmap?e===s.NEAREST?s.NEAREST_MIPMAP_NEAREST:s.LINEAR_MIPMAP_NEAREST:e),this.filter=e),i!==this.wrap&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,i),s.texParameteri(s.TEXTURE_2D,s.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:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class ng{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class og{constructor(){this.tasks={},this.taskQueue=[],un(["process"],this),this.invoker=new ng(this.process),this.nextId=0}add(e,i){const n=this.nextId++,s=function({type:c,isSymbolTile:u,zoom:p}){return p=p||0,c==="message"?0:c!=="maybePrepare"||u?c!=="parseTile"||u?c==="parseTile"&&u?300-p:c==="maybePrepare"&&u?400-p:500:200-p:100-p}(i);if(s===0){Er();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:i,priority:s,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){Er();try{if(this.taskQueue=this.taskQueue.filter(n=>!!this.tasks[n]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const i=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!i)return;i.fn()}finally{}}pick(){let e=null,i=1/0;for(let s=0;s<this.taskQueue.length;s++){const c=this.tasks[this.taskQueue[s]];c.priority<i&&(i=c.priority,e=s)}if(e===null)return null;const n=this.taskQueue[e];return this.taskQueue.splice(e,1),n}remove(){this.invoker.remove()}}class sf{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){const n=e[i];this._stringToNumber[n]=i,this._numberToString[i]=n}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const sg=["tile","layer","source","sourceLayer","state"];class af{constructor(e,i,n,s,c){this.type="Feature",this._vectorTileFeature=e,this._z=i,this._x=n,this._y=s,this.properties=e.properties,this.id=c}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};this.id!==void 0&&(e.id=this.id);for(const i of sg)this[i]!==void 0&&(e[i]=this[i]);return e}}const gr=32,on=33,go=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,i=0,n=0,s=0,c=0,u=0,p=0;for(1&e?s=c=u=gr:i=n=p=gr;(e>>=1)>1;){const _=i+s>>1,x=n+c>>1;1&e?(s=i,c=n,i=u,n=p):(i=s,n=c,s=u,c=p),u=_,p=x}const m=4*t;go[m+0]=i,go[m+1]=n,go[m+2]=s,go[m+3]=c}const sn=new Uint16Array(2178),yo=new Uint8Array(1089),Th=new Uint16Array(1089);function lf(t){return t===0?-.03125:t===32?.03125:0}var cf=te([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const hf={type:2,extent:Ze,loadGeometry:()=>[[new Le(0,0),new Le(Ze+1,0),new Le(Ze+1,Ze+1),new Le(0,Ze+1),new Le(0,0)]]};class Zu{constructor(e,i,n,s,c){this.tileID=e,this.uid=On(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=c,this.expiredRequestCount=0,this.state="loading",s&&s.transform&&(this.projection=s.transform.projection)}registerFadeDuration(e){const i=e+this.timeAdded;i<Sr.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=us(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,i,n){if(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(s,c){const u={};if(!c)return u;for(const p of s){const m=p.layerIds.map(_=>
vendor: 5,415 bytes, line 8
8c.getLayer(_)).filter(Boolean);if(m.length!==0){p.layers=m,p.stateDependentLayerIds&&(p.stateDependentLayers=p.stateDependentLayerIds.map(_=>m.filter(x=>x.id===_)[0]));for(const _ of m)u[_.id]=p}}return u}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const s in this.buckets){const c=this.buckets[s];if(c instanceof _o){if(this.hasSymbolBuckets=!0,!n)break;c.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const s in this.buckets){const c=this.buckets[s];if(c instanceof _o&&c.hasRTLText){this.hasRTLText=!0,y.isLoading()||y.isLoaded()||f()!=="deferred"||g();break}}this.queryPadding=0;for(const s in this.buckets){const c=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(s).queryRadius(c))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Mt}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const n in this.buckets){const s=this.buckets[n];s.uploadPending()&&s.upload(e)}const i=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hl(e,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hl(e,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Hl(e,this.lineAtlas.image,i.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,i,n,s,c,u,p,m){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:s,pixelPosMatrix:p,transform:u,params:c,tileTransform:this.tileTransform},e,i,n):{}}querySourceFeatures(e,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const s=n.loadVTLayers(),c=i?i.sourceLayer:"",u=s._geojsonTileLayer||s[c];if(!u)return;const p=Ws(i&&i.filter),{z:m,x:_,y:x}=this.tileID.canonical,b={z:m,x:_,y:x};for(let w=0;w<u.length;w++){const S=u.feature(w);if(p.needGeometry){const D=ls(S,!0);if(!p.filter(new v(this.tileID.overscaledZ),D,this.tileID.canonical))continue}else if(!p.filter(new v(this.tileID.overscaledZ),S))continue;const M=n.getId(S,c),C=new af(S,m,_,x,M);C.tile=b,e.push(C)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const n=Ri(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const n=Date.now();let s=!1;if(this.expirationTime>n)s=!1;else if(i)if(this.expirationTime<i)s=!0;else{const c=this.expirationTime-i;c?this.expirationTime=n+Math.max(c,3e4):s=!0}else s=!0;s?(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,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0||!i)return;const n=this.latestFeatureIndex.loadVTLayers(),s=i.style.listImages();for(const c in this.buckets){if(!i.style.hasLayer(c))continue;const u=this.buckets[c],p=u.layers[0].sourceLayer||"_geojsonTileLayer",m=n[p],_=e[p];if(!m||!_||Object.keys(_).length===0)continue;if(u.update(_,m,s,this.imageAtlas&&this.imageAtlas.patternPositions||{}),u instanceof lh||u instanceof rh){const b=i.style._getSourceCache(u.layers[0].source);i._terrain&&i._terrain.enabled&&b&&u.programConfigurations.needsUpload&&i._terrain._clearRenderCacheForTile(b.id,this.tileID)}const x=i&&i.style&&i.style.getLayer(c);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(u)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Sr.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Sr.now()+e}
8setTexture(e,i){const n=i.context,s=n.gl;this.texture=this.texture||i.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new Hl(n,e,s.RGBA,{useMipmap:!0}),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE))}setDependencies(e,i){const n={};for(const s of i)n[s]=!0;this.dependencies[e]=n}hasDependency(e,i){for(const n of e){const s=this.dependencies[n];if(s){for(const c of i)if(s[c])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,i){if(!i||i.name==="mercator"||this._tileDebugBuffer)return;const n=zn(hf,this.tileID.canonical,this.tileTransform)[0],s=new Te,c=new qi;for(let u=0;u<n.length;u++){const{x:p,y:m}=n[u];s.emplaceBack(p,m),c.emplaceBack(u)}c.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(c),this._tileDebugBuffer=e.createVertexBuffer(s,Al.members),this._tileDebugSegments=Yt.simpleSegment(0,0,s.length,c.length)}_makeTileBoundsBuffers(e,i){if(this._tileBoundsBuffer||!i||i.name==="mercator")return;const n=zn(hf,this.tileID.canonical,this.tileTransform)[0];let s,c;if(this.isRaster){const u=function(p,m){const _=us(p,m),x=Math.pow(2,p.z);for(let D=0;D<on;D++)for(let U=0;U<on;U++){const q=or((p.x+(U+lf(U))/gr)/x),V=bi((p.y+(D+lf(D))/gr)/x),$=m.project(q,V),X=D*on+U;sn[2*X+0]=Math.round(($.x*_.scale-_.x)*Ze),sn[2*X+1]=Math.round(($.y*_.scale-_.y)*Ze)}yo.fill(0),Th.fill(0);for(let D=2045;D>=0;D--){const U=4*D,q=go[U+0],V=go[U+1],$=go[U+2],X=go[U+3],W=q+$>>1,ce=V+X>>1,se=W+ce-V,me=ce+q-W,Ee=V*on+q,ue=X*on+$,ye=ce*on+W,xe=Math.hypot((sn[2*Ee+0]+sn[2*ue+0])/2-sn[2*ye+0],(sn[2*Ee+1]+sn[2*ue+1])/2-sn[2*ye+1])>=16;yo[ye]=yo[ye]||(xe?1:0),D<1022&&(yo[ye]=yo[ye]||yo[(V+me>>1)*on+(q+se>>1)]||yo[(X+me>>1)*on+($+se>>1)])}const b=new ge,w=new je;let S=0;function M(D,U){const q=U*on+D;return Th[q]===0&&(b.emplaceBack(sn[2*q+0],sn[2*q+1],D*Ze/gr,U*Ze/gr),Th[q]=++S),Th[q]-1}function C(D,U,q,V,$,X){const W=D+q>>1,ce=U+V>>1;if(Math.abs(D-$)+Math.abs(U-X)>1&&yo[ce*on+W])C($,X,D,U,W,ce),C(q,V,$,X,W,ce);else{const se=M(D,U),me=M(q,V),Ee=M($,X);w.emplaceBack(se,me,Ee)}}return C(0,0,gr,gr,gr,0),C(gr,gr,0,0,0,gr),{vertices:b,indices:w}}(this.tileID.canonical,i);s=u.vertices,c=u.indices}else{s=new ge,c=new je;for(const{x:p,y:m}of n)s.emplaceBack(p,m,0,0);const u=Su(s.int16,void 0,4);for(let p=0;p<u.length;p+=3)c.emplaceBack(u[p],u[p+1],u[p+2])}this._tileBoundsBuffer=e.createVertexBuffer(s,cf.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(c),this._tileBoundsSegments=Yt.simpleSegment(0,0,s.length,c.length)}_makeGlobeTileDebugBuffers(e,i){const n=i.projection;if(!n||n.name!=="globe"||i.freezeTileCoverage)return;const s=this.tileID.canonical,c=zl(zd(s,i)),u=ra(i.zoom);let p;u>0&&(p=Qh(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,s,i,c,p,u),this._makeGlobeTileDebugTextBuffer(e,s,i,c,p,u)}_globePoint(e,i,n,s,c,u,p){let m=Cl(e,i,n);if(u){const _=1<<n.z,x=rn(s.center.lng),b=nn(s.center.lat),w=(n.x+.5)/_-x;let S=0;w>.5?S=-1:w<-.5&&(S=1);let M=(e/Ze+n.x)/_+S,C=(i/Ze+n.y)/_;M=(M-x)*s._pixelsPerMercatorPixel+x,C=(C-b)*s._pixelsPerMercatorPixel+b;const D=[M*s.worldSize,C*s.worldSize,0];qt(D,D,u),m=as(m,D,p)}return qt(m,m,c)}_makeGlobeTileDebugBorderBuffer(e,i,n,s,c,u){const p=new Te,m=new qi,_=new oe,x=(w,S,M,C,D)=>{const U=(M-w)/(D-1),q=(C-S)/(D-1),V=p.length;for(let $=0;$<D;$++){const X=w+$*U,W=S+$*q;p.emplaceBack(X,W);const ce=this._globePoint(X,W,i,n,s,c,u);_.emplaceBack(ce[0],ce[1],ce[2]),m.emplaceBack(V+$)}},b=Ze;x(0,0,b,0,16),x(b,0,b,b,16),x(b,b,0,b,16),x(0,b,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(m),this._tileDebugBuffer=e.createVertexBuffer(p,Al.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(_,Ad.members),this._tileDebugSegments=Yt.simpleSegment(0,0,p.length,m.length)}_makeGlobeTileDebugTextBuffer(e,i,n,s,c,u){const p=Ze/4,m=new Te,_=new je,x=new oe,b=25;_.reserve(32),m.reserve(b),x.reserve(b);const w=(S,M)=>b*S+M;for(let S=0;S<b;S++){const M=S*p;for(let C=0;C<b;C++){const D=C*p;m.emplaceBack(D,M);const U=this._globePoint(D,M,i,n,s,c,u);x.emplaceBack(U[0],U[1],U[2])}}for(let S=0;S<4;S++)for(let M=0;M<4;M++){const C=w(S,M),D=w(S,M+1),U=w(S+1,M),q=w(S+1,M+1);_.emplaceBack(C,D,U),_.emplaceBack(U,D,q)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(_),this._tileDebugTextBuffer=e.createVertexBuffer(m,Al.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(x,Ad.members),this._tileDebugTextSegments=Yt.simpleSegment(0,0,b,32)}}class ag{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,i,n){const s=String(i);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][s]=this.stateChanges[e][s]||{},Wt(this.stateChanges[e][s],n),this.deletedStates[e]===null){this.deletedStates[e]={};for(const c in this.state[e])c!==s&&(this.deletedStates[e][c]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][s]===null){this.deletedStates[e][s]={};for(const c in this.state[e][s])n[c]||(this.deletedStates[e][s][c]=null)}else for(const c in n)this.deletedStates[e]&&this.deletedStates[e][s]&&this.deletedStates[e][s][c]===null&&delete this.deletedStates[e][s][c]}removeFeatureState(e,i,n){if(this.deletedStates[e]===null)return;const s=String(i);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&i!==void 0)this.deletedStates[e][s]!==null&&(this.deletedStates[e][s]=this.deletedStates[e][s]||{},this.deletedStates[e][s][n]=null);else if(i!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][s])for(n in this.deletedStates[e][s]={},this.stateChanges[e][s])this.deletedStates[e][s][n]=null;else this.deletedStates[e][s]=null;else this.deletedStates[e]=null}getState(e,i){const n=String(i),s=Wt({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const c=this.deletedStates[e][i];if(c===null)return{};for(const u in c)delete s[u]}return s}initializeTileState(e,i){e.setFeatureState(this.state,i)}coalesceChanges(e,i){const n={};for(const s in this.stateChanges){this.state[s]=this.state[s]||{};const c={};for(const u in this.stateChanges[s])this.state[s][u]||(this.state[s][u]={}),Wt(this.state[s][u],this.stateChanges[s][u]),c[u]=this.state[s][u];n[s]=c}
vendor: 7,787 bytes, line 8
8for(const s in this.deletedStates){this.state[s]=this.state[s]||{};const c={};if(this.deletedStates[s]===null)for(const u in this.state[s])c[u]={},this.state[s][u]={};else for(const u in this.deletedStates[s]){if(this.deletedStates[s][u]===null)this.state[s][u]={};else if(this.state[s][u])for(const p of Object.keys(this.deletedStates[s][u]))delete this.state[s][u][p];c[u]=this.state[s][u]}n[s]=n[s]||{},Wt(n[s],c)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(const s in e)e[s].setFeatureState(n,i)}}class uf{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,i){const n=this.toIdx(e,i);return{min:this.minimums[n],max:this.maximums[n]}}isLeaf(e,i){return this.leaves[this.toIdx(e,i)]}toIdx(e,i){return i*this.size+e}}function df(t,e,i,n){let s=0,c=Number.MAX_VALUE;for(let u=0;u<3;u++)if(Math.abs(n[u])<1e-15){if(i[u]<t[u]||i[u]>e[u])return null}else{const p=1/n[u];let m=(t[u]-i[u])*p,_=(e[u]-i[u])*p;if(m>_){const x=m;m=_,_=x}if(m>s&&(s=m),_<c&&(c=_),s>c)return null}return s}function pf(t,e,i,n,s,c,u,p,m,_,x){const b=n-t,w=s-e,S=c-i,M=u-t,C=p-e,D=m-i,U=x[1]*D-x[2]*C,q=x[2]*M-x[0]*D,V=x[0]*C-x[1]*M,$=b*U+w*q+S*V;if(Math.abs($)<1e-15)return null;const X=1/$,W=_[0]-t,ce=_[1]-e,se=_[2]-i,me=(W*U+ce*q+se*V)*X;if(me<0||me>1)return null;const Ee=ce*S-se*w,ue=se*b-W*S,ye=W*w-ce*b,xe=(x[0]*Ee+x[1]*ue+x[2]*ye)*X;return xe<0||me+xe>1?null:(M*Ee+C*ue+D*ye)*X}function ff(t,e,i){return(t-e)/(i-e)}function mf(t,e,i,n,s,c,u,p,m){const _=1<<i,x=c-n,b=u-s,w=(t+1)/_*x+n,S=(e+0)/_*b+s,M=(e+1)/_*b+s;p[0]=(t+0)/_*x+n,p[1]=S,m[0]=w,m[1]=M}class _f{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const i=function(c){const u=Math.ceil(Math.log2(c.dim/8)),p=[];let m=Math.ceil(Math.pow(2,u));const _=1/m,x=(S,M,C,D,U)=>{const q=D?1:0,V=(S+1)*C-q,$=M*C,X=(M+1)*C-q;U[0]=S*C,U[1]=$,U[2]=V,U[3]=X};let b=new uf(m);const w=[];for(let S=0;S<m*m;S++){x(S%m,Math.floor(S/m),_,!1,w);const M=xo(w[0],w[1],c),C=xo(w[2],w[1],c),D=xo(w[2],w[3],c),U=xo(w[0],w[3],c);b.minimums.push(Math.min(M,C,D,U)),b.maximums.push(Math.max(M,C,D,U)),b.leaves.push(1)}for(p.push(b),m/=2;m>=1;m/=2){const S=p[p.length-1];b=new uf(m);for(let M=0;M<m*m;M++){x(M%m,Math.floor(M/m),2,!0,w);const C=S.getElevation(w[0],w[1]),D=S.getElevation(w[2],w[1]),U=S.getElevation(w[2],w[3]),q=S.getElevation(w[0],w[3]),V=S.isLeaf(w[0],w[1]),$=S.isLeaf(w[2],w[1]),X=S.isLeaf(w[2],w[3]),W=S.isLeaf(w[0],w[3]),ce=Math.min(C.min,D.min,U.min,q.min),se=Math.max(C.max,D.max,U.max,q.max),me=V&&$&&X&&W;b.maximums.push(se),b.minimums.push(ce),b.leaves.push(se-ce<=5&&me?1:0)}p.push(b)}return p}(this.dem),n=i.length-1,s=i[n];this._addNode(s.minimums[0],s.maximums[0],s.leaves[0]),this._construct(i,0,0,n,0)}raycastRoot(e,i,n,s,c,u,p=1){return df([e,i,-100],[n,s,this.maximums[0]*p],c,u)}raycast(e,i,n,s,c,u,p=1){if(!this.nodeCount)return null;const m=this.raycastRoot(e,i,n,s,c,u,p);if(m==null)return null;const _=[],x=[],b=[],w=[],S=[{idx:0,t:m,nodex:0,nodey:0,depth:0}];for(;S.length>0;){const{idx:M,t:C,nodex:D,nodey:U,depth:q}=S.pop();if(this.leaves[M]){mf(D,U,q,e,i,n,s,b,w);const $=1<<q,X=(D+0)/$,W=(D+1)/$,ce=(U+0)/$,se=(U+1)/$,me=xo(X,ce,this.dem)*p,Ee=xo(W,ce,this.dem)*p,ue=xo(W,se,this.dem)*p,ye=xo(X,se,this.dem)*p,xe=pf(b[0],b[1],me,w[0],b[1],Ee,w[0],w[1],ue,c,u),be=pf(w[0],w[1],ue,b[0],w[1],ye,b[0],b[1],me,c,u),Ce=Math.min(xe!==null?xe:Number.MAX_VALUE,be!==null?be:Number.MAX_VALUE);if(Ce!==Number.MAX_VALUE)return Ce;{const pe=Sl([],c,u,C);if(gf(me,Ee,ye,ue,ff(pe[0],b[0],w[0]),ff(pe[1],b[1],w[1]))>=pe[2])return C}continue}let V=0;for(let $=0;$<this._siblingOffset.length;$++){mf((D<<1)+this._siblingOffset[$][0],(U<<1)+this._siblingOffset[$][1],q+1,e,i,n,s,b,w),b[2]=-100,w[2]=this.maximums[this.childOffsets[M]+$]*p;const X=df(b,w,c,u);if(X!=null){const W=X;_[$]=W;let ce=!1;for(let se=0;se<V&&!ce;se++)W>=_[x[se]]&&(x.splice(se,0,$),ce=!0);ce||(x[V]=$),V++}}for(let $=0;$<V;$++){const X=x[$];S.push({idx:this.childOffsets[M]+X,t:_[X],nodex:(D<<1)+this._siblingOffset[X][0],nodey:(U<<1)+this._siblingOffset[X][1],depth:q+1})}}return null}_addNode(e,i,n){return this.minimums.push(e),this.maximums.push(i),this.leaves.push(n),this.childOffsets.push(0),this.nodeCount++}_construct(e,i,n,s,c){if(e[s].isLeaf(i,n)===1)return;this.childOffsets[c]||(this.childOffsets[c]=this.nodeCount);const u=s-1,p=e[u];let m=0,_=0;for(let x=0;x<this._siblingOffset.length;x++){const b=2*i+this._siblingOffset[x][0],w=2*n+this._siblingOffset[x][1],S=p.getElevation(b,w),M=p.isLeaf(b,w),C=this._addNode(S.min,S.max,M);M&&(m|=1<<x),_||(_=C)}for(let x=0;x<this._siblingOffset.length;x++)m&1<<x||this._construct(e,2*i+this._siblingOffset[x][0],2*n+this._siblingOffset[x][1],u,_+x)}}function gf(t,e,i,n,s,c){return mt(mt(t,i,c),mt(e,n,c),s)}function xo(t,e,i){const n=i.dim,s=ct(t*n-.5,0,n-1),c=ct(e*n-.5,0,n-1),u=Math.floor(s),p=Math.floor(c),m=Math.min(u+1,n-1),_=Math.min(p+1,n-1);return gf(i.get(u,p),i.get(m,p),i.get(u,_),i.get(m,_),s-u,c-p)}const yf={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function lg(t,e,i){return(256*t*256+256*e+i)/10-1e4}function cg(t,e,i){return 256*t+e+i/256-32768}class Eh{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,i,n,s=!1,c=!1){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(n&&n!=="mapbox"&&n!=="terrarium")return Ut(`"${n}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=i.height;const u=this.dim=i.height-2,p=new Uint32Array(i.data.buffer);if(this.pixels=new Uint8Array(i.data.buffer),this.encoding=n||"mapbox",this.borderReady=s,!s){for(let m=0;m<u;m++)p[this._idx(-1,m)]=p[this._idx(0,m)],p[this._idx(u,m)]=p[this._idx(u-1,m)],p[this._idx(m,-1)]=p[this._idx(m,0)],p[this._idx(m,u)]=p[this._idx(m,u-1)];p[this._idx(-1,-1)]=p[this._idx(0,0)],p[this._idx(u,-1)]=p[this._idx(u-1,0)],p[this._idx(-1,u)]=p[this._idx(0,u-1)],p[this._idx(u,u)]=p[this._idx(u-1,u-1)],c&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new _f(this)}get(e,i,n=!1){n&&(e=ct(e,-1,this.dim),i=ct(i,-1,this.dim));const s=4*this._idx(e,i);return(this.encoding==="terrarium"?cg:lg)(this.pixels[s],this.pixels[s+1],this.pixels[s+2])}static getUnpackVector(e){return yf[e]}get unpackVector(){return yf[this.encoding]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(e+1)}static pack(e,i){const n=[0,0,0,0],s=Eh.getUnpackVector(i);let c=Math.floor((e+s[3])/s[2]);return n[2]=c%256,c=Math.floor(c/256),n[1]=c%256,c=Math.floor(c/256),n[0]=c,n}getPixels(){return new Xi({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,i,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,c=i*this.dim+this.dim,u=n*this.dim,p=n*this.dim+this.dim;switch(i){case-1:s=c-1;break;case 1:c=s+1}switch(n){case-1:u=p-1;break;case 1:p=u+1}const m=-i*this.dim,_=-n*this.dim;for(let x=u;x<p;x++)for(let b=s;b<c;b++){const w=4*this._idx(b,x),S=4*this._idx(b+m,x+_);this.pixels[w+0]=e.pixels[S+0],this.pixels[w+1]=e.pixels[S+1],this.pixels[w+2]=e.pixels[S+2],this.pixels[w+3]=e.pixels[S+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Ue(Eh,"DEMData"),Ue(_f,"DemMinMaxQuadTree",{omit:["dem"]});class hg{constructor(e,i){this.max=e,this.onRemove=i,this.reset()}reset(){for(const e in this.data)for(const i of this.data[e])i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value);return this.data={},this.order=[],this}add(e,i,n){const s=e.wrapped().key;this.data[s]===void 0&&(this.data[s]=[]);const c={value:i,timeout:void 0};if(n!==void 0&&(c.timeout=setTimeout(()=>{this.remove(e,c)}
vendor: 9,993 bytes, line 8
8,n)),this.data[s].push(c),this.order.push(s),this.order.length>this.max){const u=this._getAndRemoveByKey(this.order[0]);u&&this.onRemove(u)}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 i=this.data[e].shift();return i.timeout&&clearTimeout(i.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),i.value}getByKey(e){const i=this.data[e];return i?i[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,i){if(!this.has(e))return this;const n=e.wrapped().key,s=i===void 0?0:this.data[n].indexOf(i),c=this.data[n][s];return this.data[n].splice(s,1),c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(c.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const i=this._getAndRemoveByKey(this.order[0]);i&&this.onRemove(i)}return this}filter(e){const i=[];for(const n in this.data)for(const s of this.data[n])e(s.value)||i.push(s);for(const n of i)this.remove(n.value.tileID,n)}}class ya{constructor(e,i,n){this.func=e,this.mask=i,this.range=n}}ya.ReadOnly=!1,ya.ReadWrite=!0,ya.disabled=new ya(519,ya.ReadOnly,[0,1]);const qu=7680;class Wu{constructor(e,i,n,s,c,u){this.test=e,this.ref=i,this.mask=n,this.fail=s,this.depthFail=c,this.pass=u}}Wu.disabled=new Wu({func:519,mask:0},0,0,qu,qu,qu);class an{constructor(e,i,n){this.blendFunction=e,this.blendColor=i,this.mask=n}}an.Replace=[1,0],an.disabled=new an(an.Replace,Zt.transparent,[!1,!1,!1,!1]),an.unblended=new an(an.Replace,Zt.transparent,[!0,!0,!0,!0]),an.alphaBlended=new an([1,771],Zt.transparent,[!0,!0,!0,!0]);const Xu=1029,Hu=2305;class Gr{constructor(e,i,n){this.enable=e,this.mode=i,this.frontFace=n}}Gr.disabled=new Gr(!1,Xu,Hu),Gr.backCCW=new Gr(!0,Xu,Hu),Gr.backCW=new Gr(!0,Xu,2304),Gr.frontCW=new Gr(!0,1028,2304),Gr.frontCCW=new Gr(!0,1028,Hu);class ds extends Co{constructor(e,i,n){super(),this.id=e,this._onlySymbols=n,i.on("data",s=>{s.dataType==="source"&&s.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&s.dataType==="source"&&s.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),i.on("error",()=>{this._sourceErrored=!0}),this._source=i,this._tiles={},this._cache=new hg(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=i.minTileCacheSize,this._maxTileCacheSize=i.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new ag,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(e){this.map=e,this._minTileCacheSize=this._minTileCacheSize===void 0&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const e in this._tiles){const i=this._tiles[e];if(i.state!=="loaded"&&i.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)}_loadTile(e,i){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,i)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}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 i in this._tiles){const n=this._tiles[i];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return Zr(this._tiles).map(e=>e.tileID).sort(xf).map(e=>e.key)}getRenderableIds(e){const i=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&i.push(this._tiles[n]);return e?i.sort((n,s)=>{const c=n.tileID,u=s.tileID,p=new Le(c.canonical.x,c.canonical.y)._rotate(this.transform.angle),m=new Le(u.canonical.x,u.canonical.y)._rotate(this.transform.angle);return c.overscaledZ-u.overscaledZ||m.y-p.y||m.x-p.x}).map(n=>n.tileID.key):i.map(n=>n.tileID).sort(xf).map(n=>n.key)}hasRenderableParent(e){const i=this.findLoadedParent(e,0);return!!i&&this._isIdRenderable(i.tileID.key)}_isIdRenderable(e,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(i||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(+e,"reloading")}}_reloadTile(e,i){const n=this._tiles[e];n&&(n.state!=="loading"&&(n.state=i),this._loadTile(n,this._tileLoaded.bind(this,n,e,i)))}_tileLoaded(e,i,n,s){if(s)if(e.state="errored",s.status!==404)this._source.fire(new Mr(s,{tile:e}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const c=this.map.painter.terrain;this.update(this.transform,c.getScaledDemTileSize(),!0),c.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Sr.now(),n==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),this._source.type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new _n("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const i=this.getRenderableIds();for(let s=0;s<i.length;s++){const c=i[s];if(e.neighboringTiles&&e.neighboringTiles[c]){const u=this.getTileByID(c);n(e,u),n(u,e)}}function n(s,c){if(!s.dem||s.dem.borderReady)return;s.needsHillshadePrepare=!0,s.needsDEMTextureUpload=!0;let u=c.tileID.canonical.x-s.tileID.canonical.x;const p=c.tileID.canonical.y-s.tileID.canonical.y,m=Math.pow(2,s.tileID.canonical.z),_=c.tileID.key;u===0&&p===0||Math.abs(p)>1||(Math.abs(u)>1&&(Math.abs(u+m)===1?u+=m:Math.abs(u-m)===1&&(u-=m)),c.dem&&s.dem&&(s.dem.backfillBorder(c.dem,u,p),s.neighboringTiles&&s.neighboringTiles[_]&&(s.neighboringTiles[_].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,i,n,s){for(const c in this._tiles){let u=this._tiles[c];if(s[c]||!u.hasData()||u.tileID.overscaledZ<=i||u.tileID.overscaledZ>n)continue;let p=u.tileID;for(;u&&u.tileID.overscaledZ>i+1;){const _=u.tileID.scaledTo(u.tileID.overscaledZ-1);u=this._tiles[_.key],u&&u.hasData()&&(p=_)}let m=p;for(;m.overscaledZ>i;)if(m=m.scaledTo(m.overscaledZ-1),e[m.key]){s[p.key]=p;break}}}findLoadedParent(e,i){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=i?n:null}for(let n=e.overscaledZ-1;n>=i;n--){const s=e.scaledTo(n),c=this._getLoadedTile(s);if(c)return c}}_getLoadedTile(e){const i=this._tiles[e.key];return i&&i.hasData()?i:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,i){i=i||this._source.tileSize;const n=Math.ceil(e.width/i)+1,s=Math.ceil(e.height/i)+1,c=Math.floor(n*s*5),u=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,c):c,p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,u):u;this._cache.setMaxSize(p)}handleWrapJump(e){const i=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,i){const n={};for(const s in this._tiles){const c=this._tiles[s];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+i),n[c.tileID.key]=c}this._tiles=n;for(const s in this._timers)clearTimeout(this._timers[s]),delete this._timers[s];for(const s in this._tiles)this._setTileReloadTimer(+s,this._tiles[s])}}update(e,i,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!n)return;let s;this.updateCacheSize(e,i),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new Pi(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(s=e.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(s=s.filter(p=>this._source.hasTile(p)))):s=[];const c=this._updateRetainedTiles(s);if(vf(this._source.type)&&s.length!==0){const p={},m={},_=Object.keys(c);for(const b of _){const w=c[b],S=this._tiles[b];if(!S||S.fadeEndTime&&S.fadeEndTime<=Sr.now())continue;const M=this.findLoadedParent(w,Math.max(w.overscaledZ-ds.maxOverzooming,this._source.minzoom));M&&(this._addTile(M.tileID),p[M.tileID.key]=M.tileID),m[b]=w}const x=s[s.length-1].overscaledZ;for(const b in this._tiles){const w=this._tiles[b];if(c[b]||!w.hasData())continue;let S=w.tileID;for(;S.overscaledZ>x;){S=S.scaledTo(S.overscaledZ-1);const M=this._tiles[S.key];if(M&&M.hasData()&&m[S.key]){c[b]=w.tileID;break}}}for(const b in p)c[b]||(this._coveredTiles[b]=!0,c[b]=p[b])}for(const p in c)this._tiles[p].clearFadeHold();const u=function(p,m){const _=[];for(const x in p)x in m||_.push(x);return _}(this._tiles,c);for(const p of u){const m=this._tiles[p];m.hasSymbolBuckets&&!m.holdingForFade()?m.setHoldDuration(this.map._fadeDuration):m.hasSymbolBuckets&&!m.symbolFadeFinished()||this._removeTile(+p)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const i={};if(e.length===0)return i;const n={},s=e.reduce((_,x)=>
vendor: 8,817 bytes, line 8
8Math.min(_,x.overscaledZ),1/0),c=e[0].overscaledZ,u=Math.max(c-ds.maxOverzooming,this._source.minzoom),p=Math.max(c+ds.maxUnderzooming,this._source.minzoom),m={};for(const _ of e){const x=this._addTile(_);i[_.key]=_,x.hasData()||s<this._source.maxzoom&&(m[_.key]=_)}this._retainLoadedChildren(m,s,p,i);for(const _ of e){let x=this._tiles[_.key];if(x.hasData())continue;if(_.canonical.z>=this._source.maxzoom){const w=_.children(this._source.maxzoom)[0],S=this.getTile(w);if(S&&S.hasData()){i[w.key]=w;continue}}else{const w=_.children(this._source.maxzoom);if(i[w[0].key]&&i[w[1].key]&&i[w[2].key]&&i[w[3].key])continue}let b=x.wasRequested();for(let w=_.overscaledZ-1;w>=u;--w){const S=_.scaledTo(w);if(n[S.key]||(n[S.key]=!0,x=this.getTile(S),!x&&b&&(x=this._addTile(S)),x&&(i[S.key]=S,b=x.wasRequested(),x.hasData())))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const i=[];let n,s=this._tiles[e].tileID;for(;s.overscaledZ>0;){if(s.key in this._loadedParentTiles){n=this._loadedParentTiles[s.key];break}i.push(s.key);const c=s.scaledTo(s.overscaledZ-1);if(n=this._getLoadedTile(c),n)break;s=c}for(const c of i)this._loadedParentTiles[c]=n}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const n=!!i;if(!n){const s=this.map?this.map.painter:null;i=new Zu(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,s,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))}return i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new _n("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,i){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=i.getExpiryTimeout();n&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},n))}_removeTile(e){const i=this._tiles[e];i&&(i.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),i.uses>0||(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,i,n){const s=[],c=this.transform;if(!c)return s;const u=c.projection.name==="globe",p=rn(c.center.lng);for(const m in this._tiles){const _=this._tiles[m];if(n&&_.clearQueryDebugViz(),_.holdingForFade())continue;let x;if(u){const b=_.tileID.canonical;if(b.z===0){const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[0,2*w.indexOf(Math.min(...w))-1]}else{const w=[Math.abs(ct(p,...Kl(b,-1))-p),Math.abs(ct(p,...Kl(b,0))-p),Math.abs(ct(p,...Kl(b,1))-p)];x=[w.indexOf(Math.min(...w))-1]}}else x=[0];for(const b of x){const w=e.containsTile(_,c,i,b);w&&s.push(w)}}return s}getVisibleCoordinates(e){const i=this.getRenderableIds(e).map(n=>this._tiles[n].tileID);for(const n of i)n.projMatrix=this.transform.calculateProjMatrix(n.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(vf(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(i.fadeEndTime!==void 0&&i.fadeEndTime>=Sr.now())return!0}return!1}setFeatureState(e,i,n){this._state.updateState(e=e||"_geojsonTileLayer",i,n)}removeFeatureState(e,i,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",i,n)}getFeatureState(e,i){return this._state.getState(e=e||"_geojsonTileLayer",i)}setDependencies(e,i,n){const s=this._tiles[e];s&&s.setDependencies(i,n)}reloadTilesForDependencies(e,i){for(const n in this._tiles)this._tiles[n].hasDependency(e,i)&&this._reloadTile(+n,"reloading");this._cache.filter(n=>!n.hasDependency(e,i))}_preloadTiles(e,i){if(!this._sourceLoaded){const p=()=>{this._sourceLoaded&&(this._source.off("data",p),this._preloadTiles(e,i))};return void this._source.on("data",p)}const n=new Map,s=Array.isArray(e)?e:[e],c=this.map.painter.terrain,u=this.usedForTerrain&&c?c.getScaledDemTileSize():this._source.tileSize;for(const p of s){const m=p.coveringTiles({tileSize:u,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const _ of m)n.set(_.key,_);this.usedForTerrain&&p.updateElevation(!1)}ai(Array.from(n.values()),(p,m)=>{const _=new Zu(p,this._source.tileSize*p.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(_,x=>{this._source.type==="raster-dem"&&_.dem&&this._backfillDEM(_),m(x,_)})},i)}}function xf(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function vf(t){return t==="raster"||t==="image"||t==="video"||t==="custom"}function Kl(t,e){const i=1<<t.z;return[t.x/i+e,(t.x+1)/i+e]}ds.maxOverzooming=10,ds.maxUnderzooming=3;class Sh{constructor(e,i,n){this._demTile=e,this._dem=this._demTile.dem,this._scale=i,this._offset=n}static create(e,i,n){const s=n||e.findDEMTileFor(i);if(!s||!s.dem)return;const c=s.dem,u=s.tileID,p=1<<i.canonical.z-u.canonical.z;return new Sh(s,s.tileSize/Ze/p,[(i.canonical.x/p-u.canonical.x)*c.dim,(i.canonical.y/p-u.canonical.y)*c.dim])}tileCoordToPixel(e,i){const n=i*this._scale+this._offset[1],s=Math.floor(e*this._scale+this._offset[0]),c=Math.floor(n);return new Le(s,c)}getElevationAt(e,i,n,s){const c=e*this._scale+this._offset[0],u=i*this._scale+this._offset[1],p=Math.floor(c),m=Math.floor(u),_=this._dem;return s=!!s,n?mt(mt(_.get(p,m,s),_.get(p,m+1,s),u-m),mt(_.get(p+1,m,s),_.get(p+1,m+1,s),u-m),c-p):_.get(p,m,s)}getElevationAtPixel(e,i,n){return this._dem.get(e,i,!!n)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Vr(1,e)*this._dem.stride}}class bf{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Tn(Ze,16,0),this.featureIndexArray=new es,this.promoteId=i}insert(e,i,n,s,c,u=0){const p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,s,c,u);const m=this.grid;for(let _=0;_<i.length;_++){const x=i[_],b=[1/0,1/0,-1/0,-1/0];for(let w=0;w<x.length;w++){const S=x[w];b[0]=Math.min(b[0],S.x),b[1]=Math.min(b[1],S.y),b[2]=Math.max(b[2],S.x),b[3]=Math.max(b[3],S.y)}b[0]<Ze&&b[1]<Ze&&b[2]>=0&&b[3]>=0&&m.insert(p,b[0],b[1],b[2],b[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Cu(new uh(this.rawTileData)).layers,this.sourceLayerCoder=new sf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,i,n,s){this.loadVTLayers();const c=e.params||{},u=Ws(c.filter),p=e.tileResult,m=e.transform,_=p.bufferedTilespaceBounds,x=this.grid.query(_.min.x,_.min.y,_.max.x,_.max.y,(M,C,D,U)=>Zd(p.bufferedTilespaceGeometry,M,C,D,U));x.sort(ug);let b=null;m.elevation&&x.length>0&&(b=Sh.create(m.elevation,this.tileID));const w={};let S;for(let M=0;M<x.length;M++){const C=x[M];if(C===S)continue;S=C;const D=this.featureIndexArray.get(C);let U=null;this.loadMatchingFeature(w,D,u,c.layers,c.availableImages,i,n,s,(q,V,$,X=0)=>(U||(U=zn(q,this.tileID.canonical,e.tileTransform)),V.queryIntersectsFeature(p,q,$,U,this.z,e.transform,e.pixelPosMatrix,b,X)))}return w}loadMatchingFeature(e,i,n,s,c,u,p,m,_){const{featureIndex:x,bucketIndex:b,sourceLayerIndex:w,layoutVertexArrayOffset:S}=i,M=this.bucketLayerIDs[b];if(s&&!function(q,V){for(let $=0;$<q.length;$++)if(V.indexOf(q[$])>=0)return!0;return!1}(s,M))return;const C=this.sourceLayerCoder.decode(w),D=this.vtLayers[C].feature(x);if(n.needGeometry){const q=ls(D,!0);if(!n.filter(new v(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!n.filter(new v(this.tileID.overscaledZ),D))return;const U=this.getId(D,C);for(let q=0;q<M.length;q++){const V=M[q];if(s&&s.indexOf(V)<0)continue;const $=u[V];if(!$)continue;let X={};U!==void 0&&m&&(X=m.getState($.sourceLayer||"_geojsonTileLayer",U));const W=Wt({},p[V]);W.paint=wf(W.paint,$.paint,D,X,c),W.layout=wf(W.layout,$.layout,D,X,c);const ce=!_||_(D,$,X,S);if(!ce)continue;const se=new af(D,this.z,this.x,this.y,U);se.layer=W;let me=e[V];me===void 0&&(me=e[V]=[]),me.push({featureIndex:x,feature:se,intersectionZ:ce})}}lookupSymbolFeatures(e,i,n,s,c,u,p,m){const _={};this.loadVTLayers();const x=Ws(c);
vendor: 4,344 bytes, line 8
8for(const b of e)this.loadMatchingFeature(_,{bucketIndex:n,sourceLayerIndex:s,featureIndex:b,layoutVertexArrayOffset:0},x,u,p,m,i);return _}loadFeature(e){const{featureIndex:i,sourceLayerIndex:n}=e;this.loadVTLayers();const s=this.sourceLayerCoder.decode(n),c=this.vtFeatures[s];if(c[i])return c[i];const u=this.vtLayers[s].feature(i);return c[i]=u,u}hasLayer(e){for(const i of this.bucketLayerIDs)for(const n of i)if(e===n)return!0;return!1}getId(e,i){let n=e.id;if(this.promoteId){const s=typeof this.promoteId=="string"?this.promoteId:this.promoteId[i];s!=null&&(n=e.properties[s]),typeof n=="boolean"&&(n=Number(n))}return n}}function wf(t,e,i,n,s){return pt(t,(c,u)=>{const p=e instanceof F?e.get(u):null;return p&&p.evaluate?p.evaluate(i,n,s):p})}function ug(t,e){return e-t}Ue(bf,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class Tf{constructor(e,i){this.width=e,this.height=i,this.nextRow=0,this.image=new Pn({width:e,height:i}),this.positions={},this.uploaded=!1}getDash(e,i){const n=this.getKey(e,i);return this.positions[n]}trim(){const e=this.width,i=this.height=Tr(this.nextRow);this.image.resize({width:e,height:i})}getKey(e,i){return e.join(",")+i}getDashRanges(e,i,n){const s=[];let c=e.length%2==1?-e[e.length-1]*n:0,u=e[0]*n,p=!0;s.push({left:c,right:u,isDash:p,zeroLength:e[0]===0});let m=e[0];for(let _=1;_<e.length;_++){p=!p;const x=e[_];c=m*n,m+=x,u=m*n,s.push({left:c,right:u,isDash:p,zeroLength:x===0})}return s}addRoundDash(e,i,n){const s=i/2;for(let c=-n;c<=n;c++){const u=this.width*(this.nextRow+n+c);let p=0,m=e[p];for(let _=0;_<this.width;_++){_/m.right>1&&(m=e[++p]);const x=Math.abs(_-m.left),b=Math.abs(_-m.right),w=Math.min(x,b);let S;const M=c/n*(s+1);if(m.isDash){const C=s-Math.abs(M);S=Math.sqrt(w*w+C*C)}else S=s-Math.sqrt(w*w+M*M);this.image.data[u+_]=Math.max(0,Math.min(255,S+128))}}}addRegularDash(e,i){for(let m=e.length-1;m>=0;--m){const _=e[m],x=e[m+1];_.zeroLength?e.splice(m,1):x&&x.isDash===_.isDash&&(x.left=_.left,e.splice(m,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 c=this.width*this.nextRow;let u=0,p=e[u];for(let m=0;m<this.width;m++){m/p.right>1&&(p=e[++u]);const _=Math.abs(m-p.left),x=Math.abs(m-p.right),b=Math.min(_,x);this.image.data[c+m]=Math.max(0,Math.min(255,(p.isDash?b:-b)+i+128))}}addDash(e,i){const n=this.getKey(e,i);if(this.positions[n])return this.positions[n];const s=i==="round",c=s?7:0,u=2*c+1;if(this.nextRow+u>this.height)return Ut("LineAtlas out of space"),null;e.length===0&&e.push(1);let p=0;for(let x=0;x<e.length;x++)e[x]<0&&(Ut("Negative value is found in line dasharray, replacing values with 0"),e[x]=0),p+=e[x];if(p!==0){const x=this.width/p,b=this.getDashRanges(e,this.width,x);s?this.addRoundDash(b,x,c):this.addRegularDash(b,i==="square"?.5*x:0)}const m=this.nextRow+c;this.nextRow+=u;const _={tl:[m,c],br:[p,0]};return this.positions[n]=_,_}}Ue(Tf,"LineAtlas");const Ef=1*jr;class Sf{constructor(e){const i={},n=[];for(const p in e){const m=e[p],_=i[p]={};for(const x in m.glyphs){const b=m.glyphs[+x];if(!b||b.bitmap.width===0||b.bitmap.height===0)continue;const w=b.metrics.localGlyph?Ef:1,S={x:0,y:0,w:b.bitmap.width+2*w,h:b.bitmap.height+2*w};n.push(S),_[x]=S}}const{w:s,h:c}=Du(n),u=new Pn({width:s||1,height:c||1});for(const p in e){const m=e[p];for(const _ in m.glyphs){const x=m.glyphs[+_];if(!x||x.bitmap.width===0||x.bitmap.height===0)continue;const b=i[p][_],w=x.metrics.localGlyph?Ef:1;Pn.copy(x.bitmap,u,{x:0,y:0},{x:b.x+w,y:b.y+w},x.bitmap)}}this.image=u,this.positions=i}}Ue(Sf,"GlyphAtlas");class dg{constructor(e){this.tileID=new Pi(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=us(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,i,n,s,c){this.status="parsing",this.data=e,this.collisionBoxArray=new Mt;
8const u=new sf(Object.keys(e.layers).sort()),p=new bf(this.tileID,this.promoteId);p.bucketLayerIDs=[];const m={},_=new Tf(256,256),x={featureIndex:p,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:_,availableImages:n},b=i.familiesBySource[this.source];for(const X in b){const W=e.layers[X];if(!W)continue;let ce=!1,se=!1;for(const ue of b[X])ue[0].type==="symbol"?ce=!0:se=!0;if(this.isSymbolTile===!0&&!ce||this.isSymbolTile===!1&&!se)continue;W.version===1&&Ut(`Vector tile source "${this.source}" layer "${X}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const me=u.encode(X),Ee=[];for(let ue=0;ue<W.length;ue++){const ye=W.feature(ue),xe=p.getId(ye,X);Ee.push({feature:ye,id:xe,index:ue,sourceLayerIndex:me})}for(const ue of b[X]){const ye=ue[0];this.isSymbolTile!==void 0&&ye.type==="symbol"!==this.isSymbolTile||ye.minzoom&&this.zoom<Math.floor(ye.minzoom)||ye.maxzoom&&this.zoom>=ye.maxzoom||ye.visibility!=="none"&&(Ku(ue,this.zoom,n),(m[ye.id]=ye.createBucket({index:p.bucketLayerIDs.length,layers:ue,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:me,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(Ee,x,this.tileID.canonical,this.tileTransform),p.bucketLayerIDs.push(ue.map(xe=>xe.id)))}}let w,S,M,C;_.trim();const D={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},U=()=>{if(w)return c(w);if(S&&M&&C){const X=new Sf(S),W=new Pp(M,C);for(const ce in m){const se=m[ce];se instanceof _o?(Ku(se.layers,this.zoom,n),F_(se,S,X.positions,M,W.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):se.hasPattern&&(se instanceof lh||se instanceof rh||se instanceof Fl)&&(Ku(se.layers,this.zoom,n),se.addFeatures(x,this.tileID.canonical,W.patternPositions,n,this.tileTransform))}this.status="done",c(null,{buckets:Zr(m).filter(ce=>!ce.isEmpty()),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:X.image,lineAtlas:_,imageAtlas:W,glyphMap:this.returnDependencies?S:null,iconMap:this.returnDependencies?M:null,glyphPositions:this.returnDependencies?X.positions:null})}},q=pt(x.glyphDependencies,X=>Object.keys(X).map(Number));Object.keys(q).length?s.send("getGlyphs",{uid:this.uid,stacks:q},(X,W)=>{w||(w=X,S=W,U())},void 0,!1,D):S={};const V=Object.keys(x.iconDependencies);V.length?s.send("getImages",{icons:V,source:this.source,tileID:this.tileID,type:"icons"},(X,W)=>{w||(w=X,M=W,U())},void 0,!1,D):M={};const $=Object.keys(x.patternDependencies);$.length?s.send("getImages",{icons:$,source:this.source,tileID:this.tileID,type:"patterns"},(X,W)=>{w||(w=X,C=W,U())},void 0,!1,D):C={},U()}}function Ku(t,e,i){const n=new v(e);for(const s of t)s.recalculate(n,i)}class Mf{constructor(e){this.entries={},this.scheduler=e}request(e,i,n,s){const c=this.entries[e]=this.entries[e]||{callbacks:[]};if(c.result){const[u,p]=c.result;return this.scheduler?this.scheduler.add(()=>{s(u,p)},i):s(u,p),()=>{}}return c.callbacks.push(s),c.cancel||(c.cancel=n((u,p)=>{c.result=[u,p];for(const m of c.callbacks)this.scheduler?this.scheduler.add(()=>{m(u,p)},i):m(u,p);setTimeout(()=>delete this.entries[e],3e3)})),()=>{c.result||(c.callbacks=c.callbacks.filter(u=>u!==s),c.callbacks.length||(c.cancel(),delete this.entries[e]))}}}function Af(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},s=>{const c=Gn(t.request,(u,p,m,_)=>{u?s(u):p&&s(null,{vectorTile:i?void 0:new Cu(new uh(p)),rawData:p,cacheControl:m,expires:_})});return()=>{c.cancel(),s()}},e)}const If=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yu{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);const c=If[15&n];if(!c)throw new Error("Unrecognized array type.");const[u]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Yu(p,u,c,e)}constructor(e,i=64,n=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const c=If.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,m=(8-p%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${n}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+p+m),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+m,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+c]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ju(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:u,nodeSize:p}=this,m=[0,c.length-1,0],_=[];for(;m.length;){const x=m.pop()||0,b=m.pop()||0,w=m.pop()||0;if(b-w<=p){for(let D=w;D<=b;D++){const U=u[2*D],q=u[2*D+1];U>=e&&U<=n&&q>=i&&q<=s&&_.push(c[D])}continue}const S=w+b>>1,M=u[2*S],C=u[2*S+1];M>=e&&M<=n&&C>=i&&C<=s&&_.push(c[S]),(x===0?e<=M:i<=C)&&(m.push(w),m.push(S-1),m.push(1-x)),(x===0?n>=M:s>=C)&&(m.push(S+1),m.push(b),m.push(1-x))}return _}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:c,nodeSize:u}=this,p=[0,s.length-1,0],m=[],_=n*n;for(;p.length;){const x=p.pop()||0,b=p.pop()||0,w=p.pop()||0;if(b-w<=u){for(let D=w;D<=b;D++)zf(c[2*D],c[2*D+1],e,i)<=_&&m.push(s[D]);continue}const S=w+b>>1,M=c[2*S],C=c[2*S+1];zf(M,C,e,i)<=_&&m.push(s[S]),(x===0?e-n<=M:i-n<=C)&&(p.push(w),p.push(S-1),p.push(1-x)),(x===0?e+n>=M:i+n>=C)&&(p.push(S+1),p.push(b),p.push(1-x))}return m}}function Ju(t,e,i,n,s,c){if(s-n<=i)return;const u=n+s>>1;Cf(t,e,u,n,s,c),Ju(t,e,i,n,u-1,1-c),Ju(t,e,i,u+1,s,1-c)}function Cf(t,e,i,n,s,c){for(;s>n;){if(s-n>600){const _=s-n+1,x=i-n+1,b=Math.log(_),w=.5*Math.exp(2*b/3),S=.5*Math.sqrt(b*w*(_-w)/_)*(x-_/2<0?-1:1);Cf(t,e,i,Math.max(n,Math.floor(i-x*w/_+S)),Math.min(s,Math.floor(i+(_-x)*w/_+S)),c)}const u=e[2*i+c];let p=n,m=s;for(Yl(t,e,n,i),e[2*s+c]>u&&Yl(t,e,n,s);p<m;){for(Yl(t,e,p,m),p++,m--;e[2*p+c]<u;)p++;for(;e[2*m+c]>u;)m--}e[2*n+c]===u?Yl(t,e,n,m):(m++,Yl(t,e,m,s)),m<=i&&(n=m+1),i<=m&&(s=m-1)}}function Yl(t,e,i,n){Qu(t,i,n),Qu(e,2*i,2*n),Qu(e,2*i+1,2*n+1)}function Qu(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function zf(t,e,i,n){const s=t-i,c=e-n;return s*s+c*c}a.ARRAY_TYPE=Wi,a.AUTH_ERR_MSG=H,a.Aabb=zi,a.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},un(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=Er()?t:Se,this.scheduler
8=new og}send(t,e,i,n,s=!1,c){const u=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=c,this.callbacks[u]=i);const p=Vn(this.globalScope)?void 0:[];return this.target.postMessage({id:u,type:t,hasCallback:!!i,targetMapId:n,mustQueue:s,sourceMapId:this.mapId,data:ao(e,p)},p),{cancel:()=>{i&&delete this.callbacks[u],this.target.postMessage({id:u,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if(e.type==="<cancel>"){const n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n.cancel()}else if(e.mustQueue||Er()){const n=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add(()=>this.processTask(i,e),n&&n.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if(e.type==="<response>"){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(En(e.error)):i(null,En(e.data)))}else{const i=Vn(this.globalScope)?void 0:[],n=e.hasCallback?(c,u)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:c?ao(c):null,data:ao(u,i)},i)}:c=>{},s=En(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,s,n);else if(this.parent.getWorkerSource){const c=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,c[0],s.source)[c[1]](s,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.CanonicalTileID=ah,a.Color=Zt,a.ColorMode=an,a.CullFaceMode=Gr,a.DEMData=Eh,a.DataConstantProperty=I,a.DedupedRequest=Mf,a.DepthMode=ya,a.EXTENT=Ze,a.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<<i,s=Math.floor(t.x),c=Math.floor((t.x-s)*n),u=Math.floor(t.y*n),p=this.findDEMTileFor(new Pi(i,s,i,c,u));return!(!p||!p.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){if(this.isUsingMockSource())return null;e==null&&(e=null);const n=this._source();if(!n||t.y<0||t.y>1)return e;const s=n.getSource().maxzoom,c=1<<s,u=Math.floor(t.x),p=t.x-u,m=new Pi(s,u,s,Math.floor(p*c),Math.floor(t.y*c)),_=this.findDEMTileFor(m);if(!_||!_.dem)return e;const x=_.dem,b=1<<_.tileID.canonical.z,w=(p*b-_.tileID.canonical.x)*x.dim,S=(t.y*b-_.tileID.canonical.y)*x.dim,M=Math.floor(w),C=Math.floor(S);return(i?this.exaggeration():1)*mt(mt(x.get(M,C),x.get(M,C+1),S-C),mt(x.get(M+1,C),x.get(M+1,C+1),S-C),w-M)}getAtTileOffset(t,e,i){const n=1<<t.canonical.z;return this.getAtPointOrZero(new na(t.wrap+(t.canonical.x+e/Ze)/n,(t.canonical.y+i/Ze)/n))}getAtTileOffsetFunc(t,e,i,n){return s=>{const c=this.getAtTileOffset(t,s.x,s.y),u=n.upVector(t.canonical,s.x,s.y);return nr(u,u,c*n.upVectorScale(t.canonical,e,i).metersToTile),u}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const s=Sh.create(this,t,n);return!!s&&(e.forEach(c=>{c[2]=this.exaggeration()*s.getElevationAt(c[0],c[1],i)}),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,s=1<<t.canonical.z-n.canonical.z;let c=t.canonical.x/s-n.canonical.x,u=t.canonical.y/s-n.canonical.y,p=0;for(let m=0;m<t.canonical.z-n.canonical.z&&!i.leaves[p];m++){c*=2,u*=2;const _=2*Math.floor(u)+Math.floor(c);p=i.childOffsets[p]+_,c%=1,u%=1}return{min:this.exaggeration()*i.minimums[p],max:this.exaggeration()*i.maximums[p]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},a.ErrorEvent=Mr,a.EvaluationParameters=v,a.Event=_n,a.Evented=Co,a.FillExtrusionBucket=Fl,a.Frustum=su,a.FrustumCorners=ou,a.GLOBE_RADIUS=en,a.GLOBE_SCALE_MATCH_LATITUDE=45,a.GLOBE_ZOOM_THRESHOLD_MAX=Id,a.GLOBE_ZOOM_THRESHOLD_MIN=au,a.GlobeSharedBuffers=class{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const t of this._wireframeSegments)t.destroy()}}_fillGridMeshWithLods(t,e){const i=new Te,n=new je,s=[],c=t+1+2,u=e[0]+1,p=e[0]+1+(1+e.length),m=(_,x,b)=>{let w=_===c-1?_-2:_===0?_:_-1;return w+=b?24575:0,[w,x]};for(let _=0;_<c;++_)i.emplaceBack(...m(_,0,!0));for(let _=0;_<u;++_)for(let x=0;x<c;++x)i.emplaceBack(...m(x,_,(x===0||x===c-1)&&!0));for(let _=0;_<e.length;++_){const x=e[_];for(let b=0;b<c;++b)i.emplaceBack(...m(b,x,!0))}for(let _=0;_<e.length;++_){const x=n.length,b=e[_]+1+2,w=new je;for(let C=0;C<b-1;C++){const D=C===b-2,U=D?c*(p-e.length+_-C):c;for(let q=0;q<c-1;q++){const V=C*c+q;C===0||D||q===0||q===c-2?(w.emplaceBack(V+1,V,V+U),w.emplaceBack(V+U,V+U+1,V+1)):(n.emplaceBack(V+1,V,V+U),n.emplaceBack(V+U,V+U+1,V+1))}}const S=Yt.simpleSegment(0,x,i.length,n.length-x);for(let C=0;C<w.uint16.length;C+=3)n.emplaceBack(w.uint16[C],w.uint16[C+1],w.uint16[C+2]);const M=Yt.simpleSegment(0,x,i.length,n.length-x);s.push({withoutSkirts:S,withSkirts:M})}return{vertices:i,indices:n,segments:s}}_createGrid(t){const e=this._fillGridMeshWithLods(ss,Il);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,Al.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new je;for(let s=0;s<=ss;s++)e.emplaceBack(0,s+1,s+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const i=new St,n=new St;this._poleSegments=[];for(let s=0,c=0;s<au;s++){const u=360/(1<<s);i.emplaceBack(0,-en,0,.5,0),n.emplaceBack(0,-en,0,.5,1);for(let p=0;p<=ss;p++){const m=p/ss,_=mt(0,u,m),[x,b,w]=ta(om,sm,_,en);i.emplaceBack(x,b,w,m,0),n.emplaceBack(x,b,w,m,1)}this._poleSegments.push(Yt.simpleSegment(c,0,66,64)),c+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(i,Md,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(n,Md,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}getWirefameBuffers(t,e){if(!this._wireframeSegments){const i=new ui,n=ss,s=n+1+2,c=1;this._wireframeSegments=[];for(let u=0,p=0;u<Il.length;u++){const m=Il[u];for(let x=c;x<m+c;x++)for(let b=c;b<n+c;b++){const w=x*s+b;i.emplaceBack(w,w+1),i.emplaceBack(w,w+s),i.emplaceBack(w,w+s+1)}const _=m*n*3;this._wireframeSegments.push(Yt.simpleSegment(0,p,(m+1)*s,_)),p+=_}this._wireframeIndexBuffer=t.createIndexBuffer(i)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[e]]}},a.GlyphManager=pa,a.ImagePosition=Lu,a.KDBush=Yu,a.LivePerformanceUtils=Ah,a.LngLat=At,a.LngLatBounds=uo,a.LocalGlyphMode=Ou,a.MAX_MERCATOR_LATITUDE=wi,a.MercatorCoordinate=na,a.ONE_EM=mi,a.OverscaledTileID=Pi,a.PerformanceMarkers=$n,a.Point=Le,a.Properties=j,a.RGBAImage=Xi,a.Ray=nu,a.RequestManager=class{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let e="";for(let i=0;i<10;i++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Ln,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!ee(t))return t;const i=ke(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}
8normalizeSourceURL(t,e,i,n){if(!ee(t))return t;const s=ke(t);return s.path=`/v4/${s.authority}.json`,s.params.push("secure"),i&&s.params.push(`language=${i}`),n&&s.params.push(`worldview=${n}`),this._makeAPIURL(s,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const s=ke(t);return ee(t)?(s.path=`/styles/v1${s.path}/sprite${e}${i}`,this._makeAPIURL(s,this._customAccessToken||n)):(s.path+=`${e}${i}`,Ie(s))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ee(t))return t;const n=ke(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&n.authority!=="raster"&&i===512?"@2x":""}${ht.supported?".webp":"$1"}`),n.authority==="raster"?n.path=`/${it.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${it.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||function(c){for(const u of c){const p=u.match(/^access_token=(.*)$/);if(p)return p[1]}return null}(n.params)||it.ACCESS_TOKEN;return it.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(t,e){const i=ke(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${it.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${it.TILE_URL_VERSION}/`,"")}`;let s=i.params;return e&&(s=s.filter(c=>!c.match(/^access_token=/))),s.length&&(n+=`?${s.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&ee(e),n=[];for(const s of t.tiles||[])ne(s)?n.push(this.canonicalizeTileURL(s,i)):n.push(s);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=ke(it.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,t.protocol==="http"){const s=t.params.indexOf("secure");s>=0&&t.params.splice(s,1)}if(n.path!=="/"&&(t.path=`${n.path}${t.path}`),!it.REQUIRE_ACCESS_TOKEN)return Ie(t);if(e=e||it.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if(e[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter(s=>s.indexOf("access_token")===-1),t.params.push(`access_token=${e||""}`),Ie(t)}},a.ResourceType=pn,a.SegmentVector=Yt,a.SourceCache=ds,a.StencilMode=Wu,a.StructArrayLayout1ui2=qi,a.StructArrayLayout2f1f2i16=qe,a.StructArrayLayout2i4=Te,a.StructArrayLayout2ui4=ui,a.StructArrayLayout3f12=ot,a.StructArrayLayout3ui6=je,a.StructArrayLayout4i8=ge,a.StructArrayLayout5f20=St,a.Texture=Hl,a.Tile=Zu,a.Transitionable=A,a.Uniform1f=$c,a.Uniform1i=class extends An{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},a.Uniform2f=class extends An{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},a.Uniform3f=class extends An{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},a.Uniform4f=cd,a.UniformColor=hd,a.UniformMatrix2f=class extends An{constructor(t){super(t),this.current=Gf}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<4;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}},a.UniformMatrix3f=class extends An{constructor(t){super(t),this.current=jf}set(t,e,i){if(this.fetchUniformLocation(t,e)){for(let n=0;n<9;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},a.UniformMatrix4f=class extends An{constructor(t){super(t),this.current=Nf}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let n=1;n<16;n++)if(i[n]!==this.current[n]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},a.UnwrappedTileID=_p,a.ValidationError=Fe,a.VectorTileFeature=oh,a.VectorTileWorkerSource=class extends Co{constructor(t,e,i,n,s){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=s||Af,this.loading={},this.loaded={},this.deduped=new Mf(t.scheduler),this.isSpriteLoaded=n,this.scheduler
8=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,s=n&&n.collectResourceTiming,c=this.loading[i]=new dg(t);c.abort=this.loadVectorData(t,(u,p)=>{const m=!this.loading[i];if(delete this.loading[i],m||u||!p)return c.status="done",m||(this.loaded[i]=c),e(u);const _=p.rawData,x={};p.expires&&(x.expires=p.expires),p.cacheControl&&(x.cacheControl=p.cacheControl),c.vectorTile=p.vectorTile||new Cu(new uh(_));const b=()=>{c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,(w,S)=>{if(w||!S)return e(w);const M={};if(s){const C=Ea(n);C.length>0&&(M.resourceTiming=JSON.parse(JSON.stringify(C)))}e(null,Wt({rawTileData:_.slice(0)},S,x,M))})};this.isSpriteLoaded?b():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(b,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):b()}),this.loaded=this.loaded||{},this.loaded[i]=c})}reloadTile(t,e){const i=this.loaded,n=t.uid,s=this;if(i&&i[n]){const c=i[n];c.showCollisionBoxes=t.showCollisionBoxes,c.enableTerrain=!!t.enableTerrain,c.projection=t.projection,c.tileTransform=us(t.tileID.canonical,t.projection);const u=(p,m)=>{const _=c.reloadCallback;_&&(delete c.reloadCallback,c.parse(c.vectorTile,s.layerIndex,this.availableImages,s.actor,_)),e(p,m)};c.status==="parsing"?c.reloadCallback=u:c.status==="done"&&(c.vectorTile?c.parse(c.vectorTile,this.layerIndex,this.availableImages,this.actor,u):u())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},a.WritingMode=sr,a.ZoomDependentExpression=Wo,a.add=Cn,a.addDynamicAttributes=bh,a.adjoint=function(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=e[4],p=e[5],m=e[6],_=e[7],x=e[8];return t[0]=u*x-p*_,t[1]=s*_-n*x,t[2]=n*p-s*u,t[3]=p*m-c*x,t[4]=i*x-s*m,t[5]=s*c-i*p,t[6]=c*_-u*m,t[7]=n*m-i*_,t[8]=i*u-n*c,t},a.asyncAll=ai,a.bezier=wo,a.bindAll=un,a.boundsAttributes=cf,a.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;n<t.length;n++){const s=oi(n-1,-1,t.length-1),c=oi(n+1,-1,t.length-1),u=t[n],p=t[c],m=t[s].sub(u).unit(),_=p.sub(u).unit(),x=_.angleWithSep(m.x,m.y),b=m.add(_).unit().mult(-1*e/Math.sin(x/2));i.push(u.add(b))}return i},a.cacheEntryPossiblyAdded=function(t){Ao++,Ao>bs&&(t.getActor().send("enforceCacheSizeLimit",vs),Ao=0)},a.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:n}=t.point,s=Dd(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return rs(s,s,hu(tn(e)))},a.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:s}=t._center;return Dd(e,i,t.worldSize,n,s)},a.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/Vr(1,t.center.lat),n=Fr(new Float64Array(16));return bl(n,n,[t.point.x,t.point.y,0]),ns(n,n,[i,i,e]),Float32Array.from(n)},a.circumferenceAtLatitude=du,a.clamp=ct,a.clearTileCache=function(t){if(!Mo())return;const e=Se.caches.delete(Nn);t&&e.catch(t).then(()=>t())},a.clipLine=$p,a.clone=function(t){var e=new Wi(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},a.clone$1=Li,a.collisionCircleLayout=h_,a.config=it,a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.create=function(){var t=new Wi(16);return Wi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},a.create$1=pd,a.createExpression=no,a.createLayout=te,a.createStyleLayer=function(t){return t.type==="custom"?new tg(t):new rg[t.type](t)},a.cross=ru,a.degToRad=dt,a.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},a.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},a.dot=fr,a.earthRadius=Pl,a.ease=gs,a.easeCubicInOut=_s,a.ecefToLatLng=function([t,e,i]){const n=Math.hypot(t,e,i),s=Math.atan2(t,i),c=.5*Math.PI-Math.acos(-e/n);return new At(si(s),si(c))},a.emitValidationErrors=Fc,a.endsWith=Fn,a.enforceCacheSizeLimit=function(t){dn(),Ni&&Ni.then(e=>{e.keys().then(i=>{for(let n=0;n<i.length-t;n++)e.delete(i[n])})})},a.evaluateSizeForFeature=ch,a.evaluateSizeForZoom=ca,a.evaluateVariableOffset=Hp,a.evented=d,a.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},a.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},a.exported=Sr,a.exported$1=ht,a.extend=Wt,a.extend$1=Ar,a.fillExtrusionHeightLift=pp,a.filterObject=Un,a.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},a.fromQuat=function(t,e){var i=e[0],n=e[1],s=e[2],c=e[3],u=i+i,p=n+n,m=s+s,_=i*u,x=n*u,b=n*p,w=s*u,S=s*p,M=s*m,C=c*u,D=c*p,U=c*m;return t[0]=1-b-M,t[1]=x+U,t[2]=w-D,t[3]=0,t[4]=x-U,t[5]=1-_-M,t[6]=S+C,t[7]=0,t[8]=w+D,t[9]=S-C,t[10]=1-_-b,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},a.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},a.fromScaling=md,a.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return Ta[e]}
8,a.getAABBPointSquareDist=function(t,e,i){let n=0;for(let s=0;s<2;++s){const c=i?i[s]:0;t[s]>c&&(n+=(t[s]-c)*(t[s]-c)),e[s]<c&&(n+=(c-e[s])*(c-e[s]))}return n},a.getAnchorAlignment=Bu,a.getAnchorJustification=Uu,a.getBounds=function(t){let e=1/0,i=1/0,n=-1/0,s=-1/0;for(const c of t)e=Math.min(e,c.x),i=Math.min(i,c.y),n=Math.max(n,c.x),s=Math.max(s,c.y);return{min:new Le(e,i),max:new Le(n,s)}},a.getColumn=Xr,a.getDefaultExportFromCjs=Ji,a.getGridMatrix=function(t,e,i,n){const s=e.getNorth(),c=e.getSouth(),u=e.getWest(),p=e.getEast(),m=1<<t.z,_=p-u,x=s-c,b=_/ss,w=-x/Il[i],S=[0,b,0,w,0,0,s,u,0];if(t.z>0){const M=180/n;fd(S,S,[M/_+1,0,0,0,M/x+1,0,-.5*M/b,.5*M/w,1])}return S[2]=m,S[5]=t.x,S[8]=t.y,S},a.getImage=G,a.getJSON=function(t,e){return mn(Wt(t,{type:"json"}),e)},a.getLatitudinalLod=function(t){const e=wi-5;t=ct(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(dt(t))),3);return Math.round(i*(Il.length-1))},a.getMapSessionAPI=li,a.getPerformanceMeasurement=Ea,a.getProjection=nf,a.getRTLTextPluginStatus=f,a.getReferrer=fn,a.getTilePoint=function(t,{x:e,y:i},n=0){return new Le(((e-n)*t.scale-t.x)*Ze,(i*t.scale-t.y)*Ze)},a.getTileVec3=function(t,e,i=0){return ea(((e.x-i)*t.scale-t.x)*Ze,(e.y*t.scale-t.y)*Ze,Od(e.z,e.y))},a.getVideo=function(t,e){const i=Se.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let n=0;n<t.length;n++){const s=Se.document.createElement("source");ws(t[n])||(i.crossOrigin="Anonymous"),s.src=t[n],i.appendChild(s)}return{cancel:()=>{}}},a.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=Fr(new Float64Array(16));return rs(i,t.pixelMatrix,t.globeMatrix),qt(e,e,i),new Le(e[0],e[1])},a.globeDenormalizeECEF=hu,a.globeECEFOrigin=function(t,e){const i=[0,0,0];return qt(i,i,zl(tn(e.canonical))),qt(i,i,t),i},a.globeMetersToEcef=Wc,a.globeNormalizeECEF=zl,a.globePixelsToTileUnits=function(t,e){return Ze/(512*Math.pow(2,t))*Hc(tn(e))},a.globePoleMatrixForTile=function(t,e,i){const n=Fr(new Float64Array(16)),s=(e/(1<<t)-.5)*Math.PI*2;return qc(n,i.globeMatrix,s),Float32Array.from(n)},a.globeTileBounds=tn,a.globeTiltAtLngLat=Ld,a.globeToMercatorTransition=ra,a.globeUseCustomAntiAliasing=function(t,e,i){const n=ra(i.zoom),s=t.style.map._antialias,c=!!e.extStandardDerivatives,u=e.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return n===0&&!s&&!u&&c},a.identity=Fr,a.identity$1=Td,a.invert=Qh,a.isFullscreen=function(){return!!Se.document.fullscreenElement||!!Se.document.webkitFullscreenElement},a.isLngLatBehindGlobe=uu,a.isMapAuthenticated=function(t){return Ti.has(t)},a.isMapboxURL=ee,a.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!Vn(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},a.latFromMercatorY=bi,a.latLngToECEF=ia,a.len=Jf,a.length=wl,a.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},a.lngFromMercatorX=or,a.loadVectorTile=Af,a.makeRequest=mn,a.mapValue=function(t,e,i,n,s){return ct((t-e)/(i-e)*(s-n)+n,n,s)},a.mercatorScale=Fd,a.mercatorXfromLng=rn,a.mercatorYfromLat=nn,a.mercatorZfromAltitude=Vr,a.mul=Kf,a.mul$1=Yf,a.multiply=rs,a.multiply$1=fd,a.multiply$2=yd,a.nextPowerOfTwo=Tr,a.normalize=Ci,a.normalize$1=Qf,a.normalize$2=bd,a.number=mt,a.ortho=function(t,e,i,n,s,c,u){var p=1/(e-i),m=1/(n-s),_=1/(c-u);return t[0]=-2*p,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*m,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*_,t[11]=0,t[12]=(e+i)*p,t[13]=(s+n)*m,t[14]=(u+c)*_,t[15]=1,t},a.pbf=Tp,a.perspective=function(t,e,i,n,s){var c,u=1/Math.tan(e/2);return t[0]=u/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,s!=null&&s!==1/0?(t[10]=(s+n)*(c=1/(n-s)),t[14]=2*s*n*c):(t[10]=-1,t[14]=-2*n),t},a.pick=function(t,e){const i={};for(let n=0;n<e.length;n++){const s=e[n];s in t&&(i[s]=t[s])}return i},a.plugin=y,a.pointGeometry=hn,a.polesInViewport=function(t){const e=Fr(new Float64Array(16));rs(e,t.pixelMatrix,t.globeMatrix);const i=[0,mr,0],n=[0,_r,0];return qt(i,i,e),qt(n,n,e),[i[0]>0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!uu(t,new At(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!uu(t,new At(t.center.lat,-90))]},a.polygonContainsPoint=cs,a.polygonIntersectsBox=Zd,a.polygonIntersectsPolygon=Nd,a.polygonizeBounds=function(t,e,
vendor: 7,125 bytes, line 8
8i=0,n=!0){const s=new Le(i,i),c=t.sub(s),u=e.add(s),p=[c,new Le(u.x,c.y),u,new Le(c.x,u.y)];return n&&p.push(c.clone()),p},a.posAttributes=Al,a.postMapLoadEvent=Xt,a.postPerformanceEvent=ri,a.postTurnstileEvent=ft,a.potpack=Du,a.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},a.radToDeg=si,a.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],a.registerForPluginStateChange=function(t){return t({pluginStatus:l,pluginURL:r}),d.on("pluginStateChange",t),t},a.removeAuthState=function(t){Ti.delete(t)},a.renderColorRamp=vu,a.resample=Ud,a.rotateX=eu,a.rotateX$1=Ed,a.rotateY=qc,a.rotateY$1=Sd,a.rotateZ=function(t,e,i){var n=Math.sin(i),s=Math.cos(i),c=e[0],u=e[1],p=e[2],m=e[3],_=e[4],x=e[5],b=e[6],w=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=c*s+_*n,t[1]=u*s+x*n,t[2]=p*s+b*n,t[3]=m*s+w*n,t[4]=_*s-c*n,t[5]=x*s-u*n,t[6]=b*s-p*n,t[7]=w*s-m*n,t},a.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],s=e[1],c=e[2],u=e[3],p=Math.sin(i),m=Math.cos(i);return t[0]=n*m+s*p,t[1]=s*m-n*p,t[2]=c*m+u*p,t[3]=u*m-c*p,t},a.scale=ns,a.scale$1=vd,a.scale$2=nr,a.scaleAndAdd=Sl,a.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},a.setCacheLimits=function(t,e){vs=t,bs=e},a.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},a.setRTLTextPlugin=function(t,e,i=!1){if(l===_l||l===gl||l===yl)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=Sr.resolveURL(t),l=_l,lo=e,h(),i||g()},a.smoothstep=Bn,a.spec=fe,a.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},a.storeAuthState=function(t,e){e?Ti.add(t):Ti.delete(t)},a.sub=Ur,a.subtract=iu,a.symbolSize=u_,a.tileAABB=function(t,e,i,n,s,c,u,p,m){if(m.name==="globe")return nm(t,e,new ah(i,n,s));const _=us({z:i,x:n,y:s},m);return new zi([(c+_.x/_.scale)*e,e*(_.y/_.scale),u],[(c+_.x2/_.scale)*e,e*(_.y2/_.scale),p])},a.tileCornersToBounds=Xc,a.tileTransform=us,a.transformMat3=function(t,e,i){var n=e[0],s=e[1],c=e[2];return t[0]=n*i[0]+s*i[3]+c*i[6],t[1]=n*i[1]+s*i[4]+c*i[7],t[2]=n*i[2]+s*i[5]+c*i[8],t},a.transformMat4=qt,a.transformMat4$1=os,a.transformQuat=xd,a.transitionTileAABBinECEF=zd,a.translate=bl,a.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],s=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=s}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},a.triggerPluginCompletionEvent=o,a.uniqueId=On,a.updateGlobeVertexNormal=function(t,e,i,n,s){const c=5*e+2;t.float32[c+0]=i,t.float32[c+1]=n,t.float32[c+2]=s},a.validateCustomStyleLayer=function(t){const e=[],i=t.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),t.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},a.validateFilter=t=>Zi(Jo(t)),a.validateFog=t=>Zi(Rc(t)),a.validateLayer=t=>Zi(Pc(t)),a.validateLight=t=>Zi(Lc(t)),a.validateSource=t=>Zi(Dc(t)),a.validateStyle=Oc,a.validateTerrain=t=>Zi(ul(t)),a.values=Zr,a.vectorTile=nh,a.version=vr,a.warnOnce=Ut,a.window=Se,a.wrap=oi}),Mh(["./shared"],function(a){function Se(Z){if(typeof Z=="number"||typeof Z=="boolean"||typeof Z=="string"||Z==null)return JSON.stringify(Z);if(Array.isArray(Z)){let P="[";for(const G of Z)P+=`${Se(G)},`;return`${P}]`}let z="{";for(const P of Object.keys(Z).sort())z+=`${P}:${Se(Z[P])},`;return`${z}}`}function vr(Z){let z="";for(const P of a.refProperties)z+=`/${Se(Z[P])}`;return z}class Yi{constructor(z){this.keyCache={},z&&this.replace(z)}replace(z){this._layerConfigs={},this._layers={},this.update(z,[])}update(z,P){for(const H of z)this._layerConfigs[H.id]=H,(this._layers[H.id]=a.createStyleLayer(H)).compileFilter(),this.keyCache[H.id]&&delete this.keyCache[H.id];for(const H of P)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const G=function(H,ee){const ne={};for(let Q=0;Q<H.length;Q++){const de=ee&&ee[H[Q].id]||vr(H[Q]);ee&&(ee[H[Q].id]=de);let Pe=ne[de];Pe||(Pe=ne[de]=[]),Pe.push(H[Q])}const re=[];for(const Q in ne)re.push(ne[Q]);return re}(a.values(this._layerConfigs),this.keyCache);for(const H of G){const ee=H.map(ke=>this._layers[ke.id]),ne=ee[0];if(ne.visibility==="none")continue;const re=ne.source||"";let Q=this.familiesBySource[re];Q||(Q=this.familiesBySource[re]={});const de=ne.sourceLayer||"_geojsonTileLayer";let Pe=Q[de];Pe||(Pe=Q[de]=[]),Pe.push(ee)}}}class it{loadTile(z,P){const{uid:G,encoding:H,rawImageData:ee,padding:ne,buildQuadTree:re}=z,Q=a.window.ImageBitmap&&ee instanceof a.window.ImageBitmap?this.getImageData(ee,ne):ee;P(null,new a.DEMData(G,Q,H,ne<1,re))}getImageData(z,P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(z.width,z.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=z.width,this.offscreenCanvas.height=z.height,this.offscreenCanvasContext.drawImage(z,0,0,z.width,z.height);const G=this.offscreenCanvasContext.getImageData(-P,-P,z.width+2*P,z.height+2*P);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),G}}function ht(Z,z){if(Z.length!==0){gi(Z[0],z);for(var P=1;P<Z.length;P++)gi(Z[P],!z)}}function gi(Z,z){for(var P=0,G=0,H=0,ee=Z.length,ne=ee-1;H<ee;ne=H++){var re=(Z[H][0]-Z[ne][0])*(Z[ne][1]+Z[H][1]),Q=P+re;G+=Math.abs(P)>=Math.abs(re)?P-Q+re:re-Q+P,P=Q}P+G>=0!=!!z&&Z.reverse()}var Si=a.getDefaultExportFromCjs(function Z(z,P){var G,H=z&&z.type;if(H==="FeatureCollection")for(G=0;G<z.features.length;G++)Z(z.features[G],P);else if(H==="GeometryCollection")for(G=0;G<z.geometries.length;G++)Z(z.geometries[G],P);else if(H==="Feature")Z(z.geometry,P);else if(H==="Polygon")ht(z.coordinates,P);else if(H==="MultiPolygon")for(G=0;G<z.coordinates.length;G++)ht(z.coordinates[G],P);return z});const br=a.VectorTileFeature.prototype.toGeoJSON;var wr={exports:{}},bo=a.pointGeometry,Ln=a.vectorTile.VectorTileFeature,Ji=Rn;function Rn(Z,z){this.options=z||{},this.features=Z,this.length=Z.length}function Qi(Z,z){this.id=typeof Z.id=="number"?Z.id:void 0,this.type=Z.type,this.rawGeometry=Z.type===1?[Z.geometry]:Z.geometry,this.properties=Z.tags,this.extent=z||4096}Rn.prototype.feature=function(Z){return new Qi(this.features[Z],this.options.extent)},Qi.prototype.loadGeometry=function(){var Z=this.rawGeometry;this.geometry=[];for(var z=0;z<Z.length;z++){for(var P=Z[z],G=[],H=0;H<P.length;H++)G.push(new bo(P[H][0],P[H][1]));this.geometry.push(G)}return this.geometry},Qi.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Z=this.geometry,z=1/0,P=-1/0,G=1/0,H=-1/0,ee=0;ee<Z.length;ee++)for(var ne=Z[ee],re=0;re<ne.length;re++){var Q=ne[re];z=Math.min(z,Q.x),P=Math.max(P,Q.x),G=Math.min(G,Q.y),H=Math.max(H,Q.y)}return[z,G,P,H]},Qi.prototype.toGeoJSON=Ln.prototype.toGeoJSON;var cn=a.pbf,hn=Ji;function er(Z){var z=new cn;
vendor: 4,217 bytes, line 8
8return function(P,G){for(var H in P.layers)G.writeMessage(3,Le,P.layers[H])}(Z,z),z.finish()}function Le(Z,z){var P;z.writeVarintField(15,Z.version||1),z.writeStringField(1,Z.name||""),z.writeVarintField(5,Z.extent||4096);var G={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<Z.length;P++)G.feature=Z.feature(P),z.writeMessage(2,ba,G);var H=G.keys;for(P=0;P<H.length;P++)z.writeStringField(3,H[P]);var ee=G.values;for(P=0;P<ee.length;P++)z.writeMessage(4,_s,ee[P])}function ba(Z,z){var P=Z.feature;P.id!==void 0&&z.writeVarintField(1,P.id),z.writeMessage(2,wa,Z),z.writeVarintField(3,P.type),z.writeMessage(4,Ta,P)}function wa(Z,z){var P=Z.feature,G=Z.keys,H=Z.values,ee=Z.keycache,ne=Z.valuecache;for(var re in P.properties){var Q=P.properties[re],de=ee[re];if(Q!==null){de===void 0&&(G.push(re),ee[re]=de=G.length-1),z.writeVarint(de);var Pe=typeof Q;Pe!=="string"&&Pe!=="boolean"&&Pe!=="number"&&(Q=JSON.stringify(Q));var ke=Pe+":"+Q,Ie=ne[ke];Ie===void 0&&(H.push(Q),ne[ke]=Ie=H.length-1),z.writeVarint(Ie)}}}function dt(Z,z){return(z<<3)+(7&Z)}function si(Z){return Z<<1^Z>>31}function Ta(Z,z){for(var P=Z.loadGeometry(),G=Z.type,H=0,ee=0,ne=P.length,re=0;re<ne;re++){var Q=P[re],de=1;G===1&&(de=Q.length),z.writeVarint(dt(1,de));for(var Pe=G===3?Q.length-1:Q.length,ke=0;ke<Pe;ke++){ke===1&&G!==1&&z.writeVarint(dt(2,Pe-1));var Ie=Q[ke].x-H,Je=Q[ke].y-ee;z.writeVarint(si(Ie)),z.writeVarint(si(Je)),H+=Ie,ee+=Je}G===3&&z.writeVarint(dt(7,1))}}function _s(Z,z){var P=typeof Z;P==="string"?z.writeStringField(1,Z):P==="boolean"?z.writeBooleanField(7,Z):P==="number"&&(Z%1!=0?z.writeDoubleField(3,Z):Z<0?z.writeSVarintField(6,Z):z.writeVarintField(5,Z))}wr.exports=er,wr.exports.fromVectorTileJs=er,wr.exports.fromGeojsonVt=function(Z,z){z=z||{};var P={};for(var G in Z)P[G]=new hn(Z[G].features,z),P[G].name=G,P[G].version=z.version,P[G].extent=z.extent;return er({layers:P})},wr.exports.GeoJSONWrapper=hn;var wo=a.getDefaultExportFromCjs(wr.exports);const gs={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Z=>Z},ct=Math.fround||(Bn=new Float32Array(1),Z=>(Bn[0]=+Z,Bn[0]));var Bn;const oi=3,ai=5,Zr=6;class Wt{constructor(z){this.options=Object.assign(Object.create(gs),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(z){const{log:P,minZoom:G,maxZoom:H}=this.options;P&&console.time("total time");const ee=`prepare ${z.length} points`;P&&console.time(ee),this.points=z;const ne=[];for(let Q=0;Q<z.length;Q++){const de=z[Q];if(!de.geometry)continue;const[Pe,ke]=de.geometry.coordinates,Ie=ct(Wr(Pe)),Je=ct(Tr(ke));ne.push(Ie,Je,1/0,Q,-1,1),this.options.reduce&&ne.push(0)}let re=this.trees[H+1]=this._createTree(ne);P&&console.timeEnd(ee);for(let Q=H;Q>=G;Q--){const de=+Date.now();re=this.trees[Q]=this._createTree(this._cluster(re,Q)),P&&console.log("z%d: %d clusters in %dms",Q,re.numItems,+Date.now()-de)}return P&&console.timeEnd("total time"),this}getClusters(z,P){let G=((z[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,z[1]));let ee=z[2]===180?180:((z[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)G=-180,ee=180;else if(G>ee){const ke=this.getClusters([G,H,180,ne],P),Ie=this.getClusters([-180,H,ee,ne],P);return ke.concat(Ie)}const re=this.trees[this._limitZoom(P)],Q=re.range(Wr(G),Tr(ne),Wr(ee),Tr(H)),de=re.data,Pe=[];for(const ke of Q){const Ie=this.stride*ke;Pe.push(de[Ie+ai]>1?qr(de,Ie,this.clusterProps):this.points[de[Ie+oi]])}return Pe}getChildren(z){const P=this._getOriginId(z),G=this._getOriginZoom(z),H="No cluster with the specified id.",ee=this.trees[G];if(!ee)throw new Error(H);const ne=ee.data;if(P*this.stride>=ne.length)throw new Error(H);const re=this.options.radius/(this.options.extent*Math.pow(2,G-1)),Q=ee.within(ne[P*this.stride],ne[P*this.stride+1],re),de=[];for(const Pe of Q){const ke=Pe*this.stride;ne[ke+4]===z&&de.push(ne[ke+ai]>1?qr(ne,ke,this.clusterProps):this.points[ne[ke+oi]])}if(de.length===0)throw new Error(H);return de}getLeaves(z,P,G){const H=[];return this._appendLeaves(H,z,P=P||10,G=G||0,0),H}getTile(z,P,G){const H=this.trees[this._limitZoom(z)],ee=Math.pow(2,z),{extent:ne,radiu
8s:re}=this.options,Q=re/ne,de=(G-Q)/ee,Pe=(G+1+Q)/ee,ke={features:[]};return this._addTileFeatures(H.range((P-Q)/ee,de,(P+1+Q)/ee,Pe),H.data,P,G,ee,ke),P===0&&this._addTileFeatures(H.range(1-Q/ee,de,1,Pe),H.data,ee,G,ee,ke),P===ee-1&&this._addTileFeatures(H.range(0,de,Q/ee,Pe),H.data,-1,G,ee,ke),ke.features.length?ke:null}getClusterExpansionZoom(z){let P=this._getOriginZoom(z)-1;for(;P<=this.options.maxZoom;){const G=this.getChildren(z);if(P++,G.length!==1)break;z=G[0].properties.cluster_id}return P}_appendLeaves(z,P,G,H,ee){const ne=this.getChildren(P);for(const re of ne){const Q=re.properties;if(Q&&Q.cluster?ee+Q.point_count<=H?ee+=Q.point_count:ee=this._appendLeaves(z,Q.cluster_id,G,H,ee):ee<H?ee++:z.push(re),z.length===G)break}return ee}_createTree(z){const P=new a.KDBush(z.length/this.stride|0,this.options.nodeSize,Float32Array);for(let G=0;G<z.length;G+=this.stride)P.add(z[G],z[G+1]);return P.finish(),P.data=z,P}_addTileFeatures(z,P,G,H,ee,ne){for(const re of z){const Q=re*this.stride,de=P[Q+ai]>1;let Pe,ke,Ie;if(de)Pe=On(P,Q,this.clusterProps),ke=P[Q],Ie=P[Q+1];else{const Qe=this.points[P[Q+oi]];Pe=Qe.properties;const[nt,ft]=Qe.geometry.coordinates;ke=Wr(nt),Ie=Tr(ft)}const Je={type:1,geometry:[[Math.round(this.options.extent*(ke*ee-G)),Math.round(this.options.extent*(Ie*ee-H))]],tags:Pe};let rt;rt=de||this.options.generateId?P[Q+oi]:this.points[P[Q+oi]].id,rt!==void 0&&(Je.id=rt),ne.features.push(Je)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,P){const{radius:G,extent:H,reduce:ee,minPoints:ne}=this.options,re=G/(H*Math.pow(2,P)),Q=z.data,de=[],Pe=this.stride;for(let ke=0;ke<Q.length;ke+=Pe){if(Q[ke+2]<=P)continue;Q[ke+2]=P;const Ie=Q[ke],Je=Q[ke+1],rt=z.within(Q[ke],Q[ke+1],re),Qe=Q[ke+ai];let nt=Qe;for(const ft of rt){const Vt=ft*Pe;Q[Vt+2]>P&&(nt+=Q[Vt+ai])}if(nt>Qe&&nt>=ne){let ft,Vt=Ie*Qe,Xt=Je*Qe,yi=-1;const ri=((ke/Pe|0)<<5)+(P+1)+this.points.length;for(const ar of rt){const li=ar*Pe;if(Q[li+2]<=P)continue;Q[li+2]=P;const Ti=Q[li+ai];Vt+=Q[li]*Ti,Xt+=Q[li+1]*Ti,Q[li+4]=ri,ee&&(ft||(ft=this._map(Q,ke,!0),yi=this.clusterProps.length,this.clusterProps.push(ft)),ee(ft,this._map(Q,li)))}Q[ke+4]=ri,de.push(Vt/nt,Xt/nt,1/0,ri,-1,nt),ee&&de.push(yi)}else{for(let ft=0;ft<Pe;ft++)de.push(Q[ke+ft]);if(nt>1)for(const ft of rt){const Vt=ft*Pe;if(!(Q[Vt+2]<=P)){Q[Vt+2]=P;for(let Xt=0;Xt<Pe;Xt++)de.push(Q[Vt+Xt])}}}}return de}_getOriginId(z){return z-this.points.length>>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,P,G){if(z[P+ai]>1){const ne=this.clusterProps[z[P+Zr]];return G?Object.assign({},ne):ne}const H=this.points[z[P+oi]].properties,ee=this.options.map(H);return G&&ee===H?Object.assign({},ee):ee}}function qr(Z,z,P){return{type:"Feature",id:Z[z+oi],properties:On(Z,z,P),geometry:{type:"Point",coordinates:[(G=Z[z],360*(G-.5)),ys(Z[z+1])]}};var G}function On(Z,z,P){const G=Z[z+ai],H=G>=1e4?`${Math.round(G/1e3)}k`:G>=1e3?Math.round(G/100)/10+"k":G,ee=Z[z+Zr],ne=ee===-1?{}:Object.assign({},P[ee]);return Object.assign(ne,{cluster:!0,cluster_id:Z[z+oi],point_count:G,point_count_abbreviated:H})}function Wr(Z){return Z/360+.5}function Tr(Z){const z=Math.sin(Z*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function ys(Z){const z=(180-360*Z)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function un(Z,z,P,G){for(var H,ee=G,ne=P-z>>1,re=P-z,Q=Z[z],de=Z[z+1],Pe=Z[P],ke=Z[P+1],Ie=z+3;Ie<P;Ie+=3){var Je=Fn(Z[Ie],Z[Ie+1],Q,de,Pe,ke);if(Je>ee)H=Ie,ee=Je;else if(Je===ee){var rt=Math.abs(Ie-ne);rt<re&&(H=Ie,re=rt)}}ee>G&&(H-z>3&&un(Z,z,H,G),Z[H+2]=ee,P-H>3&&un(Z,H,P,G))}function Fn(Z,z,P,G,H,ee){var ne=H-P,re=ee-G;if(ne!==0||re!==0){var Q=((Z-P)*ne+(z-G)*re)/(ne*ne+re*re);Q>1?(P=H,G=ee):Q>0&&(P+=ne*Q,G+=re*Q)}return(ne=Z-P)*ne+(re=z-G)*re}function pt(Z,z,P,G){var H={id:Z===void 0?null:Z,type:z,geometry:P,tags:G,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var ne=ee.geometry,re=ee.type;if(re==="Point"||re==="MultiPoint"||re==="LineString")Un(ee,ne);else if(re==="Polygon"||re==="MultiLineString")for(var Q=0;Q<ne.length;Q++)Un(ee,ne[Q]);else if(re==="MultiPolygon")for(Q=0;Q<ne.length;Q++)for(var de=0;de<ne[Q].length;de++)Un(ee,ne[Q][de])}(H),H}function Un(Z,z){for(var P=0;P<z.length;P+=3)Z.minX=Math.min(Z.minX,z[P]),Z.minY=Math.min(Z.minY,z[P+1]),Z.maxX=Math.max(Z.maxX,z[P]),Z.maxY=Math.max(Z.maxY,z[P+1])}function Li(Z,z,P,G){if(z.geometry){var H=z.geometry.coordinates,ee=z.geometry.type,ne=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),re=[],Q=z.id;if(P.promoteId?Q=z.properties[P.promoteId]:P.generateId&&(Q=G||0),ee==="Point")To(H,re);else if(ee==="MultiPoint")for(var de=0;de<H.length;de++)To(H[de],re);else if(ee==="LineString")Ut(H,re,ne,!1);else if(ee==="MultiLineString"){if(P.lineMetrics){for(de=0;de<H.length;de++)Ut(H[de],re=[],ne,!1),Z.push(pt(Q,"LineString",re,z.properties));return}Vi(H,re,ne,!1)}else if(ee==="Polygon")Vi(H,re,ne,!0);else{if(ee!=="MultiPolygon"){if(ee==="GeometryCollection"){for(de=0;de<z.geometry.geometries.length;de++)Li(Z,{id:Q,geometry:z.geometry.geometries[de],properties:z.properties},P,G);return}throw new Error("Input data is not a valid GeoJSON object.")}for(de=0;de<H.length;de++){var Pe=[];Vi(H[de],Pe,ne,!0),re.push(Pe)}}Z.push(pt(Q,ee,re,z.properties))}}
vendor: 4,254 bytes, line 8
8function To(Z,z){z.push(xs(Z[0])),z.push(Er(Z[1])),z.push(0)}function Ut(Z,z,P,G){for(var H,ee,ne=0,re=0;re<Z.length;re++){var Q=xs(Z[re][0]),de=Er(Z[re][1]);z.push(Q),z.push(de),z.push(0),re>0&&(ne+=G?(H*de-Q*ee)/2:Math.sqrt(Math.pow(Q-H,2)+Math.pow(de-ee,2))),H=Q,ee=de}var Pe=z.length-3;z[2]=1,un(z,0,Pe,P),z[Pe+2]=1,z.size=Math.abs(ne),z.start=0,z.end=z.size}function Vi(Z,z,P,G){for(var H=0;H<Z.length;H++){var ee=[];Ut(Z[H],ee,P,G),z.push(ee)}}function xs(Z){return Z/360+.5}function Er(Z){var z=Math.sin(Z*Math.PI/180),P=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return P<0?0:P>1?1:P}function Ri(Z,z,P,G,H,ee,ne,re){if(G/=z,ee>=(P/=z)&&ne<G)return Z;if(ne<P||ee>=G)return null;for(var Q=[],de=0;de<Z.length;de++){var Pe=Z[de],ke=Pe.geometry,Ie=Pe.type,Je=H===0?Pe.minX:Pe.minY,rt=H===0?Pe.maxX:Pe.maxY;if(Je>=P&&rt<G)Q.push(Pe);else if(!(rt<P||Je>=G)){var Qe=[];if(Ie==="Point"||Ie==="MultiPoint")Eo(ke,Qe,P,G,H);else if(Ie==="LineString")Vn(ke,Qe,P,G,H,!1,re.lineMetrics);else if(Ie==="MultiLineString")Xr(ke,Qe,P,G,H,!1);else if(Ie==="Polygon")Xr(ke,Qe,P,G,H,!0);else if(Ie==="MultiPolygon")for(var nt=0;nt<ke.length;nt++){var ft=[];Xr(ke[nt],ft,P,G,H,!0),ft.length&&Qe.push(ft)}if(Qe.length){if(re.lineMetrics&&Ie==="LineString"){for(nt=0;nt<Qe.length;nt++)Q.push(pt(Pe.id,Ie,Qe[nt],Pe.tags));continue}Ie!=="LineString"&&Ie!=="MultiLineString"||(Qe.length===1?(Ie="LineString",Qe=Qe[0]):Ie="MultiLineString"),Ie!=="Point"&&Ie!=="MultiPoint"||(Ie=Qe.length===3?"Point":"MultiPoint"),Q.push(pt(Pe.id,Ie,Qe,Pe.tags))}}}return Q.length?Q:null}function Eo(Z,z,P,G,H){for(var ee=0;ee<Z.length;ee+=3){var ne=Z[ee+H];ne>=P&&ne<=G&&(z.push(Z[ee]),z.push(Z[ee+1]),z.push(Z[ee+2]))}}function Vn(Z,z,P,G,H,ee,ne){for(var re,Q,de=So(Z),Pe=H===0?vs:bs,ke=Z.start,Ie=0;Ie<Z.length-3;Ie+=3){var Je=Z[Ie],rt=Z[Ie+1],Qe=Z[Ie+2],nt=Z[Ie+3],ft=Z[Ie+4],Vt=H===0?Je:rt,Xt=H===0?nt:ft,yi=!1;ne&&(re=Math.sqrt(Math.pow(Je-nt,2)+Math.pow(rt-ft,2))),Vt<P?Xt>P&&(Q=Pe(de,Je,rt,nt,ft,P),ne&&(de.start=ke+re*Q)):Vt>G?Xt<G&&(Q=Pe(de,Je,rt,nt,ft,G),ne&&(de.start=ke+re*Q)):Nn(de,Je,rt,Qe),Xt<P&&Vt>=P&&(Q=Pe(de,Je,rt,nt,ft,P),yi=!0),Xt>G&&Vt<=G&&(Q=Pe(de,Je,rt,nt,ft,G),yi=!0),!ee&&yi&&(ne&&(de.end=ke+re*Q),z.push(de),de=So(Z)),ne&&(ke+=re)}var ri=Z.length-3;Je=Z[ri],rt=Z[ri+1],Qe=Z[ri+2],(Vt=H===0?Je:rt)>=P&&Vt<=G&&Nn(de,Je,rt,Qe),ri=de.length-3,ee&&ri>=3&&(de[ri]!==de[0]||de[ri+1]!==de[1])&&Nn(de,de[0],de[1],de[2]),de.length&&z.push(de)}function So(Z){var z=[];return z.size=Z.size,z.start=Z.start,z.end=Z.end,z}function Xr(Z,z,P,G,H,ee){for(var ne=0;ne<Z.length;ne++)Vn(Z[ne],z,P,G,H,ee,!1)}function Nn(Z,z,P,G){Z.push(z),Z.push(P),Z.push(G)}function vs(Z,z,P,G,H,ee){var ne=(ee-z)/(G-z);return Z.push(ee),Z.push(P+(H-P)*ne),Z.push(1),ne}function bs(Z,z,P,G,H,ee){var ne=(ee-P)/(H-P);return Z.push(z+(G-z)*ne),Z.push(ee),Z.push(1),ne}function Ni(Z,z){for(var P=[],G=0;G<Z.length;G++){var H,ee=Z[G],ne=ee.type;if(ne==="Point"||ne==="MultiPoint"||ne==="LineString")H=Hr(ee.geometry,z);else if(ne==="MultiLineString"||ne==="Polygon"){H=[];for(var re=0;re<ee.geometry.length;re++)H.push(Hr(ee.geometry[re],z))}else if(ne==="MultiPolygon")for(H=[],re=0;re<ee.geometry.length;re++){for(var Q=[],de=0;de<ee.geometry[re].length;de++)Q.push(Hr(ee.geometry[re][de],z));H.push(Q)}P.push(pt(ee.id,ne,H,ee.tags))}return P}function Hr(Z,z){var P=[];P.size=Z.size,Z.start!==void 0&&(P.start=Z.start,P.end=Z.end);for(var G=0;G<Z.length;G+=3)P.push(Z[G]+z,Z[G+1],Z[G+2]);return P}function Mo(Z,z){if(Z.transformed)return Z;var P,G,H,ee=1<<Z.z,ne=Z.x,re=Z.y;for(P=0;P<Z.features.length;P++){var Q=Z.features[P],de=Q.geometry,Pe=Q.type;if(Q.geometry=[],Pe===1)for(G=0;G<de.length;G+=2)Q.geometry.push(dn(de[G],de[G+1],z,ee,ne,re));else for(G=0;G<de.length;G++){var ke=[];for(H=0;H<de[G].length;H+=2)ke.push(dn(de[G][H],de[G][H+1],z,ee,ne,re));Q.geometry.push(ke)}}return Z.transformed=!0,Z}function dn(Z,z,P,G,H,ee){return[Math.round(P*(Z*G-H)),Math.round(P*(z*G-ee))]}function jn(Z,z,P,G,H){for(var ee=z===H.maxZoom?0:H.tolerance/((1<<z)*H.extent),ne={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:G,z,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},re=0;re<Z.length;re++){ne.numFeatures++,Ao(ne,Z[re],ee,H);var Q=Z[re].minX,de=Z[re].minY,Pe=Z[re].maxX,ke=Z[re].maxY;
vendor: 8,316 bytes, line 8
8Q<ne.minX&&(ne.minX=Q),de<ne.minY&&(ne.minY=de),Pe>ne.maxX&&(ne.maxX=Pe),ke>ne.maxY&&(ne.maxY=ke)}return ne}function Ao(Z,z,P,G){var H=z.geometry,ee=z.type,ne=[];if(ee==="Point"||ee==="MultiPoint")for(var re=0;re<H.length;re+=3)ne.push(H[re]),ne.push(H[re+1]),Z.numPoints++,Z.numSimplified++;else if(ee==="LineString")pn(ne,H,Z,P,!1,!1);else if(ee==="MultiLineString"||ee==="Polygon")for(re=0;re<H.length;re++)pn(ne,H[re],Z,P,ee==="Polygon",re===0);else if(ee==="MultiPolygon")for(var Q=0;Q<H.length;Q++){var de=H[Q];for(re=0;re<de.length;re++)pn(ne,de[re],Z,P,!0,re===0)}if(ne.length){var Pe=z.tags||null;if(ee==="LineString"&&G.lineMetrics){for(var ke in Pe={},z.tags)Pe[ke]=z.tags[ke];Pe.mapbox_clip_start=H.start/H.size,Pe.mapbox_clip_end=H.end/H.size}var Ie={geometry:ne,type:ee==="Polygon"||ee==="MultiPolygon"?3:ee==="LineString"||ee==="MultiLineString"?2:1,tags:Pe};z.id!==null&&(Ie.id=z.id),Z.features.push(Ie)}}function pn(Z,z,P,G,H,ee){var ne=G*G;if(G>0&&z.size<(H?ne:G))P.numPoints+=z.length/3;else{for(var re=[],Q=0;Q<z.length;Q+=3)(G===0||z[Q+2]>ne)&&(P.numSimplified++,re.push(z[Q]),re.push(z[Q+1])),P.numPoints++;H&&function(de,Pe){for(var ke=0,Ie=0,Je=de.length,rt=Je-2;Ie<Je;rt=Ie,Ie+=2)ke+=(de[Ie]-de[rt])*(de[Ie+1]+de[rt+1]);if(ke>0===Pe)for(Ie=0,Je=de.length;Ie<Je/2;Ie+=2){var Qe=de[Ie],nt=de[Ie+1];de[Ie]=de[Je-2-Ie],de[Ie+1]=de[Je-1-Ie],de[Je-2-Ie]=Qe,de[Je-1-Ie]=nt}}(re,ee),Z.push(re)}}function Kr(Z,z){var P=(z=this.options=function(H,ee){for(var ne in ee)H[ne]=ee[ne];return H}(Object.create(this.options),z)).debug;if(P&&console.time("preprocess data"),z.maxZoom<0||z.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");var G=function(H,ee){var ne=[];if(H.type==="FeatureCollection")for(var re=0;re<H.features.length;re++)Li(ne,H.features[re],ee,re);else Li(ne,H.type==="Feature"?H:{geometry:H},ee);return ne}(Z,z);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",z.indexMaxZoom,z.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),G=function(H,ee){var ne=ee.buffer/ee.extent,re=H,Q=Ri(H,1,-1-ne,ne,0,-1,2,ee),de=Ri(H,1,1-ne,2+ne,0,-1,2,ee);return(Q||de)&&(re=Ri(H,1,-ne,1+ne,0,-1,2,ee)||[],Q&&(re=Ni(Q,1).concat(re)),de&&(re=re.concat(Ni(de,-1)))),re}(G,z),G.length&&this.splitTile(G,0,0,0),P&&(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)))}function fn(Z,z,P){return 32*((1<<Z)*P+z)+Z}function mn(Z,z){const P=Z.tileID.canonical;if(!this._geoJSONIndex)return z(null,null);const G=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!G)return z(null,null);const H=new class{constructor(ne){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=ne.length,this._features=ne}feature(ne){return new class{constructor(re){this._feature=re,this.extent=a.EXTENT,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))}loadGeometry(){if(this._feature.type===1){const re=[];for(const Q of this._feature.geometry)re.push([new a.Point(Q[0],Q[1])]);return re}{const re=[];for(const Q of this._feature.geometry){const de=[];for(const Pe of Q)de.push(new a.Point(Pe[0],Pe[1]));re.push(de)}return re}}toGeoJSON(re,Q,de){return br.call(this,re,Q,de)}}(this._features[ne])}}(G.features);let ee=wo(H);ee.byteOffset===0&&ee.byteLength===ee.buffer.byteLength||(ee=new Uint8Array(ee)),z(null,{vectorTile:H,rawData:ee.buffer})}Kr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Kr.prototype.splitTile=function(Z,z,P,G,H,ee,ne){for(var re=[Z,z,P,G],Q=this.options,de=Q.debug;re.length;){G=re.pop(),P=re.pop(),z=re.pop(),Z=re.pop();var Pe=1<<z,ke=fn(z,P,G),Ie=this.tiles[ke];if(!Ie&&(de>1&&console.time("creation"),Ie=this.tiles[ke]=jn(Z,z,P,G,Q),this.tileCoords.push({z,x:P,y:G}),de)){de>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,P,G,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Je="z"+z;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(Ie.source=Z,H){if(z===Q.maxZoom||z===H)continue;var rt=1<<H-z;if(P!==Math.floor(ee/rt)||G!==Math.floor(ne/rt))continue}else if(z===Q.indexMaxZoom||Ie.numPoints<=Q.indexMaxPoints)continue;if(Ie.source=null,Z.length!==0){de>1&&console.time("clipping");var Qe,nt,ft,Vt,Xt,yi,ri=.5*Q.buffer/Q.extent,ar=.5-ri,li=.5+ri,Ti=1+ri;Qe=nt=ft=Vt=null,Xt=Ri(Z,Pe,P-ri,P+li,0,Ie.minX,Ie.maxX,Q),yi=Ri(Z,Pe,P+ar,P+Ti,0,Ie.minX,Ie.maxX,Q),Z=null,Xt&&(Qe=Ri(Xt,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),nt=Ri(Xt,Pe,G+ar,G+Ti,1,Ie.minY,Ie.maxY,Q),Xt=null),yi&&(ft=Ri(yi,Pe,G-ri,G+li,1,Ie.minY,Ie.maxY,Q),Vt=Ri(yi,Pe,G+ar,G+Ti,1,Ie.minY,Ie.maxY,Q),yi=null),de>1&&console.timeEnd("clipping"),re.push(Qe||[],z+1,2*P,2*G),re.push(nt||[],z+1,2*P,2*G+1),re.push(ft||[],z+1,2*P+1,2*G),re.push(Vt||[],z+1,2*P+1,2*G+1)}}},Kr.prototype.getTile=function(Z,z,P){var G=this.options,H=G.extent,ee=G.debug;if(Z<0||Z>24)return null;var ne=1<<Z,re=fn(Z,z=(z%ne+ne)%ne,P);if(this.tiles[re])return Mo(this.tiles[re],H);ee>1&&console.log("drilling down to z%d-%d-%d",Z,z,P);for(var Q,de=Z,Pe=z,ke=P;!Q&&de>0;)de--,Pe=Math.floor(Pe/2),ke=Math.floor(ke/2),Q=this.tiles[fn(de,Pe,ke)];return Q&&Q.source?(ee>1&&console.log("found parent tile z%d-%d-%d",de,Pe,ke),ee>1&&console.time("drilling down"),this.splitTile(Q.source,de,Pe,ke,Z,z,P),ee>1&&console.timeEnd("drilling down"),this.tiles[re]?Mo(this.tiles[re],H):null):null};class Gn extends a.VectorTileWorkerSource{constructor(z,P,G,H,ee){super(z,P,G,H,mn),ee&&(this.loadGeoJSON=ee)}loadData(z,P){const G=z&&z.request,H=G&&G.collectResourceTiming;this.loadGeoJSON(z,(ee,ne)=>{if(ee||!ne)return P(ee);if(typeof ne!="object")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));{Si(ne,!0);try{if(z.filter){const Q=a.createExpression(z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));ne={type:"FeatureCollection",features:ne.features.filter(Pe=>Q.value.evaluate({zoom:0},Pe))}}this._geoJSONIndex=z.cluster?new Wt(function({superclusterOptions:Q,clusterProperties:de}){if(!de||!Q)return Q;const Pe={},ke={},Ie={accumulated:null,zoom:0},Je={properties:null},rt=Object.keys(de);for(const Qe of rt){const[nt,ft]=de[Qe],Vt=a.createExpression(ft),Xt=a.createExpression(typeof nt=="string"?[nt,["accumulated"],["get",Qe]]:nt);Pe[Qe]=Vt.value,ke[Qe]=Xt.value}return Q.map=Qe=>{Je.properties=Qe;const nt={};for(const ft of rt)nt[ft]=Pe[ft].evaluate(Ie,Je);return nt},Q.reduce=(Qe,nt)=>{Je.properties=nt;for(const ft of rt)Ie.accumulated=Qe[ft],Qe[ft]=ke[ft].evaluate(Ie,Je)},Q}(z)).load(ne.features):function(Q,de){return new Kr(Q,de)}(ne,z.geojsonVtOptions)}catch(Q){return P(Q)}this.loaded={};const re={};if(H){const Q=a.getPerformanceMeasurement(G);Q&&(re.resourceTiming={},re.resourceTiming[z.source]=JSON.parse(JSON.stringify(Q)))}P(null,re)}})}reloadTile(z,P){const G=this.loaded;return G&&G[z.uid]?super.reloadTile(z,P):this.loadTile(z,P)}loadGeoJSON(z,P){if(z.request)a.getJSON(z.request,P);else{if(typeof z.data!="string")return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`));try{return P(null,JSON.parse(z.data))}catch{return P(new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(z,P){try{P(null,this._geoJSONIndex.getClusterExpansionZoom(z.clusterId))}catch(G){P(G)}}getClusterChildren(z,P){try{P(null,this._geoJSONIndex.getChildren(z.clusterId))}catch(G){P(G)}}getClusterLeaves(z,P){try{P(null,this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset))}catch(G){P(G)}}}class ws{constructor(z){this.self=z,this.actor=new a.Actor(z,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=a.getProjection({name:"mercator"}),this.workerSourceTypes={vector:a.VectorTileWorkerSource,geojson:Gn},this.workerSources={},this.demWorkerSources={}
8,this.self.registerWorkerSource=(P,G)=>{if(this.workerSourceTypes[P])throw new Error(`Worker source with name "${P}" already registered.`);this.workerSourceTypes[P]=G},this.self.registerRTLTextPlugin=P=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=P.applyArabicShaping,a.plugin.processBidirectionalText=P.processBidirectionalText,a.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}}clearCaches(z,P,G){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z],G()}checkIfReady(z,P,G){G()}setReferrer(z,P){this.referrer=P}spriteLoaded(z,P){this.isSpriteLoaded[z]=P;for(const G in this.workerSources[z]){const H=this.workerSources[z][G];for(const ee in H)H[ee]instanceof a.VectorTileWorkerSource&&(H[ee].isSpriteLoaded=P,H[ee].fire(new a.Event("isSpriteLoaded")))}}setImages(z,P,G){this.availableImages[z]=P;for(const H in this.workerSources[z]){const ee=this.workerSources[z][H];for(const ne in ee)ee[ne].availableImages=P}G()}enableTerrain(z,P,G){this.terrain=P,G()}setProjection(z,P){this.projections[z]=a.getProjection(P)}setLayers(z,P,G){this.getLayerIndex(z).replace(P),G()}updateLayers(z,P,G){this.getLayerIndex(z).update(P.layers,P.removedIds),G()}loadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).loadTile(H,G)}loadDEMTile(z,P,G){const H=this.enableTerrain?a.extend({buildQuadTree:this.terrain},P):P;this.getDEMWorkerSource(z,P.source).loadTile(H,G)}reloadTile(z,P,G){const H=this.enableTerrain?a.extend({enableTerrain:this.terrain},P):P;H.projection=this.projections[z]||this.defaultProjection,this.getWorkerSource(z,P.type,P.source).reloadTile(H,G)}abortTile(z,P,G){this.getWorkerSource(z,P.type,P.source).abortTile(P,G)}removeTile(z,P,G){this.getWorkerSource(z,P.type,P.source).removeTile(P,G)}removeSource(z,P,G){if(!this.workerSources[z]||!this.workerSources[z][P.type]||!this.workerSources[z][P.type][P.source])return;const H=this.workerSources[z][P.type][P.source];delete this.workerSources[z][P.type][P.source],H.removeSource!==void 0?H.removeSource(P,G):G()}loadWorkerSource(z,P,G){try{this.self.importScripts(P.url),G()}catch(H){G(H.toString())}}syncRTLPluginState(z,P,G){try{a.plugin.setState(P);const H=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&H!=null){this.self.importScripts(H);const ee=a.plugin.isParsed();G(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),ee)}}catch(H){G(H.toString())}}getAvailableImages(z){let P=this.availableImages[z];return P||(P=[]),P}getLayerIndex(z){let P=this.layerIndexes[z];return P||(P=this.layerIndexes[z]=new Yi),P}getWorkerSource(z,P,G){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][P]||(this.workerSources[z][P]={}),!this.workerSources[z][P][G]){const H={send:(ee,ne,re,Q,de,Pe)=>{this.actor.send(ee,ne,re,z,de,Pe)},scheduler:this.actor.scheduler};this.workerSources[z][P][G]=new this.workerSourceTypes[P](H,this.getLayerIndex(z),this.getAvailableImages(z),this.isSpriteLoaded[z])}return this.workerSources[z][P][G]}getDEMWorkerSource(z,P){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][P]||(this.demWorkerSources[z][P]=new it),this.demWorkerSources[z][P]}enforceCacheSizeLimit(z,P){a.enforceCacheSizeLimit(P)}getWorkerPerformanceMetrics(z,P,G){G(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new ws(self)),ws}),Mh(["./shared"],function(a){function Se(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let o=0;o<l.length;o++)if(!Se(l[o],r[o]))return!1;return!0}if(typeof l=="object"&&l!==null&&r!==null){if(typeof r!="object"||Object.keys(l).length!==Object.keys(r).length)return!1;for(const o in l)if(!Se(l[o],r[o]))return!1;return!0}return l===r}var vr=Yi;function Yi(l){return!function(r){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var h,d,f=new Blob([""],{type:"text/javascript"}),g=URL.createObjectURL(f);try{d=new Worker(g),h=!0}catch{h=!1}return d&&d.terminate(),URL.revokeObjectURL(g),h}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var h=document.createElement("canvas");h.width=h.height=1;var d=h.getContext("2d");if(!d)return!1;var f=d.getImageData(0,0,1,1);return f&&f.width===h.width}
vendor: 13,501 bytes, line 8
8()?(it[o=r&&r.failIfMajorPerformanceCaveat]===void 0&&(it[o]=function(h){var d,f=function(g){var y=document.createElement("canvas"),v=Object.create(Yi.webGLContextAttributes);return v.failIfMajorPerformanceCaveat=g,y.getContext("webgl",v)||y.getContext("experimental-webgl",v)}(h);if(!f)return!1;try{d=f.createShader(f.VERTEX_SHADER)}catch{return!1}return!(!d||f.isContextLost())&&(f.shaderSource(d,"void main() {}"),f.compileShader(d),f.getShaderParameter(d,f.COMPILE_STATUS)===!0)}(o)),it[o]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var o}(l)}var it={};function ht(l,r,o){const h=a.window.document.createElement(l);return r!==void 0&&(h.className=r),o&&o.appendChild(h),h}function gi(l,r,o){const h=a.window.document.createElementNS("http://www.w3.org/2000/svg",l);for(const d of Object.keys(r))h.setAttributeNS(null,d,r[d]);return o&&o.appendChild(h),h}Yi.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const Si=a.window.document&&a.window.document.documentElement.style,br=Si&&Si.userSelect!==void 0?"userSelect":"WebkitUserSelect";let wr;function bo(){Si&&br&&(wr=Si[br],Si[br]="none")}function Ln(){Si&&br&&(Si[br]=wr)}function Ji(l){l.preventDefault(),l.stopPropagation(),a.window.removeEventListener("click",Ji,!0)}function Rn(){a.window.addEventListener("click",Ji,!0),a.window.setTimeout(()=>{a.window.removeEventListener("click",Ji,!0)},0)}function Qi(l,r){const o=l.getBoundingClientRect();return er(l,o,r)}function cn(l,r){const o=l.getBoundingClientRect(),h=[];for(let d=0;d<r.length;d++)h.push(er(l,o,r[d]));return h}function hn(l){return a.window.InstallTrigger!==void 0&&l.button===2&&l.ctrlKey&&a.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:l.button}function er(l,r,o){const h=l.offsetWidth===r.width?1:l.offsetWidth/r.width;return new a.Point((o.clientX-r.left)*h,(o.clientY-r.top)*h)}function Le(l,r){var o=r[0],h=r[1],d=r[2],f=r[3],g=o*f-d*h;return g?(l[0]=f*(g=1/g),l[1]=-h*g,l[2]=-d*g,l[3]=o*g,l):null}function ba(l){const{userImage:r}=l;return!!(r&&r.render&&r.render())&&(l.data.replace(new Uint8Array(r.data.buffer)),!0)}class wa extends a.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:o,callback:h}of this.requestors)this._notify(o,h);this.requestors=[]}}hasImage(r){return!!this.getImage(r)}getImage(r){return this.images[r]}addImage(r,o){this._validate(r,o)&&(this.images[r]=o)}_validate(r,o){let h=!0;return this._validateStretch(o.stretchX,o.data&&o.data.width)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchX" value`))),h=!1),this._validateStretch(o.stretchY,o.data&&o.data.height)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "stretchY" value`))),h=!1),this._validateContent(o.content,o)||(this.fire(new a.ErrorEvent(new Error(`Image "${r}" has invalid "content" value`))),h=!1),h}_validateStretch(r,o){if(!r)return!0;let h=0;for(const d of r){if(d[0]<h||d[1]<d[0]||o<d[1])return!1;h=d[1]}return!0}_validateContent(r,o){return!(r&&(r.length!==4||r[0]<0||o.data.width<r[0]||r[1]<0||o.data.height<r[1]||r[2]<0||o.data.width<r[2]||r[3]<0||o.data.height<r[3]||r[2]<r[0]||r[3]<r[1]))}updateImage(r,o){o.version=this.images[r].version+1,this.images[r]=o,this.updatedImages[r]=!0}removeImage(r){const o=this.images[r];delete this.images[r],delete this.patterns[r],o.userImage&&o.userImage.onRemove&&o.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(r,o){let h=!0;if(!this.isLoaded())for(const d of r)this.images[d]||(h=!1);this.isLoaded()||h?this._notify(r,o):this.requestors.push({ids:r,callback:o})}_notify(r,o){const h={};for(const d of r){this.images[d]||this.fire(new a.Event("styleimagemissing",{id:d}));const f=this.images[d];f?h[d]={data:f.data.clone(),pixelRatio:f.pixelRatio,sdf:f.sdf,version:f.version,stretchX:f.stretchX,stretchY:f.stretchY,content:f.content,hasRenderCallback:!!(f.userImage&&f.userImage.render)}:a.warnOnce(`Image "${d}" 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.`)}o(null,h)}getPixelSize(){const{width:r,height:o}=this.atlasImage;return{width:r,height:o}}getPattern(r){const o=this.patterns[r],h=this.getImage(r);if(!h)return null;if(o&&o.position.version===h.version)return o.position;if(o)o.position.version=h.version;else{const d={w:h.data.width+2,h:h.data.height+2,x:0,y:0},f=new a.ImagePosition(d,h);this.patterns[r]={bin:d,position:f}}return this._updatePatternAtlas(),this.patterns[r].position}bind(r){const o=r.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new a.Texture(r,this.atlasImage,o.RGBA),this.atlasTexture&&this.atlasTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE)}_updatePatternAtlas(){const r=[];for(const f in this.patterns)r.push(this.patterns[f].bin);const{w:o,h}=a.potpack(r),d=this.atlasImage;d.resize({width:o||1,height:h||1});for(const f in this.patterns){const{bin:g}=this.patterns[f],y=g.x+1,v=g.y+1,E=this.images[f].data,T=E.width,A=E.height;a.RGBAImage.copy(E,d,{x:0,y:0},{x:y,y:v},{width:T,height:A}),a.RGBAImage.copy(E,d,{x:0,y:A-1},{x:y,y:v-1},{width:T,height:1}),a.RGBAImage.copy(E,d,{x:0,y:0},{x:y,y:v+A},{width:T,height:1}),a.RGBAImage.copy(E,d,{x:T-1,y:0},{x:y-1,y:v},{width:1,height:A}),a.RGBAImage.copy(E,d,{x:0,y:0},{x:y+T,y:v},{width:1,height:A})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(r){for(const o of r){if(this.callbackDispatchedThisFrame[o])continue;this.callbackDispatchedThisFrame[o]=!0;const h=this.images[o];ba(h)&&this.updateImage(o,h)}}}const dt=new a.Properties({anchor:new a.DataConstantProperty(a.spec.light.anchor),position:new class{constructor(){this.specification=a.spec.light.position}possiblyEvaluate(l,r){return function([o,h,d]){const f=a.degToRad(h+90),g=a.degToRad(d);return{x:o*Math.cos(f)*Math.sin(g),y:o*Math.sin(f)*Math.sin(g),z:o*Math.cos(g),azimuthal:h,polar:d}}(l.expression.evaluate(r))}interpolate(l,r,o){return{x:a.number(l.x,r.x,o),y:a.number(l.y,r.y,o),z:a.number(l.z,r.z,o),azimuthal:a.number(l.azimuthal,r.azimuthal,o),polar:a.number(l.polar,r.polar,o)}}},color:new a.DataConstantProperty(a.spec.light.color),intensity:new a.DataConstantProperty(a.spec.light.intensity)});class si extends a.Evented{constructor(r){super(),this._transitionable=new a.Transitionable(dt),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(r,o={}){if(!this._validate(a.validateLight,r,o))for(const h in r){const d=r[h];a.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),d):this._transitionable.setValue(h,d)}}updateTransitions(r){this._transitioning=this._transitionable.transitioned(r,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(r){this.properties=this._transitioning.possiblyEvaluate(r)}_validate(r,o,h){return(!h||h.validate!==!1)&&a.emitValidationErrors(this,r.call(a.validateStyle,a.extend({value:o,style:{glyphs:!0,sprite:!0},styleSpec:a.spec})))}}const Ta=new a.Properties({source:new a.DataConstantProperty(a.spec.terrain.source),exaggeration:new a.DataConstantProperty(a.spec.terrain.exaggeration)});let _s=class extends a.Evented{constructor(l,r){super(),this._transitionable=new a.Transitionable(Ta),this.set(l),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=r}get(){return this._transitionable.serialize()}set(l){for(const r in l){const o=l[r];a.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),o):this._transitionable.setValue(r,o)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}};function wo(l,r,o,h){const d=a.smoothstep(45,65,o),[f,g]=gs(l,h),y=a.length(r);let v=1-Math.min(1,Math.exp((y-f)/(g-f)*-6));return v*=v*v,v=Math.min(1,1.00747*v),v*d*l.alpha}function gs(l,r){const o=.5/Math.tan(.5*r);return[l.range[0]+o,l.range[1]+o]}const ct=new a.Properties({range:new a.DataConstantProperty(a.spec.fog.range),color:new a.DataConstantProperty(a.spec.fog.color),"high-color":new a.DataConstantProperty(a.spec.fog["high-color"]),"space-color":new a.DataConstantProperty(a.spec.fog["space-color"]),"horizon-blend":new a.DataConstantProperty(a.spec.fog["horizon-blend"]),"star-intensity":new a.DataConstantProperty(a.spec.fog["star-intensity"])});class Bn extends a.Evented{constructor(r,o){super(),this._transitionable=new a.Transitionable(ct),this.set(r),this._transitioning=this._transitionable.untransitioned(),this._transform=o}get state(){const r=this._transform,o=r.projection.name==="globe",h=a.globeToMercatorTransition(r.zoom),d=this.properties.get("range"),f=[.5,3];return{range:o?[a.number(f[0],d[0],h),a.number(f[1],d[1],h)]:d,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(r,o={}){if(!this._validate(a.validateFog,r,o)){for(const h of Object.keys(a.spec.fog))r&&r[h]===void 0&&(r[h]=a.spec.fog[h].default);for(const h in r){const d=r[h];a.endsWith(h,"-transition")?this._transitionable.setTransition(h.slice(0,-11),d):this._transitionable.setValue(h,d)}}}getOpacity(r){if(!this._transform.projection.supportsFog)return 0;const o=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:a.smoothstep(45,65,r))*o.a}getOpacityAtLatLng(r,o){return this._transform.projection.supportsFog?function(h,d,f){const g=a.MercatorCoordinate.fromLngLat(d),y=f.elevation?f.elevation.getAtPointOrZero(g):0,v=[g.x,g.y,y];return a.transformMat4(v,v,f.mercatorFogMatrix),wo(h,v,f.pitch,f._fov)}(this.state,r,o):0}getFovAdjustedRange(r){return this._transform.projection.supportsFog?gs(this.state,r):[0,1]}updateTransitions(r){this._transitioning=this._transitionable.transitioned(r,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(r){this.properties=this._transitioning.possiblyEvaluate(r)}_validate(r,o,h){return(!h||h.validate!==!1)&&a.emitValidationErrors(this,r.call(a.validateStyle,a.extend({value:o,style:{glyphs:!0,sprite:!0},styleSpec:a.spec})))}}class oi{constructor(r,o){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=a.uniqueId();const h=this.workerPool.acquire(this.id);for(let d=0;d<h.length;d++){const f=new oi.Actor(h[d],o,this.id);f.name=`Worker ${d}`,this.actors.push(f)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(r,o,h){a.asyncAll(this.actors,(d,f)=>{d.send(r,o,f)},h=h||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(r=>{r.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ai(l,r,o){return r*(a.EXTENT/(l.tileSize*Math.pow(2,o-l.tileID.overscaledZ)))}oi.Actor=a.Actor;class Zr{constructor(r,o,h,d){this.screenBounds=r,this.cameraPoint=o,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=h,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,d)}static createFromScreenPoints(r,o){let h,d;if(r instanceof a.Point||typeof r[0]=="number"){const f=a.Point.convert(r);h=[f],d=o.isPointAboveHorizon(f)}else{const f=a.Point.convert(r[0]),g=a.Point.convert(r[1]);h=[f,g],d=a.polygonizeBounds(f,g).every(y=>o.isPointAboveHorizon(y))}return new Zr(h,o.getCameraPoint(),d,o)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(r){return a.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,0,!1);return this.cameraPoint.y>h.y&&(this.cameraPoint.x>o.x&&this.cameraPoint.x<h.x?d.splice(3,0,this.cameraPoint):this.cameraPoint.x>=h.x?d[2]=this.cameraPoint:this.cameraPoint.x<=o.x&&(d[3]=this.cameraPoint)),a.bufferConvexPolygon(d,r)}bufferedCameraGeometryGlobe(r){const o=this.screenBounds[0],h=this.screenBounds.length===1?this.screenBounds[0].add(new a.Point(1,1)):this.screenBounds[1],d=a.polygonizeBounds(o,h,r),f=this.cameraPoint.clone();switch(3*((f.y>o.y)+(f.y>h.y))+((f.x>o.x)+(f.x>h.x))){case 0:d[0]=f,d[4]=f.clone();break;case 1:d.splice(1,0,f);break;case 2:d[1]=f;break;case 3:d.splice(4,0,f);break;case 5:d.splice(2,0,f);break;case 6:d[3]=f;break;case 7:d.splice(3,0,f);break;case 8:d[2]=f}return d}containsTile(r,o,h,d=0){const f=r.queryPadding/o._pixelsPerMercatorPixel+1,g=h?this._bufferedCameraMercator(f,o):this._bufferedScreenMercator(f,o);let y=r.tileID.wrap+(g.unwrapped?d:0);const v=g.polygon.map(F=>
vendor: 4,101 bytes, line 8
8a.getTilePoint(r.tileTransform,F,y));if(!a.polygonIntersectsBox(v,0,0,a.EXTENT,a.EXTENT))return;y=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?d:0);const E=this.screenGeometryMercator.polygon.map(F=>a.getTileVec3(r.tileTransform,F,y)),T=E.map(F=>new a.Point(F[0],F[1])),A=o.getFreeCameraOptions().position||new a.MercatorCoordinate(0,0,0),k=a.getTileVec3(r.tileTransform,A,y),R=E.map(F=>{const I=a.sub(F,F,k);return a.normalize(I,I),new a.Ray(k,I)}),O=ai(r,1,o.zoom)*o._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:T,tilespaceRays:R,bufferedTilespaceGeometry:v,bufferedTilespaceBounds:(B=a.getBounds(v),B.min.x=a.clamp(B.min.x,0,a.EXTENT),B.min.y=a.clamp(B.min.y,0,a.EXTENT),B.max.x=a.clamp(B.max.x,0,a.EXTENT),B.max.y=a.clamp(B.max.y,0,a.EXTENT),B),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:O};var B}_bufferedScreenMercator(r,o){const h=On(r);if(this._screenRaycastCache[h])return this._screenRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(r),o):{polygon:this.bufferedScreenGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._screenRaycastCache[h]=d,d}}_bufferedCameraMercator(r,o){const h=On(r);if(this._cameraRaycastCache[h])return this._cameraRaycastCache[h];{let d;return d=o.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(r),o):{polygon:this.bufferedCameraGeometry(r).map(f=>o.pointCoordinate3D(f)),unwrapped:!0},this._cameraRaycastCache[h]=d,d}}_projectAndResample(r,o){const h=function(f,g){const y=a.multiply([],g.pixelMatrix,g.globeMatrix),v=[0,-a.GLOBE_RADIUS,0,1],E=[0,a.GLOBE_RADIUS,0,1],T=[0,0,0,1];a.transformMat4$1(v,v,y),a.transformMat4$1(E,E,y),a.transformMat4$1(T,T,y);const A=new a.Point(v[0]/v[3],v[1]/v[3]),k=new a.Point(E[0]/E[3],E[1]/E[3]),R=a.polygonContainsPoint(f,A)&&v[3]<T[3],O=a.polygonContainsPoint(f,k)&&E[3]<T[3];if(!R&&!O)return null;const B=function(Y,ie,te){for(let le=1;le<Y.length;le++){const Te=qr(ie.pointCoordinate3D(Y[le-1]).x),oe=qr(ie.pointCoordinate3D(Y[le]).x);if(te<0){if(Te<oe)return{idx:le,t:-Te/(oe-1-Te)}}else if(oe<Te)return{idx:le,t:(1-Te)/(oe+1-Te)}}return null}(f,g,R?-1:1);if(!B)return null;const{idx:F,t:I}=B;let L=F>1?Wt(f.slice(0,F),g):[],N=F<f.length?Wt(f.slice(F),g):[];L=L.map(Y=>new a.Point(qr(Y.x),Y.y)),N=N.map(Y=>new a.Point(qr(Y.x),Y.y));const j=[...L];j.length===0&&j.push(N[N.length-1]);const K=a.number(j[j.length-1].y,(N.length===0?L[0]:N[0]).y,I);let J;return J=R?[new a.Point(0,K),new a.Point(0,0),new a.Point(1,0),new a.Point(1,K)]:[new a.Point(1,K),new a.Point(1,1),new a.Point(0,1),new a.Point(0,K)],j.push(...J),N.length===0?j.push(L[0]):j.push(...N),{polygon:j.map(Y=>new a.MercatorCoordinate(Y.x,Y.y)),unwrapped:!1}}(r,o);if(h)return h;const d=function(f,g){let y=!1,v=-1/0,E=0;for(let A=0;A<f.length-1;A++)f[A].x>v&&(v=f[A].x,E=A);for(let A=0;A<f.length-1;A++){const k=(E+A)%(f.length-1),R=f[k],O=f[k+1];Math.abs(R.x-O.x)>.5&&(R.x<O.x?(R.x+=1,k===0&&(f[f.length-1].x+=1)):(O.x+=1,k+1===f.length-1&&(f[0].x+=1)),y=!0)}const T=a.mercatorXfromLng(g.center.lng);return y&&T<Math.abs(T-1)&&f.forEach(A=>{A.x-=1}),{polygon:f,unwrapped:y}}(Wt(r,o).map(f=>new a.Point(qr(f.x),f.y)),o);return{polygon:d.polygon.map(f=>new a.MercatorCoordinate(f.x,f.y)),unwrapped:d.unwrapped}}}function Wt(l,r){return a.resample(l,o=>{const h=r.pointCoordinate3D(o);o.x=h.x,o.y=h.y},1/256)}function qr(l){return l<0?1+l%1:l%1}function On(l){return 100*l|0}function Wr(l,r,o,h,d){const f=function(g,y){if(g)return d(g);if(y){l.url&&y.tiles&&l.tiles&&delete l.tiles;const v=a.pick(a.extend(y,l),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);y.vector_layers&&(v.vectorLayers=y.vector_layers,v.vectorLayerIds=v.vectorLayers.map(E=>E.id)),v.tiles=r.canonicalizeTileset(v,l.url),d(null,v)}};return l.url?a.getJSON(r.transformRequest(r.normalizeSourceURL(l.url,null,o,h),a.ResourceType.Source),f):a.exported.frame(()=>f(null,l))}class Tr{constructor(r,o,h){this.bounds=a.LngLatBounds.convert(this.validateBounds(r)),this.minzoom=o||0,this.maxzoom=h||24}
vendor: 4,999 bytes, line 8
8validateBounds(r){return Array.isArray(r)&&r.length===4?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const o=Math.pow(2,r.z),h=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*o),d=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*o),f=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*o),g=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*o);return r.x>=h&&r.x<f&&r.y>=d&&r.y<g}}class ys{constructor(r,o,h){this.context=r;const d=r.gl;this.buffer=d.createBuffer(),this.dynamicDraw=!!h,this.context.unbindVAO(),r.bindElementBuffer.set(this.buffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||o.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(r){const o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,r.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const un={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Fn{constructor(r,o,h,d){this.length=o.length,this.attributes=h,this.itemSize=o.bytesPerElement,this.dynamicDraw=d,this.context=r;const f=r.gl;this.buffer=f.createBuffer(),r.bindVertexBuffer.set(this.buffer),f.bufferData(f.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||o.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(r){const o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,r.arrayBuffer)}enableAttributes(r,o){for(let h=0;h<this.attributes.length;h++){const d=o.attributes[this.attributes[h].name];d!==void 0&&r.enableVertexAttribArray(d)}}setVertexAttribPointers(r,o,h){for(let d=0;d<this.attributes.length;d++){const f=this.attributes[d],g=o.attributes[f.name];g!==void 0&&r.vertexAttribPointer(g,f.components,r[un[f.type]],!1,this.itemSize,f.offset+this.itemSize*(h||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class pt{constructor(r){this.gl=r.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(r){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Un extends pt{getDefault(){return a.Color.transparent}set(r){const o=this.current;(r.r!==o.r||r.g!==o.g||r.b!==o.b||r.a!==o.a||this.dirty)&&(this.gl.clearColor(r.r,r.g,r.b,r.a),this.current=r,this.dirty=!1)}}class Li extends pt{getDefault(){return 1}set(r){(r!==this.current||this.dirty)&&(this.gl.clearDepth(r),this.current=r,this.dirty=!1)}}class To extends pt{getDefault(){return 0}set(r){(r!==this.current||this.dirty)&&(this.gl.clearStencil(r),this.current=r,this.dirty=!1)}}class Ut extends pt{getDefault(){return[!0,!0,!0,!0]}set(r){const o=this.current;(r[0]!==o[0]||r[1]!==o[1]||r[2]!==o[2]||r[3]!==o[3]||this.dirty)&&(this.gl.colorMask(r[0],r[1],r[2],r[3]),this.current=r,this.dirty=!1)}}class Vi extends pt{getDefault(){return!0}set(r){(r!==this.current||this.dirty)&&(this.gl.depthMask(r),this.current=r,this.dirty=!1)}}class xs extends pt{getDefault(){return 255}set(r){(r!==this.current||this.dirty)&&(this.gl.stencilMask(r),this.current=r,this.dirty=!1)}}class Er extends pt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(r){const o=this.current;(r.func!==o.func||r.ref!==o.ref||r.mask!==o.mask||this.dirty)&&(this.gl.stencilFunc(r.func,r.ref,r.mask),this.current=r,this.dirty=!1)}}class Ri extends pt{getDefault(){const r=this.gl;return[r.KEEP,r.KEEP,r.KEEP]}set(r){const o=this.current;(r[0]!==o[0]||r[1]!==o[1]||r[2]!==o[2]||this.dirty)&&(this.gl.stencilOp(r[0],r[1],r[2]),this.current=r,this.dirty=!1)}}class Eo extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;r?o.enable(o.STENCIL_TEST):o.disable(o.STENCIL_TEST),this.current=r,this.dirty=!1}}class Vn extends pt{getDefault(){return[0,1]}set(r){const o=this.current;(r[0]!==o[0]||r[1]!==o[1]||this.dirty)&&(this.gl.depthRange(r[0],r[1]),this.current=r,this.dirty=!1)}}class So extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;r?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),this.current=r,this.dirty=!1}}class Xr extends pt{getDefault(){return this.gl.LESS}set(r){(r!==this.current||this.dirty)&&(this.gl.depthFunc(r),this.current=r,this.dirty=!1)}}class Nn extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;r?o.enable(o.BLEND):o.disable(o.BLEND),this.current=r,this.dirty=!1}}class vs extends pt{getDefault(){const r=this.gl;return[r.ONE,r.ZERO]}set(r){const o=this.current;(r[0]!==o[0]||r[1]!==o[1]||this.dirty)&&(this.gl.blendFunc(r[0],r[1]),this.current=r,this.dirty=!1)}}class bs extends pt{getDefault(){return a.Color.transparent}set(r){const o=this.current;(r.r!==o.r||r.g!==o.g||r.b!==o.b||r.a!==o.a||this.dirty)&&(this.gl.blendColor
vendor: 4,487 bytes, line 8
8(r.r,r.g,r.b,r.a),this.current=r,this.dirty=!1)}}class Ni extends pt{getDefault(){return this.gl.FUNC_ADD}set(r){(r!==this.current||this.dirty)&&(this.gl.blendEquation(r),this.current=r,this.dirty=!1)}}class Hr extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;r?o.enable(o.CULL_FACE):o.disable(o.CULL_FACE),this.current=r,this.dirty=!1}}class Mo extends pt{getDefault(){return this.gl.BACK}set(r){(r!==this.current||this.dirty)&&(this.gl.cullFace(r),this.current=r,this.dirty=!1)}}class dn extends pt{getDefault(){return this.gl.CCW}set(r){(r!==this.current||this.dirty)&&(this.gl.frontFace(r),this.current=r,this.dirty=!1)}}let jn,Ao=class extends pt{getDefault(){return null}set(l){(l!==this.current||this.dirty)&&(this.gl.useProgram(l),this.current=l,this.dirty=!1)}};class pn extends pt{getDefault(){return this.gl.TEXTURE0}set(r){(r!==this.current||this.dirty)&&(this.gl.activeTexture(r),this.current=r,this.dirty=!1)}}class Kr extends pt{getDefault(){const r=this.gl;return[0,0,r.drawingBufferWidth,r.drawingBufferHeight]}set(r){const o=this.current;(r[0]!==o[0]||r[1]!==o[1]||r[2]!==o[2]||r[3]!==o[3]||this.dirty)&&(this.gl.viewport(r[0],r[1],r[2],r[3]),this.current=r,this.dirty=!1)}}class fn extends pt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.bindFramebuffer(o.FRAMEBUFFER,r),this.current=r,this.dirty=!1}}class mn extends pt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.bindRenderbuffer(o.RENDERBUFFER,r),this.current=r,this.dirty=!1}}class Gn extends pt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.bindTexture(o.TEXTURE_2D,r),this.current=r,this.dirty=!1}}class ws extends pt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.bindBuffer(o.ARRAY_BUFFER,r),this.current=r,this.dirty=!1}}class Z extends pt{getDefault(){return null}set(r){const o=this.gl;o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),this.current=r,this.dirty=!1}}class z extends pt{constructor(r){super(r),this.vao=r.extVertexArrayObject}getDefault(){return null}set(r){this.vao&&(r!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(r),this.current=r,this.dirty=!1)}}class P extends pt{getDefault(){return 4}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_ALIGNMENT,r),this.current=r,this.dirty=!1}}class G extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this.current=r,this.dirty=!1}}class H extends pt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,r),this.current=r,this.dirty=!1}}class ee extends pt{constructor(r,o){super(r),this.context=r,this.parent=o}getDefault(){return null}}class ne extends ee{setDirty(){this.dirty=!0}set(r){if(r===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,r,0),this.current=r,this.dirty=!1}}class re extends ee{attachment(){return this.gl.DEPTH_ATTACHMENT}set(r){if(r===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferRenderbuffer(o.FRAMEBUFFER,this.attachment(),o.RENDERBUFFER,r),this.current=r,this.dirty=!1}}class Q extends re{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class de{constructor(r,o,h,d){this.context=r,this.width=o,this.height=h;const f=this.framebuffer=r.gl.createFramebuffer();this.colorAttachment=new ne(r,f),d&&(this.depthAttachment=new re(r,f))}destroy(){const r=this.context.gl,o=this.colorAttachment.get();if(o&&r.deleteTexture(o),this.depthAttachment){const h=this.depthAttachment.get();h&&r.deleteRenderbuffer(h)}r.deleteFramebuffer(this.framebuffer)}}class Pe{constructor(r,o=!1){if(this.gl=r,this.isWebGL2=o,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),o){const h=r;this.extVertexArrayObject={createVertexArrayOES:h.createVertexArray.bind(r),deleteVertexArrayOES:h.deleteVertexArray.bind(r),bindVertexArrayOES:h.bindVertexArray.bind(r)}}this.clearColor=new Un(this),this.clearDepth=new Li(this),this.clearStencil=new To(this),this.colorMask=new Ut(this),this.depthMask=new Vi(this),this.stencilMask=new xs(this),this.stencilFunc=new Er(this),this.stencilOp=new Ri(this),this.stencilTest=new E
vendor: 6,224 bytes, line 8
8o(this),this.depthRange=new Vn(this),this.depthTest=new So(this),this.depthFunc=new Xr(this),this.blend=new Nn(this),this.blendFunc=new vs(this),this.blendColor=new bs(this),this.blendEquation=new Ni(this),this.cullFace=new Hr(this),this.cullFaceSide=new Mo(this),this.frontFace=new dn(this),this.program=new Ao(this),this.activeTexture=new pn(this),this.viewport=new Kr(this),this.bindFramebuffer=new fn(this),this.bindRenderbuffer=new mn(this),this.bindTexture=new Gn(this),this.bindVertexBuffer=new ws(this),this.bindElementBuffer=new Z(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new z(this),this.pixelStoreUnpack=new P(this),this.pixelStoreUnpackPremultiplyAlpha=new G(this),this.pixelStoreUnpackFlipY=new H(this),this.extTextureFilterAnisotropic=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=r.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=r.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=r.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=r.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),o||(this.extTextureHalfFloat=r.getExtension("OES_texture_half_float")),(o||this.extTextureHalfFloat&&r.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=r.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=o||r.getExtension("OES_standard_derivatives"),this.extTimerQuery=r.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE)}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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(r,o){return new ys(this,r,o)}createVertexBuffer(r,o,h){return new Fn(this,r,o,h)}createRenderbuffer(r,o,h){const d=this.gl,f=d.createRenderbuffer();return this.bindRenderbuffer.set(f),d.renderbufferStorage(d.RENDERBUFFER,r,o,h),this.bindRenderbuffer.set(null),f}createFramebuffer(r,o,h){return new de(this,r,o,h)}clear({color:r,depth:o,stencil:h}){const d=this.gl;let f=0;r&&(f|=d.COLOR_BUFFER_BIT,this.clearColor.set(r),this.colorMask.set([!0,!0,!0,!0])),o!==void 0&&(f|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(o),this.depthMask.set(!0)),h!==void 0&&(f|=d.STENCIL_BUFFER_BIT,this.clearStencil.set(h),this.stencilMask.set(255)),d.clear(f)}setCullFace(r){r.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(r.mode),this.frontFace.set(r.frontFace))}setDepthMode(r){r.func!==this.gl.ALWAYS||r.mask?(this.depthTest.set(!0),this.depthFunc.set(r.func),this.depthMask.set(r.mask),this.depthRange.set(r.range)):this.depthTest.set(!1)}setStencilMode(r){r.test.func!==this.gl.ALWAYS||r.mask?(this.stencilTest.set(!0),this.stencilMask.set(r.mask),this.stencilOp.set([r.fail,r.depthFail,r.pass]),this.stencilFunc.set({func:r.test.func,ref:r.ref,mask:r.test.mask})):this.stencilTest.set(!1)}setColorMode(r){Se(r.blendFunction,a.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(r.blendFunction),this.blendColor.set(r.blendColor)),this.colorMask.set(r.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class ke extends a.Evented{constructor(r,o,h,d){if(super(),this.id=r,this.dispatcher=h,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,a.extend(this,a.pick(o,["url","scheme","tileSize","promoteId"])),this._options=a.extend({type:"vector"},o),this._collectResourceTiming=o.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d),this._tileWorkers={},this._deduped=new a.DedupedRequest}load(r){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"}));const o=Array.isArray(this.map._language)?this.map._language.join():this.map._language,h=this.map._worldview;this._tileJSONRequest=Wr(this._options,this.map._requestManager,o,h,(d,f)=>{this._tileJSONRequest=null,this._loaded=!0,d?(o&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${o}`),h&&h.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${h}`),this.fire(new a.ErrorEvent(d))):f&&(a.extend(this,f),f.bounds&&(this.tileBounds=new Tr(f.boun
8ds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(f.tiles,this.map._requestManager._customAccessToken),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(d)})}loaded(){return this._loaded}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}loadTile(r,o){const h=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),d={request:this.map._requestManager.transformRequest(h,a.ResourceType.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.t
8ype,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile};if(d.request.collectResourceTiming=this._collectResourceTiming,r.actor&&r.state!=="expired")r.state==="loading"?r.reloadCallback=o:r.request=r.actor.send("reloadTile",d,f.bind(this));else if(r.actor=this._tileWorkers[h]=this._tileWorkers[h]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",d,f.bind(this),void 0,!0);else{const g=a.loadVectorTile.call({deduped:this._deduped},d,(y,v)=>{y||!v?f.call(this,y):(d.data={cacheControl:v.cacheControl,expires:v.expires,rawData:v.rawData.slice(0)},r.actor&&r.actor.send("loadTile",d,f.bind(this),void 0,!0))},!0);r.request={cancel:g}}function f(g,y){return delete r.request,r.aborted?o(null):g&&g.status!==404?o(g):(y&&y.resourceTiming&&(r.resourceTiming=y.resourceTiming),this.map._refreshExpiredTiles&&y&&r.setExpiryData(y),r.loadVectorData(y,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),o(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(r){r.request&&(r.request.cancel(),delete r.request),r.actor&&r.actor.send("abortTile",{uid:r.uid,type:this.t
vendor: 8,875 bytes, line 8
8ype,source:this.id})}unloadTile(r){r.unloadVectorData(),r.actor&&r.actor.send("removeTile",{uid:r.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Ie extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},o),a.extend(this,a.pick(o,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Wr(this._options,this.map._requestManager,null,null,(o,h)=>{this._tileJSONRequest=null,this._loaded=!0,o?this.fire(new a.ErrorEvent(o)):h&&(a.extend(this,h),h.bounds&&(this.tileBounds=new Tr(h.bounds,this.minzoom,this.maxzoom)),a.postTurnstileEvent(h.tiles),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(r){return this._options.tiles=r,this.reload(),this}setUrl(r){return this.url=r,this._options.url=r,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return a.extend({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r,o){const h=a.exported.devicePixelRatio>=2,d=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),h,this.tileSize);r.request=a.getImage(this.map._requestManager.transformRequest(d,a.ResourceType.Tile),(f,g,y,v)=>(delete r.request,r.aborted?(r.state="unloaded",o(null)):f?(r.state="errored",o(f)):g?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:y,expires:v}),r.setTexture(g,this.map.painter),r.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),void o(null)):o(null)))}static loadTileData(r,o,h){r.setTexture(o,h)}static unloadTileData(r,o){r.texture&&o.saveTileTexture(r.texture)}abortTile(r,o){r.request&&(r.request.cancel(),delete r.request),o()}unloadTile(r,o){r.texture&&this.map.painter.saveTileTexture(r.texture),o()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Je(l,r,o,h,d,f,g,y){const v=[l,o,d,r,h,f,1,1,1],E=[g,y,1],T=a.adjoint([],v),[A,k,R]=a.transformMat3(E,E,a.transpose(T,T));return a.multiply$1(v,[A,0,0,0,k,0,0,0,R],v)}class rt extends a.Evented{constructor(r,o,h,d){super(),this.id=r,this.dispatcher=h,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o,this._dirty=!1}load(r,o){this._loaded=o||!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(h,d)=>{if(this._imageRequest=null,this._loaded=!0,h)this.fire(new a.ErrorEvent(h));else if(d){const{HTMLImageElement:f}=a.window;this.image=d instanceof f?a.exported.getImageData(d):d,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,r&&(this.coordinates=r),this._finishLoading()}})}loaded(){return this._loaded}updateImage(r){return this.image&&r.url?(this._imageRequest&&r.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=r.url,this.load(r.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(r){this.coordinates=r,this._boundsArray=void 0;const o=r.map(a.MercatorCoordinate.fromLngLat);return this.tileID=function(h){let d=1/0,f=1/0,g=-1/0,y=-1/0;for(const A of h)d=Math.min(d,A.x),f=Math.min(f,A.y),g=Math.max(g,A.x),y=Math.max(y,A.y);const v=Math.max(g-d,y-f),E=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),T=Math.pow(2,E);return new a.CanonicalTileID(E,Math.floor((d+g)/2*T),Math.floor((f+y)/2*T))}(o),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(r){for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}if(this._boundsArray)return;const o=a.tileTransform(this.tileID,this.map.transform.projection),[h,d,f,g]=this.coordinates.map(v=>{const E=o.projection.project(v[0],v[1]);return a.getTilePoint(o,E)._round()});this.perspectiveTransform=function(v,E,T,A,k,R,O,B,F,I){const L=Je(0,0,v,0,0,E,v,E),N=Je(T,A,k,R,O,B,F,I);return a.multiply$1(N,a.adjoint(L,L),N),[N[6]/N[8]*v/a.EXTENT,N[7]/N[8]*E/a.EXTENT]}(this.width,this.height,h.x,h.y,d.x,d.y,g.x,g.y,f.x,f.y);const y=this._boundsArray=new a.StructArrayLayout4i8;y.emplaceBack(h.x,h.y,0,0),y.emplaceBack(d.x,d.y,a.EXTENT,0),y.emplaceBack(g.x,g.y,0,a.EXTENT),y.emplaceBack(f.x,f.y,a.EXTENT,a.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=r.createVertexBuffer(y,a.boundsAttributes.members),this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const r=this.map.painter.context,o=r.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new a.Texture(r,this.image,o.RGBA),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(r)}loadTile(r,o){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={},o(null)):(r.state="errored",o(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Qe={vector:ke,raster:Ie,"raster-dem":class extends Ie{constructor(l,r,o,h){super(l,r,o,h),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}loadTile(l,r){const o=this.map._requestManager.normalizeTileURL(l.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function h(d,f){d&&(l.state="errored",r(d)),f&&(l.dem=f,l.dem.onDeserialize(),l.needsHillshadePrepare=!0,l.needsDEMTextureUpload=!0,l.state="loaded",r(null))}l.request=a.getImage(this.map._requestManager.transformRequest(o,a.ResourceType.Tile),(function(d,f,g,y){if(delete l.request,l.aborted)l.state="unloaded",r(null);else if(d)l.state="errored",r(d);else if(f){this.map._refreshExpiredTiles&&l.setExpiryData({cacheControl:g,expires:y});const v=a.window.ImageBitmap&&f instanceof a.window.ImageBitmap&&(jn==null&&(jn=a.window.OffscreenCanvas&&new a.window.OffscreenCanvas(1,1).getContext("2d")&&typeof a.window.createImageBitmap=="function"),jn),E=1-(f.width-a.prevPowerOfTwo(f.width))/2;E<1||l.neighboringTiles||(l.neighboringTiles=this._getNeighboringTiles(l.tileID));const T=v?f:a.exported.getImageData(f,E),A={uid:l.uid,coord:l.tileID,source:this.id,rawImageData:T,encoding:this.encoding,padding:E};l.actor&&l.state!=="expired"||(l.actor=this.dispatcher.getActor(),l.actor.send("loadDEMTile",A,h.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(l){const r=l.canonical,o=Math.pow(2,r.z),h=(r.x-1+o)%o,d=r.x===0?l.wrap-1:l.wrap,f=(r.x+1+o)%o,g=r.x+1===o?l.wrap+1:l.wrap,y={};return y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y).key]={backfilled:!1},r.y>0&&(y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,l.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y-1).key]={backfilled:!1}),r.y+1<o&&(y[new a.OverscaledTileID(l.overscaledZ,d,r.z,h,r.y+1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,l.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},y[new a.OverscaledTileID(l.overscaledZ,g,r.z,f,r.y+1).key]={backfilled:!1}),y}unloadTile(l){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state="unloaded"}},geojson:class extends a.Evented{constructor(l,r,o,h){super(),this.id=l,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(h),this._data=r.data,this._options=a.extend({},r),this._collectResourceTiming=r.collectResourceTiming,r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.t
8ype=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const d=a.EXTENT/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(r.buffer!==void 0?r.buffer:128)*d,tolerance:(r.tolerance!==void 0?r.tolerance:.375)*d,extent:a.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:r.clusterMaxZoom!==void 0?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:a.EXTENT,radius:(r.clusterRadius!==void 0?r.clusterRadius:50)*d,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}onAdd(l){this.map=l,this.setData(this._data)}setData(l){return this._data=l,this._updateWorkerData(),this}getClusterExpansionZoom(l,r){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:l,source:this.id},r),this}getClusterChildren(l,r){return this.actor.send("geojson.getClusterChildren",{clusterId:l,source:this.id},r),this}getClusterLeaves(l,r,o,h){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:l,limit:r,offset:o},h),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new a.Event("dataloading",{dataType:"source"})),this._loaded=!1;const l=a.extend({},this.workerOptions),r=this._data;typeof r=="string"?(l.request=this.map._requestManager.transformRequest(a.exported.resolveURL(r),a.ResourceType.Source),l.request.collectResourceTiming=this._collectResourceTiming):l.data=JSON.stringify(r),this._pendingLoad=this.actor.send(`${this.type}.loadData`,l,(o,h)=>{if(this._loaded=!0,this._pendingLoad=null,o)this.fire(new a.ErrorEvent(o));else{const d={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&h&&h.resourceTiming&&h.resourceTiming[this.id]&&(d.resourceTiming=h.resourceTiming[this.id]),this.fire(new a.Event("data",d)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(l,r){const o=l.actor?"reloadTile":"loadTile";
8l.actor=this.actor,l.request=this.actor.send(o,{type:this.type,uid:l.uid,tileID:l.tileID,tileZoom:l.tileZoom,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(h,d)=>(delete l.request,l.unloadVectorData(),l.aborted?r(null):h?r(h):(l.loadVectorData(d,this.map.painter,o==="reloadTile"),r(null))),void 0,o==="loadTile")}abortTile(l){l.request&&(l.request.cancel(),delete l.request),l.aborted=!0}unloadTile(l){l.unloadVectorData(),this.actor.send("removeTile",{uid:l.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends rt{constructor(l,r,o,h){super(l,r,o,h),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;const l=this.options;this.urls=[];for(const r of l.urls)this.urls.push(this.map._requestManager.transformRequest(r,a.ResourceType.Source).url);a.getVideo(this.urls,(r,o)=>{this._loaded=!0,r?this.fire(new a.ErrorEvent(r)):o&&(this.video=o,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){const r=this.video.seekable;l<r.start(0)||l>r.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,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 l=this.map.painter.context,r=l.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new a.Texture(l,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(l)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:rt,canvas:class extends rt{constructor(l,r,o,h){super(l,r,o,h),r.coordinates?Array.isArray(r.coordinates)&&r.coordinates.length===4&&!r.coordinates.some(d=>!Array.isArray(d)||d.length!==2||d.some(f=>typeof f!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas=="string"||r.canvas instanceof a.window.HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${l}`,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 a.ErrorEvent(new a.ValidationError(`sources.${l}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof a.window.HTMLCanvasElement?this.options.canvas:a.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.ErrorEvent(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(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const r=this.map.painter.context;this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new a.Texture(r,this.canvas,r.gl.RGBA,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}},custom:class extends a.Evented{constructor(l,r,o,h){super(),this.id=l,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=r,this.setEventedParent(h),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new a.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new a.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Tr(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),a.extend(this,a.pick(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileC
8acheSize"]))}serialize(){return a.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(l){this._map=l,this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(l),this.load()}onRemove(l){this._implementation.onRemove&&this._implementation.onRemove(l)}hasTile(l){if(this._implementation.hasTile){const{x:r,y:o,z:h}=l.canonical;return this._implementation.hasTile({x:r,y:o,z:h})}return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l,r){const{x:o,y:h,z:d}=l.tileID.canonical,f=new a.window.AbortController;l.request=Promise.resolve(this._implementation.loadTile({x:o,y:h,z:d},{signal:f.signal})).then((function(g){return delete l.request,l.aborted?(l.state="unloaded",r(null)):g===void 0?(l.state="errored",r(null)):g===null?(this.loadTileData(l,{width:this.tileSize,height:this.tileSize,data:null}),l.state="loaded",r(null)):function(y){return y instanceof a.window.ImageData||y instanceof a.window.HTMLCanvasElement||y instanceof a.window.ImageBitmap||y instanceof a.window.HTMLImageElement}(g)?(this.loadTileData(l,g),l.state="loaded",void r(null)):(l.state="errored",r(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(g=>{g.code!==20&&(l.state="errored",r(g))}),l.request.cancel=()=>f.abort()}loadTileData(l,r){Ie.loadTileData(l,r,this._map.painter)}unloadTileData(l){Ie.unloadTileData(l,this._map.painter)}unloadTile(l,r){if(this.unloadTileData(l),this._implementation.unloadTile){const{x:o,y:h,z:d}=l.tileID.canonical;this._implementation.unloadTile({x:o,y:h,z:d})}r()}abortTile(l,r){l.request&&l.request.cancel&&(l.request.cancel(),delete l.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(l=>({x:l.canonical.x,y:l.canonical.y,z:l.canonical.z}))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"}))}}},nt=function(l,r,o,h){const d=new Qe[r.type](l,r,o,h);if(d.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${d.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],d),d};function ft(l,r){const o=a.identity([]);return a.scale(o,o,[.5*l.width,.5*-l.height,1]),a.translate(o,o,[1,-1,0]),a.multiply(o,o,l.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(o)}function Vt(l,r,o,h,d,f,g,y=!1){const v=l.tilesIn(h,g,y);v.sort(yi);const E=[];for(const A of v)E.push({wrappedTileID:A.tile.tileID.wrapped().key,queryResults:A.tile.queryRenderedFeatures(r,o,l._state,A,d,f,ft(l.transform,A.tile.tileID),y)});const T=function(A){const k={},R={};for(const O of A){const B=O.queryResults,F=O.wrappedTileID,I=R[F]=R[F]||{};for(const L in B){const N=B[L],j=I[L]=I[L]||{},K=k[L]=k[L]||[];for(const J of N)j[J.featureIndex]||(j[J.featureIndex]=!0,K.push(J))}}return k}(E);for(const A in T)T[A].forEach(k=>{const R=k.feature,O=R.layer;O&&O.type!=="background"&&O.type!=="sky"&&(R.source=O.source,O["source-layer"]&&(R.sourceLayer=O["source-layer"]),R.state=R.id!==void 0?l.getFeatureState(O["source-layer"],R.id):{})});return T}function Xt(l,r){const o=l.getRenderableIds().map(f=>l.getTileByID(f)),h=[],d={};for(let f=0;f<o.length;f++){const g=o[f],y=g.tileID.canonical.key;d[y]||(d[y]=!0,g.querySourceFeatures(h,r))}return h}function yi(l,r){const o=l.tileID,h=r.tileID;return o.overscaledZ-h.overscaledZ||o.canonical.y-h.canonical.y||o.wrap-h.wrap||o.canonical.x-h.canonical.x}function ri(){return lo.workerClass!=null?new lo.workerClass:new a.window.Worker(lo.workerUrl)}const ar="mapboxgl_preloaded_worker_pool";class li{constructor(){this.active={}}acquire(r){if(!this.workers)for(this.workers=[];this.workers.length<li.workerCount;)this.workers.push(new ri);return this.active[r]=!0,this.workers.slice()}release(r){delete this.active[r],this.numActive()===0&&(this.workers.forEac
vendor: 8,358 bytes, line 8
8h(o=>{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ar]}numActive(){return Object.keys(this.active).length}}let Ti;function $n(){return Ti||(Ti=new li),Ti}function Ah(l,r){const o={};for(const h in l)h!=="ref"&&(o[h]=l[h]);return a.refProperties.forEach(h=>{h in r&&(o[h]=r[h])}),o}function tc(l){l=l.slice();const r=Object.create(null);for(let o=0;o<l.length;o++)r[l[o].id]=l[o];for(let o=0;o<l.length;o++)"ref"in l[o]&&(l[o]=Ah(l[o],r[l[o].ref]));return l}li.workerCount=2;const vt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function Ea(l,r,o){o.push({command:vt.addSource,args:[l,r[l]]})}function Io(l,r,o){r.push({command:vt.removeSource,args:[l]}),o[l]=!0}function Sa(l,r,o,h){Io(l,o,h),Ea(l,r,o)}function Ts(l,r,o){let h;for(h in l[o])if(l[o].hasOwnProperty(h)&&h!=="data"&&!Se(l[o][h],r[o][h]))return!1;for(h in r[o])if(r[o].hasOwnProperty(h)&&h!=="data"&&!Se(l[o][h],r[o][h]))return!1;return!0}function lr(l,r,o,h,d,f){let g;for(g in r=r||{},l=l||{})l.hasOwnProperty(g)&&(Se(l[g],r[g])||o.push({command:f,args:[h,g,r[g],d]}));for(g in r)r.hasOwnProperty(g)&&!l.hasOwnProperty(g)&&(Se(l[g],r[g])||o.push({command:f,args:[h,g,r[g],d]}))}function Sr(l){return l.id}function Ma(l,r){return l[r.id]=r,l}class Aa{constructor(r,o){this.reset(r,o)}reset(r,o){this.points=r||[],this._distances=[0];for(let h=1;h<this.points.length;h++)this._distances[h]=this._distances[h-1]+this.points[h].dist(this.points[h-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(r){if(this.points.length===1)return this.points[0];r=a.clamp(r,0,1);let o=1,h=this._distances[o];const d=r*this.paddedLength+this.padding;for(;h<d&&o<this._distances.length;)h=this._distances[++o];const f=o-1,g=this._distances[f],y=h-g,v=y>0?(d-g)/y:0;return this.points[f].mult(1-v).add(this.points[o].mult(v))}}class _n{constructor(r,o,h){const d=this.boxCells=[],f=this.circleCells=[];this.xCellCount=Math.ceil(r/h),this.yCellCount=Math.ceil(o/h);for(let g=0;g<this.xCellCount*this.yCellCount;g++)d.push([]),f.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=r,this.height=o,this.xScale=this.xCellCount/r,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(r,o,h,d,f){this._forEachCell(o,h,d,f,this._insertBoxCell,this.boxUid++),this.boxKeys.push(r),this.bboxes.push(o),this.bboxes.push(h),this.bboxes.push(d),this.bboxes.push(f)}insertCircle(r,o,h,d){this._forEachCell(o-d,h-d,o+d,h+d,this._insertCircleCell,this.circleUid++),this.circleKeys.push(r),this.circles.push(o),this.circles.push(h),this.circles.push(d)}_insertBoxCell(r,o,h,d,f,g){this.boxCells[f].push(g)}_insertCircleCell(r,o,h,d,f,g){this.circleCells[f].push(g)}_query(r,o,h,d,f,g){if(h<0||r>this.width||d<0||o>this.height)return!f&&[];const y=[];if(r<=0&&o<=0&&this.width<=h&&this.height<=d){if(f)return!0;for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const E=this.circles[3*v],T=this.circles[3*v+1],A=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:E-A,y1:T-A,x2:E+A,y2:T+A})}return g?y.filter(g):y}return this._forEachCell(r,o,h,d,this._queryCell,y,{hitTest:f,seenUids:{box:{},circle:{}}},g),f?y.length>0:y}_queryCircle(r,o,h,d,f){const g=r-h,y=r+h,v=o-h,E=o+h;if(y<0||g>this.width||E<0||v>this.height)return!d&&[];const T=[];return this._forEachCell(g,v,y,E,this._queryCellCircle,T,{hitTest:d,circle:{x:r,y:o,radius:h},seenUids:{box:{},circle:{}}},f),d?T.length>0:T}query(r,o,h,d,f){return this._query(r,o,h,d,!1,f)}hitTest(r,o,h,d,f){return this._query(r,o,h,d,!0,f)}hitTestCircle(r,o,h,d){return this._queryCircle(r,o,h,!0,d)}_queryCell(r,o,h,d,f,g,y,v){const E=y.seenUids,T=this.boxCells[f];if(T!==null){const k=this.bboxes;for(const R of T)if(!E.box[R]){E.box[R]=!0;const O=4*R;if(r<=k[O+2]&&o<=k[O+3]&&h>=k[O+0]&&d>=k[O+1]&&(!v||v(this.boxKeys[R]))){if(y.hitTest)return g.push(!0),!0;g.push({key:this.boxKeys[R],x1:k[O],y1:k[O+1],x2:k[O+2],y2:k[O+3]})}}}const A=this.circleCells[f];if(A!==null){const k=this.circles;for(const R of A)if(!E.circle[R]){E.circle[R]=!0;const O=3*R;if(this._circleAndRectCollide(k[O],k[O+1],k[O+2],r,o,h,d)&&(!v||v(this.circleKeys[R]))){if(y.hitTest)return g.push(!0),!0;{const B=k[O],F=k[O+1],I=k[O+2];g.push({key:this.circleKeys[R],x1:B-I,y1:F-I,x2:B+I,y2:F+I})}}}}}_queryCellCircle(r,o,h,d,f,g,y,v){const E=y.circle,T=y.seenUids,A=this.boxCells[f];if(A!==null){const R=this.bboxes;for(const O of A)if(!T.box[O]){T.box[O]=!0;const B=4*O;if(this._circleAndRectCollide(E.x,E.y,E.radius,R[B+0],R[B+1],R[B+2],R[B+3])&&(!v||v(this.boxKeys[O])))return g.push(!0),!0}}const k=this.circleCells[f];if(k!==null){const R=this.circles;for(const O of k)if(!T.circle[O]){T.circle[O]=!0;const B=3*O;if(this._circlesCollide(R[B],R[B+1],R[B+2],E.x,E.y,E.radius)&&(!v||v(this.circleKeys[O])))return g.push(!0),!0}}}_forEachCell(r,o,h,d,f,g,y,v){const E=this._convertToXCellCoord(r),T=this._convertToYCellCoord(o),A=this._convertToXCellCoord(h),k=this._convertToYCellCoord(d);for(let R=E;R<=A;R++)for(let O=T;O<=k;O++)if(f.call(this,r,o,h,d,this.xCellCount*O+R,g,y,v))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,o,h,d,f,g){const y=d-r,v=f-o,E=h+g;return E*E>y*y+v*v}_circleAndRectCollide(r,o,h,d,f,g,y){const v=(g-d)/2,E=Math.abs(r-(d+v));if(E>v+h)return!1;const T=(y-f)/2,A=Math.abs(o-(f+T));if(A>T+h)return!1;if(E<=v||A<=T)return!0;const k=E-v,R=A-T;return k*k+R*R<=h*h}}const Mr={unknown:0,flipRequired:1,flipNotRequired:2},Co=Math.tan(85*Math.PI/180);function fe(l,r,o,h,d,f,g){const y=a.create();if(o)if(f.name==="globe"){const v=a.calculateGlobeLabelMatrix(d,r);a.multiply(y,y,v)}else{const v=Le([],g);y[0]=v[0],y[1]=v[1],y[4]=v[2],y[5]=v[3],h||a.rotateZ(y,y,d.angle)}else a.multiply(y,d.labelPlaneMatrix,l);return y}function Ar(l,r,o,h,d,f,g){const y=fe(l,r,o,h,d,f,g);return f.name==="globe"&&o||(y[2]=y[6]=y[10]=y[14]=0),y}function Ht(l,r,o,h,d,f,g){if(o){if(f.name==="globe"){const y=fe(l,r,o,h,d,f,g);return a.invert(y,y),a.multiply(y,l,y),y}{const y=a.clone(l),v=a.identity([]);return v[0]=g[0],v[1]=g[1],v[4]=g[2],v[5]=g[3],a.multiply(y,y,v),h||a.rotateZ(y,y,-d.angle),y}}return d.glCoordMatrix}function ci(l,r,o,h){const d=[l,r,o,1];o?a.transformMat4$1(d,d,h):at(d,d,h);const f=d[3];return d[0]/=f,d[1]/=f,d[2]/=f,d}function ic(l,r){return Math.min(.5+l/r*.5,1.5)}function cr(l,r){const o=l[0]/l[3],h=l[1]/l[3];return o>=-r[0]&&o<=r[0]&&h>=-r[1]&&h<=r[1]}function Ia(l,r,o,h,d,f,g,y,v,E){const T=o.transform,A=h?l.textSizeData:l.iconSizeData,k=a.evaluateSizeForZoom(A,o.transform.zoom),R=T.projection.name==="globe",O=[256/o.width*2+1,256/o.height*2+1],B=h?l.text.dynamicLayoutVertexArray:l.icon.dynamicLayoutVertexArray;B.clear();let F=null;R&&(F=h?l.text.globeExtVertexArray:l.icon.globeExtVertexArray);const I=l.lineVertexArray,L=h?l.text.placedSymbolArray:l.icon.placedSymbolArray,N=o.transform.width/o.transform.height;let j,K=!1;for(let J=0;J<L.length;J++){const Y=L.get(J),{numGlyphs:ie,writingMode:te}=Y;if(te!==a.WritingMode.vertical||K||j===a.WritingMode.horizontal||(K=!0),j=te,(Y.hidden||te===a.WritingMode.vertical)&&!K){tr(ie,B);continue}K=!1;const le=new a.Point(Y.tileAnchorX,Y.tileAnchorY);let{x:Te,y:oe,z:ge}=T.projection.projectTilePoint(le.x,le.y,E.canonical);if(v){const[Xe,Ve,qe]=v(le);Te+=Xe,oe+=Ve,ge+=qe}const he=[Te,oe,ge,1];if(a.transformMat4$1(he,he,r),!cr(he,O)){tr(ie,B);continue}const we=ic(o.transform.cameraToCenterDistance,he[3]),ae=a.evaluateSizeForFeature
vendor: 25,805 bytes, line 8
8(A,k,Y),_e=g?ae/we:ae*we,Me=ci(Te,oe,ge,d);if(Me[3]<=0){tr(ie,B);continue}let ve={};const Ae=g?null:v,Ge=Oe(Y,_e,!1,y,r,d,f,l.glyphOffsetArray,I,B,F,Me,le,ve,N,Ae,T.projection,E,g);K=Ge.useVertical,Ae&&Ge.needsFlipping&&(ve={}),(Ge.notEnoughRoom||K||Ge.needsFlipping&&Oe(Y,_e,!0,y,r,d,f,l.glyphOffsetArray,I,B,F,Me,le,ve,N,Ae,T.projection,E,g).notEnoughRoom)&&tr(ie,B)}h?(l.text.dynamicLayoutVertexBuffer.updateData(B),F&&l.text.globeExtVertexBuffer.updateData(F)):(l.icon.dynamicLayoutVertexBuffer.updateData(B),F&&l.icon.globeExtVertexBuffer.updateData(F))}function rc(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const{lineStartIndex:F,glyphStartIndex:I,segment:L}=y,N=I+y.numGlyphs,j=F+y.lineLength,K=r.getoffsetX(I),J=r.getoffsetX(N-1),Y=Bi(l*K,o,h,d,f,g,L,F,j,v,E,T,A,k,!0,R,O,B);if(!Y)return null;const ie=Bi(l*J,o,h,d,f,g,L,F,j,v,E,T,A,k,!0,R,O,B);return ie?{first:Y,last:ie}:null}function Zn(l,r,o,h){return l===a.WritingMode.horizontal&&Math.abs(h)>Math.abs(o)?{useVertical:!0}:l===a.WritingMode.vertical?h>0?{needsFlipping:!0}:null:r!==Mr.unknown&&function(d,f){return d===0||Math.abs(f/d)>Co}(o,h)?r===Mr.flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null}function Oe(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const N=r/24,j=l.lineOffsetX*N,K=l.lineOffsetY*N,{lineStartIndex:J,glyphStartIndex:Y,numGlyphs:ie,segment:te,writingMode:le,flipState:Te}=l,oe=J+l.lineLength,ge=he=>{if(T){const[Me,ve,Ae]=he.up,Ge=E.length;a.updateGlobeVertexNormal(T,Ge+0,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+1,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+2,Me,ve,Ae),a.updateGlobeVertexNormal(T,Ge+3,Me,ve,Ae)}const[we,ae,_e]=he.point;a.addDynamicAttributes(E,we,ae,_e,he.angle)};if(ie>1){const he=rc(N,y,j,K,o,A,k,l,v,f,R,B,!1,F,I,L);if(!he)return{notEnoughRoom:!0};if(h&&!o){let[we,ae,_e]=he.first.point,[Me,ve,Ae]=he.last.point;[we,ae]=ci(we,ae,_e,g),[Me,ve]=ci(Me,ve,Ae,g);const Ge=Zn(le,Te,(Me-we)*O,ve-ae);if(l.flipState=Ge&&Ge.needsFlipping?Mr.flipRequired:Mr.flipNotRequired,Ge)return Ge}ge(he.first);for(let we=Y+1;we<Y+ie-1;we++){const ae=Bi(N*y.getoffsetX(we),j,K,o,A,k,te,J,oe,v,f,R,B,!1,!1,F,I,L);if(!ae)return E.length-=4*(we-Y),{notEnoughRoom:!0};ge(ae)}ge(he.last)}else{if(h&&!o){const we=ci(k.x,k.y,0,d),ae=J+te+1,_e=new a.Point(v.getx(ae),v.gety(ae)),Me=ci(_e.x,_e.y,0,d),ve=Me[3]>0?Me:st(k,_e,we,1,d,void 0,F,I.canonical),Ae=Zn(le,Te,(ve[0]-we[0])*O,ve[1]-we[1]);if(l.flipState=Ae&&Ae.needsFlipping?Mr.flipRequired:Mr.flipNotRequired,Ae)return Ae}const he=Bi(N*y.getoffsetX(Y),j,K,o,A,k,te,J,oe,v,f,R,B,!1,!1,F,I,L);if(!he)return{notEnoughRoom:!0};ge(he)}return{}}function ut(l,r,o,h,d){const{x:f,y:g,z:y}=h.projectTilePoint(l.x,l.y,r);if(!d)return ci(f,g,y,o);const[v,E,T]=d(l);return ci(f+v,g+E,y+T,o)}function st(l,r,o,h,d,f,g,y){const v=ut(l.sub(r)._unit()._add(l),y,d,g,f);return a.sub(v,o,v),a.normalize(v,v),a.scaleAndAdd(v,o,v,h)}function Bi(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I){const L=h?l-r:l+r;let N=L>0?1:-1,j=0;h&&(N*=-1,j=Math.PI),N<0&&(j+=Math.PI);let K=y+g+(N>0?0:1)|0,J=d,Y=d,ie=0,te=0;const le=Math.abs(L),Te=[],oe=[];let ge=f,he=ge;const we=()=>st(he,ge,Y,le-ie+1,T,k,B,F.canonical);for(;ie+te<=le;){if(K+=N,K<y||K>=v)return null;if(Y=J,he=ge,Te.push(Y),R&&oe.push(he),ge=new a.Point(E.getx(K),E.gety(K)),J=A[K],!J){const qe=ut(ge,F.canonical,T,B,k);J=qe[3]>0?A[K]=qe:we()}ie+=te,te=a.distance(Y,J)}O&&k&&(A[K]&&(J=we(),te=a.distance(Y,J)),A[K]=J);const ae=(le-ie)/te,_e=ge.sub(he)._mult(ae)._add(he),Me=a.sub([],J,Y),ve=a.scaleAndAdd([],Y,Me,ae);let Ae=[0,0,1],Ge=Me[0],Xe=Me[1];if(I&&(Ae=B.upVector(F.canonical,_e.x,_e.y),Ae[0]!==0||Ae[1]!==0||Ae[2]!==1)){const qe=[Ae[2],0,-Ae[0]],lt=a.cross([],Ae,qe);a.normalize(qe,qe),a.normalize(lt,lt),Ge=a.dot(Me,qe),Xe=a.dot(Me,lt)}if(o){const qe=a.cross([],Ae,Me);a.normalize(qe,qe),a.scaleAndAdd(ve,ve,qe,o*N)}const Ve=j+Math.atan2(Xe,Ge);return Te.push(ve),R&&oe.push(_e),{point:ve,angle:Ve,path:Te,tilePath:oe,up:Ae}}function tr(l,r){const o=r.length,h=o+4*l;r.resize(h),r.float32.fill(-1/0,4*o,4*h)}function at(l,r,o){const h=r[0],d=r[1];return l[0]=o[0]*h+o[4]*d+o[12],l[1]=o[1]*h+o[5]*d+o[13],l[3]=o[3]*h+o[7]*d+o[15],l}const Oi=100;class zo{constructor(r,o,h=new _n(r.width+200,r.height+200,25),d=new _n(r.width+200,r.height+200,25)){this.transform=r,this.grid=h,this.ignoredGrid=d,this.pitchfactor=Math.cos(r._pitch)*r.cameraToCenterDistance,this.screenRightBoundary=r.width+Oi,this.screenBottomBoundary=r.height+Oi,this.gridRightBoundary=r.width+200,this.gridBottomBoundary=r.height+200,this.fogState=o}placeCollisionBox(r,o,h,d,f,g,y,v){let E=h.projectedAnchorX,T=h.projectedAnchorY,A=h.projectedAnchorZ;const k=h.elevation,R=h.tileID,O=r.getProjection();if(k&&R){const[J,Y,ie]=O.upVector(R.canonical,h.tileAnchorX,h.tileAnchorY),te=O.upVectorScale(R.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;E+=J*k*te,T+=Y*k*te,A+=ie*k*te}const B=this.projectAndGetPerspectiveRatio(y,E,T,A,h.tileID,O.name==="globe"||!!k||this.transform.pitch>0,O),F=g*B.perspectiveRatio,I=(h.x1*o+d.x-h.padding)*F+B.point.x,L=(h.y1*o+d.y-h.padding)*F+B.point.y,N=(h.x2*o+d.x+h.padding)*F+B.point.x,j=(h.y2*o+d.y+h.padding)*F+B.point.y,K=B.perspectiveRatio<=.55||B.occluded;return!this.isInsideGrid(I,L,N,j)||!f&&this.grid.hitTest(I,L,N,j,v)||K?{box:[],offscreen:!1,occluded:B.occluded}:{box:[I,L,N,j],offscreen:this.isOffscreen(I,L,N,j),occluded:!1}}placeCollisionCircles(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=[],I=this.transform.elevation,L=r.getProjection(),N=I?I.getAtTileOffsetFunc(B,this.transform.center.lat,this.transform.worldSize,L):null,j=new a.Point(h.tileAnchorX,h.tileAnchorY);let{x:K,y:J,z:Y}=L.projectTilePoint(j.x,j.y,B.canonical);if(N){const[_e,Me,ve]=N(j);K+=_e,J+=Me,Y+=ve}const ie=L.name==="globe",te=this.projectAndGetPerspectiveRatio(y,K,J,Y,B,ie||!!I||this.transform.pitch>0,L),{perspectiveRatio:le}=te,Te=(A?g/le:g*le)/a.ONE_EM,oe=ci(K,J,Y,v),ge=te.signedDistanceFromCamera>0?rc(Te,f,h.lineOffsetX*Te,h.lineOffsetY*Te,!1,oe,j,h,d,v,{},I&&!A?N:null,A&&!!I,L,B,A):null;let he=!1,we=!1,ae=!0;if(ge&&!te.occluded){const _e=.5*R*le+O,Me=new a.Point(-100,-100),ve=new a.Point(this.screenRightBoundary,this.screenBottomBoundary),Ae=new Aa,{first:Ge,last:Xe}=ge,Ve=Ge.path.length;let qe=[];for(let je=Ve-1;je>=1;je--)qe.push(Ge.path[je]);for(let je=1;je<Xe.path.length;je++)qe.push(Xe.path[je]);const lt=2.5*_e;E&&(qe=qe.map(([je,wt,Tt],Et)=>(N&&!ie&&(Tt=N(Et<Ve-1?Ge.tilePath[Ve-1-Et]:Xe.tilePath[Et-Ve+2])[2]),ci(je,wt,Tt,E))),qe.some(je=>je[3]<=0)&&(qe=[]));let ot=[];if(qe.length>0){let je=1/0,wt=-1/0,Tt=1/0,Et=-1/0;for(const St of qe)je=Math.min(je,St[0]),Tt=Math.min(Tt,St[1]),wt=Math.max(wt,St[0]),Et=Math.max(Et,St[1]);wt>=Me.x&&je<=ve.x&&Et>=Me.y&&Tt<=ve.y&&(ot=[qe.map(St=>new a.Point(St[0],St[1]))],(je<Me.x||wt>ve.x||Tt<Me.y||Et>ve.y)&&(ot=a.clipLine(ot,Me.x,Me.y,ve.x,ve.y)))}for(const je of ot){Ae.reset(je,.25*_e);let wt=0;wt=Ae.length<=.5*_e?1:Math.ceil(Ae.paddedLength/lt)+1;for(let Tt=0;Tt<wt;Tt++){const Et=Tt/Math.max(wt-1,1),St=Ae.lerp(Et),vi=St.x+Oi,ui=St.y+Oi;F.push(vi,ui,_e,0);const qi=vi-_e,pr=ui-_e,Ft=vi+_e,Mt=ui+_e;if(ae=ae&&this.isOffscreen(qi,pr,Ft,Mt),we=we||this.isInsideGrid(qi,pr,Ft,Mt),!o&&this.grid.hitTestCircle(vi,ui,_e,k)&&(he=!0,!T))return{circles:[],offscreen:!1,collisionDetected:he,occluded:!1}}}}return{circles:!T&&he||!we?[]:F,offscreen:ae,collisionDetected:he,occluded:te.occluded}}queryRenderedSymbols(r){if(r.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const o=[];let h=1/0,d=1/0,f=-1/0,g=-1/0;for(const T of r){const A=new a.Point(T.x+Oi,T.y+Oi);h=Math.min(h,A.x),d=Math.min(d,A.y),f=Math.max(f,A.x),g=Math.max(g,A.y),o.push(A)}const y=this.grid.query(h,d,f,g).concat(this.ignoredGrid.query(h,d,f,g)),v={},E={};for(const T of y){const A=T.key;if(v[A.bucketInstanceId]===void 0&&(v[A.bucketInstanceId]={}),v[A.bucketInstanceId][A.featureIndex])continue;const k=[new a.Point(T.x1,T.y1),new a.Point(T.x2,T.y1),new a.Point(T.x2,T.y2),new a.Point(T.x1,T.y2)];a.polygonIntersectsPolygon(o,k)&&(v[A.bucketInstanceId][A.featureIndex]=!0,E[A.bucketInstanceId]===void 0&&(E[A.bucketInstanceId]=[]),E[A.bucketInstanceId].push(A.featureIndex))}return E}insertCollisionBox(r,o,h,d,f){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:h,featureIndex:d,collisionGroupID:f},r[0],r[1],r[2],r[3])}insertCollisionCircles(r,o,h,d,f){const g=o?this.ignoredGrid:this.grid,y={bucketInstanceId:h,featureIndex:d,collisionGroupID:f};for(let v=0;v<r.length;v+=4)g.insertCircle(y,r[v],r[v+1],r[v+2])}projectAndGetPerspectiveRatio(r,o,h,d,f,g,y){const v=[o,h,d,1];let E=!1;d||this.transform.pitch>0?(a.transformMat4$1(v,v,r),this.fogState&&f&&y.name!=="globe"&&(E=function(k,R,O,B,F,I){const L=I.calculateFogTileMatrix(F),N=[R,O,B];return a.transformMat4(N,N,L),wo(k,N,I.pitch,I._fov)}(this.fogState,o,h,d,f.toUnwrapped(),this.transform)>.9)):at(v,v,r);const T=v[3];return{point:new a.Point((v[0]/T+1)/2*this.transform.width+Oi,(-v[1]/T+1)/2*this.transform.height+Oi),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(y)/T*.5,1.5),signedDistanceFromCamera:T,occluded:g&&v[2]>T||E}}isOffscreen(r,o,h,d){return h<Oi||r>=this.screenRightBoundary||d<Oi||o>this.screenBottomBoundary}isInsideGrid(r,o,h,d){return h>=0&&r<this.gridRightBoundary&&d>=0&&o<this.gridBottomBoundary}getViewportMatrix(){const r=a.identity([]);return a.translate(r,r,[-100,-100,0]),r}}function gn(l,r,o){const h=r.createTileMatrix(l,l.worldSize,o.toUnwrapped());return a.multiply(new Float32Array(16),l.projMatrix,h)}function ji(l,r,o){if(r.projection.name===o.projection.name)return l.projMatrix;const h=o.clone();return h.setProjection(r.projection),gn(h,r.getProjection(),l)}function Ot(l,r,o){return r.name===o.projection.name?l.projMatrix:gn(o,r,l)}class nc{constructor(r,o,h,d){this.opacity=r?Math.max(0,Math.min(1,r.opacity+(r.placed?o:-o))):d&&h?1:0,this.placed=h}isHidden(){return this.opacity===0&&!this.placed}}class Ir{constructor(r,o,h,d,f,g=!1){this.text=new nc(r?r.text:null,o,h,f),this.icon=new nc(r?r.icon:null,o,d,f),this.clipped=g}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Po{constructor(r,o,h,d=!1){this.text=r,this.icon=o,this.skipFade=h,this.clipped=d}}class ko{constructor(){this.invProjMatrix=a.create(),this.viewportMatrix=a.create(),this.circles=[]}}class Ca{constructor(r,o,h,d,f){this.bucketInstanceId=r,this.featureIndex=o,this.sourceLayerIndex=h,this.bucketIndex=d,this.tileID=f}}class oc{constructor(r){this.crossSourceCollisions=r,this.maxGroupID=0,this.collisionGroups={}}get(r){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[r]){const o=++this.maxGroupID;this.collisionGroups[r]={ID:o,predicate:h=>h.collisionGroupID===o}}return this.collisionGroups[r]}}function Do(l,r,o,h,d){const{horizontalAlign:f,verticalAlign:g}=a.getAnchorAlignment(l),y=-(f-.5)*r,v=-(g-.5)*o,E=a.evaluateVariableOffset(l,h);return new a.Point(y+E[0]*d,v+E[1]*d)}function Lo(l,r,o,h,d){const f=new a.Point(l,r);return o&&f._rotate(h?d:-d),f}class Es{constructor(r,o,h,d,f){this.transform=r.clone(),this.projection=r.projection.name,this.collisionIndex=new zo(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new oc(h),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,o,h,d){const f=h.getBucket(o),g=h.latestFeatureIndex;if(!f||!g||o.id!==f.layerIds[0])return;const y=f.layers[0].layout,v=h.collisionBoxArray,E=Math.pow(2,this.transform.zoom-h.tileID.overscaledZ),T=h.tileSize/a.EXTENT,A=h.tileID.toUnwrapped();this.transform.setProjection(f.projection);const k=(R=h.tileID,O=f.getProjection(),B=this.transform,O.name===this.projection?B.calculateProjMatrix(R.toUnwrapped()):gn(B,O,R));var R,O,B;const F=y.get("text-pitch-alignment")==="map",I=y.get("text-rotation-alignment")==="map";o.compileFilter();const L=o.dynamicFilter(),N=o.dynamicFilterNeedsFeature(),j=this.transform.calculatePixelsToTileUnitsMatrix(h),K=Ar(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);let J=null;if(F){const te=Ht(k,h.tileID.canonical,F,I,this.transform,f.getProjection(),j);J=a.multiply([],this.transform.labelPlaneMatrix,te)}let Y=null;L&&h.latestFeatureIndex&&(Y={unwrappedTileID:A,dynamicFilter:L,dynamicFilterNeedsFeature:N,featureIndex:h.latestFeatureIndex}),this.retainedQueryData[f.bucketInstanceId]=new Ca(f.bucketInstanceId,g,f.sourceLayerIndex,f.index,h.tileID);const ie={bucket:f,layout:y,posMatrix:k,textLabelPlaneMatrix:K,labelToScreenMatrix:J,clippingData:Y,scale:E,textPixelRatio:T,holdingForFade:h.holdingForFade(),collisionBoxArray:v,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(f.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:a.evaluateSizeForZoom(f.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(f.sourceID)};if(d)for(const te of f.sortKeyRanges){const{sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe}=te;r.push({sortKey:le,symbolInstanceStart:Te,symbolInstanceEnd:oe,parameters:ie})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:f.symbolInstances.length,parameters:ie})}attemptAnchorPlacement(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F,I,L){const{textOffset0:N,textOffset1:j,crossTileID:K}=k,J=[N,j],Y=Do(r,h,d,J,f),ie=this.collisionIndex.placeCollisionBox(O,f,o,Lo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate);if(F){const te=O.getSymbolInstanceIconSize(L,this.transform.zoom,k.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(O,te,F,Lo(Y.x,Y.y,g,y,this.transform.angle),A,v,E,T.predicate).box.length===0)return}if(ie.box.length>0){let te;return this.prevPlacement&&this.prevPlacement.variableOffsets[K]&&this.prevPlacement.placements[K]&&this.prevPlacement.placements[K].text&&(te=this.prevPlacement.variableOffsets[K].anchor),this.variableOffsets[K]={textOffset:J,width:h,height:d,anchor:r,textScale:f,prevAnchor:te},this.markUsedJustification(O,r,k,B),O.allowVerticalPlacement&&(this.markUsedOrientation(O,B,k),this.placedOrientations[K]=B),{shift:Y,placedGlyphBoxes:ie}}}placeLayerBucketPart(r,o,h,d){const{bucket:f,layout:g,posMatrix:y,textLabelPlaneMatrix:v,labelToScreenMatrix:E,clippingData:T,textPixelRatio:A,holdingForFade:k,collisionBoxArray:R,partiallyEvaluatedTextSize:O,partiallyEvaluatedIconSize:B,collisionGroup:F}=r.parameters,I=g.get("text-optional"),L=g.get("icon-optional"),N=g.get("text-allow-overlap"),j=g.get("icon-allow-overlap"),K=g.get("text-rotation-alignment")==="map",J=g.get("text-pitch-alignment")==="map",Y=g.get("icon-text-fit")!=="none",ie=g.get("symbol-z-order")==="viewport-y";this.transform.setProjection(f.projection);let te=N&&(j||!f.hasIconData()||L),le=j&&(N||!f.hasTextData()||I);!f.collisionArrays&&R&&f.deserializeCollisionBoxes(R),h&&d&&f.updateCollisionDebugBuffers(this.transform.zoom,R);const Te=(oe,ge,he)=>{const{crossTileID:we,numVerticalGlyphVertices:ae}=oe;if(T){const Ft={zoom:this.transform.zoom,pitch:this.transform.pitch};let Mt=null;if(T.dynamicFilterNeedsFeature){const yt=this.retainedQueryData[f.bucketInstanceId];Mt=T.featureIndex.loadFeature({featureIndex:oe.featureIndex,bucketIndex:yt.bucketIndex,sourceLayerIndex:yt.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,T.dynamicFilter)(Ft,Mt,this.retainedQueryData[f.bucketInstanceId].tileID.canonical,new a.Point(oe.tileAnchorX,oe.tileAnchorY),this.transform.calculateDistanceTileData(T.unwrappedTileID)))return this.placements[we]=new Po(!1,!1,!1,!0),void o.add(we)}if(o.has(we))return;if(k)return void(this.placements[we]=new Po(!1,!1,!1));let _e=!1,Me=!1,ve=!0,Ae=!1,Ge=!1,Xe=null,Ve={box:null,offscreen:null,occluded:null},qe={box:null,offscreen:null,occluded:null},lt=null,ot=null,je=null,wt=0,Tt=0,Et=0;he.textFeatureIndex?wt=he.textFeatureIndex:oe.useRuntimeCollisionCircles&&(wt=oe.featureIndex),he.verticalTextFeatureIndex&&(Tt=he.verticalTextFeatureIndex);const St=Ft=>{Ft.tileID=this.retainedQueryData[f.bucketInstanceId].tileID;const Mt=this.transform.elevation;(Mt||Ft.elevation)&&(Ft.elevation=Mt?Mt.getAtTileOffset(Ft.tileID,Ft.tileAnchorX,Ft.tileAnchorY):0)},vi=he.textBox;if(vi){St(vi);const Ft=yt=>{let Kt=a.WritingMode.horizontal;if(f.allowVerticalPlacement&&!yt&&this.prevPlacement){const Ei=this.prevPlacement.placedOrientations[we];Ei&&(this.placedOrientations[we]=Ei,Kt=Ei,this.markUsedOrientation(f,Kt,oe))}return Kt},Mt=(yt,Kt)=>{if(f.allowVerticalPlacement&&ae>0&&he.verticalTextBox){for(const Ei of f.writingModes)if(Ei===a.WritingMode.vertical?(Ve=Kt(),qe=Ve):Ve=yt(),Ve&&Ve.box&&Ve.box.length)break}else Ve=yt()};if(g.get("text-variable-anchor")){let yt=g.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[we]){const Bt=this.prevPlacement.variableOffsets[we];yt.indexOf(Bt.anchor)>0&&(yt=yt.filter(Ii=>Ii!==Bt.anchor),yt.unshift(Bt.anchor))}const Kt=(Bt,Ii,Ys)=>{const Sn=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),es=(Bt.x2-Bt.x1)*Sn+2*Bt.padding,Rr=(Bt.y2-Bt.y1)*Sn+2*Bt.padding,Qr=Y&&!j?Ii:null;Qr&&St(Qr);let Mn={box:[],offscreen:!1,occluded:!1};const Js=N?2*yt.length:yt.length;for(let ts=0;ts<Js;++ts){const xl=this.attemptAnchorPlacement(yt[ts%yt.length],Bt,es,Rr,Sn,K,J,A,y,F,ts>=yt.length,oe,ge,f,Ys,Qr,O,B);if(xl&&(Mn=xl.placedGlyphBoxes,Mn&&Mn.box&&Mn.box.length)){_e=!0,Xe=xl.shift;break}}return Mn};Mt(()=>Kt(vi,he.iconBox,a.WritingMode.horizontal),()=>{const Bt=he.verticalTextBox;return Bt&&St(Bt),f.allowVerticalPlacement&&!(Ve&&Ve.box&&Ve.box.length)&&ae>0&&Bt?Kt(Bt,he.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),Ve&&(_e=Ve.box,ve=Ve.offscreen,Ae=Ve.occluded);const Ei=Ft(!(!Ve||!Ve.box));if(!_e&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[we];Bt&&(this.variableOffsets[we]=Bt,this.markUsedJustification(f,Bt.anchor,oe,Ei))}}else{const yt=(Kt,Ei)=>{const Bt=f.getSymbolInstanceTextSize(O,oe,this.transform.zoom,ge),Ii=this.collisionIndex.placeCollisionBox(f,Bt,Kt,new a.Point(0,0),N,A,y,F.predicate);return Ii&&Ii.box&&Ii.box.length&&(this.markUsedOrientation(f,Ei,oe),this.placedOrientations[we]=Ei),Ii};Mt(()=>yt(vi,a.WritingMode.horizontal),()=>{const Kt=he.verticalTextBox;return f.allowVerticalPlacement&&ae>0&&Kt?(St(Kt),yt(Kt,a.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Ft(!!(Ve&&Ve.box&&Ve.box.length))}}if(lt=Ve,_e=lt&&lt.box&&lt.box.length>0,ve=lt&&lt.offscreen,Ae=lt&&lt.occluded,oe.useRuntimeCollisionCircles){const Ft=f.text.placedSymbolArray.get(oe.centerJustifiedTextSymbolIndex>=0?oe.centerJustifiedTextSymbolIndex:oe.verticalPlacedTextSymbolIndex),Mt=a.evaluateSizeForFeature(f.textSizeData,O,Ft),yt=g.get("text-padding");ot=this.collisionIndex.placeCollisionCircles(f,N,Ft,f.lineVertexArray,f.glyphOffsetArray,Mt,y,v,E,h,J,F.predicate,oe.collisionCircleDiameter*Mt/a.ONE_EM,yt,this.retainedQueryData[f.bucketInstanceId].tileID),_e=N||ot.circles.length>0&&!ot.collisionDetected,ve=ve&&ot.offscreen,Ae=ot.occluded}if(he.iconFeatureIndex&&(Et=he.iconFeatureIndex),he.iconBox){const Ft=Mt=>{St(Mt);const yt=Y&&Xe?Lo(Xe.x,Xe.y,K,J,this.transform.angle):new a.Point(0,0),Kt=f.getSymbolInstanceIconSize(B,this.transform.zoom,oe.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(f,Kt,Mt,yt,j,A,y,F.predicate)};qe&&qe.box&&qe.box.length&&he.verticalIconBox?(je=Ft(he.verticalIconBox),Me=je.box.length>0):(je=Ft(he.iconBox),Me=je.box.length>0),ve=ve&&je.offscreen,Ge=je.occluded}const ui=I||oe.numHorizontalGlyphVertices===0&&ae===0,qi=L||oe.numIconVertices===0;if(ui||qi?qi?ui||(Me=Me&&_e):_e=Me&&_e:Me=_e=Me&&_e,_e&&lt&&lt.box&&this.collisionIndex.insertCollisionBox(lt.box,g.get("text-ignore-placement"),f.bucketInstanceId,qe&&qe.box&&Tt?Tt:wt,F.ID),Me&&je&&this.collisionIndex.insertCollisionBox(je.box,g.get("icon-ignore-placement"),f.bucketInstanceId,Et,F.ID),ot&&(_e&&this.collisionIndex.insertCollisionCircles(ot.circles,g.get("text-ignore-placement"),f.bucketInstanceId,wt,F.ID),h)){const Ft=f.bucketInstanceId;let Mt=this.collisionCircleArrays[Ft];Mt===void 0&&(Mt=this.collisionCircleArrays[Ft]=new ko);for(let yt=0;yt<ot.circles.length;yt+=4)Mt.circles.push(ot.circles[yt+0]),Mt.circles.push(ot.circles[yt+1]),Mt.circles.push(ot.circles[yt+2]),Mt.circles.push(ot.collisionDetected?1:0)}const pr=f.projection.name!=="globe";te=te&&(pr||!Ae),le=le&&(pr||!Ge),this.placements[we]=new Po(_e||te,Me||le,ve||f.justReloaded),o.add(we)};if(ie){const oe=f.getSortedSymbolIndexes(this.transform.angle);for(let ge=oe.length-1;ge>=0;--ge){const he=oe[ge];Te(f.symbolInstances.get(he),he,f.collisionArrays[he])}}else for(let oe=r.symbolInstanceStart;oe<r.symbolInstanceEnd;oe++)Te(f.symbolInstances.get(oe),oe,f.collisionArrays[oe]);if(h&&f.bucketInstanceId in this.collisionCircleArrays){const oe=this.collisionCircleArrays[f.bucketInstanceId];a.invert(oe.invProjMatrix,y),oe.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1}markUsedJustification(r,o,h,d){const{leftJustifiedTextSymbolIndex:f,centerJustifiedTextSymbolIndex:g,rightJustifiedTextSymbolIndex:y,verticalPlacedTextSymbolIndex:v,crossTileID:E}=h,T=a.getAnchorJustification(o),A=d===a.WritingMode.vertical?v:T==="left"?f:T==="center"?g:T==="right"?y:-1;f>=0&&(r.text.placedSymbolArray.get(f).crossTileID=A>=0&&f!==A?0:E),g>=0&&(r.text.placedSymbolArray.get(g).crossTileID=A>=0&&g!==A?0:E),y>=0&&(r.text.placedSymbolArray.get(y).crossTileID=A>=0&&y!==A?0:E),v>=0&&(r.text.placedSymbolArray.get(v).crossTileID=A>=0&&v!==A?0:E)}markUsedOrientation(r,o,h){const d=o===a.WritingMode.horizontal||o===a.WritingMode.horizontalOnly?o:0,f=o===a.WritingMode.vertical?o:0,{leftJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:y,rightJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:E}=h,T=r.text.placedSymbolArray;g>=0&&(T.get(g).placedOrientation=d),y>=0&&(T.get(y).placedOrientation=d),v>=0&&(T.get(v).placedOrientation=d),E>=0&&(T.get(E).placedOrientation=f)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let h=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(r):1,f=o?o.opacities:{},g=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(const v in this.placements){const E=this.placements[v],T=f[v];T?(this.opacities[v]=new Ir(T,d,E.text,E.icon,null,E.clipped),h=h||E.text!==T.text.placed||E.icon!==T.icon.placed):(this.opacities[v]=new Ir(null,d,E.text,E.icon,E.skipFade,E.clipped),h=h||E.text||E.icon)}for(const v in f){const E=f[v];if(!this.opacities[v]){const T=new Ir(E,d,!1,!1);T.isHidden()||(this.opacities[v]=T,h=h||E.text.placed||E.icon.placed)}}for(const v in g)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=g[v]);for(const v in y)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=y[v]);h?this.lastPlacementChangeTime=r:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:r)}updateLayerOpacities(r,o){const h=new Set;for(const d of o){const f=d.getBucket(r);f&&d.latestFeatureIndex&&r.id===f.layerIds[0]&&this.updateBucketOpacities(f,h,d.collisionBoxArray)}}updateBucketOpacities(r,o,h){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const d=r.layers[0].layout,f=!!r.layers[0].dynamicFilter(),g=new Ir(null,0,!1,!1,!0),y=d.get("text-allow-overlap"),v=d.get("icon-allow-overlap"),E=d.get("text-variable-anchor"),T=d.get("text-rotation-alignment")==="map",A=d.get("text-pitch-alignment")==="map",k=d.get("icon-text-fit")!=="none",R=new Ir(null,0,y&&(v||!r.hasIconData()||d.get("icon-optional")),v&&(y||!r.hasTextData()||d.get("text-optional")),!0);!r.collisionArrays&&h&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(h);const O=(F,I,L)=>{for(let N=0;N<I/4;N++)F.opacityVertexArray.emplaceBack(L)};let B=0;for(let F=0;F<r.symbolInstances.length;F++){const I=r.symbolInstances.get(F),{numHorizontalGlyphVertices:L,numVerticalGlyphVertices:N,crossTileID:j,numIconVertices:K}=I,J=o.has(j);let Y=this.opacities[j];J?Y=g:Y||(Y=R,this.opacities[j]=Y),o.add(j);const ie=L>0||N>0,te=K>0,le=this.placedOrientations[j],Te=le===a.WritingMode.vertical,oe=le===a.WritingMode.horizontal||le===a.WritingMode.horizontalOnly;if(!ie&&!te||Y.isHidden()||B++,ie){const ge=Ro(Y.text);O(r.text,L,Te?Gt:ge),O(r.text,N,oe?Gt:ge);const he=Y.text.isHidden(),{leftJustifiedTextSymbolIndex:we,centerJustifiedTextSymbolIndex:ae,rightJustifiedTextSymbolIndex:_e,verticalPlacedTextSymbolIndex:Me}=I,ve=r.text.placedSymbolArray,Ae=he||Te?1:0;we>=0&&(ve.get(we).hidden=Ae),ae>=0&&(ve.get(ae).hidden=Ae),_e>=0&&(ve.get(_e).hidden=Ae),Me>=0&&(ve.get(Me).hidden=he||oe?1:0);const Ge=this.variableOffsets[j];Ge&&this.markUsedJustification(r,Ge.anchor,I,le);const Xe=this.placedOrientations[j];Xe&&(this.markUsedJustification(r,"left",I,Xe),this.markUsedOrientation(r,Xe,I))}if(te){const ge=Ro(Y.icon),{placedIconSymbolIndex:he,verticalPlacedIconSymbolIndex:we}=I,ae=r.icon.placedSymbolArray,_e=Y.icon.isHidden()?1:0;he>=0&&(O(r.icon,K,Te?Gt:ge),ae.get(he).hidden=_e),we>=0&&(O(r.icon,I.numVerticalIconVertices,oe?Gt:ge),ae.get(we).hidden=_e)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const ge=r.collisionArrays[F];if(ge){let he=new a.Point(0,0),we=!0;if(ge.textBox||ge.verticalTextBox){if(E){const _e=this.variableOffsets[j];_e?(he=Do(_e.anchor,_e.width,_e.height,_e.textOffset,_e.textScale),T&&he._rotate(A?this.transform.angle:-this.transform.angle)):we=!1}f&&(we=!Y.clipped),ge.textBox&&qn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||Te,he.x,he.
8y),ge.verticalTextBox&&qn(r.textCollisionBox.collisionVertexArray,Y.text.placed,!we||oe,he.x,he.y)}const ae=we&&!!(!oe&&ge.verticalIconBox);ge.iconBox&&qn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,ae,k?he.x:0,k?he.y:0),ge.verticalIconBox&&qn(r.iconCollisionBox.collisionVertexArray,Y.icon.placed,!ae,k?he.x:0,k?he.y:0)}}}if(r.fullyClipped=B===0,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=F.invProjMatrix,r.placementViewportMatrix=F.viewportMatrix,r.collisionCircleArray=F.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return this.fadeDuration===0?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(r,o){const h=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*h>r}setStale(){this.stale=!0}}function qn(l,r,o,h,d){l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0),l.emplaceBack(r?1:0,o?1:0,h||0,d||0)}const Mi=Math.pow(2,25),Zt=Math.pow(2,24),za=Math.pow(2,17),Pa=Math.pow(2,16),Ai=Math.pow(2,9),Gi=Math.pow(2,8),sc=Math.pow(2,1);function Ro(l){if(l.opacity===0&&!l.placed)return 0;if(l.opacity===1&&l.placed)return 4294967295;const r=l.placed?1:0,o=Math.floor(127*l.opacity);return o*Mi+r*Zt+o*za+r*Pa+o*Ai+r*Gi+o*sc+r}const Gt=0;class Bo{constructor(r){this._sortAcrossTiles=r.layout.get("symbol-z-order")!=="viewport-y"&&r.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(r,o,h,d,f){const g=this._bucketParts;for(;this._currentTileIndex<r.length;)if(o.getBucketParts(g,d,r[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,f())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,g.sort((y,v)=>y.sortKey-v.sortKey));this._currentPartIndex<g.length;){const y=g[this._currentPartIndex];if(o.placeLayerBucketPart(y,this._seenCrossTileIDs,h,y.symbolInstanceStart===0),this._currentPartIndex++,f())return!0}return!1}}class ka{constructor(r,o,h,d,f,g,y,v){this.placement=new Es(r,f,g,y,v),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=h,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(r,o,h){const d=a.exported.now(),f=()=>{const g=a.exported.now()-d;return!this._forceFullPlacement&&g>2};for(;this._currentPlacementIndex>=0;){const g=o[r[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=y)&&(!g.maxzoom||g.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Bo(g)),this._inProgressLayer.continuePlacement(h[g.source],this.placement,this._showCollisionBoxes,g,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const yn=512/a.EXTENT/2;class fi{constructor(r,o,h){this.tileID=r,this.bucketInstanceId=h,this.index=new a.KDBush(o.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const d=r.canonical.x*a.EXTENT,f=r.canonical.y*a.EXTENT;for(let g=0;g<o.length;g++){const{key:y,crossTileID:v,tileAnchorX:E,tileAnchorY:T}=o.get(g),A=Math.floor((d+E)*yn),k=Math.floor((f+T)*yn);this.index.add(A,k),this.keys.push(y),this.crossTileIDs.push(v)}this.index.finish()}
vendor: 4,719 bytes, line 8
8findMatches(r,o,h){const d=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),f=yn/Math.pow(2,o.canonical.z-this.tileID.canonical.z),g=o.canonical.x*a.EXTENT,y=o.canonical.y*a.EXTENT;for(let v=0;v<r.length;v++){const E=r.get(v);if(E.crossTileID)continue;const{key:T,tileAnchorX:A,tileAnchorY:k}=E,R=Math.floor((g+A)*f),O=Math.floor((y+k)*f),B=this.index.range(R-d,O-d,R+d,O+d);for(const F of B){const I=this.crossTileIDs[F];if(this.keys[F]===T&&!h.has(I)){h.add(I),E.crossTileID=I;break}}}}}class Da{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class La{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(r){const o=Math.round((r-this.lng)/360);if(o!==0)for(const h in this.indexes){const d=this.indexes[h],f={};for(const g in d){const y=d[g];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+o),f[y.tileID.key]=y}this.indexes[h]=f}this.lng=r}addBucket(r,o,h){if(this.indexes[r.overscaledZ]&&this.indexes[r.overscaledZ][r.key]){if(this.indexes[r.overscaledZ][r.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(r.overscaledZ,this.indexes[r.overscaledZ][r.key])}for(let f=0;f<o.symbolInstances.length;f++)o.symbolInstances.get(f).crossTileID=0;this.usedCrossTileIDs[r.overscaledZ]||(this.usedCrossTileIDs[r.overscaledZ]=new Set);const d=this.usedCrossTileIDs[r.overscaledZ];for(const f in this.indexes){const g=this.indexes[f];if(Number(f)>r.overscaledZ)for(const y in g){const v=g[y];v.tileID.isChildOf(r)&&v.findMatches(o.symbolInstances,r,d)}else{const y=g[r.scaledTo(Number(f)).key];y&&y.findMatches(o.symbolInstances,r,d)}}for(let f=0;f<o.symbolInstances.length;f++){const g=o.symbolInstances.get(f);g.crossTileID||(g.crossTileID=h.generate(),d.add(g.crossTileID))}return this.indexes[r.overscaledZ]===void 0&&(this.indexes[r.overscaledZ]={}),this.indexes[r.overscaledZ][r.key]=new fi(r,o.symbolInstances,o.bucketInstanceId),!0}removeBucketCrossTileIDs(r,o){for(const h of o.crossTileIDs)this.usedCrossTileIDs[r].delete(h)}removeStaleBuckets(r){let o=!1;for(const h in this.indexes){const d=this.indexes[h];for(const f in d)r[d[f].bucketInstanceId]||(this.removeBucketCrossTileIDs(h,d[f]),delete d[f],o=!0)}return o}}class Cr{constructor(){this.layerIndexes={},this.crossTileIDs=new Da,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(r,o,h,d){let f=this.layerIndexes[r.id];f===void 0&&(f=this.layerIndexes[r.id]=new La);let g=!1;const y={};d.name!=="globe"&&f.handleWrapJump(h);for(const v of o){const E=v.getBucket(r);E&&r.id===E.layerIds[0]&&(E.bucketInstanceId||(E.bucketInstanceId=++this.maxBucketInstanceId),f.addBucket(v.tileID,E,this.crossTileIDs)&&(g=!0),y[E.bucketInstanceId]=!0)}return f.removeStaleBuckets(y)&&(g=!0),g}pruneUnusedLayers(r){const o={};r.forEach(h=>{o[h]=!0});for(const h in this.layerIndexes)o[h]||delete this.layerIndexes[h]}}const Yr=(l,r)=>a.emitValidationErrors(l,r&&r.filter(o=>o.identifier!=="source.canvas")),Ss=a.pick(vt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ih=a.pick(vt,["setCenter","setZoom","setBearing","setPitch"]),Ra={version:8,layers:[],sources:{}},Wn={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class hr extends a.Evented{constructor(r,o={}){super(),this.map=r,this.dispatcher=new oi($n(),this),this.imageManager=new wa,this.imageManager.setEventedParent(this),this.glyphManager=new a.GlyphManager(r._requestManager,o.localFontFamily?a.LocalGlyphMode.all:o.localIdeographFontFamily?a.LocalGlyphMode.ideographs:a.LocalGlyphMode.none,o.localFontFamily||o.localIdeographFontFamily),this.crossTileSymbolIndex=new Cr,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const h=this;this._rtlTextPluginCallback=hr.registerForPluginStateChange(d=>{h.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(f,g)=>{if(a.triggerPluginCompletionEvent(f),g&&g.every(y=>y))for(const y in h._sourceCaches){const v=h._sourceCaches[y],E=v.getSource().type;E!=="vector"&&E!=="geojson"||v.reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const f=this.getSource(d.sourceId);if(f&&f.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];
8y.source===f.id&&this._validateLayer(y)}})}loadURL(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const h=typeof o.validate=="boolean"?o.validate:!a.isMapboxURL(r);r=this.map._requestManager.normalizeStyleURL(r,o.accessToken);const d=this.map._requestManager.transformRequest(r,a.ResourceType.Style);this._request=a.getJSON(d,(f,g)=>{this._request=null,f?this.fire(new a.ErrorEvent(f)):g&&this._load(g,h)})}loadJSON(r,o={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(r,o.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(Ra,!1)}_updateLayerCount(r,o){const h=o?1:-1;r.is3D()&&(this._num3DLayers+=h),r.type==="circle"&&(this._numCircleLayers+=h),r.type==="symbol"&&(this._numSymbolLayers+=h)}_load(r,o){if(o&&Yr(this,a.validateStyle(r)))return;this._loaded=!0,this.stylesheet=a.clone$1(r),this._updateMapProjection();for(const d in r.sources)this.addSource(d,r.sources[d],{validate:!1});this._changed=!1,r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(r.glyphs);const h=tc(this.stylesheet.layers);this._order=h.map(d=>d.id),this._layers={},this._serializedLayers={};for(const d of h){const f=a.createStyleLayer(d);f.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=f,this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new si(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(r){r?this.stylesheet.projection=r:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(r){this._spriteRequest=function(o,h,d){let f,g,y;const v=a.exported.devicePixelRatio>1?"@2x":"";let E=a.getJSON(h.transformRequest(h.normalizeSpriteURL(o,v,".json"),a.ResourceType.SpriteJSON),(k,R)=>{E=null,y||(y=k,f=R,A())}),T=a.getImage(h.transformRequest(h.normalizeSpriteURL(o,v,".png"),a.ResourceType.SpriteImage),(k,R)=>{T=null,y||(y=k,g=R,A())});function A(){if(y)d(y);else if(f&&g){const k=a.exported.getImageData(g),R={};for(const O in f){const{width:B,height:F,x:I,y:L,sdf:N,pixelRatio:j,stretchX:K,stretchY:J,content:Y}=f[O],ie=new a.RGBAImage({width:B,height:F});a.RGBAImage.copy(k,ie,{x:I,y:L},{x:0,y:0},{width:B,height:F}),R[O]={data:ie,pixelRatio:j,sdf:N,stretchX:K,stretchY:J,content:Y}}d(null,R)}}return{cancel(){E&&(E.cancel(),E=null),T&&(T.cancel(),T=null)}}}(r,this.map._requestManager,(o,h)=>{if(this._spriteRequest=null,o)this.fire(new a.ErrorEvent(o));else if(h)for(const d in h)this.imageManager.addImage(d,h[d]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(r){const o=this.getSource(r.source);if(!o)return;const h=r.sourceLayer;h&&(o.type==="geojson"||o.vectorLayerIds&&o.vectorLayerIds.indexOf(h)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${h}" does not exist on source "${o.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this._sourceCaches)if(!this._sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(r){const o=[];for(const h of r){const d=this._layers[h];d.type!=="custom"&&o.push(d.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(const r in this._sourceCaches)if(this._sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(r){return!!this.terrain&&(typeof r.isLayerDraped=="function"?r.isLayerDraped():Wn[r.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(r){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);(d.length||f.length)&&this._updateWorkerLayers(d,f);for(const g in this._updatedSources){const y=this._updatedSources[g];y==="reload"?this._reloadSource(g):y==="clear"&&this._clearSource(g)}this._updateTilesForChangedImages();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(r);this.light.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._resetUpdates()}const h={};for(const d in this._sourceCaches){const f=this._sourceCaches[d];h[d]=f.used,f.used=!1}for(const d of this._order){const f=this._layers[d];if(f.recalculate(r,this._availableImages),!f.isHidden(r.zoom)){const y=this._getLayerSourceCache(f);y&&(y.used=!0)}const g=this.map.painter;if(g){const y=f.getProgramIds();if(!y)continue;const v=f.getProgramConfiguration(r.zoom);for(const E of y)g.useProgram(E,v)}}for(const d in h){const f=this._sourceCaches[d];h[d]!==f.used&&f.getSource().fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:f.getSource().id}))}this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedU
vendor: 8,746 bytes, line 8
8pdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),o&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const o in this._sourceCaches)this._sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateWorkerLayers(r,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(r),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(r){if(this._checkLoaded(),Yr(this,a.validateStyle(r)))return!1;(r=a.clone$1(r)).layers=tc(r.layers);const o=function(d,f){if(!d)return[{command:vt.setStyle,args:[f]}];let g=[];try{if(!Se(d.version,f.version))return[{command:vt.setStyle,args:[f]}];Se(d.center,f.center)||g.push({command:vt.setCenter,args:[f.center]}),Se(d.zoom,f.zoom)||g.push({command:vt.setZoom,args:[f.zoom]}),Se(d.bearing,f.bearing)||g.push({command:vt.setBearing,args:[f.bearing]}),Se(d.pitch,f.pitch)||g.push({command:vt.setPitch,args:[f.pitch]}),Se(d.sprite,f.sprite)||g.push({command:vt.setSprite,args:[f.sprite]}),Se(d.glyphs,f.glyphs)||g.push({command:vt.setGlyphs,args:[f.glyphs]}),Se(d.transition,f.transition)||g.push({command:vt.setTransition,args:[f.transition]}),Se(d.light,f.light)||g.push({command:vt.setLight,args:[f.light]}),Se(d.fog,f.fog)||g.push({command:vt.setFog,args:[f.fog]}),Se(d.projection,f.projection)||g.push({command:vt.setProjection,args:[f.projection]});const y={},v=[];(function(A,k,R,O){let B;for(B in k=k||{},A=A||{})A.hasOwnProperty(B)&&(k.hasOwnProperty(B)||Io(B,R,O));for(B in k){if(!k.hasOwnProperty(B))continue;const F=k[B];A.hasOwnProperty(B)?Se(A[B],F)||(A[B].type==="geojson"&&F.type==="geojson"&&Ts(A,k,B)?R.push({command:vt.setGeoJSONSourceData,args:[B,F.data]}):Sa(B,k,R,O)):Ea(B,k,R)}})(d.sources,f.sources,v,y);const E=[];d.layers&&d.layers.forEach(A=>{A.source&&y[A.source]?g.push({command:vt.removeLayer,args:[A.id]}):E.push(A)});let T=d.terrain;T&&y[T.source]&&(g.push({command:vt.setTerrain,args:[void 0]}),T=void 0),g=g.concat(v),Se(T,f.terrain)||g.push({command:vt.setTerrain,args:[f.terrain]}),function(A,k,R){k=k||[];const O=(A=A||[]).map(Sr),B=k.map(Sr),F=A.reduce(Ma,{}),I=k.reduce(Ma,{}),L=O.slice(),N=Object.create(null);let j,K,J,Y,ie,te,le;for(j=0,K=0;j<O.length;j++)J=O[j],I.hasOwnProperty(J)?K++:(R.push({command:vt.removeLayer,args:[J]}),L.splice(L.indexOf(J,K),1));for(j=0,K=0;j<B.length;j++)J=B[B.length-1-j],L[L.length-1-j]!==J&&(F.hasOwnProperty(J)?(R.push({command:vt.removeLayer,args:[J]}),L.splice(L.lastIndexOf(J,L.length-K),1)):K++,te=L[L.length-j],R.push({command:vt.addLayer,args:[I[J],te]}),L.splice(L.length-j,0,J),N[J]=!0);for(j=0;j<B.length;j++)if(J=B[j],Y=F[J],ie=I[J],!N[J]&&!Se(Y,ie))if(Se(Y.source,ie.source)&&Se(Y["source-layer"],ie["source-layer"])&&Se(Y.type,ie.type)){for(le in lr(Y.layout,ie.layout,R,J,null,vt.setLayoutProperty),lr(Y.paint,ie.paint,R,J,null,vt.setPaintProperty),Se(Y.filter,ie.filter)||R.push({command:vt.setFilter,args:[J,ie.filter]}),Se(Y.minzoom,ie.minzoom)&&Se(Y.maxzoom,ie.maxzoom)||R.push({command:vt.setLayerZoomRange,args:[J,ie.minzoom,ie.maxzoom]}),Y)Y.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?lr(Y[le],ie[le],R,J,le.slice(6),vt.setPaintProperty):Se(Y[le],ie[le])||R.push({command:vt.setLayerProperty,args:[J,le,ie[le]]}));for(le in ie)ie.hasOwnProperty(le)&&!Y.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?lr(Y[le],ie[le],R,J,le.slice(6),vt.setPaintProperty):Se(Y[le],ie[le])||R.push({command:vt.setLayerProperty,args:[J,le,ie[le]]}))}else R.push({command:vt.removeLayer,args:[J]}),te=L[L.lastIndexOf(J)+1],R.push({command:vt.addLayer,args:[ie,te]})}(E,f.layers,g)}catch(y){console.warn("Unable to compute style diff:",y),g=[{command:vt.setStyle,args:[f]}]}return g}(this.serialize(),r).filter(d=>!(d.command in Ih));if(o.length===0)return!1;const h=o.filter(d=>!(d.command in Ss));if(h.length>0)throw new Error(`Unimplemented: ${h.map(d=>d.command).join(", ")}.`);return o.forEach(d=>{d.command!=="setTransition"&&d.command!=="setProjection"&&this[d.command].apply(this,d.args)}),this.stylesheet=r,this._updateMapProjection(),!0}addImage(r,o){return this.getImage(r)?this.fire(new a.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(r,o),this._afterImageUpdated(r),this)}updateImage(r,o){this.imageManager.updateImage(r,o)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r),this._afterImageUpdated(r),this):this.fire(new a.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(r,o,h={}){if(this._checkLoaded(),this.getSource(r)!==void 0)throw new Error("There is already a source with this ID");if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(a.validateSource,`sources.${r}`,o,null,h))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=nt(r,o,this.dispatcher,this);d.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(r),source:d.serialize(),sourceId:r}));const f=g=>{const y=(g?"symbol:":"other:")+r,v=this._sourceCaches[y]=new a.SourceCache(y,d,g);(g?this._symbolSourceCaches:this._otherSourceCaches)[r]=v,v.style=this,v.onAdd(this.map)};f(!1),o.type!=="vector"&&o.type!=="geojson"||f(!0),d.onAdd&&d.onAdd(this.map),this._changed=!0}removeSource(r){this._checkLoaded();const o=this.getSource(r);if(!o)throw new Error("There is no source with this ID");for(const d in this._layers)if(this._layers[d].source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while layer "${d}" is using it.`)));if(this.terrain&&this.terrain.get().source===r)return this.fire(new a.ErrorEvent(new Error(`Source "${r}" cannot be removed while terrain is using it.`)));const h=this._getSourceCaches(r);for(const d of h)delete this._sourceCaches[d.id],delete this._updatedSources[d.id],d.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d.getSource().id})),d.setEventedParent(null),d.clearTiles();return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],o.setEventedParent(null),o.onRemove&&o.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(r,o){this._checkLoaded(),this.getSource(r).setData(o),this._changed=!0}getSource(r){const o=this._getSourceCache(r);return o&&o.getSource()}_getSources(){const r=[];for(const o in this._otherSourceCaches){const h=this._getSourceCache(o);h&&r.push(h.getSource())}return r}addLayer(r,o,h={}){this._checkLoaded();const d=r.id;if(this.getLayer(d))return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${d}" already exists on this map`)));let f;if(r.type==="custom"){if(Yr(this,a.validateCustomStyleLayer(r)))return;f=a.createStyleLayer(r)}else{if(typeof r.source=="object"&&(this.addSource(d,r.source),r=a.clone$1(r),r=a.extend(r,{source:d})),this._validate(a.validateLayer,`layers.${d}`,r,{arrayIndex:-1},h))return;f=a.createStyleLayer(r),this._validateLayer(f),f.setEventedParent(this,{layer:{id:d}}),this._serializedLayers[f.id]=f.serialize(),this._updateLayerCount(f,!0)}const g=o?this._order.indexOf(o):this._order.length;if(o&&g===-1)return void this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`)));this._order.splice(g,0,d),this._layerOrderChanged=!0,this._layers[d]=f;const y=this._getLayerSourceCache(f);if(this._removedLayers[d]&&f.source&&y&&f.type!=="custom"){const v=this._removedLayers[d];delete this._removedLayers[d],v.type!==f.type?this._updatedSources[f.source]="clear":(this._updatedSources[f.source]="reload",y.pause())}this._updateLayer(f),f.onAdd&&f.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(r,o){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===o)return;const h=this._order.indexOf(r);this._order.splice(h,1);const d=o?this._order.indexOf(o):this._order.length;
8o&&d===-1?this.fire(new a.ErrorEvent(new Error(`Layer with id "${o}" does not exist on this map.`))):(this._order.splice(d,0,r),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(r){this._checkLoaded();const o=this._layers[r];if(!o)return void this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be removed.`)));o.setEventedParent(null),this._updateLayerCount(o,!1);const h=this._order.indexOf(r);this._order.splice(h,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=o,delete this._layers[r],delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],o.onRemove&&o.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(r){return this._layers[r]}hasLayer(r){return r in this._layers}hasLayerType(r){for(const o in this._layers)if(this._layers[o].type===r)return!0;return!1}setLayerZoomRange(r,o,h){this._checkLoaded();const d=this.getLayer(r);d?d.minzoom===o&&d.maxzoom===h||(o!=null&&(d.minzoom=o),h!=null&&(d.maxzoom=h),this._updateLayer(d)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(r,o,h={}){this._checkLoaded();const d=this.getLayer(r);if(d){if(!Se(d.filter,o))return o==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(a.validateFilter,`layers.${d.id}.filter`,o,{layerType:d.type},h)||(d.filter=a.clone$1(o),this._updateLayer(d)))}else this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be filtered.`)))}getFilter(r){const o=this.getLayer(r);return o&&a.clone$1(o.filter)}setLayoutProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getLayoutProperty(o),h)||(f.setLayoutProperty(o,h,d),this._updateLayer(f)):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(r,o){const h=this.getLayer(r);if(h)return h.getLayoutProperty(o);this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style.`)))}setPaintProperty(r,o,h,d={}){this._checkLoaded();const f=this.getLayer(r);f?Se(f.getPaintProperty(o),h)||(f.setPaintProperty(o,h,d)&&this._updateLayer(f),this._changed=!0,this._updatedPaintProps[r]=!0):this.fire(new a.ErrorEvent(new Error(`The layer '${r}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(r,o){const h=this.getLayer(r);return h&&h.getPaintProperty(o)}setFeatureState(r,o){this._checkLoaded();const h=r.source,d=r.sourceLayer,f=this.getSource(h);if(!f)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const g=f.type;if(g==="geojson"&&d)return void this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(g==="vector"&&!d)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided.")));const y=this._getSourceCaches(h);for(const v of y)v.setFeatureState(d,r.id,o)}removeFeatureState(r,o){this._checkLoaded();const h=r.source,d=this.getSource(h);if(!d)return void this.fire(new a.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)));const f=d.type,g=f==="vector"?r.sourceLayer:void 0;if(f==="vector"&&!g)return void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(o&&typeof r.id!="string"&&typeof r.id!="number")return void this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const y=this._getSourceCaches(h);for(const v of y)v.removeFeatureState(g,r.id,o)}getFeatureState(r){this._checkLoaded();const o=r.source,h=r.sourceLayer,d=this.getSource(o);if(d){if(d.type!=="vector"||h)return r.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(o)[0].getFeatureState(h,r.id);this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new a.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const r={};for(const o in this._sourceCaches){const h=this._sourceCaches[o].getSource();r[h.id]||(r[h.id]=h.serialize())}return a.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:r,layers:this._serializeLayers(this._order)},o=>o!==void 0)}_updateLayer(r){this._updatedLayers[r.id]=!0;const o=this._getLayerSourceCache(r);r.source&&!this._updatedSources[r.source]&&o&&o.getSource().type!=="raster"&&(this._updatedSources[r.source]="reload",o.pause()),this._changed=!0,r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(r){const o=g=>this._layers[g].type==="fill-extrusion",h={},d=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y)){h[y]=g;for(const v of r){const E=v[y];if(E)for(const T of E)d.push(T)}}}d.sort((g,y)=>y.intersectionZ-g.intersectionZ);const f=[];for(let g=this._order.length-1;g>=0;g--){const y=this._order[g];if(o(y))for(let v=d.length-1;v>=0;v--){const E=d[v].feature;if(h[E.layer.id]<g)break;f.push(E),d.pop()}else for(const v of r){const E=v[y];if(E)for(const T of E)f.push(T.feature)}}return f}
vendor: 9,502 bytes, lines 8-16
8queryRenderedFeatures(r,o,h){o&&o.filter&&this._validate(a.validateFilter,"queryRenderedFeatures.filter",o.filter,null,o);const d={};if(o&&o.layers){if(!Array.isArray(o.layers))return this.fire(new a.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const v of o.layers){const E=this._layers[v];if(!E)return this.fire(new a.ErrorEvent(new Error(`The layer '${v}' does not exist in the map's style and cannot be queried for features.`))),[];d[E.source]=!0}}const f=[];o.availableImages=this._availableImages;const g=o&&o.layers?o.layers.some(v=>{const E=this.getLayer(v);return E&&E.is3D()}):this.has3DLayers(),y=Zr.createFromScreenPoints(r,h);for(const v in this._sourceCaches){const E=this._sourceCaches[v].getSource().id;o.layers&&!d[E]||f.push(Vt(this._sourceCaches[v],this._layers,this._serializedLayers,y,o,h,g,!!this.map._showQueryGeometry))}return this.placement&&f.push(function(v,E,T,A,k,R,O){const B={},F=R.queryRenderedSymbols(A),I=[];for(const L of Object.keys(F).map(Number))I.push(O[L]);I.sort(yi);for(const L of I){const N=L.featureIndex.lookupSymbolFeatures(F[L.bucketInstanceId],E,L.bucketIndex,L.sourceLayerIndex,k.filter,k.layers,k.availableImages,v);for(const j in N){const K=B[j]=B[j]||[],J=N[j];J.sort((Y,ie)=>{const te=L.featureSortOrder;if(te){const le=te.indexOf(Y.featureIndex);return te.indexOf(ie.featureIndex)-le}return ie.featureIndex-Y.featureIndex});for(const Y of J)K.push(Y)}}for(const L in B)B[L].forEach(N=>{const j=N.feature,K=T(v[L]);if(!K)return;const J=K.getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=J});return B}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),y.screenGeometry,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(f)}querySourceFeatures(r,o){o&&o.filter&&this._validate(a.validateFilter,"querySourceFeatures.filter",o.filter,null,o);const h=this._getSourceCaches(r);let d=[];for(const f of h)d=d.concat(Xt(f,o));return d}addSourceType(r,o,h){return hr.getSourceType(r)?h(new Error(`A source type called "${r}" already exists.`)):(hr.setSourceType(r,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:r,url:o.workerSourceURL},h):h(null,null))}getLight(){return this.light.getLight()}setLight(r,o={}){this._checkLoaded();const h=this.light.getLight();let d=!1;for(const g in r)if(!Se(r[g],h[g])){d=!0;break}if(!d)return;const f=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(r,o),this.light.updateTransitions(f)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,o=1){if(this._checkLoaded(),!r)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let h=r;if(o===1){if(typeof h.source=="object"){const d="terrain-dem-src";this.addSource(d,h.source),h=a.clone$1(h),h=a.extend(h,{source:d})}if(this._validate(a.validateTerrain,"terrain",h))return}if(!this.terrain||this.terrain&&o!==this.terrain.drapeRenderMode){if(!h)return;this._createTerrain(h,o)}else{const d=this.terrain,f=d.get();for(const g of Object.keys(a.spec.terrain))!h.hasOwnProperty(g)&&a.spec.terrain[g].default&&(h[g]=a.spec.terrain[g].default);for(const g in h)if(!Se(h[g],f[g])){d.set(h),this.stylesheet.terrain=h;const y=this._setTransitionParameters({duration:0});d.updateTransitions(y);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(r){const o=this.fog=new Bn(r,this.map.transform);this.stylesheet.fog=r;const h=this._setTransitionParameters({duration:0});o.updateTransitions(h)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const r of this.map._markers)r._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(r){if(this._checkLoaded(),!r)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const o=this.fog,h=o.get();Object.keys(r).length===0&&o.set(r);for(const d in r)if(!Se(r[d],h[d])){o.set(r),this.stylesheet.fog=r;const f=this._setTransitionParameters({duration:0});o.updateTransitions(f);break}}else this._createFog(r);this._markersNeedUpdate=!0}_setTransitionParameters(r){return{now:a.exported.now(),transition:a.extend(r,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const r=this._order.filter(h=>this.isLayerDraped(this._layers[h])),o=this._order.filter(h=>!this.isLayerDraped(this._layers[h]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...r),this._drapedFirstOrder.push(...o)}_createTerrain(r,o){const h=this.terrain=new _s(r,o);this.stylesheet.terrain=r,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const d=this._setTransitionParameters({duration:0});h.updateTransitions(d)}_force3DLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="fill-extrusion"&&this._updateLayer(o)}}_forceSymbolLayerUpdate(){for(const r in this._layers){const o=this._layers[r];o.type==="symbol"&&this._updateLayer(o)}}_validate(r,o,h,d,f={}){return(!f||f.validate!==!1)&&Yr(this,r.call(a.validateStyle,a.extend({key:o,style:this.serialize(),value:h,styleSpec:a.spec},d)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),a.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const r in this._layers)this._layers[r].setEventedParent(null);for(const r in this._sourceCaches)this._sourceCaches[r].clearTiles(),this._sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(r){const o=this._getSourceCaches(r);for(const h of o)h.clearTiles()}_reloadSource(r){const o=this._getSourceCaches(r);for(const h of o)h.resume(),h.reload()}_reloadSources(){for(const r of this._getSources())r.reload&&r.reload()}_updateSources(r){for(const o in this._sourceCaches)this._sourceCaches[o].update(r)}_generateCollisionBoxes(){for(const r in this._sourceCaches){const o=this._sourceCaches[r];o.resume(),o.reload()}}_updatePlacement(r,o,h,d,f=!1){let g=!1,y=!1;const v={};for(const E of this._order){const T=this._layers[E];if(T.type!=="symbol")continue;if(!v[T.source]){const k=this._getLayerSourceCache(T);if(!k)continue;v[T.source]=k.getRenderableIds(!0).map(R=>k.getTileByID(R)).sort((R,O)=>O.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(O.tileID)?-1:1))}const A=this.crossTileSymbolIndex.addLayer(T,v[T.source],r.center.lng,r.projection);g=g||A}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),f=f||this._layerOrderChanged||h===0,this._layerOrderChanged&&this.fire(new a.Event("neworder")),(f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),r.zoom))&&(this.pauseablePlacement=new ka(r,this._order,f,o,h,d,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),y=!0),g&&this.pauseablePlacement.placement.setStale()),y||g)for(const E of this._order){const T=this._layers[E];T.type==="symbol"&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const r in this._sourceCaches)this._sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,o,h){this.imageManager.getImages(o.icons,h),this._updateTilesForChangedImages();const d=f=>{f&&f.setDependencies(o.tileID.key,o.type,o.icons)};d(this._otherSourceCaches[o.source]),d(this._symbolSourceCaches[o.source])}getGlyphs(r,o,h){this.glyphManager.getGlyphs(o.stacks,h)}getResource(r,o,h){return a.makeRequest(o,h)}_getSourceCache(r){return this._otherSourceCaches[r]}_getLayerSourceCache(r){return r.type==="symbol"?this._symbolSourceCaches[r.source]:this._otherSourceCaches[r.source]}_getSourceCaches(r){const o=[];return this._otherSourceCaches[r]&&o.push(this._otherSourceCaches[r]),this._symbolSourceCaches[r]&&o.push(this._symbolSourceCaches[r]),o}_isSourceCacheLoaded(r){const o=this._getSourceCaches(r);return o.length===0?(this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${r}'`))),!1):o.every(h=>h.loaded())}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}hr.getSourceType=function(l){return Qe[l]},hr.setSourceType=function(l,r){Qe[l]=r},hr.registerForPluginStateChange=a.registerForPluginStateChange;var Ba=`
9#define EPSILON 0.0000001
10#define PI 3.141592653589793
11#define EXTENT 8192.0
12#define HALF_PI PI/2.0
13#define QUARTER_PI PI/4.0
14#define RAD_TO_DEG 180.0/PI
15#define DEG_TO_RAD PI/180.0
16#define GLOBE_RADIUS EXTENT/PI/2.0`,xn="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;
16void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",zr=`
17#define ELEVATION_SCALE 7.0
18#define ELEVATION_OFFSET 450.0
19#ifdef PROJECTION_GLOBE_VIEW
20uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(
21mix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}
22#else
23vec3 elevationVector(vec2 pos) { return vec3(0,0,1); }
24#endif
25const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)
26{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}
27#ifdef TERRAIN
28#ifdef TERRAIN_DEM_FLOAT_FORMAT
29uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;
30#else
31uniform sampler2D u_dem;uniform sampler2D u_dem_prev;
32#endif
33uniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {
34#ifdef TERRAIN_DEM_FLOAT_FORMAT
35vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;
36#else
37float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));
38#ifdef TERRAIN_DEM_NEAREST_FILTER
39return u_exaggeration*tl;
40#endif
41float tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
42#endif
43}float prevElevation(vec2 apos) {
44#ifdef TERRAIN_DEM_FLOAT_FORMAT
45vec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;
46#else
47float dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);
48#endif
49}
50#ifdef TERRAIN_VERTEX_MORPHING
51float elevation(vec2 apos) {
52#ifdef ZERO_EXAGGERATION
53return 0.0;
54#endif
55float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
56#else
57float elevation(vec2 apos) {
58#ifdef ZERO_EXAGGERATION
59return 0.0;
60#endif
61return currentElevation(apos);}
62#endif
63highp float unpack_depth(highp vec4 rgba_depth)
64{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(
65unpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))
66);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {
67#ifdef TERRAIN_DEM_FLOAT_FORMAT
68float tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;
69#else
70vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);
70vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);
71#endif
72return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}
73#else
74float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }
75#endif`,Oo=`#ifdef FOG
76uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}
77#endif`,Pr=`#ifdef FOG
78uniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
79mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}
80#endif`;let Ms={},Xn={};const Fo=[];Hn(Ba,Fo),Hn(zr,Fo),Hn(Oo,Fo),Hn(Pr,Fo),Ms=bt("",zr),Xn=bt(Pr,Oo);const ac=bt(`
81#if __VERSION__ >=300
82#define varying in
83#define gl_FragColor glFragColor
84#define texture2D texture
85#define textureCube texture
86out vec4 glFragColor;
87#endif
88highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}
88vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)
89{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}`,`
90#if __VERSION__ >=300
91#define attribute in
92#define varying out
93#define texture2D texture
94#endif
95float wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}
96#ifdef PROJECTION_GLOBE_VIEW
97vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {
98#ifndef PROJECTED_POS_ON_VIEWPORT
99float tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;
100#else
101return vec3(0.0);
102#endif
103}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}
104#endif
105vec2 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(
106unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
107);}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;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered.`),As=Ba,Oa=`
108#ifdef GL_ES
109precision mediump float;
110#else
111
112#if !defined(lowp)
113#define lowp
114#endif
115
116#if !defined(mediump)
117#define mediump
118#endif
119
120#if !defined(highp)
121#define highp
122#endif
123
124#endif`;var Fa={background:bt(`uniform vec4 u_color;uniform float u_opacity;
125#ifdef LIGHTING_3D_MODE
126varying vec4 v_color;
127#endif
128void main() {vec4 out_color;
129#ifdef LIGHTING_3D_MODE
130out_color=v_color;
131#else
132out_color=u_color;
133#endif
134#ifdef FOG
135out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
136#endif
137gl_FragColor=out_color*u_opacity;
138#ifdef OVERDRAW_INSPECTOR
139gl_FragColor=vec4(1.0);
140#endif
141}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
142#ifdef LIGHTING_3D_MODE
143uniform vec4 u_color;varying vec4 v_color;
144#endif
145void main() {gl_Position=u_matrix*vec4(a_pos,0,1);
146#ifdef LIGHTING_3D_MODE
147v_color=apply_lighting(u_color);
148#endif
149#ifdef FOG
150v_fog_pos=fog_position(a_pos);
151#endif
152}`),backgroundPattern:bt(`uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
153#ifdef LIGHTING_3D_MODE
154out_color=apply_lighting(out_color);
155#endif
156#ifdef FOG
157out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
158#endif
159gl_FragColor=out_color*u_opacity;
160#ifdef OVERDRAW_INSPECTOR
161gl_FragColor=vec4(1.0);
162#endif
163}`,`uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);
164#ifdef FOG
165v_fog_pos=fog_position(a_pos);
166#endif
167}`),circle:bt(`varying vec3 v_data;varying float v_visibility;
168#pragma mapbox: define highp vec4 color
169#pragma mapbox: define mediump float radius
170#pragma mapbox: define lowp float blur
171#pragma mapbox: define lowp float opacity
172#pragma mapbox: define highp vec4 stroke_color
173#pragma mapbox: define mediump float stroke_width
174#pragma mapbox: define lowp float stroke_opacity
175void main() {
176#pragma mapbox: initialize highp vec4 color
177#pragma mapbox: initialize mediump float radius
178#pragma mapbox: initialize lowp float blur
179#pragma mapbox: initialize lowp float opacity
180#pragma mapbox: initialize highp vec4 stroke_color
181#pragma mapbox: initialize mediump float stroke_width
182#pragma mapbox: initialize lowp float stroke_opacity
183vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(
184antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)
185);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);
186#ifdef LIGHTING_3D_MODE
187out_color=apply_lighting(out_color);
188#endif
189#ifdef FOG
190out_color=fog_apply_premultiplied(out_color,v_fog_pos);
191#endif
192gl_FragColor=out_color*(v_visibility*opacity_t);
193#ifdef OVERDRAW_INSPECTOR
194gl_FragColor=vec4(1.0);
195#endif
196}`,`#define NUM_VISIBILITY_RINGS 2
197#define INV_SQRT2 0.70710678
198#define ELEVATION_BIAS 0.0001
199#define NUM_SAMPLES_PER_RING 16
200uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;
201#ifdef PROJECTION_GLOBE_VIEW
202attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
203#endif
204varying vec3 v_data;varying float v_visibility;
205#pragma mapbox: define highp vec4 color
206#pragma mapbox: define mediump float radius
207#pragma mapbox: define lowp float blur
208#pragma mapbox: define lowp float opacity
209#pragma mapbox: define highp vec4 stroke_color
210#pragma mapbox: define mediump float stroke_width
211#pragma mapbox: define lowp float stroke_opacity
212vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {
213#if defined(TERRAIN)
214return elevation(pos)+ELEVATION_BIAS;
215#else
216return 0.0;
217#endif
218}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);
219#ifdef PITCH_WITH_MAP
220#ifdef PROJECTION_GLOBE_VIEW
221return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );
222#else
223return u_matrix*( world_center+vec4(sample_offset,0,0) );
224#endif
225#else
226return projected_center+vec4(sample_offset,0,0);
227#endif
228}float get_sample_step() {
229#ifdef PITCH_WITH_MAP
230return 2.0*PI/float(NUM_SAMPLES_PER_RING);
231#else
232return PI/float(NUM_SAMPLES_PER_RING);
233#endif
234}void main(void) {
235#pragma mapbox: initialize highp vec4 color
236#pragma mapbox: initialize mediump float radius
237#pragma mapbox: initialize lowp float blur
238#pragma mapbox: initialize lowp float opacity
239#pragma mapbox: initialize highp vec4 stroke_color
240#pragma mapbox: initialize mediump float stroke_width
241#pragma mapbox: initialize lowp float stroke_opacity
242vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;
243#ifdef PROJECTION_GLOBE_VIEW
244vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);
245#else 
246surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);
247#endif
248vec4 projected_center=u_matrix*world_center;float view_scale=0.0;
249#ifdef PITCH_WITH_MAP
250#ifdef SCALE_WITH_MAP
251view_scale=1.0;
252#else
253view_scale=projected_center.w/u_camera_to_center_distance;
254#endif
255#else
256#ifdef SCALE_WITH_MAP
257view_scale=u_camera_to_center_distance;
258#else
259view_scale=projected_center.w;
260#endif
261#endif
262gl_Position=project_vertex(extrude,world_center,projected_center,radiu
262s,stroke_width,view_scale,surface_vectors);float visibility=0.0;
263#ifdef TERRAIN
264float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;
265#ifdef PITCH_WITH_MAP
266float cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;
267#else
268occlusion_world_center=world_center;occlusion_projected_center=projected_center;
269#endif
270for(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);
271#else
272visibility=1.0;
273#endif
274#ifdef PROJECTION_GLOBE_VIEW
275visibility=1.0;
276#endif
277v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);
278#ifdef FOG
279v_fog_pos=fog_position(world_center.xyz);
280#endif
281}`),clippingMask:bt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:bt(`uniform highp float u_intensity;varying vec2 v_extrude;
282#pragma mapbox: define highp float weight
283#define GAUSS_COEF 0.3989422804014327
284void main() {
285#pragma mapbox: initialize highp float weight
286float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
287#ifdef FOG
288if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}
289#endif
290#ifdef OVERDRAW_INSPECTOR
291gl_FragColor=vec4(1.0);
292#endif
293}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;
294#ifdef PROJECTION_GLOBE_VIEW
295attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
296#endif
297varying vec2 v_extrude;
298#pragma mapbox: define highp float weight
299#pragma mapbox: define mediump float radius
300const highp float ZERO=1.0/255.0/16.0;
301#define GAUSS_COEF 0.3989422804014327
302void main(void) {
303#pragma mapbox: initialize highp float weight
304#pragma mapbox: initialize mediump float radius
305vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;
306#ifdef PROJECTION_GLOBE_VIEW
307vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
308#else
309pos=vec3(tilePos+extrude,elevation(tilePos));
310#endif
311gl_Position=u_matrix*vec4(pos,1);
312#ifdef FOG
313v_fog_pos=fog_position(pos);
314#endif
315}`),heatmapTexture:bt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
316#ifdef OVERDRAW_INSPECTOR
317gl_FragColor=vec4(0.0);
318#endif
319}`,"attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:bt("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",`attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(
3200.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:bt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}",`attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(
321mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(
3220.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),debug:bt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}",`attribute vec2 a_pos;
323#ifdef PROJECTION_GLOBE_VIEW
324attribute vec3 a_pos_3;
325#endif
326varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;
327#ifdef PROJECTION_GLOBE_VIEW
328gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);
329#else
330gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);
331#endif
332}`),fill:bt(`#pragma mapbox: define highp vec4 color
333#pragma mapbox: define lowp float opacity
334void main() {
335#pragma mapbox: initialize highp vec4 color
336#pragma mapbox: initialize lowp float opacity
337vec4 out_color=color;
338#ifdef LIGHTING_3D_MODE
339out_color=apply_lighting(out_color);
340#endif
341#ifdef FOG
342out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
343#endif
344gl_FragColor=out_color*opacity;
345#ifdef OVERDRAW_INSPECTOR
346gl_FragColor=vec4(1.0);
347#endif
348}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
349#pragma mapbox: define highp vec4 color
350#pragma mapbox: define lowp float opacity
351void main() {
352#pragma mapbox: initialize highp vec4 color
353#pragma mapbox: initialize lowp float opacity
354gl_Position=u_matrix*vec4(a_pos,0,1);
355#ifdef FOG
356v_fog_pos=fog_position(a_pos);
357#endif
358}`),fillOutline:bt(`varying vec2 v_pos;
359#pragma mapbox: define highp vec4 outline_color
360#pragma mapbox: define lowp float opacity
361void main() {
362#pragma mapbox: initialize highp vec4 outline_color
363#pragma mapbox: initialize lowp float opacity
364float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;
365#ifdef LIGHTING_3D_MODE
366out_color=apply_lighting(out_color);
367#endif
368#ifdef FOG
369out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
370#endif
371gl_FragColor=out_color*(alpha*opacity);
372#ifdef OVERDRAW_INSPECTOR
373gl_FragColor=vec4(1.0);
374#endif
375}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
376#pragma mapbox: define highp vec4 outline_color
377#pragma mapbox: define lowp float opacity
378void main() {
379#pragma mapbox: initialize highp vec4 outline_color
380#pragma mapbox: initialize lowp float opacity
381gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
382#ifdef FOG
383v_fog_pos=fog_position(a_pos);
384#endif
385}`),fillOutlinePattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;
386#pragma mapbox: define lowp float opacity
387#pragma mapbox: define lowp vec4 pattern
388void main() {
389#pragma mapbox: initialize lowp float opacity
390#pragma mapbox: initialize mediump vec4 pattern
391vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);
392#ifdef LIGHTING_3D_MODE
393out_color=apply_lighting(out_color);
394#endif
395#ifdef FOG
396out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
397#endif
398gl_FragColor=out_color*(alpha*opacity);
399#ifdef OVERDRAW_INSPECTOR
400gl_FragColor=vec4(1.0);
401#endif
402}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;
403#pragma mapbox: define lowp float opacity
404#pragma mapbox: define lowp vec4 pattern
405#pragma mapbox: define lowp float pixel_ratio
406void main() {
407#pragma mapbox: initialize lowp float opacity
408#pragma mapbox: initialize mediump vec4 pattern
409#pragma mapbox: initialize lowp float pixel_ratio
410vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
411#ifdef FOG
412v_fog_pos=fog_position(a_pos);
413#endif
414}`),fillPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;
415#pragma mapbox: define lowp float opacity
416#pragma mapbox: define lowp vec4 pattern
417void main() {
418#pragma mapbox: initialize lowp float opacity
419#pragma mapbox: initialize mediump vec4 pattern
420vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
421#ifdef LIGHTING_3D_MODE
422out_color=apply_lighting(out_color);
423#endif
424#ifdef FOG
425out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
426#endif
427gl_FragColor=out_color*opacity;
428#ifdef OVERDRAW_INSPECTOR
429gl_FragColor=vec4(1.0);
430#endif
431}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;
432#pragma mapbox: define lowp float opacity
433#pragma mapbox: define lowp vec4 pattern
434#pragma mapbox: define lowp float pixel_ratio
435void main() {
436#pragma mapbox: initialize lowp float opacity
437#pragma mapbox: initialize mediump vec4 pattern
438#pragma mapbox: initialize lowp float pixel_ratio
439vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);
440#ifdef FOG
441v_fog_pos=fog_position(a_pos);
442#endif
443}`),fillExtrusion:bt(`varying vec4 v_color;
444#ifdef RENDER_SHADOWS
445varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
446#endif
447#ifdef FAUX_AO
448uniform lowp vec2 u_ao;varying vec3 v_ao;
449#endif
450#ifdef ZERO_ROOF_RADIUS
451varying vec4 v_roof_color;
452#endif
453#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
454varying highp vec3 v_normal;
455#endif
456void main() {
457#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
458vec3 normal=v_normal;
459#endif
460float z;vec4 color;
461#ifdef ZERO_ROOF_RADIUS
462z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);
463#else
464color=v_color;
465#endif
466#ifdef FAUX_AO
467float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
467),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;
468#ifdef ZERO_ROOF_RADIUS
469concave*=(1.0-z);
470#endif
471float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;
472#endif
473#ifdef RENDER_SHADOWS
474#ifdef ZERO_ROOF_RADIUS
475normal=mix(normal,vec3(0.0,0.0,1.0),z);
476#endif
477color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);
478#endif
479#ifdef FOG
480color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
481#endif
482gl_FragColor=color;
483#ifdef OVERDRAW_INSPECTOR
484gl_FragColor=vec4(1.0);
485#endif
486}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
487#ifdef PROJECTION_GLOBE_VIEW
488attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
489#endif
490varying vec4 v_color;
491#ifdef RENDER_SHADOWS
492uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
493#endif
494#ifdef ZERO_ROOF_RADIUS
495varying vec4 v_roof_color;
496#endif
497#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
498varying highp vec3 v_normal;
499#endif
500#ifdef FAUX_AO
501uniform lowp vec2 u_ao;varying vec3 v_ao;
502#endif
503#pragma mapbox: define highp float base
504#pragma mapbox: define highp float height
505#pragma mapbox: define highp vec4 color
506void main() {
507#pragma mapbox: initialize highp float base
508#pragma mapbox: initialize highp float height
509#pragma mapbox: initialize highp vec4 color
510vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));
511#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
512v_normal=normal;
513#endif
514base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);
515#if defined(HAS_CENTROID) || defined(TERRAIN)
516centroid_pos=a_centroid_pos;
517#endif
518float ele=0.0;float h=0.0;float c_ele;vec3 pos;
519#ifdef TERRAIN
520bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);
521#else
522h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);
523#endif
524#ifdef PROJECTION_GLOBE_VIEW
525float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
526#endif
527float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);
528#ifdef RENDER_SHADOWS
529v_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;
530#endif
531float NdotL=0.0;float colorvalue=0.0;
532#ifdef LIGHTING_3D_MODE
533NdotL=calculate_NdotL(normal);
534#else
535colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);
536#endif
537if (normal.y !=0.0) {float r=0.84;
538#ifndef LIGHTING_3D_MODE
539r=mix(0.7,0.98,1.0-u_lightintensity);
540#endif
541NdotL*=(
542(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);
543#ifdef FAUX_AO
544float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
545#ifdef TERRAIN
546top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
547#endif
548v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
549#ifdef PROJECTION_GLOBE_VIEW
550top_height+=u_height_lift;
551#endif
552gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
553#endif
554#ifdef LIGHTING_3D_MODE
555v_color=apply_lighting(color,NdotL);
556#else
557v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
558#endif
559v_color*=u_opacity;
560#ifdef ZERO_ROOF_RADIUS
561v_roof_color=vec4(0.0,0.0,0.0,1.0);
562#ifdef LIGHTING_3D_MODE
563v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));
564#else
565float roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
566#endif
567v_roof_color*=u_opacity;
568#endif
569#ifdef FOG
570v_fog_pos=fog_position(pos);
571#endif
572}`),fillExtrusionPattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;
573#ifdef FAUX_AO
574uniform lowp vec2 u_ao;varying vec3 v_ao;
575#endif
576#ifdef LIGHTING_3D_MODE
577varying float v_NdotL;
578#endif
579varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;
580#pragma mapbox: define lowp float base
581#pragma mapbox: define lowp float height
582#pragma mapbox: define lowp vec4 pattern
583#pragma mapbox: define lowp float pixel_ratio
584void main() {
585#pragma mapbox: initialize lowp float base
586#pragma mapbox: initialize lowp float height
587#pragma mapbox: initialize mediump vec4 pattern
588#pragma mapbox: initialize lowp float pixel_ratio
589vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);
590#ifdef LIGHTING_3D_MODE
591out_color=apply_lighting(out_color,v_NdotL)*u_opacity;
592#else
593out_color=out_color*v_lighting;
594#endif
595#ifdef FAUX_AO
596float intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;
597#endif
598#ifdef FOG
599out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
600#endif
601gl_FragColor=out_color;
602#ifdef OVERDRAW_INSPECTOR
603gl_FragColor=vec4(1.0);
604#endif
605}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;
606#ifdef PROJECTION_GLOBE_VIEW
607attribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
608#endif
609varying vec2 v_pos;varying vec4 v_lighting;
610#ifdef FAUX_AO
611uniform lowp vec2 u_ao;varying vec3 v_ao;
612#endif
613#ifdef LIGHTING_3D_MODE
614varying float v_NdotL;
615#endif
616#pragma mapbox: define lowp float base
617#pragma mapbox: define lowp float height
618#pragma mapbox: define lowp vec4 pattern
619#pragma mapbox: define lowp float pixel_ratio
620void main() {
621#pragma mapbox: initialize lowp float base
622#pragma mapbox: initialize lowp float height
623#pragma mapbox: initialize mediump vec4 pattern
624#pragma mapbox: initialize lowp float pixel_ratio
625vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;
625base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);
626#if defined(HAS_CENTROID) || defined(TERRAIN)
627centroid_pos=a_centroid_pos;
628#endif
629float ele=0.0;float h=z;vec3 p;float c_ele;
630#ifdef TERRAIN
631bool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);
632#else
633p=vec3(pos_nx.xy,z);
634#endif
635#ifdef PROJECTION_GLOBE_VIEW
636float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
637#endif
638float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0
639? pos_nx.xy
640: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;
641#ifdef LIGHTING_3D_MODE
642NdotL=calculate_NdotL(normal);
643#else
644NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);
645#endif
646if (normal.y !=0.0) {float r=0.84;
647#ifndef LIGHTING_3D_MODE
648r=mix(0.7,0.98,1.0-u_lightintensity);
649#endif
650NdotL*=(
651(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
652#ifdef FAUX_AO
653float concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;
654#ifdef TERRAIN
655top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
655ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
656#endif
657v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
658#ifdef PROJECTION_GLOBE_VIEW
659top_height+=u_height_lift;
660#endif
661gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
662#endif
663#ifdef LIGHTING_3D_MODE
664v_NdotL=NdotL;
665#else
666v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;
667#endif 
668#ifdef FOG
669v_fog_pos=fog_position(p);
670#endif
671}`),hillshadePrepare:bt(`#ifdef GL_ES
672precision highp float;
673#endif
674uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {
675#ifdef TERRAIN_DEM_FLOAT_FORMAT
676return texture2D(u_image,coord).a/4.0;
677#else
678vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;
679#endif
680}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));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(
681(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)
682)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(
683deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
684#ifdef OVERDRAW_INSPECTOR
685gl_FragColor=vec4(1.0);
686#endif
687}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:bt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
688#ifdef LIGHTING_3D_MODE
689gl_FragColor=apply_lighting(gl_FragColor);
690#endif
691#ifdef FOG
692gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));
693#endif
694#ifdef OVERDRAW_INSPECTOR
695gl_FragColor=vec4(1.0);
696#endif
697}`,`uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;
698#ifdef FOG
699v_fog_pos=fog_position(a_pos);
700#endif
701}`),line:bt(`uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;
702#ifdef RENDER_LINE_DASH
703uniform sampler2D u_dash_image;varying vec2 v_tex;
704#endif
705#ifdef RENDER_LINE_GRADIENT
706uniform sampler2D u_gradient_image;
707#endif
708uniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}
709#pragma mapbox: define highp vec4 color
710#pragma mapbox: define lowp float floorwidth
711#pragma mapbox: define lowp vec4 dash
712#pragma mapbox: define lowp float blur
713#pragma mapbox: define lowp float opacity
714float linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {
715#pragma mapbox: initialize highp vec4 color
716#pragma mapbox: initialize lowp float floorwidth
717#pragma mapbox: initialize lowp vec4 dash
718#pragma mapbox: initialize lowp float blur
719#pragma mapbox: initialize lowp float opacity
720float 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);
721#ifdef RENDER_LINE_DASH
722float sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);
723#endif
724highp vec4 out_color;
725#ifdef RENDER_LINE_GRADIENT
726out_color=texture2D(u_gradient_image,v_uv.xy);
727#else
728out_color=color;
729#endif
730float trimmed=1.0;
731#ifdef RENDER_LINE_TRIM_OFFSET
732highp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}
733#endif
734#ifdef LIGHTING_3D_MODE
735out_color=apply_lighting(out_color);
736#endif
737#ifdef FOG
738out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
739#endif
740#ifdef RENDER_LINE_ALPHA_DISCARD
741if (alpha < u_alpha_discard_threshold) {discard;}
742#endif
743#ifdef RENDER_LINE_BORDER
744float edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);
745#ifdef RENDER_LINE_BORDER_AUTO
746float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}
747#else
748out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);
749#endif
750}
751#endif
752gl_FragColor=out_color*(alpha*opacity);
753#ifdef OVERDRAW_INSPECTOR
754gl_FragColor=vec4(1.0);
755#endif
756}`,`
757#define EXTRUDE_SCALE 0.015873016
758attribute vec2 a_pos_normal;attribute vec4 a_data;
759#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
760attribute highp vec4 a_packed;
761#endif
762#ifdef RENDER_LINE_DASH
763attribute float a_linesofar;
764#endif
765uniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;
766#ifdef RENDER_LINE_DASH
767uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;
768#endif
769#ifdef RENDER_LINE_GRADIENT
770uniform float u_image_height;
771#endif
772#pragma mapbox: define highp vec4 color
773#pragma mapbox: define lowp float floorwidth
774#pragma mapbox: define lowp vec4 dash
775#pragma mapbox: define lowp float blur
776#pragma mapbox: define lowp float opacity
777#pragma mapbox: define mediump float gapwidth
778#pragma mapbox: define lowp float offset
779#pragma mapbox: define mediump float width
780void main() {
781#pragma mapbox: initialize highp vec4 color
782#pragma mapbox: initialize lowp float floorwidth
783#pragma mapbox: initialize lowp vec4 dash
784#pragma mapbox: initialize lowp float blur
785#pragma mapbox: initialize lowp float opacity
786#pragma mapbox: initialize mediump float gapwidth
787#pragma mapbox: initialize lowp float offset
788#pragma mapbox: initialize mediump float width
789float 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;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*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
790#ifndef RENDER_TO_TEXTURE
791float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
792#else
793v_gamma_scale=1.0;
794#endif
795#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
796float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];
797#ifdef RENDER_LINE_GRADIENT
798highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);
799#else
800v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);
801#endif
802#endif
803#ifdef RENDER_LINE_DASH
804float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);
805#endif
806v_width2=vec2(outset,inset);
807#ifdef FOG
808v_fog_pos=fog_position(pos);
809#endif
810}`),linePattern:bt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
811#pragma mapbox: define lowp vec4 pattern
812#pragma mapbox: define lowp float pixel_ratio
813#pragma mapbox: define lowp float blur
814#pragma mapbox: define lowp float opacity
815void main() {
816#pragma mapbox: initialize mediump vec4 pattern
817#pragma mapbox: initialize lowp float pixel_ratio
818#pragma mapbox: initialize lowp float blur
819#pragma mapbox: initialize lowp float opacity
820vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.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=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);
821#ifdef LIGHTING_3D_MODE
822color=apply_lighting(color);
823#endif
824#ifdef FOG
825color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
826#endif
827gl_FragColor=color*(alpha*opacity);
828#ifdef OVERDRAW_INSPECTOR
829gl_FragColor=vec4(1.0);
830#endif
831}`,`
832#define scale 0.015873016
833attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
834#pragma mapbox: define lowp float blur
835#pragma mapbox: define lowp float opacity
836#pragma mapbox: define lowp float offset
837#pragma mapbox: define mediump float gapwidth
838#pragma mapbox: define mediump float width
839#pragma mapbox: define lowp float floorwidth
840#pragma mapbox: define lowp vec4 pattern
841#pragma mapbox: define lowp float pixel_ratio
842void main() {
843#pragma mapbox: initialize lowp float blur
844#pragma mapbox: initialize lowp float opacity
845#pragma mapbox: initialize lowp float offset
846#pragma mapbox: initialize mediump float gapwidth
847#pragma mapbox: initialize mediump float width
848#pragma mapbox: initialize lowp float floorwidth
849#pragma mapbox: initialize mediump vec4 pattern
850#pragma mapbox: initialize lowp float pixel_ratio
851float 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;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;
852#ifndef RENDER_TO_TEXTURE
853float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
854#else
855v_gamma_scale=1.0;
856#endif
857v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;
858#ifdef FOG
859v_fog_pos=fog_position(pos);
860#endif
861}`),raster:bt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(
862dot(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);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);
863#ifdef LIGHTING_3D_MODE
864out_color=apply_lighting(out_color);
865#endif
866#ifdef FOG
867out_color=fog_dither(fog_apply(out_color,v_fog_pos));
868#endif
869gl_FragColor=vec4(out_color*color.a,color.a);
870#ifdef OVERDRAW_INSPECTOR
871gl_FragColor=vec4(1.0);
872#endif
873}`,`uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;
874#ifdef FOG
875v_fog_pos=fog_position(a_pos);
876#endif
877}`),symbolIcon:bt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
878#pragma mapbox: define lowp float opacity
879void main() {
880#pragma mapbox: initialize lowp float opacity
881lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
882#ifdef OVERDRAW_INSPECTOR
883gl_FragColor=vec4(1.0);
884#endif
885}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
886#ifdef PROJECTION_GLOBE_VIEW
887attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
888#endif
889uniform 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 bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;
890#ifdef PROJECTION_GLOBE_VIEW
891uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
892#endif
893varying vec2 v_tex;varying float v_fade_opacity;
894#pragma mapbox: define lowp float opacity
895void main() {
896#pragma mapbox: initialize lowp float opacity
897vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
898#ifdef PROJECTION_GLOBE_VIEW
899mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
900#else
901world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
902#endif
903vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
904camera_to_anchor_distance/u_camera_to_center_distance :
905u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9060.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;
907#ifdef PROJECTION_GLOBE_VIEW
908vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
909#else
910offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
911#endif
912vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
913#ifdef PROJECTION_GLOBE_VIEW
914vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
915#else
916projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
917#endif
918highp 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);
919#ifdef TERRAIN
920#ifdef PITCH_WITH_MAP_TERRAIN
921vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
922#endif
923#endif
924float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
925#ifdef PROJECTION_GLOBE_VIEW
926vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
927#else
928gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
929#endif
930float projection_transition_fade=1.0;
931#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
932projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
933#endif
934v_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;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}`),symbolSDF:bt(`#define SDF_PX 8.0
935uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
936#pragma mapbox: define highp vec4 fill_color
937#pragma mapb
937ox: define highp vec4 halo_color
938#pragma mapbox: define lowp float opacity
939#pragma mapbox: define lowp float halo_width
940#pragma mapbox: define lowp float halo_blur
941void main() {
942#pragma mapbox: initialize highp vec4 fill_color
943#pragma mapbox: initialize highp vec4 halo_color
944#pragma mapbox: initialize lowp float opacity
945#pragma mapbox: initialize lowp float halo_width
946#pragma mapbox: initialize lowp float halo_blur
947float 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 buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
948#ifdef OVERDRAW_INSPECTOR
949gl_FragColor=vec4(1.0);
950#endif
951}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
952#ifdef PROJECTION_GLOBE_VIEW
953attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
954#endif
955uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_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 vec3 u_up_vector;
956#ifdef PROJECTION_GLOBE_VIEW
957uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
958#endif
959varying vec2 v_data0;varying vec3 v_data1;
960#pragma mapbox: define highp vec4 fill_color
961#pragma mapbox: define highp vec4 halo_color
962#pragma mapbox: define lowp float opacity
963#pragma mapbox: define lowp float halo_width
964#pragma mapbox: define lowp float halo_blur
965void main() {
966#pragma mapbox: initialize highp vec4 fill_color
967#pragma mapbox: initialize highp vec4 halo_color
968#pragma mapbox: initialize lowp float opacity
969#pragma mapbox: initialize lowp float halo_width
970#pragma mapbox: initialize lowp float halo_blur
971vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
972#ifdef PROJECTION_GLOBE_VIEW
973mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
974#else
975world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
976#endif
977vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
978camera_to_anchor_distance/u_camera_to_center_distance :
979u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9800.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;
981#ifdef PROJECTION_GLOBE_VIEW
982vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
983#else
984offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
985#endif
986vec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
987#ifdef PROJECTION_GLOBE_VIEW
988vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
989#else
990projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
991#endif
992highp 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);
993#ifdef TERRAIN
994#ifdef PITCH_WITH_MAP_TERRAIN
995vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
996#endif
997#endif
998float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
999#ifdef PROJECTION_GLOBE_VIEW
1000vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1001#else
1002gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1003#endif
1004float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;
1005#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1006projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1007#endif
1008vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}`),symbolTextAndIcon:bt(`#define SDF_PX 8.0
1009#define SDF 1.0
1010#define ICON 0.0
1011uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
1012#pragma mapbox: define highp vec4 fill_color
1013#pragma mapbox: define highp vec4 halo_color
1014#pragma mapbox: define lowp float opacity
1015#pragma mapbox: define lowp float halo_width
1016#pragma mapbox: define lowp float halo_blur
1017void main() {
1018#pragma mapbox: initialize highp vec4 fill_color
1019#pragma mapbox: initialize highp vec4 halo_color
1020#pragma mapbox: initialize lowp float opacity
1021#pragma mapbox: initialize lowp float halo_width
1022#pragma mapbox: initialize lowp float halo_blur
1023float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1023gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
1024#ifdef OVERDRAW_INSPECTOR
1025gl_FragColor=vec4(1.0);
1026#endif
1027return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
1028#ifdef OVERDRAW_INSPECTOR
1029gl_FragColor=vec4(1.0);
1030#endif
1031}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
1032#ifdef PROJECTION_GLOBE_VIEW
1033attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
1034#endif
1035uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_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 vec3 u_up_vector;uniform vec2 u_texsize_icon;
1036#ifdef PROJECTION_GLOBE_VIEW
1037uniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;
1038#endif
1039varying vec4 v_data0;varying vec4 v_data1;
1040#pragma mapbox: define highp vec4 fill_color
1041#pragma mapbox: define highp vec4 halo_color
1042#pragma mapbox: define lowp float opacity
1043#pragma mapbox: define lowp float halo_width
1044#pragma mapbox: define lowp float halo_blur
1045void main() {
1046#pragma mapbox: initialize highp vec4 fill_color
1047#pragma mapbox: initialize highp vec4 halo_color
1048#pragma mapbox: initialize lowp float opacity
1049#pragma mapbox: initialize lowp float halo_width
1050#pragma mapbox: initialize lowp float halo_blur
1051vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];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 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;
1052#ifdef PROJECTION_GLOBE_VIEW
1053mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;
1054#else
1055world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
1056#endif
1057vec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?
1058camera_to_anchor_distance/u_camera_to_center_distance :
1059u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
10600.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
1061#ifdef PROJECTION_GLOBE_VIEW
1062vec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);
1063#else
1064projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
1065#endif
1066highp 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);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);
1067#ifdef TERRAIN
1068#ifdef PITCH_WITH_MAP_TERRAIN
1069vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
1070#endif
1071#endif
1072float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
1073#ifdef PROJECTION_GLOBE_VIEW
1074vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1075#else
1076gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));
1077#endif
1078float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;
1079#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1080projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1081#endif
1082v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_s
1082df);}`),terrainRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0;
1083#ifdef FOG
1084varying float v_fog_opacity;
1085#endif
1086#ifdef RENDER_SHADOWS
1087varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
1088#endif
1089void main() {vec4 color=texture2D(u_image0,v_pos0);
1090#ifdef RENDER_SHADOWS
1091color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);
1092#endif
1093#ifdef FOG
1094#ifdef ZERO_EXAGGERATION
1095color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1096#else
1097color=fog_dither(fog_apply_from_vert(color,v_fog_opacity));
1098#endif
1099#endif
1100gl_FragColor=color;
1101#ifdef TERRAIN_WIREFRAME
1102gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1103#endif
1104#ifdef OVERDRAW_INSPECTOR
1105gl_FragColor=vec4(1.0);
1106#endif
1107}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;
1108#ifdef FOG
1109varying float v_fog_opacity;
1110#endif
1111#ifdef RENDER_SHADOWS
1112uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
1113#endif
1114const float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;
1115#ifdef TERRAIN_WIREFRAME
1116elevation+=wireframeOffset;
1117#endif
1118v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);
1119#ifdef FOG
1120#ifdef ZERO_EXAGGERATION
1121v_fog_pos=fog_position(decodedPos);
1122#else
1123v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));
1124#endif
1125#endif
1126#ifdef RENDER_SHADOWS
1127vec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;
1128#endif
1129}`),terrainDepth:bt(`#ifdef GL_ES
1130precision highp float;
1131#endif
1132varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}`,"uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:bt(`
1133varying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(
1134cos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1134nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;
1135#ifdef FOG
1136sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);
1137#endif
1138sky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);
1139#ifdef OVERDRAW_INSPECTOR
1140gl_FragColor=vec4(1.0);
1141#endif
1142}`,xn),skyboxGradient:bt(`varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));
1143#ifdef FOG
1144color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;
1145#endif
1146color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;
1147#ifdef OVERDRAW_INSPECTOR
1148gl_FragColor=vec4(1.0);
1149#endif
1150}`,xn),skyboxCapture:bt(`
1151varying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;
1152#ifdef GL_ES
1153precision highp float;
1154#endif
1155#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)
1156#define BETA_M                  vec3(21e-6,21e-6,21e-6)
1157#define MIE_G                   0.76
1158#define DENSITY_HEIGHT_SCALE_R  8000.0
1159#define DENSITY_HEIGHT_SCALE_M  1200.0
1160#define PLANET_RADIUS           6360e3
1161#define ATMOSPHERE_RADIUS       6420e3
1162#define SAMPLE_STEPS            10
1163#define DENSITY_STEPS           4
1164float ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}
1164float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}`,"attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1164nd-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:bt(`uniform sampler2D u_image0;varying vec2 v_pos0;
1165#ifndef FOG
1166uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;
1167#endif
1168void main() {vec4 color;
1169#ifdef CUSTOM_ANTIALIASING
1170vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
1171mix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);
1172#else
1173color=texture2D(u_image0,v_pos0);
1174#endif
1175#ifdef FOG
1176color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1177#endif
1178gl_FragColor=color;
1179#ifdef TERRAIN_WIREFRAME
1180gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1181#endif
1182#ifdef OVERDRAW_INSPECTOR
1183gl_FragColor=vec4(1.0);
1184#endif
1185}`,`uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;
1186#ifdef GLOBE_POLES
1187attribute vec3 a_globe_pos;attribute vec2 a_uv;
1188#else
1189attribute vec2 a_pos;
1190#endif
1191varying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {
1192#ifdef GLOBE_POLES
1193vec3 globe_pos=a_globe_pos;vec2 uv=a_uv;
1194#else
1195float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);
1196#endif
1197v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;
1198#ifdef GLOBE_POLES
1199vec3 up_vector=globe_derived_up_vector;
1200#else
1201vec3 up_vector=elevationVector(tile_pos);
1202#endif
1203float height=elevation(tile_pos);
1204#ifdef TERRAIN_WIREFRAME
1205height+=wireframeOffset;
1206#endif
1207globe_pos+=up_vector*height;
1208#ifndef GLOBE_POLES
1209globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;
1210#endif
1211#ifdef GLOBE_POLES
1212vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);
1213#else
1214vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);
1215#endif
1216gl_Position=u_proj_matrix*interpolated_pos;
1217#ifdef FOG
1218v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
1219#endif
1220}`),globeAtmosphere:bt(`uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;
1220highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;
1221#ifdef PROJECTION_GLOBE_VIEW
1222globe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}
1223#endif
1224highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?
12250.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;
1226#ifdef PROJECTION_GLOBE_VIEW
1227highp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?
1228PI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);
1229#else
1230horizon_angle=horizon_angle_mercator;
1231#endif
1232horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:
1233(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:
1234uv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}`,`attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(
1235mix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(
1236mix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}`)};function Hn(l,r){const o=l.replace(/\s*\/\/[^\n]*\n/g,`
1237`).split(`
1238`);for(let h of o)if(h=h.trim(),h[0]==="#"&&h.includes("if")&&!h.includes("endif")){h=h.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const d=h.split(" ");for(const f of d)r.includes(f)||r.push(f)}}function bt(l,r){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,h=r.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),d={},f=[...Fo];return Hn(l,f),Hn(r,f),{fragmentSource:l=l.replace(o,(g,y,v,E,T)=>(d[T]=!0,y==="define"?`
1239#ifndef HAS_UNIFORM_u_${T}
1240varying ${v} ${E} ${T};
1241#else
1242uniform ${v} ${E} u_${T};
1243#endif
1244`:`
1245#ifdef HAS_UNIFORM_u_${T}
1246    ${v} ${E} ${T} = u_${T};
1247#endif
1248`)),vertexSource:r=r.replace(o,(g,y,v,E,T)=>{const A=E==="float"?"vec2":"vec4",k=T.match(/color/)?"color":A;return d[T]?y==="define"?`
1249#ifndef HAS_UNIFORM_u_${T}
1250uniform lowp float u_${T}_t;
1251attribute ${v} ${A} a_${T};
1252varying ${v} ${E} ${T};
1253#else
1254uniform ${v} ${E} u_${T};
1255#endif
1256`:k==="vec4"?`
1257#ifndef HAS_UNIFORM_u_${T}
1258    ${T} = a_${T};
1259#else
1260    ${v} ${E} ${T} = u_${T};
1261#endif
1262`:`
1263#ifndef HAS_UNIFORM_u_${T}
1264    ${T} = unpack_mix_${k}(a_${T}, u_${T}_t);
1265#else
1266    ${v} ${E} ${T} = u_${T};
1267#endif
1268`:y==="define"?`
1269#ifndef HAS_UNIFORM_u_${T}
1270uniform lowp float u_${T}_t;
1271attribute ${v} ${A} a_${T};
1272#else
1273uniform ${v} ${E} u_${T};
1274#endif
1275`:k==="vec4"?`
1276#ifndef HAS_UNIFORM_u_${T}
1277    ${v} ${E} ${T} = a_${T};
1278#else
1279    ${v} ${E} ${T} = u_${T};
1280#endif
1281`:`
1282#ifndef HAS_UNIFORM_u_${T}
1283    ${v} ${E} ${T} = unpack_mix_${k}(a_${T}, u_${T}_t);
1284#else
1285    ${v} ${E} ${T} = u_${T};
1286#endif
1287`}),staticAttributes:h,usedDefines:f}}class Ch{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(r,o,h,d,f,g,y){this.context=r;let v=this.boundPaintVertexBuffers.length!==d.length;for(let T=0;!v&&T<d.length;T++)this.boundPaintVertexBuffers[T]!==d[T]&&(v=!0);let E=this.boundDynamicVertexBuffers.length!==y.length;for(let T=0;!E&&T<y.length;T++)this.boundDynamicVertexBuffers[T]!==y[T]&&(E=!0);if(!r.extVertexArrayObject||!this.vao||this.boundProgram!==o||this.boundLayoutVertexBuffer!==h||v||E||this.boundIndexBuffer!==f||this.boundVertexOffset!==g)this.freshBind(o,h,d,f,g,y);else{r.bindVertexArrayOES.set(this.vao);for(const T of y)T&&T.bind();f&&f.dynamicDraw&&f.bind()}}freshBind(r,o,h,d,f,g){let y;const v=r.numAttributes,E=this.context,T=E.gl;if(E.extVertexArrayObject)this.vao&&this.destroy(),this.vao=E.extVertexArrayObject.createVertexArrayOES(),E.bindVertexArrayOES.set(this.vao),y=0,this.boundProgram=r,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=h,this.boundIndexBuffer=d,this.boundVertexOffset=f,this.boundDynamicVertexBuffers=g;else{y=E.currentNumAttributes||0;for(let A=v;A<y;A++)T.disableVertexAttribArray(A)}o.enableAttributes(T,r),o.bind(),o.setVertexAttribPointers(T,r,f);for(const A of h)A.enableAttributes(T,r),A.bind(),A.setVertexAttribPointers(T,r,f);for(const A of g)A&&(A.enableAttributes(T,r),A.bind(),A.setVertexAttribPointers(T,r,f));d&&d.bind(),E.currentNumAttributes=v}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Ua(l,r){const o=Math.pow(2,r.canonical.z),h=r.canonical.y;return[new a.MercatorCoordinate(0,h/o).toLngLat().lat,new a.MercatorCoordinate(0,(h+1)/o).toLngLat().lat]}function lc(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=o.fbo;if(!E)return;l.prepareDrawTile();const T=l.useProgram("hillshade");y.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,E.colorAttachment.get());const A=((B,F,I,L)=>{const N=I.paint.get("hillshade-shadow-color"),j=I.paint.get("hillshade-highlight-color"),K=I.paint.get("hillshade-accent-color");let J=I.paint.get("hillshade-illumination-direction")*(Math.PI/180);I.paint.get("hillshade-illumination-anchor")==="viewport"&&(J-=B.transform.angle);const Y=!B.options.moving;return{u_matrix:L||B.transform.calculateProjMatrix(F.tileID.toUnwrapped(),Y),u_image:0,u_latrange:Ua(0,F.tileID),u_light:[I.paint.get("hillshade-exaggeration"),J],u_shadow:N,u_highlight:j,u_accent:K}})(l,o,h,l.terrain?r.projMatrix:null);l.prepareDrawProgram(y,T,r.toUnwrapped());const{tileBoundsBuffer:k,tileBoundsIndexBuffer:R,tileBoundsSegments:O}=l.getTileBoundsBuffers(o);T.draw(y,v.TRIANGLES,d,f,g,a.CullFaceMode.disabled,A,h.id,k,R,O)}function Va(l,r,o){if(!r.needsDEMTextureUpload)return;const h=l.context,d=h.gl;h.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||l.getTileTexture(o.stride);const f=o.getPixels();r.demTexture?r.demTexture.update(f,{premultiply:!1}):r.demTexture=new a.Texture(h,f,d.RGBA,{premultiply:!1}),r.needsDEMTextureUpload=!1}function cc(l,r,o,h,d,f){const g=l.context,y=g.gl;if(!r.dem)return;const v=r.dem;if(g.activeTexture.set(y.TEXTURE1),Va(l,r,v),!r.demTexture)return;r.demTexture.bind(y.NEAREST,y.CLAMP_TO_EDGE);const E=v.dim;g.activeTexture.set(y.TEXTURE0);let T=r.fbo;if(!T){const O=new a.Texture(g,{width:E,height:E,data:null},y.RGBA);O.bind(y.LINEAR,y.CLAMP_TO_EDGE),T=r.fbo=g.createFramebuffer(E,E,!0),T.colorAttachment.set(O.texture)}g.bindFramebuffer.set(T.framebuffer),g.viewport.set([0,0,E,E]);const{tileBoundsBuffer:A,tileBoundsIndexBuffer:k,tileBoundsSegments:R}=l.getMercatorTileBoundsBuffers();l.useProgram("hillshadePrepare").draw(g,y.TRIANGLES,h,d,f,a.CullFaceMode.disabled,((O,B)=>{const F=B.stride,I=a.create();return a.ortho(I,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(I,I,[0,-a.EXTENT,0]),{u_matrix:I,u_image:1,u_dimension:[F,F],u_zoom:O.overscaledZ,u_unpack:B.unpackVector}})(r.tileID,v),o.id,A,k,R),r.needsHillshadePrepare=!1}const Na=l=>({u_matrix:new a.UniformMatrix4f(l),u_image0:new a.Uniform1i(l),u_skirt_height:new a.Uniform1f(l)}),Kn=(l,r)=>({u_matrix:l,u_image0:0,u_skirt_height:r}),Is=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O)=>({u_proj_matrix:Float32Array.from(l),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(h),u_merc_matrix:o,u_zoom_transition:d,u_merc_center:f,u_image0:0,u_frustum_tl:g,u_frustum_tr:y,u_frustum_br:v,u_frustum_bl:E,u_globe_pos:T,u_globe_radius:A,u_viewport:k,u_grid_matrix:O?Float32Array.from(O):new Float32Array(9),u_skirt_height:R});function Yn(l,r){return l!=null&&r!=null&&!(!l.hasData()||!r.hasData())&&l.demTexture!=null&&r.demTexture!=null&&l.tileID.key!==r.tileID.key}const kr=new class{constructor(){this.operations={}}newMorphing(l,r,o,h,d){if(l in this.operations){const f=this.operations[l];f.to.tileID.key!==o.tileID.key&&(f.queued=o)}else this.operations[l]={startTime:h,phase:0,duration:d,from:r,to:o,queued:null}}getMorphValuesForProxy(l){if(!(l in this.operations))return null;const r=this.operations[l];return{from:r.from,to:r.to,phase:r.phase}}update(l){for(const r in this.operations){const o=this.operations[r];for(o.phase=(l-o.startTime)/o.duration;o.phase>
vendor: 5,460 bytes, lines 1287-1288
1287=1||!this._validOp(o);)if(!this._nextOp(o,l)){delete this.operations[r];break}}}_nextOp(l,r){return!!l.queued&&(l.from=l.to,l.to=l.queued,l.queued=null,l.phase=0,l.startTime=r,!0)}_validOp(l){return l.from.hasData()&&l.to.hasData()}},vn={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Cs(l){return 6*Math.pow(1.5,22-l)}function hc(l,r){const o=1<<l.z;return!r&&(l.x===0||l.x===o-1)||l.y===0||l.y===o-1}const Uo=l=>({u_matrix:l});function ja(l,r,o,h,d){if(d>0){const f=a.exported.now(),g=(f-l.timeAdded)/d,y=r?(f-r.timeAdded)/d:-1,v=o.getSource(),E=h.coveringZoomLevel({tileSize:v.tileSize,roundZoom:v.roundZoom}),T=!r||Math.abs(r.tileID.overscaledZ-E)>Math.abs(l.tileID.overscaledZ-E),A=T&&l.refreshedUponExpiration?1:a.clamp(T?g:1-y,0,1);return l.refreshedUponExpiration&&g>=1&&(l.refreshedUponExpiration=!1),r?{opacity:1,mix:1-A}:{opacity:A,mix:0}}return{opacity:1,mix:0}}class Ga extends a.SourceCache{constructor(r){const o={type:"raster-dem",maxzoom:r.transform.maxZoom},h=new oi($n(),null),d=nt("mock-dem",o,h,r.style);super("mock-dem",d,!1),d.setEventedParent(this),this._sourceLoaded=!0}_loadTile(r,o){r.state="loaded",o(null)}}class zs extends a.SourceCache{constructor(r){const o=nt("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new oi($n(),null),r.style);super("proxy",o,!1),o.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(r,o,h){if(r.freezeTileCoverage)return;this.transform=r;const d=r.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((f,g)=>{if(f[g.key]="",!this._tiles[g.key]){const y=new a.Tile(g,this._source.tileSize*g.overscaleFactor(),r.tileZoom);y.state="loaded",this._tiles[g.key]=y}return f},{});for(const f in this._tiles)f in d||(this.freeFBO(f),this._tiles[f].unloadVectorData(),delete this._tiles[f])}freeFBO(r){const o=this.proxyCachedFBO[r];if(o!==void 0){const h=Object.values(o);this.renderCachePool.push(...h),delete this.proxyCachedFBO[r]}}deallocRenderCache(){this.renderCache.forEach(r=>r.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Ps extends a.OverscaledTileID{constructor(r,o,h){super(r.overscaledZ,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y),this.proxyTileKey=o,this.projMatrix=h}}class $a extends a.Elevation{constructor(r,o){super(),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[h,d,f]=function(v){const E=new a.StructArrayLayout2i4,T=new a.StructArrayLayout3ui6,A=131;E.reserve(17161),T.reserve(33800);const k=a.EXTENT/128,R=a.EXTENT+k/2,O=R+k;for(let F=-k;F<O;F+=k)for(let I=-k;I<O;I+=k){const L=I<0||I>R||F<0||F>R?24575:0,N=a.clamp(Math.round(I),0,a.EXTENT),j=a.clamp(Math.round(F),0,a.EXTENT);E.emplaceBack(N+L,j)}const B=(F,I)=>{const L=I*A+F;T.emplaceBack(L+1,L,L+A),T.emplaceBack(L+A,L+A+1,L+1)};for(let F=1;F<129;F++)for(let I=1;I<129;I++)B(I,F);return[0,129].forEach(F=>{for(let I=0;I<130;I++)B(I,F),B(F,I)}),[E,T,32768]}(),g=r.context;this.gridBuffer=g.createVertexBuffer(h,a.posAttributes.members),this.gridIndexBuffer=g.createIndexBuffer(d),this.gridSegments=a.SegmentVector.simpleSegment(0,0,h.length,d.length),this.gridNoSkirtSegments=a.SegmentVector.simpleSegment(0,0,h.length,f),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new zs(o.map),this.orthoMatrix=a.create(),a.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,a.EXTENT,0,a.EXTENT,0,1);const y=g.gl;this._overlapStencilMode=new a.StencilMode({func:y.GEQUAL,mask:255},0,255,y.KEEP,y.KEEP,y.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=o,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ga(o.map)}set style(r){r.on("data",this._onStyleDataEvent.bind(this)),r.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=r,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,o,h){if(r&&r.terrain){this._style!==r&&(this.style=r),this.enabled=!0;const d=r.terrain.properties;this.sourceCache=r.terrain.drapeRenderMode===0?this._mockSourceCache:r._getSourceCache(d.get("source")),this._exaggeration=d.get("exaggeration");const f=()=>{this.sourceCache.used&&a.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
1288This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const g=this.getScaledDemTileSize();this.sourceCache.update(o,g,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,f(),this._initializing=!0),f(),o.updateElevation(!0,h),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(o),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(r){this._findCoveringTileCache[r]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const r=this.renderCacheEfficiency(this._style);
vendor: 4,322 bytes, lines 1288-1290
1288this._style.map._optimizeForTerrain||r.efficiency!==100&&a.warnOnce(`Terrain render cache efficiency is not optimal (${r.efficiency}%) and performance
1289                may be affected negatively, consider placing all background, fill and line layers before layer
1290                with id '${r.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(r){r.coord&&r.dataType==="source"?this._clearRenderCacheForTile(r.sourceCacheId,r.coord):r.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const r in this._style._sourceCaches)this._style._sourceCaches[r].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(r=>r.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const r=2*this.proxySourceCache.getSource().tileSize;return[r,r]}set useVertexMorphing(r){this._useVertexMorphing=r}updateTileBinding(r){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const o=this.proxySourceCache,h=this.painter.transform;this._initializing&&(this._initializing=h._centerAltitude===0&&this.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(h.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const d=this.proxyCoords=o.getIds().map(v=>{const E=o.getTileByID(v).tileID;return E.projMatrix=h.calculateProjMatrix(E.toUnwrapped()),E});(function(v,E){const T=E.transform.pointCoordinate(E.transform.getCameraPoint()),A=new a.Point(T.x,T.y);v.sort((k,R)=>{if(R.overscaledZ-k.overscaledZ)return R.overscaledZ-k.overscaledZ;const O=new a.Point(k.canonical.x+(1<<k.canonical.z)*k.wrap,k.canonical.y),B=new a.Point(R.canonical.x+(1<<R.canonical.z)*R.wrap,R.canonical.y),F=A.mult(1<<k.canonical.z);return F.x-=.5,F.y-=.5,F.distSqr(O)-F.distSqr(B)})})(d,this.painter),this._previousZoom=h.zoom;const f=this.proxyToSource||{};this.proxyToSource={},d.forEach(v=>{this.proxyToSource[v.key]={}}),this.terrainTileForTile={};const g=this._style._sourceCaches;for(const v in g){const E=g[v];if(!E.used||(E!==this.sourceCache&&this.resetTileLookupCache(E.id),this._setupProxiedCoordsForOrtho(E,r[v],f),E.usedForTerrain))continue;const T=r[v];E.getSource().reparseOverscaled&&this._assignTerrainTiles(T)}this.proxiedCoords[o.id]=d.map(v=>new Ps(v,v.key,this.orthoMatrix)),this._assignTerrainTiles(d),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(f),this.renderingToTexture=!1,this._updateTimestamp=a.exported.now();const y={};this._visibleDemTiles=[];for(const v of this.proxyCoords){const E=this.terrainTileForTile[v.key];if(!E)continue;const T=E.tileID.key;T in y||(this._visibleDemTiles.push(E),y[T]=T)}}_assignTerrainTiles(r){this._initializing||r.forEach(o=>{if(this.terrainTileForTile[o.key])return;const h=this._findTileCoveringTileID(o,this.sourceCache);h&&(this.terrainTileForTile[o.key]=h)})}_prepareDEMTextures(){const r=this.painter.context,o=r.gl;for(const h in this.terrainTileForTile){const d=this.terrainTileForTile[h],f=d.dem;!f||d.demTexture&&!d.needsDEMTextureUpload||(r.activeTexture.set(o.TEXTURE1),Va(this.painter,d,f))}}_prepareDemTileUniforms(r,o,h,d){if(!o||o.demTexture==null)return!1;const f=r.tileID.canonical,g=Math.pow(2,o.tileID.canonical.z-f.z),y=d||"";return h[`u_dem_tl${y}`]=[f.x*g%1,f.y*g%1],h[`u_dem_scale${y}`]=g,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const r=this.painter.context,o=r.gl;if(!this._emptyDepthBufferTexture){const h=new a.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new a.Texture(r,h,o.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let r=0;const o=this._visibleDemTiles.reduce((h,d)=>
1290{if(!d.dem)return h;const f=d.dem.tree.minimums[0];return f>0&&r++,h+f},0);return r?o/r:0}_updateEmptyDEMTexture(){const r=this.painter.context,o=r.gl;r.activeTexture.set(o.TEXTURE2);const h=this._getLoadedAreaMinimum(),d=new a.RGBAImage({width:1,height:1},new Uint8Array(a.DEMData.pack(h,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let f=this._emptyDEMTexture;return f?f.update(d,{premultiply:!1}):f=this._emptyDEMTexture=new a.Texture(r,d,o.RGBA,{premultiply:!1}),f}setupElevationDraw(r,o,h){const d=this.painter.context,f=d.gl,g=(y=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:a.DEMData.getUnpackVector(y),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var y;g.u_dem_size=this.sourceCache.getSource().tileSize,g.u_exaggeration=this.exaggeration();let v=null,E=null,T=1;if(h&&h.morphing&&this._useVertexMorphing){const A=h.morphing.srcDemTile,k=h.morphing.dstDemTile;T=h.morphing.phase,A&&k&&(this._prepareDemTileUniforms(r,A,g,"_prev")&&(E=A),this._prepareDemTileUniforms(r,k,g)&&(v=k))}if(E&&v?(d.activeTexture.set(f.TEXTURE2),v.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),d.activeTexture.set(f.TEXTURE4),E.demTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE,f.NEAREST),g.u_dem_lerp=T):(v=this.terrainTileForTile[r.tileID.key],d.activeTexture.set(f.TEXTURE2),(this._prepareDemTileUniforms(r,v,g)?v.demTexture:this.emptyDEMTexture).bind(f.NEAREST,f.CLAMP_TO_EDGE)),d.activeTexture.set(f.TEXTURE3),h&&h.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),this._depthFBO&&(g.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(f.NEAREST,f.CLAMP_TO_EDGE),g.u_depth_size_inv=[1,1]),h&&h.useMeterToDem&&v){const A=(1<<v.tileID.canonical.z)*a.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;g.u_meter_to_dem=A}if(h&&h.labelPlaneMatrixInv&&(g.u_label_plane_matrix_inv=h.labelPlaneMatrixInv),o.setTerrainUniformValues(d,g),this.painter.transform.projection.name==="globe"){const A=this.globeUniformValues(this.painter.transform,r.tileID.canonical,h&&h.useDenormalizedUpVectorScale);o.setGlobeUniformValues(d,A)}}globeUniformValues(r,o,h){const d=r.projection;return{u_tile_tl_up:d.upVector(o,0,0),u_tile_tr_up:d.upVector(o,a.EXTENT,0),u_tile_br_up:d.upVector(o,a.EXTENT,a.EXTENT),u_tile_bl_up:d.upVector(o,0,a.EXTENT),u_tile_up_scale:h?a.globeMetersToEcef(1):d.upVectorScale(o,r.center.lat,r.worldSize).metersToTile}}renderToBackBuffer(r){const o=this.painter,h=this.painter.context;r.length!==0&&(h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),o.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(d,f,g,y,v){if(d.transform.projection.name==="globe")(function(E,T,A,k,R){const O=E.context,B=O.gl;let F,I;const L=E.options.showTerrainWireframe?2:0,N=E.transform,j=a.globeUseCustomAntiAliasing(E,O,N),K=(we,ae)=>{if(I===we)return;const _e=[vn[we],"PROJECTION_GLOBE_VIEW"];j&&_e.push("CUSTOM_ANTIALIASING"),ae&&_e.push(vn[L]),F=E.useProgram("globeRaster",null,_e),I=we},J=E.colorModeForRenderPass(),Y=new a.DepthMode(B.LEQUAL,a.DepthMode.ReadWrite,E.depthRangeFor3D);kr.update(R);const ie=a.calculateGlobeMercatorMatrix(N),te=[a.mercatorXfromLng(N.center.lng),a.mercatorYfromLat(N.center.lat)],le=L?[!1,!0]:[!1],Te=E.globeSharedBuffers,oe=[N.width*a.exported.devicePixelRatio,N.height*a.exported.devicePixelRatio],ge=Float32Array.from(N.globeMatrix),he={useDenormalizedUpVectorScale:!0};if(le.forEach(we=>{const ae=E.transform,_e=Cs(ae.zoom)*T.exaggeration();I=-1;const Me=we?B.LINES:B.TRIANGLES;for(const ve of k){const Ae=A.getTile(ve),Ge=a.StencilMode.disabled,Xe=T.prevTerrainTileForTile[ve.key],Ve=T.terrainTileForTile[ve.key];Yn(Xe,Ve)&&kr.newMorphing(ve.key,Xe,Ve,R,250),O.activeTexture.set(B.TEXTURE0),Ae.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);const qe=kr.getMorphValuesForProxy(ve.key),lt=qe?1:0;qe&&a.extend$1(he,{morphing:{srcDemTile:qe.from,dstDemTile:qe.to,phase:a.easeCubicInOut(qe.phase)}});const ot=a.tileCornersToBounds(ve.canonical),je=a.getLatitudinalLod(ot.getCenter().lat),wt=a.getGridMatrix(ve.canonical,ot,je,ae.worldSize/ae._pixelsPerMercatorPixel),Tt=a.globeNormalizeECEF(a.globeTileBounds(ve.canonical)),Et=Is(ae.projMatrix,ge,ie,Tt,a.globeToMercatorTransition(ae.zoom),te,ae.frustumCorners.TL,ae.frustumCorners.TR,ae.frustumCorners.BR,ae.frustumCorners.BL,ae.globeCenterInViewSpace,ae.globeRadius,oe,_e,wt);if(K(lt,we),T.setupElevationDraw(Ae,F,he),E.prepareDrawProgram(O,F,ve.toUnwrapped()),Te){const[St,vi,ui]=we?Te.getWirefameBuffers(E.context,je):Te.getGridBuffers(je,_e!==0);F.draw(O,Me,Y,Ge,J,a.CullFaceMode.backCCW,Et,"globe_raster",St,vi,ui)}}}),Te){const we=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];j&&we.push("CUSTOM_ANTIALIASING"),F=E.useProgram("globeRaster",null,we);for(const ae of k){const{x:_e,y:Me,z:ve}=ae.canonical,Ae=Me===0,Ge=Me===(1<<ve)-1,[Xe,Ve,qe,lt]=Te.getPoleBuffers(ve);if(lt&&(Ae||Ge)){const ot=A.getTile(ae);O.activeTexture.set(B.TEXTURE0),ot.texture.bind(B.LINEAR,B.CLAMP_TO_EDGE);let je=a.globePoleMatrixForTile(ve,_e,N);const wt=a.globeNormalizeECEF(a.globeTileBounds(ae.canonical)),Tt=(Et,St)=>Et.draw(O,B.TRIANGLES,Y,a.StencilMode.disabled,J,a.CullFaceMode.disabled,Is(N.projMatrix,je,je,wt,0,te,N.frustumCorners.TL,N.frustumCorners.TR,N.frustumCorners.BR,N.frustumCorners.BL,N.globeCenterInViewSpace,N.globeRadius,oe,0),"globe_pole_raster",St,qe,lt);T.setupElevationDraw(ot,F,he),E.prepareDrawProgram(O,F,ae.toUnwrapped()),Ae&&Tt(F,Xe),Ge&&(je=a.scale(a.create(),je,[1,-1,1]),Tt(F,Ve))}}}})(d,f,g,y,v);else{const E=d.context,T=E.gl;let A,k;const R=d.options.showTerrainWireframe?2:0,O=(N,j)=>{if(k===N)return;const K=[vn[N]];j&&K.push(vn[R]),A=d.useProgram("terrainRaster",null,K),k=N},B=d.colorModeForRenderPass(),F=new a.DepthMode(T.LEQUAL,a.DepthMode.ReadWrite,d.depthRangeFor3D);kr.update(v);const I=d.transform,L=Cs(I.zoom)*f.exaggeration();
1290(R?[!1,!0]:[!1]).forEach(N=>{k=-1;const j=N?T.LINES:T.TRIANGLES,[K,J]=N?f.getWirefameBuffer():[f.gridIndexBuffer,f.gridSegments];for(const Y of y){const ie=g.getTile(Y),te=a.StencilMode.disabled,le=f.prevTerrainTileForTile[Y.key],Te=f.terrainTileForTile[Y.key];Yn(le,Te)&&kr.newMorphing(Y.key,le,Te,v,250),E.activeTexture.set(T.TEXTURE0),ie.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST);const oe=kr.getMorphValuesForProxy(Y.key),ge=oe?1:0;let he;oe&&(he={morphing:{srcDemTile:oe.from,dstDemTile:oe.to,phase:a.easeCubicInOut(oe.phase)}});const we=Kn(Y.projMatrix,hc(Y.canonical,I.renderWorldCopies)?L/10:L);O(ge,N),f.setupElevationDraw(ie,A,he),d.prepareDrawProgram(E,A,Y.toUnwrapped()),A.draw(E,j,F,te,B,a.CullFaceMode.backCCW,we,"terrain_raster",f.gridBuffer,K,J)}})}}(o,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,o.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(this._drapedRenderBatches.length===0)return r+1;this.renderingToTexture=!0;const o=this.painter,h=this.painter.context,d=this.proxySourceCache,f=this.proxiedCoords[d.id],g=this._drapedRenderBatches.shift(),y=[],v=o.style.order;let E=0;for(const T of f){const A=d.getTileByID(T.proxyTileKey),k=d.proxyCachedFBO[T.key]?d.proxyCachedFBO[T.key][r]:void 0,R=k!==void 0?d.renderCache[k]:this.pool[E++],O=k!==void 0;if(A.texture=R.tex,O&&!R.dirty){y.push(A.tileID);continue}let B;h.bindFramebuffer.set(R.fb.framebuffer),this.renderedToTile=!1,R.dirty&&(h.clear({color:a.Color.transparent,stencil:0}),R.dirty=!1);for(let F=g.start;F<=g.end;++F){const I=o.style._layers[v[F]];if(I.isHidden(o.transform.zoom))continue;const L=o.style._getLayerSourceCache(I),N=L?this.proxyToSource[T.key][L.id]:[T];if(!N)continue;const j=N;h.viewport.set([0,0,R.fb.width,R.fb.height]),B!==(L?L.id:null)&&(this._setupStencil(R,N,I,L),B=L?L.id:null),o.renderLayer(o,L,I,j)}this.renderedToTile?(R.dirty=!0,y.push(A.tileID)):O||--E,E===5&&(E=0,this.renderToBackBuffer(y))}return this.renderToBackBuffer(y),this.renderingToTexture=!1,h.bindFramebuffer.set(null),h.viewport.set([0,0,o.width,o.height]),g.end+1}postRender(){}renderCacheEfficiency(r){const o=r.order.length;if(o===0)return{efficiency:100};let h,d=0,f=0,g=!1;for(let y=0;y<o;++y){const v=r._layers[r.order[y]];this._style.isLayerDraped(v)?(g&&++d,++f):g||(g=!0,h=v.id)}return f===0?{efficiency:100}:{efficiency:100*(1-d/f),firstUndrapedLayer:h}}getMinElevationBelowMSL(){let r=0;return this._visibleDemTiles.filter(o=>o.dem).forEach(o=>{r=Math.min(r,o.dem.tree.minimums[0])}),r===0?r:(r-30)*this._exaggeration}raycast(r,o,h){if(!this._visibleDemTiles)return null;const d=this._visibleDemTiles.filter(f=>f.dem).map(f=>{const g=f.tileID,y=1<<g.overscaledZ,{x:v,y:E}=g.canonical,T=v/y,A=(v+1)/y,k=E/y,R=(E+1)/y;return{minx:T,miny:k,maxx:A,maxy:R,t:f.dem.tree.raycastRoot(T,k,A,R,r,o,h),tile:f}});d.sort((f,g)=>(f.t!==null?f.t:Number.MAX_VALUE)-(g.t!==null?g.t:Number.MAX_VALUE));for(const f of d){if(f.t==null)return null;const g=f.tile.dem.tree.raycast(f.minx,f.miny,f.maxx,f.maxy,r,o,h);if(g!=null)return g}return null}_createFBO(){const r=this.painter.context,o=r.gl,h=this.drapeBufferSize;r.activeTexture.set(o.TEXTURE0);const d=new a.Texture(r,{width:h[0],height:h[1],data:null},o.RGBA);d.bind(o.LINEAR,o.CLAMP_TO_EDGE);const f=r.createFramebuffer(h[0],h[1],!1);return f.colorAttachment.set(d.texture),f.depthAttachment=new Q(r,f.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,h[0],h[1]),this._stencilRef=0,f.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):f.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&!r.extTextureFilterAnisotropicForceOff&&o.texParameterf(o.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:f,tex:d,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const r in this._style._sourceCaches)if(this._style._sourceCaches[r].hasTransition())return!0;return this._style.order.some(r=>{const o=this._style._layers[r],h=o.isHidden(this.painter.transform.zoom);return o.type==="custom"?!h&&o.shouldRedrape():!h&&o.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(const h of this._style._getSources())if(h instanceof ke){r=!0;break}if(!r)return;const o={};for(let h=0;h<this._style.order.length;++h){const d=this._style._layers[this._style.order[h]],f=this._style._getLayerSourceCache(d);if(f&&!o[f.id]&&!d.isHidden(this.painter.transform.zoom)&&d.type==="line"&&d.widthExpression()instanceof a.ZoomDependentExpression){o[f.id]=!0;for(const g of this.proxyCoords){const y=this.proxyToSource[g.key][f.id];
vendor: 4,353 bytes, line 1290
1290if(y)for(const v of y)this._clearRenderCacheForTile(f.id,v)}}}}_clearRasterLayersFromRenderCache(){let r=!1;for(const h in this._style._sourceCaches)if(this._style._sourceCaches[h]._source instanceof Ie){r=!0;break}if(!r)return;const o={};for(let h=0;h<this._style.order.length;++h){const d=this._style._layers[this._style.order[h]],f=this._style._getLayerSourceCache(d);if(!f||o[f.id]||d.isHidden(this.painter.transform.zoom)||d.type!=="raster")continue;const g=d.paint.get("raster-fade-duration");for(const y of this.proxyCoords){const v=this.proxyToSource[y.key][f.id];if(v)for(const E of v){const T=ja(f.getTile(E),f.findLoadedParent(E,0),f,this.painter.transform,g);(T.opacity!==1||T.mix!==0)&&this._clearRenderCacheForTile(f.id,E)}}}}_setupDrapedRenderBatches(){const r=this._style.order,o=r.length;if(o===0)return;const h=[];let d,f=0,g=this._style._layers[r[f]];for(;!this._style.isLayerDraped(g)&&g.isHidden(this.painter.transform.zoom)&&++f<o;)g=this._style._layers[r[f]];for(;f<o;++f){const y=this._style._layers[r[f]];y.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(y)?d===void 0&&(d=f):d!==void 0&&(h.push({start:d,end:f-1}),d=void 0))}d!==void 0&&h.push({start:d,end:f-1}),this._drapedRenderBatches=h}_setupRenderCache(r){const o=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,o.renderCache.length>o.renderCachePool.length){const g=Object.values(o.proxyCachedFBO);o.proxyCachedFBO={};for(let y=0;y<g.length;++y){const v=Object.values(g[y]);o.renderCachePool.push(...v)}}return}this._clearRasterLayersFromRenderCache();const h=this.proxyCoords,d=this._tilesDirty;for(let g=h.length-1;g>=0;g--){const y=h[g];if(o.getTileByID(y.key),o.proxyCachedFBO[y.key]!==void 0){const v=r[y.key],E=this.proxyToSource[y.key];let T=0;for(const A in E){const k=E[A],R=v[A];if(!R||R.length!==k.length||k.some((O,B)=>O!==R[B]||d[A]&&d[A].hasOwnProperty(O.key))){T=-1;break}++T}for(const A in o.proxyCachedFBO[y.key])o.renderCache[o.proxyCachedFBO[y.key][A]].dirty=T<0||T!==Object.values(v).length}}const f=[...this._drapedRenderBatches];f.sort((g,y)=>y.end-y.start-(g.end-g.start));for(const g of f)for(const y of h){if(o.proxyCachedFBO[y.key])continue;let v=o.renderCachePool.pop();v===void 0&&o.renderCache.length<50&&(v=o.renderCache.length,o.renderCache.push(this._createFBO())),v!==void 0&&(o.proxyCachedFBO[y.key]={},o.proxyCachedFBO[y.key][g.start]=v,o.renderCache[v].dirty=!0)}this._tilesDirty={}}_setupStencil(r,o,h,d){if(!d||!this._sourceTilesOverlap[d.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const f=this.painter.context,g=f.gl;if(o.length<=1)return void(this._overlapStencilType=!1);let y;if(h.isTileClipped())y=o.length,this._overlapStencilMode.test={func:g.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(o[0].overscaledZ>o[o.length-1].overscaledZ))return void(this._overlapStencilType=!1);y=1,this._overlapStencilMode.test={func:g.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+y>255&&(f.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=y,this._overlapStencilMode.ref=this._stencilRef,h.isTileClipped()&&this._renderTileClippingMasks(o,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(r){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[r.key]),this._overlapStencilMode):a.StencilMode.disabled}_renderTileClippingMasks(r,o){const h=this.painter,d=this.painter.context,f=d.gl;h._tileClippingMaskIDs={},d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=h.useProgram("clippingMask");for(const y of r){const v=h._tileClippingMaskIDs[y.key]=--o;g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},v,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,Uo(y.projMatrix),"$clipping",h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}pointCoordinate(r){const o=this.painter.transform;if(r.x<0||r.x>o.width||r.y<0||r.y>o.height)return null;const h=[r.x,r.y,1,1];a.transformMat4$1(h,h,o.pixelMatrixInverse),a.scale$1(h,h,1/h[3]),h[0]/=o.worldSize,h[1]/=o.worldSize;
vendor: 4,379 bytes, line 1290
1290const d=o._camera.position,f=a.mercatorZfromAltitude(1,o.center.lat),g=[d[0],d[1],d[2]/f,0],y=a.subtract([],h.slice(0,3),g);a.normalize(y,y);const v=this.raycast(g,y,this._exaggeration);return v!==null&&v?(a.scaleAndAdd(g,g,y,v),g[3]=g[2],g[2]*=f,g):null}drawDepth(){const r=this.painter,o=r.context,h=this.proxySourceCache,d=Math.ceil(r.width),f=Math.ceil(r.height);if(!this._depthFBO||this._depthFBO.width===d&&this._depthFBO.height===f||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const g=o.gl,y=o.createFramebuffer(d,f,!0);o.activeTexture.set(g.TEXTURE0);const v=new a.Texture(o,{width:d,height:f,data:null},g.RGBA);v.bind(g.NEAREST,g.CLAMP_TO_EDGE),y.colorAttachment.set(v.texture);const E=o.createRenderbuffer(o.gl.DEPTH_COMPONENT16,d,f);y.depthAttachment.set(E),this._depthFBO=y,this._depthTexture=v}o.bindFramebuffer.set(this._depthFBO.framebuffer),o.viewport.set([0,0,d,f]),function(g,y,v,E){if(g.transform.projection.name==="globe")return;const T=g.context,A=T.gl;T.clear({depth:1});const k=g.useProgram("terrainDepth"),R=new a.DepthMode(A.LESS,a.DepthMode.ReadWrite,g.depthRangeFor3D);for(const O of E){const B=v.getTile(O),F=Kn(O.projMatrix,0);y.setupElevationDraw(B,k),k.draw(T,A.TRIANGLES,R,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.backCCW,F,"terrain_depth",y.gridBuffer,y.gridIndexBuffer,y.gridNoSkirtSegments)}}(r,this,h,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,o,h){if(r.getSource()instanceof rt)return this._setupProxiedCoordsForImageSource(r,o,h);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};const d=this.proxiedCoords[r.id]=[],f=this.proxyCoords;for(let y=0;y<f.length;y++){const v=f[y],E=this._findTileCoveringTileID(v,r);if(E){const T=this._createProxiedId(v,E,h[v.key]&&h[v.key][r.id]);d.push(T),this.proxyToSource[v.key][r.id]=[T]}}let g=!1;for(let y=0;y<o.length;y++){const v=r.getTile(o[y]);if(!v||!v.hasData())continue;const E=this._findTileCoveringTileID(v.tileID,this.proxySourceCache);if(E&&E.tileID.canonical.z!==v.tileID.canonical.z){const T=this.proxyToSource[E.tileID.key][r.id],A=this._createProxiedId(E.tileID,v,h[E.tileID.key]&&h[E.tileID.key][r.id]);T?T.splice(T.length-1,0,A):this.proxyToSource[E.tileID.key][r.id]=[A],d.push(A),g=!0}}this._sourceTilesOverlap[r.id]=g}_setupProxiedCoordsForImageSource(r,o,h){if(!r.getSource().loaded())return;const d=this.proxiedCoords[r.id]=[],f=this.proxyCoords,g=r.getSource(),y=new a.Point(g.tileID.x,g.tileID.y)._div(1<<g.tileID.z),v=g.coordinates.map(a.MercatorCoordinate.fromLngLat).reduce((T,A)=>(T.min.x=Math.min(T.min.x,A.x-y.x),T.min.y=Math.min(T.min.y,A.y-y.y),T.max.x=Math.max(T.max.x,A.x-y.x),T.max.y=Math.max(T.max.y,A.y-y.y),T),{min:new a.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new a.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),E=(T,A)=>{const k=T.wrap+T.canonical.x/(1<<T.canonical.z),R=T.canonical.y/(1<<T.canonical.z),O=a.EXTENT/(1<<T.canonical.z),B=A.wrap+A.canonical.x/(1<<A.canonical.z),F=A.canonical.y/(1<<A.canonical.z);return k+O<B+v.min.x||k>B+v.max.x||R+O<F+v.min.y||R>F+v.max.y};for(let T=0;T<f.length;T++){const A=f[T];for(let k=0;k<o.length;k++){const R=r.getTile(o[k]);if(!R||!R.hasData()||E(A,R.tileID))continue;const O=this._createProxiedId(A,R,h[A.key]&&h[A.key][r.id]),B=this.proxyToSource[A.key][r.id];B?B.push(O):this.proxyToSource[A.key][r.id]=[O],d.push(O)}}}_createProxiedId(r,o,h){let d=this.orthoMatrix;if(h){const f=h.find(g=>g.key===o.tileID.key);if(f)return f}if(o.tileID.key!==r.key){const f=r.canonical.z-o.tileID.canonical.z;let g,y,v;d=a.create();const E=o.tileID.wrap-r.wrap<<r.overscaledZ;f>0?(g=a.EXTENT>>f,y=g*((o.tileID.canonical.x<<f)-r.canonical.x+E),v=g*((o.tileID.canonical.y<<f)-r.canonical.y)):(g=a.EXTENT<<-f,y=a.EXTENT*(o.tileID.canonical.x-(r.canonical.x+E<<-f)),v=a.EXTENT*(o.tileID.canonical.y-(r.canonical.y<<-f))),a.ortho(d,0,g,0,g,0,1),a.translate(d,d,[y,v,0])}return new Ps(o.tileID,r.key,d)}_findTileCoveringTileID(r,o){let h=o.getTile(r);if(h&&h.hasData())return h;const d=this._findCoveringTileCache[o.id],f=d[r.key];if(h=f?o.getTileByID(f):null,h&&h.hasData()||f===null)return h;let g=h?h.tileID:r,y=g.overscaledZ;const v=o.getSource().minzoom,E=[];if(!f){const A=o.getSource().maxzoom;if(r.canonical.z>=A){const k=r.canonical.z-A;o.getSource().reparseOverscaled?(y=Math.max(r.canonical.z+2,o.transform.tileZoom),g=new a.Over
1290scaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k)):k!==0&&(y=A,g=new a.OverscaledTileID(y,r.wrap,A,r.canonical.x>>k,r.canonical.y>>k))}g.key!==r.key&&(E.push(g.key),h=o.getTile(g))}const T=A=>{E.forEach(k=>{d[k]=A}),E.length=0};for(y-=1;y>=v&&(!h||!h.hasData());y--){h&&T(h.tileID.key);const A=g.calculateScaledKey(y);if(h=o.getTileByID(A),h&&h.hasData())break;const k=d[A];if(k===null)break;k===void 0?E.push(A):h=o.getTileByID(k)}return T(h?h.tileID.key:null),h&&h.hasData()?h:null}findDEMTileFor(r){return this.enabled?this._findTileCoveringTileID(r,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(r,o){let h=this._tilesDirty[r];h||(h=this._tilesDirty[r]={}),h[o.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const r=function(o){let h=0;const d=new a.StructArrayLayout2ui4,f=131;for(let g=1;g<129;g++){for(let y=1;y<129;y++)h=g*f+y,d.emplaceBack(h,h+1),d.emplaceBack(h,h+f),d.emplaceBack(h+1,h+f),g===128&&d.emplaceBack(h+f,h+f+1);d.emplaceBack(h+1,h+1+f)}return d}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(r),this.wireframeSegments=a.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,r.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class mt{static cacheKey(r,o,h,d){let f=`${o}${d?d.cacheKey:""}`;for(const g of h)r.usedDefines.includes(g)&&(f+=`/${g}`);return f}constructor(r,o,h,d,f,g){const y=r.gl;this.program=y.createProgram();const v=function(I){const L=[];for(let N=0;N<I.length;N++){if(I[N]===null)continue;const j=I[N].split(" ");L.push(j.pop())}return L}(h.staticAttributes),E=d?d.getBinderAttributes():[],T=v.concat(E);let A=d?d.defines():[];A=A.concat(g.map(I=>`#define ${I}`));const k=r.isWebGL2?`#version 300 es
1291`:"",R=k+A.concat(r.extStandardDerivatives&&k.length===0?`#extension GL_OES_standard_derivatives : enable
1292`.concat(Oa):Oa,Oa,As,ac.fragmentSource,Xn.fragmentSource,h.fragmentSource).join(`
1293`),O=k+A.concat(`
1294#ifdef GL_ES
1295precision highp float;
1296#else
1297
1298#if !defined(lowp)
1299#define lowp
1300#endif
1301
1302#if !defined(mediump)
1303#define mediump
1304#endif
1305
1306#if !defined(highp)
1307#define highp
1308#endif
1309
1310#endif`,As,ac.vertexSource,Xn.vertexSource,Ms.vertexSource,h.vertexSource).join(`
1311`),B=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())return void(this.failedToCreate=!0);y.shaderSource(B,R),y.compileShader(B),y.attachShader(this.program,B);const F=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(F,O),y.compileShader(F),y.attachShader(this.program,F),this.attributes={},this.numAttributes=T.length;for(let I=0;I<this.numAttributes;I++)T[I]&&(y.bindAttribLocation(this.program,I,T[I]),this.attributes[T[I]]=I);y.linkProgram(this.program),y.deleteShader(F),y.deleteShader(B),this.fixedUniforms=f(r),this.binderUniforms=d?d.getUniforms(r):[],g.includes("TERRAIN")&&(this.terrainUniforms=(I=>({u_dem:new a.Uniform1i(I),u_dem_prev:new a.Uniform1i(I),u_dem_unpack:new a.Uniform4f(I),u_dem_tl:new a.Uniform2f(I),u_dem_scale:new a.Uniform1f(I),u_dem_tl_prev:new a.Uniform2f(I),u_dem_scale_prev:new a.Uniform1f(I),u_dem_size:new a.Uniform1f(I),u_dem_lerp:new a.Uniform1f(I),u_exaggeration:new a.Uniform1f(I),u_depth:new a.Uniform1i(I),u_depth_size_inv:new a.Uniform2f(I),u_meter_to_dem:new a.Uniform1f(I),u_label_plane_matrix_inv:new a.UniformMatrix4f(I)}))(r)),g.includes("GLOBE")&&(this.globeUniforms=(I=>({u_tile_tl_up:new a.Uniform3f(I),u_tile_tr_up:new a.Uniform3f(I),u_tile_br_up:new a.Uniform3f(I),u_tile_bl_up:new a.Uniform3f(I),u_tile_up_scale:new a.Uniform1f(I)}))(r)),g.includes("FOG")&&(this.fogUniforms=(I=>({u_fog_matrix:new a.UniformMatrix4f(I),u_fog_range:new a.Uniform2f(I),u_fog_color:new a.Uniform4f(I),u_fog_horizon_blend:new a.Uniform1f(I),u_fog_temporal_offset:new a.Uniform1f(I),u_frustum_tl:new a.Uniform3f(I),u_frustum_tr:new a.Uniform3f(I),u_frustum_br:new a.Uniform3f(I),u_frustum_bl:new a.Uniform3f(I),u_globe_pos:new a.Uniform3f(I),u_globe_radius:new a.Uniform1f(I),u_globe_transition:new a.Uniform1f(I),u_is_globe:new a.Uniform1i(I),u_viewport:new a.Uniform2f(I)}))(r))}}
1311setTerrainUniformValues(r,o){if(!this.terrainUniforms)return;const h=this.terrainUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setGlobeUniformValues(r,o){if(!this.globeUniforms)return;const h=this.globeUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d]&&h[d].set(this.program,d,o[d])}}setFogUniformValues(r,o){if(!this.fogUniforms)return;const h=this.fogUniforms;if(!this.failedToCreate){r.program.set(this.program);for(const d in o)h[d].set(this.program,d,o[d])}}draw(r,o,h,d,f,g,y,v,E,T,A,k,R,O,B){const F=r.gl;if(this.failedToCreate)return;r.program.set(this.program),r.setDepthMode(h),r.setStencilMode(d),r.setColorMode(f),r.setCullFace(g);for(const L of Object.keys(this.fixedUniforms))this.fixedUniforms[L].set(this.program,L,y[L]);O&&O.setUniforms(this.program,r,this.binderUniforms,k,{zoom:R});const I={[F.LINES]:2,[F.TRIANGLES]:3,[F.LINE_STRIP]:1}[o];for(const L of A.get()){const N=L.vaos||(L.vaos={});(N[v]||(N[v]=new Ch)).bind(r,this,E,O?O.getPaintVertexBuffers():[],T,L.vertexOffset,B||[]),F.drawElements(o,L.primitiveLength*I,F.UNSIGNED_SHORT,L.primitiveOffset*I*2)}}}function Vo(l,r){const o=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,l.transform.tileZoom)/o,d=h*(r.tileID.canonical.x+r.tileID.wrap*o),f=h*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_tile_units_to_pixels:1/ai(r,1,l.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}const uc=a.create(),Za=(l,r,o,h,d,f,g,y,v,E,T)=>{const A=r.style.light,k=A.properties.get("position"),R=[k.x,k.y,k.z],O=a.create$1();A.properties.get("anchor")==="viewport"&&(a.fromRotation(O,-r.transform.angle),a.transformMat3(R,R,O));const B=A.properties.get("color"),F=r.transform,I={u_matrix:l,u_lightpos:R,u_lightintensity:A.properties.get("intensity"),u_lightcolor:[B.r,B.g,B.b],u_vertical_gradient:+o,u_opacity:h,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:uc,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:d,u_edge_radius:f};return F.projection.name==="globe"&&(I.u_tile_id=[g.canonical.x,g.canonical.y,1<<g.canonical.z],I.u_zoom_transition=v,I.u_inv_rot_matrix=T,I.u_merc_center=E,I.u_up_dir=F.projection.upVector(new a.CanonicalTileID(0,0,0),E[0]*a.EXTENT,E[1]*a.EXTENT),I.u_height_lift=y),I},dc=(l,r,o,h,d,f,g,y,v,E,T,A)=>{const k=Za(l,r,o,h,d,f,g,v,E,T,A),R={u_height_factor:-Math.pow(2,g.overscaledZ)/y.tileSize/8};return a.extend(k,Vo(r,y),R)},bn=l=>({u_matrix:l}),qa=(l,r,o)=>a.extend(bn(l),Vo(r,o)),zh=(l,r)=>({u_matrix:l,u_world:r}),Ph=(l,r,o,h)=>a.extend(qa(l,r,o),{u_world:h}),kh=a.create(),Wa=(l,r,o,h,d,f)=>{const g=l.transform,y=g.projection.name==="globe";let v;if(f.paint.get("circle-pitch-alignment")==="map")if(y){const T=a.globePixelsToTileUnits(g.zoom,r.canonical)*g._pixelsPerMercatorPixel;v=Float32Array.from([T,0,0,T])}else v=g.calculatePixelsToTileUnitsMatrix(o);else v=new Float32Array([g.pixelsToGLUnits[0],0,0,g.pixelsToGLUnits[1]]);const E={u_camera_to_center_distance:g.cameraToCenterDistance,u_matrix:l.translatePosMatrix(r.projMatrix,o,f.paint.get("circle-translate"),f.paint.get("circle-translate-anchor")),u_device_pixel_ratio:a.exported.devicePixelRatio,u_extrude_scale:v,u_inv_rot_matrix:kh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(y){E.u_inv_rot_matrix=h,E.u_merc_center=d,E.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],E.u_zoom_transition=a.globeToMercatorTransition(g.zoom);const T=d[0]*a.EXTENT,A=d[1]*a.EXTENT;E.u_up_dir=g.projection.upVector(new a.CanonicalTileID(0,0,0),T,A)}return E},Xa=l=>{const r=[];return l.paint.get("circle-pitch-alignment")==="map"&&r.push("PITCH_WITH_MAP"),l.paint.get("circle-pitch-scale")==="map"&&r.push("SCALE_WITH_MAP"),r},Ha=(l,r,o,h)=>{const d=a.EXTENT/o.tileSize;return{u_matrix:l,u_camera_to_center_distance:r.getCameraToCenterDistance(h),u_extrude_scale:[r.pixelsToGLUnits[0]/d,r.pixelsToGLUnits[1]/d]}},ks=(l,r,o=1)=>({u_matrix:l,u_color:r,u_overlay:0,u_overlay_scale:o}),pc=a.create(),fc=(l,r,o,h,d,f,g)=>{const y=l.transform,v=y.projection.name==="globe",E=v?a.globePixelsToTileUnits(y.zoom,r.canonical)*y._pixelsPerMercatorPixel:ai(o,1,f),T={u_matrix:r.projMatrix,u_extrude_scale:E,u_intensity:g,u_inv_rot_matrix:pc,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(v){T.u_inv_rot_matrix=h,T.u_merc_center=d,T.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],T.u_zoom_transition=a.globeToMercatorTransition(y.zoom);
vendor: 13,486 bytes, line 1311
1311const A=d[0]*a.EXTENT,k=d[1]*a.EXTENT;T.u_up_dir=y.projection.upVector(new a.CanonicalTileID(0,0,0),A,k)}return T},Dh=(l,r,o,h,d,f,g)=>{const y=l.transform,v=y.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:Ka(l,r,o,h),u_pixels_to_tile_units:v,u_device_pixel_ratio:f,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:d,u_texsize:jo(o)?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Jn(r,l.transform),u_alpha_discard_threshold:0,u_trim_offset:g}},No=(l,r,o,h,d)=>{const f=l.transform;return{u_matrix:Ka(l,r,o,h),u_texsize:r.imageAtlasTexture.size,u_pixels_to_tile_units:f.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:d,u_image:0,u_tile_units_to_pixels:Jn(r,f),u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Jn(l,r){return 1/ai(l,1,r.tileZoom)}function Ka(l,r,o,h){return l.translatePosMatrix(h||r.tileID.projMatrix,r,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}function jo(l){const r=l.paint.get("line-dasharray").value;return r.value||r.kind!=="constant"}const Ya=(l,r,o,h,d,f)=>{return{u_matrix:l,u_tl_parent:r,u_scale_parent:o,u_fade_t:h.mix,u_opacity:h.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(y=d.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:ur(d.paint.get("raster-hue-rotate")),u_perspective_transform:f};var g,y};function ur(l){l*=Math.PI/180;const r=Math.sin(l),o=Math.cos(l);return[(2*o+1)/3,(-Math.sqrt(3)*r-o+1)/3,(Math.sqrt(3)*r-o+1)/3]}const Ds=a.create(),Ja=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>{const F=d.transform,I={u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:F.cameraToCenterDistance,u_rotate_symbol:+o,u_aspect_ratio:F.width/F.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:g,u_coord_matrix:y,u_is_text:+v,u_pitch_with_map:+h,u_texsize:E,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ds,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Ds,u_up_vector:[0,-1,0]};return B.name==="globe"&&(I.u_tile_id=[T.canonical.x,T.canonical.y,1<<T.canonical.z],I.u_zoom_transition=A,I.u_inv_rot_matrix=R,I.u_merc_center=k,I.u_camera_forward=F._camera.forward(),I.u_ecef_origin=a.globeECEFOrigin(F.globeMatrix,T.toUnwrapped()),I.u_tile_matrix=Float32Array.from(F.globeMatrix),I.u_up_vector=O),I},Ls=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B,F)=>a.extend(Ja(l,r,o,h,d,f,g,y,v,E,A,k,R,O,B,F),{u_gamma_scale:h?d.transform.cameraToCenterDistance*Math.cos(d.terrain?0:d.transform._pitch):1,u_device_pixel_ratio:a.exported.devicePixelRatio,u_is_halo:+T}),mc=(l,r,o,h,d,f,g,y,v,E,T,A,k,R,O,B)=>a.extend(Ls(l,r,o,h,d,f,g,y,!0,v,!0,T,A,k,R,O,B),{u_texsize_icon:E,u_texture_icon:1}),Qa=(l,r,o)=>({u_matrix:l,u_opacity:r,u_color:o}),Lh=(l,r,o,h,d)=>a.extend(function(f,g,y){const v=g.imageManager.getPattern(f.toString()),{width:E,height:T}=g.imageManager.getPixelSize(),A=Math.pow(2,y.tileID.overscaledZ),k=y.tileSize*Math.pow(2,g.transform.tileZoom)/A,R=k*(y.tileID.canonical.x+y.tileID.wrap*A),O=k*y.tileID.canonical.y;return{u_image:0,u_pattern_tl:v.tl,u_pattern_br:v.br,u_texsize:[E,T],u_pattern_size:v.displaySize,u_tile_units_to_pixels:1/ai(y,1,g.transform.tileZoom),u_pixel_coord_upper:[R>>16,O>>16],u_pixel_coord_lower:[65535&R,65535&O]}}(h,o,d),{u_matrix:l,u_opacity:r}),el={fillExtrusion:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l)}),fillExtrusionPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_lightpos:new a.Uniform3f(l),u_lightintensity:new a.Uniform1f(l),u_lightcolor:new a.Uniform3f(l),u_vertical_gradient:new a.Uniform1f(l),u_height_factor:new a.Uniform1f(l),u_edge_radius:new a.Uniform1f(l),u_ao:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_up_dir:new a.Uniform3f(l),u_height_lift:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l)}),fill:l=>({u_matrix:new a.UniformMatrix4f(l)}),fillPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),fillOutline:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l)}),fillOutlinePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_world:new a.Uniform2f(l),u_image:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),circle:l=>({u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),collisionBox:l=>({u_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_extrude_scale:new a.Uniform2f(l)}),collisionCircle:l=>({u_matrix:new a.UniformMatrix4f(l),u_inv_matrix:new a.UniformMatrix4f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_viewport_size:new a.Uniform2f(l)}),debug:l=>({u_color:new a.UniformColor(l),u_matrix:new a.UniformMatrix4f(l),u_overlay:new a.Uniform1i(l),u_overlay_scale:new a.Uniform1f(l)}),clippingMask:l=>({u_matrix:new a.UniformMatrix4f(l)}),heatmap:l=>({u_extrude_scale:new a.Uniform1f(l),u_intensity:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_up_dir:new a.Uniform3f(l)}),heatmapTexture:l=>({u_image:new a.Uniform1i(l),u_color_ramp:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l)}),hillshade:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_latrange:new a.Uniform2f(l),u_light:new a.Uniform2f(l),u_shadow:new a.UniformColor(l),u_highlight:new a.UniformColor(l),u_accent:new a.UniformColor(l)}),hillshadePrepare:l=>({u_matrix:new a.UniformMatrix4f(l),u_image:new a.Uniform1i(l),u_dimension:new a.Uniform2f(l),u_zoom:new a.Uniform1f(l),u_unpack:new a.Uniform4f(l)}),line:l=>({u_matrix:new a.UniformMatrix4f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_units_to_pixels:new a.Uniform2f(l),u_dash_image:new a.Uniform1i(l),u_gradient_image:new a.Uniform1i(l),u_image_height:new a.Uniform1f(l),u_texsize:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l),u_trim_offset:new a.Uniform2f(l)}),linePattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_texsize:new a.Uniform2f(l),u_pixels_to_tile_units:new a.UniformMatrix2f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_units_to_pixels:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l),u_alpha_discard_threshold:new a.Uniform1f(l)}),raster:l=>({u_matrix:new a.UniformMatrix4f(l),u_tl_parent:new a.Uniform2f(l),u_scale_parent:new a.Uniform1f(l),u_fade_t:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_image0:new a.Uniform1i(l),u_image1:new a.Uniform1i(l),u_brightness_low:new a.Uniform1f(l),u_brightness_high:new a.Uniform1f(l),u_saturation_factor:new a.Uniform1f(l),u_contrast_factor:new a.Uniform1f(l),u_spin_weights:new a.Uniform3f(l),u_perspective_transform:new a.Uniform2f(l)}),symbolIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_texture:new a.Uniform1i(l)}),symbolSDF:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_tile_id:new a.Uniform3f(l),u_zoom_transition:new a.Uniform1f(l),u_inv_rot_matrix:new a.UniformMatrix4f(l),u_merc_center:new a.Uniform2f(l),u_camera_forward:new a.Uniform3f(l),u_tile_matrix:new a.UniformMatrix4f(l),u_up_vector:new a.Uniform3f(l),u_ecef_origin:new a.Uniform3f(l),u_is_halo:new a.Uniform1i(l)}),symbolTextAndIcon:l=>({u_is_size_zoom_constant:new a.Uniform1i(l),u_is_size_feature_constant:new a.Uniform1i(l),u_size_t:new a.Uniform1f(l),u_size:new a.Uniform1f(l),u_camera_to_center_distance:new a.Uniform1f(l),u_rotate_symbol:new a.Uniform1i(l),u_aspect_ratio:new a.Uniform1f(l),u_fade_change:new a.Uniform1f(l),u_matrix:new a.UniformMatrix4f(l),u_label_plane_matrix:new a.UniformMatrix4f(l),u_coord_matrix:new a.UniformMatrix4f(l),u_is_text:new a.Uniform1i(l),u_pitch_with_map:new a.Uniform1i(l),u_texsize:new a.Uniform2f(l),u_texsize_icon:new a.Uniform2f(l),u_texture:new a.Uniform1i(l),u_texture_icon:new a.Uniform1i(l),u_gamma_scale:new a.Uniform1f(l),u_device_pixel_ratio:new a.Uniform1f(l),u_is_halo:new a.Uniform1i(l)}),background:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_color:new a.UniformColor(l)}),backgroundPattern:l=>({u_matrix:new a.UniformMatrix4f(l),u_opacity:new a.Uniform1f(l),u_image:new a.Uniform1i(l),u_pattern_tl:new a.Uniform2f(l),u_pattern_br:new a.Uniform2f(l),u_texsize:new a.Uniform2f(l),u_pattern_size:new a.Uniform2f(l),u_pixel_coord_upper:new a.Uniform2f(l),u_pixel_coord_lower:new a.Uniform2f(l),u_tile_units_to_pixels:new a.Uniform1f(l)}),terrainRaster:Na,terrainDepth:Na,skybox:l=>({u_matrix:new a.UniformMatrix4f(l),u_sun_direction:new a.Uniform3f(l),u_cubemap:new a.Uniform1i(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxGradient:l=>({u_matrix:new a.UniformMatrix4f(l),u_color_ramp:new a.Uniform1i(l),u_center_direction:new a.Uniform3f(l),u_radius:new a.Uniform1f(l),u_opacity:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l)}),skyboxCapture:l=>({u_matrix_3f:new a.UniformMatrix3f(l),u_sun_direction:new a.Uniform3f(l),u_sun_intensity:new a.Uniform1f(l),u_color_tint_r:new a.Uniform4f(l),u_color_tint_m:new a.Uniform4f(l),u_luminance:new a.Uniform1f(l)}),globeRaster:l=>({u_proj_matrix:new a.UniformMatrix4f(l),u_globe_matrix:new a.UniformMatrix4f(l),u_normalize_matrix:new a.UniformMatrix4f(l),u_merc_matrix:new a.UniformMatrix4f(l),u_zoom_transition:new a.Uniform1f(l),u_merc_center:new a.Uniform2f(l),u_image0:new a.Uniform1i(l),u_grid_matrix:new a.UniformMatrix3f(l),u_skirt_height:new a.Uniform1f(l),u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_globe_pos:new a.Uniform3f(l),u_globe_radius:new a.Uniform1f(l),u_viewport:new a.Uniform2f(l)}),globeAtmosphere:l=>({u_frustum_tl:new a.Uniform3f(l),u_frustum_tr:new a.Uniform3f(l),u_frustum_br:new a.Uniform3f(l),u_frustum_bl:new a.Uniform3f(l),u_horizon:new a.Uniform1f(l),u_transition:new a.Uniform1f(l),u_fadeout_range:new a.Uniform1f(l),u_color:new a.Uniform4f(l),u_high_color:new a.Uniform4f(l),u_space_color:new a.Uniform4f(l),u_star_intensity:new a.Uniform1f(l),u_star_density:new a.Uniform1f(l),u_star_size:new a.Uniform1f(l),u_temporal_offset:new a.Uniform1f(l),u_horizon_angle:new a.Uniform1f(l),u_rotation_matrix:new a.UniformMatrix4f(l)})};let Rs;function Go(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=l.useProgram("collisionBox"),A=[];let k=0,R=0;for(let j=0;j<h.length;j++){const K=h[j],J=r.getTile(K),Y=J.getBucket(o);if(!Y)continue;const ie=ji(K,Y,E);let te=ie;d[0]===0&&d[1]===0||(te=l.translatePosMatrix(ie,J,d,f));const le=g?Y.textCollisionBox:Y.iconCollisionBox,Te=Y.collisionCircleArray;
1311if(Te.length>0){const oe=a.create(),ge=te;a.mul(oe,Y.placementInvProjMatrix,E.glCoordMatrix),a.mul(oe,oe,Y.placementViewportMatrix),A.push({circleArray:Te,circleOffset:R,transform:ge,invTransform:oe,projection:Y.getProjection()}),k+=Te.length/4,R=k}le&&(l.terrain&&l.terrain.setupElevationDraw(J,T),T.draw(y,v.LINES,a.DepthMode.disabled,a.StencilMode.disabled,l.colorModeForRenderPass(),a.CullFaceMode.disabled,Ha(te,E,J,Y.getProjection()),o.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,null,E.zoom,null,[le.collisionVertexBuffer,le.collisionVertexBufferExt]))}if(!g||!A.length)return;const O=l.useProgram("collisionCircle"),B=new a.StructArrayLayout2f1f2i16;B.resize(4*k),B._trim();let F=0;for(const j of A)for(let K=0;K<j.circleArray.length/4;K++){const J=4*K,Y=j.circleArray[J+0],ie=j.circleArray[J+1],te=j.circleArray[J+2],le=j.circleArray[J+3];B.emplace(F++,Y,ie,te,le,0),B.emplace(F++,Y,ie,te,le,1),B.emplace(F++,Y,ie,te,le,2),B.emplace(F++,Y,ie,te,le,3)}(!Rs||Rs.length<2*k)&&(Rs=function(j){const K=2*j,J=new a.StructArrayLayout3ui6;J.resize(K),J._trim();for(let Y=0;Y<K;Y++){const ie=6*Y;J.uint16[ie+0]=4*Y+0,J.uint16[ie+1]=4*Y+1,J.uint16[ie+2]=4*Y+2,J.uint16[ie+3]=4*Y+2,J.uint16[ie+4]=4*Y+3,J.uint16[ie+5]=4*Y+0}return J}(k));const I=y.createIndexBuffer(Rs,!0),L=y.createVertexBuffer(B,a.collisionCircleLayout.members,!0);for(const j of A){const K={u_matrix:j.transform,u_inv_matrix:j.invTransform,u_camera_to_center_distance:(N=E).getCameraToCenterDistance(j.projection),u_viewport_size:[N.width,N.height]};O.draw(y,v.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,l.colorModeForRenderPass(),a.CullFaceMode.disabled,K,o.id,L,I,a.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,E.zoom)}var N;L.destroy(),I.destroy()}const _c=a.create();function tl({width:l,height:r,anchor:o,textOffset:h,textScale:d},f){const{horizontalAlign:g,verticalAlign:y}=a.getAnchorAlignment(o),v=-(g-.5)*l,E=-(y-.5)*r,T=a.evaluateVariableOffset(o,h);return new a.Point((v/d+T[0])*f,(E/d+T[1])*f)}function Rh(l,r,o,h,d,f,g,y,v,E,T){const A=l.text.placedSymbolArray,k=l.text.dynamicLayoutVertexArray,R=l.icon.dynamicLayoutVertexArray,O={},B=l.getProjection(),F=Ot(y,B,f),I=f.elevation,L=B.upVectorScale(y.canonical,f.center.lat,f.worldSize).metersToTile;k.clear();for(let N=0;N<A.length;N++){const j=A.get(N),{tileAnchorX:K,tileAnchorY:J,numGlyphs:Y}=j,ie=j.hidden||!j.crossTileID||l.allowVerticalPlacement&&!j.placedOrientation?null:h[j.crossTileID];if(ie){let te=0,le=0,Te=0;if(I){const Ae=I?I.getAtTileOffset(y,K,J):0,[Ge,Xe,Ve]=B.upVector(y.canonical,K,J);te=Ae*Ge*L,le=Ae*Xe*L,Te=Ae*Ve*L}let[oe,ge,he,we]=ci(j.projectedAnchorX+te,j.projectedAnchorY+le,j.projectedAnchorZ+Te,o?F:g);const ae=ic(f.getCameraToCenterDistance(B),we);let _e=d.evaluateSizeForFeature(l.textSizeData,E,j)*ae/a.ONE_EM;o&&(_e*=l.tilePixelRatio/v);const Me=tl(ie,_e);o?({x:oe,y:ge,z:he}=B.projectTilePoint(K+Me.x,J+Me.y,y.canonical),[oe,ge,he]=ci(oe+te,ge+le,he+Te,g)):(r&&Me._rotate(-f.angle),oe+=Me.x,ge+=Me.y,he=0);const ve=l.allowVerticalPlacement&&j.placedOrientation===a.WritingMode.vertical?Math.PI/2:0;for(let Ae=0;Ae<Y;Ae++)a.addDynamicAttributes(k,oe,ge,he,ve);T&&j.associatedIconIndex>=0&&(O[j.associatedIconIndex]={x:oe,y:ge,z:he,angle:ve})}else tr(Y,k)}if(T){R.clear();const N=l.icon.placedSymbolArray;for(let j=0;j<N.length;j++){const K=N.get(j),{numGlyphs:J}=K,Y=O[j];if(K.hidden||!Y)tr(J,R);else{const{x:ie,y:te,z:le,angle:Te}=Y;for(let oe=0;oe<J;oe++)a.addDynamicAttributes(R,ie,te,le,Te)}}l.icon.dynamicLayoutVertexBuffer.updateData(R)}l.text.dynamicLayoutVertexBuffer.updateData(k)}function il(l,r,o){return o.iconsInText&&r?"symbolTextAndIcon":l?"symbolSDF":"symbolIcon"}function gc(l,r,o,h,d,f,g,y,v,E,T,A){const k=l.context,R=k.gl,O=l.transform,B=y==="map",F=v==="map",I=B&&o.layout.get("symbol-placement")!=="point",L=B&&!F&&!I,N=o.layout.get("symbol-sort-key").constantOr(1)!==void 0;let j=!1;const K=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),J=[a.mercatorXfromLng(O.center.lng),a.mercatorYfromLat(O.center.lat)],Y=o.layout.get("text-variable-anchor"),ie=O.projection.name==="globe",te=[],le=[0,-1,0];let Te=le;!ie&&!O.mercatorFromTransition||B||(Te=function(oe){const ge=oe._camera.getWorldToCamera(oe.w
1311orldSize,1),he=a.multiply([],ge,oe.globeMatrix);a.invert(he,he);const we=[0,0,0],ae=[0,1,0,0];return a.transformMat4$1(ae,ae,he),we[0]=ae[0],we[1]=ae[1],we[2]=ae[2],a.normalize(we,we),we}(O));for(const oe of h){const ge=r.getTile(oe),he=ge.getBucket(o);if(!he||he.projection.name==="mercator"&&ie)continue;const we=d?he.text:he.icon;if(!we||he.fullyClipped||!we.segments.get().length)continue;const ae=we.programConfigurations.get(o.id),_e=d||he.sdfIcons,Me=d?he.textSizeData:he.iconSizeData,ve=F||O.pitch!==0,Ae=a.evaluateSizeForZoom(Me,O.zoom);let Ge,Xe,Ve,qe,lt=[0,0],ot=null;if(d)Xe=ge.glyphAtlasTexture,Ve=R.LINEAR,Ge=ge.glyphAtlasTexture.size,he.iconsInText&&(lt=ge.imageAtlasTexture.size,ot=ge.imageAtlasTexture,qe=ve||l.options.rotating||l.options.zooming||Me.kind==="composite"||Me.kind==="camera"?R.LINEAR:R.NEAREST);else{const Rr=o.layout.get("icon-size").constantOr(0)!==1||he.iconsNeedLinear;Xe=ge.imageAtlasTexture,Ve=_e||l.options.rotating||l.options.zooming||Rr||ve?R.LINEAR:R.NEAREST,Ge=ge.imageAtlasTexture.size}const je=he.projection.name==="globe",wt=je?Te:le,Tt=je?a.globeToMercatorTransition(O.zoom):0,Et=Ot(oe,he.getProjection(),O),St=O.calculatePixelsToTileUnitsMatrix(ge),vi=fe(Et,ge.tileID.canonical,F,B,O,he.getProjection(),St),ui=l.terrain&&F&&I?a.invert(a.create(),vi):_c,qi=Ht(Et,ge.tileID.canonical,F,B,O,he.getProjection(),St),pr=Y&&he.hasTextData(),Ft=o.layout.get("icon-text-fit")!=="none"&&pr&&he.hasIconData();if(I){const Rr=O.elevation,Qr=Rr?Rr.getAtTileOffsetFunc(oe,O.center.lat,O.worldSize,he.getProjection()):null,Mn=Ar(Et,ge.tileID.canonical,F,B,O,he.getProjection(),St);Ia(he,Et,l,d,Mn,qi,F,E,Qr,oe)}const Mt=I||d&&Y||Ft,yt=l.translatePosMatrix(Et,ge,f,g),Kt=Mt?_c:vi,Ei=l.translatePosMatrix(qi,ge,f,g,!0),Bt=he.getProjection().createInversionMatrix(O,oe.canonical),Ii=[];l.terrainRenderModeElevated()&&F&&Ii.push("PITCH_WITH_MAP_TERRAIN"),je&&Ii.push("PROJECTION_GLOBE_VIEW"),Mt&&Ii.push("PROJECTED_POS_ON_VIEWPORT");const Ys=_e&&o.paint.get(d?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Sn;Sn=_e?he.iconsInText?mc(Me.kind,Ae,L,F,l,yt,Kt,Ei,Ge,lt,oe,Tt,J,Bt,wt,he.getProjection()):Ls(Me.kind,Ae,L,F,l,yt,Kt,Ei,d,Ge,!0,oe,Tt,J,Bt,wt,he.getProjection()):Ja(Me.kind,Ae,L,F,l,yt,Kt,Ei,d,Ge,oe,Tt,J,Bt,wt,he.getProjection());const es={program:l.useProgram(il(_e,d,he),ae,Ii),buffers:we,uniformValues:Sn,atlasTexture:Xe,atlasTextureIcon:ot,atlasInterpolation:Ve,atlasInterpolationIcon:qe,isSDF:_e,hasHalo:Ys,tile:ge,labelPlaneMatrixInv:ui};if(N&&he.canOverlap){j=!0;const Rr=we.segments.get();for(const Qr of Rr)te.push({segments:new a.SegmentVector([Qr]),sortKey:Qr.sortKey,state:es})}else te.push({segments:we.segments,sortKey:0,state:es})}j&&te.sort((oe,ge)=>oe.sortKey-ge.sortKey);for(const oe of te){const ge=oe.state;if(l.terrain&&l.terrain.setupElevationDraw(ge.tile,ge.program,{useDepthForOcclusion:!ie,labelPlaneMatrixInv:ge.labelPlaneMatrixInv}),k.activeTexture.set(R.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,R.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(k.activeTexture.set(R.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),ge.isSDF){const he=ge.uniformValues;ge.hasHalo&&(he.u_is_halo=1,$o(ge.buffers,oe.segments,o,l,ge.program,K,T,A,he)),he.u_is_halo=0}$o(ge.buffers,oe.segments,o,l,ge.program,K,T,A,ge.uniformValues)}}function $o(l,r,o,h,d,f,g,y,v){const E=h.context,T=[l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer,l.globeExtVertexBuffer];d.draw(E,E.gl.TRIANGLES,f,g,y,a.CullFaceMode.disabled,v,o.id,l.layoutVertexBuffer,l.indexBuffer,r,o.paint,h.transform.zoom,l.programConfigurations.get(o.id),T)}function yc(l,r,o,h,d,f,g){const y=l.context.gl,v=o.paint.get("fill-pattern"),E=v&&v.constantOr(1);let T,A,k,R,O;g?(A=E&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=y.LINES):(A=E?"fillPattern":"fill",T=y.TRIANGLES);for(const B of h){const F=r.getTile(B);if(E&&!F.patternsLoaded())continue;const I=F.getBucket(o);if(!I)continue;l.prepareDrawTile();const L=I.programConfigurations.get(o.id),N=l.useProgram(A,L);E&&(l.context.activeTexture.set(y.TEXTURE0),F.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),L.updatePaintBuffers());const j=v.constantOr(null);if(j&&F.imageAtlas){const J=F.imageAtlas.patternPositions[j.toString()];J&&L.setConstantPatternPositions(J)}const K=l.translatePosMatrix(B.projMatrix,F,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(g){R=I.indexBuffer2,O=I.segments2;const J=l.terrain&&l.terrain.renderingToTexture?l.terrain.drapeBufferSize:[y.drawingBufferWidth,y.drawingBufferHeight];k=A==="fillOutlinePattern"&&E?Ph(K,l,F,J):zh(K,J)}else R=I.indexBuffer,O=I.segments,k=E?qa(K,l,F):bn(K);l.prepareDrawProgram(l.context,N,B.toUnwrapped()),N.draw(l.context,T,d,l.stencilModeForClipping(B),f,a.CullFaceMode.disabled,k,o.id,I.layoutVertexBuffer,R,O,o.paint,l.transform.zoom,L)}}function Bs(l,r,o,h,d,f,g){const y=l.context,v=y.gl,E=l.transform,T=o.paint.get("fill-extrusion-pattern"),A=T.constantOr(1),k=o.paint.get("fill-extrusion-opacity"),R=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),o.paint.get("fill-extrusion-ambient-occlusion-radius")],O=o.layout.get("fill-extrusion-edge-radius"),B=O>0&&!o.paint.get("fill-extrusion-rounded-roof"),F=B?0:O,I=E.projection.name==="globe"?a.fillExtrusionHeightLift():0,L=E.projection.name==="globe",N=L?a.globeToMercatorTransition(E.zoom):0,j=[a.mercatorXfromLng(E.center.lng),a.mercatorYfromLat(E.center.lat)],K=[];
vendor: 9,982 bytes, line 1311
1311L&&K.push("PROJECTION_GLOBE_VIEW"),R[0]>0&&K.push("FAUX_AO"),B&&K.push("ZERO_ROOF_RADIUS");for(const J of h){const Y=r.getTile(J),ie=Y.getBucket(o);if(!ie||ie.projection.name!==E.projection.name)continue;const te=ie.programConfigurations.get(o.id),le=l.useProgram(A?"fillExtrusionPattern":"fillExtrusion",te,K);if(l.terrain){const _e=l.terrain;if(l.style.terrainSetForDrapingOnly())_e.setupElevationDraw(Y,le,{useMeterToDem:!0});else{if(!ie.enableTerrain)continue;if(_e.setupElevationDraw(Y,le,{useMeterToDem:!0}),xc(y,r,J,ie,o,_e),!ie.centroidVertexBuffer){const Me=le.attributes.a_centroid_pos;Me!==void 0&&v.vertexAttrib2f(Me,0,0)}}}A&&(l.context.activeTexture.set(v.TEXTURE0),Y.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),te.updatePaintBuffers());const Te=T.constantOr(null);if(Te&&Y.imageAtlas){const _e=Y.imageAtlas.patternPositions[Te.toString()];_e&&te.setConstantPatternPositions(_e)}const oe=l.translatePosMatrix(J.projMatrix,Y,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),ge=E.projection.createInversionMatrix(E,J.canonical),he=o.paint.get("fill-extrusion-vertical-gradient"),we=A?dc(oe,l,he,k,R,F,J,Y,I,N,j,ge):Za(oe,l,he,k,R,F,J,I,N,j,ge);l.prepareDrawProgram(y,le,J.toUnwrapped());const ae=[];l.terrain&&ae.push(ie.centroidVertexBuffer),L&&ae.push(ie.layoutVertexExtBuffer),le.draw(y,y.gl.TRIANGLES,d,f,g,a.CullFaceMode.backCCW,we,o.id,ie.layoutVertexBuffer,ie.indexBuffer,ie.segments,o.paint,l.transform.zoom,te,ae)}}function xc(l,r,o,h,d,f){const g=[I=>{let L=I.canonical.x-1,N=I.wrap;return L<0&&(L=(1<<I.canonical.z)-1,N--),new a.OverscaledTileID(I.overscaledZ,N,I.canonical.z,L,I.canonical.y)},I=>{let L=I.canonical.x+1,N=I.wrap;return L===1<<I.canonical.z&&(L=0,N++),new a.OverscaledTileID(I.overscaledZ,N,I.canonical.z,L,I.canonical.y)},I=>new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,(I.canonical.y===0?1<<I.canonical.z:I.canonical.y)-1),I=>new a.OverscaledTileID(I.overscaledZ,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y===(1<<I.canonical.z)-1?0:I.canonical.y+1)],y=I=>{const L=r.getSource().minzoom,N=K=>{const J=r.getTileByID(K);if(J&&J.hasData())return J.getBucket(d)},j=[0,-1,1];for(const K of j){if(I.overscaledZ+K<L)continue;const J=N(I.calculateScaledKey(I.overscaledZ+K));if(J)return J}},v=[0,0,0],E=(I,L)=>(v[0]=Math.min(I.min.y,L.min.y),v[1]=Math.max(I.max.y,L.max.y),v[2]=a.EXTENT-L.min.x>I.max.x?L.min.x-a.EXTENT:I.max.x,v),T=(I,L)=>(v[0]=Math.min(I.min.x,L.min.x),v[1]=Math.max(I.max.x,L.max.x),v[2]=a.EXTENT-L.min.y>I.max.y?L.min.y-a.EXTENT:I.max.y,v),A=[(I,L)=>E(I,L),(I,L)=>E(L,I),(I,L)=>T(I,L),(I,L)=>T(L,I)],k=new a.Point(0,0);let R,O,B;const F=(I,L,N,j,K)=>{const J=[[j?N:I,j?I:N,0],[j?N:L,j?L:N,0]],Y=K<0?a.EXTENT+K:K,ie=[j?Y:(I+L)/2,j?(I+L)/2:Y,0];return N===0&&K<0||N!==0&&K>0?f.getForTilePoints(B,[ie],!0,O):J.push(ie),f.getForTilePoints(o,J,!0,R),Math.max(J[0][2],J[1][2],ie[2])/f.exaggeration()};for(let I=0;I<4;I++){const L=(I<2?1:5)-I,N=h.borders[I];if(N.length===0)continue;const j=B=g[I](o),K=y(j);if(!(K&&K instanceof a.FillExtrusionBucket&&K.enableTerrain)||h.borderDoneWithNeighborZ[I]===K.canonical.z&&K.borderDoneWithNeighborZ[L]===h.canonical.z||(O=f.findDEMTileFor(j),!O||!O.dem))continue;if(!R){const te=f.findDEMTileFor(o);if(!te||!te.dem)return;R=te}const J=K.borders[L];let Y=0;const ie=K.borderDoneWithNeighborZ[L]!==h.canonical.z;if(h.canonical.z===K.canonical.z){for(let te=0;te<N.length;te++){const le=h.featuresOnBorder[N[te]],Te=le.borders[I];let oe;for(;Y<J.length&&(oe=K.featuresOnBorder[J[Y]],!(oe.borders[L][1]>Te[0]+3));)ie&&K.encodeCentroid(void 0,oe,!1),Y++;if(oe&&Y<J.length){const ge=Y;let he=0;for(;!(oe.borders[L][0]>Te[1]-3)&&(he++,++Y!==J.length);)oe=K.featuresOnBorder[J[Y]];if(oe=K.featuresOnBorder[J[ge]],le.intersectsCount()>1||oe.intersectsCount()>1||he!==1){he!==1&&(Y=ge),h.encodeCentroid(void 0,le,!1),ie&&K.encodeCentroid(void 0,oe,!1);continue}const we=A[I](le,oe),ae=I%2?a.EXTENT-1:0;k.x=F(we[0],Math.min(a.EXTENT-1,we[1]),ae,I<2,we[2]),k.y=0,h.encodeCentroid(k,le,!1),ie&&K.encodeCentroid(k,oe,!1)}else h.encodeCentroid(void 0,le,!1)}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0,ie&&(K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0)}else{for(const te of N)h.encodeCentroid(void 0,h.featuresOnBorder[te],!1);if(ie){for(const te of J)K.encodeCentroid(void 0,K.featuresOnBorder[te],!1);K.borderDoneWithNeighborZ[L]=h.canonical.z,K.needsCentroidUpdate=!0}h.borderDoneWithNeighborZ[I]=K.canonical.z,h.needsCentroidUpdate=!0}}(h.needsCentroidUpdate||!h.centroidVertexBuffer&&h.centroidVertexArray.length!==0)&&h.uploadCentroid(l)}const Qn=new a.Color(1,0,0,1),Bh=new a.Color(0,1,0,1),Oh=new a.Color(0,0,1,1),Fh=new a.Color(1,0,1,1),Uh=new a.Color(0,1,1,1);function Vh(l,r,o){const h=l.context,d=l.transform,f=h.gl,g=d.projection.name==="globe",y=g?["PROJECTION_GLOBE_VIEW"]:null;let v=o.projMatrix;if(g&&a.globeToMercatorTransition(d.zoom)>0){const le=a.transitionTileAABBinECEF(o.canonical,d),Te=a.globeDenormalizeECEF(le);v=a.multiply(new Float32Array(16),d.globeMatrix,Te),a.multiply(v,d.projMatrix,v)}const E=l.useProgram("debug",null,y),T=r.getTileByID(o.key);l.terrain&&l.terrain.setupElevationDraw(T,E);const A=a.DepthMode.disabled,k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O="$debug";h.activeTexture.set(f.TEXTURE0),l.emptyTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),g?T._makeGlobeTileDebugBuffers(l.context,d):T._makeDebugTileBoundsBuffers(l.context,d.projection);const B=T._tileDebugBuffer||l.debugBuffer,F=T._tileDebugIndexBuffer||l.debugIndexBuffer,I=T._tileDebugSegments||l.debugSegments;E.draw(h,f.LINE_STRIP,A,k,R,a.CullFaceMode.disabled,ks(v,a.Color.red),O,B,F,I,null,null,null,[T._globeTileDebugBorderBuffer]);const L=T.latestRawTileData,N=Math.floor((L&&L.byteLength||0)/1024),j=r.getTile(o).tileSize,K=512/Math.min(j,512)*(o.overscaledZ/d.zoom)*.5;let J=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(J+=` => ${o.overscaledZ}`),J+=` ${N}kb`,function(le,Te){le.initDebugOverlayCanvas();const oe=le.debugOverlayCanvas,ge=le.context.gl,he=le.debugOverlayCanvas.getContext("2d");he.clearRect(0,0,oe.width,oe.height),he.shadowColor="white",he.shadowBlur=2,he.lineWidth=1.5,he.strokeStyle="white",he.textBaseline="top",he.font="bold 36px Open Sans, sans-serif",he.fillText(Te,5,5),he.strokeText(Te,5,5),le.debugOverlayTexture.update(oe),le.debugOverlayTexture.bind(ge.LINEAR,ge.CLAMP_TO_EDGE)}(l,J);const Y=T._tileDebugTextBuffer||l.debugBuffer,ie=T._tileDebugTextIndexBuffer||l.quadTriangleIndexBuffer,te=T._tileDebugTextSegments||l.debugSegments;E.draw(h,f.TRIANGLES,A,k,a.ColorMode.alphaBlended,a.CullFaceMode.disabled,ks(v,a.Color.transparent,K),O,Y,ie,te,null,null,null,[T._globeTileDebugTextBuffer])}function vc(l,r,o,h){eo(l,0,r+o/2,l.transform.width,o,h)}function Os(l,r,o,h){eo(l,r-o/2,0,o,l.transform.height,h)}function eo(l,r,o,h,d,f){const g=l.context,y=g.gl;y.enable(y.SCISSOR_TEST),y.scissor(r*a.exported.devicePixelRatio,o*a.exported.devicePixelRatio,h*a.exported.devicePixelRatio,d*a.exported.devicePixelRatio),g.clear({color:f}),y.disable(y.SCISSOR_TEST)}const bc=a.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:wc}=bc;function Dr(l,r,o,h){l.emplaceBack(r,o,h)}class Fs{constructor(r){this.vertexArray=new a.StructArrayLayout3f12,this.indices=new a.StructArrayLayout3ui6,Dr(this.vertexArray,-1,-1,1),Dr(this.vertexArray,1,-1,1),Dr(this.vertexArray,-1,1,1),Dr(this.vertexArray,1,1,1),Dr(this.vertexArray,-1,-1,-1),Dr(this.vertexArray,1,-1,-1),Dr(this.vertexArray,-1,1,-1),Dr(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,wc),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=a.SegmentVector.simpleSegment(0,0,36,12)}}function $i(l,r,o,h,d,f){const g=l.gl,y=r.paint.get("sky-atmosphere-color"),v=r.paint.get("sky-atmosphere-halo-color"),E=r.paint.get("sky-atmosphere-sun-intensity"),T=((A,k,R,O,B)=>({u_matrix_3f:A,u_sun_direction:k,u_sun_intensity:R,u_color_tint_r:[O.r,O.g,O.b,O.a],u_color_tint_m:[B.r,B.g,B.b,B.a],u_luminance:5e-5}))(a.fromMat4(a.create$1(),h),d,E,y,v);g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_CUBE_MAP_POSITIVE_X+f,r.skyboxTexture,0),o.draw(l,g.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,a.ColorMode.unblended,a.CullFaceMode.frontCW,T,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const Zo=a.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Tc{constructor(r){const o=new a.StructArrayLayout5f20;o.emplaceBack(-1,1,1,0,0),o.emplaceBack(1,1,1,1,0),o.emplaceBack(1,-1,1,1,1),o.emplaceBack(-1,-1,1,0,1);const h=new a.StructArrayLayout3ui6;h.emplaceBack(0,1,2),h.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(o,Zo.members),this.indexBuffer=r.createIndexBuffer(h),this.segments=a.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const wn={symbol:function(l,r,o,h,d){if(l.renderPass!=="translucent")return;const f=a.StencilMode.disabled,g=l.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(y,v,E,T,A,k,R){const O=v.transform,B=A==="map",F=k==="map";for(const I of y){const L=T.getTile(I),N=L.getBucket(E);if(!N||!N.text||!N.text.segments.get().length)continue;const j=a.evaluateSizeForZoom(N.textSizeData,O.zoom),K=Ot(I,N.getProjection(),O),J=O.calculatePixelsToTileUnitsMatrix(L),Y=fe(K,L.tileID.canonical,F,B,O,N.getProjection(),J),ie=E.layout.get("icon-text-fit")!=="none"&&N.hasIconData();
1311if(j){const te=Math.pow(2,O.zoom-L.tileID.overscaledZ);Rh(N,B,F,R,a.symbolSize,O,Y,I,te,j,ie)}}}(h,l,o,r,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),d),o.paint.get("icon-opacity").constantOr(1)!==0&&gc(l,r,o,h,!1,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),o.layout.get("icon-rotation-alignment"),o.layout.get("icon-pitch-alignment"),o.layout.get("icon-keep-upright"),f,g),o.paint.get("text-opacity").constantOr(1)!==0&&gc(l,r,o,h,!0,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),o.layout.get("text-keep-upright"),f,g),r.map.showCollisionBoxes&&(Go(l,r,o,h,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),Go(l,r,o,h,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1))},circle:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("circle-opacity"),f=o.paint.get("circle-stroke-width"),g=o.paint.get("circle-stroke-opacity"),y=o.layout.get("circle-sort-key").constantOr(1)!==void 0;if(d.constantOr(1)===0&&(f.constantOr(1)===0||g.constantOr(1)===0))return;const v=l.context,E=v.gl,T=l.transform,A=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),k=a.StencilMode.disabled,R=l.colorModeForRenderPass(),O=T.projection.name==="globe",B=[a.mercatorXfromLng(T.center.lng),a.mercatorYfromLat(T.center.lat)],F=[];for(let L=0;L<h.length;L++){const N=h[L],j=r.getTile(N),K=j.getBucket(o);if(!K||K.projection.name!==T.projection.name)continue;const J=K.programConfigurations.get(o.id),Y=Xa(o);O&&Y.push("PROJECTION_GLOBE_VIEW");const ie=l.useProgram("circle",J,Y),te=K.layoutVertexBuffer,le=K.globeExtVertexBuffer,Te=K.indexBuffer,oe=T.projection.createInversionMatrix(T,N.canonical),ge={programConfiguration:J,program:ie,layoutVertexBuffer:te,globeExtVertexBuffer:le,indexBuffer:Te,uniformValues:Wa(l,N,j,oe,B,o),tile:j};if(y){const he=K.segments.get();for(const we of he)F.push({segments:new a.SegmentVector([we]),sortKey:we.sortKey,state:ge})}else F.push({segments:K.segments,sortKey:0,state:ge})}y&&F.sort((L,N)=>L.sortKey-N.sortKey);const I={useDepthForOcclusion:!O};for(const L of F){const{programConfiguration:N,program:j,layoutVertexBuffer:K,globeExtVertexBuffer:J,indexBuffer:Y,uniformValues:ie,tile:te}=L.state,le=L.segments;l.terrain&&l.terrain.setupElevationDraw(te,j,I),l.prepareDrawProgram(v,j,te.tileID.toUnwrapped()),j.draw(v,E.TRIANGLES,A,k,R,a.CullFaceMode.disabled,ie,o.id,K,Y,le,o.paint,T.zoom,N,[J])}},heatmap:function(l,r,o,h){if(o.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){const d=l.context,f=d.gl,g=a.StencilMode.disabled,y=new a.ColorMode([f.ONE,f.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(R,O,B,F){const I=R.gl,L=O.width*F,N=O.height*F;R.activeTexture.set(I.TEXTURE1),R.viewport.set([0,0,L,N]);let j=B.heatmapFbo;if(!j||j&&(j.width!==L||j.height!==N)){j&&j.destroy();const K=I.createTexture();I.bindTexture(I.TEXTURE_2D,K),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),j=B.heatmapFbo=R.createFramebuffer(L,N,!1),function(J,Y,ie,te,le,Te){const oe=J.gl;oe.texImage2D(oe.TEXTURE_2D,0,J.isWebGL2&&J.extRenderToTextureHalfFloat?oe.RGBA16F:oe.RGBA,le,Te,0,oe.RGBA,J.extRenderToTextureHalfFloat?J.isWebGL2?oe.HALF_FLOAT:J.extTextureHalfFloat.HALF_FLOAT_OES:oe.UNSIGNED_BYTE,null),te.colorAttachment.set(ie)}(R,0,K,j,L,N)}else I.bindTexture(I.TEXTURE_2D,j.colorAttachment.get()),R.bindFramebuffer.set(j.framebuffer)})(d,l,o,l.transform.projection.name==="globe"?.5:.25),d.clear({color:a.Color.transparent});const v=l.transform,E=v.projection.name==="globe",T=E?["PROJECTION_GLOBE_VIEW"]:null,A=E?a.CullFaceMode.frontCCW:a.CullFaceMode.disabled,k=[a.mercatorXfromLng(v.center.lng),a.mercatorYfromLat(v.center.lat)];for(let R=0;R<h.length;R++){const O=h[R];if(r.hasRenderableParent(O))continue;const B=r.getTile(O),F=B.getBucket(o);if(!F||F.projection.name!==v.projection.name)continue;const I=F.programConfigurations.get(o.id),L=l.useProgram("heatmap",I,T),{zoom:N}=l.transform;l.terrain&&l.terrain.setupElevationDraw(B,L),l.prepareDrawProgram(d,L,O.toUnwrapped());const j=v.projection.createInversionMatrix(v,O.canonical);L.draw(d,f.TRIANGLES,a.DepthMode.disabled,g,y,A,fc(l,O,B,j,k,N,o.paint.get("heatmap-intensity")),o.id,F.layoutVertexBuffer,F.indexBuffer,F.segments,o.paint,l.transform.zoom,I,E?[F.globeExtVertexBuffer]:null)}d.viewport.set([0,0,l.width,l.height])}else l.renderPass==="translucent"&&(l.context.setColorMode(l.colorModeForRenderPass()),function(d,f){const g=d.context,y=g.gl,v=f.heatmapFbo;if(!v)return;g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),g.activeTexture.set(y.TEXTURE1);let E=f.colorRampTexture;E||(E=f.colorRampTexture=new a.Texture(g,f.colorRamp,y.RGBA)),E.bind(y.LINEAR,y.CLAMP_TO_EDGE),d.useProgram("heatmapTexture").draw(g,y.TRIANGLES,a.DepthMode.disabled,a.StencilMode.disabled,d.colorModeForRenderPass(),a.CullFaceMode.disabled,((T,A,k,R)=>({u_image:0,u_color_ramp:1,u_opacity:A.paint.get("heatmap-opacity")}))(0,f),f.id,d.viewportBuffer,d.quadTriangleIndexBuffer,d.viewportSegments,f.paint,d.transform.zoom)}(l,o))},line:function(l,r,o,h){if(l.renderPass!=="translucent")return;const d=o.paint.get("line-opacity"),f=o.paint.get("line-width");if(d.constantOr(1)===0||f.constantOr(1)===0)return;const g=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),y=l.colorModeForRenderPass(),v=l.terrain&&l.terrain.renderingToTexture?1:a.exported.devicePixelRatio,E=o.paint.get("line-dasharray"),T=E.constantOr(1),A=o.layout.get("line-cap"),k=o.paint.get("line-pattern"),R=k.constantOr(1),O=o.paint.get("line-gradient"),B=R?"linePattern":"line",F=l.context,I=F.gl,L=(j=>{const K=[];jo(j)&&K.push("RENDER_LINE_DASH"),j.paint.get("line-gradient")&&K.push("RENDER_LINE_GRADIENT");const J=j.paint.get("line-trim-offset");J[0]===0&&J[1]===0||K.push("RENDER_LINE_TRIM_OFFSET");const Y=j.paint.get("line-pattern").constantOr(1),ie=j.paint.get("line-opacity").constantOr(1)!==1;return!Y&&ie&&K.push("RENDER_LINE_ALPHA_DISCARD"),K})(o);let N=L.includes("RENDER_LINE_ALPHA_DISCARD");l.terrain&&l.terrain.clipOrMaskOverlapStencilType()&&(N=!1);for(const j of h){const K=r.getTile(j);if(R&&!K.patternsLoaded())continue;const J=K.getBucket(o);if(!J)continue;l.prepareDrawTile();const Y=J.programConfigurations.get(o.id),ie=l.useProgram(B,Y,L),te=k.constantOr(null);if(te&&K.imageAtlas){const _e=K.imageAtlas.patternPositions[te.toString()];_e&&Y.setConstantPatternPositions(_e)}const le=E.constantOr(null),Te=A.constantOr(null);if(!R&&le&&Te&&K.lineAtlas){const _e=K.lineAtlas.getDash(le,Te);_e&&Y.setConstantPatternPositions(_e)}let[oe,ge]=o.paint.get("line-trim-offset");(Te==="round"||Te==="square")&&oe!==ge&&(oe===0&&(oe-=1),ge===1&&(ge+=1));const he=l.terrain?j.projMatrix:null,we=R?No(l,K,o,he,v):Dh(l,K,o,he,J.lineClipsArray.length,v,[oe,ge]);if(O){const _e=J.gradients[o.id];let Me=_e.texture;if(o.gradientVersion!==_e.version){let ve=256;if(o.stepInterpolant){const Ae=r.getSource().maxzoom,Ge=j.canonical.z===Ae?Math.ceil(1<<l.transform.maxZoom-j.canonical.z):1;ve=a.clamp(a.nextPowerOfTwo(J.maxLineLength/a.EXTENT*1024*Ge),256,F.maxTextureSize)}_e.gradient=a.renderColorRamp({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:ve,image:_e.gradient||void 0,clips:J.lineClipsArray}),_e.texture?_e.texture.update(_e.gradient):_e.texture=new a.Texture(F,_e.gradient,I.RGBA),_e.version=o.gradientVersion,Me=_e.texture}F.activeTexture.set(I.TEXTURE1),Me.bind(o.stepInterpolant?I.NEAREST:I.LINEAR,I.CLAMP_TO_EDGE)}T&&(F.activeTexture.set(I.TEXTURE0),K.lineAtlasTexture.bind(I.LINEAR,I.REPEAT),Y.updatePaintBuffers()),R&&(F.activeTexture.set(I.TEXTURE0),K.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Y.updatePaintBuffers()),l.prepareDrawProgram(F,ie,j.toUnwrapped());const ae=_e=>{ie.draw(F,I.TRIANGLES,g,_e,y,a.CullFaceMode.disabled,we,o.id,J.layoutVertexBuffer,J.indexBuffer,J.segments,o.paint,l.transform.zoom,Y,[J.layoutVertexBuffer2])};if(N){const _e=l.stencilModeForClipping(j).ref;_e===0&&l.terrain&&F.clear({stencil:0});const Me={func:I.EQUAL,mask:255};we.u_alpha_discard_threshold=.8,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.INVERT)),we.u_alpha_discard_threshold=0,ae(new a.StencilMode(Me,_e,255,I.KEEP,I.KEEP,I.KEEP))}else ae(l.stencilModeForClipping(j))}N&&(l.resetStencilClippingMasks(),l.terrain&&F.clear({stencil:0}))},fill:function(l,r,o,h){const d=o.paint.get("fill-color"),f=o.paint.get("fill-opacity");if(f.constantOr(1)===0)return;const g=l.colorModeForRenderPass(),y=o.paint.get("fill-pattern"),v=l.opaquePassEnabledForLayer()&&!y.constantOr(1)&&d.constantOr(a.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===v){const E=l.depthModeForSublayer(1,l.renderPass==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!1)}if(l.renderPass==="translucent"&&o.paint.get("fill-antialias")){const E=l.depthModeForSublayer(o.getPaintProperty("fill-outline-color")?2:0,a.DepthMode.ReadOnly);yc(l,r,o,h,E,g,!0)}},"fill-extrusion":function(l,r,o,h){const d=o.paint.get("fill-extrusion-opacity");if(d!==0&&l.renderPass==="translucent"){const f=new a.DepthMode(l.context.gl.LEQUAL,a.DepthMode.ReadWrite,l.depthRangeFor3D);if(d!==1||o.paint.get("fill-extrusion-pattern").constantOr(1))Bs(l,r,o,h,f,a.StencilMode.disabled,a.ColorMode.disabled),Bs(l,r,o,h,f,l.stencilModeFor3D(),l.colorModeForRenderPass()),l.resetStencilClippingMasks();else{const g=l.colorModeForRenderPass();Bs(l,r,o,h,f,a.StencilMode.disabled,g)}}},hillshade:function(l,r,o,h){if(l.renderPass!=="offscreen"&&l.renderPass!=="translucent")return;
1311const d=l.context,f=l.depthModeForSublayer(0,a.DepthMode.ReadOnly),g=l.colorModeForRenderPass(),y=l.terrain&&l.terrain.renderingToTexture,[v,E]=l.renderPass!=="translucent"||y?[{},h]:l.stencilConfigForOverlap(h);for(const T of E){const A=r.getTile(T);if(A.needsHillshadePrepare&&l.renderPass==="offscreen")cc(l,A,o,f,a.StencilMode.disabled,g);else if(l.renderPass==="translucent"){const k=y&&l.terrain?l.terrain.stencilModeForRTTOverlap(T):v[T.overscaledZ];lc(l,T,A,o,f,k,g)}}d.viewport.set([0,0,l.width,l.height]),l.resetStencilClippingMasks()},raster:function(l,r,o,h,d,f){if(l.renderPass!=="translucent"||o.paint.get("raster-opacity")===0||!h.length)return;const g=l.context,y=g.gl,v=r.getSource(),E=l.useProgram("raster"),T=l.colorModeForRenderPass(),A=l.terrain&&l.terrain.renderingToTexture,[k,R]=v instanceof rt||A?[{},h]:l.stencilConfigForOverlap(h),O=R[R.length-1].overscaledZ,B=!l.options.moving;for(const F of R){const I=A?a.DepthMode.disabled:l.depthModeForSublayer(F.overscaledZ-O,o.paint.get("raster-opacity")===1?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly,y.LESS),L=F.toUnwrapped(),N=r.getTile(F);if(A&&(!N||!N.hasData()))continue;const j=A?F.projMatrix:l.transform.calculateProjMatrix(L,B),K=l.terrain&&A?l.terrain.stencilModeForRTTOverlap(F):k[F.overscaledZ],J=f?0:o.paint.get("raster-fade-duration");N.registerFadeDuration(J);const Y=r.findLoadedParent(F,0),ie=ja(N,Y,r,l.transform,J);let te,le;l.terrain&&l.terrain.prepareDrawTile();const Te=o.paint.get("raster-resampling")==="nearest"?y.NEAREST:y.LINEAR;g.activeTexture.set(y.TEXTURE0),N.texture.bind(Te,y.CLAMP_TO_EDGE),g.activeTexture.set(y.TEXTURE1),Y?(Y.texture.bind(Te,y.CLAMP_TO_EDGE),te=Math.pow(2,Y.tileID.overscaledZ-N.tileID.overscaledZ),le=[N.tileID.canonical.x*te%1,N.tileID.canonical.y*te%1]):N.texture.bind(Te,y.CLAMP_TO_EDGE),N.texture.useMipmap&&g.extTextureFilterAnisotropic&&l.transform.pitch>20&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const oe=Ya(j,le||[0,0],te||1,ie,o,v instanceof rt?v.perspectiveTransform:[0,0]);if(l.prepareDrawProgram(g,E,L),v instanceof rt)v.boundsBuffer&&v.boundsSegments&&E.draw(g,y.TRIANGLES,I,a.StencilMode.disabled,T,a.CullFaceMode.disabled,oe,o.id,v.boundsBuffer,l.quadTriangleIndexBuffer,v.boundsSegments);else{const{tileBoundsBuffer:ge,tileBoundsIndexBuffer:he,tileBoundsSegments:we}=l.getTileBoundsBuffers(N);E.draw(g,y.TRIANGLES,I,K,T,a.CullFaceMode.disabled,oe,o.id,ge,he,we)}}l.resetStencilClippingMasks()},background:function(l,r,o,h){const d=o.paint.get("background-color"),f=o.paint.get("background-opacity");if(f===0)return;const g=l.context,y=g.gl,v=l.transform,E=v.tileSize,T=o.paint.get("background-pattern");if(l.isPatternMissing(T))return;const A=!T&&d.a===1&&f===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass!==A)return;const k=a.StencilMode.disabled,R=l.depthModeForSublayer(0,A==="opaque"?a.DepthMode.ReadWrite:a.DepthMode.ReadOnly),O=l.colorModeForRenderPass(),B=l.useProgram(T?"backgroundPattern":"background");let F,I=h;I||(F=l.getBackgroundTiles(),I=Object.values(F).map(L=>L.tileID)),T&&(g.activeTexture.set(y.TEXTURE0),l.imageManager.bind(l.context));for(const L of I){const N=L.toUnwrapped(),j=h?L.projMatrix:l.transform.calculateProjMatrix(N);l.prepareDrawTile();const K=r?r.getTile(L):F?F[L.key]:new a.Tile(L,E,v.zoom,l),J=T?Lh(j,f,l,T,{tileID:L,tileSize:E}):Qa(j,f,d);l.prepareDrawProgram(g,B,N);const{tileBoundsBuffer:Y,tileBoundsIndexBuffer:ie,tileBoundsSegments:te}=l.getTileBoundsBuffers(K);B.draw(g,y.TRIANGLES,R,k,O,a.CullFaceMode.disabled,J,o.id,Y,ie,te)}},sky:function(l,r,o){const h=l.transform,d=h.projection.name==="mercator"||h.projection.name==="globe"?1:a.smoothstep(7,8,h.zoom),f=o.paint.get("sky-opacity")*d;if(f===0)return;const g=l.context,y=o.paint.get("sky-type"),v=new a.DepthMode(g.gl.LEQUAL,a.DepthMode.ReadOnly,[0,1]),E=l.frameCounter/1e3%1;y==="atmosphere"?l.renderPass==="offscreen"?o.needsSkyboxCapture(l)&&(function(T,A,k,R){const O=T.context,B=O.gl;let F=A.skyboxFbo;if(!F){F=A.skyboxFbo=O.createFramebuffer(32,32,!1),A.skyboxGeometry=new Fs(O),A.skyboxTexture=O.gl.createTexture(),B.bindTexture(B.TEXTURE_CUBE_MAP,A.
vendor: 7,002 bytes, line 1311
1311skyboxTexture),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_CUBE_MAP,B.TEXTURE_MAG_FILTER,B.LINEAR);for(let j=0;j<6;++j)B.texImage2D(B.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,B.RGBA,32,32,0,B.RGBA,B.UNSIGNED_BYTE,null)}O.bindFramebuffer.set(F.framebuffer),O.viewport.set([0,0,32,32]);const I=A.getCenter(T,!0),L=T.useProgram("skyboxCapture"),N=new Float64Array(16);a.identity(N),a.rotateY(N,N,.5*-Math.PI),$i(O,A,L,N,I,0),a.identity(N),a.rotateY(N,N,.5*Math.PI),$i(O,A,L,N,I,1),a.identity(N),a.rotateX(N,N,.5*-Math.PI),$i(O,A,L,N,I,2),a.identity(N),a.rotateX(N,N,.5*Math.PI),$i(O,A,L,N,I,3),a.identity(N),$i(O,A,L,N,I,4),a.identity(N),a.rotateY(N,N,Math.PI),$i(O,A,L,N,I,5),O.viewport.set([0,0,T.width,T.height])}(l,o),o.markSkyboxValid(l)):l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skybox");B.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_CUBE_MAP,A.skyboxTexture);const N=((j,K,J,Y,ie)=>({u_matrix:j,u_sun_direction:K,u_cubemap:0,u_opacity:Y,u_temporal_offset:ie}))(I.skyboxMatrix,A.getCenter(T,!1),0,R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,N,"skybox",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E):y==="gradient"&&l.renderPass==="sky"&&function(T,A,k,R,O){const B=T.context,F=B.gl,I=T.transform,L=T.useProgram("skyboxGradient");A.skyboxGeometry||(A.skyboxGeometry=new Fs(B)),B.activeTexture.set(F.TEXTURE0);let N=A.colorRampTexture;N||(N=A.colorRampTexture=new a.Texture(B,A.colorRamp,F.RGBA)),N.bind(F.LINEAR,F.CLAMP_TO_EDGE);const j=((K,J,Y,ie,te)=>({u_matrix:K,u_color_ramp:0,u_center_direction:J,u_radius:a.degToRad(Y),u_opacity:ie,u_temporal_offset:te}))(I.skyboxMatrix,A.getCenter(T,!1),A.paint.get("sky-gradient-radius"),R,O);T.prepareDrawProgram(B,L),L.draw(B,F.TRIANGLES,k,a.StencilMode.disabled,T.colorModeForRenderPass(),a.CullFaceMode.backCW,j,"skyboxGradient",A.skyboxGeometry.vertexBuffer,A.skyboxGeometry.indexBuffer,A.skyboxGeometry.segment)}(l,o,v,f,E)},debug:function(l,r,o){for(let h=0;h<o.length;h++)Vh(l,r,o[h])},custom:function(l,r,o,h){const d=l.context,f=o.implementation;if(!l.transform.projection.unsupportedLayers||!l.transform.projection.unsupportedLayers.includes("custom")||l.terrain&&(l.terrain.renderingToTexture||l.renderPass==="offscreen")&&o.isLayerDraped()){if(l.renderPass==="offscreen"){const g=f.prerender;if(g){if(l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;g.call(f,d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),a.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else g.call(f,d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState()}}else if(l.renderPass==="translucent"){if(l.terrain&&l.terrain.renderingToTexture){const y=f.renderToTile;if(y){const v=h[0].canonical,E=new a.MercatorCoordinate(v.x+h[0].wrap*(1<<v.z),v.y,v.z);d.setDepthMode(a.DepthMode.disabled),d.setStencilMode(a.StencilMode.disabled),d.setColorMode(l.colorModeForRenderPass()),l.setCustomLayerDefaults(),y.call(f,d.gl,E),d.setDirty(),l.setBaseState()}return}l.setCustomLayerDefaults(),d.setColorMode(l.colorModeForRenderPass()),d.setStencilMode(a.StencilMode.disabled);const g=f.renderingMode==="3d"?new a.DepthMode(l.context.gl.LEQUAL,a.DepthMode.ReadWrite,l.depthRangeFor3D):l.depthModeForSublayer(0,a.DepthMode.ReadOnly);if(d.setDepthMode(g),l.transform.projection.name==="globe"){const y=l.transform.pointMerc;f.render(d.gl,l.transform.customLayerMatrix(),l.transform.getProjection(),l.transform.globeToMercatorMatrix(),a.globeToMercatorTransition(l.transform.zoom),[y.x,y.y],l.transform.pixelsPerMeterRatio)}else f.render(d.gl,l.transform.customLayerMatrix());d.setDirty(),l.setBaseState(),d.bindFramebuffer.set(null)}}else a.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class to{constructor(r,o,h=!1){this.context=new Pe(r,h),this.transform=o,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=a.SourceCache.maxUnderzooming+a.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(r,o){const h=!!r&&!!r.terrain&&this.transform.projection.supportsTerrain;if(!(h||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new $a(this,r));const d=this._terrain;this.transform.elevation=h?d:null,d.update(r,this.transform,o)}_updateFog(r){const o=r.fog;if(!o||this.transform.projection.name==="globe"||o.getOpacity(this.transform.pitch)<1||o.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[h,d]=o.getFovAdjustedRange(this.transform._fov);if(h>d)return void(this.transform.fogCullDistSq=null);const f=h+.78*(d-h);this.transform.fogCullDistSq=f*f}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(r,o){if(this.width=r*a.exported.devicePixelRatio,this.height=o*a.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style.order)this.style._layers[h].resize()}setup(){const r=this.context,o=new a.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(a.EXTENT,0),o.emplaceBack(0,a.EXTENT),o.emplaceBack(a.EXTENT,a.EXTENT),this.tileExtentBuffer=r.createVertexBuffer(o,a.posAttributes.members),this.tileExtentSegments=a.SegmentVector.simpleSegment(0,0,4,2);const h=new a.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(a.EXTENT,0),h.emplaceBack(0,a.EXTENT),h.emplaceBack(a.EXTENT,a.EXTENT),this.debugBuffer=r.createVertexBuffer(h,a.posAttributes.members),this.debugSegments=a.SegmentVector.simpleSegment(0,0,4,5);const d=new a.StructArrayLayout2i4;d.emplaceBack(-1,-1),d.emplaceBack(1,-1),d.emplaceBack(-1,1),d.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(d,a.posAttributes.members),this.viewportSegments=a.SegmentVector.simpleSegment(0,0,4,2);const f=new a.StructArrayLayout4i8;f.emplaceBack(0,0,0,0),f.emplaceBack(a.EXTENT,0,a.EXTENT,0),f.emplaceBack(0,a.EXTENT,0,a.EXTENT),f.emplaceBack(a.EXTENT,a.EXTENT,a.EXTENT,a.EXTENT),this.mercatorBoundsBuffer=r.createVertexBuffer(f,a.boundsAttributes.members),this.mercatorBoundsSegments=a.SegmentVector.simpleSegment(0,0,4,2);const g=new a.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(g);const y=new a.StructArrayLayout1ui2;for(const E of[0,1,3,2,0])y.emplaceBack(E);this.debugIndexBuffer=r.createIndexBuffer(y),this.emptyTexture=new a.Texture(r,
vendor: 8,973 bytes, line 1311
1311new a.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=a.create();const v=this.context.gl;this.stencilClearMode=new a.StencilMode({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO),this.loadTimeStamps.push(a.window.performance.now()),this.atmosphereBuffer=new Tc(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(r){return r._makeTileBoundsBuffers(this.context,this.transform.projection),r._tileBoundsBuffer?{tileBoundsBuffer:r._tileBoundsBuffer,tileBoundsIndexBuffer:r._tileBoundsIndexBuffer,tileBoundsSegments:r._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const r=this.context,o=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(r,o.TRIANGLES,a.DepthMode.disabled,this.stencilClearMode,a.ColorMode.disabled,a.CullFaceMode.disabled,Uo(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(r,o,h){if(!o||this.currentStencilSource===o.id||!r.isTileClipped()||!h||h.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let y=!1;for(const v of h)if(this._tileClippingMaskIDs[v.key]===void 0){y=!0;break}if(!y)return}this.currentStencilSource=o.id;const d=this.context,f=d.gl;this.nextStencilID+h.length>256&&this.clearStencil(),d.setColorMode(a.ColorMode.disabled),d.setDepthMode(a.DepthMode.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of h){const v=o.getTile(y),E=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,{tileBoundsBuffer:T,tileBoundsIndexBuffer:A,tileBoundsSegments:k}=this.getTileBoundsBuffers(v);g.draw(d,f.TRIANGLES,a.DepthMode.disabled,new a.StencilMode({func:f.ALWAYS,mask:0},E,255,f.KEEP,f.KEEP,f.REPLACE),a.ColorMode.disabled,a.CullFaceMode.disabled,Uo(y.projMatrix),"$clipping",T,A,k)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,o=this.context.gl;return new a.StencilMode({func:o.NOTEQUAL,mask:255},r,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(r){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(r);const o=this.context.gl;return new a.StencilMode({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(r){const o=this.context.gl,h=r.sort((g,y)=>y.overscaledZ-g.overscaledZ),d=h[h.length-1].overscaledZ,f=h[0].overscaledZ-d+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();const g={};for(let y=0;y<f;y++)g[y+d]=new a.StencilMode({func:o.GEQUAL,mask:255},y+this.nextStencilID,255,o.KEEP,o.KEEP,o.REPLACE);return this.nextStencilID+=f,[g,h]}return[{[d]:a.StencilMode.disabled},h]}colorModeForRenderPass(){const r=this.context.gl;return this._showOverdrawInspector?new a.ColorMode([r.CONSTANT_COLOR,r.ONE],new a.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?a.ColorMode.unblended:a.ColorMode.alphaBlended}depthModeForSublayer(r,o,h){if(!this.opaquePassEnabledForLayer())return a.DepthMode.disabled;const d=1-((1+this.currentLayer)*this.numSublayers+r)*this.depthEpsilon;return new a.DepthMode(h||this.context.gl.LEQUAL,o,[d,d])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(r,o){this.style=r,this.options=o,this.imageManager=r.imageManager,this.glyphManager=r.glyphManager,this.symbolFadeChange=r.placement.symbolFadeChange(a.exported.now()),this.imageManager.beginFrame();const h=this.style.order,d=this.style._sourceCaches;for(const E in d){const T=d[E];T.used&&T.prepare(this.context)}const f={},g={},y={};for(const E in d){const T=d[E];f[E]=T.getVisibleCoordinates(),g[E]=f[E].slice().reverse(),y[E]=T.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let E=0;E<h.length;E++)if(this.style._layers[h[E]].is3D()){this.opaquePassCutoff=E;break}if(this.terrain&&(this.terrain.updateTileBinding(y),this.opaquePassCutoff=0),this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new a.GlobeSharedBuffers(this.context)),!a.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const E of h){const T=this.style._layers[E],A=r._getLayerSourceCache(T);if(!T.hasOffscreenPass()||T.isHidden(this.transform.zoom))continue;const k=A?g[A.id]:void 0;(T.type==="custom"||T.isSky()||k&&k.length)&&this.renderLayer(this,A,T,k)}this.depthRangeFor3D=[0,1-(r.order.length+2)*this.numSublayers*this.depthEpsilon];const v=this.terrain;if(v&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&v.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:o.showOverdrawInspector?a.Color.black:a.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=h.length-1;this.currentLayer>=0;this.currentLayer--){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);if(E.isSky())continue;const A=T?g[T.id]:void 0;this._renderTileClippingMasks(E,T,A),this.renderLayer(this,T,E,A)}if(this.style.fog&&this.transform.projection.supportsFog&&function(E,T){const A=E.context,k=A.gl,R=E.transform,O=new a.DepthMode(k.LEQUAL,a.DepthMode.ReadOnly,[0,1]),B=E.useProgram("globeAtmosphere",null,R.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),F=a.globeToMercatorTransition(R.zoom),I=T.properties.get("color").toArray01(),L=T.properties.get("high-color").toArray01(),N=T.properties.get("space-color").toArray01PremultipliedAlpha(),j=a.identity$1([]);a.rotateY$1(j,j,-a.degToRad(R._center.lng)),a.rotateX$1(j,j,a.degToRad(R._center.lat)),a.rotateZ$1(j,j,R.angle),a.rotateX$1(j,j,-R._pitch);const K=a.fromQuat(new Float32Array(16),j),J=a.mapValue(T.properties.get("star-intensity"),0,1,0,.25),Y=5e-4,ie=a.mapValue(T.properties.get("horizon-blend"),0,1,Y,.25),te=a.globeUseCustomAntiAliasing(E,A,R)&&ie===Y?R.worldSize/(2*Math.PI*1.025)-1:R.globeRadius,le=E.frameCounter/1e3%1,Te=a.length(R.globeCenterInViewSpace),oe=Math.sqrt(Math.pow(Te,2)-Math.pow(te,2)),ge=Math.acos(oe/Te),he=((ae,_e,Me,ve,Ae,Ge,Xe,Ve,qe,lt,ot,je,wt,Tt)=>({u_frustum_tl:ae,u_frustum_tr:_e,u_frustum_br:Me,u_frustum_bl:ve,u_horizon:Ae,u_transition:Ge,u_fadeout_range:Xe,u_color:Ve,u_high_color:qe,u_space_color:lt,u_star_intensity:ot,u_star_size:5*a.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:je,u_horizon_angle:wt,u_rotation_matrix:Tt}))(R.frustumCorners.TL,R.frustumCorners.TR,R.frustumCorners.BR,R.frustumCorners.BL,R.frustumCorners.horizon,F,ie,I,L,N,J,le,ge,K);E.prepareDrawProgram(A,B);const we=E.atmosphereBuffer;we&&B.draw(A,k.TRIANGLES,O,a.StencilMode.disabled,a.ColorMode.alphaBlended,a.CullFaceMode.backCW,he,"skybox",we.vertexBuffer,we.indexBuffer,we.segments)}(this,this.style.fog),this.renderPass="sky",(a.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);E.isSky()&&this.renderLayer(this,T,E,T?g[T.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<h.length;){const E=this.style._layers[h[this.currentLayer]],T=r._getLayerSourceCache(E);if(E.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(E)){if(E.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const A=T?(E.type==="symbol"?y:g)[T.id]:void 0;this._renderTileClippingMasks(E,T,T?f[T.id]:void 0),this.renderLayer(this,T,E,A),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let E=null;a.values(this.style._layers).forEach(T=>{const A=r._getLayerSourceCache(T);A&&!T.isHidden(this.transform.zoom)&&(!E||E.getSource().maxzoom<A.getSource().maxzoom)&&(E=A)}),E&&this.options.showTileBoundaries&&wn.debug(this,E,E.getVisibleCoordinates())}this.options.showPadding&&function(E){const T=E.transform.padding;vc(E,E.transform.height-(T.top||0),3,Qn),vc(E,T.bottom||0,3,Bh),Os(E,T.left||0,3,Oh),Os(E,E.transform.width-(T.right||0),3,Fh);const A=E.transform.centerPoint;(function(k,R,O,B){eo(k,R-1,O-10,2,20,B),eo(k,R-10,O-1,20,2,B)})(E,A.x,E.transform.height-A.y,Uh)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(a.window.performance.now()),this.saveC
vendor: 1,465 bytes, line 1311
1311anvasCopy())}renderLayer(r,o,h,d){h.isHidden(this.transform.zoom)||(h.type==="background"||h.type==="sky"||h.type==="custom"||d&&d.length)&&(this.id=h.id,this.gpuTimingStart(h),(!r.transform.projection.unsupportedLayers||!r.transform.projection.unsupportedLayers.includes(h.type)||r.terrain&&h.type==="custom")&&wn[h.type](r,o,h,d,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(r){if(!this.options.gpuTiming)return;const o=this.context.extTimerQuery;let h=this.gpuTimers[r.id];h||(h=this.gpuTimers[r.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),h.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,h.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const r=this.context.extTimerQuery,o=r.createQueryEXT();this.deferredRenderGpuTimeQueries.push(o),r.beginQueryEXT(r.TIME_ELAPSED_EXT,o)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const r=this.context.extTimerQuery;r.endQueryEXT(r.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const r=this.context.extTimerQuery;r.endQueryEXT(r.TIME_ELAPSED_EXT)}collectGpuTimers(){const r=this.gpuTimers;return this.gpuTimers={},r}collectDeferredRenderGpuQueries(){const r=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],r}queryGpuTimers(r){const o={};for(const h in r){const d=r[h],f=this.context.extTimerQuery,g=f.getQueryObjectEXT(d.query,f.QUERY_RESULT_EXT)/1e6;
1311f.deleteQueryEXT(d.query),o[h]=g}return o}queryGpuTimeDeferredRender(r){if(!this.options.gpuTimingDeferredRender)return 0;const o=this.context.extTimerQuery;let h=0;for(const d of r)h+=o.getQueryObjectEXT(d,o.QUERY_RESULT_EXT)/1e6,o.deleteQueryEXT(d);return h}translatePosMatrix(r,o,h,d,f){if(!h[0]&&!h[1])return r;const g=f?d==="map"?this.transform.angle:0:d==="viewport"?-this.transform.angle:0;if(g){const E=Math.sin(g),T=Math.cos(g);h=[h[0]*T-h[1]*E,h[0]*E+h[1]*T]}const y=[f?h[0]:ai(o,h[0],this.transform.zoom),f?h[1]:ai(o,h[1],this.transform.zoom),0],v=new Float32Array(16);return a.translate(v,r,y),v}saveTileTexture(r){const o=this._tileTextures[r.size[0]];o?o.push(r):this._tileTextures[r.size[0]]=[r]}getTileTexture(r){const o=this._tileTextures[r];return o&&o.length>0?o.pop():null}isPatternMissing(r){return r===null||r!==void 0&&!this.imageManager.getPattern(r.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const r=this.terrain&&this.terrain.renderingToTexture,o=this.terrain&&this.terrain.exaggeration()===0,h=this.style&&this.style.fog,d=[];return this.terrainRenderModeElevated()&&d.push("TERRAIN"),this.transform.projection.name==="globe"&&d.push("GLOBE"),o&&d.push("ZERO_EXAGGERATION"),h&&!r&&h.getOpacity(this.transform.pitch)!==0&&d.push("FOG"),r&&d.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&d.push("OVERDRAW_INSPECTOR"),d}useProgram(r,o,h){this.cache=this.cache||{};const d=h||[],f=this.currentGlobalDefines().concat(d),g=mt.cacheKey(Fa[r],r,f,o);return this.cache[g]||(this.cache[g]=new mt(this.context,r,Fa[r],o,el[r],f)),this.cache[g]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=a.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new a.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(r,o,h){if(this.terrain&&this.terrain.renderingToTexture)return;const d=this.style.fog;if(d){const f=d.getOpacity(this.transform.pitch),g=((y,v,E,T,A,k,R,O,B,F,I)=>{const L=y.transform,N=v.properties.get("color").toArray01();N[3]=T;const j=y.frameCounter/1e3%1;return{u_fog_matrix:E?L.calculateFogTileMatrix(E):y.identityMat,u_fog_range:v.getFovAdjustedRange(L._fov),u_fog_color:N,u_fog_horizon_blend:v.properties.get("horizon-blend"),u_fog_temporal_offset:j,u_frustum_tl:A,u_frustum_tr:k,u_frustum_br:R,u_frustum_bl:O,u_globe_pos:B,u_globe_radius:F,u_viewport:I,u_globe_transition:a.globeToMercatorTransition(L.zoom),u_is_globe:+(L.projection.name==="globe")}})(this,d,h,f,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*a.exported.devicePixelRatio,this.transform.height*a.exported.devicePixelRatio]);o.setFogUniformValues(r,g)}}setTileLoadedFlag(r){this.tileLoaded=r}saveCanvasCopy(){const r=this.canvasCopy();r&&(this.frameCopies.push(r),this.tileLoaded=!1)}canvasCopy(){const r=this.context.gl,o=r.createTexture();return r.bindTexture(r.TEXTURE_2D,o),r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,0,0,r.drawingBufferWidth,r.drawingBufferHeight,0),o}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const r=this.style&&this.style.fog;return!!r&&r.getOpacity(this.transform.pitch)!==0}
vendor: 6,737 bytes, line 1311
1311getBackgroundTiles(){const r=this._backgroundTiles,o=this._backgroundTiles={},h=this.transform.coveringTiles({tileSize:512});for(const d of h)o[d.key]=r[d.key]||new a.Tile(d,512,this.transform.tileZoom,this);return o}clearBackgroundTiles(){this._backgroundTiles={}}}class Us{constructor(r=0,o=0,h=0,d=0){if(isNaN(r)||r<0||isNaN(o)||o<0||isNaN(h)||h<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=o,this.left=h,this.right=d}interpolate(r,o,h){return o.top!=null&&r.top!=null&&(this.top=a.number(r.top,o.top,h)),o.bottom!=null&&r.bottom!=null&&(this.bottom=a.number(r.bottom,o.bottom,h)),o.left!=null&&r.left!=null&&(this.left=a.number(r.left,o.left,h)),o.right!=null&&r.right!=null&&(this.right=a.number(r.right,o.right,h)),this}getCenter(r,o){const h=a.clamp((this.left+r-this.right)/2,0,r),d=a.clamp((this.top+o-this.bottom)/2,0,o);return new a.Point(h,d)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new Us(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Vs(l,r){const o=a.getColumn(l,3);a.fromQuat(l,r),a.setColumn(l,3,o)}function _t(l,r){const o=a.identity$1([]);return a.rotateZ$1(o,o,-r),a.rotateX$1(o,o,-l),o}function qo(l,r){const o=[l[0],l[1],0],h=[r[0],r[1],0];if(a.length(o)>=1e-15){const g=a.normalize([],o);a.scale$2(h,g,a.dot(h,g)),r[0]=h[0],r[1]=h[1]}const d=a.cross([],r,l);if(a.len(d)<1e-15)return null;const f=Math.atan2(-d[1],d[0]);return _t(Math.atan2(Math.sqrt(l[0]*l[0]+l[1]*l[1]),-l[2]),f)}class Ec{constructor(r,o){this.position=r,this.orientation=o}get position(){return this._position}set position(r){if(r){const o=r instanceof a.MercatorCoordinate?r:new a.MercatorCoordinate(r[0],r[1],r[2]);this._renderWorldCopies&&(o.x=a.wrap(o.x,0,1)),this._position=o}else this._position=null}lookAtPoint(r,o){if(this.orientation=null,!this.position)return;const h=this.position,d=this._elevation?this._elevation.getAtPointOrZero(a.MercatorCoordinate.fromLngLat(r)):0,f=a.MercatorCoordinate.fromLngLat(r,d),g=[f.x-h.x,f.y-h.y,f.z-h.z];o||(o=[0,0,1]),o[2]=Math.abs(o[2]),this.orientation=qo(g,o)}setPitchBearing(r,o){this.orientation=_t(a.degToRad(r),a.degToRad(-o))}}class Ns{constructor(r,o){this._transform=a.identity([]),this.orientation=o,this.position=r}get mercatorPosition(){const r=this.position;return new a.MercatorCoordinate(r[0],r[1],r[2])}get position(){const r=a.getColumn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){var o;r&&a.setColumn(this._transform,3,[(o=r)[0],o[1],o[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||a.identity$1([]),r&&Vs(this._transform,this._orientation)}getPitchBearing(){const r=this.forward(),o=this.right();return{bearing:Math.atan2(-o[1],o[0]),pitch:Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2])}}setPitchBearing(r,o){this._orientation=_t(r,o),Vs(this._transform,this._orientation)}forward(){const r=a.getColumn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){const r=a.getColumn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){const r=a.getColumn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,o){const h=new Float64Array(16);return a.invert(h,this.getWorldToCamera(r,o)),h}getWorldToCameraPosition(r,o,h){const d=this.position;a.scale$2(d,d,-r);const f=new Float64Array(16);return a.fromScaling(f,[h,h,h]),a.translate(f,f,d),f[10]*=o,f}getWorldToCamera(r,o){const h=new Float64Array(16),d=new Float64Array(4),f=this.position;return a.conjugate(d,this._orientation),a.scale$2(f,f,-r),a.fromQuat(h,d),a.translate(h,h,f),h[1]*=-1,h[5]*=-1,h[9]*=-1,h[13]*=-1,h[8]*=o,h[9]*=o,h[10]*=o,h[11]*=o,h}getCameraToClipPerspective(r,o,h,d){const f=new Float64Array(16);return a.perspective(f,r,o,h,d),f}getDistanceToElevation(r,o=!1){const h=r===0?0:a.mercatorZfromAltitude(r,o?a.latFromMercatorY(this.position[1]):this.position[1]),d=this.forward();return(h-this.position[2])/d[2]}clone(){return new Ns([...this.position],[...this.orientation])}}function io(l,r){const o=js(l.projection,l.zoom,l.width,l.height),h=function(f,g,y,v,E){const T=new a.LngLat(y.lng-180*Lr,y.lat),A=new a.LngLat(y.lng+180*Lr,y.lat),k=f.project(T.lng,T.lat),R=f.project(A.lng,A.lat),O=-Math.atan2(R.y-k.y,R.x-k.x),B=a.MercatorCoordinate.fromLngLat(y);B.y=a.clamp(B.y,-1+Lr,1-Lr);const F=B.toLngLat(),I=f.project(F.lng,F.lat),L=a.MercatorCoordinate.fromLngLat(F);L.x+=Lr;const N=L.toLngLat(),j=f.project(N.lng,N.lat),K=Gs(j.x-I.x,j.y-I.y,O),J=a.MercatorCoordinate.fromLngLat(F);J.y+=Lr;const Y=J.toLngLat(),ie=f.project(Y.lng,Y.lat),te=Gs(ie.x-I.x,ie.y-I.y,O),le=Math.abs(K.x)/Math.abs(te.y),Te=a.identity([]);a.rotateZ(Te,Te,-O*(1-(E?0:v)));const oe=a.identity([]);return a.scale(oe,oe,[1,1-(1-le)*v,1]),oe[4]=-te.x/te.y*v,a.rotateZ(oe,oe,O),a.multiply(oe,Te,oe),oe}(l.projection,0,l.center,o,r),d=Sc(l);return a.scale(h,h,[d,d,1]),h}function Sc(l){const r=l.projection,o=js(l.projection,l.zoom,l.width,l.height),h=Mc(r,l.center),d=Mc(r,a.LngLat.convert(r.center));return Math.pow(2,h*o+(1-o)*d)}function js(l,r,o,h,d=1/0){const f=l.range;if(!f)return 0;const g=Math.min(d,Math.max(o,h)),y=Math.log(g/1024)/Math.LN2;return a.smoothstep(f[0]+y,f[1]+y,r)}const Lr=1/4e4;function Mc(l,r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=new a.LngLat(r.lng-180*Lr,o),d=new a.LngLat(r.lng+180*Lr,o),f=l.project(h.lng,o),g=l.project(d.lng,o),y=a.MercatorCoordinate.fromLngLat(h),v=a.MercatorCoordinate.fromLngLat(d),E=g.x-f.x,T=g.y-f.y,A=v.x-y.x,k=v.y-y.y,R=Math.sqrt((A*A+k*k)/(E*E+T*T));return Math.log(R)/Math.LN2}function Gs(l,r,o){const h=Math.cos(o),d=Math.sin(o);return{x:l*h-r*d,y:l*d+r*h}}class ro{constructor(r,o,h,d,f,g,y){this.tileSize=512,this._renderWorldCopies=f===void 0||f,this._minZoom=r||0,this._maxZoom=o||22,this._minPitch=h??0,this._maxPitch=d??60,this.setProjection(g),this.setMaxBounds(y),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Us,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Ns,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const r=new ro(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return r._elevation=this._elevation,r._centerAltitude=this._centerAltitude,r._centerAltitudeValidForE
1311xaggeration=this._centerAltitudeValidForExaggeration,r.tileSize=this.tileSize,r.mercatorFromTransition=this.mercatorFromTransition,r.width=this.width,r.height=this.height,r.cameraElevationReference=this.cameraElevationReference,r._center=this._center,r._setZoom(this.zoom),r._seaLevelZoom=this._seaLevelZoom,r.angle=this.angle,r._fov=this._fov,r._pitch=this._pitch,r._nearZ=this._nearZ,r._farZ=this._farZ,r._averageElevation=this._averageElevation,r._unmodified=this._unmodified,r._edgeInsets=this._edgeInsets.clone(),r._camera=this._camera.clone(),r._calcMatrices(),r.freezeTileCoverage=this.freezeTileCoverage,r.frustumCorners=this.frustumCorners,r}get elevation(){return this._elevation}set elevation(r){this._elevation!==r&&(this._elevation=r,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(r,o=!1){const h=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||h)&&this._updateCameraOnTerrain(),(r||h)&&this._constrainCamera(o),this._calcMatrices()}getProjection(){return a.pick(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};const o=this.projection?this.getProjection():void 0;this.projection=a.getProjection(this.projectionOptions);const h=!Se(o,this.getProjection());return h&&this._calcMatrices(),this.mercatorFromTransition=!1,h}setMercatorFromTransition(){const r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=a.getProjection({name:"mercator"});const o=r!==this.projection.name;return o&&this._calcMatrices(),o}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(r){r===void 0?r=!0:r===null&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get cameraWorldSize(){const r=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(r))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return a.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.Point(this.width,this.height)}get bearing(){return a.wrap(this.rotation,-180,180)}set bearing(r){this.rotation=r}get rotation(){return-this.angle/Math.PI*180}set rotation(r){const o=-r*Math.PI/180;var h;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=(h=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(h[1]=0,h[2]=0),h[0]=1,h[3]=1,h),function(d,f,g){var y=f[0],v=f[1],E=f[2],T=f[3],A=Math.sin(g),k=Math.cos(g);d[0]=y*k+E*A,d[1]=v*k+T*A,d[2]=y*-A+E*k,d[3]=v*-A+T*k}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const o=a.clamp(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const r=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/r)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=a.degToRad(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(r){this._averageElevation=r,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(r){const o=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._setZoom(o),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(r){this._zoom=r,this.scale=this.zoomScale(r),this.tileZoom=Math.floor(r),this.zoomFraction=r-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForE
vendor: 11,677 bytes, line 1311
1311xaggeration=void 0);const r=this._elevation;this._centerAltitude=r.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=r.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const r=this._elevation,o=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],h=this.horizonLineFromTop();let d=0,f=0;for(let g=0;g<o.length;g++){const y=new a.Point(o[g][0]*this.width,h+o[g][1]*(this.height-h)),v=r.pointCoordinate(y);if(!v)continue;const E=1/Math.hypot(v[0]-this._camera.position[0],v[1]-this._camera.position[1]);d+=v[3]*E,f+=E}return f===0?NaN:d/f}get center(){return this._center}set center(r){r.lat===this._center.lat&&r.lng===this._center.lng||(this._unmodified=!1,this._center=r,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const r=this._seaLevelZoom,o=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),h=this.pixelsPerMeter/this.worldSize*o,d=this._mercatorZfromZoom(r),f=this._mercatorZfromZoom(this._maxZoom),g=Math.max(d-h,f);this._setZoom(this._zoomFromMercatorZ(g))}get padding(){return this._edgeInsets.toJSON()}set padding(r){this._edgeInsets.equals(r)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,r,1),this._calcMatrices())}computeZoomRelativeTo(r){const o=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,r.toAltitude()));let h;h=r.z<this._camera.position[2]?[o.x,o.y,o.z]:[r.x,r.y,r.z];const d=a.length(a.sub([],this._camera.position,h));return a.clamp(this._zoomFromMercatorZ(d),this._minZoom,this._maxZoom)}setFreeCameraOptions(r){if(!this.height||!r.position&&!r.orientation)return;this._updateCameraState();let o=!1;if(r.orientation&&!a.exactEquals(r.orientation,this._camera.orientation)&&(o=this._setCameraOrientation(r.orientation)),r.position){const h=[r.position.x,r.position.y,r.position.z];a.exactEquals$1(h,this._camera.position)||(this._setCameraPosition(h),o=!0)}o&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const r=this._camera.position,o=new Ec;return o.position=new a.MercatorCoordinate(r[0],r[1],r[2]),o.orientation=this._camera.orientation,o._elevation=this.elevation,o._renderWorldCopies=this.renderWorldCopies,o}_setCameraOrientation(r){if(!a.length$1(r))return!1;a.normalize$1(r,r);const o=a.transformQuat([],[0,0,-1],r),h=a.transformQuat([],[0,-1,0],r);if(h[2]<0)return!1;const d=qo(o,h);return!!d&&(this._camera.orientation=d,!0)}_setCameraPosition(r){const o=this.zoomScale(this.minZoom)*this.tileSize,h=this.zoomScale(this.maxZoom)*this.tileSize,d=this.cameraToCenterDistance;r[2]=a.clamp(r[2],d/h,d/o),this._camera.position=r}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(r){return this._edgeInsets.equals(r)}interpolatePadding(r,o,h){this._unmodified=!1,this._edgeInsets.interpolate(r,o,h),this._constrain(),this._calcMatrices()}coveringZoomLevel(r){const o=(r.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/r.tileSize));return Math.max(0,o)}getVisibleUnwrappedCoordinates(r){const o=[new a.UnwrappedTileID(0,r)];if(this.renderWorldCopies){const h=this.pointCoordinate(new a.Point(0,0)),d=this.pointCoordinate(new a.Point(this.width,0)),f=this.pointCoordinate(new a.Point(this.width,this.height)),g=this.pointCoordinate(new a.Point(0,this.height)),y=Math.floor(Math.min(h.x,d.x,f.x,g.x)),v=Math.floor(Math.max(h.x,d.x,f.x,g.x)),E=1;for(let T=y-E;T<=v+E;T++)T!==0&&o.push(new a.UnwrappedTileID(T,r))}return o}coveringTiles(r){let o=this.coveringZoomLevel(r);const h=o,d=this.elevation&&!r.isTerrainDEM,f=this.projection.name==="mercator";if(r.minzoom!==void 0&&o<r.minzoom)return[];r.maxzoom!==void 0&&o>r.maxzoom&&(o=r.maxzoom);const g=this.locationCoordinate(this.center),y=this.center.lat,v=1<<o,E=[v*g.x,v*g.y,0],T=this.projection.name==="globe",A=!T,k=a.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o,A),R=T?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),O=v*a.mercatorZfromAltitude(1,this.center.lat),B=this._camera.position[2]/a.mercatorZfromAltitude(1,this.center.lat),F=[v*R.x,v*R.y,B*(A?1:O)],I=this.cameraToCenterDistance/r.tileSize*(r.roundZoom?1:.502),L=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?o:0,N=r.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,j=r.isTerrainDEM?-N:this._elevation?this._elevation.getMinElevationBelowMSL():0,K=this.projection.isReprojectedInTileSpace?Sc(this):1,J=ae=>{const Me=new a.MercatorCoordinate(ae.x+25e-6,ae.y,ae.z),ve=new a.MercatorCoordinate(ae.x,ae.y+25e-6,ae.z),Ae=ae.toLngLat(),Ge=Me.toLngLat(),Xe=ve.toLngLat(),Ve=this.locationCoordinate(Ae),qe=this.locationCoordinate(Ge),lt=this.locationCoordinate(Xe),ot=Math.hypot(qe.x-Ve.x,qe.y-Ve.y),je=Math.hypot(lt.x-Ve.x,lt.y-Ve.y);return Math.sqrt(ot*je)*K/25e-6},Y=ae=>{const _e=N,Me=j;return{aabb:a.tileAABB(this,v,0,0,0,ae,Me,_e,this.projection),zoom:0,x:0,y:0,minZ:Me,maxZ:_e,wrap:ae,fullyVisible:!1}},ie=[];let te=[];const le=o,Te=r.reparseOverscaled?h:o,oe=ae=>ae*ae,ge=oe((B-this._centerAltitude)*O),he=ae=>{if(!this._elevation||!ae.tileID||!f)return;const _e=this._elevation.getMinMaxForTile(ae.tileID),Me=ae.aabb;_e?(Me.min[2]=_e.min,Me.max[2]=_e.max,Me.center[2]=(Me.min[2]+Me.max[2])/2):(ae.shouldSplit=we(ae),ae.shouldSplit||(Me.min[2]=Me.max[2]=Me.center[2]=this._centerAltitude))},we=ae=>{if(ae.zoom<L)return!0;if(ae.zoom===le)return!1;if(ae.shouldSplit!=null)return ae.shouldSplit;const _e=ae.aabb.distanceX(F),Me=ae.aabb.distanceY(F);let ve=ge,Ae=1;if(T){ve=oe(ae.aabb.distanceZ(F));const Ve=Math.pow(2,ae.zoom),qe=a.latFromMercatorY((ae.y+1)/Ve),lt=a.latFromMercatorY(ae.y/Ve),ot=Math.min(Math.max(y,qe),lt),je=a.circumferenceAtLatitude(ot)/a.circumferenceAtLatitude(y);if(Ae=ot===y?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,je/this._mercatorScaleRatio),this.zoom<=a.GLOBE_ZOOM_THRESHOLD_MIN&&ae.zoom===le-1&&je>=.9)return!0}else if(d&&(ve=oe(ae.aabb.distanceZ(F)*O)),this.projection.isReprojectedInTileSpace&&h<=5){const Ve=Math.pow(2,ae.zoom),qe=J(new a.MercatorCoordinate((ae.x+.5)/Ve,(ae.y+.5)/Ve));Ae=qe>.85?1:qe}const Ge=_e*_e+Me*Me+ve,Xe=oe((1<<le-ae.zoom)*I*Ae*((Ve,qe)=>{if(qe*oe(.707)<Ve)return 1;const lt=Math.sqrt(qe/Ve);return lt/(1.4144271570014144+(Math.pow(1.1,lt-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(ve,ge),Ge));return Ge<Xe};if(this.renderWorldCopies)for(let ae=1;ae<=3;ae++)ie.push(Y(-ae)),ie.push(Y(ae));for(ie.push(Y(0));ie.length>0;){const ae=ie.pop(),_e=ae.x,Me=ae.y;let ve=ae.fullyVisible;if(!ve){const Ae=ae.aabb.intersects(k);if(Ae===0)continue;ve=Ae===2}if(ae.zoom!==le&&we(ae))for(let Ae=0;Ae<4;Ae++){const Ge=(_e<<1)+Ae%2,Xe=(Me<<1)+(Ae>>1),Ve={aabb:f?ae.aabb.quadrant(Ae):a.tileAABB(this,v,ae.zoom+1,Ge,Xe,ae.wrap,ae.minZ,ae.maxZ,this.projection),zoom:ae.zoom+1,x:Ge,y:Xe,wrap:ae.wrap,fullyVisible:ve,tileID:void 0,shouldSplit:void 0,minZ:ae.minZ,maxZ:ae.maxZ};d&&!T&&(Ve.tileID=new a.OverscaledTileID(ae.zoom+1===le?Te:ae.zoom+1,ae.wrap,ae.zoom+1,Ge,Xe),he(Ve)),ie.push(Ve)}else{const Ae=ae.zoom===le?Te:ae.zoom;if(r.minzoom&&r.minzoom>Ae)continue;const Ge=E[0]-(.5+_e+(ae.wrap<<ae.zoom))*(1<<o-ae.zoom),Xe=E[1]-.5-Me,Ve=ae.tileID?ae.tileID:new a.OverscaledTileID(Ae,ae.wrap,ae.zoom,_e,Me);te.push({tileID:Ve,distanceSq:Ge*Ge+Xe*Xe})}}if(this.fogCullDistSq){const ae=this.fogCullDistSq,_e=this.horizonLineFromTop();te=te.filter(Me=>{const ve=[0,0,0,1],Ae=[a.EXTENT,a.EXTENT,0,1],Ge=this.calculateFogTileMatrix(Me.tileID.toUnwrapped());a.transformMat4$1(ve,ve,Ge),a.transformMat4$1(Ae,Ae,Ge);const Xe=a.getAABBPointSquareDist(ve,Ae);if(Xe===0)return!0;let Ve=!1;const qe=this._elevation;if(qe&&Xe>ae&&_e!==0){const lt=this.calculateProjMatrix(Me.tileID.toUnwrapped());let ot;r.isTerrainDEM||(ot=qe.getMinMaxForTile(Me.tileID)),ot||(ot={min:j,max:N});const je=a.furthestTileCorner(this.rotation),wt=[je[0]*a.EXTENT,je[1]*a.EXTENT,ot.max];a.transformMat4(wt,wt,lt),Ve=(1-wt[1])*this.height*.5<_e}return Xe<ae||Ve})}return te.sort((ae,_e)=>ae.distanceSq-_e.distanceSq).map(ae=>ae.tileID)}resize(r,o){this.width=r,this.height=o,this.pixelsToGLUnits=[2/r,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const o=a.clamp(r.lat,-a.MAX_MERCATOR_LATITUDE,a.MAX_MERCATOR_LATITUDE),h=this.projection.project(r.lng,o);return new a.Point(h.x*this.worldSize,h.y*this.worldSize)}unproject(r){return this.projection.unproject(r.x/this.worldSize,r.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/a.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,o){let h,d;const f=this.centerPoint;if(this.projection.name==="globe"){const y=this.worldSize;h=(o.x-f.x)/y,d=(o.y-f.y)/y}else{const y=this.pointCoordinate(o),v=this.pointCoordinate(f);h=y.x-v.x,d=y.y-v.y}const g=this.locationCoordinate(r);this.setLocation(new a.MercatorCoordinate(g.x-h,g.y-d))}setLocation(r){this.center=this.coordinateLocation(r),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(r){return this.projection.locationPoint(this,r)}locationPoint3D(r){return this.projection.locationPoint(this,r,!0)}pointLocation(r){return this.coordinateLocation(this.pointCoordinate(r))}pointLocation3D(r){return this.coordinateLocation(this.pointCoordinate3D(r))}locationCoordinate(r,o){const h=o?a.mercatorZfromAltitude(o,r.lat):void 0,d=this.projection.project(r.lng,r.lat);return new a.MercatorCoordinate(d.x,d.y,h)}coordinateLocation(r){return this.projection.unproject(r.x,r.y)}pointRayIntersection(r,o){const h=o??this._centerAltitude,d=[r.x,r.y,0,1],f=[r.x,r.y,1,1];a.transformMat4$1(d,d,this.pixelMatrixInverse),a.transformMat4$1(f,f,this.pixelMatrixInverse);const g=f[3];a.scale$1(d,d,1/d[3]),a.scale$1(f,f,1/g);const y=d[2],v=f[2];return{p0:d,p1:f,t:y===v?0:(h-y)/(v-y)}}screenPointToMercatorRay(r){const o=[r.x,r.y,0,1],h=[r.x,r.y,1,1];return a.transformMat4$1(o,o,this.pixelMatrixInverse),a.transformMat4$1(h,h,this.pixelMatrixInverse),a.scale$1(o,o,1/o[3]),a.scale$1(h,h,1/h[3]),o[2]=a.mercatorZfromAltitude(o[2],this._center.lat)*this.worldSize,h[2]=a.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,a.scale$1(o,o,1/this.worldSize),a.scale$1(h,h,1/this.worldSize),new a.Ray([o[0],o[1],o[2]],a.normalize([],a.sub([],h,o)))}rayIntersectionCoordinate(r){const{p0:o,p1:h,t:d}=r,f=a.mercatorZfromAltitude(o[2],this._center.lat),g=a.mercatorZfromAltitude(h[2],this._center.lat);return new a.MercatorCoordinate(a.number(o[0],h[0],d)/this.worldSize,a.number(o[1],h[1],d)/this.worldSize,a.number(f,g,d))}pointCoordinate(r,o=this._centerAltitude){return this.projection.pointCoordinate(this,r.x,r.y,o)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let o=this.projection.pointCoordinate3D(this,r.x,r.y);if(o)return new a.MercatorCoordinate(o[0],o[1],o[2]);let h=0,d=this.horizonLineFromTop();if(r.y>d)return this.pointCoordinate(r);const f=.02*d,g=r.clone();for(let y=0;y<10&&d-h>f;
vendor: 4,801 bytes, line 1311
1311y++){g.y=a.number(h,d,.66);const v=this.projection.pointCoordinate3D(this,g.x,g.y);v?(d=g.y,o=v):h=g.y}return o?new a.MercatorCoordinate(o[0],o[1],o[2]):this.pointCoordinate(r)}isPointAboveHorizon(r){return this.projection.isPointAboveHorizon(this,r)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(r);const o=this.pointCoordinate(r);return o.y>=0&&o.y<=1}_coordinatePoint(r,o){const h=o&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,d=[r.x*this.worldSize,r.y*this.worldSize,h+r.toAltitude(),1];return a.transformMat4$1(d,d,this.pixelMatrix),d[3]>0?new a.Point(d[0]/d[3],d[1]/d[3]):new a.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:r,left:o}=this._edgeInsets,h=this.height-this._edgeInsets.bottom,d=this.width-this._edgeInsets.right,f=this.pointLocation3D(new a.Point(o,r)),g=this.pointLocation3D(new a.Point(d,r)),y=this.pointLocation3D(new a.Point(d,h)),v=this.pointLocation3D(new a.Point(o,h));let E=Math.min(f.lng,g.lng,y.lng,v.lng),T=Math.max(f.lng,g.lng,y.lng,v.lng),A=Math.min(f.lat,g.lat,y.lat,v.lat),k=Math.max(f.lat,g.lat,y.lat,v.lat);const R=Math.pow(2,-this.zoom)/16*270,O=this.projection.name==="globe"?1:4,B=(F,I,L,N,j)=>{const K=(F+L)/2,J=(I+N)/2,Y=new a.Point(K,J),{lng:ie,lat:te}=this.pointLocation3D(Y),le=Math.max(0,E-ie,A-te,ie-T,te-k);E=Math.min(E,ie),T=Math.max(T,ie),A=Math.min(A,te),k=Math.max(k,te),(j<O||le>R)&&(B(F,I,K,J,j+1),B(K,J,L,N,j+1))};if(B(o,r,d,r,1),B(d,r,d,h,1),B(d,h,o,h,1),B(o,h,o,r,1),this.projection.name==="globe"){const[F,I]=a.polesInViewport(this);F?(k=90,T=180,E=-180):I&&(A=-90,T=180,E=-180)}return new a.LngLatBounds(new a.LngLat(E,A),new a.LngLat(T,k))}_getBoundsRectangular(r,o){const{top:h,left:d}=this._edgeInsets,f=this.height-this._edgeInsets.bottom,g=this.width-this._edgeInsets.right,y=new a.Point(d,h),v=new a.Point(g,h),E=new a.Point(g,f),T=new a.Point(d,f);let A=this.pointCoordinate(y,r),k=this.pointCoordinate(v,r);const R=this.pointCoordinate(E,o),O=this.pointCoordinate(T,o),B=(F,I)=>(I.y-F.y)/(I.x-F.x);return A.y>1&&k.y>=0?A=new a.MercatorCoordinate((1-O.y)/B(O,A)+O.x,1):A.y<0&&k.y<=1&&(A=new a.MercatorCoordinate(-O.y/B(O,A)+O.x,0)),k.y>1&&A.y>=0?k=new a.MercatorCoordinate((1-R.y)/B(R,k)+R.x,1):k.y<0&&A.y<=1&&(k=new a.MercatorCoordinate(-R.y/B(R,k)+R.x,0)),new a.LngLatBounds().extend(this.coordinateLocation(A)).extend(this.coordinateLocation(k)).extend(this.coordinateLocation(O)).extend(this.coordinateLocation(R))}_getBoundsRectangularTerrain(){const r=this.elevation;if(!r.visibleDemTiles.length||r.isUsingMockSource())return this._getBoundsRectangular(0,0);const o=r.visibleDemTiles.reduce((h,d)=>{if(d.dem){const f=d.dem.tree;h.min=Math.min(h.min,f.minimums[0]),h.max=Math.max(h.max,f.maximums[0])}return h},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(o.min*r.exaggeration(),o.max*r.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(r=!0){const o=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,h=this.height/2-o*(1-this._horizonShift);return r?Math.max(0,h):h}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-a.MAX_MERCATOR_LATITUDE,this.maxLat=a.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=a.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=a.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=a.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=a.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(r,o){return this.projection.createTileMatrix(this,o,r)}calculateDistanceTileData(r){const o=r.key,h=this._distanceTileDataCache;if(h[o])return h[o];const d=r.canonical,f=1/this.height,g=this.cameraWorldSize,y=g/this.zoomScale(d.z),v=(d.x+Math.pow(2,d.z)*r.wrap)*y,E=d.y*y,T=this.point;T.x*=g/this.worldSize,T.y*=g/this.worldSize;const A=this.angle,k=Math.sin(-A),R=-Math.cos(-A);return h[o]={bearing:[k,R],center:[(T.x-v)*f,(T.y-E)*f],scale:y/a.EXTENT*f},h[o]}calculateFogTileMatrix(r){const o=r.key,h=this._fogTileMatrixCache;if(h[o])return h[o];const d=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,r);return a.multiply(d,this.worldToFogMatrix,d),h[o]=new Float32Array(d),h[o]}calculateProjMatrix(r,o=!1){const h=r.key,d=o?this._alignedProjMatrixCache:this._projMatrixCache;
vendor: 10,126 bytes, line 1311
1311if(d[h])return d[h];const f=this.calculatePosMatrix(r,this.worldSize);return a.multiply(f,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:o?this.alignedProjMatrix:this.projMatrix,f),d[h]=new Float32Array(f),d[h]}calculatePixelsToTileUnitsMatrix(r){const o=r.tileID.key,h=this._pixelsToTileUnitsCache;if(h[o])return h[o];const d=function(f,g){const{scale:y}=f.tileTransform,v=y*a.EXTENT/(f.tileSize*Math.pow(2,g.zoom-f.tileID.overscaledZ+f.tileID.canonical.z));return E=new Float32Array(4),k=(T=g.inverseAdjustmentMatrix)[1],R=T[2],O=T[3],F=(A=[v,v])[1],E[0]=T[0]*(B=A[0]),E[1]=k*B,E[2]=R*F,E[3]=O*F,E;var E,T,A,k,R,O,B,F}(r,this);return h[o]=d,h[o]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const r=1/this.worldSize,o=a.fromScaling([],[r,r,r]);return a.multiply(o,o,this.globeMatrix),o}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const r=this._elevation;this._updateCameraState();const o=a.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,h=this._computeCameraPosition(o),d=this._camera.forward(),f=a.mercatorZfromAltitude(1,this._center.lat);h[2]/=f,d[2]/=f,a.normalize(d,d);const g=r.raycast(h,d,r.exaggeration());if(g){const y=a.scaleAndAdd([],h,d,g),v=new a.MercatorCoordinate(y[0],y[1],a.mercatorZfromAltitude(y[2],a.latFromMercatorY(y[1]))),E=(v.z+a.length([v.x-h[0],v.y-h[1],v.z-h[2]*f]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(E),this._centerAltitude=v.toAltitude(),this._center=this.coordinateLocation(v),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(r=!1){if(!this._elevation)return;const o=this._elevation,h=a.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,d=this._computeCameraPosition(h),f=o.getAtPointOrZero(new a.MercatorCoordinate(...d)),g=this.pixelsPerMeter/this.worldSize*f,y=this._minimumHeightOverTerrain(),v=d[2]-g;if(v<=y)if(v<0||r){const E=this.locationCoordinate(this._center,this._centerAltitude),T=[d[0],d[1],E.z-d[2]],A=a.length(T);T[2]-=(y-v)/this._pixelsPerMercatorPixel;const k=a.length(T);if(k===0)return;a.scale$2(T,T,A/k*this._pixelsPerMercatorPixel),this._camera.position=[d[0],d[1],E.z*this._pixelsPerMercatorPixel-T[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const r=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||r){const k=this.center;return k.lat=a.clamp(k.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!r)&&(k.lng=a.clamp(k.lng,this.minLng,this.maxLng)),this.center=k,void(this._constraining=!1)}const o=this._unmodified,{x:h,y:d}=this.point;let f=0,g=h,y=d;const v=this.width/2,E=this.height/2,T=this.worldMinY*this.scale,A=this.worldMaxY*this.scale;if(d-E<T&&(y=T+E),d+E>A&&(y=A-E),A-T<this.height&&(f=Math.max(f,this.height/(A-T)),y=(A+T)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const k=this.worldMinX*this.scale,R=this.worldMaxX*this.scale,O=this.worldSize/2-(k+R)/2;g=(h+O+this.worldSize)%this.worldSize-O,g-v<k&&(g=k+v),g+v>R&&(g=R-v),R-k<this.width&&(f=Math.max(f,this.width/(R-k)),g=(R+k)/2)}g===h&&y===d||(this.center=this.unproject(new a.Point(g,y))),f&&(this.zoom+=this.scaleZoom(f)),this._constrainCamera(),this._unmodified=o,this._constraining=!1}_minZoomForBounds(){let r=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(r=Math.max(r,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),r}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const r=this.centerOffset,o=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=a.mercatorZfromAltitude(1,this.center.lat)/a.mercatorZfromAltitude(1,a.GLOBE_SCALE_MATCH_LATITUDE));const h=js(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,h),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const d=this.projection.zAxisUnit==="meters"?o:1,f=this._camera.getWorldToCamera(this.worldSize,d),g=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);g[8]=2*-r.x/this.width,g[9]=2*r.y/this.height;let y=a.mul([],g,f);if(this.projection.isReprojectedInTileSpace){const J=this.locationCoordinate(this.center),Y=a.identity([]);a.translate(Y,Y,[J.x*this.worldSize,J.y*this.worldSize,0]),a.multiply(Y,Y,io(this)),a.translate(Y,Y,[-J.x*this.worldSize,-J.y*this.worldSize,0]),a.multiply(y,y,Y),this.inverseAdjustmentMatrix=function(ie){const te=io(ie,!0);return Le([],[te[0],te[1],te[4],te[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=a.scale([],y,[this.worldSize,this.worldSize,this.worldSize/d,1]),this.projMatrix=y,this.invProjMatrix=a.invert(new Float64Array(16),this.projMatrix);const v=a.invert([],g);this.frustumCorners=a.FrustumCorners.fromInvProjectionMatrix(v,this.horizonLineFromTop(),this.height);const E=new Float32Array(16);a.identity(E),a.scale(E,E,[1,-1,1]),a.rotateX(E,E,this._pitch),a.rotateZ(E,E,this.angle);const T=a.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),A=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;T[8]=2*-r.x/this.width,T[9]=2*(r.y+A)/this.height,this.skyboxMatrix=a.multiply(E,T,E);const k=this.point,R=k.x,O=k.y,B=this.width%2/2,F=this.height%2/2,I=Math.cos(this.angle),L=Math.sin(this.angle),N=R-Math.round(R)+I*B+L*F,j=O-Math.round(O)+I*F+L*B,K=new Float64Array(y);if(a.translate(K,K,[N>.5?N-1:N,j>.5?j-1:j,0]),this.alignedProjMatrix=K,y=a.create(),a.scale(y,y,[this.width/2,-this.height/2,1]),a.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=a.create(),a.scale(y,y,[1,-1,1]),a.translate(y,y,[-1,-1,0]),a.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},y=a.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=y,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=a.calculateGlobeMatrix(this);const J=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=a.transformMat4(J,J,f),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=y;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const r=this.cameraWorldSizeForFog,o=this.cameraPixelsPerMeter,h=this._camera.position,d=1/this.height/this._pixelsPerMercatorPixel,f=[r,r,o];a.scale$2(f,f,d),a.scale$2(h,h,-1),a.multiply$2(h,h,f);const g=a.create();a.translate(g,g,h),a.scale(g,g,f),this.mercatorFogMatrix=g,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,o,d)}_computeCameraPosition(r){const o=(r=r||this.pixelsPerMeter)/this.pixelsPerMeter,h=this._camera.forward(),d=this.point,f=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*o-r/this.worldSize*this._centerAltitude;return[d.x/this.worldSize-h[0]*f,d.y/this.worldSize-h[1]*f,r/this.worldSize*this._centerAltitude-h[2]*f]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){const o=this._maxCameraBoundsDistance()*Math.cos(this._pitch),h=this._camera.position[2],d=r[2];let f=1;this.projection.wrap&&(this.center=this.center.wrap()),d>0&&(f=Math.min((o-h)/d,1)),this._camera.position=a.scaleAndAdd([],this._camera.position,r,f),this._updateStateFromCamera()}_updateStateFromCamera(){const r=this._camera.position,o=this._camera.forward(),{pitch:h,bearing:d}=this._camera.getPitchBearing(),f=a.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,g=this._mercatorZfromZoom(this._maxZoom)*Math.cos(a.degToRad(this._maxPitch)),y=Math.max((r[2]-f)/Math.cos(h),g),v=this._zoomFromMercatorZ(y);a.scaleAndAdd(r,r,o,y),this._pitch=a.clamp(h,a.degToRad(this.minPitch),a.degToRad(this.maxPitch)),this.angle=a.wrap(d,-Math.PI,Math.PI),this._setZoom(a.clamp(v,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new a.MercatorCoordinate(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(r){return Math.pow(2,r)*this.tileSize}_mercatorZfromZoom(r){return this.cameraToCenterDistance/this._worldSizeFromZoom(r)}_minimumHeightOverTerrain(){const r=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(r)}_zoomFromMercatorZ(r){return this.scaleZoom(this.cameraToCenterDistance/(r*this.tileSize))}zoomFromMercatorZAdjusted(r){let o=0,h=a.GLOBE_ZOOM_THRESHOLD_MAX,d=0,f=1/0;for(;h-o>1e-6&&h>o;){const g=o+.5*(h-o),y=this.tileSize*Math.pow(2,g),v=this.getCameraToCenterDistance(this.projection,g,y),E=this.scaleZoom(v/(r*this.tileSize)),T=Math.abs(g-E);T<f&&(f=T,d=g),g<E?o=g:h=g}return d}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(a.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(r,o){const h=Math.min(r.x,o.x),d=Math.max(r.x,o.x),f=Math.min(r.y,o.y),g=Math.max(r.y,o.y);if(f<this.horizonLineFromTop(!1))return!0;if(this.projection.name!=="mercator")return!1;const y=[new a.Point(h,f),new a.Point(d,g),new a.Point(h,g),new a.Point(d,f)],v=this.renderWorldCopies?-3:0,E=this.renderWorldCopies?4:1;for(const T of y){const A=this.pointRayIntersection(T);if(A.t<0)return!0;const k=this.rayIntersectionCoordinate(A);if(k.x<v||k.y<0||k.x>E||k.y>1)return!0}return!1}
1311isHorizonVisible(){return this.pitch+a.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new a.Point(0,0),new a.Point(this.width,this.height))}zoomDeltaToMovement(r,o){const h=a.length(a.sub([],this._camera.position,r)),d=this._zoomFromMercatorZ(h)+o;return h-this._mercatorZfromZoom(d)}getCameraPoint(){if(this.projection.name==="globe"){const r=function([o,h,d],f){const g=[o,h,d,1];a.transformMat4$1(g,g,f);const y=g[3]=Math.max(g[3],1e-6);return g[0]/=y,g[1]/=y,g[2]/=y,g}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new a.Point(r[0],r[1])}{const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.Point(0,r))}}getCameraToCenterDistance(r,o=this.zoom,h=this.worldSize){const d=js(r,o,this.width,this.height,1024),f=r.pixelSpaceConversion(this.center.lat,h,d);return .5/Math.tan(.5*this._fov)*this.height*f}getWorldToCameraMatrix(){const r=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&a.multiply(r,r,this.globeMatrix),r}}function no(l,r){let o=!1,h=null;const d=()=>{h=null,o&&(l(),h=setTimeout(d,r),o=!1)};return()=>(o=!0,h||d(),h)}class rl{constructor(r){this._hashName=r&&encodeURIComponent(r),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=no(this._updateHashUnthrottled.bind(this),300)}addTo(r){return this._map=r,a.window.addEventListener("hashchange",this._onHashChange,!1),r.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),a.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const r=this._map;if(!r)return"";const o=Wo(r);if(this._hashName){const h=this._hashName;let d=!1;const f=a.window.location.hash.slice(1).split("&").map(g=>{const y=g.split("=")[0];return y===h?(d=!0,`${y}=${o}`):g}).filter(g=>g);return d||f.push(`${h}=${o}`),`#${f.join("&")}`}return`#${o}`}_getCurrentHash(){const r=a.window.location.hash.replace("#","");if(this._hashName){let o;return r.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(o=h)}),(o&&o[1]||"").split("/")}return r.split("/")}_onHashChange(){const r=this._map;if(!r)return!1;const o=this._getCurrentHash();if(o.length>=3&&!o.some(h=>isNaN(h))){const h=r.dragRotate.isEnabled()&&r.touchZoomRotate.isEnabled()?+(o[3]||0):r.getBearing();return r.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:h,pitch:+(o[4]||0)}),!0}return!1}_updateHashUnthrottled(){const r=a.window.location.href.replace(/(#.+)?$/,this.getHashString());a.window.history.replaceState(a.window.history.state,null,r)}}function Wo(l,r){const o=l.getCenter(),h=Math.round(100*l.getZoom())/100,d=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),f=Math.pow(10,d),g=Math.round(o.lng*f)/f,y=Math.round(o.lat*f)/f,v=l.getBearing(),E=l.getPitch();let T=r?`/${g}/${y}/${h}`:`${h}/${y}/${g}`;return(v||E)&&(T+="/"+Math.round(10*v)/10),E&&(T+=`/${Math.round(E)}`),T}const Xo={linearity:.3,easing:a.bezier(0,0,.3,1)},$s=a.extend({deceleration:2500,maxSpeed:1400},Xo),Zs=a.extend({deceleration:20,maxSpeed:1400},Xo),Fe=a.extend({deceleration:1e3,maxSpeed:360},Xo),ir=a.extend({deceleration:1e3,maxSpeed:90},Xo);class Ac{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,o=a.exported.now();for(;r.length>0&&o-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const o={zoom:0,bearing:0,pitch:0,pan:new a.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:f}of this._inertiaBuffer)o.zoom+=f.zoomDelta||0,o.bearing+=f.bearingDelta||0,o.pitch+=f.pitchDelta||0,f.panDelta&&o.pan._add(f.panDelta),f.around&&(o.around=f.around),f.pinchAround&&(o.pinchAround=f.pinchAround);const h=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const f=Ko(o.pan.mag(),h,a.extend({},$s,r||{}));d.offset=o.pan.mult(f.amount/o.pan.mag()),d.center=this._map.transform.center,Ho(d,f)}if(o.zoom){const f=Ko(o.zoom,h,Zs);d.zoom=this._map.transform.zoom+f.amount,Ho(d,f)}if(o.bearing){const f=Ko(o.bearing,h,Fe);
vendor: 21,442 bytes, line 1311
1311d.bearing=this._map.transform.bearing+a.clamp(f.amount,-179,179),Ho(d,f)}if(o.pitch){const f=Ko(o.pitch,h,ir);d.pitch=this._map.transform.pitch+f.amount,Ho(d,f)}if(d.zoom||d.bearing){const f=o.pinchAround===void 0?o.around:o.pinchAround;d.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),d.noMoveStart=!0,d}}function Ho(l,r){(!l.duration||l.duration<r.duration)&&(l.duration=r.duration,l.easing=r.easing)}function Ko(l,r,o){const{maxSpeed:h,linearity:d,deceleration:f}=o,g=a.clamp(l*d/(r/1e3),-h,h),y=Math.abs(g)/(f*d);return{easing:o.easing,duration:1e3*y,amount:g*(y/2)}}class hi extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h,d={}){const f=Qi(o.getCanvasContainer(),h),g=o.unproject(f);super(r,a.extend({point:f,lngLat:g,originalEvent:h},d)),this._defaultPrevented=!1,this.target=o}}class Yo extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h){const d=r==="touchend"?h.changedTouches:h.touches,f=cn(o.getCanvasContainer(),d),g=f.map(v=>o.unproject(v)),y=f.reduce((v,E,T,A)=>v.add(E.div(A.length)),new a.Point(0,0));super(r,{points:f,point:y,lngLats:g,lngLat:o.unproject(y),originalEvent:h}),this._defaultPrevented=!1}}class qs extends a.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,o,h){super(r,{originalEvent:h}),this._defaultPrevented=!1}}class nl{constructor(r,o){this._map=r,this._clickTolerance=o.clickTolerance}reset(){this._mousedownPos=void 0}wheel(r){return this._firePreventable(new qs(r.type,this._map,r))}mousedown(r,o){return this._mousedownPos=o,this._firePreventable(new hi(r.type,this._map,r))}mouseup(r){this._map.fire(new hi(r.type,this._map,r))}preclick(r){const o=a.extend({},r);o.type="preclick",this._map.fire(new hi(o.type,this._map,o))}click(r,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||(this.preclick(r),this._map.fire(new hi(r.type,this._map,r)))}dblclick(r){return this._firePreventable(new hi(r.type,this._map,r))}mouseover(r){this._map.fire(new hi(r.type,this._map,r))}mouseout(r){this._map.fire(new hi(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Yo(r.type,this._map,r))}touchmove(r){this._map.fire(new Yo(r.type,this._map,r))}touchend(r){this._map.fire(new Yo(r.type,this._map,r))}touchcancel(r){this._map.fire(new Yo(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ws{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(r){this._map.fire(new hi(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._map.fire(new hi(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,o){this.isEnabled()&&r.shiftKey&&r.button===0&&(bo(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(r,o){if(!this._active)return;const h=o,d=this._startPos,f=this._lastPos;if(!d||!f||f.equals(h)||!this._box&&h.dist(d)<this._clickTolerance)return;this._lastPos=h,this._box||(this._box=ht("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",r));const g=Math.min(d.x,h.x),y=Math.max(d.x,h.x),v=Math.min(d.y,h.y),E=Math.max(d.y,h.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${g}px,${v}px)`,this._box.style.width=y-g+"px",this._box.style.height=E-v+"px")})}mouseupWindow(r,o){if(!this._active)return;const h=this._startPos,d=o;if(h&&r.button===0){if(this.reset(),Rn(),h.x!==d.x||h.y!==d.y)return this._map.fire(new a.Event("boxzoomend",{originalEvent:r})),{cameraAnimation:f=>f.fitScreenCoordinates(h,d,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Ln(),delete this._startPos,delete this._lastPos}_fireEvent(r,o){return this._map.fire(new a.Event(r,{originalEvent:o}))}}function Xs(l,r){const o={};for(let h=0;h<l.length;h++)o[l[h].identifier]=r[h];return o}class oo{constructor(r){this.reset(),this.numTouches=r.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(r,o,h){(this.centroid||h.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=r.timeStamp),h.length===this.numTouches&&(this.centroid=function(d){const f=new a.Point(0,0);for(const g of d)f._add(g);return f.div(d.length)}(o),this.touches=Xs(h,o)))}touchmove(r,o,h){if(this.aborted||!this.centroid)return;const d=Xs(h,o);for(const f in this.touches){const g=d[f];(!g||g.dist(this.touches[f])>30)&&(this.aborted=!0)}}touchend(r,o,h){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class ol{constructor(r){this.singleTap=new oo(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(r,o,h){this.singleTap.touchstart(r,o,h)}touchmove(r,o,h){this.singleTap.touchmove(r,o,h)}touchend(r,o,h){const d=this.singleTap.touchend(r,o,h);if(d){const f=r.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(d)<30;if(f&&g||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class Nh{constructor(){this._zoomIn=new ol({numTouches:1,numTaps:2}),this._zoomOut=new ol({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,o,h){this._zoomIn.touchstart(r,o,h),this._zoomOut.touchstart(r,o,h)}touchmove(r,o,h){this._zoomIn.touchmove(r,o,h),this._zoomOut.touchmove(r,o,h)}touchend(r,o,h){const d=this._zoomIn.touchend(r,o,h),f=this._zoomOut.touchend(r,o,h);return d?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()+1,around:g.unproject(d)},{originalEvent:r})}):f?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:g.getZoom()-1,around:g.unproject(f)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Cc={0:1,2:2};class so{constructor(r){this.reset(),this._clickTolerance=r.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(r,o){return!1}_move(r,o){return{}}mousedown(r,o){if(this._lastPoint)return;const h=hn(r);this._correctButton(r,h)&&(this._lastPoint=o,this._eventButton=h)}mousemoveWindow(r,o){const h=this._lastPoint;if(h){if(r.preventDefault(),this._eventButton!=null&&function(d,f){const g=Cc[f];return d.buttons===void 0||(d.buttons&g)!==g}(r,this._eventButton))this.reset();else if(this._moved||!(o.dist(h)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(h,o)}}mouseupWindow(r){this._lastPoint&&hn(r)===this._eventButton&&(this._moved&&Rn(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sl extends so{mousedown(r,o){super.mousedown(r,o),this._lastPoint&&(this._active=!0)}_correctButton(r,o){return o===0&&!r.ctrlKey}_move(r,o){return{around:o,panDelta:o.sub(r)}}}class al extends so{_correctButton(r,o){return o===0&&r.ctrlKey||o===2}_move(r,o){const h=.8*(o.x-r.x);if(h)return this._active=!0,{bearingDelta:h}}contextmenu(r){r.preventDefault()}}class ll extends so{_correctButton(r,o){return o===0&&r.ctrlKey||o===2}_move(r,o){const h=-.5*(o.y-r.y);if(h)return this._active=!0,{pitchDelta:h}}contextmenu(r){r.preventDefault()}}class Hs{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._minTouches=1,this._clickTolerance=o.clickTolerance||1,this.reset(),a.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new a.Point(0,0)}touchstart(r,o,h){return this._calculateTransform(r,o,h)}touchmove(r,o,h){if(this._active&&!(h.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(h.length===1&&!a.isFullscreen())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return r.cancelable&&r.preventDefault(),this._calculateTransform(r,o,h)}}touchend(r,o,h){this._calculateTransform(r,o,h),this._active&&h.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,o,h){h.length>0&&(this._active=!0);const d=Xs(h,o),f=new a.Point(0,0),g=new a.Point(0,0);let y=0;for(const E in d){const T=d[E],A=this._touches[E];A&&(f._add(T),g._add(T.sub(A)),y++,d[E]=T)}if(this._touches=d,y<this._minTouches||!g.mag())return;const v=g.div(y);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:f.div(y),panDelta:v}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ht("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class Jo{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(r){}_move(r,o,h){return{}}touchstart(r,o,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([o[0],o[1]]))}touchmove(r,o,h){const d=this._firstTwoTouches;if(!d)return;r.preventDefault();const[f,g]=d,y=Qo(h,o,f),v=Qo(h,o,g);if(!y||!v)return;const E=this._aroundCenter?null:y.add(v).div(2);return this._move([y,v],E,r)}touchend(r,o,h){if(!this._firstTwoTouches)return;const[d,f]=this._firstTwoTouches,g=Qo(h,o,d),y=Qo(h,o,f);g&&y||(this._active&&Rn(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Qo(l,r,o){for(let h=0;h<l.length;h++)if(l[h].identifier===o)return r[h]}function cl(l,r){return Math.log(l/r)/Math.LN2}class zc extends Jo{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(r){this._startDistance=this._distance=r[0].dist(r[1])}_move(r,o){const h=this._distance;if(this._distance=r[0].dist(r[1]),this._active||!(Math.abs(cl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:cl(this._distance,h),pinchAround:o}}}function hl(l,r){return 180*l.angleWith(r)/Math.PI}class Pc extends Jo{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(r){this._startVector=this._vector=r[0].sub(r[1]),this._minDiameter=r[0].dist(r[1])}_move(r,o){const h=this._vector;if(this._vector=r[0].sub(r[1]),h&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:hl(this._vector,h),pinchAround:o}}_isBelowThreshold(r){this._minDiameter=Math.min(this._minDiameter,r.mag());const o=25/(Math.PI*this._minDiameter)*360,h=this._startVector;if(!h)return!1;const d=hl(r,h);return Math.abs(d)<o}}function Jr(l){return Math.abs(l.y)>Math.abs(l.x)}class kc extends Jo{constructor(r){super(),this._map=r}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(r){this._lastPoints=r,Jr(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,o,h){const d=this._lastPoints;if(!d)return;const f=r[0].sub(d[0]),g=r[1].sub(d[1]);return this._map._cooperativeGestures&&!a.isFullscreen()&&h.touches.length<3||(this._valid=this.gestureBeginsVertically(f,g,h.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:(f.y+g.y)/2*-.5})}gestureBeginsVertically(r,o,h){if(this._valid!==void 0)return this._valid;const d=r.mag()>=2,f=o.mag()>=2;if(!d&&!f)return;if(!d||!f)return this._firstMove==null&&(this._firstMove=h),h-this._firstMove<100&&void 0;const g=r.y>0==o.y>0;return Jr(r)&&Jr(o)&&g}}const Dc={panStep:100,bearingStep:15,pitchStep:10};class jh{constructor(){const r=Dc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let o=0,h=0,d=0,f=0,g=0;switch(r.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:r.shiftKey?h=-1:(r.preventDefault(),f=-1);break;case 39:r.shiftKey?h=1:(r.preventDefault(),f=1);break;case 38:r.shiftKey?d=1:(r.preventDefault(),g=-1);break;case 40:r.shiftKey?d=-1:(r.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(h=0,d=0),{cameraAnimation:y=>{const v=y.getZoom();y.easeTo({duration:300,easeId:"keyboardHandler",easing:Lc,zoom:o?Math.round(v)+o*(r.shiftKey?2:1):v,bearing:y.getBearing()+h*this._bearingStep,pitch:y.getPitch()+d*this._pitchStep,offset:[-f*this._panStep,-g*this._panStep],center:y.getCenter()},{originalEvent:r})}}}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 Lc(l){return l*(2-l)}const ul=4.000244140625;class Rc{constructor(r,o){this._map=r,this._el=r.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||a.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let o=r.deltaMode===a.window.WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const h=a.exported.now(),d=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,o!==0&&o%ul==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),r.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=r,this._delta-=o,this._active||this._start(r)),r.preventDefault()}_onTimeout(r){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)}_start(r){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 o=Qi(this._el,r);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:o,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._map.transform;this._type==="wheel"&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const o=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(this._delta!==0){const v=this._type==="wheel"&&Math.abs(this._delta)>ul?this._wheelZoomRate:this._defaultZoomRate;let E=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&E!==0&&(E=1/E);const T=o(),A=Math.pow(2,T),k=typeof this._targetZoom=="number"?r.zoomScale(this._targetZoom):A;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=T,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o(),d=this._startZoom,f=this._easing;let g,y=!1;if(this._type==="wheel"&&d&&f){const v=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),E=f(v);g=a.number(d,h,E),v<1?this._frameId||(this._frameId=!0):y=!0}else g=h,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:g-o(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let o=a.ease;if(this._prevEase){const h=this._prevEase,d=(a.exported.now()-h.start)/h.duration,f=h.easing(d+.01)-h.easing(d),g=.27/Math.sqrt(f*f+1e-4)*.01,y=Math.sqrt(.0729-g*g);o=a.bezier(g,y,.25,1)}return this._prevEase={start:a.exported.now(),duration:r,easing:o},o}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ht("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(a.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")},200)}}class Bc{constructor(r,o){this._clickZoom=r,this._tapZoom=o}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 xi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(r,o){return r.preventDefault(),{cameraAnimation:h=>{h.easeTo({duration:300,zoom:h.getZoom()+(r.shiftKey?-1:1),around:h.unproject(o)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gh{constructor(){this._tap=new ol({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(r,o,h){this._swipePoint||(this._tapTime&&r.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=o[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(r,o,h))}touchmove(r,o,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;const d=o[0],f=d.y-this._swipePoint.y;return this._swipePoint=d,r.preventDefault(),this._active=!0,{zoomDelta:f/128}}}else this._tap.touchmove(r,o,h)}touchend(r,o,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(r,o,h)&&(this._tapTime=r.t
vendor: 6,133 bytes, line 1311
1311imeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Oc{constructor(r,o,h){this._el=r,this._mousePan=o,this._touchPan=h}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $h{constructor(r,o,h){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=o,this._mousePitch=h}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Zh{constructor(r,o,h,d){this._el=r,this._touchZoom=o,this._touchRotate=h,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-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()}}const Zi=l=>l.zoom||l.drag||l.pitch||l.rotate;class Fc extends a.Event{}class qh{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,o){const h=a.sub([],o,r);this.radius=a.length(h[2]<0?a.div([],h,this.constants):[h[0],h[1],0])}projectRay(r){a.div(r,r,this.constants),a.normalize(r,r),a.mul$1(r,r,this.constants);const o=a.scale$2([],r,this.radius);if(o[2]>0){const h=a.scale$2([],[0,0,1],a.dot(o,[0,0,1])),d=a.scale$2([],a.normalize([],[o[0],o[1],0]),this.radius),f=a.add([],o,a.scale$2([],a.sub([],a.add([],d,h),o),2));o[0]=f[0],o[1]=f[1]}return o}}function rr(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}class dr{constructor(r,o){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ac(r),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new qh,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(o),a.bindAll(["handleEvent","handleWindowEvent"],this);const h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[a.window.document,"mousemove",{capture:!0}],[a.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[a.window,"blur",void 0]];for(const[d,f,g]of this._listeners)d.addEventListener(f,d===a.window.document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[r,o,h]of this._listeners)r.removeEventListener(o,r===a.window.document?this.handleWindowEvent:this.handleEvent,h)}_addDefaultHandlers(r){const o=this._map,h=o.getCanvasContainer();this._add("mapEvent",new nl(o,r));const d=o.boxZoom=new Ic(o,r);this._add("boxZoom",d);const f=new Nh,g=new xi;o.doubleClickZoom=new Bc(g,f),this._add("tapZoom",f),this._add("clickZoom",g);const y=new Gh;this._add("tapDragZoom",y);const v=o.touchPitch=new kc(o);this._add("touchPitch",v);const E=new al(r),T=new ll(r);o.dragRotate=new $h(r,E,T),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]);const A=new sl(r),k=new Hs(o,r);o.dragPan=new Oc(h,A,k),this._add("mousePan",A),this._add("touchPan",k,["touchZoom","touchRotate"]);const R=new Pc,O=new zc;o.touchZoomRotate=new Zh(h,O,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",O,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Ws(o));const B=o.scrollZoom=new Rc(o,this);this._add("scrollZoom",B,["mousePan"]);const F=o.keyboard=new jh;this._add("keyboard",F);for(const I of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])r.interactive&&r[I]&&o[I].enable(r[I])}_add(r,o,h){this._handlers.push({handlerName:r,handler:o,allowed:h}),this._handlersById[r]=o}stop(r){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Zi(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(r,o,h){for(const d in r)if(d!==h&&(!o||o.indexOf(d)<0))return!0;return!1}handleWindowEvent(r){this.handleEvent(r,`${r.type}Window`)}_getMapTouches(r){const o=[];for(const h of r)this._el.contains(h.target)&&o.push(h);return o}handleEvent(r,o){this._updatingCamera=!0;const h=r.type==="renderFrame",d=h?void 0:r,f={needsRenderFrame:!1},g={},y={},v=r.touches?this._getMapTouches(r.touches):void 0,E=v?cn(this._el,v):h?void 0:Qi(this._el,r);for(const{handlerName:k,handler:R,allowed:O}of this._handlers){if(!R.isEnabled())continue;let B;this._blockedByActive(y,O,k)?R.reset():R[o||r.type]&&(B=R[o||r.type](r,E,v),this.mergeHandlerResult(f,g,B,k,d),B&&B.needsRenderFrame&&this._triggerRe
vendor: 24,601 bytes, line 1311
1311nderFrame()),(B||R.isActive())&&(y[k]=R)}const T={};for(const k in this._previousActiveHandlers)y[k]||(T[k]=d);this._previousActiveHandlers=y,(Object.keys(T).length||rr(f))&&(this._changes.push([f,g,T]),this._triggerRenderFrame()),(Object.keys(y).length||rr(f))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:A}=f;A&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],A(this._map))}mergeHandlerResult(r,o,h,d,f){if(!h)return;a.extend(r,h);const g={handlerName:d,originalEvent:h.originalEvent||f};h.zoomDelta!==void 0&&(o.zoom=g),h.panDelta!==void 0&&(o.drag=g),h.pitchDelta!==void 0&&(o.pitch=g),h.bearingDelta!==void 0&&(o.rotate=g)}_applyChanges(){const r={},o={},h={};for(const[d,f,g]of this._changes)d.panDelta&&(r.panDelta=(r.panDelta||new a.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(r.around=d.around),d.aroundCoord!==void 0&&(r.aroundCoord=d.aroundCoord),d.pinchAround!==void 0&&(r.pinchAround=d.pinchAround),d.noInertia&&(r.noInertia=d.noInertia),a.extend(o,f),a.extend(h,g);this._updateMapTransform(r,o,h),this._changes=[]}_updateMapTransform(r,o,h){const d=this._map,f=d.transform,g=L=>[L.x,L.y,L.z];if((L=>{const N=this._eventsInProgress.drag;return N&&!this._handlersById[N.handlerName].isActive()})()&&!rr(r)){const L=f.zoom;f.cameraElevationReference="sea",f.recenterOnTerrain(),f.cameraElevationReference="ground",L!==f.zoom&&this._map._update(!0)}if(f._isCameraConstrained&&d._stop(!0),!rr(r))return void this._fireEvents(o,h,!0);let{panDelta:y,zoomDelta:v,bearingDelta:E,pitchDelta:T,around:A,aroundCoord:k,pinchAround:R}=r;f._isCameraConstrained&&(v>0&&(v=0),f._isCameraConstrained=!1),R!==void 0&&(A=R),(v||(L=>o[L]&&!this._eventsInProgress[L])("drag"))&&A&&(this._dragOrigin=g(f.pointCoordinate3D(A)),this._trackingEllipsoid.setup(f._camera.position,this._dragOrigin)),f.cameraElevationReference="sea",d._stop(!0),A=A||d.transform.centerPoint,E&&(f.bearing+=E),T&&(f.pitch+=T),f._updateCameraState();const O=[0,0,0];if(y)if(f.projection.name==="mercator"){const L=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A).dir),N=this._trackingEllipsoid.projectRay(f.screenPointToMercatorRay(A.sub(y)).dir);O[0]=N[0]-L[0],O[1]=N[1]-L[1]}else{const L=f.pointCoordinate(A);if(f.projection.name==="globe"){y=y.rotate(-f.angle);const N=f._pixelsPerMercatorPixel/f.worldSize;O[0]=-y.x*a.mercatorScale(a.latFromMercatorY(L.y))*N,O[1]=-y.y*a.mercatorScale(f.center.lat)*N}else{const N=f.pointCoordinate(A.sub(y));L&&N&&(O[0]=N.x-L.x,O[1]=N.y-L.y)}}const B=f.zoom,F=[0,0,0];if(v){const L=g(k||f.pointCoordinate3D(A)),N={dir:a.normalize([],a.sub([],L,f._camera.position))};if(N.dir[2]<0){const j=f.zoomDeltaToMovement(L,v);a.scale$2(F,N.dir,j)}}const I=a.add(O,O,F);f._translateCameraConstrained(I),v&&Math.abs(f.zoom-B)>1e-4&&f.recenterOnTerrain(),f.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(o,h,!0)}_fireEvents(r,o,h){const d=Zi(this._eventsInProgress),f=Zi(r),g={};for(const T in r){const{originalEvent:A}=r[T];this._eventsInProgress[T]||(g[`${T}start`]=A),this._eventsInProgress[T]=r[T]}!d&&f&&this._fireEvent("movestart",f.originalEvent);for(const T in g)this._fireEvent(T,g[T]);f&&this._fireEvent("move",f.originalEvent);for(const T in r){const{originalEvent:A}=r[T];this._fireEvent(T,A)}const y={};let v;for(const T in this._eventsInProgress){const{handlerName:A,originalEvent:k}=this._eventsInProgress[T];this._handlersById[A].isActive()||(delete this._eventsInProgress[T],v=o[A]||k,y[`${T}end`]=v)}for(const T in y)this._fireEvent(T,y[T]);const E=Zi(this._eventsInProgress);if(h&&(d||f)&&!E){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),A=k=>k!==0&&-this._bearingSnap<k&&k<this._bearingSnap;T?(A(T.bearing||this._map.getBearing())&&(T.bearing=0),this._map.easeTo(T,{originalEvent:v})):(this._map.fire(new a.Event("moveend",{originalEvent:v})),A(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(r,o){this._map.fire(new a.Event(r,o?{originalEvent:o}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(r=>{this._frameId=void 0,this.handleEvent(new Fc("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Tn="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ks extends a.Evented{constructor(r,o){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=o.bearingSnap,this._respectPrefersReducedMotion=o.respectPrefersReducedMotion!==!1,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(r,o){return this.jumpTo({center:r},o)}panBy(r,o,h){return r=a.Point.convert(r).mult(-1),this.panTo(this.transform.center,a.extend({offset:r},o),h)}panTo(r,o,h){return this.easeTo(a.extend({center:r},o),h)}getZoom(){return this.transform.zoom}setZoom(r,o){return this.jumpTo({zoom:r},o),this}zoomTo(r,o,h){return this.easeTo(a.extend({zoom:r},o),h)}zoomIn(r,o){return this.zoomTo(this.getZoom()+1,r,o),this}zoomOut(r,o){return this.zoomTo(this.getZoom()-1,r,o),this}getBearing(){return this.transform.bearing}setBearing(r,o){return this.jumpTo({bearing:r},o),this}getPadding(){return this.transform.padding}setPadding(r,o){return this.jumpTo({padding:r},o),this}rotateTo(r,o,h){return this.easeTo(a.extend({bearing:r},o),h)}resetNorth(r,o){return this.rotateTo(0,a.extend({duration:1e3},r),o),this}resetNorthPitch(r,o){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},r),o),this}snapToNorth(r,o){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(r,o):this}getPitch(){return this.transform.pitch}setPitch(r,o){return this.jumpTo({pitch:r},o),this}cameraForBounds(r,o){r=a.LngLatBounds.convert(r);const h=o&&o.bearing||0,d=o&&o.pitch||0,f=r.getNorthWest(),g=r.getSouthEast();return this._cameraForBounds(this.transform,f,g,h,d,o)}_extendCameraOptions(r){const o={top:0,bottom:0,right:0,left:0};if(typeof(r=a.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding=="number"){const h=r.padding;r.padding={top:h,bottom:h,right:h,left:h}}return r.padding=a.extend(o,r.padding),r}_minimumAABBFrustumDistance(r,o){const h=o.max[0]-o.min[0],d=o.max[1]-o.min[1];return h/d>r.aspect?h/(2*Math.tan(.5*r.fovX)*r.aspect):d/(2*Math.tan(.5*r.fovY)*r.aspect)}_cameraForBoundsOnGlobe(r,o,h,d,f,g){const y=r.clone(),v=this._extendCameraOptions(g);y.bearing=d,y.pitch=f;const E=a.LngLat.convert(o),T=a.LngLat.convert(h),A=.5*(E.lat+T.lat),k=.5*(E.lng+T.lng),R=a.latLngToECEF(A,k),O=a.normalize([],R),B=a.normalize([],a.cross([],O,[0,1,0])),F=a.cross([],B,O),I=[B[0],B[1],B[2],0,F[0],F[1],F[2],0,O[0],O[1],O[2],0,0,0,0,1],L=[R,a.latLngToECEF(E.lat,E.lng),a.latLngToECEF(T.lat,E.lng),a.latLngToECEF(T.lat,T.lng),a.latLngToECEF(E.lat,T.lng),a.latLngToECEF(A,E.lng),a.latLngToECEF(A,T.lng),a.latLngToECEF(E.lat,k),a.latLngToECEF(T.lat,k)];let N=a.Aabb.fromPoints(L.map(ve=>[a.dot(B,ve),a.dot(F,ve),a.dot(O,ve)]));const j=a.transformMat4([],N.center,I);a.squaredLength(j)===0&&a.set(j,0,0,1),a.normalize(j,j),a.scale$2(j,j,a.GLOBE_RADIUS),y.center=a.ecefToLatLng(j);const K=y.getWorldToCameraMatrix(),J=a.invert(new Float64Array(16),K);N=a.Aabb.applyTransform(N,a.multiply([],K,I)),a.transformMat4(j,j,K);const Y=.5*(N.max[2]-N.min[2]),ie=this._minimumAABBFrustumDistance(y,N),te=a.scale$2([],[0,0,1],Y),le=a.add(te,j,te),Te=ie+(y.pitch===0?0:a.distance(j,le)),oe=y.globeCenterInViewSpace,ge=a.sub([],j,[oe[0],oe[1],oe[2]]);a.normalize(ge,ge),a.scale$2(ge,ge,Te);const he=a.add([],j,ge);a.transformMat4(he,he,J);const we=a.earthRadius/a.GLOBE_RADIUS,ae=a.length(he),_e=a.mercatorZfromAltitude(Math.max(ae*we-a.earthRadius,Number.EPSILON),0),Me=Math.min(y.zoomFromMercatorZAdjusted(_e),v.maxZoom);return Me>.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"mercator"}),y.zoom=Me,this._cameraForBounds(y,o,h,d,f,g)):{center:y.center,zoom:Me,bearing:d,pitch:f}}queryTerrainElevation(r,o){const h=this.transform.elevation;return h?(o=a.extend({},{exaggerated:!0},o),h.getAtPoint(a.MercatorCoordinate.fromLngLat(r),null,o.exaggerated)):null}_cameraForBounds(r,o,h,d,f,g){if(r.projection.name==="globe")return this._cameraForBoundsOnGlobe(r,o,h,d,f,g);const y=r.clone(),v=this._extendCameraOptions(g),E=y.padding;y.bearing=d,y.pitch=f;const T=a.LngLat.convert(o),A=a.LngLat.convert(h),k=new a.LngLat(T.lng,A.lat),R=new a.LngLat(A.lng,T.lat),O=y.project(T),B=y.project(A),F=this.queryTerrainElevation(T),I=this.queryTerrainElevation(A),L=this.queryTerrainElevation(k),N=this.queryTerrainElevation(R),j=[[O.x,O.y,Math.min(F||0,I||0,L||0,N||0)],[B.x,B.y,Math.max(F||0,I||0,L||0,N||0)]];let K=a.Aabb.fromPoints(j);const J=y.getWorldToCameraMatrix(),Y=a.invert(new Float64Array(16),J);K=a.Aabb.applyTransform(K,J);const ie=a.sub([],K.max,K.min),te=E.left||0,le=E.right||0,Te=E.bottom||0,oe=E.top||0,{left:ge,right:he,top:we,bottom:ae}=v.padding,_e=.5*(te+le),Me=.5*(oe+Te),ve=Math.min(y.scaleZoom(y.scale*Math.min((y.width-(te+le+ge+he))/ie[0],(y.height-(Te+oe+ae+we))/ie[1])),v.maxZoom),Ae=y.scale/y.zoomScale(ve);K=new a.Aabb([K.min[0]-(ge+_e)*Ae,K.min[1]-(ae+Me)*Ae,K.min[2]],[K.max[0]+(he+_e)*Ae,K.max[1]+(we+Me)*Ae,K.max[2]]);const Ge=.5*ie[2],Xe=this._minimumAABBFrustumDistance(y,K),Ve=[0,0,1,0];a.transformMat4$1(Ve,Ve,J),a.normalize$2(Ve,Ve);const qe=a.scale$2([],Ve,Xe+Ge),lt=a.add([],K.center,qe),ot=(typeof v.offset.x=="number"&&typeof v.offset.y=="number"?new a.Point(v.offset.x,v.offset.y):a.Point.convert(v.offset)).rotate(-a.degToRad(d));K.center[0]-=ot.x*Ae,K.center[1]+=ot.y*Ae,a.transformMat4(K.center,K.center,Y),a.transformMat4(lt,lt,Y);const je=[K.center[0],K.center[1],lt[2]*y.pixelsPerMeter];a.scale$2(je,je,1/y.worldSize);const wt=a.lngFromMercatorX(je[0]),Tt=a.latFromMercatorY(je[1]),Et=Math.min(y._zoomFromMercatorZ(je[2]),v.maxZoom),St=new a.LngLat(wt,Tt);return y.mercatorFromTransition&&Et<.5*(a.GLOBE_ZOOM_THRESHOLD_MIN+a.GLOBE_ZOOM_THRESHOLD_MAX)?(y.setProjection({name:"globe"}),y.zoom=Et,this._cameraForBounds(y,o,h,d,f,g)):{center:St,zoom:Et,bearing:d,pitch:f}}fitBounds(r,o,h){const d=this.cameraForBounds(r,o);return this._fitInternal(d,o,h)}fitScreenCoordinates(r,o,h,d,f){const g=a.Point.convert(r),y=a.Point.convert(o),v=new a.Point(Math.min(g.x,y.x),Math.min(g.y,y.y)),E=new a.Point(Math.max(g.x,y.x),Math.max(g.y,y.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(g,y))return this;const T=this.transform.pointLocation3D(v),A=this.transform.pointLocation3D(E),k=this.transform.pointLocation3D(new a.Point(v.x,E.y)),R=this.transform.pointLocation3D(new a.Point(E.x,v.y)),O=[Math.min(T.lng,A.lng,k.lng,R.lng),Math.min(T.lat,A.lat,k.lat,R.lat)],B=[Math.max(T.lng,A.lng,k.lng,R.lng),Math.max(T.lat,A.lat,k.lat,R.lat)],F=d&&d.pitch?d.pitch:this.getPitch(),I=this._cameraForBounds(this.transform,O,B,h,F,d);return this._fitInternal(I,d,f)}_fitInternal(r,o,h){return r?(delete(o=a.extend(r,o)).padding,o.linear?this.easeTo(o,h):this.flyTo(o,h)):this}jumpTo(r,o){this.stop();const h=r.preloadOnly?this.transform.clone():this.transform;let d=!1,f=!1,g=!1;return"zoom"in r&&h.zoom!==+r.zoom&&(d=!0,h.zoom=+r.zoom),r.center!==void 0&&(h.center=a.LngLat.convert(r.center)),"bearing"in r&&h.bearing!==+r.bearing&&(f=!0,h.bearing=+r.bearing),"pitch"in r&&h.pitch!==+r.pitch&&(g=!0,h.pitch=+r.pitch),r.padding==null||h.isPaddingEqual(r.padding)||(h.padding=r.padding),r.preloadOnly?(this._preloadTiles(h),this):(this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),d&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),f&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),g&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||a.warnOnce(Tn),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,o){const h=this.transform;if(!h.projection.supportsFreeCamera)return a.warnOnce(Tn),this;this.stop();const d=h.zoom,f=h.pitch,g=h.bearing;h.setFreeCameraOptions(r);const y=d!==h.zoom,v=f!==h.pitch,E=g!==h.bearing;return this.fire(new a.Event("movestart",o)).fire(new a.Event("move",o)),y&&this.fire(new a.Event("zoomstart",o)).fire(new a.Event("zoom",o)).fire(new a.Event("zoomend",o)),E&&this.fire(new a.Event("rotatestart",o)).fire(new a.Event("rotate",o)).fire(new a.Event("rotateend",o)),v&&this.fire(new a.Event("pitchstart",o)).fire(new a.Event("pitch",o)).fire(new a.Event("pitchend",o)),this.fire(new a.Event("moveend",o)),this}easeTo(r,o){this._stop(!1,r.easeId),((r=a.extend({offset:[0,0],duration:500,easing:a.ease},r)).animate===!1||this._prefersReducedMotion(r))&&(r.duration=0);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?+r.zoom:d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=a.Point.convert(r.offset);let R,O,B;if(h.projection.name==="globe"){const te=a.MercatorCoordinate.fromLngLat(h.center),le=k.rotate(-h.angle);te.x+=le.x/h.worldSize,te.y+=le.y/h.worldSize;const Te=te.toLngLat(),oe=a.LngLat.convert(r.center||Te);this._normalizeCenter(oe),R=h.centerPoint.add(le),O=new a.Point(te.x,te.y).mult(h.worldSize),B=new a.Point(a.mercatorXfromLng(oe.lng),a.mercatorYfromLat(oe.lat)).mult(h.worldSize).sub(O)}else{R=h.centerPoint.add(k);const te=h.pointLocation(R),le=a.LngLat.convert(r.center||te);this._normalizeCenter(le),O=h.project(te),B=h.project(le).sub(O)}const F=h.zoomScale(v-d);let I,L;r.around&&(I=a.LngLat.convert(r.around),L=h.locationPoint(I));const N=this._zooming||v!==d,j=this._rotating||f!==E,K=this._pitching||T!==g,J=!h.isPaddingEqual(A),Y=te=>le=>{if(N&&(te.zoom=a.number(d,v,le)),j&&(te.bearing=a.number(f,E,le)),K&&(te.pitch=a.number(g,T,le)),J&&(te.interpolatePadding(y,A,le),R=te.centerPoint.add(k)),I)te.setLocationAtPoint(I,L);else{const Te=te.zoomScale(te.zoom-d),oe=v>d?Math.min(2,F):Math.max(.5,F),ge=Math.pow(oe,1-le),he=te.unproject(O.add(B.mult(le*ge)).mult(Te));te.setLocationAtPoint(te.renderWorldCopies?he.wrap():he,R)}return r.preloadOnly||this._fireMoveEvents(o),te};if(r.preloadOnly){const te=this._emulate(Y,r.duration,h);return this._preloadTiles(te),this}const ie={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=N,this._rotating=j,this._pitching=K,this._padding=J,this._easeId=r.easeId,this._prepareEase(o,r.noMoveStart,ie),this._ease(Y(h),te=>{h.recenterOnTerrain(),this._afterEase(o,te)},r),this}_prepareEase(r,o,h={}){this._moving=!0,this.transform.cameraElevationReference="sea",o||h.moving||this.fire(new a.Event("movestart",r)),this._zooming&&!h.zooming&&this.fire(new a.Event("zoomstart",r)),this._rotating&&!h.rotating&&this.fire(new a.Event("rotatestart",r)),this._pitching&&!h.pitching&&this.fire(new a.Event("pitchstart",r))}_fireMoveEvents(r){this.fire(new a.Event("move",r)),this._zooming&&this.fire(new a.Event("zoom",r)),this._rotating&&this.fire(new a.Event("rotate",r)),this._pitching&&this.fire(new a.Event("pitch",r))}_afterEase(r,o){if(this._easeId&&o&&this._easeId===o)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const h=this._zooming,d=this._rotating,f=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,h&&this.fire(new a.Event("zoomend",r)),d&&this.fire(new a.Event("rotateend",r)),f&&this.fire(new a.Event("pitchend",r)),this.fire(new a.Event("moveend",r))}flyTo(r,o){if(this._prefersReducedMotion(r)){const ve=a.pick(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,o)}this.stop(),r=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},r);const h=this.transform,d=this.getZoom(),f=this.getBearing(),g=this.getPitch(),y=this.getPadding(),v="zoom"in r?a.clamp(+r.zoom,h.minZoom,h.maxZoom):d,E="bearing"in r?this._normalizeBearing(r.bearing,f):f,T="pitch"in r?+r.pitch:g,A="padding"in r?r.padding:h.padding,k=h.zoomScale(v-d),R=a.Point.convert(r.offset);let O=h.centerPoint.add(R);const B=h.pointLocation(O),F=a.LngLat.convert(r.center||B);this._normalizeCenter(F);const I=h.project(B),L=h.project(F).sub(I);let N=r.curve;const j=Math.max(h.width,h.height),K=j/k,J=L.mag();if("minZoom"in r){const ve=a.clamp(Math.min(r.minZoom,d,v),h.minZoom,h.maxZoom),Ae=j/h.zoomScale(ve-d);N=Math.sqrt(Ae/J*2)}const Y=N*N;function ie(ve){const Ae=(K*K-j*j+(ve?-1:1)*Y*Y*J*J)/(2*(ve?K:j)*Y*J);return Math.log(Math.sqrt(Ae*Ae+1)-Ae)}function te(ve){return(Math.exp(ve)-Math.exp(-ve))/2}function le(ve){return(Math.exp(ve)+Math.exp(-ve))/2}const Te=ie(0);let oe=function(ve){return le(Te)/le(Te+N*ve)},ge=function(ve){return j*((le(Te)*(te(Ae=Te+N*ve)/le(Ae))-te(Te))/Y)/J;var Ae},he=(ie(1)-Te)/N;if(Math.abs(J)<1e-6||!isFinite(he)){if(Math.abs(j-K)<1e-6)return this.easeTo(r,o);const ve=K<j?-1:1;he=Math.abs(Math.log(K/j))/N,ge=function(){return 0},oe=function(Ae){return Math.exp(ve*N*Ae)}}r.duration="duration"in r?+r.duration:1e3*he/("screenSpeed"in r?+r.screenSpeed/N:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0);const we=f!==E,ae=T!==g,_e=!h.isPaddingEqual(A),Me=ve=>Ae=>{const Ge=Ae*he,Xe=1/oe(Ge);ve.zoom=Ae===1?v:d+ve.scaleZoom(Xe),we&&(ve.bearing=a.number(f,E,Ae)),ae&&(ve.pitch=a.number(g,T,Ae)),_e&&(ve.interpolatePadding(y,A,Ae),O=ve.centerPoint.add(R));const Ve=Ae===1?F:ve.unproject(I.add(L.mult(ge(Ge))).mult(Xe));return ve.setLocationAtPoint(ve.renderWorldCopies?Ve.wrap():Ve,O),ve._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(o),ve};if(r.preloadOnly){const ve=this._emulate(Me,r.duration,h);return this._preloadTiles(ve),this}return this._zooming=!0,this._rotating=we,this._pitching=ae,this._padding=_e,this._prepareEase(o,!1),this._ease(Me(h),()=>this._afterEase(o),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const h=this._onEaseEnd;this._onEaseEnd=void 0,h.call(this,o)}if(!r){const h=this.handlers;h&&h.stop(!1)}return this}_ease(r,o,h){h.animate===!1||h.duration===0?(r(1),o()):(this._easeStart=a.exported.now(),this._easeOptions=h,this._onEaseFrame=r,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const r=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1),o=this._onEaseFrame;o&&o(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,o){r=a.wrap(r,-180,180);const h=Math.abs(r-o);return Math.abs(r-360-o)<h&&(r-=360),Math.abs(r+360-o)<h&&(r+=360),r}_normalizeCenter(r){const o=this.transform;if(!o.renderWorldCopies||o.maxBounds)return;const h=r.lng-o.center.lng;r.lng+=h>180?-360:h<-180?360:0}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&a.exported.prefersReducedMotion&&!(r&&r.essential)}_emulate(r,o,h){const d=Math.ceil(15*o/1e3),f=[],g=r(h.clone());for(let y=0;y<=d;y++){const v=g(y/d);f.push(v.clone())}return f}}class Ue{constructor(r={}){this.options=r,a.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(r){const o=this.options&&this.options.compact;return this._map=r,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ht("button","mapboxgl-ctrl-attrib-button",this._container),ht("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(r,o){const h=this._map._getUIString(`AttributionControl.${o}`);r.setAttribute("aria-label",h),r.removeAttribute("title"),r.firstElementChild&&r.firstElementChild.setAttribute("title",h)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));const o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||a.config.ACCESS_TOKEN}];if(r){const h=o.reduce((d,f,g)=>(f.value&&(d+=`${f.key}=${f.value}${g<o.length-1?"&":""}`),d),"?");r.href=`${a.config.FEEDBACK_URL}/${h}#${Wo(this._map,!0)}`,r.rel="noopener nofollow",this._setElementTitle(r,"MapFeedback")}}_updateData(r){!r||r.sourceDataType!=="metadata"&&r.sourceDataType!=="visibility"&&r.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let r=[];if(this._map.style.stylesheet){const d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}const o=this._map.style._sourceCaches;for(const d in o){const f=o[d];if(f.used){const g=f.getSource();g.attribution&&r.indexOf(g.attribution)<0&&r.push(g.attribution)}}r.sort((d,f)=>d.length-f.length),r=r.filter((d,f)=>{for(let g=f+1;g<r.length;g++)if(r[g].indexOf(d)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=[...this.options.customAttribution,...r]:r.unshift(this.options.customAttribution));const h=r.join(" | ");h!==this._attribHTML&&(this._attribHTML=h,r.length?(this._innerContainer.innerHTML=h,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class dl{constructor(){a.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(r){this._map=r,this._container=ht("div","mapboxgl-ctrl");const o=ht("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(r){r&&r.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const r=this._map.style._sourceCaches;if(Object.entries(r).length===0)return!0;for(const o in r){const h=r[o].getSource();if(h.hasOwnProperty("mapbox_logo")&&!h.mapbox_logo)return!1}return!0}_updateCompact(){const r=this._container.children;if(r.length){const o=r[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}}}class pl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const o=++this._id;
vendor: 5,030 bytes, line 1311
1311return this._queue.push({callback:r,id:o,cancelled:!1}),o}remove(r){const o=this._currentlyRunning,h=o?this._queue.concat(o):this._queue;for(const d of h)if(d.id===r)return void(d.cancelled=!0)}run(r=0){const o=this._currentlyRunning=this._queue;this._queue=[];for(const h of o)if(!h.cancelled&&(h.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function ao(l,r,o){if(l=new a.LngLat(l.lng,l.lat),r){const h=new a.LngLat(l.lng-360,l.lat),d=new a.LngLat(l.lng+360,l.lat),f=360*Math.ceil(Math.abs(l.lng-o.center.lng)/360),g=o.locationPoint(l).distSqr(r),y=r.x<0||r.y<0||r.x>o.width||r.y>o.height;o.locationPoint(h).distSqr(r)<g&&(y||Math.abs(h.lng-o.center.lng)<f)?l=h:o.locationPoint(d).distSqr(r)<g&&(y||Math.abs(d.lng-o.center.lng)<f)&&(l=d)}for(;Math.abs(l.lng-o.center.lng)>180;){const h=o.locationPoint(l);if(h.x>=0&&h.y>=0&&h.x<=o.width&&h.y<=o.height)break;l.lng>o.center.lng?l.lng-=360:l.lng+=360}return l}const En={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%)"};class Be extends a.Evented{constructor(r,o){if(super(),(r instanceof a.window.HTMLElement||o)&&(r=a.extend({element:r},o)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=a.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht("div");const d=41,f=27,g=gi("svg",{display:"block",height:d*this._scale+"px",width:f*this._scale+"px",viewBox:`0 0 ${f} ${d}`},this._element),y=gi("radialGradient",{id:"shadowGradient"},gi("defs",{},g));gi("stop",{offset:"10%","stop-opacity":.4},y),gi("stop",{offset:"100%","stop-opacity":.05},y),gi("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},g),gi("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},g),gi("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},g),gi("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},g),this._offset=a.Point.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()});const h=this._element.classList;for(const d in En)h.remove(`mapboxgl-marker-anchor-${d}`);h.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(r){return r===this._map||(this.remove(),this._map=r,r.getCanvasContainer().appendChild(this._element),r.on("move",this._updateMoving),r.on("moveend",this._update),r.on("remove",this._clearFadeTimer),r._addMarker(this),this.setDraggable(this._draggable),this._update(),r.on("click",this._onMapClick)),this}remove(){const r=this._map;return r&&(r.off("click",this._onMapClick),r.off("move",this._updateMoving),r.off("moveend",this._update),r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler),r.off("mouseup",this._onUp),r.off("touchend",this._onUp),r.off("mousemove",this._onMove),r.off("touchmove",this._onMove),r.off("remove",this._clearFadeTimer),r._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=a.LngLat.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const d=Math.sqrt(Math.pow(13.5,2)/2);r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 8,503 bytes, lines 1311-1316
13110,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,r._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(r){const o=r.code,h=r.charCode||r.keyCode;o!=="Space"&&o!=="Enter"&&h!==32&&h!==13||this.togglePopup()}_onMapClick(r){const o=r.originalEvent.target,h=this._element;this._popup&&(o===h||h.contains(o))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const r=this._popup;return r?(r.isOpen()?(r.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(r.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const r=this._map,o=this._pos;if(!r||!o)return!1;const h=r.unproject(o),d=r.getFreeCameraOptions();if(!d.position)return!1;const f=d.position.toLngLat();return f.distanceTo(h)<.9*f.distanceTo(this._lngLat)}_evaluateOpacity(){const r=this._map;if(!r)return;const o=this._pos;if(!o||o.x<0||o.x>r.transform.width||o.y<0||o.y>r.transform.height)return void this._clearFadeTimer();const h=r.unproject(o);let d;r._showingGlobe()&&a.isLngLatBehindGlobe(r.transform,this._lngLat)?d=0:(d=1-r._queryFogOpacity(h),r.transform._terrainEnabled()&&r.getTerrain()&&this._behindTerrain()&&(d*=this._occludedOpacity)),this._element.style.opacity=`${d}`,this._element.style.pointerEvents=d>0?"auto":"none",this._popup&&this._popup._setOpacity(d),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const r=this._pos;if(!r||!this._map)return;const o=this._offset.mult(this._scale);this._element.style.transform=`
1312            translate(${r.x}px,${r.y}px)
1313            ${En[this._anchor]}
1314            ${this._calculateXYTransform()} ${this._calculateZTransform()}
1315            translate(${o.x}px,${o.y}px)
1316        `}_calculateXYTransform(){const r=this._pos,o=this._map,h=this.getPitchAlignment();if(!o||!r||h!=="map")return"";if(!o._showingGlobe()){const v=o.getPitch();return v?`rotateX(${v}deg)`:""}const d=a.radToDeg(a.globeTiltAtLngLat(o.transform,this._lngLat)),f=r.sub(a.globeCenterToScreenPoint(o.transform)),g=Math.abs(f.x)+Math.abs(f.y);if(g===0)return"";const y=d/g;return`rotateX(${-f.y*y}deg) rotateY(${f.x*y}deg)`}_calculateZTransform(){const r=this._pos,o=this._map;if(!o||!r)return"";let h=0;const d=this.getRotationAlignment();if(d==="map")if(o._showingGlobe()){const f=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),g=o.project(new a.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(f);h=a.radToDeg(Math.atan2(g.y,g.x))-90}else h=-o.getBearing();else if(d==="horizon"){const f=a.smoothstep(4,6,o.getZoom()),g=a.globeCenterToScreenPoint(o.transform);g.y+=f*o.transform.height;const y=r.sub(g),v=a.radToDeg(Math.atan2(y.y,y.x));h=(v>90?v-270:v+90)*(1-f)}return h+=this._rotation,h?`rotateZ(${h}deg)`:""}_update(r){a.window.cancelAnimationFrame(this._updateFrameId);const o=this._map;o&&(o.transform.renderWorldCopies&&(this._lngLat=ao(this._lngLat,this._pos,o.transform)),this._pos=o.project(this._lngLat),r===!0?this._updateFrameId=a.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),o._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(o._showingGlobe()||o.getTerrain()||o.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=a.Point.convert(r),this._update(),this}_onMove(r){const o=this._map;if(!o)return;const h=this._pointerdownPos,d=this._positionDelta;if(h&&d){if(!this._isDragging){const f=this._clickTolerance||o._clickTolerance;if(r.point.dist(h)<f)return;this._isDragging=!0}this._pos=r.point.sub(d),this._lngLat=o.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.Event("dragstart"))),this.fire(new a.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const r=this._map;r&&(r.off("mousemove",this._onMove),r.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new a.Event("dragend")),this._state="inactive"}_addDragHandler(r){const o=this._map,h=this._pos;o&&h&&this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(h),this._pointerdownPos=r.point,this._state="pending",o.on("mousemove",this._onMove),o.on("touchmove",this._onMove),o.once("mouseup",this._onUp),o.once("touchend",this._onUp))}setDraggable(r){this._draggable=!!r;const o=this._map;return o&&(r?(o.on("mousedown",this._addDragHandler),o.on("touchstart",this._addDragHandler)):(o.off("mousedown",this._addDragHandler),o.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(r){return this._rotation=r||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(r){return this._rotationAlignment=r||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(r){return this._pitchAlignment=r||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(r){return this._occludedOpacity=r||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const fl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Wh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Uc(l=new a.Point(0,0),r="bottom"){if(typeof l=="number"){const o=Math.round(Math.sqrt(.5*Math.pow(l,2)));switch(r){case"top":return new a.Point(0,l);case"top-left":return new a.Point(o,o);case"top-right":return new a.Point(-o,o);case"bottom":return new a.Point(0,-l);case"bottom-left":return new a.Point(o,-o);case"bottom-right":return new a.Point(-o,-o);case"left":return new a.Point(l,0);case"right":return new a.Point(-l,0)}return new a.Point(0,0)}return l instanceof a.Point||Array.isArray(l)?a.Point.convert(l):a.Point.convert(l[r]||[0,0])}class ml{constructor(r){this.jumpTo(r)}getValue(r){if(r<=this._startTime)return this._start;if(r>=this._endTime)return this._end;const o=a.easeCubicInOut((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-o)+this._end*o}isEasing(r){return r>=this._startTime&&r<=this._endTime}jumpTo(r){this._startTime=-1/0,this._endTime=-1/0,this._start=r,this._end=r}easeTo(r,o,h){this._start=this.getValue(o),this._end=r,this._startTime=o,this._endTime=o+h}}const Vc={"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":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},Nc={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileC
1316acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},Xh={showCompass:!0,showZoom:!0,visualizePitch:!1};class Hh{constructor(r,o,h=!1){this._clickTolerance=10,this.element=o,this.mouseRotate=new al({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,h&&(this.mousePitch=new ll({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener("mousedown",this.mousedown),o.addEventListener("touchstart",this.touchstart,{passive:!1}),o.addEventListener("touchmove",this.touchmove),o.addEventListener("touchend",this.touchend),o.addEventListener("touchcancel",this.reset)}down(r,o){this.mouseRotate.mousedown(r,o),this.mousePitch&&this.mousePitch.mousedown(r,o),bo()}move(r,o){const h=this.map,d=this.mouseRotate.mousemoveWindow(r,o),f=d&&d.bearingDelta;if(f&&h.setBearing(h.getBearing()+f),this.mousePitch){const g=this.mousePitch.mousemoveWindow(r,o),y=g&&g.pitchDelta;y&&h.setPitch(h.getPitch()+y)}}off(){const r=this.element;r.removeEventListener("mousedown",this.mousedown),r.removeEventListener("touchstart",this.touchstart,{passive:!1}),r.removeEventListener("touchmove",this.touchmove),r.removeEventListener("touchend",this.touchend),r.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Ln(),a.window.removeEventListener("mousemove",this.mousemove),a.window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(a.extend({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),Qi(this.element,r)),a.window.addEventListener("mousemove",this.mousemove),a.window.addEventListener("mouseup",this.mouseup)}mousemove(r){this.move(r,Qi(this.element,r))}mouseup(r){this.mouseRotate.mouseupWindow(r),this.mousePitch&&this.mousePitch.mouseupWindow(r),this.offTemp()}touchstart(r){r.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=cn(this.element,r.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>r.preventDefault()},this._startPos))}touchmove(r){r.targetTouches.length!==1?this.reset():(this._lastPos=cn(this.element,r.targetTouches)[0],this.move({preventDefault:()=>r.preventDefault()},this._lastPos))}touchend(r){r.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const _l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},gl={maxWidth:100,unit:"metric"},yl={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},lo={version:a.version,supported:vr,setRTLTextPlugin:a.setRTLTextPlugin,getRTLTextPluginStatus:a.getRTLTextPluginStatus,Map:class extends Ks{constructor(l){if(a.LivePerformanceUtils.mark(a.PerformanceMarkers.create),(l=a.extend({},Nc,l)).minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(l.antialias&&a.isSafariWithAntialiasingBug(a.window)&&(l.antialias=!1,a.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new ro(l.minZoom,l.maxZoom,l.minPitch,l.maxPitch,l.renderWorldCopies),l),this._interactive=l.interactive,this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._failIfMajorPerformanceCaveat=l.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=l.preserveDrawingBuffer,this._antialias=l.antialias,this._useWebGL2=l.useWebGL2,this._trackResize=l.trackResize,this._bearingSnap=l.bearingSnap,this._refreshExpiredTiles=l.refreshExpiredTiles,this._fadeDuration=l.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=l.crossSourceCollisions,this._collectResourceTiming=l.collectResourceTiming,this._optimizeForTerrain=l.optimizeForTerrain,this._language=this._parseLanguage(l.language),this._worldview=l.worldview,this._renderTaskQueue=new pl,this._domRenderTaskQueue=new pl,this._controls=[],this._markers=[],this._popups=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Vc,l.locale),this._clickTolerance=l.clickTolerance,this._cooperativeGestures=l.cooperativeGestures,this._performanceMetricsCollection=l.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ml(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new a.RequestManager(l.transformRequest,l.accessToken,l.testMode),this._silenceAuthErrors=!!l.testMode,typeof l.container=="string"){if(this._container=a.window.document.getElementById(l.container),!this._container)throw new Error(`Container '${l.container}' not found.`)}else{if(!(l.container instanceof a.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=l.container}if(this._container.childNodes.length>0&&a.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),l.maxBounds&&this.setMaxBounds(l.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),a.window!==void 0&&(a.window.addEventListener("online",this._onWindowOnline,!1),a.window.addEventListener("resize",this._onWindowResize,!1),a.window.addEventListener("orientationchange",this._onWindowResize,!1),a.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),a.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new dr(this,l),this._localFontFamily=l.localFontFamily,this._localIdeographFontFamily=l.localIdeographFontFamily,l.style&&this.setStyle(l.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),l.projection&&this.setProjection(l.projection),this._hash=l.hash&&new rl(typeof l.hash=="string"&&l.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,a.extend({},l.fitBoundsOptions,{duration:0})))),this.resize(),l.attributionControl&&this.addControl(new Ue({customAttribution:l.customAttribution}
vendor: 5,097 bytes, line 1316
1316)),this._logoControl=new dl,this.addControl(this._logoControl,l.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",r=>{this._update(r.dataType==="style"),this.fire(new a.Event(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new a.Event(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(l,r){if(r===void 0&&(r=l.getDefaultPosition?l.getDefaultPosition():"top-right"),!l||!l.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=l.onAdd(this);this._controls.push(l);const h=this._controlPositions[r];return r.indexOf("bottom")!==-1?h.insertBefore(o,h.firstChild):h.appendChild(o),this}removeControl(l){if(!l||!l.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(l);return r>-1&&this._controls.splice(r,1),l.onRemove(this),this}hasControl(l){return this._controls.indexOf(l)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(l){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new a.Event("movestart",l)).fire(new a.Event("move",l)),this.fire(new a.Event("resize",l)),r&&this.fire(new a.Event("moveend",l)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(l){return this.transform.setMaxBounds(a.LngLatBounds.convert(l)),this._update()}setMinZoom(l){if((l=l??-2)>=-2&&l<=this.transform.maxZoom)return this.transform.minZoom=l,this._update(),this.getZoom()<l?this.setZoom(l):this.fire(new a.Event("zoomstart")).fire(new a.Event("zoom")).fire(new a.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(l){if((l=l??22)>=this.transform.minZoom)return this.transform.maxZoom=l,this._update(),this.getZoom()>l?this.setZoom(l):this.fire(new a.Event("zoomstart")).fire(new a.Event("zoom")).fire(new a.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(l){if((l=l??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(l>=0&&l<=this.transform.maxPitch)return this.transform.minPitch=l,this._update(),this.getPitch()<l?this.setPitch(l):this.fire(new a.Event("pitchstart")).fire(new a.Event("pitch")).fire(new a.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(l){if((l=l??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(l>=this.transform.minPitch)return this.transform.maxPitch=l,this._update(),this.getPitch()>l?this.setPitch(l):this.fire(new a.Event("pitchstart")).fire(new a.Event("pitch")).fire(new a.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(l){return this.transform.renderWorldCopies=l,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(l){return l==="auto"?a.window.navigator.language:Array.isArray(l)?l.length===0?void 0:l.map(r=>r==="auto"?a.window.navigator.language:r):l}setLanguage(l){const r=this._parseLanguage(l);if(!this.style||r===this._language)return this;this._language=r,this.style._reloadSources();for(const o of this._controls)o._setLanguage&&o._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(l){return this.style&&l!==this._worldview?(this._worldview=l,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(l){return this._lazyInitEmptyStyle(),l?typeof l=="string"&&(l={name:l}):l=null,this._useExplicitProjection=!!l,this._prioritizeAndUpdateProjection(l,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const l=this.transform,r=l.projection.name;let o;r==="globe"&&l.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX?(l.setMercatorFromTransition(),o=!0):r==="mercator"&&l.zoom<a.GLOBE_ZOOM_THRESHOLD_MAX&&(l.setProjection({name:"globe"}),o=!0),o&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
1316Update())}_prioritizeAndUpdateProjection(l,r){return this._updateProjection(l||r||{name:"mercator"})}_updateProjection(l){let r;if(r=l.name==="globe"&&this.transform.zoom>=a.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(l),this.style.applyProjectionUpdate(),r){this.painter.clearBackgroundTiles();for(const o in this.style._sourceCaches)this.style._sourceCaches[o].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(l){return this.transform.locationPoint3D(a.LngLat.convert(l))}unproject(l){return this.transform.pointLocation3D(a.Point.convert(l))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(l,r,o){if(l==="mouseenter"||l==="mouseover"){let h=!1;const d=g=>{const y=r.filter(E=>this.getLayer(E)),v=y.length?this.queryRenderedFeatures(g.point,{layers:y}):[];v.length?h||(h=!0,o.call(this,new hi(l,this,g.originalEvent,{features:v}))):h=!1},f=()=>{h=!1};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}if(l==="mouseleave"||l==="mouseout"){let h=!1;const d=g=>{const y=r.filter(v=>this.getLayer(v));(y.length?this.queryRenderedFeatures(g.point,{layers:y}):[]).length?h=!0:h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))},f=g=>{h&&(h=!1,o.call(this,new hi(l,this,g.originalEvent)))};return{layers:new Set(r),listener:o,delegates:{mousemove:d,mouseout:f}}}{const h=d=>{const f=r.filter(y=>this.getLayer(y)),g=f.length?this.queryRenderedFeatures(d.point,{layers:f}):[];g.length&&(d.features=g,o.call(this,d),delete d.features)};return{layers:new Set(r),listener:o,delegates:{[l]:h}}}}on(l,r,o){if(o===void 0)return super.on(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[l]=this._delegatedListeners[l]||[],this._delegatedListeners[l].push(h);for(const d in h.delegates)this.on(d,h.delegates[d]);return this}once(l,r,o){if(o===void 0)return super.once(l,r);Array.isArray(r)||(r=[r]);const h=this._createDelegatedListener(l,r,o);for(const d in h.delegates)this.once(d,h.delegates[d]);return this}off(l,r,o){if(o===void 0)return super.off(l,r);r=new Set(Array.isArray(r)?r:[r]);const h=(f,g)=>{if(f.size!==g.size)return!1;for(const y of f)if(!g.has(y))return!1;return!0},d=this._delegatedListeners?this._delegatedListeners[l]:void 0;return d&&(f=>{for(let g=0;g<f.length;g++){const y=f[g];if(y.listener===o&&h(y.layers,r)){for(const v in y.delegates)this.off(v,y.delegates[v]);return f.splice(g,1),this}}})(d),this}queryRenderedFeatures(l,r){return this.style?(r!==void 0||l===void 0||l instanceof a.Point||Array.isArray(l)||(r=l,l=void 0),this.style.queryRenderedFeatures(l=l||[[0,0],[this.transform.width,this.transform.height]],r=r||{},this.transform)):[]}querySourceFeatures(l,r){return this.style.querySourceFeatures(l,r)}isPointOnSurface(l){const{name:r}=this.transform.projection;return r!=="globe"&&r!=="mercator"&&a.warnOnce(`${r} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(a.Point.convert(l))}setStyle(l,r){return(r=a.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},r)).diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&r.localFontFamily===this._localFontFamily&&this.style&&l?(this._diffStyle(l,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._localFontFamily=r.localFontFamily,this._updateStyle(l,r))}_getUIString(l){const r=this._locale[l];if(r==null)throw new Error(`Missing UI string '${l}'`);return r}_updateStyle(l,r){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),l&&(this.style=new hr(this,r||{}),this.style.setEventedParent(this,{style:this.style}),typeof l=="string"?this.style.loadURL(l):this.style.loadJSON(l)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new hr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(l,r){if(typeof l=="string"){const o=this._requestManager.normalizeStyleURL(l),h=this._requestManager.transformRequest(o,a.ResourceType.Style);a.getJSON(h,(d,f)=>{d?this.fire(new a.ErrorEvent(d)):f&&this._updateDiff(f,r)})}else typeof l=="object"&&this._updateDiff(l,r)}_updateDiff(l,r){try{this.style.setState(l)&&this._update(!0)}catch(o){a.warnOnce(`Unable to perform style diff: ${o.message||o.error||o}.  Rebuilding the style from scratch.`),this._updateStyle(l,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(a.warnOnce("There is no style added to the map."),!1)}addSource(l,r){return this._lazyInitEmptyStyle(),this.style.addSource(l,r),this._update(!0)}isSourceLoaded(l){return!!this.style&&this.style._isSourceCacheLoaded(l)}areTilesLoaded(){const l=this.style&&this.style._sourceCaches;for(const r in l){const o=l[r]._tiles;for(const h in o){const d=o[h];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(l,r,o){this._lazyInitEmptyStyle(),this.style.addSourceType(l,r,o)}removeSource(l){return this.style.removeSource(l),this._updateTerrain(),this._update(!0)}getSource(l){return this.style.getSource(l)}addImage(l,r,{pixelRatio:o=1,sdf:h=!1,stretchX:d,stretchY:f,content:g}={}){if(this._lazyInitEmptyStyle(),r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap){const{width:y,height:v,data:E}=a.exported.getImageData(r);this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},E),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0})}
1316else if(r.width===void 0||r.height===void 0)this.fire(new a.ErrorEvent(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`")));else{const{width:y,height:v}=r,E=r;this.style.addImage(l,{data:new a.RGBAImage({width:y,height:v},new Uint8Array(E.data)),pixelRatio:o,stretchX:d,stretchY:f,content:g,sdf:h,version:0,userImage:E}),E.onAdd&&E.onAdd(this,l)}}updateImage(l,r){const o=this.style.getImage(l);if(!o)return void this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const h=r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap?a.exported.getImageData(r):r,{width:d,height:f}=h;d!==void 0&&f!==void 0?d===o.data.width&&f===o.data.height?(o.data.replace(h.data,!(r instanceof a.window.HTMLImageElement||a.window.ImageBitmap&&r instanceof a.window.ImageBitmap)),this.style.updateImage(l,o)):this.fire(new a.ErrorEvent(new Error(`The width and height of the updated image (${d}, ${f})
1317                must be that same as the previous version of the image
1318                (${o.data.width}, ${o.data.height})`))):this.fire(new a.ErrorEvent(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`")))}hasImage(l){return l?!!this.style.getImage(l):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(l){this.style.removeImage(l)}loadImage(l,r){a.getImage(this._requestManager.transformRequest(l,a.ResourceType.Image),(o,h)=>{r(o,h instanceof a.window.HTMLImageElement?a.exported.getImageData(h):h)})}listImages(){return this.style.listImages()}addLayer(l,r){return this._lazyInitEmptyStyle(),this.style.addLayer(l,r),this._update(!0)}moveLayer(l,r){return this.style.moveLayer(l,r),this._update(!0)}removeLayer(l){return this.style.removeLayer(l),this._update(!0)}getLayer(l){return this.style.getLayer(l)}setLayerZoomRange(l,r,o){return this.style.setLayerZoomRange(l,r,o),this._update(!0)}setFilter(l,r,o={}){return this.style.setFilter(l,r,o),this._update(!0)}getFilter(l){return this.style.getFilter(l)}setPaintProperty(l,r,o,h={}){return this.style.setPaintProperty(l,r,o,h),this._update(!0)}getPaintProperty(l,r){return this.style.getPaintProperty(l,r)}setLayoutProperty(l,r,o,h={}){return this.style.setLayoutProperty(l,r,o,h),this._update(!0)}getLayoutProperty(l,r){return this.style.getLayoutProperty(l,r)}setLight(l,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(l,r),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(l){return this._lazyInitEmptyStyle(),!l&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(l),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(l){return this._lazyInitEmptyStyle(),this.style.setFog(l),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(l){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(a.LngLat.convert(l),this.transform):0}setFeatureState(l,r){return this.style.setFeatureState(l,r),this._update()}removeFeatureState(l,r){return this.style.removeFeatureState(l,r),this._update()}getFeatureState(l){return this.style.getFeatureState(l)}_updateContainerDimensions(){if(!this._container)return;const l=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300;let o,h,d,f=this._container;for(;f&&(!h||!d);){const g=a.window.getComputedStyle(f).transform;g&&g!=="none"&&(o=g.match(/matrix.*\((.+)\)/)[1].split(", "),o[0]&&o[0]!=="0"&&o[0]!=="1"&&(h=o[0]),o[3]&&o[3]!=="0"&&o[3]!=="1"&&(d=o[3])),f=f.parentElement}this._containerWidth=h?Math.abs(l/h):l,this._containerHeight=d?Math.abs(r/d):r}_detectMissingCSS(){a.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&a.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described 
1318in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const l=this._container;l.classList.add("mapboxgl-map"),(this._missingCSSCanary=ht("div","mapboxgl-canary",l)).style.visibility="hidden",this._detectMissingCSS();const r=this._canvasContainer=ht("div","mapboxgl-canvas-container",l);this._interactive&&r.classList.add("mapboxgl-interactive"),this._canvas=ht("canvas","mapboxgl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const o=this._controlContainer=ht("div","mapboxgl-control-container",l),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(d=>{h[d]=ht("div",`mapboxgl-ctrl-${d}`,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(l,r){const o=a.exported.devicePixelRatio||1;this._canvas.width=o*Math.ceil(l),this._canvas.height=o*Math.ceil(r),this._canvas.style.width=`${l}px`,this._canvas.style.height=`${r}px`}_addMarker(l){this._markers.push(l)}_removeMarker(l){const r=this._markers.indexOf(l);r!==-1&&this._markers.splice(r,1)}_addPopup(l){this._popups.push(l)}_removePopup(l){const r=this._popups.indexOf(l);r!==-1&&this._popups.splice(r,1)}_setupPainter(){const l=a.extend({},vr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",l),o=r||this._canvas.getContext("webgl",l)||this._canvas.getContext("experimental-webgl",l);o?(this._useWebGL2&&!r&&a.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),a.storeAuthState(o,!0),this.painter=new to(o,this.transform,!!r),this.on("data",h=>{h.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),a.exported$1.testSupport(o)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(l){l.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:l}))}_contextRestored(l){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:l}))}_onMapScroll(l){if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(l){return this.style?(this._styleDirty=this._styleDirty||l,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(l){return this._update(),this._renderTaskQueue.add(l)}_cancelRenderFrame(l){this._renderTaskQueue.remove(l)}_requestDomTask(l){!this.loaded()||this.loaded()&&!this.isMoving()?l():this._domRenderTaskQueue.add(l)}_render(l){let r;const o=this.painter.context.extTimerQuery,h=a.exported.now();if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],a.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],a.window.performance.now())),this._renderTaskQueue.run(l),this._domRenderTaskQueue.run(l),this._removed)return;this._updateProjectionTransition();const d=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const y=this.transform.zoom,v=this.transform.pitch,E=a.exported.now(),T=new a.EvaluationParameters(y,{now:E,fadeDuration:d,pitch:v,transition:this.style.getTransition()});this.style.update(T)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let f=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),f=this._updateAverageElevation(h),this.style._updateSources(this.transform),this._forceMar
vendor: 14,423 bytes, line 1318
1318kerAndPopupUpdate()):f=this._updateAverageElevation(h),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,d,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:d,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new a.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),r){const y=a.exported.now()-h;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout(()=>{const v=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),this.fire(new a.Event("gpu-timing-frame",{cpuTime:y,gpuTime:v})),a.window.performance.mark("frame-gpu",{startTime:h,detail:{gpuTime:v}})},50)}if(this.listens("gpu-timing-layer")){const y=this.painter.collectGpuTimers();setTimeout(()=>{const v=this.painter.queryGpuTimers(y);this.fire(new a.Event("gpu-timing-layer",{layerTimes:v}))},50)}if(this.listens("gpu-timing-deferred-render")){const y=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const v=this.painter.queryGpuTimeDeferredRender(y);this.fire(new a.Event("gpu-timing-deferred-render",{gpuTime:v}))},50)}const g=this._sourcesDirty||this._styleDirty||this._placementDirty||f;if(g||this._repaint)this.triggerRepaint();else{const y=!this.isMoving()&&this.loaded();if(y&&(f=this._updateAverageElevation(h,!0)),f)this.triggerRepaint();else if(this._triggerFrame(!1),y&&(this.fire(new a.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const v=this._calculateSpeedIndex();this.fire(new a.Event("speedindexcompleted",{speedIndex:v})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||g||(this._fullyLoaded=!0,a.LivePerformanceUtils.mark(a.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&a.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(l){for(const r of this._markers)l&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(const r of this._popups)!l||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(l,r=!1){const o=h=>(this.transform.averageElevation=h,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&o(0);if((r||l-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(l)){const h=this.transform.averageElevation;let d=this.transform.sampleAverageElevation(),f=!1;this.transform.elevation&&(f=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(d)?d=0:this._averageElevationLastSampledAt=l;const g=Math.abs(h-d);if(g>1){if(this._isInitialLoad||f)return this._averageElevation.jumpTo(d),o(d);this._averageElevation.easeTo(d,l,300)}else if(g>1e-4)return this._averageElevation.jumpTo(d),o(d)}return!!this._averageElevation.isEasing(l)&&o(this._averageElevation.getValue(l))}_authenticate(){a.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,l=>{if(l&&(l.message===a.AUTH_ERR_MSG||l.status===401)){const r=this.painter.context.gl;a.storeAuthState(r,!1),this._logoControl instanceof dl&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new a.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),a.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){const l=this._isDragging();this.painter.updateTerrain(this.style,l)}_calculateSpeedIndex(){const l=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());const o=this.painter.context.gl,h=o.createFramebuffer();function d(f){o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,f,0);const g=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);return o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,g),g}return o.bindFramebuffer(o.FRAMEBUFFER,h),this._canvasPixelComparison(d(l),r.canvasCopies.map(d),r.timeStamps)}_canvasPixelComparison(l,r,o){let h=o[1]-o[0];const d=l.length/4;for(let f=0;f<r.length;f++){const g=r[f];let y=0;for(let v=0;v<g.length;v+=4)g[v]===l[v]&&g[v+1]===l[v+1]&&g[v+2]===l[v+2]&&g[v+3]===l[v+3]&&(y+=1);h+=(o[f+2]-o[f+1])*(1-y/d)}return h}remove(){this._hash&&this._hash.remove();for(const r of this._controls)r.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),a.window!==void 0&&(a.window.removeEventListener("resize",this._onWindowResize,!1),a.window.removeEventListener("orientationchange",this._onWindowResize,!1),a.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),a.window.removeEventListener("online",this._onWindowOnline,!1),a.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const l=this.painter.context.gl.getExtension("WEBGL_lose_context");l&&l.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),a.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new a.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(l){this._renderNextFrame=this._renderNextFrame||l,this.style&&!this._frame&&(this._frame=a.exported.frame(r=>{const o=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,o&&this._render(r)}))}_preloadTiles(l){const r=this.style?Object.values(this.style._sourceCaches):[];return a.asyncAll(r,(o,h)=>o._preloadTiles(l,h),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(l){this._trackResize&&this.resize({originalEvent:l})._update()}_onVisibilityChange(){a.window.document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(l){this._showTileBoundaries!==l&&(this._showTileBoundaries=l,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(l){this._showTerrainWireframe!==l&&(this._showTerrainWireframe=l,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(l){this._speedIndexTiming!==l&&(this._speedIndexTiming=l,this._update())}get showPadding(){return!!this._showPadding}set showPadding(l){this._showPadding!==l&&(this._showPadding=l,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(l){this._showCollisionBoxes!==l&&(this._showCollisionBoxes=l,l?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(l){this._showOverdrawInspector!==l&&(this._showOverdrawInspector=l,this._update())}get repaint(){return!!this._repaint}set repaint(l){this._repaint!==l&&(this._repaint=l,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(l){this._vertices=l,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(l){this._showTileAABBs!==l&&(this._showTileAABBs=l,l&&this._update())}_setCacheLimits(l,r){a.setCacheLimits(l,r)}get version(){return a.version}},NavigationControl:class{constructor(l){this.options=a.extend({},Xh,l),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",r=>{this._map&&this._map.zoomIn({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",r=>{this._map&&this._map.zoomOut({},{originalEvent:r})}),ht("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",r=>{const o=this._map;o&&(this.options.visualizePitch?o.resetNorthPitch({},{originalEvent:r}):o.resetNorth({},{originalEvent:r}))}),this._compassIcon=ht("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const l=this._map;if(!l)return;const r=l.getZoom(),o=r===l.getMaxZoom(),h=r===l.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const l=this._map;if(!l)return;const r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(l.transform.pitch*(Math.PI/180)),.5)}) rotateX(${l.transform.pitch}deg) rotateZ(${l.transform.angle*(180/Math.PI)}deg)`:`rotate(${l.transform.angle*(180/Math.PI)}deg)`;l._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),l.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&l.on("pitch",this._rotateCompassArrow),l.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Hh(l,this._compass,this.options.visualizePitch)),this._container}onRemove(){const l=this._map;l&&(this._container.remove(),this.options.showZoom&&l.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&l.off("pitch",this._rotateCompassArrow),l.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(l,r){const o=ht("button",l,this._container);return o.type="button",o.addEventListener("click",r),o}_setButtonTitle(l,r){if(!this._map)return;const o=this._map._getUIString(`NavigationControl.${r}`);l.setAttribute("aria-label",o),l.firstElementChild&&l.firstElementChild.setAttribute("title",o)}},GeolocateControl:class extends a.Evented{constructor(l){super(),this.options=a.extend({geolocation:a.window.navigator.geolocation},_l,l),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=no(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(l){return this._map=l,this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(l){const r=(o=!!this.options.geolocation)=>{this._supportsGeolocation=o,l(o)};this._supportsGeolocation!==void 0?l(this._supportsGeolocation):a.window.navigator.permissions!==void 0?a.window.navigator.permissions.query({name:"geolocation"}).then(o=>r(o.state!=="denied")).catch(()=>r()):r()}_isOutOfMapMaxBounds(l){const r=this._map.getMaxBounds(),o=l.coords;return!!r&&(o.longitude<r.getWest()||o.longitude>r.getEast()||o.latitude<r.getSouth()||o.latitude>r.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(l){if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
1318RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",l)),this._finish()}}_updateCamera(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude),o=l.coords.accuracy,h=this._map.getBearing(),d=a.extend({bearing:h},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(o),d,{geolocateSource:!0})}_updateMarker(l){if(l){const r=new a.LngLat(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const l=this._map.transform,r=a.mercatorZfromAltitude(1,l._center.lat)*l.worldSize,o=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(l){if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",l)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(l){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=ht("button","mapboxgl-ctrl-geolocate",this._container),ht("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",l===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1318se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ht("div","mapboxgl-user-location"),this._dotElement.appendChild(ht("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ht("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Be({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ht("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Be({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}}_onDeviceOrientation(l){this._userLocationDotMarker&&(l.webkitCompassHeading?this._heading=l.webkitCompassHeading:l.absolute===!0&&(this._heading=-1*l.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return a.warnOnce("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 a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let l;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(l={maximumAge:6e5,timeout:0},this._noTimeout=!0):(l=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,l),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const l=()=>{a.window.addEventListener("ondeviceorientationabsolute"in a.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};a.window.DeviceMotionEvent!==void 0&&typeof a.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(r=>{r==="granted"&&l()}).catch(console.error):l()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),a.window.removeEventListener("deviceorientation",this._onDeviceOrientation),a.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
1318se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Ue,ScaleControl:class{constructor(l){this.options=a.extend({},gl,l),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),a.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const l=this.options.maxWidth||100,r=this._map,o=r._containerHeight/2,h=r._containerWidth/2-l/2,d=r.unproject([h,o]),f=r.unproject([h+l,o]),g=d.distanceTo(f);if(this.options.unit==="imperial"){const y=3.2808*g;y>5280?this._setScale(l,y/5280,"mile"):this._setScale(l,y,"foot")}else this.options.unit==="nautical"?this._setScale(l,g/1852,"nautical-mile"):g>=1e3?this._setScale(l,g/1e3,"kilometer"):this._setScale(l,g,"meter")}_setScale(l,r,o){this._map._requestDomTask(()=>{const h=function(f){const g=Math.pow(10,`${Math.floor(f)}`.length-1);let y=f/g;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(v){const E=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*E)/E}(y),g*y}(r),d=h/r;this._container.innerHTML=this._isNumberFormatSupported&&o!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:o}).format(h):`${h}&nbsp;${yl[o]}`,this._container.style.width=l*d+"px"})}onAdd(l){return this._map=l,this._language=l.getLanguage(),this._container=ht("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(l){this._language=l,this._update()}setUnit(l){this.options.unit=l,this._update()}},FullscreenControl:class{constructor(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof a.window.HTMLElement?this._container=l.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in a.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=ht("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,a.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!a.window.document.fullscreenEnabled&&!a.window.document.webkitFullscreenEnabled)}_setupUI(){const l=this._fullscreenButton=ht("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ht("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden","true"),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",l)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(a.window.document.fullscreenElement||a.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?a.window.document.exitFullscreen?a.window.document.exitFullscreen():a.window.document.webkitCancelFullScreen&&a.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends a.Evented{constructor(l){super(),this.options=a.extend(Object.create(fl),l),a.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(l&&l.className?l.className.trim().split(/\s+/):[])}addTo(l){return this._map&&this.remove(),this._map=l,this.options.closeOnClick&&l.on("preclick",this._onClose),this.options.closeOnMove&&l.on("move",this._onClose),l.on("remove",this.remove),this._update(),l._addPopup(this),this._focusFirstElement(),this._trackPointer?(l.on("mousemove",this._onMouseEvent),l.on("mouseup",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")):l.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const l=this._map;return l&&(l.off("move",this._update),l.off("move",this._onClose),l.off("preclick",this._onClose),l.off("click",this._onClose),l.off("remove",this.remove),l.off("mousemove",this._onMouseEvent),l.off("mouseup",this._onMouseEvent),l.off("drag",this._onMouseEvent),l._canvasContainer&&l._canvasContainer.classList.remove("mapboxgl-track-pointer"),l._removePopup(this),this._map=void 0),this.fire(new a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(l){this._lngLat=a.LngLat.convert(l),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const l=this._map;return l&&(l.off("move",this._update),l.on("mousemove",this._onMouseEvent),l.on("drag",this._onMouseEvent),l._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(l){return this.setDOMContent(a.window.document.createTextNode(l))}setHTML(l){const r=a.window.document.createDocumentFragment(),o=a.window.document.createElement("body");let h;for(o.innerHTML=l;h=o.firstChild,h;)r.appendChild(h);return this.setDOMContent(r)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(l){return this.options.maxWidth=l,this._update(),this}setDOMContent(l){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=ht("div","mapboxgl-popup-content",this._container||void 0);
vendor: 3,736 bytes, line 1318
1318if(r.appendChild(l),this.options.closeButton){const o=this._closeButton=ht("button","mapboxgl-popup-close-button",r);o.type="button",o.setAttribute("aria-label","Close popup"),o.setAttribute("aria-hidden","true"),o.innerHTML="&#215;",o.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(l){return this._classList.add(l),this._updateClassList(),this}removeClassName(l){return this._classList.delete(l),this._updateClassList(),this}setOffset(l){return this.options.offset=l,this._update(),this}toggleClassName(l){let r;return this._classList.delete(l)?r=!1:(this._classList.add(l),r=!0),this._updateClassList(),r}_onMouseEvent(l){this._update(l.point)}_getAnchor(l){if(this.options.anchor)return this.options.anchor;const r=this._map,o=this._container,h=this._pos;if(!r||!o||!h)return"bottom";const d=o.offsetWidth,f=o.offsetHeight,g=h.x<d/2,y=h.x>r.transform.width-d/2;if(h.y+l<f)return g?"top-left":y?"top-right":"top";if(h.y>r.transform.height-f){if(g)return"bottom-left";if(y)return"bottom-right"}return g?"left":y?"right":"bottom"}_updateClassList(){const l=this._container;if(!l)return;const r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),l.className=r.join(" ")}_update(l){const r=this._map,o=this._content;if(!r||!this._lngLat&&!this._trackPointer||!o)return;let h=this._container;if(h||(h=this._container=ht("div","mapboxgl-popup",r.getContainer()),this._tip=ht("div","mapboxgl-popup-tip",h),h.appendChild(o)),this.options.maxWidth&&h.style.maxWidth!==this.options.maxWidth&&(h.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ao(this._lngLat,this._pos,r.transform)),!this._trackPointer||l){const d=this._pos=this._trackPointer&&l?l:r.project(this._lngLat),f=Uc(this.options.offset),g=this._anchor=this._getAnchor(f.y),y=Uc(this.options.offset,g),v=d.add(y).round();r._requestDomTask(()=>{this._container&&g&&(this._container.style.transform=`${En[g]} translate(${v.x}px,${v.y}px)`)})}if(!this._marker&&r._showingGlobe()){const d=a.isLngLatBehindGlobe(r.transform,this._lngLat)?0:1;this._setOpacity(d)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const l=this._container.querySelector(Wh);l&&l.focus()}_onClose(){this.remove()}_setOpacity(l){this._container&&(this._container.style.opacity=`${l}`),this._content&&(this._content.style.pointerEvents=l?"auto":"none")}},Marker:Be,Style:hr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.Point,MercatorCoordinate:a.MercatorCoordinate,FreeCameraOptions:Ec,Evented:a.Evented,config:a.config,prewarm:function(){$n().acquire(ar)},clearPrewarmedResources:function(){const l=Ti;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(ar),Ti=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()"))},get accessToken(){return a.config.ACCESS_TOKEN},set accessToken(l){a.config.ACCESS_TOKEN=l},get baseApiUrl(){return a.config.API_URL},set baseApiUrl(l){a.config.API_URL=l},get workerCount(){return li.workerCount},set workerCount(l){li.workerCount=l},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){a.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage(l){a.clearTileCache(l)},workerUrl:"",workerClass:null,setNow:a.exported.setNow,restoreNow:a.exported.restoreNow};return lo});var Uf=ms;return Uf})})(Of);var _g=Of.exports;const yg=mg(_g);export{mg as a,fg as c,gg as g,yg as m};

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.